Skip to content

Resolve or eliminate direct cwd-relative font loads in the scoreboard family #240

Description

@coderabbitai

Summary

Resolve or eliminate direct cwd-relative font loads in the scoreboard family.

Context

The supported systemd deployment sets WorkingDirectory=/home/devpi/LEDMatrix, so existing direct paths such as assets/fonts/4x6-font.ttf resolve today. Do not apply a one-line or one-plugin path rewrite.

ChuckBuilds/LEDMatrix#425 makes the core FontManager resolve assets/fonts against the install root. After that change merges, family-based font resolution is covered. The remaining scope is direct ImageFont.truetype("assets/fonts/...") calls in the scoreboard family.

The planned shared-sports-code unification in docs/plugin-development/08-shared-sports-code.md intends to retire these direct call sites by routing through core helpers. Prefer that resolution when it is available.

Scope

  • Audit direct cwd-relative ImageFont.truetype("assets/fonts/...") calls in scoreboard sports.py modules.
  • Audit equivalent direct calls in scoreboard game_renderer.py sibling modules.
  • Resolve the direct paths through an install-root-aware/core helper, or remove them through the planned shared-sports-code unification.
  • Keep current font fallback behavior.
  • Do not make an isolated migration that leaves related scoreboard font-loading paths inconsistent.

Current estimate: approximately seven direct loads per sports.py across nine scoreboard plugins, plus game_renderer.py siblings.

Acceptance criteria

  • No retained scoreboard direct font load depends on the process working directory.
  • The implementation uses the core font-resolution approach when practical, or removes the direct load during shared-code convergence.
  • Existing font aliases, configured fonts, and fallback fonts retain their current behavior.
  • The affected scoreboard plugins pass the relevant safety harness validation across supported panel sizes.

References

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions