Processing-like framework for Pebble Smartwatch. Let's sketch a watchface with code!
PFont font; void setup() { font = loadSystemFont(FONT_KEY_BITHAM_42_LIGHT); textFont(font); fill(BLACK); } void draw() { background(WHITE); text("Hello!", 10, 50); }
PFont is the font type for Pebcessing. PFont is loaded in two ways, the loadFont() function or the loadSystemFont() function. loadFont() or loadSystemFont() loads a font and textFont() makes the font active.
With loadFont(), you can load a custom font. A TrueType font is available as a custom font. If you'd like to know how to import a font, please read the guide on the Pebble developer website.
http://developer.getpebble.com/guides/pebble-apps/resources/font-resources#import-the-font
With loadSystemFont(), you can use a system font. The available fonts are as follows.
The images of fonts are on the Pebble developer website.
http://developer.getpebble.com/guides/pebble-apps/display-and-animations/ux-fonts#pebble-system-fonts
PFont is the alias for GFont of Pebble SDK.
loadFont()
loadSystemFont()