Beispiel #1
0
        public static GlyphBitmapData2 Read(BinaryReaderFont reader, int byteSize)
        {
            GlyphBitmapData2 value = new GlyphBitmapData2 {
                smallMetrics = SmallGlyphMetrics.Read(reader)
            };

            byteSize       -= SmallGlyphMetrics.ByteSize;
            value.imageData = reader.ReadBytes(byteSize);
            return(value);
        }
Beispiel #2
0
        public static GlyphBitmapData Read(BinaryReaderFont reader, ushort imageFormat, int byteSize)
        {
            switch (imageFormat)
            {
            case 1:
                return(GlyphBitmapData1.Read(reader, byteSize));

            case 2:
                return(GlyphBitmapData2.Read(reader, byteSize));

            case 5:
                return(GlyphBitmapData5.Read(reader, byteSize));

            case 6:
                return(GlyphBitmapData6.Read(reader, byteSize));

            case 7:
                return(GlyphBitmapData7.Read(reader, byteSize));

            case 8:
                return(GlyphBitmapData8.Read(reader));

            case 9:
                return(GlyphBitmapData9.Read(reader));

            case 17:
                return(GlyphBitmapData17.Read(reader));

            case 18:
                return(GlyphBitmapData18.Read(reader));

            case 19:
                return(GlyphBitmapData19.Read(reader));
            }
            return(null);
        }
Beispiel #3
0
        public static void DrawGlyph(RendererContext context)
        {
            EBLCTable EBLC = context.Font.Tables.EBLC;
            EBDTTable EBDT = context.Font.Tables.EBDT;

            //Bitmap bitmap = context.Bitmap;

            BitmapSize size = EBLC.GetBitmapSize(context.FontSize, context.FontSize);
            //Console.WriteLine("bitDepth: {0}", size.bitDepth);
            //Console.WriteLine("subTables.Length: {0}", size.subTables.Length);

            //for (int i = 0; i < size.subTables.Length; i++) {
            //	Console.WriteLine("subTables {0}: {1}", i, size.subTables[i]);
            //}
            //Console.WriteLine("flags: {0}", size.flags);

            //GlyphBitmapData data = EBDT.bitmapData[0x53F8];
            GlyphBitmapData data = EBDT.GetGlyphBitmapData(size.index, context.GlyphId);

            if (data == null)
            {
                data = EBDT.GetGlyphBitmapData(size.index, 0);
            }
            if (data == null)
            {
                context.X += context.FontSize;
                return;
            }
            //GlyphBitmapData data = EBDT.bitmapData[0x835];
            switch (data.format)
            {
            case 1:
                GlyphBitmapData1 data1 = data as GlyphBitmapData1;
                //Console.WriteLine("data7: {0}", data7);
                DrawImageData(
                    context,
                    size.bitDepth,
                    data1.smallMetrics,
                    data1.imageData
                    );
                break;

            case 2:
                GlyphBitmapData2 data2 = data as GlyphBitmapData2;
                //Console.WriteLine("data7: {0}", data7);
                DrawImageData(
                    context,
                    size.bitDepth,
                    data2.smallMetrics,
                    data2.imageData
                    );
                break;

            case 5:
                DrawBitmapData5(context, size, data as GlyphBitmapData5);
                break;

            case 6:
                GlyphBitmapData6 data6 = data as GlyphBitmapData6;
                //Console.WriteLine("data7: {0}", data);
                DrawImageData(
                    context,
                    size.bitDepth,
                    data6.bigMetrics,
                    data6.imageData
                    );
                break;

            case 7:
                GlyphBitmapData7 data7 = data as GlyphBitmapData7;
                //Console.WriteLine("data7: {0}", data7);
                DrawImageData(
                    context,
                    size.bitDepth,
                    data7.bigMetrics,
                    data7.imageData
                    );
                break;

            case 8:
                break;

            case 9:
                break;
            }
            //context.X += context.FontSize;
        }