GUIslice  0.16.0
Embedded GUI in C
Font Functions

Functions that load fonts. More...

Functions

bool gslc_FontAdd (gslc_tsGui *pGui, int16_t nFontId, gslc_teFontRefType eFontRefType, const void *pvFontRef, uint16_t nFontSz)
 Load a font into the local font cache and assign font ID (nFontId). More...
 
bool gslc_FontSet (gslc_tsGui *pGui, int16_t nFontId, gslc_teFontRefType eFontRefType, const void *pvFontRef, uint16_t nFontSz)
 Load a font into the local font cache and store as font ID (nFontId) More...
 
gslc_tsFontgslc_FontGet (gslc_tsGui *pGui, int16_t nFontId)
 Fetch a font from its ID value. More...
 
bool gslc_FontSetMode (gslc_tsGui *pGui, int16_t nFontId, gslc_teFontRefMode eFontMode)
 Set the font operating mode. More...
 

Detailed Description

Functions that load fonts.

Function Documentation

bool gslc_FontAdd ( gslc_tsGui pGui,
int16_t  nFontId,
gslc_teFontRefType  eFontRefType,
const void *  pvFontRef,
uint16_t  nFontSz 
)

Load a font into the local font cache and assign font ID (nFontId).

  • Font is stored into next available internal array element
  • NOTE: Use FontSet() instead
Parameters
[in]pGuiPointer to GUI
[in]nFontIdID to use when referencing this font
[in]eFontRefTypeFont reference type (eg. filename or pointer)
[in]pvFontRefReference pointer to identify the font. In the case of SDL mode, it is a filepath to the font file. In the case of Arduino it is a pointer value to the font bitmap array (GFXFont)
[in]nFontSzTypeface size to use (only used in SDL mode)
Returns
true if load was successful, false otherwise
gslc_tsFont* gslc_FontGet ( gslc_tsGui pGui,
int16_t  nFontId 
)

Fetch a font from its ID value.

Parameters
[in]pGuiPointer to GUI
[in]nFontIdID value used to reference the font (supplied originally to gslc_FontAdd()
Returns
A pointer to the font structure or NULL if error
bool gslc_FontSet ( gslc_tsGui pGui,
int16_t  nFontId,
gslc_teFontRefType  eFontRefType,
const void *  pvFontRef,
uint16_t  nFontSz 
)

Load a font into the local font cache and store as font ID (nFontId)

  • Font is stored into index nFontId, so nFontId must be from separate font enum (0-based).
  • Example: enum { E_FONT_BTN, E_FONT_TXT, MAX_FONT };
Parameters
[in]pGuiPointer to GUI
[in]nFontIdID to use when referencing this font
[in]eFontRefTypeFont reference type (eg. filename or pointer)
[in]pvFontRefReference pointer to identify the font. In the case of SDL mode, it is a filepath to the font file. In the case of Arduino it is a pointer value to the font bitmap array (GFXFont)
[in]nFontSzTypeface size to use (only used in SDL mode)
Returns
true if load was successful, false otherwise
bool gslc_FontSetMode ( gslc_tsGui pGui,
int16_t  nFontId,
gslc_teFontRefMode  eFontMode 
)

Set the font operating mode.

Parameters
[in]pGuiPointer to GUI
[in]nFontIdID value used to reference the font (supplied originally to gslc_FontAdd()
[in,out]eFontModeFont mode to assign to this font
Returns
true if success