OpenTTD Source 20250205-master-gfd85ab1e2c
LanguagePackGlyphSearcher Class Reference

Helper for searching through the language pack. More...

Inheritance diagram for LanguagePackGlyphSearcher:
MissingGlyphSearcher

Private Member Functions

void Reset () override
 Reset the search, i.e.
 
FontSize DefaultSize () override
 Get the default (font) size of the string.
 
std::optional< std::string_view > NextString () override
 Get the next string to search through.
 
bool Monospace () override
 Whether to search for a monospace font or not.
 
void SetFontNames (FontCacheSettings *settings, const char *font_name, const void *os_data) override
 Set the right font names.
 

Private Attributes

uint i
 Iterator for the primary language tables.
 
uint j
 Iterator for the secondary language tables.
 

Additional Inherited Members

- Public Member Functions inherited from MissingGlyphSearcher
virtual ~MissingGlyphSearcher ()=default
 Make sure everything gets destructed right.
 
bool FindMissingGlyphs ()
 Check whether there are glyphs missing in the current language.
 

Detailed Description

Helper for searching through the language pack.

Definition at line 2223 of file strings.cpp.

Member Function Documentation

◆ DefaultSize()

FontSize LanguagePackGlyphSearcher::DefaultSize ( )
inlineoverrideprivatevirtual

Get the default (font) size of the string.

Returns
The font size.

Implements MissingGlyphSearcher.

Definition at line 2233 of file strings.cpp.

References FS_NORMAL.

◆ Monospace()

bool LanguagePackGlyphSearcher::Monospace ( )
inlineoverrideprivatevirtual

Whether to search for a monospace font or not.

Returns
True if searching for monospace.

Implements MissingGlyphSearcher.

Definition at line 2253 of file strings.cpp.

◆ NextString()

std::optional< std::string_view > LanguagePackGlyphSearcher::NextString ( )
inlineoverrideprivatevirtual

Get the next string to search through.

Returns
The next string or nullopt if there is none.

Implements MissingGlyphSearcher.

Definition at line 2238 of file strings.cpp.

References i, j, LoadedLanguagePack::langtab_num, LoadedLanguagePack::langtab_start, and TEXT_TAB_END.

◆ Reset()

void LanguagePackGlyphSearcher::Reset ( )
inlineoverrideprivatevirtual

Reset the search, i.e.

begin from the beginning again.

Implements MissingGlyphSearcher.

Definition at line 2227 of file strings.cpp.

◆ SetFontNames()

void LanguagePackGlyphSearcher::SetFontNames ( FontCacheSettings settings,
const char *  font_name,
const void *  os_data 
)
inlineoverrideprivatevirtual

Set the right font names.

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

Implements MissingGlyphSearcher.

Definition at line 2258 of file strings.cpp.

References settings.

Field Documentation

◆ i

uint LanguagePackGlyphSearcher::i
private

Iterator for the primary language tables.

Definition at line 2224 of file strings.cpp.

Referenced by NextString().

◆ j

uint LanguagePackGlyphSearcher::j
private

Iterator for the secondary language tables.

Definition at line 2225 of file strings.cpp.

Referenced by NextString().


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