From 21ce6c9f4e23d6f0347fbf62b22a4a91dd7c7195 Mon Sep 17 00:00:00 2001 From: Saurtron Date: Mon, 9 Dec 2024 09:33:19 +0100 Subject: [PATCH] Don't preload glyphs for non-alphanumeric fonts. --- rts/Rendering/Fonts/CFontTexture.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rts/Rendering/Fonts/CFontTexture.cpp b/rts/Rendering/Fonts/CFontTexture.cpp index 33f7cbce7d..6476f97a7c 100644 --- a/rts/Rendering/Fonts/CFontTexture.cpp +++ b/rts/Rendering/Fonts/CFontTexture.cpp @@ -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);