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

font/shaper: split text runs on common bad ligature pairs #2086

Merged
merged 1 commit into from
Aug 11, 2024
Merged

Conversation

mitchellh
Copy link
Contributor

Fixes #2081

Many fonts have a bad ligature for "fl", "fi", or "st". We previously maintained a list of such fonts in quirks.zig. However, these are so common that it was suggested we do something more systematic and this commit is that.

This commit changes our text run splitting algorithm to always split on fl, fi, and st. This will cause some more runs for well behaved fonts but the combination of those characters is rare enough and our caching algorithm is good enough that it should be minimal overhead.

This commit renders our existing quirks fonts obsolete but I kept that logic around so we can add to it if/when we find other quirky font behaviors.

Fixes #2081

Many fonts have a bad ligature for "fl", "fi", or "st". We previously
maintained a list of such fonts in quirks.zig. However, these are so
common that it was suggested we do something more systematic and this
commit is that.

This commit changes our text run splitting algorithm to always split on
`fl`, `fi`, and `st`. This will cause some more runs for well behaved
fonts but the combination of those characters is rare enough and our
caching algorithm is good enough that it should be minimal overhead.

This commit renders our existing quirks fonts obsolete but I kept that
logic around so we can add to it if/when we find other quirky font
behaviors.
@mitchellh mitchellh merged commit 468a8e9 into main Aug 11, 2024
32 of 36 checks passed
@mitchellh mitchellh deleted the split branch August 11, 2024 22:40
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.

fonts: don't use ligatures for ASCII alphabetic characters by default
1 participant