コード例 #1
0
        //Format 17: small metrics, PNG image data
        //Type                Name          Description
        //smallGlyphMetrics   glyphMetrics  Metrics information for the glyph
        //uint32              dataLen       Length of data in bytes
        //uint8               data[dataLen] Raw PNG data

        public override void FillGlyphInfo(BinaryReader reader, Glyph bitmapGlyph)
        {
            SmallGlyphMetrics smallGlyphMetric = new SmallGlyphMetrics();

            SmallGlyphMetrics.ReadSmallGlyphMetric(reader, ref smallGlyphMetric);
            uint dataLen = reader.ReadUInt32();

            bitmapGlyph.OriginalAdvanceWidth = smallGlyphMetric.advance;
            bitmapGlyph.Bounds = new Bounds(0, 0, smallGlyphMetric.width, smallGlyphMetric.height);
            //then
            //byte[] buff = reader.ReadBytes((int)dataLen);
            //System.IO.File.WriteAllBytes("d:\\WImageTest\\testBitmapGlyph_" + glyph.GlyphIndex + ".png", buff);
        }