示例#1
0
 internal void method_0(DxfModel model)
 {
     if ((this.elementType_0 & DxfLineType.ElementType.IsShape) != DxfLineType.ElementType.None)
     {
         if (this.TextStyle == null)
         {
             return;
         }
         ShxFile shxFile = this.TextStyle.GetShxFile();
         if (shxFile == null)
         {
             return;
         }
         ShxShape shapeByIndex = shxFile.GetShapeByIndex((ushort)this.short_0);
         if (shapeByIndex == null)
         {
             return;
         }
         WW.Math.Point2D endPoint;
         this.fillableShape2D_0 = new FillableShape2D(shapeByIndex.GetGlyphShape(this.TextStyle.IsVertical, out endPoint), false);
     }
     else
     {
         if ((this.elementType_0 & DxfLineType.ElementType.IsText) == DxfLineType.ElementType.None || this.TextStyle == null)
         {
             return;
         }
         Class425        class425     = Class594.smethod_10(this.string_0, 1.0, this.TextStyle.ObliqueAngle, this.TextStyle.WidthFactor, this.TextStyle, Colors.White);
         List <Class908> class908List = new List <Class908>();
         class425.imethod_3((ICollection <Class908>)class908List, Matrix4D.Identity, (short)0);
         GeneralShape2D generalShape2D = new GeneralShape2D();
         bool           filled         = false;
         foreach (Class908 class908 in class908List)
         {
             generalShape2D.Append(class908.FontPath, false);
             if (class908.Font.Filled)
             {
                 filled = true;
             }
         }
         if (!generalShape2D.HasSegments)
         {
             return;
         }
         generalShape2D.ShrinkWrap();
         this.fillableShape2D_0 = new FillableShape2D((IShape2D) new CachedBoundsShape2D((IShape2D)generalShape2D), filled);
     }
 }
示例#2
0
        private static IShape2D smethod_11(Stream stream, byte[] buffer)
        {
            GeneralShape2D generalShape2D = new GeneralShape2D();
            int            num;

            while (true)
            {
                num = stream.ReadByte();
                if (num >= 0)
                {
                    WoutWareFont.Enum11 enum11 = (WoutWareFont.Enum11)num;
                    if ((uint)enum11 <= 46U)
                    {
                        if (enum11 != WoutWareFont.Enum11.const_5)
                        {
                            if (enum11 == WoutWareFont.Enum11.const_4)
                            {
                                generalShape2D.Close();
                            }
                            else
                            {
                                goto label_15;
                            }
                        }
                        else
                        {
                            goto label_12;
                        }
                    }
                    else
                    {
                        switch (enum11)
                        {
                        case WoutWareFont.Enum11.const_3:
                            Point2D p1_1 = WoutWareFont.smethod_9(stream, buffer);
                            Point2D p2_1 = WoutWareFont.smethod_9(stream, buffer);
                            Point2D p3   = WoutWareFont.smethod_9(stream, buffer);
                            generalShape2D.CubicTo(p1_1, p2_1, p3);
                            continue;

                        case WoutWareFont.Enum11.const_1:
                            Point2D p1 = WoutWareFont.smethod_9(stream, buffer);
                            generalShape2D.LineTo(p1);
                            continue;

                        case WoutWareFont.Enum11.const_0:
                            Point2D p2 = WoutWareFont.smethod_9(stream, buffer);
                            generalShape2D.MoveTo(p2);
                            continue;

                        case WoutWareFont.Enum11.const_2:
                            Point2D p1_2 = WoutWareFont.smethod_9(stream, buffer);
                            Point2D p2_2 = WoutWareFont.smethod_9(stream, buffer);
                            generalShape2D.QuadTo(p1_2, p2_2);
                            continue;

                        default:
                            goto label_15;
                        }
                    }
                }
                else
                {
                    break;
                }
            }
            throw new IOException("Unexpected end of input!");
label_12:
            if (generalShape2D.HasSegments)
            {
                generalShape2D.ShrinkWrap();
            }
            else
            {
                generalShape2D = (GeneralShape2D)null;
            }
            return((IShape2D)generalShape2D);

label_15:
            throw new IOException("Invalid path operator " + (object)num);
        }