internal Interface35 GetGlyph(char c, bool vertical, char fallback) { int key = vertical ? (int)-c : (int)c; lock (this.dictionary_0) { Interface35 nterface35; this.dictionary_0.TryGetValue(key, out nterface35); if (nterface35 == null) { ShxShape shxShape = this.shxFile_0.GetShape(c) ?? this.shxFile_0.GetShape(fallback); if (shxShape == null) { nterface35 = (Interface35) new Class866(c); } else { WW.Math.Point2D endPoint; GeneralShape2D generalShape2D = new GeneralShape2D(shxShape.GetGlyphShape(vertical, out endPoint), this.matrix2D_0, true); double m00 = this.matrix2D_0.M00; endPoint.X *= m00; endPoint.Y *= -m00; nterface35 = (Interface35) new Class866(c, (IShape2D)generalShape2D, new Vector2D(endPoint.X, endPoint.Y), false); } this.dictionary_0.Add(key, nterface35); } return(nterface35); } }
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); } }
public Class521(ShxFile font, ShxShape shape, GraphicsConfig graphicsConfig) { this.int_0 = font.Above; Point2D endPoint; IShape2D glyphShape = shape.GetGlyphShape(false, out endPoint); this.vector2D_0 = (Vector2D)endPoint; this.ilist_0 = (IList <Polyline2D>)ShapeTool.GetFlattened(glyphShape, graphicsConfig.ShapeFlattenEpsilon); foreach (List <Point2D> point2DList in (IEnumerable <Polyline2D>) this.ilist_0) { foreach (Point2D p in point2DList) { this.bounds2D_0.Update(p); } } }
public static Class521 GetPolylines( ShxFile font, char character, GraphicsConfig config) { Class805 key = new Class805(font, character); Class521 class521; if (Class521.dictionary_0.TryGetValue(key, out class521)) { return(class521); } ShxShape shape = font.GetShape(character); if (shape != null) { class521 = new Class521(font, shape, config); Class521.dictionary_0.Add(key, class521); } return(class521); }
internal override void Read() { ushort num1 = this.binaryReader_0.ReadUInt16(); ushort num2 = this.binaryReader_0.ReadUInt16(); Class5.Struct17[] struct17Array = new Class5.Struct17[(int)num2]; for (int index = 0; index < (int)num2; ++index) { ushort start = this.binaryReader_0.ReadUInt16(); ushort end = this.binaryReader_0.ReadUInt16(); struct17Array[index] = new Class5.Struct17(start, end); } Dictionary <long, Class5.Class1059> dictionary = new Dictionary <long, Class5.Class1059>((int)num1); for (int index = 0; index < (int)num1; ++index) { ushort id = this.binaryReader_0.ReadUInt16(); ushort length = this.binaryReader_0.ReadUInt16(); uint fileOffset = this.binaryReader_0.ReadUInt32(); if (fileOffset != 0U) { dictionary[(long)fileOffset] = new Class5.Class1059(id, length, fileOffset); } } ushort count = (ushort)dictionary.Count; for (int index = 0; index < (int)count; ++index) { long position1 = this.binaryReader_0.BaseStream.Position; Class5.Class1059 class1059; dictionary.TryGetValue(position1, out class1059); if (class1059 == null) { throw new Exception("Corrupt shx bigfont file."); } if (class1059.ushort_0 == (ushort)0) { long position2 = this.binaryReader_0.BaseStream.Position; this.method_0(); long num3 = this.binaryReader_0.BaseStream.Position - position2; int num4 = (int)class1059.ushort_1 - (int)num3; if (num4 == 5) { this.shxFile_0.method_5((int)this.binaryReader_0.ReadByte()); int num5 = (int)this.binaryReader_0.ReadByte(); this.shxFile_0.method_4((int)this.binaryReader_0.ReadByte()); this.shxFile_0.method_6((int)this.binaryReader_0.ReadByte()); int num6 = (int)this.binaryReader_0.ReadByte(); } else { this.shxFile_0.method_2((int)this.binaryReader_0.ReadByte()); this.shxFile_0.method_3((int)this.binaryReader_0.ReadByte()); this.shxFile_0.method_4((int)this.binaryReader_0.ReadByte()); while (num4-- > 3) { int num5 = (int)this.binaryReader_0.ReadByte(); } } } else { long position2 = this.binaryReader_0.BaseStream.Position; string description = this.method_0(); long num3 = this.binaryReader_0.BaseStream.Position - position2; byte[] geometry = this.binaryReader_0.ReadBytes((int)class1059.ushort_1 - (int)num3); this.shxFile_0.method_0(new ShxShape(this.shxFile_0, class1059.ushort_0, ShxShape.smethod_16(this.encoding_0, class1059.ushort_0), description, geometry)); } } }