twardoch/fonttools-opentype-feature-freezer

Cannot enable the "ss07" feature in FiraCode font

MarcosBaungartner opened this issue · 17 comments

Greetings,
I'm trying to enable the ss07 feature in FiraCode font, but it doesn't working.

Command:

pyftfeatfreeze -n -v -f "ss07" FiraCode-Regular.ttf FiraCode-Regular-ss07.ttf

Output:

INFO: [RemapByOTL] Running with options: Namespace(features='ss07', info=False, inpath='FiraCode-Regular.ttf', lang=None, names=True, outpath='FiraCode-Regular-ss07.ttf', rename=False, replacenames='', report=False, script='latn', usesuffix='', verbose=True, zapnames=False)
INFO: [openFont] Opened font: FiraCode-Regular.ttf
INFO: [filterFeatureIndex] FeatureIndex: [3, 19, 35, 51, 67, 93, 109, 125, 141, 157, 173, 189, 205, 221, 237, 253, 269, 285, 301, 317, 333, 349]
INFO: [filterLookupList] Features to apply: ['ss07']
INFO: [filterLookupList] Lookups: [138, 139]

INFO: [saveFont] Saved font: FiraCode-Regular-ss07.ttf
INFO: Finished processing.

This command with these feature works fine:

pyftfeatfreeze -n -v -f "ss01,ss03,ss05" FiraCode-Regular.ttf FiraCode-Regular-ss01-03-05.ttf

I'm not having any luck either. If I pass "ss02,ss03" I get an error for the 3 changes. If I do "ss02, ss03", I only get an error on <= and >= (so & should have gone through), but the change isn't registered when I re-select Fira Code regular. Doesn't seem to be baked.

I'm not having any luck either. If I pass "ss02,ss03" I get an error for the 3 changes. If I do "ss02, ss03", I only get an error on <= and >= (so & should have gone through), but the change isn't registered when I re-select Fira Code regular. Doesn't seem to be baked.

If i put a space like "ss03, ss05" it doesn't work.
You don't need the quotes, try this:
pyftfeatfreeze -n -v -f ss02,ss03

From this command I get the following warnings:
pyftfeatfreeze -n -v -f ss02,ss03 FiraCode-Regular.ttf FiraCode-Regular-ss02-03.ttf

INFO: [applySubstitutions] Remap: 'ampersand' -> 'ampersand.ss03'
WARNING: [applySubstitutions] Cannot remap 'ampersand_ampersand.liga' -> 'ampersand.ss03' because neither has a Unicode value assigned in any of the cmap tables.
WARNING: [applySubstitutions] Cannot remap 'greater_equal.liga' -> 'greater_equal.ss02' because neither has a Unicode value assigned in any of the cmap tables.
WARNING: [applySubstitutions] Cannot remap 'less_equal.liga' -> 'less_equal.ss02' because neither has a Unicode value assigned in any of the cmap tables.

Yes, that is as designed.

Ah ok. Thanks. First time trying to use this or bake in ligature changes. So disregard warnings? Still not seeing the ss02 and ss03 changes in the font on reload.

It should remap 1:1 glyphs where the source has a Unicode. Ligatures won’t work.

But if i enable these settings in Visual Studio Code, they all work swiftly:

In settings.json:
"editor.fontLigatures": "'true', 'ss07'",

You can use ligatures when they’re OT features but the feature freezer cannot remap ligatures to default glyphs because they don’t correspond to a single Unicode character

This tool moves the Unicode codepoints for a glyph that represents a single character — from the default glyph that has a Unicode to an alternate glyph (which is normally accessible via a feature). This tool only remaps 1:1 substitutions, while ligatures are n:1.

The tool also won’t work on “stacked features” e.g. for variants of ligatures, because the source glyph must have a Unicode.

Yes, i used "enable" as a matter of speaking.
I understand that it only remaps the Unicode, so the ss07 doesn't have a Unicode because it is a ligature, so the tool cannot remap that.
Thanks for clarify that.

Yes, it further won’t work if a glyph is only accessible only through a combination of multiple features, which is not a systemic limitation, just of the implementation.

I’m uncertain whether I’m having the same issue or experiencing something different in my Recursive project.

arrowtype/recursive-code-config#4 (comment)

In Instanced statics, almost all stylistic sets will freeze in, except for a simplified i – even though its naming & substitution rules are almost exactly like other glyphs that are working. @twardoch do you think this is likely to be the same, or something different? (Thanks for such an amazing tool, by the way!)

@mrbaungartner I made a new app that can handle your needs. Please check it out: https://mutsuntsai.github.io/fontfreeze/

@mrbaungartner I made a new app that can handle your needs. Please check it out: https://mutsuntsai.github.io/fontfreeze/

@MuTsunTsai Very nice tool, but it is throwing an error when I try to generate the FiraCode with ss01-03-05-08 features.

Captura de tela 2022-07-26 144900

@mrbaungartner Try start with FiraCode-VF.ttf (in the variable_ttf folder in the zip file); I have no problem generating ss01-03-05-08 with it. Please report further issue directly in the FontFreeze repo.

@MuTsunTsai It works with the variable_ttf, but it is lighter than the FiraCode-Regular.ttf (I get an error if I generate with a Weight of 450)

@MarcosBaungartner Did you use the latest version of FiraCode (6.002)? I have no problem generating ss01-03-05-08 with weight 450 using FiraCode-VF.ttf. And please, do report further issue directly in the FontFreeze repo, as I won't be routinely checking replies here, and any further discussion would be off-topic here.