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

Slice does not seem to activate axis-based (rvrn) substitutions #109

Open
Shrinks99 opened this issue Mar 22, 2023 · 9 comments
Open

Slice does not seem to activate axis-based (rvrn) substitutions #109

Shrinks99 opened this issue Mar 22, 2023 · 9 comments

Comments

@Shrinks99
Copy link

I'm trying to create a single cut of the excellent Recursive with its mono axis set to 0.51. At this value a bunch of characters are substituted for their monospaced slab-serif alternates (check out r which is substituted for r.mono). Unfortunately when I set up slice with a mono value of 0.51 it does not perform this substitution, and because the typeface is output as a single axis I cannot select this substitution in most (any?) software as it's a contextual alternate and won't appear in a stylistic set or ligatures option.

It would be helpful to have the option to bake those types of character substitutions specifically into the sliced font file? Somewhat niche use case, I know!

Otherwise this tool works quite well and is very helpful! Thank you for making it :)

@kenmcd
Copy link

kenmcd commented Mar 22, 2023

The r.mono substitution is also affected by cursive (CRSV).
~cr<0.09&0.5<mo, ~cr<0.9&0.5<mo&-14.99<sl
And it appears Slice does not automatically use the default.
When I set CRSV to 0 or 0.5 it seems to work.
The image below is the result with:

  • MONO 0.51
  • CASL 0
  • wght 400
  • slnt 0
  • CRSV 0

CorpSemiMono-Regular-preview

Here is the font: CorpSemiMono-Regular.ttf.zip

Also exported an OTF from FontLab with the same settings:
CorpSemiMono-Regular.otf.zip

So Slice appears to work if you specifically set the axes.

@Shrinks99
Copy link
Author

Shrinks99 commented Mar 22, 2023

Hey! You know exactly what issue I'm trying to solve! Thank you for being so helpful regarding this issue (across two different sites nonetheless!) :)

Windows' font viewer seems to result in a different output than what the typeface actually displays in certian applications, specifically Affinity Designer which was a bonus struggle when trying to nail down what the actual issue was? Perhaps something that Affinity Designer is doing here is unstandard and this could be a bug on their end (I will go ahead and close this if you think that's the case), but after testing in Inkscape and Figma (both of which support variable fonts) your output is identical to Recursive with similar settings. In Designer the r and similar monospace axis substitutions still aren't swapped out properly?

Figma

Screenshot 2023-03-22 182250

Affinity Designer

Screenshot 2023-03-22 182319

Weird eh?

@kenmcd
Copy link

kenmcd commented Mar 22, 2023

Interesting... I can see the issue.

The .ttf font from Slice uses the Required Variation Alternates (rvrn) OpenType feature to replace the characters.
And APub is not processing the rvrn feature apparently.
Which is a bug.

The .otf font from FontLab is swapping the alternates into the normal character codes - so they just work.
Try that one and you will see.

Since the font from FontLab does work in APub as expected...
Why don't we take the discussion back to the Affinity forum.
OK to use that same thread - others will benefit.
Tell me exactly what you are trying to do.
Such as make your own R/I/B/BI corp font set. ? ? or?
And exactly what the axes settings are supposed to be, etc.

@kenmcd
Copy link

kenmcd commented Mar 23, 2023

@chrissimpkins
Should Slice be using rvrn for a static font?
Based on the OpenType specs it appears to be only for variable fonts "and is always used in conjunction with a FeatureVariations table".
So it really does not make sense to me that when creating static fonts, primarily for applications which do not support variable fonts, that the rvrn feature is used.
What is the thinking here?

@Shrinks99
Copy link
Author

Shrinks99 commented Mar 23, 2023

Briefly looking at the code it seems Slice actually calls FontTools for creating the instance... Perhaps I've opened this issue in the wrong repo? I can confirm that FontTools' instantiateVariableFont function results in the same issue when using it through the CLI.

EDIT: Have opened a discussion question in the FontTools repo discussions: fonttools/fonttools#3057

@kenmcd
Copy link

kenmcd commented Mar 23, 2023

Briefly looking at the code it seems Slice actually calls FontTools for creating the instance... Perhaps I've opened this issue in the wrong repo? I can confirm that FontTools' instantiateVariableFont function results in the same issue when using it through the CLI.

Hmmm... I wonder if there is a function in fonttools which could affect how that is done (if Yes, that should be an option in Slice).
The fonttools guys are very helpful when you ask specific questions - so you may want to ask there.

And how is it being done when the Recursive statics are built?

@Shrinks99 Shrinks99 changed the title Slice does not seem to activate axis-based substitutions Slice does not seem to activate axis-based (rvrn) substitutions Mar 26, 2023
@Shrinks99
Copy link
Author

Shrinks99 commented Mar 26, 2023

As my final(?) update to this issue, this is not a feature currently built into fontTools and as such, is not built into Slice. In order to solve it (thanks to the helpful suggestion from Jens Kutilek in that GH Discussions thread) I used OpenType Feature Freezer to freeze the rvrn tags after using Slice to generate the instanced font file.

I will leave this issue open to track the status of it being added to fontTools? If a corresponding issue is made over there I'll link it here. :)

EDIT: Here's the fontTools issue: fonttools/fonttools#3128

@davelab6
Copy link
Contributor

@behdad should this be added to fontTools?

@behdad
Copy link

behdad commented May 25, 2023

Yes, this sounds like something the fonttools instancer should do. I'll follow up in fonttools/fonttools#3057

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants