@@ -418,12 +418,15 @@ FreeTypeFontCache::~FreeTypeFontCache()
/**
* Reset cached glyphs.
*/
void FreeTypeFontCache::ClearFontCache()
{
/* Font scaling might have changed, determine font size anew if it was automatically selected. */
if (this->face != NULL) this->SetFontSize(this->fs, this->face, this->req_size);
if (this->glyph_to_sprite == NULL) return;
for (int i = 0; i < 256; i++) {
if (this->glyph_to_sprite[i] == NULL) continue;
for (int j = 0; j < 256; j++) {
@@ -435,15 +438,12 @@ void FreeTypeFontCache::ClearFontCache()
}
free(this->glyph_to_sprite);
this->glyph_to_sprite = NULL;
Layouter::ResetFontCache(this->fs);
/* GUI scaling might have changed, determine font size anew if it was automatically selected. */
FreeTypeFontCache::GlyphEntry *FreeTypeFontCache::GetGlyphPtr(GlyphID key)
if (this->glyph_to_sprite == NULL) return NULL;
if (this->glyph_to_sprite[GB(key, 8, 8)] == NULL) return NULL;