Ligaturizer icon indicating copy to clipboard operation
Ligaturizer copied to clipboard

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

Open kshetline opened this issue 4 years ago • 3 comments

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.

kshetline avatar May 05 '20 04:05 kshetline

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.

ToxicFrog avatar Jul 31 '20 13:07 ToxicFrog

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.

Cons-Cat avatar Nov 11 '20 21:11 Cons-Cat

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.

ToxicFrog avatar Sep 04 '21 13:09 ToxicFrog