mirror of https://github.com/OpenTTD/OpenTTD
(svn r23277) -Codechange: fallback font support for fontcache
parent
462b875b4a
commit
33f1636847
|
@ -709,7 +709,7 @@ bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, i
|
||||||
/* First create a pattern to match the wanted language. */
|
/* First create a pattern to match the wanted language. */
|
||||||
FcPattern *pat = FcNameParse((FcChar8*)lang);
|
FcPattern *pat = FcNameParse((FcChar8*)lang);
|
||||||
/* We only want to know the filename. */
|
/* We only want to know the filename. */
|
||||||
FcObjectSet *os = FcObjectSetBuild(FC_FILE, NULL);
|
FcObjectSet *os = FcObjectSetBuild(FC_FILE, FC_SPACING, NULL);
|
||||||
/* Get the list of filenames matching the wanted language. */
|
/* Get the list of filenames matching the wanted language. */
|
||||||
FcFontSet *fs = FcFontList(NULL, pat, os);
|
FcFontSet *fs = FcFontList(NULL, pat, os);
|
||||||
|
|
||||||
|
@ -727,6 +727,10 @@ bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, i
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int value = 0;
|
||||||
|
FcPatternGetInteger(font, FC_SPACING, 0, &value);
|
||||||
|
if (callback->Monospace() != (value == FC_MONO) && value != FC_DUAL) continue;
|
||||||
|
|
||||||
callback->SetFontNames(settings, (const char*)file);
|
callback->SetFontNames(settings, (const char*)file);
|
||||||
|
|
||||||
bool missing = callback->FindMissingGlyphs(NULL);
|
bool missing = callback->FindMissingGlyphs(NULL);
|
||||||
|
|
Loading…
Reference in New Issue