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

Suppress run breaking for abs. differences < 0.001 in advance #4861

Merged
merged 1 commit into from
Mar 10, 2020

Conversation

DHowett-MSFT
Copy link
Contributor

With certain font faces at certain sizes, the advances seem to be
slightly more than the pixel grid; Cascadia Code at 13pt (though, 200%
scale) had an advance of 10.000001.

This commit makes it so that anything sub-1/100 of a cell won't make us
break up runs, because doing so results in suboptimal rendering.

Fixes #4806.


I wrote a renderer hack that colors text runs by their origin x (blue+) and y (red+).

This shows that at font size 12, we were only doing one run per line.

image

This shows that at font size 13, we were doing one run per cell.

image

With certain font faces at certain sizes, the advances seem to be
slightly more than the pixel grid; Cascadia Code at 13pt (though, 200%
scale) had an advance of 10.000001.

This commit makes it so that anything sub-1/100 of a cell won't make us
break up runs, because doing so results in suboptimal rendering.

Fixes #4806.
@DHowett-MSFT DHowett-MSFT added the Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues label Mar 10, 2020
@DHowett-MSFT
Copy link
Contributor Author

This does allow for a font to do a weird thing that makes the 100th character in a row be off by a whole cell, but why would it do that

Copy link
Member

@miniksa miniksa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine.

@DHowett-MSFT DHowett-MSFT merged commit d954ad6 into master Mar 10, 2020
@DHowett-MSFT DHowett-MSFT deleted the dev/duhowett/suboptimal_my_eye branch March 10, 2020 18:12
abhijeetviswam pushed a commit to abhijeetviswam/terminal that referenced this pull request Mar 12, 2020
…oft#4861)

With certain font faces at certain sizes, the advances seem to be
slightly more than the pixel grid; Cascadia Code at 13pt (though, 200%
scale) had an advance of 10.000001.

This commit makes it so that anything sub-1/100 of a cell won't make us
break up runs, because doing so results in suboptimal rendering.

Fixes microsoft#4806.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Rendering Text rendering, emoji, complex glyph & font-fallback issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

At certain font sizes, ligatures only render in the rightmost cell
4 participants