Skip to content

Commit

Permalink
Don't preload glyphs for non-alphanumeric fonts.
Browse files Browse the repository at this point in the history
  • Loading branch information
saurtron authored and lhog committed Dec 16, 2024
1 parent e4d0e47 commit 21ce6c9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions rts/Rendering/Fonts/CFontTexture.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,9 @@ CFontTexture::CFontTexture(const std::string& fontfile, int size, int _outlinesi
// precache ASCII glyphs & kernings (save them in kerningPrecached array for better lvl2 cpu cache hitrate)

//preload Glyphs
// if given face doesn't contain alphanumerics, don't preload it
if (!FT_Get_Char_Index(face, 'a'))
return;
LoadWantedGlyphs(32, 127);
for (char32_t i = 32; i < 127; ++i) {
const auto& lgl = GetGlyph(i);
Expand Down

0 comments on commit 21ce6c9

Please sign in to comment.