mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r23242) -Codechange: allow ignoring the sprite font completely when checking whether the font supports a language
This commit is contained in:
parent
6e31c2f068
commit
881d6d25fd
|
@ -1799,10 +1799,11 @@ static bool FindMissingGlyphs(const char **str)
|
||||||
* mean it might use characters that are not in the
|
* mean it might use characters that are not in the
|
||||||
* font, which is the whole reason this check has
|
* font, which is the whole reason this check has
|
||||||
* been added.
|
* 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
|
#ifdef WITH_FREETYPE
|
||||||
if (bad_font) {
|
if (bad_font) {
|
||||||
/* We found an unprintable character... lets try whether we can find
|
/* We found an unprintable character... lets try whether we can find
|
||||||
|
@ -1814,7 +1815,7 @@ void CheckForMissingGlyphsInLoadedLanguagePack()
|
||||||
|
|
||||||
memcpy(&_freetype, &backup, sizeof(backup));
|
memcpy(&_freetype, &backup, sizeof(backup));
|
||||||
|
|
||||||
if (bad_font) {
|
if (bad_font && base_font) {
|
||||||
/* 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 */
|
||||||
|
|
|
@ -196,6 +196,6 @@ const char *GetCurrentLanguageIsoCode();
|
||||||
|
|
||||||
int CDECL StringIDSorter(const StringID *a, const StringID *b);
|
int CDECL StringIDSorter(const StringID *a, const StringID *b);
|
||||||
|
|
||||||
void CheckForMissingGlyphsInLoadedLanguagePack();
|
void CheckForMissingGlyphsInLoadedLanguagePack(bool base_font = true);
|
||||||
|
|
||||||
#endif /* STRINGS_FUNC_H */
|
#endif /* STRINGS_FUNC_H */
|
||||||
|
|
Loading…
Reference in New Issue