Пример #1
0
        private ShxFile(string filename, byte[] data)
        {
            this.string_1     = filename;
            this.dictionary_3 = new Dictionary <ushort, ShxShape>();
            this.dictionary_4 = new Dictionary <char, ShxShape>();
            using (Stream input = data == null ? (Stream)File.OpenRead(filename) : (Stream) new MemoryStream(data))
            {
                using (this.binaryReader_0 = new BinaryReader(input))
                {
                    this.shxFormat_0 = this.method_9();
                    Class2 class2;
                    switch (this.shxFormat_0)
                    {
                    case ShxFormat.shx1_0:
                        CharRemapDelegate charRemapper1;
                        ShxFile.dictionary_2.TryGetValue(ShxFile.smethod_4(filename), out charRemapper1);
                        class2 = new Class2(this.binaryReader_0, ShxFile.smethod_1(filename, DrawingCodePage.Dos437), charRemapper1, this);
                        break;

                    case ShxFormat.shx1_1:
                        CharRemapDelegate charRemapper2;
                        ShxFile.dictionary_2.TryGetValue(ShxFile.smethod_4(filename), out charRemapper2);
                        class2 = new Class2(this.binaryReader_0, ShxFile.smethod_1(filename, DrawingCodePage.Ansi1252), charRemapper2, this);
                        break;

                    case ShxFormat.shxBigFont1_0:
                        this.encoding_0 = ShxFile.smethod_0(filename);
                        if (this.encoding_0 == null)
                        {
                            throw new ShxFile.ShxUnknownEncodingException("Encoding of bigfont SHX file " + filename + " is unknown!");
                        }
                        class2 = (Class2) new Class5(this.binaryReader_0, this.encoding_0, this);
                        break;

                    case ShxFormat.shxUnicode1_0:
                        class2 = (Class2) new Class3(this.binaryReader_0, Encoding.UTF8, this);
                        break;

                    default:
                        throw new InternalException("Unknown SHX file format!");
                    }
                    class2.Read();
                }
            }
            if (this.int_3 == 0)
            {
                this.int_3 = this.int_1 + this.int_0;
            }
            ShxShape shape = this.GetShape('\n');

            if (shape == null)
            {
                return;
            }
            WW.Math.Point2D endPoint;
            shape.GetGlyphShape(false, out endPoint);
            this.double_1 = endPoint.Y;
            shape.GetGlyphShape(true, out endPoint);
            this.double_0 = endPoint.X;
        }
Пример #2
0
        public override void DrawInternal(
            DrawContext.Surface context,
            ISurfaceGraphicsFactory graphicsFactory)
        {
            DxfTextStyle textStyle = this.TextStyle;

            if (textStyle == null)
            {
                return;
            }
            ShxFile shxFile = textStyle.GetShxFile();

            if (shxFile == null)
            {
                return;
            }
            ShxShape shapeByIndex = shxFile.GetShapeByIndex(this.ushort_0);

            if (shapeByIndex == null)
            {
                return;
            }
            WW.Math.Point2D endPoint;
            new Class473((DxfEntity)this, context, graphicsFactory).DrawPath(shapeByIndex.GetGlyphShape(false, out endPoint), this.Transform, this.Color.ToColor(), context.GetLineWeight((DxfEntity)this), false, false, this.double_1);
        }
Пример #3
0
        public override void DrawInternal(
            DrawContext.Surface context,
            Graphics graphics,
            IGraphicElementBlock parentGraphicElementBlock)
        {
            DxfTextStyle textStyle = this.TextStyle;

            if (textStyle == null)
            {
                return;
            }
            ShxFile shxFile = textStyle.GetShxFile();

            if (shxFile == null)
            {
                return;
            }
            ShxShape shapeByIndex = shxFile.GetShapeByIndex(this.ushort_0);

            if (shapeByIndex == null)
            {
                return;
            }
            ArgbColor plotColor = context.GetPlotColor((DxfEntity)this);

            if (!graphics.AddExistingGraphicElement1(parentGraphicElementBlock, (DxfEntity)this, plotColor))
            {
                return;
            }
            WW.Math.Point2D endPoint;
            new Class355((DxfEntity)this, context, graphics, parentGraphicElementBlock).DrawPath(shapeByIndex.GetGlyphShape(false, out endPoint), this.Transform, this.Color.ToColor(), context.GetLineWeight((DxfEntity)this), false, false, this.double_1);
        }