All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Detailed Description

Custom and system fonts.

fonts.png

Pebble comes with a number of system fonts that you are free to use in your app. Use fonts_get_system_font() to load a system font. Alternatively, it is possible to include a custom font into an app. Use fonts_load_custom_font() to load a custom font. See the guide on Managing App Resources in Pebble Developer Guide on how to embed a font into your app.

Sizes and readability

Readability is dependent on the font itself, the size and the lighting conditions (contrast of the text against the background). What is readable also varies from person to person. The usage context also plays an important role. So, choosing a font is always a compromise between readability, information density and aesthetics.

Glancing

For text that is to be read when glancing at the watch, we recommend using at least a 28pt font size and a bold style. For example, the Text Watch app uses a bold font sized at 42pt for the hours.

Actively reading

Texts that are to be read while the user is interacting with the watch, a smaller font size may be adequate. Pebble uses the bold system font at size 24 for the titles in system menus and as the default ('large') notification font. For larger bodies of text, we recommend using the default system font (Raster Gothic). Modern fonts usually do not have a "bitmapped" version and tend to crumble on black/white displays at smaller font sizes.

The font that is used throughout the system is called Rasther Gothic by Mark Simonson. This bitmap font is optimized for monochromatic displays. We picked this because it allows relatively many characters to be displayed on one line and has an excellent readability vs. size ratio.

See Also
TextLayer
Drawing Text
text_layer_set_font
graphics_draw_text

Function Documentation

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 pebble_fonts.h 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.
GFont fonts_load_custom_font ( ResHandle  resource)

Loads a custom font.

Parameters
resourceThe 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
Managing App Resources in Pebble Developer Guide on how to embed a font into your app.
Note
this may load a font from the flash peripheral into RAM.
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.

Typedef Documentation

typedef void* GFont

Pointer to opaque font data structure.

See Also
fonts_load_custom_font()
text_layer_set_font()
graphics_draw_text()