private void _Traverse(AtopBox ab) { EWPF.Fixup(ab.Top, _traverseType); EWPF.Fixup(ab.Bot, _traverseType); Leaf(); }
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); }
private void _Traverse(RootBox rb) { EWPF.Fixup(rb.Index, _traverseType); EWPF.Fixup(rb.Radicand, _traverseType); Leaf(); }
private void _Traverse(AlignmentBox ab) { foreach (Box b in ab.Boxes) { EWPF.Fixup(b, _traverseType); } Leaf(); }
private void _Traverse(VBox vb) { foreach (Box b in vb.Boxes) { EWPF.Fixup(b, _traverseType); } Leaf(); }
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)); }
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(); }
/// <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)); }