1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-09-02 11:29:10 +00:00

(svn r23273) -Codechange: allow passing a MissingGlyphSearcher to CheckForMissingGlyphs (default to the language pack strings)

This commit is contained in:
rubidium
2011-11-20 11:52:11 +00:00
parent 2075bc702c
commit 0a4a75b0af
5 changed files with 12 additions and 9 deletions

View File

@@ -1833,11 +1833,14 @@ class LanguagePackGlyphSearcher : public MissingGlyphSearcher {
* font, which is the whole reason this check has
* been added.
* @param base_font Whether to look at the base font as well.
* @param searcher The methods to use to search for strings to check.
* If NULL the loaded language pack searcher is used.
*/
void CheckForMissingGlyphsInLoadedLanguagePack(bool base_font)
void CheckForMissingGlyphs(bool base_font, MissingGlyphSearcher *searcher)
{
LanguagePackGlyphSearcher searcher;
bool bad_font = !base_font || searcher.FindMissingGlyphs(NULL);
static LanguagePackGlyphSearcher pack_searcher;
if (searcher == NULL) searcher = &pack_searcher;
bool bad_font = !base_font || searcher->FindMissingGlyphs(NULL);
#ifdef WITH_FREETYPE
if (bad_font) {
/* We found an unprintable character... lets try whether we can find
@@ -1845,7 +1848,7 @@ void CheckForMissingGlyphsInLoadedLanguagePack(bool base_font)
FreeTypeSettings backup;
memcpy(&backup, &_freetype, sizeof(backup));
bad_font = !SetFallbackFont(&_freetype, _langpack->isocode, _langpack->winlangid, &searcher);
bad_font = !SetFallbackFont(&_freetype, _langpack->isocode, _langpack->winlangid, searcher);
memcpy(&_freetype, &backup, sizeof(backup));