(svn r23276) -Codechange: add the answer for the question whether we're looking for monospace fonts in the searcher

This commit is contained in:
rubidium 2011-11-20 12:01:42 +00:00
parent 17db686187
commit e82325e5c6
2 changed files with 13 additions and 2 deletions

View File

@ -1750,7 +1750,7 @@ const char *GetCurrentLanguageIsoCode()
*/ */
bool MissingGlyphSearcher::FindMissingGlyphs(const char **str) bool MissingGlyphSearcher::FindMissingGlyphs(const char **str)
{ {
InitFreeType(false); InitFreeType(this->Monospace());
const Sprite *question_mark[FS_END]; const Sprite *question_mark[FS_END];
for (FontSize size = FS_BEGIN; size < FS_END; size++) { for (FontSize size = FS_BEGIN; size < FS_END; size++) {
@ -1813,6 +1813,11 @@ class LanguagePackGlyphSearcher : public MissingGlyphSearcher {
return ret; return ret;
} }
/* virtual */ bool Monospace()
{
return false;
}
/* virtual */ void SetFontNames(FreeTypeSettings *settings, const char *font_name) /* virtual */ void SetFontNames(FreeTypeSettings *settings, const char *font_name)
{ {
#ifdef WITH_FREETYPE #ifdef WITH_FREETYPE
@ -1856,7 +1861,7 @@ void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
/* Our fallback font does miss characters too, so keep the /* Our fallback font does miss characters too, so keep the
* user chosen font as that is more likely to be any good than * user chosen font as that is more likely to be any good than
* the wild guess we made */ * the wild guess we made */
InitFreeType(false); InitFreeType(searcher->Monospace());
} }
} }
#endif #endif

View File

@ -222,6 +222,12 @@ public:
*/ */
virtual void Reset() = 0; virtual void Reset() = 0;
/**
* Whether to search for a monospace font or not.
* @return True if searching for monospace.
*/
virtual bool Monospace() = 0;
/** /**
* Set the right font names. * Set the right font names.
* @param settings The settings to modify. * @param settings The settings to modify.