コード例 #1
0
ファイル: TextRender.cs プロジェクト: fanchuanster/ClipArt
        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);
        }
コード例 #2
0
ファイル: Text.cs プロジェクト: fanchuanster/ClipArt
            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));
            }
コード例 #3
0
ファイル: TextRender.cs プロジェクト: fanchuanster/ClipArt
        // 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));
        }
コード例 #4
0
ファイル: TextRender.cs プロジェクト: fanchuanster/ClipArt
 static public GeometryGroup BuildTextGeometry(TextShape shape)
 {
     return(BuildGlyphRun(shape, 0, 0));
 }