Stores many different types of font.
More...
|
| static void | AddFontListener (const StringView &app_font, UUID id, std::function< void(const StringView &)> callback) |
| | Registers a callback to be invoked when an application font changes.
|
| static const Font & | ApplicationFont (const StringView &app_font) |
| | Retrieves a registered application font by name.
|
| static File | FindBestFitFontFile (Font &font, bool allow_backup_file=true) |
| | Finds the best matching font file for the given font properties.
|
| static Font | FindFallbackFont (Font original, wchar_t character) |
| | Finds a fallback font that supports the given character.
|
| static bool | HasApplicationFont (const StringView &app_font) |
| | Checks whether an application font has been registered with the given name.
|
| static bool | HasFontFile (const StringView &font_name) |
| | Checks whether a font file is registered for the given font name.
|
| static void | PullFontFromFolder (const File &folder) |
| | Scans a folder for font files and registers them.
|
|
static void | ReadFontSettings () |
| | Reads font settings from the settings file.
|
| static void | RemoveFontListener (const StringView &app_font, UUID id) |
| | Removes a previously registered font change listener.
|
|
static void | SaveFontSettings () |
| | Saves the current font settings to the settings file.
|
| static void | SetApplicationFont (const StringView &app_font, const Font &font) |
| | Registers or updates an application font by name.
|
| static void | SetFontFile (const StringView &font_name, const File &file, uint04 index=0) |
| | Associates a font file with a font name.
|
| static void | SetSettingsFile (const File &file) |
| | Sets the file used to persist font settings.
|
|
|
static constexpr StringView | DefaultFont = "Default" |
| | The default application font identifier.
|
Stores many different types of font.
Definition at line 175 of file Font.h.
◆ AddFontListener()
| void FontEngine::AddFontListener |
( |
const StringView & | app_font, |
|
|
UUID | id, |
|
|
std::function< void(const StringView &)> | callback ) |
|
static |
Registers a callback to be invoked when an application font changes.
- Parameters
-
| [in] | app_font | The application font identifier to listen on. |
| [in] | id | A unique identifier for the listener. |
| [in] | callback | The function to call when the font changes. |
◆ ApplicationFont()
| const Font & FontEngine::ApplicationFont |
( |
const StringView & | app_font | ) |
|
|
static |
Retrieves a registered application font by name.
- Parameters
-
| [in] | app_font | The application font identifier. |
- Returns
- A const reference to the registered font.
◆ FindBestFitFontFile()
| File FontEngine::FindBestFitFontFile |
( |
Font & | font, |
|
|
bool | allow_backup_file = true ) |
|
static |
Finds the best matching font file for the given font properties.
- Parameters
-
| [in] | font | The font whose file should be resolved. May be modified with the found file. |
| [in] | allow_backup_file | Whether to fall back to a backup font file if exact match is not found. |
- Returns
- The best matching font file.
◆ FindFallbackFont()
| Font FontEngine::FindFallbackFont |
( |
Font | original, |
|
|
wchar_t | character ) |
|
static |
Finds a fallback font that supports the given character.
- Parameters
-
| [in] | original | The original font that does not support the character. |
| [in] | character | The character that needs font support. |
- Returns
- A font that can render the specified character.
◆ HasApplicationFont()
| bool FontEngine::HasApplicationFont |
( |
const StringView & | app_font | ) |
|
|
static |
Checks whether an application font has been registered with the given name.
- Parameters
-
| [in] | app_font | The application font identifier. |
- Returns
- True if the font is registered.
◆ HasFontFile()
| bool FontEngine::HasFontFile |
( |
const StringView & | font_name | ) |
|
|
static |
Checks whether a font file is registered for the given font name.
- Parameters
-
| [in] | font_name | The font family name to look up. |
- Returns
- True if a font file exists for the name.
◆ PullFontFromFolder()
| void FontEngine::PullFontFromFolder |
( |
const File & | folder | ) |
|
|
static |
Scans a folder for font files and registers them.
- Parameters
-
| [in] | folder | The directory to scan for font files. |
◆ RemoveFontListener()
| void FontEngine::RemoveFontListener |
( |
const StringView & | app_font, |
|
|
UUID | id ) |
|
static |
Removes a previously registered font change listener.
- Parameters
-
| [in] | app_font | The application font identifier the listener was registered on. |
| [in] | id | The unique identifier of the listener to remove. |
◆ SetApplicationFont()
| void FontEngine::SetApplicationFont |
( |
const StringView & | app_font, |
|
|
const Font & | font ) |
|
static |
Registers or updates an application font by name.
- Parameters
-
| [in] | app_font | The application font identifier. |
| [in] | font | The font to associate with the identifier. |
◆ SetFontFile()
Associates a font file with a font name.
- Parameters
-
| [in] | font_name | The font family name. |
| [in] | file | The font file path. |
| [in] | index | The face index within the font file. |
◆ SetSettingsFile()
| void FontEngine::SetSettingsFile |
( |
const File & | file | ) |
|
|
static |
Sets the file used to persist font settings.
- Parameters
-
| [in] | file | The settings file path. |
◆ TryFontName()
Attempts to locate a font file by font family name.
- Parameters
-
| [in] | family | The font family name to search for. |
- Returns
- The file path if found, or an invalid file otherwise.
The documentation for this class was generated from the following file: