Pebble Foundation Classes  0.2.0
C++ for Pebble
Collaboration diagram for Fonts:

Typedefs

typedef struct FontInfo FontInfo
 
typedef FontInfo * GFont
 

Functions

GFont fonts_get_system_font (const char *font_key)
 
GFont fonts_load_custom_font (ResHandle handle)
 
void fonts_unload_custom_font (GFont font)
 

Detailed Description

See also
TextLayer
Drawing Text
text_layer_set_font
graphics_draw_text

Typedef Documentation

◆ GFont

typedef FontInfo* GFont

Pointer to opaque font data structure.

See also
fonts_load_custom_font()
text_layer_set_font()
graphics_draw_text()

Function Documentation

◆ fonts_get_system_font()

GFont fonts_get_system_font ( const char *  font_key)

Loads a system font corresponding to the specified font key.

Parameters
font_keyThe string key of the font to load. See System Fonts guide for a list of system fonts.
Returns
An opaque pointer to the loaded font, or, a pointer to the default (fallback) font if the specified font cannot be loaded.
Note
This may load a font from the flash peripheral into RAM.

◆ fonts_load_custom_font()

GFont fonts_load_custom_font ( ResHandle  handle)

Loads a custom font.

Parameters
handleThe resource handle of the font to load. See resource_ids.auto.h for a list of resource IDs, and use resource_get_handle() to obtain the resource handle.
Returns
An opaque pointer to the loaded font, or a pointer to the default (fallback) font if the specified font cannot be loaded.
See also
Read the App Resources guide on how to embed a font into your app.
Note
this may load a font from the flash peripheral into RAM.

◆ fonts_unload_custom_font()

void fonts_unload_custom_font ( GFont  font)

Unloads the specified custom font and frees the memory that is occupied by it.

Note
When an application exits, the system automatically unloads all fonts that have been loaded.
Parameters
fontThe font to unload.