Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
These functions load and free font assets which are compiled into the filesystem into RAM. Once loaded into RAM, fonts may be used to draw text to the screen.
For more information about using fonts, see font.h.
For information on asset processing, see assets_preprocessor.
Load fonts from the filesystem to RAM using loadFont(). Fonts may be loaded to normal RAM, which is smaller and faster, or SPI RAM, which is larger and slower.
Free when done using freeFont(). If a font is not freed, the memory will leak.
Go to the source code of this file.
Functions | |
bool | loadFont (const char *name, font_t *font, bool spiRam) |
Load a font from ROM to RAM. Fonts are bitmapped image files that have a single height, all ASCII characters, and a width for each character. PNGs placed in the assets folder before compilation will be automatically flashed to ROM. | |
void | freeFont (font_t *font) |
Free the memory allocated for a font. | |
bool loadFont | ( | const char * | name, |
font_t * | font, | ||
bool | spiRam ) |
Load a font from ROM to RAM. Fonts are bitmapped image files that have a single height, all ASCII characters, and a width for each character. PNGs placed in the assets folder before compilation will be automatically flashed to ROM.
name | The name of the font to load. The font_t is not allocated by this function |
font | A handle to load the font to |
spiRam | true to load to SPI RAM, false to load to normal RAM. SPI RAM is more plentiful but slower to access than normal RAM |
void freeFont | ( | font_t * | font | ) |
Free the memory allocated for a font.
font | The font handle to free memory from |