Exemplo n.º 1
0
            private void _Traverse(AtopBox ab)
            {
                EWPF.Fixup(ab.Top, _traverseType);
                EWPF.Fixup(ab.Bot, _traverseType);

                Leaf();
            }
Exemplo n.º 2
0
        static public Box Measure(Expr e, double fsize, DrawingContext dc)
        {
            Box b = new EWPF(false).Compose(e);

            b.Measure(new EDrawingContext(fsize, dc, Colors.Black));
            return(b);
        }
Exemplo n.º 3
0
            private void _Traverse(RootBox rb)
            {
                EWPF.Fixup(rb.Index, _traverseType);
                EWPF.Fixup(rb.Radicand, _traverseType);

                Leaf();
            }
Exemplo n.º 4
0
            private void _Traverse(AlignmentBox ab)
            {
                foreach (Box b in ab.Boxes)
                {
                    EWPF.Fixup(b, _traverseType);
                }

                Leaf();
            }
Exemplo n.º 5
0
            private void _Traverse(VBox vb)
            {
                foreach (Box b in vb.Boxes)
                {
                    EWPF.Fixup(b, _traverseType);
                }

                Leaf();
            }
Exemplo n.º 6
0
        static public Geometry ComputeGeometry(Expr e, double fsize, out Rct nombbox)
        {
            EDrawingContext edc = new EDrawingContext(fsize, null, Colors.Black);
            EWPF            us  = new EWPF(false);
            Box             b   = us.Compose(e);

            b.Measure(edc);
            nombbox = b.nombbox;
            return(b.ComputeGeometry(edc));
        }
Exemplo n.º 7
0
            private void _Traverse(AtomBox ab)
            {
                EWPF.Fixup(ab.Sub, _traverseType);
                if (!(ab.Nucleus is CharBox || ab.Nucleus is StringBox))
                {
                    EWPF.Fixup(ab.Nucleus, _traverseType);
                }
                EWPF.Fixup(ab.Sup, _traverseType);

                Leaf();
            }
Exemplo n.º 8
0
        /// <summary>
        /// Note that the y component of the point where returns is the math axis, midway between the baseline and the x-height.
        /// </summary>
        /// <param name="fsize">Em-height of font to use. (This is essentially the font size.)</param>
        /// <param name="where">Note that the y component of the point this returns is the math axis, midway between the baseline and the x-height.</param>
        /// <param name="showinvisibles">Whether to draw parentheses indicating function application slightly darker</param>
        /// <returns>nominal bounding box of resulting typeset as drawn</returns>
        // TJC:
        static public BoxRct Draw(Expr e, double fsize, DrawingContext dc, Color color, Func <Rct, EDrawingContext, Pt> where, bool showinvisibles)
        {
            EDrawingContext edc = new EDrawingContext(fsize, dc, color);
            EWPF            us  = new EWPF(showinvisibles);

            edc.Brush.Opacity = Opacity; // TJC: support opacity change
            Box b = us.Compose(e);

            b.Measure(edc);
            Pt loc = where (b.nombbox, edc);

            b.Draw(edc, loc);
            // TJC:
            return(new BoxRct(b, b.nombbox + (Vec)loc));
        }