Font registry. A face loads its custom fonts once, each under a small integer slot id, and the rest of the ui looks them up by id so layout tables can stay static, carrying an id rather than a live GFont handle. The registry does not care which fonts they are. The face owns the slots and what they mean. See the face's own draw/fonts.h. This just maps an id to its handle. More...
#include <pebble.h>Go to the source code of this file.
Macros | |
| #define | FONT_SLOTS_MAX 24 |
Typedefs | |
| typedef uint8_t | FontId |
| A font slot id. The face defines its slots as 0 to FONT_SLOTS_MAX-1 and the registry treats the id as a plain index. | |
Functions | |
| void | fonts_register (FontId id, GFont handle) |
| Store a loaded font handle under its slot id. | |
| void | fonts_register_system (FontId id, GFont handle) |
| Store a system font handle under its slot id, without taking ownership. | |
| GFont | fonts_get (FontId id) |
| Resolve a slot id to its handle. Falls back to the system font on a miss. | |
| void | fonts_unload_all (void) |
| Unload every font the app owns and clear the registry. | |
Font registry. A face loads its custom fonts once, each under a small integer slot id, and the rest of the ui looks them up by id so layout tables can stay static, carrying an id rather than a live GFont handle. The registry does not care which fonts they are. The face owns the slots and what they mean. See the face's own draw/fonts.h. This just maps an id to its handle.