v2 Phase 5: Now Playing — Windows media session on the watch

The daemon reads the Windows "now playing" media session (WinRT SMTC) and
adds np/nt/na to the BLE payload; the watch shows a play/pause glyph, a
scrolling title, artist and status. Best-effort and token-independent, so
it works even when the rate-limit data is unavailable.

Cyrillic titles: Styrene B has no Cyrillic glyphs, so the title/artist use
new composite fonts (font_styrene_cyr_{28,20}) — Latin from Styrene B,
Cyrillic + typographic punctuation from Montserrat, merged by lv_font_conv.
Latin titles stay on-brand; only Cyrillic falls back to Montserrat.

- daemon: read_now_playing() via winrt-Windows.Media.Control (lazy import,
  never raises; PLAYING->1, PAUSED->2, else 0; title/artist truncated,
  empty fields omitted)
- firmware: UsageData np_state/np_title/np_artist + parser; the real Now
  Playing screen replaces the shared stub (SCREEN_NOWPLAYING)
- fonts: assets/Montserrat-Medium.ttf, font_styrene_cyr_{28,20}.c
- tools: patch_lvgl9_font.py (automates the 4 LVGL 9 font patches),
  screenshot_win.py (Windows serial screenshot via pyserial + Pillow)
- README: document Cyrillic composite font generation

Verified on hardware (waveshare_amoled_206): idle state, a live Latin
title (scrolling), and Cyrillic (Prohozhdenie / Dunduk) all render.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
wenil
2026-06-21 00:41:15 +03:00
co-authored by Claude Opus 4.8
parent e682b43735
commit b8d4daa03f
10 changed files with 9293 additions and 1 deletions
+22
View File
@@ -289,6 +289,28 @@ to preserve the brand font — Chinese text in those slots renders as
empty boxes. Add a `font_cjk_28.c` if full coverage is needed (~1MB
more flash).
### Cyrillic (Now Playing titles)
`firmware/src/font_styrene_cyr_{28,20}.c` back the Now Playing screen's
title/artist, where user content (media titles) can be non-Latin. Styrene B
has no Cyrillic glyphs, so these are **composite** fonts: Latin from Styrene B,
Cyrillic + typographic punctuation ( — ' ' " " …) from Montserrat. `lv_font_conv`
merges multiple `--font`/`-r` groups into one font — a pure-Latin title stays
on-brand, only Cyrillic falls back to Montserrat.
```bash
for size in 28 20; do
lv_font_conv \
--font assets/StyreneB-Regular.otf -r 0x20-0x7E \
--font assets/Montserrat-Medium.ttf -r '0x2013,0x2014,0x2018,0x2019,0x201C,0x201D,0x2026,0x400-0x45F' \
--size $size --format lvgl --bpp 4 --no-compress \
-o firmware/src/font_styrene_cyr_${size}.c --lv-include lvgl.h
done
```
Then apply the four LVGL 9 patches above — `tools/patch_lvgl9_font.py <file...>` does
all four automatically.
## Converting Lucide icons
The UI uses a small set of [Lucide](https://lucide.dev) icons (bluetooth + battery states) converted to RGB565 / RGB565A8 C arrays for LVGL.