Пример #1
0
        public override Bounds2D GetBounds(Enum24 whiteSpaceHandling, Class985 resultLayoutInfo)
        {
            Bounds2D bounds = base.GetBounds(whiteSpaceHandling, resultLayoutInfo);

            bounds.Update((Point2D)this.Offset);
            return(bounds);
        }
Пример #2
0
        public Bounds2D GetBounds(Enum24 whiteSpaceHandling, Class985 resultLayoutInfo)
        {
            Bounds2D bounds = this.Settings.Font.Metrics.GetBounds(this.Text, whiteSpaceHandling);

            if (resultLayoutInfo != null)
            {
                double y = bounds.Min.Y;
                if (y < 0.0)
                {
                    if ((resultLayoutInfo.BoundsCalculationFlags & Enum36.flag_1) != Enum36.flag_0)
                    {
                        bounds.Min = new Point2D(bounds.Min.X, 0.0);
                    }
                    if (y < resultLayoutInfo.TextBlockDescent)
                    {
                        resultLayoutInfo.TextBlockDescent = y;
                    }
                }
            }
            if (bounds.Max.Y > this.class596_0.Height)
            {
                bounds.Max = new Point2D(bounds.Max.X, this.class596_0.Height);
            }
            bounds.Move(this.vector2D_0.X, this.vector2D_0.Y);
            return(bounds);
        }
Пример #3
0
        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);
        }
Пример #4
0
        protected override Bounds2D GetBounds(string text, Matrix2D transformation, Enum24 wsh)
        {
            Bounds2D bounds2D = new Bounds2D();

            using (GraphicsPath graphicsPath = this.method_1(text))
            {
                if (graphicsPath.PointCount > 1)
                {
                    RectangleF bounds = graphicsPath.GetBounds((transformation * Transformation2D.Scaling(this.CanonicalScaling)).ToMatrix());
                    bounds2D.Update(new Point2D((double)bounds.Left, (double)bounds.Bottom));
                    bounds2D.Update(new Point2D((double)bounds.Right, (double)bounds.Top));
                }
            }
            if (text.Length > 0)
            {
                if ((wsh & Enum24.flag_1) != Enum24.flag_0 && char.IsWhiteSpace(text[0]))
                {
                    bounds2D.Update(0.0, 0.0);
                }
                if ((wsh & Enum24.flag_2) != Enum24.flag_0 && char.IsWhiteSpace(text[text.Length - 1]))
                {
                    Vector2D vector2D = this.imethod_0(text, (IList <Vector2D>)null);
                    bounds2D.Update(vector2D.X, vector2D.Y);
                }
            }
            return(bounds2D);
        }
Пример #5
0
        public override void imethod_0(
            ref Vector2D baselinePos,
            double height,
            Enum24 whiteSpaceHandlingFlags)
        {
            base.imethod_0(ref baselinePos, height, whiteSpaceHandlingFlags);
            Vector2D vector2D = Vector2D.Zero;
            double   val1_1;
            double   val1_2;

            if (this.Blocks.Count > 0)
            {
                val1_1 = 0.0;
                val1_2 = 0.0;
                foreach (Interface24 block in this.Blocks)
                {
                    Class596 settings = block.Settings;
                    val1_1 = System.Math.Max(val1_1, settings.Font.Metrics.Ascent);
                    val1_2 = System.Math.Max(val1_2, settings.Font.Metrics.Descent);
                    Vector2D lineFeedAdvance = settings.Font.Metrics.LineFeedAdvance;
                    if (System.Math.Abs(lineFeedAdvance.X) > System.Math.Abs(vector2D.X))
                    {
                        vector2D.X = lineFeedAdvance.X;
                    }
                    if (System.Math.Abs(lineFeedAdvance.Y) > System.Math.Abs(vector2D.Y))
                    {
                        vector2D.Y = lineFeedAdvance.Y;
                    }
                }
            }
            else
            {
                val1_1   = this.Settings.Font.Metrics.Ascent;
                val1_2   = this.Settings.Font.Metrics.Descent;
                vector2D = this.Settings.Font.Metrics.LineFeedAdvance;
            }
            if (this.lineSpacingStyle_0 == LineSpacingStyle.AtLeast)
            {
                Bounds2D bounds = this.GetBounds(whiteSpaceHandlingFlags, (Class985)null);
                double   y      = val1_1 - bounds.Corner2.Y + this.Offset.Y;
                double   num    = val1_2 - this.Offset.Y + bounds.Corner1.Y;
                if (y < 0.0)
                {
                    Class427 class427 = this;
                    class427.Offset = class427.Offset + new Vector2D(0.0, y);
                }
                baselinePos = this.Offset + vector2D * this.double_0;
                if (num >= 0.0)
                {
                    return;
                }
                baselinePos.Y += num;
            }
            else
            {
                baselinePos = this.Offset + vector2D * this.double_0;
            }
        }
Пример #6
0
 public override void imethod_0(
     ref Vector2D baselinePos,
     double height,
     Enum24 whiteSpaceHandlingFlags)
 {
     this.class471_0 = this.method_1(baselinePos, whiteSpaceHandlingFlags);
     baselinePos.X  += this.double_0;
     base.imethod_0(ref baselinePos, height, whiteSpaceHandlingFlags);
 }
Пример #7
0
        public virtual Bounds2D GetBounds(Enum24 whiteSpaceHandling, Class985 resultLayoutInfo)
        {
            Bounds2D bounds2D = new Bounds2D();

            foreach (Interface24 nterface24 in this.linkedList_0)
            {
                bounds2D.Update(nterface24.GetBounds(whiteSpaceHandling, resultLayoutInfo));
            }
            return(bounds2D);
        }
Пример #8
0
 public virtual void imethod_0(
     ref Vector2D baselinePos,
     double height,
     Enum24 whiteSpaceHandlingFlags)
 {
     this.vector2D_0 = baselinePos;
     foreach (Interface24 nterface24 in this.linkedList_0)
     {
         nterface24.imethod_0(ref baselinePos, height, whiteSpaceHandlingFlags);
     }
 }
Пример #9
0
        private Class471 method_1(Vector2D baselinePos, Enum24 whiteSpaceHandlingFlags)
        {
            this.double_0 = 0.0;
            double x = baselinePos.X;

            Class471[] tabulators = this.class1024_0.Tabulators;
            try
            {
                Bounds2D bounds = this.GetBounds(Enum24.flag_0, (Class985)null);
                int      index  = 0;
                double   num1   = 1E-06 * this.Settings.Height;
                while ((index < tabulators.Length ? tabulators[index].Position : (double)(index + 1) * this.double_1) <= x + num1)
                {
                    ++index;
                }
                Class471 class471 = index < tabulators.Length ? tabulators[index] : new Class471((double)(index + 1) * this.double_1);
                switch (class471.Type)
                {
                case Class471.Enum13.const_3:
                    Vector2D?nullable = this.imethod_2(class471.DecimalPointChar, whiteSpaceHandlingFlags);
                    this.double_0 = nullable.HasValue ? class471.Position - nullable.Value.X - x : class471.Position - x;
                    break;

                case Class471.Enum13.const_1:
                    double num2 = bounds.Initialized ? bounds.Center.X : 0.0;
                    this.double_0 = class471.Position - x - num2;
                    break;

                case Class471.Enum13.const_2:
                    double num3 = bounds.Initialized ? bounds.Corner2.X : 0.0;
                    this.double_0 = class471.Position - x - num3;
                    break;

                case Class471.Enum13.const_0:
                    this.double_0 = class471.Position - x;
                    break;

                default:
                    this.double_0 = 0.0;
                    break;
                }
                if (this.double_0 < 0.0)
                {
                    this.double_0 = 0.0;
                }
                return(class471);
            }
            catch (IndexOutOfRangeException ex)
            {
            }
            return((Class471)null);
        }
Пример #10
0
        public Bounds2D GetBounds(Enum24 whiteSpaceHandling, Class985 resultLayoutInfo)
        {
            Bounds2D bounds2D = new Bounds2D();
            bool     flag     = true;

            foreach (Class425 class425 in this.linkedList_0)
            {
                Bounds2D bounds = class425.GetBounds(whiteSpaceHandling, resultLayoutInfo);
                if ((whiteSpaceHandling & Enum24.flag_1) != Enum24.flag_0)
                {
                    if (this.class1024_0.ParagraphWidth != 0.0)
                    {
                        bounds.Min = new Point2D(this.vector2D_0.X, bounds.Min.Y);
                    }
                    else
                    {
                        double leftIndent = this.class1024_0.LeftIndent;
                        if (flag)
                        {
                            flag        = false;
                            leftIndent += this.class1024_0.LeftIndentFirst;
                        }
                        bounds.Min -= new Vector2D(leftIndent, 0.0);
                        if (bounds.Min.X > bounds.Max.X)
                        {
                            bounds.Max = new Point2D(bounds.Min.X, bounds.Max.Y);
                        }
                    }
                }
                if ((whiteSpaceHandling & Enum24.flag_2) != Enum24.flag_0 && this.class1024_0.ParagraphWidth != 0.0)
                {
                    bounds.Max = new Point2D(this.vector2D_0.X + this.class1024_0.ParagraphWidth, bounds.Max.Y);
                }
                if (resultLayoutInfo != null)
                {
                    if (resultLayoutInfo.FirstLineBounds == null)
                    {
                        resultLayoutInfo.FirstLineBounds  = bounds;
                        resultLayoutInfo.FirstLineDescent = resultLayoutInfo.TextBlockDescent;
                    }
                    resultLayoutInfo.LastLineBounds   = bounds;
                    resultLayoutInfo.LastLineDescent  = resultLayoutInfo.TextBlockDescent;
                    resultLayoutInfo.TextBlockDescent = 0.0;
                }
                bounds2D.Update(bounds);
            }
            if ((whiteSpaceHandling & Enum24.flag_2) != Enum24.flag_0)
            {
                bounds2D.Update(bounds2D.Max + new Vector2D(this.class1024_0.RightIndent, 0.0));
            }
            return(bounds2D);
        }
Пример #11
0
 internal static IList <Class908> smethod_0(
     string text,
     double height,
     DxfTextStyle style,
     double widthFactor,
     Color color,
     short lineWeight,
     Matrix4D insertionTransformation,
     Class985 resultLayoutInfo,
     Enum24 whiteSpaceHandlingFlags)
 {
     return(Class666.smethod_1(text, 0.0, height, AttachmentPoint.MiddleLeft, 1.0, LineSpacingStyle.Exact, style, widthFactor, color, DrawingDirection.LeftToRight, lineWeight, insertionTransformation, resultLayoutInfo, whiteSpaceHandlingFlags));
 }
Пример #12
0
        public Vector2D?imethod_2(char ch, Enum24 whiteSpaceHandlingFlags)
        {
            int length = this.Text.IndexOf(ch);

            if (length < 0)
            {
                return(new Vector2D?());
            }
            Class470 class470 = new Class470(this.Text.Substring(0, length), this.Settings);

            class470.Offset = this.Offset;
            Vector2D baselinePos = new Vector2D();

            class470.imethod_0(ref baselinePos, this.Settings.Height, whiteSpaceHandlingFlags);
            return(new Vector2D?(baselinePos));
        }
Пример #13
0
        public override Bounds2D GetBounds(Enum24 whiteSpaceHandling, Class985 resultLayoutInfo)
        {
            Bounds2D bounds = base.GetBounds(whiteSpaceHandling, resultLayoutInfo);

            if (!bounds.Initialized)
            {
                bounds.Update(this.Offset.X, this.Offset.Y);
                bounds.Update(this.Offset.X, this.Offset.Y + this.Settings.Height);
            }
            else
            {
                bounds.Update(bounds.Min.X, this.Offset.Y);
                bounds.Update(bounds.Min.X, this.Offset.Y + this.Settings.Height);
            }
            return(bounds);
        }
Пример #14
0
        public virtual Vector2D?imethod_2(char ch, Enum24 whiteSpaceHandlingFlags)
        {
            Vector2D?nullable = new Vector2D?();

            if (!this.bool_0)
            {
                foreach (Interface24 nterface24 in this.linkedList_0)
                {
                    nullable = nterface24.imethod_2(ch, whiteSpaceHandlingFlags);
                    if (nullable.HasValue)
                    {
                        break;
                    }
                }
            }
            return(nullable);
        }
Пример #15
0
 public Vector2D?imethod_2(char ch, Enum24 whiteSpaceHandlingFlags)
 {
     return(new Vector2D?());
 }
Пример #16
0
        public void imethod_0(ref Vector2D baselinePos, double height, Enum24 whiteSpaceHandlingFlags)
        {
            LinkedList <Class427> linkedList = new LinkedList <Class427>();

            this.vector2D_0 = baselinePos;
            baselinePos    += new Vector2D(0.0, -this.class1024_0.BeforeSpace);
            double paragraphWidth = this.class1024_0.ParagraphWidth;
            bool   flag1;
            double width = (flag1 = paragraphWidth > 0.0) ? paragraphWidth - this.class1024_0.RightIndent + this.vector2D_0.X : 0.0;
            bool   flag2 = true;

            using (LinkedList <Class427> .Enumerator enumerator = this.linkedList_0.GetEnumerator())
            {
label_13:
                if (enumerator.MoveNext())
                {
                    Class427 class427_1 = enumerator.Current;
                    do
                    {
                        double x = this.vector2D_0.X + this.class1024_0.LeftIndent;
                        if (flag2)
                        {
                            goto label_11;
                        }
label_3:
                        Vector2D baselinePos1 = new Vector2D(x, baselinePos.Y);
                        Vector2D vector2D = baselinePos1;
                        class427_1.imethod_0(ref baselinePos1, height, whiteSpaceHandlingFlags);
                        Bounds2D bounds = class427_1.GetBounds(whiteSpaceHandlingFlags, (Class985)null);
                        if (flag1 && bounds.Delta.X > width - x)
                        {
                            Interface24[] nterface24Array = class427_1.imethod_1(width, this.TextBreaker);
                            switch (nterface24Array.Length)
                            {
                            case 0:
                                linkedList.AddLast(class427_1);
                                class427_1 = (Class427)null;
                                break;

                            case 1:
                                linkedList.AddLast(class427_1);
                                class427_1 = (Class427)null;
                                break;

                            case 2:
                                baselinePos1 = vector2D;
                                Class427 class427_2 = (Class427)nterface24Array[0];
                                class427_2.imethod_0(ref baselinePos1, height, whiteSpaceHandlingFlags);
                                linkedList.AddLast(class427_2);
                                class427_1 = (Class427)nterface24Array[1];
                                break;

                            default:
                                linkedList.AddLast(class427_1);
                                class427_1 = (Class427)null;
                                break;
                            }
                        }
                        else
                        {
                            linkedList.AddLast(class427_1);
                            class427_1 = (Class427)null;
                        }
                        baselinePos += baselinePos1 - vector2D;
                        continue;
label_11:
                        flag2 = false;
                        x    += this.class1024_0.LeftIndentFirst;
                        goto label_3;
                    }while (class427_1 != null);
                    goto label_13;
                }
            }
            if (linkedList.Count > this.linkedList_0.Count)
            {
                this.linkedList_0 = linkedList;
            }
            bool flag3 = true;

            foreach (Class427 class427 in this.linkedList_0)
            {
                double num = this.vector2D_0.X + this.class1024_0.LeftIndent;
                if (flag3)
                {
                    flag3 = false;
                    num  += this.class1024_0.LeftIndentFirst;
                }
                Bounds2D bounds = class427.GetBounds(Enum24.flag_1, (Class985)null);
                switch (this.class1024_0.Alignment)
                {
                case Class1023.Enum45.const_0:
                    class427.method_1(0.5 * (width + num) - bounds.Center.X);
                    continue;

                case Class1023.Enum45.const_1:
                    class427.method_1(num - bounds.Corner1.X);
                    continue;

                case Class1023.Enum45.const_2:
                    class427.method_1(width - bounds.Corner2.X);
                    continue;

                default:
                    continue;
                }
            }
            baselinePos += new Vector2D(0.0, -this.class1024_0.AfterSpace);
        }
Пример #17
0
 protected abstract Bounds2D GetBounds(string text, Matrix2D transformation, Enum24 wsh);
Пример #18
0
 public Bounds2D GetBounds(string text, Enum24 whiteSpaceHandling)
 {
     return(this.GetBounds(text, this.matrix2D_0, whiteSpaceHandling));
 }
Пример #19
0
 // Token: 0x06002AC6 RID: 10950 RVA: 0x00013F26 File Offset: 0x00012126
 protected override void vmethod_2(BinaryReader reader, int version)
 {
     this.ScreenshotScaling = (Enum24)reader.ReadByte();
 }
Пример #20
0
 // Token: 0x06002AC4 RID: 10948 RVA: 0x00013F17 File Offset: 0x00012117
 public Class111()
 {
     this.ScreenshotScaling = Enum24.const_2;
 }
Пример #21
0
 public void imethod_0(ref Vector2D baselinePos, double height, Enum24 whiteSpaceHandlingFlags)
 {
     this.Offset  = baselinePos;
     baselinePos += this.Advance;
 }
Пример #22
0
        internal static IList <Class908> smethod_1(
            string text,
            double width,
            double height,
            AttachmentPoint attachmentPoint,
            double lineSpacingFactor,
            LineSpacingStyle lineSpacingStyle,
            DxfTextStyle style,
            double widthFactor,
            Color color,
            DrawingDirection drawingDirection,
            short lineWeight,
            Matrix4D insertionTransformation,
            Class985 resultLayoutInfo,
            Enum24 whiteSpaceHandlingFlags)
        {
            Class1023[]      class1023Array = Class594.smethod_12(text, width, height, attachmentPoint, lineSpacingFactor, lineSpacingStyle, style, widthFactor, color, drawingDirection);
            Vector2D         zero           = Vector2D.Zero;
            IList <Class908> class908List   = (IList <Class908>) new List <Class908>();
            Bounds2D         bounds         = new Bounds2D();

            foreach (Class1023 class1023 in class1023Array)
            {
                class1023.imethod_0(ref zero, class1023.Settings.Height, whiteSpaceHandlingFlags);
                bounds.Update(class1023.GetBounds(whiteSpaceHandlingFlags, resultLayoutInfo));
            }
            double num1 = 0.0;
            double num2 = 0.0;

            if (bounds.Initialized)
            {
                switch (attachmentPoint)
                {
                case AttachmentPoint.TopLeft:
                    num1 = -bounds.Corner1.X;
                    num2 = -bounds.Corner2.Y;
                    break;

                case AttachmentPoint.TopCenter:
                    num1 = -bounds.Center.X;
                    num2 = -bounds.Corner2.Y;
                    break;

                case AttachmentPoint.TopRight:
                    num1 = -bounds.Corner2.X;
                    num2 = -bounds.Corner2.Y;
                    break;

                case AttachmentPoint.MiddleLeft:
                    num1 = -bounds.Corner1.X;
                    num2 = -bounds.Center.Y;
                    break;

                case AttachmentPoint.MiddleCenter:
                    num1 = -bounds.Center.X;
                    num2 = -bounds.Center.Y;
                    break;

                case AttachmentPoint.MiddleRight:
                    num1 = -bounds.Corner2.X;
                    num2 = -bounds.Center.Y;
                    break;

                case AttachmentPoint.BottomLeft:
                    num1 = -bounds.Corner1.X;
                    num2 = -bounds.Corner1.Y;
                    break;

                case AttachmentPoint.BottomCenter:
                    num1 = -bounds.Center.X;
                    num2 = -bounds.Corner1.Y;
                    break;

                case AttachmentPoint.BottomRight:
                    num1 = -bounds.Corner2.X;
                    num2 = -bounds.Corner1.Y;
                    break;
                }
            }
            if (width == 0.0)
            {
                num1 = 0.0;
            }
            Vector2D vector2D = new Vector2D(num1, num2);

            foreach (Class1023 class1023 in class1023Array)
            {
                class1023.Offset += vector2D;
                class1023.imethod_3((ICollection <Class908>)class908List, insertionTransformation, lineWeight);
            }
            if (resultLayoutInfo != null)
            {
                bounds.Move(num1, num2);
                resultLayoutInfo.Bounds.Update(bounds);
                if (resultLayoutInfo.FirstLineBounds != null)
                {
                    resultLayoutInfo.FirstLineBounds.Move(num1, num2);
                }
                if (resultLayoutInfo.LastLineBounds != null && resultLayoutInfo.LastLineBounds != resultLayoutInfo.FirstLineBounds)
                {
                    resultLayoutInfo.LastLineBounds.Move(num1, num2);
                }
            }
            return(class908List);
        }