OpenTTD Source 20260421-master-gc2fbc6fdeb
FontProviderManager Class Reference
Inheritance diagram for FontProviderManager:
ProviderManager< FontCacheFactory >

Static Public Member Functions

static std::unique_ptr< FontCacheLoadFont (FontSize fs, FontType fonttype, bool search, const std::string &font_name, const std::any &os_handle={})
 Try loading a font with any fontcache factory.
static bool FindFallbackFont (const std::string &language_isocode, MissingGlyphSearcher *callback)
 We would like to have a fallback font as the current one doesn't contain all characters we need.

Additional Inherited Members

Private Member Functions inherited from ProviderManager< FontCacheFactory >
 ProviderManager (ProviderManager const &)=delete
ProviderManageroperator= (ProviderManager const &)=delete
Static Private Member Functions inherited from ProviderManager< FontCacheFactory >
static void Register (const FontCacheFactory &instance)
static void Unregister (const FontCacheFactory &instance)
static std::vector< const FontCacheFactory * > & GetProviders ()
 Get the currently known providers.

Detailed Description

Definition at line 271 of file fontcache.h.

Member Function Documentation

◆ FindFallbackFont()

bool FontProviderManager::FindFallbackFont ( const std::string & language_isocode,
MissingGlyphSearcher * callback )
static

We would like to have a fallback font as the current one doesn't contain all characters we need.

Parameters
language_isocodethe language, e.g. en_GB.
callbackThe function to call to check for missing glyphs.
Returns
true if a font has been set, false otherwise.

Definition at line 56 of file fontcache.cpp.

References ProviderManager< FontCacheFactory >::GetProviders().

Referenced by CheckForMissingGlyphs().

◆ LoadFont()

std::unique_ptr< FontCache > FontProviderManager::LoadFont ( FontSize fs,
FontType fonttype,
bool search,
const std::string & font_name,
const std::any & os_handle = {} )
static

Try loading a font with any fontcache factory.

Parameters
fsFont size to load.
fonttypeFont type requested.
searchSet if searching for the font.
font_nameFont name to load.
os_handleFont handle to load.
Returns
FontCache of the font if loaded, or nullptr.

Definition at line 39 of file fontcache.cpp.

References ProviderManager< FontCacheFactory >::GetProviders().

Referenced by FontCache::InitializeFontCaches(), FontCache::LoadFontCaches(), and FontCache::TryFallback().


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