Pebble App Framework
main
How It Works
CLI
Device API
Phone API
C Coverage
TS Coverage
GitHub
Theme
Pebble App Framework: Device API
Toggle main menu visibility
Loading...
Searching...
No Matches
fonts.h
Go to the documentation of this file.
1
11
#pragma once
12
#include <pebble.h>
13
18
23
typedef
uint8_t
FontId
;
24
28
#ifndef FONT_SLOTS_MAX
29
#define FONT_SLOTS_MAX 24
30
#endif
31
32
// a FontId is a uint8_t, and the registry turns away an id past the cap, which needs one id above
33
// it. at 256 the SDK's -Werror stops the build on a compare that can never be true
34
#if FONT_SLOTS_MAX < 1 || FONT_SLOTS_MAX > 255
35
#error "FONT_SLOTS_MAX has to be 1 to 255"
36
#endif
37
58
void
fonts_register
(
FontId
id
, GFont handle);
59
70
void
fonts_register_system
(
FontId
id
, GFont handle);
71
78
GFont
fonts_get
(
FontId
id
);
79
86
void
fonts_unload_all
(
void
);
87
fonts_get
GFont fonts_get(FontId id)
Resolve a slot id to its handle. Falls back to the system font on a miss.
Definition
fonts.c:42
FontId
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...
Definition
fonts.h:23
fonts_unload_all
void fonts_unload_all(void)
Unload every font the app owns and clear the registry.
Definition
fonts.c:74
fonts_register_system
void fonts_register_system(FontId id, GFont handle)
Store a system font handle under its slot id, without taking ownership.
Definition
fonts.c:30
fonts_register
void fonts_register(FontId id, GFont handle)
Store a loaded font handle under its slot id.
Definition
fonts.c:18
src
c
pebble
ui
fonts.h
Generated by
1.18.0