mirror of https://github.com/OpenTTD/OpenTTD
Codechange: OS-specific data for font search is not used outside of searching.
parent
84636fc2af
commit
2b0200d429
|
@ -217,7 +217,7 @@ struct FreeTypeSubSetting {
|
|||
uint size; ///< The (requested) size of the font.
|
||||
bool aa; ///< Whether to do anti aliasing or not.
|
||||
|
||||
const void *os_handle = nullptr; ///< Optional native OS font info.
|
||||
const void *os_handle = nullptr; ///< Optional native OS font info. Only valid during font search.
|
||||
};
|
||||
|
||||
/** Settings for the freetype fonts. */
|
||||
|
|
|
@ -344,9 +344,7 @@ static int CALLBACK EnumFontCallback(const ENUMLOGFONTEX *logfont, const NEWTEXT
|
|||
const char *english_name = font_name;
|
||||
#endif /* WITH_FREETYPE */
|
||||
|
||||
PLOGFONT os_data = MallocT<LOGFONT>(1);
|
||||
*os_data = logfont->elfLogFont;
|
||||
info->callback->SetFontNames(info->settings, font_name, os_data);
|
||||
info->callback->SetFontNames(info->settings, font_name, &logfont->elfLogFont);
|
||||
if (info->callback->FindMissingGlyphs()) return 1;
|
||||
DEBUG(freetype, 1, "Fallback font: %s (%s)", font_name, english_name);
|
||||
return 0; // stop enumerating
|
||||
|
|
|
@ -2078,7 +2078,6 @@ class LanguagePackGlyphSearcher : public MissingGlyphSearcher {
|
|||
strecpy(settings->medium.font, font_name, lastof(settings->medium.font));
|
||||
strecpy(settings->large.font, font_name, lastof(settings->large.font));
|
||||
|
||||
free(settings->medium.os_handle); // Only free one, they are all the same pointer.
|
||||
settings->small.os_handle = os_data;
|
||||
settings->medium.os_handle = os_data;
|
||||
settings->large.os_handle = os_data;
|
||||
|
@ -2116,9 +2115,6 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
|
|||
|
||||
bad_font = !SetFallbackFont(&_freetype, _langpack.langpack->isocode, _langpack.langpack->winlangid, searcher);
|
||||
|
||||
free(_freetype.mono.os_handle);
|
||||
free(_freetype.medium.os_handle);
|
||||
|
||||
memcpy(&_freetype, &backup, sizeof(backup));
|
||||
|
||||
if (!bad_font) {
|
||||
|
|
|
@ -196,7 +196,6 @@ void TextfileWindow::SetupScrollbars()
|
|||
{
|
||||
#if defined(WITH_FREETYPE) || defined(_WIN32)
|
||||
strecpy(settings->mono.font, font_name, lastof(settings->mono.font));
|
||||
free(settings->mono.os_handle);
|
||||
settings->mono.os_handle = os_data;
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue