Exemple #1
0
		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;
		}
Exemple #2
0
            public static Element Parse(SVG svg, string text, TextShape owner)
            {
                int     curpos = 0;
                Element root   = new Element(svg, owner, Element.eElementType.Tag, null);

                root.Text       = "<root>";
                root.StartIndex = 0;
                return(Parse(svg, text, ref curpos, null, root));
            }
Exemple #3
0
		// 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);
		}
Exemple #4
0
 public static Element Parse(SVG svg, string text, TextShape owner)
 {
     int curpos = 0;
     Element root = new Element(svg, owner, Element.eElementType.Tag, null);
     root.Text = "<root>";
     root.StartIndex = 0;
     return Parse(svg, text, ref curpos, null, root);
 }
Exemple #5
0
 static public GeometryGroup BuildTextGeometry(TextShape shape)
 {
     return(BuildGlyphRun(shape, 0, 0));
 }