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

Cannot enable the "ss07" feature in FiraCode font #20

Open
MarcosBaungartner opened this issue Jun 25, 2020 · 17 comments
Open

Cannot enable the "ss07" feature in FiraCode font #20

MarcosBaungartner opened this issue Jun 25, 2020 · 17 comments

Comments

@MarcosBaungartner
Copy link

MarcosBaungartner commented Jun 25, 2020

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
@Axel-Shark
Copy link

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.

@MarcosBaungartner
Copy link
Author

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

@Axel-Shark
Copy link

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.

@twardoch
Copy link
Owner

Yes, that is as designed.

@Axel-Shark
Copy link

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.

@twardoch
Copy link
Owner

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

@MarcosBaungartner
Copy link
Author

MarcosBaungartner commented Jun 27, 2020

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

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

@twardoch
Copy link
Owner

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

@twardoch
Copy link
Owner

twardoch commented Jun 27, 2020

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.

@MarcosBaungartner
Copy link
Author

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.

@twardoch
Copy link
Owner

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.

@arrowtype
Copy link

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!)

@MuTsunTsai
Copy link

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

@MarcosBaungartner
Copy link
Author

@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

@MuTsunTsai
Copy link

MuTsunTsai commented Jul 27, 2022

@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.

@MarcosBaungartner
Copy link
Author

MarcosBaungartner commented Jul 30, 2022

@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)

@MuTsunTsai
Copy link

@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.

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

5 participants