Changeset - r18396:32c4522595fa
[Not reviewed]
master
0 2 0
rubidium - 13 years ago 2011-11-17 21:11:34
rubidium@openttd.org
(svn r23242) -Codechange: allow ignoring the sprite font completely when checking whether the font supports a language
2 files changed with 5 insertions and 4 deletions:
0 comments (0 inline, 0 general)
src/strings.cpp
Show inline comments
 
@@ -1796,28 +1796,29 @@ static bool FindMissingGlyphs(const char
 
 * does not support. If this is the case an error
 
 * message will be shown in English. The error
 
 * message will not be localized because that would
 
 * mean it might use characters that are not in the
 
 * font, which is the whole reason this check has
 
 * been added.
 
 * @param base_font Whether to look at the base font as well.
 
 */
 
void CheckForMissingGlyphsInLoadedLanguagePack()
 
void CheckForMissingGlyphsInLoadedLanguagePack(bool base_font)
 
{
 
	bool bad_font = FindMissingGlyphs(NULL);
 
	bool bad_font = !base_font || FindMissingGlyphs(NULL);
 
#ifdef WITH_FREETYPE
 
	if (bad_font) {
 
		/* We found an unprintable character... lets try whether we can find
 
		 * a fallback font that can print the characters in the current language. */
 
		FreeTypeSettings backup;
 
		memcpy(&backup, &_freetype, sizeof(backup));
 

	
 
		bad_font = !SetFallbackFont(&_freetype, _langpack->isocode, _langpack->winlangid, &FindMissingGlyphs);
 

	
 
		memcpy(&_freetype, &backup, sizeof(backup));
 

	
 
		if (bad_font) {
 
		if (bad_font && base_font) {
 
			/* 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 */
 
			UninitFreeType();
 
			InitFreeType();
 
		}
src/strings_func.h
Show inline comments
 
@@ -193,9 +193,9 @@ extern TextDirection _current_text_dir; 
 

	
 
void InitializeLanguagePacks();
 
const char *GetCurrentLanguageIsoCode();
 

	
 
int CDECL StringIDSorter(const StringID *a, const StringID *b);
 

	
 
void CheckForMissingGlyphsInLoadedLanguagePack();
 
void CheckForMissingGlyphsInLoadedLanguagePack(bool base_font = true);
 

	
 
#endif /* STRINGS_FUNC_H */
0 comments (0 inline, 0 general)