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:
GFont custom_font = fonts_load_custom_font
(resource_get_handle(RESOURCE_ID_FONT_OSP_DIN_44));
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 chapter App Resources in the Pebble Developer Guides which explains how to work with font resources and embed a font into your app.
Loads a system font corresponding to the specified font key.
This may load a font from the flash peripheral into RAM.
The string key of the font to load. See pebble_fonts.h
for a list of system fonts.
An opaque pointer to the loaded font, or, a pointer to the default (fallback) font if the specified font cannot be loaded.
Loads a system font corresponding to the specified font key.
This may load a font from the flash peripheral into RAM.
The string key of the font to load. See System Fonts guide for a list of system fonts.
An opaque pointer to the loaded font, or, a pointer to the default (fallback) font if the specified font cannot be loaded.
Loads a custom font.
this may load a font from the flash peripheral into RAM.
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.
An opaque pointer to the loaded font, or a pointer to the default (fallback) font if the specified font cannot be loaded.
Read the App Resources guide on how to embed a font into your app.
Unloads the specified custom font and frees the memory that is occupied by it.
When an application exits, the system automatically unloads all fonts that have been loaded.
The font to unload.
Do you have questions about the Pebble SDK?
Do you need some help understanding something on this page?
You can either take advantage of our awesome developer community and check out the SDK Help forums, or you can send us a message through the website!