Skip to content

painter: the built-in font can be magnified - #27

Merged
tannevaled merged 1 commit into
mainfrom
text-scale
Sep 5, 2026
Merged

painter: the built-in font can be magnified#27
tannevaled merged 1 commit into
mainfrom
text-scale

Conversation

@tannevaled

Copy link
Copy Markdown
Contributor

The font is 5×7 pixels and was drawn at that size whatever the display. On a screen with two device pixels to the point a glyph is three and a half points tall — not small type, type nobody can read. Every other metric in the toolkit above this passes through a HiDPI scale; the one thing a person actually reads did not.

  • a whole number, because a bitmap font magnified by 1.5 has rows of unequal thickness and reads worse than the size it came from;
  • below 1 is 1: an invisible line of text is not a size anybody asked for;
  • TextWidth and TextHeight come with it — measuring was arithmetic every caller did for itself with the advance hard-coded, a number that has just stopped being constant, so every one of them would have right-aligned into the wrong place;
  • the zero value is 1:1, so nothing that exists changes.

The test checks the magnification exactly: one lit bit becomes an n×n block, so a scale of three lights nine times the ink for the same glyphs.

🤖 Generated with Claude Code

The font is 5x7 PIXELS and was drawn at that size whatever the display.
On a screen with two device pixels to the point a glyph is three and a
half points tall — not small type, type nobody can read. Every other
metric in the toolkit above this passes through a HiDPI scale; the one
thing a person actually reads did not.

A WHOLE number, because a bitmap font magnified by 1.5 has rows of
unequal thickness and reads worse than the size it came from. Below 1 is
1: an invisible line of text is not a size anybody asked for.

TextWidth and TextHeight come with it. Measuring was arithmetic every
caller did for itself with the advance hard-coded — a number that has
just stopped being constant, so every one of them would have
right-aligned into the wrong place.

The zero value is 1:1, so nothing that exists changes.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@tannevaled
tannevaled merged commit b340d67 into main Sep 5, 2026
3 checks passed
@tannevaled
tannevaled deleted the text-scale branch September 5, 2026 17:44
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