fix(countdown): make every offered font work, and document every setting - #363
Merged
Conversation
Only two of the five font families in the picker actually rendered. Hashing a render per family showed three producing byte-identical output -- the default face -- from two separate causes: 9bd0dbce77: ['press_start'] b59efdfd01: ['four_by_six'] d6e4d86478: ['tom_thumb', 'tiny', 'picopixel'] tiny and picopixel have no font file in the core or the plugin, so they could only ever fall back; they are removed. The rest is the .bdf pixel-size problem: a bitmap face exists at exactly one size and FreeType rejects any other, so asking for font_size (8) failed for every bitmap family. Bitmap faces are now loaded at the size the file's own PIXEL_SIZE header declares. That alone was not enough for five_by_seven. The plugin only reached its own loader when the core FontManager's catalog *missed* a family, and the catalog has five_by_seven -- so resolve_font returned a silently degraded default and the plugin trusted it. Bitmap families now go through the plugin's loader regardless of what the catalog claims. tom_thumb is also wired up: tom-thumb.bdf was always shipped, just absent from the family map. All four families in the new enum now render distinctly, verified the same way: 9bd0dbce77 press_start | b59efdfd01 four_by_six eb2d9294c8 five_by_seven | 0ed03a8f38 tom_thumb The README is rewritten around real screenshots and documents all 40 settings, including the per-entry layout and style override objects. It also corrects the countdown-value ladder, which the old version got wrong: there is no "1 Day" and no "TODAY!" anywhere in the code. Between one and two days out the plugin writes "Tomorrow" with no number, and a passed countdown reads "Nd ago" and is hidden entirely unless show_expired is on. Every rung is now shown as a real render. The stale Pillow >= 9.0.0 requirement is corrected to >= 12.2.0. Audits before opening: no config token dropped, all 40 schema leaves documented, no broken TOC anchors, and the dropped-section check surfaced the dependency and technical notes, which are restored. Harness 8/8 with goldens unchanged -- the harness pins press_start, a .ttf, so the font work does not move them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 13 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fifth plugin in the README pass. Still avoiding the sports scoreboards while #359 is open.
Only two of five fonts worked
Hashing one render per family showed three producing byte-identical output — the default face:
Two separate causes:
tinyandpicopixelhave no font file in the core or the plugin. Phantom options; removed..bdfhit the pixel-size problem — a bitmap face exists at exactly one size and FreeType rejects any other, so asking forfont_size(8) failed every time. Now loaded at the size the file's ownPIXEL_SIZEheader declares.That alone wasn't enough for
five_by_seven, and the reason is worth knowing: the plugin only reached its own loader when the coreFontManager's catalog missed a family. The catalog hasfive_by_seven, soresolve_fontreturned a silently degraded default and the plugin trusted it. Bitmap families now use the plugin's loader regardless of what the catalog claims.tom_thumbis also wired up —tom-thumb.bdfwas always shipped, just absent from the family map.All four now render distinctly, verified the same way:
Net: 2 of 5 working → 4 of 4 working, rather than just deleting the broken ones.
The old README documented strings the code never produces
It promised
"1 Day"and"TODAY!" (shown in bright yellow). Neither exists anywhere inmanager.py. The real ladder, now shown as six real renders:N DaysTomorrow(no number)Nh NmNmNOW!Nd ago, hidden unlessshow_expiredAlso corrected: the stale
Pillow >= 9.0.0requirement is actually>= 12.2.0.Audits before opening (as requested)
layoutandstyleoverride objects)Worth noting the section check is a heuristic and flagged ten headings, most of them false positives once I read the content. It's a prompt to go look, not an oracle.
Verification
python scripts/check_plugin.py --plugin countdown— 8/8 PASS, goldens unchanged (the harness pinspress_start, a.ttf, so the font work doesn't move them)python scripts/run_plugin_tests.py countdown— 1 passedrender_docs_assets.py --plugin countdown --check— images matchcheck_module_collisions.py— OK across 43 pluginsplugins.jsonregenerated🤖 Generated with Claude Code