painter: the built-in font can be magnified - #27
Merged
Merged
Conversation
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>
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.
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.
TextWidthandTextHeightcome 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 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