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

UX improvement: Missing axis should fail to build unless override with arg #1018

Open
davelab6 opened this issue Jul 20, 2023 · 2 comments
Open

Comments

@davelab6
Copy link
Member

Today I got a fontmake error during build. I figured, probably something obvious, and it was.

My full build steps and output:

$ gftools builder config.yaml;
Location with undefined axis: "wght".
Location with undefined axis: "wght".
Location with undefined axis: "wght".
Location with undefined axis: "wght".
Location with undefined axis: "wght".
Location with undefined axis: "wght".
Location with undefined axis: "wght".
Location with undefined axis: "wght".
Location with undefined axis: "wght".
INFO:GFBuilder:Creating variable fonts from font.designspace
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
WARNING:fontTools.designspaceLib.BaseDocReader:Location with undefined axis: "wght".
INFO:fontmake.font_project:Building variable fonts ./variable_ttf/variable/font.ttf
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'G' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'k' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'G' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'k' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'G' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'k' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'G' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'k' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'G' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'k' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'G' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'G' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'k' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'G' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'k' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'G' does not match the TrueType output glyph. Glyph will have no instructions in the font.
ERROR:ufo2ft.instructionCompiler:The stored hash for glyph 'k' does not match the TrueType output glyph. Glyph will have no instructions in the font.
Traceback (most recent call last):
  File "/Users/dcrossland/src/github.com/googlefonts/font/sources/Regular/test-Gk/9 Source/venv/lib/python3.11/site-packages/fontmake/font_project.py", line 1146, in run_from_designspace
    self._run_from_designspace_interpolatable(
  File "/Users/dcrossland/src/github.com/googlefonts/font/sources/Regular/test-Gk/9 Source/venv/lib/python3.11/site-packages/fontmake/font_project.py", line 1242, in _run_from_designspace_interpolatable
    self.build_variable_fonts(
  File "/Users/dcrossland/src/github.com/googlefonts/font/sources/Regular/test-Gk/9 Source/venv/lib/python3.11/site-packages/fontmake/font_project.py", line 424, in build_variable_fonts
    fonts = ufo2ft.compileVariableTTFs(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dcrossland/src/github.com/googlefonts/font/sources/Regular/test-Gk/9 Source/venv/lib/python3.11/site-packages/ufo2ft/__init__.py", line 646, in compileVariableTTFs
    vfNameToTTFont = varLib.build_many(
                     ^^^^^^^^^^^^^^^^^^
  File "/Users/dcrossland/src/github.com/googlefonts/font/sources/Regular/test-Gk/9 Source/venv/lib/python3.11/site-packages/fontTools/varLib/__init__.py", line 1104, in build_many
    vf = build(
         ^^^^^^
  File "/Users/dcrossland/src/github.com/googlefonts/font/sources/Regular/test-Gk/9 Source/venv/lib/python3.11/site-packages/fontTools/varLib/__init__.py", line 1138, in build
    ds = load_designspace(designspace)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dcrossland/src/github.com/googlefonts/font/sources/Regular/test-Gk/9 Source/venv/lib/python3.11/site-packages/fontTools/varLib/__init__.py", line 956, in load_designspace
    raise VarLibValidationError(
fontTools.varLib.errors.VarLibValidationError: More than one base master found in Designspace.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/dcrossland/src/github.com/googlefonts/font/sources/Regular/test-Gk/9 Source/venv/bin/gftools", line 10, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/dcrossland/src/github.com/googlefonts/font/sources/Regular/test-Gk/9 Source/gftools/Lib/gftools/scripts/__init__.py", line 91, in main
    mod.main(args[2:])
  File "/Users/dcrossland/src/github.com/googlefonts/font/sources/Regular/test-Gk/9 Source/gftools/Lib/gftools/builder/__init__.py", line 672, in main
    builder.build()
  File "/Users/dcrossland/src/github.com/googlefonts/font/sources/Regular/test-Gk/9 Source/gftools/Lib/gftools/builder/__init__.py", line 207, in build
    self.build_variable()
  File "/Users/dcrossland/src/github.com/googlefonts/font/sources/Regular/test-Gk/9 Source/gftools/Lib/gftools/builder/__init__.py", line 335, in build_variable
    output_files = self.run_fontmake(source, args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/dcrossland/src/github.com/googlefonts/font/sources/Regular/test-Gk/9 Source/gftools/Lib/gftools/builder/__init__.py", line 392, in run_fontmake
    FontProject().run_from_designspace(source, **args)
  File "/Users/dcrossland/src/github.com/googlefonts/font/sources/Regular/test-Gk/9 Source/venv/lib/python3.11/site-packages/fontmake/font_project.py", line 1161, in run_from_designspace
    raise FontmakeError(
fontmake.errors.FontmakeError: In 'font.designspace': Generating fonts from Designspace failed: More than one base master found in Designspace.
$

From a cursory look, the designspace file was correct, and the final

fontmake.errors.FontmakeError: In 'font.designspace': Generating fonts from Designspace failed: More than one base master found in Designspace.

was misleading; the semi helpful message at the start, repeated,

Location with undefined axis: "wght"

eventually got me to see that I had

       

but this needed to be

       

Chatting with @behdad he commented that "Just warning and ignoring an unknown axis is not good UX. I guess designers like just commenting out an axis line and compile (Instead of having to comment out all references to the axis as well)"

And @rsheeter suggested, "Maybe we could make it default to hard fail and in the failure tell them a flag they can set to ignore instead?"

So posting this issue to request that :)

@behdad
Copy link
Contributor

behdad commented Jul 20, 2023

I suggest we just change it to an error, without any option for now. If people shout, we can reconsider.

@anthrotype
Copy link
Member

I just saw this. Yeah, I also think it should be an error and am actually suprised it isn't already. The fix should go in fonttools designspaceLib

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

3 participants