Custom and system fonts.
Pebble OS provides you with a wide range of system fonts that you can use when you need to display and render text or numbers in your Pebble watchface or watchapp.
If you want to use a system font, you call fonts_get_system_font() and simply pass it the name of the system font you want.
To use a custom font, call fonts_load_custom_font(). The sample code feature_custom_font shows how you can do this programmatically, using a font resource to convert a TrueType font into a rasterized version of that font at a specified font size.
For example:
Raster Gothic Condensed is the font used throughout the Pebble system, largely because it is optimized for monochromatic displays. Pebble selected this font because it allows a relatively large number of characters to be displayed on a single line, also because the font has an excellent readability vs. size ratio.
Refer to the chapterManaging App Resources in Pebble Developer Guide which explains how to work with font resources and embed a font into your app.
GFont fonts_get_system_font | ( | const char * | font_key) |
Loads a system font corresponding to the specified font key.
font_key | The string key of the font to load. See pebble_fonts.h for a list of system fonts. |
Loads a custom font.
resource | The 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. |
void fonts_unload_custom_font | ( | GFont | font) |
Unloads the specified custom font and frees the memory that is occupied by it.
font | The font to unload. |
typedef void* GFont |
Pointer to opaque font data structure.