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

Split Italic and Roman VFs in builder #964

Merged
merged 3 commits into from
Jun 3, 2024
Merged

Conversation

simoncozens
Copy link
Contributor

Fixes #957.

We sometimes have source files containing an ital or slnt axis, but we require the onboarding of two separate fonts with Roman and Italic joined by style linking and STAT axis. This PR uses varLib.instancer to partially instance them along the relevant italic axis and then fixes them up accordingly.

Requires #963.

@simoncozens simoncozens marked this pull request as draft May 28, 2024 15:42
@simoncozens
Copy link
Contributor Author

Got a couple of babelfont-related issues here which mean I can't use it; will rethink.

@simoncozens simoncozens marked this pull request as ready for review May 30, 2024 11:55
@arrowtype
Copy link
Contributor

arrowtype commented May 30, 2024

Would this accurately handle discrete (non-continuous) Italic axes, or is that a separate issue?

For example, I’d like to do the following:

    <axis tag="ital" name="Italic" values="0 1" default="0">
      <labels>
        <label uservalue="0" name="Roman" elidable="true" />
        <label uservalue="1" name="Italic" />
      </labels>
    </axis>

This currently requires two designspace files, which pre-splits the axis between Roman and Italic sub-families. Luckily, this approach does seem to work well and create the STAT tables I want. Still, it requires some repeated information, which FontMake alone doesn’t require. I’m not sure how challenging this would be to map to the recipe logic of the Builder, though. If it’s not feasible, the builder still offers enough advantages that I would stick with it over directly using FontMake, but it would be handy to understand if the above axis setup is planned to be supported, or not.

Thanks for any insights!

@simoncozens
Copy link
Contributor Author

It probably would handle that if you have a single VF which is subspacable. I'm not sure what fontmake would do with that kind of designspace right now. Another option is DS5 designspaces which allow you to generate multiple VFs from the same designspace, but we absolutely don't support those quite yet and I'm not sure what tooling generates them anyway.

@simoncozens simoncozens merged commit 7d015db into main Jun 3, 2024
11 checks passed
@anthrotype
Copy link
Member

anthrotype commented Jun 3, 2024

fontmake supports building multiple VFS (sharing sources or axis subsets) from the same DSv5, it's handled in ufo2ft and fontTools.designspaceLib/varLib

DS5 designspaces which allow you to generate multiple VFs from the same designspace, but we absolutely don't support those quite yet and I'm not sure what tooling generates them anyway.

with since googlefonts/glyphsLib#977 @khaledhosny added support for converting Glyphs.app's Variable Font Export Settings to DSv5 <variable-fonts>, which means technically a .glyphs project that has more than one such VF Export Setting, when compiled by fontmake will export more than one VF at a time. I think this is mostly to be able to set different custom parameters on a VF export, but I'm not sure if these Glyphs.app VF Export settings would allow one to define a particular axis range. Maybe @khaledhosny knows?

@arrowtype
Copy link
Contributor

arrowtype commented Jun 4, 2024

Glyphs.app's Variable Font Export Settings ... I think this is mostly to be able to set different custom parameters on a VF export, but I'm not sure if these Glyphs.app VF Export settings would allow one to define a particular axis range.

@anthrotype having used this feature quite a bit recently, it is basically there to define the naming info, for example, if the family name is different or suffixed from the general family name given to static exports (e.g. "Familyname Variable"). From what I can see, the VF export settings and custom parameters don’t yet give any options around defining subsetting axis ranges, unlike the <variable-fonts> elements of a DSv5.

@emmamarichal
Copy link
Contributor

@simoncozens

I have a font with a backslant, where I need the backslant, and I have to get something like this: Myfont[slnt,wght].ttf.
Now the builder split the file in two, and I would like to know how to change the stat table or anything in the build process to avoid this?

@simoncozens
Copy link
Contributor Author

To keep a single file (turn off the splitting), set splitItalic: false in the config.yaml.

@emmamarichal
Copy link
Contributor

Cool, thank you!

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

Successfully merging this pull request may close these issues.

[builder] If font has ital axis, subspace into Roman and Italic
4 participants