src/main.c
resources/fonts/Flexi_IBM_VGA_False_437.ttf
appinfo.json
- New project → Watchface → SDK 3 → Basalt (Pebble Time Steel)
- Name:
dos-rpg-watch
In CloudPebble → Resources → Add Resource:
| Resource name | File | Type | Regex | Size hint |
|---|---|---|---|---|
FONT_VGA_20 |
Flexi_IBM_VGA_False_437.ttf | Font | [ -~] |
20 |
FONT_VGA_11 |
Flexi_IBM_VGA_False_437.ttf | Font | [ -~] |
11 |
FONT_VGA_10 |
Flexi_IBM_VGA_False_437.ttf | Font | [ -~] |
10 |
Important: Add the SAME .ttf file three times with different resource names and different point sizes. CloudPebble bakes each size separately.
- Source Files → New File →
main.c→ paste contents ofsrc/main.c
- Compile → Install on watch
| Resource | Used for | px size | Why |
|---|---|---|---|
FONT_VGA_20 |
TM/MY/DY rows | 20 | Large readable time block |
FONT_VGA_11 |
Health stats lines | 11 | Fits 6 lines in available space |
FONT_VGA_10 |
Dungeon log lines | 10 | Dimmer, smaller flavour text |
0,0 ┌─────────────────────────────┐
│ [■■■■] ← spiral battery │ y=4..48
│ 4,4 44×44 px │
│ │
│ TM:11/49 │ y=52
│ MY:05/26 │ y=72
│ DY:04/MON │ y=92
│ │
│ > HEALTH STATS: │ y=118
│ > STEPS: 12500 │ y=131
│ > HEART RATE: 145 BPM │ y=144 ← may overflow right edge
│ > CALORIE BURNED: 320 │ y=157
│ > ACTIVE MINS: 90 │
│ > RECOVERY SCORE: 75 │
│ │
│ > MOVE FORWARD [dimmed] │
│ > WHERE IS THIS [dimmed] │
│ > MOVE FORWARD [dimmed] │
│ > MOVE FORWARD_ [dimmed] │
168,0└─────────────────────────────┘
If text overflows on the right (e.g. "> HEART RATE: 145 BPM" too long):
Option A: Shorten strings in main.c:
// Instead of:
snprintf(s_stats_buf[i], 28, "> HEART RATE: %d BPM", (int)hr);
// Use:
snprintf(s_stats_buf[i], 28, "> HR: %d BPM", (int)hr);Option B: Drop FONT_VGA_11 to size 9 in CloudPebble resource settings.
Option C: Change STATS_X to 2 and SCREEN_W reference to 142 to get 2 more px.
Three font sizes at 437-codepage with [ -~] regex:
- VGA 10px ≈ 2.1 KB
- VGA 11px ≈ 2.3 KB
- VGA 20px ≈ 4.0 KB
- Canvas layer + buffers ≈ 3.5 KB
- Total ≈ ~12 KB — well within the 24 KB heap limit.
If you hit memory errors, reduce the characterRegex to only characters you use:
[0-9A-Z:/>. ]
This strips lowercase and symbols you don't need.
The spiral is identical to the Aldo watchface spiral. It renders as:
- White segments = battery percentage filled
- Dark gray segments = remaining/empty
At 100% → fully white. At 20% → mostly dark gray (low battery visual warning).
The spiral path covers a 44×44 area starting at BAT_X=4, BAT_Y=4.