A system responsible for the management of bitmap and system fonts.
More...
Go to the source code of this file.
A system responsible for the management of bitmap and system fonts.
- Author
- Travis Vroman (travi.nosp@m.s@ko.nosp@m.hieng.nosp@m.ine..nosp@m.com)
- Version
- 1.0
- Date
- 2023-01-18
- Copyright
- Kohi Game Engine is Copyright (c) Travis Vroman 2021-2023
◆ bitmap_font_config
The configuration for a bitmap font.
◆ font_system_config
The configuration of the font system. Should be setup by the application during the boot process.
◆ system_font_config
The configuration for a system font.
◆ font_system_acquire()
b8 font_system_acquire |
( |
const char * |
font_name, |
|
|
u16 |
font_size, |
|
|
struct ui_text * |
text |
|
) |
| |
Attempts to acquire a font of the given name and assign it to the given ui_text.
- Parameters
-
font_name | The name of the font to acquire. Must be an already loaded font. |
font_size | The font size. Ignored for bitmap fonts. |
text | A pointer to the text object for which to acquire the font. |
- Returns
- True on success; otherwise false.
◆ font_system_bitmap_font_load()
Loads a bitmap font from the following config.
- Parameters
-
config | A pointer to the config to use for loading. |
- Returns
- True on success; otherwise false.
◆ font_system_initialize()
b8 font_system_initialize |
( |
u64 * |
memory_requirement, |
|
|
void * |
memory, |
|
|
void * |
config |
|
) |
| |
Initializes the font system. As with other systems, this should be called twice; once to get the memory requirement (where memory = 0), and a second time passing allocated memory.
- Parameters
-
memory_requirement | A pointer to hold the memory requirement. |
memory | The allocated memory for the system state. |
config | The font system config. |
- Returns
- True on success; otherwise false.
◆ font_system_release()
b8 font_system_release |
( |
struct ui_text * |
text | ) |
|
Releases references to the font held by the provided ui_text.
- Parameters
-
text | A pointer to the text object to release the font from. |
- Returns
- True on success; otherwise false.
◆ font_system_shutdown()
void font_system_shutdown |
( |
void * |
memory | ) |
|
Shuts down the font system.
- Parameters
-
memory | The system state memory. |
◆ font_system_system_font_load()
Loads a system font from the following config.
- Parameters
-
config | A pointer to the config to use for loading. |
- Returns
- True on success; otherwise false.
◆ font_system_verify_atlas()
b8 font_system_verify_atlas |
( |
font_data * |
font, |
|
|
const char * |
text |
|
) |
| |
Verifies the atlas of the provided font contains the characters in text.
- Parameters
-
font | A pointer to the font to be verified. |
text | The text containing the characters required. |
- Returns
- True on success; otherwise false.