Exemple #1
0
        public override void Initialize(BinaryReader reader)
        {
            byte header = reader.ReadByte();

            // space characters have no data in AFont files.
            m_characters[0] = new CharacterAscii();

            // We load all 224 characters; this seeds the font with correct height values.
            for (int i = 0; i < 224; i++)
            {
                CharacterAscii ch = loadCharacter(reader);
                int height = ch.Height;
                if (i > 32 && i < 90 && height > Height)
                    Height = height;
                m_characters[i] = ch;
            }

            for (int i = 0; i < 224; i++)
            {
                m_characters[i].YOffset = Height - (m_characters[i].Height + m_characters[i].YOffset);
            }

            // ascii fonts are so tall! why?
            Height -= 2;

            // Determine the width of the space character - arbitrarily .333 the width of capital M (.333 em?).
            GetCharacter(' ').Width = GetCharacter('M').Width / 3;
        }
Exemple #2
0
 CharacterAscii loadCharacter(BinaryReader reader)
 {
     CharacterAscii character = new CharacterAscii(reader);
     return character;
 }