Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pixel-perfect rendering at medium size impeded #6

Open
jengelh opened this issue Apr 17, 2024 · 0 comments
Open

Pixel-perfect rendering at medium size impeded #6

jengelh opened this issue Apr 17, 2024 · 0 comments

Comments

@jengelh
Copy link

jengelh commented Apr 17, 2024

Describe the bug

The minimum pt size to get pixel-perfect rendering is too high. Consider the glyph U+0030 DIGIT ZERO: left edge is at x=32u, right edge at x=1248u, cell width is 1536u. Font declares 1em=2304u.

To get pixel-perfect rendering, one must choose a pt size such that (x-in-units x screendpi x ptchosen / emsize / 72) is integral.

  • 32 x 96 x PT / 2304 / 72 = ...
  • 1248 x 96 x PT / 2304 / 72 = ...
  • 1536 x 96 x PT / 2304 / 72 = ...

One will find that (for a 96dpi environment) 54pt gives exact rendering. All smaller sizes therefore incur smoothing artfiacts.

Expected behavior

As many glyphs seem to share a left edge of 32 units, I suggest to move all glyph nodes left (or right) by 32u. For '0', the left edge is now at x=0 (or x=64), right edge at x=1216 (or x=1280).

64 x 96 x PT / 2304 / 72 =
1280 x 96 x PT / 2304 / 72 = ...
1536 x 96 x PT / 2304 / 72 = ...

and one finds a result of 27. Incidentally, Monocraft also has 27, so that's a good sign.

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

No branches or pull requests

1 participant