Changeset - r18424:91195beac0ac
[Not reviewed]
master
0 2 0
rubidium - 13 years ago 2011-11-20 12:01:42
rubidium@openttd.org
(svn r23276) -Codechange: add the answer for the question whether we're looking for monospace fonts in the searcher
2 files changed with 13 insertions and 2 deletions:
0 comments (0 inline, 0 general)
src/strings.cpp
Show inline comments
 
@@ -1747,13 +1747,13 @@ const char *GetCurrentLanguageIsoCode()
 
 * @param Pointer to an address for storing the text pointer.
 
 * @return If glyphs are missing, return \c true, else return \false.
 
 * @post If \c true is returned and str is not NULL, *str points to a string that is found to contain at least one missing glyph.
 
 */
 
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++) {
 
		question_mark[size] = GetGlyph(size, '?');
 
	}
 

	
 
@@ -1810,12 +1810,17 @@ class LanguagePackGlyphSearcher : public
 
			j = 0;
 
		}
 

	
 
		return ret;
 
	}
 

	
 
	/* virtual */ bool Monospace()
 
	{
 
		return false;
 
	}
 

	
 
	/* virtual */ void SetFontNames(FreeTypeSettings *settings, const char *font_name)
 
	{
 
#ifdef WITH_FREETYPE
 
		strecpy(settings->small_font,  font_name, lastof(settings->small_font));
 
		strecpy(settings->medium_font, font_name, lastof(settings->medium_font));
 
		strecpy(settings->large_font,  font_name, lastof(settings->large_font));
 
@@ -1853,13 +1858,13 @@ void CheckForMissingGlyphs(bool base_fon
 
		memcpy(&_freetype, &backup, sizeof(backup));
 

	
 
		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 */
 
			InitFreeType(false);
 
			InitFreeType(searcher->Monospace());
 
		}
 
	}
 
#endif
 

	
 
	if (bad_font) {
 
		/* All attempts have failed. Display an error. As we do not want the string to be translated by
src/strings_func.h
Show inline comments
 
@@ -220,12 +220,18 @@ public:
 
	/**
 
	 * Reset the search, i.e. begin from the beginning again.
 
	 */
 
	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.
 
	 */
 
	virtual void SetFontNames(struct FreeTypeSettings *settings, const char *font_name) = 0;
 

	
0 comments (0 inline, 0 general)