Skip to content

Anti-aliased VLW fonts using Inter#2

Open
theNailz wants to merge 1 commit intofeature/lovyan-gfxfrom
feature/vlw-fonts
Open

Anti-aliased VLW fonts using Inter#2
theNailz wants to merge 1 commit intofeature/lovyan-gfxfrom
feature/vlw-fonts

Conversation

@theNailz
Copy link
Copy Markdown
Owner

@theNailz theNailz commented Apr 1, 2026

Summary

  • Replace bitmap fonts (1/2/4) with smooth anti-aliased VLW fonts generated from Inter Regular at 10/14/19pt
  • Font 7 (7-segment) kept as-is for clock displays
  • New fonts.h abstraction layer with setFont() helper using lgfx::LovyanGFX&
  • Python generator script (scripts/generate_vlw_fonts.py) for reproducible font builds from TTF source
  • Character set: printable ASCII + degree symbol (96 glyphs)

Depends on Keralots#37 (LovyanGFX migration).

Flash usage

Board Before (LovyanGFX) After (+ VLW fonts)
S3 71.3% 73.8%
CYD 69.8% 72.2%
C3 70.4% 72.7%

Test plan

  • All three environments build clean (esp32s3, cyd, esp32c3)
  • Flashed and verified on S3
  • Flashed and verified on CYD
  • Clock mode Font 7 (7-segment) still works correctly

@theNailz theNailz marked this pull request as ready for review April 1, 2026 11:57
@theNailz
Copy link
Copy Markdown
Owner Author

theNailz commented Apr 1, 2026

Looks solid overall — the VLW font pipeline and setFont abstraction are clean. Two things:

1. Type mismatch with headless PR
setFont() in fonts.h takes lgfx::LGFX_Device&, but PR #1 (headless C3) changes the global tft from LGFX_Device& to LovyanGFX& (the base class, needed for sprite polymorphism). If both PRs land, setFont(tft, ...) won't compile. The fix is simple — change the parameter to lgfx::LovyanGFX& — but worth noting so merge order doesn't bite you.

2. Font 6 → FONT_LARGE regression
One callsite previously used tft.setTextFont(compact ? 4 : 6) — Font 6 is noticeably larger than Font 4. After this PR both branches map to FONT_LARGE (Inter 19pt, which replaced Font 4). The non-compact path now uses a smaller font than before. If that layout was tight on space it might be fine, but if the larger font was intentional you'd want a FONT_XLARGE level or a bigger Inter size.

@theNailz theNailz force-pushed the feature/vlw-fonts branch from c81ed3a to 27365a8 Compare April 16, 2026 14:32
@theNailz theNailz changed the base branch from feature/lovyan-gfx to main April 16, 2026 14:33
Replace LovyanGFX built-in bitmap fonts (1/2/4) with smooth anti-aliased
VLW fonts generated from Inter Regular at 10/14/19pt. Font 7 (7-segment)
is kept for clock displays.

- Add Python script to generate VLW PROGMEM headers from TTF
- Create font abstraction layer (fonts.h) with setFont() helper
- Migrate all setTextFont() calls across 5 display files
- All three targets build (~70% flash with LovyanGFX)
@theNailz theNailz force-pushed the feature/vlw-fonts branch from 462b2b0 to 49299c9 Compare April 17, 2026 07:47
@theNailz theNailz changed the base branch from main to feature/lovyan-gfx April 17, 2026 07:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant