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

Is there a way to handle Fira Code's style variants? (e.g. ss02, ss03, zero, etc.) #88

Open
kshetline opened this issue May 5, 2020 · 4 comments

Comments

@kshetline
Copy link

I'd like to be able to specify that I copy from Fira Code, for example, the versions of and which have a horizontal bar instead of an angular bar, which is what I get now.

There's also something new in Fira Code that turns the x in a hexadecimal number like 0xFF into a raised ×, like 0×FF. I don't know if that's done using sixteen different ligatures, from 0x0 through 0xF, or by some other font trick, but it would be great to be able to copy that feature into other fonts as well.

@ToxicFrog
Copy link
Owner

For the former, if they're published as different font files, you can probably just replace the one it uses as input to the patcher wth the variant you want. If they're all different styles embedded in the same font...I have no idea.

For the latter, I can investigate when I'm updating to a more recent Fira, but time to work on this has been short lately.

@Cons-Cat
Copy link

Cons-Cat commented Nov 11, 2020

For the former, if they're published as different font files, you can probably just replace the one it uses as input to the patcher wth the variant you want. If they're all different styles embedded in the same font...I have no idea.

For the latter, I can investigate when I'm updating to a more recent Fira, but time to work on this has been short lately.

The way it basically works is you can replace "liga" with the alternate set you want.

{   # >=
    'chars': ['greater', 'equal'],
    'firacode_ligature_name': 'greater_equal.liga',
},

Turn it into:

{   # >=
    'chars': ['greater', 'equal'],
    'firacode_ligature_name': 'greater_equal.ss02',
},

This gives your fonts the alternate >= symbol when make is ran. Take a look at these:

Visual Legends: https://github.com/tonsky/FiraCode/blob/master/extras/stylistic_sets.png
The Real Code: https://github.com/tonsky/FiraCode/tree/master/features

This isn't really porting the styles over tho, it's just selecting which style you want frozen onto the output fonts.

@ToxicFrog
Copy link
Owner

That seems like a decent workaround if you know up front what variants you want; I don't know enough about fonts to know how to make them runtime-selectable, though.

@pa-0
Copy link

pa-0 commented Nov 23, 2024

@Cons-Cat this makes sense, thank you - but what about ss[##] for single characters, e.g. ampersand, the 'at' sign, dollar sign, lowercase 'r', and so on (see stylistic_sets.png linked from v3.1 of Fira repo)?

image

The ligatures.py script you referenced seems to only cover ligatures (*.liga) where multiple characters are involved. Single characters are mentioned at the top of the same file but they do not have the .liga extension which we would otherwise replace with .ss[##] shown in the image above.

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

No branches or pull requests

4 participants