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

feat!: Support fractional fonts and grid sizes (try 2) #2500

Merged
merged 10 commits into from May 11, 2024

Conversation

fredizzimo
Copy link
Member

@fredizzimo fredizzimo commented Apr 24, 2024

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.

  • Yes, the font size will be different, since no fudge factor is applied. So, you might have to adjust your configuration accordingly.

Notes

@fredizzimo fredizzimo changed the title feat!: Support fractional fonts and grid sizes try 2 feat!: Support fractional fonts and grid sizes (try 2) Apr 24, 2024
@fredizzimo
Copy link
Member Author

The underline thickness is inconsistent, so that's probably something that needs fixing.

Copy link

github-actions bot commented Apr 24, 2024

Test Results

  6 files    6 suites   18s ⏱️
110 tests 110 ✅ 0 💤 0 ❌
644 runs  644 ✅ 0 💤 0 ❌

Results for commit b67f700.

♻️ This comment has been updated with latest results.

@fredizzimo
Copy link
Member Author

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.

@fredizzimo
Copy link
Member Author

fredizzimo commented Apr 25, 2024

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

@fredizzimo fredizzimo marked this pull request as draft April 25, 2024 08:58
@fredizzimo fredizzimo marked this pull request as ready for review April 28, 2024 18:00
@fredizzimo
Copy link
Member Author

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.

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.
@Kethku Kethku merged commit f5bab65 into neovide:main May 11, 2024
13 checks passed
@agraven agraven mentioned this pull request May 15, 2024
zbyna pushed a commit to zbyna/neovide that referenced this pull request May 17, 2024
* 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.
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.

None yet

2 participants