예제 #1
0
파일: Class754.cs 프로젝트: 15831944/WW
        public Interface34 GetText(
            string text,
            WW.Cad.Model.Color color,
            short lineWeight,
            bool vertical)
        {
            Interface35[] glyphs = new Interface35[text.Length];
            int           length = 0;

            foreach (char c in text)
            {
                Interface35 glyph = this.class755_0.GetGlyph(c, vertical, '?');
                if (glyph.IsValid)
                {
                    glyphs[length++] = glyph;
                }
            }
            if (length < glyphs.Length)
            {
                Interface35[] nterface35Array = new Interface35[length];
                Array.Copy((Array)glyphs, (Array)nterface35Array, length);
                glyphs = nterface35Array;
            }
            return((Interface34) new Class472(text, (Interface14)this, color, lineWeight, glyphs, this.class27_0.CharTransformation, this.class27_0.CharSpacingFactor));
        }
예제 #2
0
파일: Class27.cs 프로젝트: 15831944/WW
        protected override Bounds2D GetBounds(string text, Matrix2D transformation, Enum24 wsh)
        {
            Bounds2D bounds2D = new Bounds2D();
            Vector2D zero     = Vector2D.Zero;
            double   num1     = this.CharSpacingFactor * transformation.M00;
            double   m11      = transformation.M11;

            if ((wsh & Enum24.flag_1) != Enum24.flag_0)
            {
                bounds2D.Update(zero.X, zero.Y);
            }
            for (int index = 0; index < text.Length; ++index)
            {
                Interface35 glyph = this.class755_0.GetGlyph(text[index], this.IsVertical, '?');
                if (glyph.IsValid)
                {
                    Bounds2D bounds = glyph.GetBounds();
                    if (bounds.Initialized)
                    {
                        bounds2D.Update(transformation.Transform(new Point2D(bounds.Corner1.X, bounds.Corner2.Y)) + zero);
                        bounds2D.Update(transformation.Transform(new Point2D(bounds.Corner2.X, bounds.Corner1.Y)) + zero);
                    }
                    Vector2D advance = glyph.Advance;
                    double   num2    = num1 * advance.X;
                    zero.X += num2;
                    zero.Y += m11 * advance.Y;
                }
            }
            if ((wsh & Enum24.flag_2) != Enum24.flag_0)
            {
                bounds2D.Update(zero.X, zero.Y);
            }
            return(bounds2D);
        }
예제 #3
0
        public ICanonicalGlyph imethod_1(char c, bool vertical)
        {
            Interface35 wrappedGlyph = (Interface35)this.class26_0.method_2(c);

            if (!vertical)
            {
                return((ICanonicalGlyph)wrappedGlyph);
            }
            return((ICanonicalGlyph) new Class597(wrappedGlyph));
        }
예제 #4
0
파일: Class27.cs 프로젝트: 15831944/WW
        protected override Vector2D vmethod_0(string text, IList <Vector2D> characterAdvances)
        {
            Point2D zero = Point2D.Zero;

            for (int index = 0; index < text.Length; ++index)
            {
                Interface35 glyph = this.class755_0.GetGlyph(text[index], this.IsVertical, '?');
                if (glyph.IsValid)
                {
                    Vector2D advance = glyph.Advance;
                    zero.X += advance.X;
                    zero.Y += advance.Y;
                }
                characterAdvances?.Add((Vector2D)zero);
            }
            return(new Vector2D(this.CharSpacingFactor * zero.X, zero.Y));
        }
예제 #5
0
파일: Class597.cs 프로젝트: 15831944/WW
 public Class597(Interface35 wrappedGlyph)
 {
     this.interface35_0 = wrappedGlyph;
 }