| 62 | } |
| 63 | |
| 64 | static dmRenderDDF::GlyphBank* CreateGlyphBank(uint32_t max_ascent, uint32_t max_descent, uint32_t glyph_count) |
| 65 | { |
| 66 | dmRenderDDF::GlyphBank* bank = new dmRenderDDF::GlyphBank; |
| 67 | memset(bank, 0, sizeof(*bank)); |
| 68 | |
| 69 | bank->m_Glyphs.m_Count = glyph_count; |
| 70 | bank->m_Glyphs.m_Data = new dmRenderDDF::GlyphBank::Glyph[glyph_count]; |
| 71 | |
| 72 | memset(bank->m_Glyphs.m_Data, 0, sizeof(dmRenderDDF::GlyphBank::Glyph) * glyph_count); |
| 73 | for (uint32_t i = 0; i < glyph_count; ++i) |
| 74 | { |
| 75 | bank->m_Glyphs[i].m_Character = i; |
| 76 | bank->m_Glyphs[i].m_Width = 1; |
| 77 | bank->m_Glyphs[i].m_LeftBearing = 1; |
| 78 | bank->m_Glyphs[i].m_Advance = 2; |
| 79 | bank->m_Glyphs[i].m_Ascent = 2; |
| 80 | bank->m_Glyphs[i].m_Descent = 1; |
| 81 | } |
| 82 | |
| 83 | bank->m_MaxAscent = max_ascent; |
| 84 | bank->m_MaxDescent = max_descent; |
| 85 | |
| 86 | return bank; |
| 87 | } |
| 88 | |
| 89 | static void DestroyGlyphBank(dmRenderDDF::GlyphBank* bank) |
| 90 | { |