Mercurial > hg > openttd
changeset 18434:790d39304f6a draft
(svn r23276) -Codechange: add the answer for the question whether we're looking for monospace fonts in the searcher
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sun, 20 Nov 2011 12:01:42 +0000 |
parents | db2505634ce4 |
children | b7cce924bf6d |
files | src/strings.cpp src/strings_func.h |
diffstat | 2 files changed, 13 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/strings.cpp +++ b/src/strings.cpp @@ -1750,7 +1750,7 @@ */ bool MissingGlyphSearcher::FindMissingGlyphs(const char **str) { - InitFreeType(false); + InitFreeType(this->Monospace()); const Sprite *question_mark[FS_END]; for (FontSize size = FS_BEGIN; size < FS_END; size++) { @@ -1813,6 +1813,11 @@ return ret; } + /* virtual */ bool Monospace() + { + return false; + } + /* virtual */ void SetFontNames(FreeTypeSettings *settings, const char *font_name) { #ifdef WITH_FREETYPE @@ -1856,7 +1861,7 @@ /* Our fallback font does miss characters too, so keep the * user chosen font as that is more likely to be any good than * the wild guess we made */ - InitFreeType(false); + InitFreeType(searcher->Monospace()); } } #endif
--- a/src/strings_func.h +++ b/src/strings_func.h @@ -223,6 +223,12 @@ 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. * @param settings The settings to modify. * @param font_name The new font name.