Skip to content

splash_screen uses epdlib text_fit; test that no sample text is cut (M7) - #250

Merged
txoof merged 2 commits into
mainfrom
249-splash-text-fit
Oct 8, 2026
Merged

txoof merged 2 commits into
mainfrom
249-splash-text-fit

Conversation

@txoof-bot

@txoof-bot txoof-bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #249

What changed

splash_screen tries several ways of breaking an address (after a "/", then after ".", "-" or ":") until one is drawn whole. Each try was checked by calling epdlib's internal text.fit_text with the block's settings copied by hand (font, size, width, height, max_lines, shrink, ellipsis). Now each try is one call to epdlib's new prepared.text_fit(name, option) (txoof/epdlib#91), which uses the block's real settings, so the check can't drift from what epdlib draws.

  • fit_address(prepared, name, address) replaces fit_address(address, font, size, width, height, max_lines, ellipsis). The quick check that skips tries too wide even at the smallest size stays (it keeps long names fast).
  • The test "addresses always appear whole" uses text_fit too, instead of its own copy of the block's settings and padding sum.
  • Same tries in the same order: no picture changed (all reference images match).
  • New test in tests/test_all_plugins.py (txoof asked for a few cases, not every layout): each plugin's default layout, drawn with its sample data on a 9.7" (1200x825) and a 2.7" (264x176) screen, must not cut any text with "…". Text made smaller by shrink is allowed. 22 cases; all pass today. Checked that it fails with a too-long sample hostname.
  • epdlib pin moved from 4633fca to 8789b4d (the Updates RGB support and Waveshare Drivers #91 merge). Only the pin changes in pyproject.toml and uv.lock.

Area

plugins/splash_screen, ci (epdlib pin only), tests.

Tests

  • uv run pytest passes (1330 passed; reference images unchanged)
  • uv run ruff check . passes
  • Hardware tests: not needed, no display or driver code changed.

Review

  • Review agents' comments answered — not run: small change (+56/−38).

Only txoof approves and merges this PR.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@txoof-bot
txoof-bot requested a review from txoof as a code owner October 7, 2026 19:50
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@txoof-bot txoof-bot changed the title splash_screen: check addresses with epdlib text_fit (M7) splash_screen uses epdlib text_fit; test that no sample text is cut (M7) Oct 8, 2026
@txoof
txoof merged commit ed28702 into main Oct 8, 2026
2 checks passed
@txoof
txoof deleted the 249-splash-text-fit branch October 8, 2026 19:20
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.

splash_screen: check addresses with epdlib text_fit

2 participants