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
zone.h
Go to the documentation of this file.
1
7
#pragma once
8
#include <pebble.h>
9
10
#include "
ui/fonts.h
"
11
16
25
typedef
struct
26
{
27
GRect
rect
;
28
FontId
font_id
;
29
GTextAlignment
align
;
30
GColor
color
;
31
FontId
font_id_fallback
;
32
GRect
rect_fallback
;
33
FontId
font_id_fallback2
;
34
GRect
rect_fallback2
;
35
FontId
font_id_fallback3
;
36
GRect
rect_fallback3
;
37
}
Zone
;
38
47
TextLayer *
zone_make_layer
(Layer *parent,
const
Zone
*zone);
48
62
void
zone_set_text_fit
(TextLayer *layer,
const
Zone
*zone,
const
char
*text);
63
fonts.h
Font registry. A face loads its custom fonts once, each under a small integer slot id,...
zone_make_layer
TextLayer * zone_make_layer(Layer *parent, const Zone *zone)
Creates a transparent text layer for a zone and attaches it to the parent layer.
Definition
zone.c:9
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
zone_set_text_fit
void zone_set_text_fit(TextLayer *layer, const Zone *zone, const char *text)
Sets a text layer's text, stepping down through the zone's font tiers to find one the text fits in.
Definition
zone.c:42
Zone
Everything needed to present one text slot. Where it sits, and which registered font,...
Definition
zone.h:26
Zone::font_id_fallback
FontId font_id_fallback
First smaller font to try when the text overflows the main one.
Definition
zone.h:31
Zone::rect
GRect rect
Area for the main font.
Definition
zone.h:27
Zone::font_id
FontId font_id
The main font to try first.
Definition
zone.h:28
Zone::color
GColor color
Text colour, used at every tier.
Definition
zone.h:30
Zone::rect_fallback
GRect rect_fallback
Area for the first smaller font.
Definition
zone.h:32
Zone::rect_fallback2
GRect rect_fallback2
Area for the second smaller font. Leave it zero-sized to skip this step.
Definition
zone.h:34
Zone::rect_fallback3
GRect rect_fallback3
Area for the third smaller font. Leave it zero-sized to skip this step.
Definition
zone.h:36
Zone::font_id_fallback3
FontId font_id_fallback3
Third smaller font for the widest strings of all.
Definition
zone.h:35
Zone::align
GTextAlignment align
Text alignment, used at every tier.
Definition
zone.h:29
Zone::font_id_fallback2
FontId font_id_fallback2
Second smaller font for the widest strings.
Definition
zone.h:33
src
c
pebble
ui
zone.h
Generated by
1.18.0