Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
Loading...
Searching...
No Matches
fs_font.c File Reference

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.
 

Function Documentation

◆ loadFont()

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.

Parameters
nameThe name of the font to load. The font_t is not allocated by this function
fontA handle to load the font to
spiRamtrue to load to SPI RAM, false to load to normal RAM. SPI RAM is more plentiful but slower to access than normal RAM
Returns
true if the font was loaded successfully false if the font failed to load and should not be used

◆ freeFont()

void freeFont ( font_t * font)

Free the memory allocated for a font.

Parameters
fontThe font handle to free memory from