summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-20 12:02:06 +0000
committerrubidium <rubidium@openttd.org>2011-11-20 12:02:06 +0000
commit33f16368475f504eed01cc1dc5c6b36f17ae46c3 (patch)
tree7d263a4ec23c74d6f755b9c42817c6633e369695 /src
parent462b875b4a5478aa90af26188eb6cd4a43f6c698 (diff)
downloadopenttd-33f16368475f504eed01cc1dc5c6b36f17ae46c3.tar.xz
(svn r23277) -Codechange: fallback font support for fontcache
Diffstat (limited to 'src')
-rw-r--r--src/fontcache.cpp6
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);