diff options
author | rubidium <rubidium@openttd.org> | 2011-11-20 12:02:06 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-11-20 12:02:06 +0000 |
commit | 33f16368475f504eed01cc1dc5c6b36f17ae46c3 (patch) | |
tree | 7d263a4ec23c74d6f755b9c42817c6633e369695 | |
parent | 462b875b4a5478aa90af26188eb6cd4a43f6c698 (diff) | |
download | openttd-33f16368475f504eed01cc1dc5c6b36f17ae46c3.tar.xz |
(svn r23277) -Codechange: fallback font support for fontcache
-rw-r--r-- | src/fontcache.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp index 7c020eeb2..3eb717c30 100644 --- a/src/fontcache.cpp +++ b/src/fontcache.cpp @@ -709,7 +709,7 @@ bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, i /* First create a pattern to match the wanted language. */ FcPattern *pat = FcNameParse((FcChar8*)lang); /* 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. */ FcFontSet *fs = FcFontList(NULL, pat, os); @@ -727,6 +727,10 @@ bool SetFallbackFont(FreeTypeSettings *settings, const char *language_isocode, i 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); bool missing = callback->FindMissingGlyphs(NULL); |