tonsky / FiraCode

Free monospaced font with programming ligatures
SIL Open Font License 1.1
77.27k stars 3.1k forks source link

SUGGESTION & REQUEST: Make a stylistic set of an underscore that negates the effect of the ligatures #1468

Open grosz-geri opened 2 years ago

grosz-geri commented 2 years ago

So, in Fira Code with ligatures off, neither equal signs nor underscores connect. With ligatures on, both connect. With the stylistic set ss08, I can make the equal signs separated However, I don't see a set that does the same for underscores, which I assume is, because that doesn't exist. This is a suggestion / request for that feature. Thank you for your time!

Oh, and what I called stylistic sets are the special ligatures called stylistic sets: https://github.com/tonsky/FiraCode/wiki/How-to-enable-stylistic-sets

tonsky commented 2 years ago

Thanks, I’ll look into it

Firestar-Reimu commented 2 years ago

Me too, the ligatures make it difficult to see when using python where there is something like __main__.

wollmers commented 2 years ago

Ligatures can also be suppressed or forced independently of liga on or off. This would also be compatible across fonts, which implement it this way.

Suppress is the simpler case: insert a ZWNJ

U+200C  ‌     ZERO WIDTH NON-JOINER (Format)

Then the ligature rule c, k will not match, because the text sequence is c, ZWNJ, k. No extra support necessary in the font.

Forcing can be done by inserting ZWJ

U+200D  ‍      ZERO WIDTH JOINER (Format)

This needs support by the ligature rules in the font.

Of course the user needs some way to enter ZWNJ and ZWJ. If needed often, customise your key mapping and place them e.g. into the