OpenTTD Source: FontProviderManager Class Reference

OpenTTD Source 15.3

Static Public Member Functions
FontProviderManager Class Reference
Inheritance diagram for FontProviderManager:

## Static Public Member Functions
static std::unique_ptr< FontCache > | LoadFont (FontSize fs, FontType fonttype)
| Try loading a font with any fontcache factory.
static bool | FindFallbackFont (FontCacheSettings *settings, 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
ProviderManager & | operator= (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 236 of file fontcache.h.

## Member Function Documentation

## ◆ FindFallbackFont()

bool FontProviderManager::FindFallbackFont | ( | FontCacheSettings * | settings,
|  | 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.

This function must set all fonts of settings.

Parameters

  settings | the settings to overwrite the fontname of.
  language_isocode | the language, e.g. en_GB.
  callback | The function to call to check for missing glyphs.

Returns
  true if a font has been set, false otherwise.

Definition at line 55 of file fontcache.cpp.

References ProviderManager< FontCacheFactory >::GetProviders(), and settings.

Referenced by CheckForMissingGlyphs().

## ◆ LoadFont()

std::unique_ptr< FontCache > FontProviderManager::LoadFont | ( | FontSize | fs,
|  | FontType | fonttype
| ) |  |
| static

Try loading a font with any fontcache factory.

Parameters

  fs | Font size to load.
  fonttype | Font type requested.

Returns
  FontCache of the font if loaded, or nullptr.

Definition at line 36 of file fontcache.cpp.

References ProviderManager< FontCacheFactory >::GetProviders().

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

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

- src/fontcache.h
- src/fontcache.cpp