ImFont: IndexLookup stores short instead of int, so typical ascii-set lookup fits in 256 bytes

This commit is contained in:
ocornut
2016-04-23 11:37:18 +02:00
parent a20d69f9ce
commit 727ca4bd17
2 changed files with 6 additions and 5 deletions

View File

@ -1300,7 +1300,7 @@ struct ImFont
ImVec2 DisplayOffset; // = (0.f,1.f) // Offset font rendering by xx pixels
ImVector<Glyph> Glyphs; // // All glyphs.
ImVector<float> IndexXAdvance; // // Sparse. Glyphs->XAdvance in a directly indexable way (more cache-friendly, for CalcTextSize functions which are often bottleneck in large UI).
ImVector<int> IndexLookup; // // Sparse. Index glyphs by Unicode code-point.
ImVector<short> IndexLookup; // // Sparse. Index glyphs by Unicode code-point.
const Glyph* FallbackGlyph; // == FindGlyph(FontFallbackChar)
float FallbackXAdvance; // == FallbackGlyph->XAdvance
ImWchar FallbackChar; // = '?' // Replacement glyph if one isn't found. Only set via SetFallbackChar()