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

Old style nums variant prevents lot of ligatures #561

Closed
paradoxxxzero opened this issue Mar 1, 2018 · 6 comments
Closed

Old style nums variant prevents lot of ligatures #561

paradoxxxzero opened this issue Mar 1, 2018 · 6 comments
Milestone

Comments

@paradoxxxzero
Copy link

Problem

Some characters like = (equal) have an identical onum variant (equal.tosf). This breaks the ligatures since there are none with equal.tosf.

Exemple

  • Normal:
    screenshot from 2018-03-01 16-09-29

  • With ligatures (default):
    screenshot from 2018-03-01 16-09-37

  • With oldstyle nums:
    screenshot from 2018-03-01 16-09-43

  • With both:
    screenshot from 2018-03-01 16-09-47

Suggestion:

Remove the .tsof variant for characters that doesn't change with the onum feature to restore default ligatures.

Thanks

@tonsky
Copy link
Owner

tonsky commented Mar 1, 2018

Makes sense, but still leaves lots of characters that do change. May I ask what’s your use-case? Why are you turning on both old-style numerals and ligatures?

@paradoxxxzero
Copy link
Author

paradoxxxzero commented Mar 1, 2018

Because I like coding with old-style nums (for some reason it helps me read long numbers) and I like this font ligatures!

Besides removing features seemed like an easy fix, since most ligatured chars (at least the one I use) do not change.

@paradoxxxzero
Copy link
Author

FYI I removed (with fontforge I don't have access to glyphs) all .tsof variants except numbers (which seem to be the only ones varying) and everything is working fine except the multiply (1x1) and the uc (1:1) ligatures that operate on regular numbers and not on the old style. (It still is a lot better)

@camsteffen
Copy link

Would someone be so kind to explain this change for curious simpletons like myself?

@j-f1
Copy link
Contributor

j-f1 commented Sep 13, 2019

This change means that you’ll be able to use old-style numbers along with ligatures that appear directly next to numbers. Here’s a screenshot showing the difference between normal and old-style numbers:

@tonsky
Copy link
Owner

tonsky commented Sep 16, 2019

@camsteffen

Ligatures are pattern based. E.g. you want to replace -> with an arrow. The code for that would be:

sub hyphen greater by hyphen_greater.liga;

So if your program sees hyphen glyph followed by greater glyph it would replace both with a single hyphen_greater.liga which contains a double-width arrow in case of Fira Code.

Old-style numbers are implemented the same way:

sub zero by zero.onum;
sub one by one.onum;

The problem is that it used to replace not only numbers but some symbols like -, +, <, >, % and so on. If onum substitution happens first ligatures won’t work because character is not different:

hyphen greater -> hyphen.onum greater.onum -> ??? (does not match <hyphen> <greater>)

This change removes substitutions for everything except the numbers, so both old-style numbers and ligatures can work at the same time.

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 a pull request may close this issue.

4 participants