OpenTTD Source 20251213-master-g1091fa6071
RuntimeMissingGlyphSearcher Class Reference
Inheritance diagram for RuntimeMissingGlyphSearcher:
MissingGlyphSearcher

Public Member Functions

FontLoadReason GetLoadReason () override
 
void Insert (FontSize fs, char32_t c)
 
std::set< char32_t > GetRequiredGlyphs (FontSizes fontsizes) override
 Get set of glyphs required for the current language.
 
- Public Member Functions inherited from MissingGlyphSearcher
 MissingGlyphSearcher (FontSizes fontsizes)
 
virtual ~MissingGlyphSearcher ()=default
 Make sure everything gets destructed right.
 
FontSizes FindMissingGlyphs ()
 Test if any glyphs are missing.
 

Data Fields

TimeoutTimer< TimerWindowsearch_timeout
 
- Data Fields inherited from MissingGlyphSearcher
FontSizes fontsizes
 Font sizes to search for.
 

Private Attributes

std::array< std::set< char32_t >, FS_END > glyphs {}
 

Detailed Description

Definition at line 45 of file gfx_layout.cpp.

Constructor & Destructor Documentation

◆ RuntimeMissingGlyphSearcher()

RuntimeMissingGlyphSearcher::RuntimeMissingGlyphSearcher ( )
inline

Definition at line 48 of file gfx_layout.cpp.

Member Function Documentation

◆ GetLoadReason()

FontLoadReason RuntimeMissingGlyphSearcher::GetLoadReason ( )
inlineoverridevirtual

Implements MissingGlyphSearcher.

Definition at line 50 of file gfx_layout.cpp.

◆ GetRequiredGlyphs()

std::set< char32_t > RuntimeMissingGlyphSearcher::GetRequiredGlyphs ( FontSizes  fontsizes)
inlineoverridevirtual

Get set of glyphs required for the current language.

Parameters
fontsizesFont sizes to test.
Returns
Set of required glyphs.

Implements MissingGlyphSearcher.

Definition at line 58 of file gfx_layout.cpp.

References MissingGlyphSearcher::fontsizes.

◆ Insert()

void RuntimeMissingGlyphSearcher::Insert ( FontSize  fs,
char32_t  c 
)
inline

Definition at line 52 of file gfx_layout.cpp.

Field Documentation

◆ glyphs

std::array<std::set<char32_t>, FS_END> RuntimeMissingGlyphSearcher::glyphs {}
private

Definition at line 46 of file gfx_layout.cpp.

◆ search_timeout

TimeoutTimer<TimerWindow> RuntimeMissingGlyphSearcher::search_timeout
Initial value:
{std::chrono::milliseconds(250), [this]()
{
FontSizes changed_fontsizes{};
for (FontSize fs = FS_BEGIN; fs != FS_END; ++fs) {
auto &missing = this->glyphs[fs];
if (missing.empty()) continue;
if (FontProviderManager::FindFallbackFont({}, fs, this)) changed_fontsizes.Set(fs);
missing.clear();
}
if (!changed_fontsizes.Any()) return;
FontCache::LoadFontCaches(changed_fontsizes);
LoadStringWidthTable(changed_fontsizes);
}}
void UpdateAllVirtCoords()
Update the viewport coordinates of all signs.
static void LoadFontCaches(FontSizes fontsizes)
(Re)initialize the font cache related things, i.e.
static bool FindFallbackFont(const std::string &language_isocode, FontSizes fontsizes, class MissingGlyphSearcher *callback)
We would like to have a fallback font as the current one doesn't contain all characters we need.
Definition fontcache.cpp:58
void LoadStringWidthTable(FontSizes fontsizes)
Initialize _stringwidth_table cache for the specified font sizes.
Definition gfx.cpp:1250
FontSize
Available font sizes.
Definition gfx_type.h:248
@ FS_BEGIN
First font.
Definition gfx_type.h:255
void ReInitAllWindows(bool zoom_changed)
Re-initialize all windows.
Definition window.cpp:3410

Definition at line 67 of file gfx_layout.cpp.


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