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
feat!: Support fractional fonts and grid sizes (try 2) #2500
Conversation
The underline thickness is inconsistent, so that's probably something that needs fixing. |
Test Results 6 files 6 suites 18s ⏱️ Results for commit b67f700. ♻️ This comment has been updated with latest results. |
On Windows, slight hinting is probably too much, it distorts the text a bit. None is better. And to restore the full quality, I think we need to implement gamma correct rendering. I have already been experimenting with that, and it seems to greatly increase the antialiasing quality. |
This also seem to be causing bad performance regressions on Windows, probably related to the caching behaviour. Marking as draft due to the various issues |
4d5fdf4
to
b03f9a4
Compare
The performance and quality issues have been fixed by ensuring that the vertical grid size is always an integer size. If not, the grid size is rounded up, the way it works in other terminal emulators. It could also round to the nearest, but then it works differently than those. |
b03f9a4
to
5c87045
Compare
NOTE: The grid is still integer sized, so it's rendered wrong
… offsets again The baseline snapping needs to be disabled so that the lines are properly placed, and not snapped to pixels. While using integer based scroll offsets greatly reduces the pressure on the Skia font cache.
A bigger default size with cleanup when idling
This improves the quality and the performance of the font rendering.
5c87045
to
b67f700
Compare
* Always use fractional font sizes NOTE: The grid is still integer sized, so it's rendered wrong * Remove fudge factor * Properly set a fractional grid size * Disable baseline snapping, and enable rounding to integers for scroll offsets again The baseline snapping needs to be disabled so that the lines are properly placed, and not snapped to pixels. While using integer based scroll offsets greatly reduces the pressure on the Skia font cache. * Plot the skia cache sizes * Improve the Skia font cache usage A bigger default size with cleanup when idling * Fix fractional border positions * Update the documentation * Enable baseline snap * Ceil the font height to the nearest pixel This improves the quality and the performance of the font rendering.
What kind of change does this PR introduce?
This is #2485 again, with some changes to improve the text clarity and performance. This bug was also fixed: #2485 (comment) and the documentation updated.
This properly renders arbitrary font sizes, so the fudge factor is now removed. The hack for floating point font sizes is also
removed, since it always caused the wrong spacing.
NOTE: This needs careful testing to make sure that we don't cause any regression in font quality. The optimal hint settings also need to be determined on different platforms, resolutions and screens. Ideally that would be read from font-config on Linux, but that's another feature support. In any case, the changed default to slight seems to match with the default of font-config, at least on my system.
Did this PR introduce a breaking change?
A breaking change includes anything that breaks backwards compatibility either at compile or run time.
Notes