Example #1
0
        void ReadGlyphList(BinaryReader reader)
        {
            ushort glyphCount = reader.ReadUInt16();

            for (int i = 0; i < glyphCount; ++i)
            {
                //read each glyph map info
                //1. codepoint
                var    glyphMap   = new BitmapMapData();
                ushort glyphIndex = reader.ReadUInt16();
                //2. area, left,top,width,height

                glyphMap.Left   = reader.ReadUInt16();
                glyphMap.Top    = reader.ReadUInt16();
                glyphMap.Width  = reader.ReadUInt16();
                glyphMap.Height = reader.ReadUInt16();
                //---------------------------------------
                //3. texture offset
                glyphMap.TextureXOffset = reader.ReadInt16();
                glyphMap.TextureYOffset = reader.ReadInt16();

                //---------------------------------------
                _atlas.AddBitmapMapData(glyphIndex, glyphMap);
            }
        }
Example #2
0
 public void AddBitmapMapData(ushort imgIndex, BitmapMapData bmpMapData)
 {
     _locations.Add(imgIndex, bmpMapData);
 }