static GeometryGroup BuildTextSpan(TextShape shape) { double x = shape.X; double y = shape.Y; GeometryGroup gp = new GeometryGroup(); BuildTextSpan(gp, shape.TextStyle, shape.TextSpan, ref x, ref y); return(gp); }
public static Element Parse(string text, TextShape owner) { int curpos = 0; Element root = new Element(owner, Element.eElementType.Tag, null); root.Text = "<root>"; root.StartIndex = 0; return(Parse(text, ref curpos, null, root)); }
// Use GlyphRun to build the text. This allows us to define letter and word spacing // http://books.google.com/books?id=558i6t1dKEAC&pg=PA485&source=gbs_toc_r&cad=4#v=onepage&q&f=false static GeometryGroup BuildGlyphRun(TextShape shape, double xoffset, double yoffset) { GeometryGroup gp = new GeometryGroup(); double totalwidth = 0; if (shape.TextSpan == null) { string txt = shape.Text; gp.Children.Add(BuildGlyphRun(shape.TextStyle, txt, shape.X, shape.Y, ref totalwidth)); return(gp); } return(BuildTextSpan(shape)); }
static public GeometryGroup BuildTextGeometry(TextShape shape) { return(BuildGlyphRun(shape, 0, 0)); }