Skip to content

fix(ledmatrix-stocks): make the bitmap fonts work, and document every setting - #394

Merged
ChuckBuilds merged 1 commit into
mainfrom
docs/stocks-readme
Sep 3, 2026
Merged

fix(ledmatrix-stocks): make the bitmap fonts work, and document every setting#394
ChuckBuilds merged 1 commit into
mainfrom
docs/stocks-readme

Conversation

@ChuckBuilds

@ChuckBuilds ChuckBuilds commented Sep 3, 2026

Copy link
Copy Markdown
Owner

The font bug

A .bdf is a bitmap face that exists at exactly one pixel size. Choosing 5x7.bdf or 4x6.bdf at any other size raised inside FreeType, and display_renderer.py caught it and substituted PressStart2P:

except Exception:
    self.logger.warning(f"Could not load BDF font {font_name} with PIL, using default")
    # Fall through to default

So the font menu appeared to work while silently ignoring the choice at twelve of the thirteen sizes the schema offers. Bitmap faces now load at their declared PIXEL_SIZE when the requested size is unavailable — the same fix already merged for clock-simple (#362), countdown (#363), news (#369), tide-display (#370), mqtt-notifications/youtube-stats (#374) and proposed for jellyfin-now-playing (#388).

cozette.bdf is removed from all six font menus. The core ships no file of that name, so selecting it could never work — see #387.

Same MINOR-vs-MAJOR judgement as #388: removing an enum value is a "removed option", but no working configuration can break because the value never loaded. 2.8.0 → 2.9.0.

Images

The plugin had none. All of these are real output, rendered from a recorded quote seeded into the cache the plugin already reads:

  • a gain, a loss, and a crypto entry — showing the separate stock/crypto colour blocks
  • display_mode scroll vs switch
  • toggle_chart on and off
  • four panel sizes

These use the frames option from #369, which is what made them possible: frame 0 of a scrolling plugin is blank, because the ticker starts off-panel. My first render came out empty for exactly that reason.

The crypto row is rendered at 256 wide rather than 128 — the -812.00 (-1.3%) line is genuinely wider than a 128px panel, so no single frame of it fits there. The caption says so rather than showing a half-cropped line.

Settings

The eight per-element colour keys were covered by one sentence — "green for positive deltas and red for negative". They are now a table, including that price_delta has no text_color because its colour is picked by the sign of the change. 41 of 41 settings are documented; the config-token audit drops nothing.

One thing worth knowing

check_plugin.py passes 8/8, but every size reports "drew nothing but display() returned None". The plugin ships no test/harness.json, so the harness has no quote data, and a scroll's first frame is blank regardless — meaning the safety harness has never actually exercised this plugin's rendering. Filed separately as #395.

🤖 Generated with Claude Code

… setting

A .bdf is a bitmap face that exists at exactly one pixel size. Choosing
5x7.bdf or 4x6.bdf at any other size raised inside FreeType, and the renderer
caught it and substituted PressStart2P with a log warning -- so the font menu
appeared to work while quietly ignoring the choice at twelve of the thirteen
offered sizes. Bitmap faces now load at their declared PIXEL_SIZE instead.

cozette.bdf is removed from all six font menus: the core ships no file of that
name, so it could never load at any size (#387).

README: real rendered screenshots throughout -- a gain, a loss, a crypto entry,
both display modes, the inline chart on and off, and four panel sizes -- all
from a recorded quote seeded into the cache the plugin already reads.

The eight per-element colour keys were previously one sentence ("green for
positive deltas and red for negative"); they are now a table, including the
detail that price_delta has no text_color because its colour comes from the
sign of the change. That takes the plugin to 41 of 41 settings documented.

The scroll shots use the frames option from #369: the ticker starts off-panel,
so frame 0 of a scrolling plugin is blank.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: 589378f6-f66d-4e75-8ae2-81fe95fbde20


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 9 complexity

Metric Results
Complexity 9

View in Codacy

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.

@ChuckBuilds
ChuckBuilds merged commit 99cddf9 into main Sep 3, 2026
4 checks passed
@ChuckBuilds
ChuckBuilds deleted the docs/stocks-readme branch September 3, 2026 13:29
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