Change: Rename some freetype things to fontcache.

The font cache supports more than just FreeType as a font provider, but still used freetype in some naming.

This now uses more suitable terms.
This commit is contained in:
Peter Nelson
2022-09-15 18:21:27 +01:00
committed by PeterN
parent 273988551d
commit f6ad8e1c9c
16 changed files with 92 additions and 92 deletions

View File

@@ -2011,7 +2011,7 @@ const char *GetCurrentLanguageIsoCode()
*/
bool MissingGlyphSearcher::FindMissingGlyphs()
{
InitFreeType(this->Monospace());
InitFontCache(this->Monospace());
const Sprite *question_mark[FS_END];
for (FontSize size = this->Monospace() ? FS_MONO : FS_BEGIN; size < (this->Monospace() ? FS_END : FS_MONO); size++) {
@@ -2036,7 +2036,7 @@ bool MissingGlyphSearcher::FindMissingGlyphs()
default: NOT_REACHED();
}
Debug(freetype, 0, "Font is missing glyphs to display char 0x{:X} in {} font size", (int)c, size_name);
Debug(fontcache, 0, "Font is missing glyphs to display char 0x{:X} in {} font size", (int)c, size_name);
return true;
}
}
@@ -2080,7 +2080,7 @@ class LanguagePackGlyphSearcher : public MissingGlyphSearcher {
return false;
}
void SetFontNames(FreeTypeSettings *settings, const char *font_name, const void *os_data) override
void SetFontNames(FontCacheSettings *settings, const char *font_name, const void *os_data) override
{
#if defined(WITH_FREETYPE) || defined(_WIN32) || defined(WITH_COCOA)
settings->small.font = font_name;
@@ -2116,15 +2116,15 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
if (bad_font) {
/* We found an unprintable character... lets try whether we can find
* a fallback font that can print the characters in the current language. */
bool any_font_configured = !_freetype.medium.font.empty();
FreeTypeSettings backup = _freetype;
bool any_font_configured = !_fcsettings.medium.font.empty();
FontCacheSettings backup = _fcsettings;
_freetype.mono.os_handle = nullptr;
_freetype.medium.os_handle = nullptr;
_fcsettings.mono.os_handle = nullptr;
_fcsettings.medium.os_handle = nullptr;
bad_font = !SetFallbackFont(&_freetype, _langpack.langpack->isocode, _langpack.langpack->winlangid, searcher);
bad_font = !SetFallbackFont(&_fcsettings, _langpack.langpack->isocode, _langpack.langpack->winlangid, searcher);
_freetype = backup;
_fcsettings = backup;
if (!bad_font && any_font_configured) {
/* If the user configured a bad font, and we found a better one,
@@ -2143,7 +2143,7 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
/* Our fallback font does miss characters too, so keep the
* user chosen font as that is more likely to be any good than
* the wild guess we made */
InitFreeType(searcher->Monospace());
InitFontCache(searcher->Monospace());
}
}
#endif