OpenTTD Source 20241224-master-gee860a5c8e
MissingGlyphSearcher Class Referenceabstract

A searcher for missing glyphs. More...

#include <strings_func.h>

Inheritance diagram for MissingGlyphSearcher:
LanguagePackGlyphSearcher TextfileWindow BaseSetTextfileWindow ContentTextfileWindow GameManualTextfileWindow NewGRFTextfileWindow ScriptTextfileWindow SurveyResultTextfileWindow

Public Member Functions

virtual ~MissingGlyphSearcher ()=default
 Make sure everything gets destructed right.
 
virtual std::optional< std::string_view > NextString ()=0
 Get the next string to search through.
 
virtual FontSize DefaultSize ()=0
 Get the default (font) size of the string.
 
virtual void Reset ()=0
 Reset the search, i.e.
 
virtual bool Monospace ()=0
 Whether to search for a monospace font or not.
 
virtual void SetFontNames (struct FontCacheSettings *settings, const char *font_name, const void *os_data=nullptr)=0
 Set the right font names.
 
bool FindMissingGlyphs ()
 Check whether there are glyphs missing in the current language.
 

Detailed Description

A searcher for missing glyphs.

Definition at line 117 of file strings_func.h.

Member Function Documentation

◆ DefaultSize()

virtual FontSize MissingGlyphSearcher::DefaultSize ( )
pure virtual

Get the default (font) size of the string.

Returns
The font size.

Implemented in LanguagePackGlyphSearcher, and TextfileWindow.

Referenced by FindMissingGlyphs().

◆ FindMissingGlyphs()

bool MissingGlyphSearcher::FindMissingGlyphs ( )

Check whether there are glyphs missing in the current language.

Returns
If glyphs are missing, return true, else return false.

Definition at line 2192 of file strings.cpp.

References Debug, DefaultSize(), FS_LARGE, FS_MONO, FS_NORMAL, FS_SMALL, FontCache::Get(), InitFontCache(), IsInsideMM(), IsTextDirectionChar(), FontCache::MapCharToGlyph(), Monospace(), NextString(), and Reset().

Referenced by CheckForMissingGlyphs(), SetFallbackFont(), and SetFallbackFont().

◆ Monospace()

virtual bool MissingGlyphSearcher::Monospace ( )
pure virtual

Whether to search for a monospace font or not.

Returns
True if searching for monospace.

Implemented in LanguagePackGlyphSearcher, and TextfileWindow.

Referenced by CheckForMissingGlyphs(), FindMissingGlyphs(), SetFallbackFont(), and SetFallbackFont().

◆ NextString()

virtual std::optional< std::string_view > MissingGlyphSearcher::NextString ( )
pure virtual

Get the next string to search through.

Returns
The next string or nullopt if there is none.

Implemented in LanguagePackGlyphSearcher, and TextfileWindow.

Referenced by FindMissingGlyphs().

◆ Reset()

virtual void MissingGlyphSearcher::Reset ( )
pure virtual

Reset the search, i.e.

begin from the beginning again.

Implemented in LanguagePackGlyphSearcher, and TextfileWindow.

Referenced by FindMissingGlyphs().

◆ SetFontNames()

virtual void MissingGlyphSearcher::SetFontNames ( struct FontCacheSettings settings,
const char *  font_name,
const void *  os_data = nullptr 
)
pure virtual

Set the right font names.

Parameters
settingsThe settings to modify.
font_nameThe new font name.
os_dataOpaque pointer to OS-specific data.

Implemented in LanguagePackGlyphSearcher, and TextfileWindow.

Referenced by SetFallbackFont(), and SetFallbackFont().


The documentation for this class was generated from the following files: