Skip to content

fix(steami_screen): Improve text scaling beyond bold offset effect. #369

@nedseb

Description

@nedseb

Problem

The current _draw_scaled_text() implementation for scale=2 draws the same text 4 times with a 1px offset, producing a bold/blurry effect rather than a true pixel-scale zoom. The result is difficult to read on the SSD1327 OLED, especially for value() which uses scale=2 by default.

Observed on hardware during testing of hello_world.py example.

Current implementation

if scale == 2:
    for dx in range(2):
        for dy in range(2):
            self._d.text(text, x + dx, y + dy, color)

Possible approaches

  1. Pixel-by-pixel scaling: render text at 1x into a temporary framebuf, then read each pixel and draw a scale x scale rect for lit pixels. Requires framebuf.pixel() read support.
  2. Font bitmap table: embed a larger font (e.g. 16x16) and render directly. More RAM but crisp output.
  3. Backend-specific: let backends that support scaled text (e.g. GC9A01 with TrueType) handle it natively via draw_scaled_text().

Reference

The limitation is documented in the README ("Note: scale=2 produces a bold effect, not a true pixel-scale zoom") and in the _draw_scaled_text() docstring.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions