Пример #1
0
        private static BDF_Font_Header GetHeaderFromData(List <byte> FontData)
        {
            BDF_Font_Header Header = new BDF_Font_Header();

            Header.NumberOfGlyphs  = FontData[0];
            Header.BoundingBoxMode = FontData[1];
            Header.m0 = FontData[2];
            Header.m1 = FontData[3];
            Header.GlyphWidthSizeInBits  = FontData[4];
            Header.GlyphHeightSizeInBits = FontData[5];
            Header.GlyphOffetXSizeInBits = FontData[6];
            Header.GlyphOffetYSizeInBits = FontData[7];
            Header.GlyphPitchSizeInBits  = FontData[8];
            Header.BoundingBoxWidth      = (sbyte)FontData[9];
            Header.BoundingBoxHeight     = (sbyte)FontData[10];
            Header.BoundingBoxOffsetX    = (sbyte)FontData[11];
            Header.BoundingBoxOffsetY    = (sbyte)FontData[12];
            Header.Ascent_A     = (sbyte)FontData[13];
            Header.Descent_g    = (sbyte)FontData[14];
            Header.Ascent_Hook  = (sbyte)FontData[15];
            Header.Descent_Hook = (sbyte)FontData[16];

            Header.Pos_A     = (UInt16)(FontData[17] * 256 + FontData[18]);
            Header.Pos_a     = (UInt16)(FontData[19] * 256 + FontData[20]);
            Header.Pos_0x100 = (UInt16)(FontData[21] * 256 + FontData[22]);
            FontData.RemoveRange(0, 23);
            Header.FontData = FontData.ToArray();
            return(Header);
        }
Пример #2
0
        private BDF_Font_Header LoadFont(String RawFontData)
        {
            List <byte>     FontData = DecodeOctalString(RawFontData);
            BDF_Font_Header Header   = GetHeaderFromData(FontData);

            return(Header);
        }
Пример #3
0
 public GlyphDecodeInfo(BDF_Font_Header FontHeader, Int32 Pos)
 {
     GlyphPos     = Pos;
     BitOffset    = 0;
     OffsetX      = 0;
     OffsetY      = FontHeader.BoundingBoxHeight + FontHeader.BoundingBoxOffsetY;
     BitmapWidth  = 0;
     BitmapHeight = 0;
     BitmapX      = 0;
     BitmapY      = 0;
 }