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

Builder not building from a single-style Glyphs source #878

Closed
arrowtype opened this issue Mar 21, 2024 · 4 comments
Closed

Builder not building from a single-style Glyphs source #878

arrowtype opened this issue Mar 21, 2024 · 4 comments

Comments

@arrowtype
Copy link
Contributor

I’m having trouble with the gftools builder and a Glyphs file that has a single master and instance, called “Black.”

I’m currently on gftools 0.9.52.

My config looks like this:

familyName: Familyname
buildVariable: false
buildWebfont: false
interpolate: false
outputDir: ./fonts
sources:
  - Familyname.glyphs

This doesn’t build to static TTFs and OTFs, as desired. It gets this far before things start failing:

▶ gftools builder config.yaml
[1/6] instantiateUfo
fontmake -i Familyname Black -o ufo -g Familyname.glyphs --ufo-structure=json --instance-dir instance_ufos
[2/6] buildOTF
FAILED: /var/folders/nb/mc9zt2n930vd_jkbg0kn2d680000gn/T/tmpxxes2k05

First, I am slightly surprised the -i flag is passed, because the config includes interpolate: false.

Based on my testing, it seems like adding the -i flag in FontMake, when generating from a single-style glyphs doc, outputs/saves nothing. So, that might be the issue here. If the builder is adding the interpolate option and fontmake is therefore not creating UFOs, that would make the process stick.

If I run a similar command without -i flag, it generates the UFOs. I can then generate OTF and TTF fonts from there.

▶ fontmake -o ufo -g Familyname.glyphs --ufo-structure=json                             
INFO:fontmake.font_project:Building master UFOs and designspace from Glyphs source
INFO:glyphsLib.parser:Parsing .glyphs file
INFO:fontmake.font_project:Saving master_ufo/Familyname-Regular.designspace
INFO:fontmake.font_project:Saving master_ufo/Familyname-Regular.ufo.json
INFO:fontmake.font_project:Loading 1 DesignSpace source UFOs

Another potential problem seems to be that the reported fontmake command includes the arg -i Familyname Black (without quotes), so Black is flagged as a positional arg. If I run just that fontmake command, on its own, I get the following error:

fontmake: error: argument -g not allowed with positional input args: Black

I’ll dig in a little further and update this if I realize more clearly what is going wrong. I’m still new to the builder, so I’m still getting my footing around debugging here.

This also may just be a fontmake issue – it seems like it should still generate a single instance when given then -i flag, if there is just a single instance to generate. I can’t find an issue covering that, so I’ll go make that one, as well.

Any insights or pointers are welcome!

@arrowtype
Copy link
Contributor Author

(Side note: I feel like I must be missing something incredibly obvious, as the builder is surely used to create single-style fonts all the time. But ... it’s not obvious to me what I’m missing, yet. 😅)

@simoncozens
Copy link
Contributor

What's the bit after the "FAILED"?

@arrowtype
Copy link
Contributor Author

Here’s the fuller terminal context:

▶ gftools builder config.yaml
[1/7] fontmake -o ufo --instance-dir instance_ufo -g Familyname.glyphs
INFO:fontmake.font_project:Building master UFOs and designspace from Glyphs source
INFO:glyphsLib.parser:Parsing .glyphs file
INFO:fontmake.font_project:Saving master_ufo/Familyname-Black.designspace
INFO:fontmake.font_project:Saving master_ufo/Familyname-Black.ufo
INFO:fontmake.font_project:Loading 1 DesignSpace source UFOs
[2/7] fontmake -i -o ufo -m master_ufo/Familyname-Black.designspace 
INFO:fontmake.font_project:Loading 1 DesignSpace source UFOs
INFO:fontmake.font_project:Interpolating master UFOs from designspace
[3/7] fontmake -o ttf -u instance_ufo/Familyname-Black.ufo --filter ... --filter FlattenComponentsFilter --filter DecomposeTransformedComponentsFilter --output-path fonts/ttf/Familyname-Black.ttf --output-path fonts/ttf/Familyname-Black.ttf
FAILED: fonts/ttf/Familyname-Black.ttf 
fontmake -o ttf -u instance_ufo/Familyname-Black.ufo --filter ... --filter FlattenComponentsFilter --filter DecomposeTransformedComponentsFilter --output-path fonts/ttf/Familyname-Black.ttf --output-path fonts/ttf/Familyname-Black.ttf
usage: fontmake [-h] [--version] [-g GLYPHS | -u UFO [UFO ...] | -m
                DESIGNSPACE] [--glyph-data GLYPHDATA] [-o FORMAT [FORMAT ...]]
                [--output-path OUTPUT_PATH | --output-dir OUTPUT_DIR]
                [-i [INSTANCE_NAME]]
                [--variable-fonts [VARIABLE_FONT_FILENAME]] [-M]
                [--family-name FAMILY_NAME] [--round-instances]
                [--designspace-path DESIGNSPACE_PATH]
                [--master-dir MASTER_DIR] [--instance-dir INSTANCE_DIR]
                [--no-write-skipexportglyphs] [--validate-ufo]
                [--check-compatibility | --no-check-compatibility]
                [--expand-features-to-instances]
                [--fea-include-dir FEA_INCLUDE_DIR] [--no-generate-GDEF]
                [--save-ufo-as-zip | --ufo-structure {package,zip,json}]
                [--indent-json] [--keep-overlaps] [--overlaps-backend BACKEND]
                [--keep-direction]
                [--ttf-curves {cu2qu,mixed,keep-quad,keep-cubic}] [-e ERROR]
                [-f] [-a [AUTOHINT]] [-A] [--cff-round-tolerance FLOAT]
                [--optimize-cff OPTIMIZE_CFF]
                [--subroutinizer {compreffor,cffsubr}] [--no-optimize-gvar]
                [--filter CLASS] [--no-auto-use-my-metrics]
                [--drop-implied-oncurves]
                [--interpolate-binary-layout [MASTER_DIR]]
                [--feature-writer CLASS] [--debug-feature-file FILE]
                [--no-variable-features] [--mti-source MTI_SOURCE]
                [--production-names | --no-production-names]
                [--subset | --no-subset] [-s | -S] [--timing]
                [--verbose LEVEL]
                [INPUTS ...]
fontmake: error: instance_ufo/Familyname-Black.ufo not found
[4/7] fontmake -o otf -u instance_ufo/Familyname-Black.ufo --filter ... --filter FlattenComponentsFilter --filter DecomposeTransformedComponentsFilter --output-path fonts/otf/Familyname-Black.otf --output-path fonts/otf/Familyname-Black.otf
FAILED: fonts/otf/Familyname-Black.otf 
fontmake -o otf -u instance_ufo/Familyname-Black.ufo --filter ... --filter FlattenComponentsFilter --filter DecomposeTransformedComponentsFilter --output-path fonts/otf/Familyname-Black.otf --output-path fonts/otf/Familyname-Black.otf
usage: fontmake [-h] [--version] [-g GLYPHS | -u UFO [UFO ...] | -m
                DESIGNSPACE] [--glyph-data GLYPHDATA] [-o FORMAT [FORMAT ...]]
                [--output-path OUTPUT_PATH | --output-dir OUTPUT_DIR]
                [-i [INSTANCE_NAME]]
                [--variable-fonts [VARIABLE_FONT_FILENAME]] [-M]
                [--family-name FAMILY_NAME] [--round-instances]
                [--designspace-path DESIGNSPACE_PATH]
                [--master-dir MASTER_DIR] [--instance-dir INSTANCE_DIR]
                [--no-write-skipexportglyphs] [--validate-ufo]
                [--check-compatibility | --no-check-compatibility]
                [--expand-features-to-instances]
                [--fea-include-dir FEA_INCLUDE_DIR] [--no-generate-GDEF]
                [--save-ufo-as-zip | --ufo-structure {package,zip,json}]
                [--indent-json] [--keep-overlaps] [--overlaps-backend BACKEND]
                [--keep-direction]
                [--ttf-curves {cu2qu,mixed,keep-quad,keep-cubic}] [-e ERROR]
                [-f] [-a [AUTOHINT]] [-A] [--cff-round-tolerance FLOAT]
                [--optimize-cff OPTIMIZE_CFF]
                [--subroutinizer {compreffor,cffsubr}] [--no-optimize-gvar]
                [--filter CLASS] [--no-auto-use-my-metrics]
                [--drop-implied-oncurves]
                [--interpolate-binary-layout [MASTER_DIR]]
                [--feature-writer CLASS] [--debug-feature-file FILE]
                [--no-variable-features] [--mti-source MTI_SOURCE]
                [--production-names | --no-production-names]
                [--subset | --no-subset] [-s | -S] [--timing]
                [--verbose LEVEL]
                [INPUTS ...]
fontmake: error: instance_ufo/Familyname-Black.ufo not found
ninja: build stopped: subcommand failed.
Removed file: build.ninja
Removed file: .ninja_log
Removed directory: master_ufo
Removed directory: instance_ufo
Done building fonts!

@arrowtype
Copy link
Contributor Author

Sorry, it seems that I was missing something relatively obvious, in hindsight.

The Glyphs document had a mismatch between the single Master and Export. The Master was specified as weight=100, while the Export had weight=900. Once the Master was updated to weight=900, the build worked as expected.

So, false alarm here. Thanks for the help in debugging it, though!

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

2 participants