Skip to content

PR#1163 breaks some font building: AssertionError: Default source not found! #1166

@hosiet

Description

@hosiet

The merged Pull Request #1163 by @anthrotype , or more specifically, 04df2cb , broke the building of some old font projects. I don't know if it is a bug or feature, so I am looking for help from fontmake developers.

For example, with https://github.com/fontworks-fonts/Train/tree/2972a9857a8332c2af86b221799558c177ba9012 :

With fontmake 3.11.0:

-> % uv pip install fontmake==3.11.0 fonttools
Using Python 3.13.11 environment at: venv2
Resolved 14 packages in 114ms
Prepared 1 package in 32ms
Installed 14 packages in 15ms
 + attrs==25.4.0
 + booleanoperations==0.10.0
 + cffsubr==0.4.0
 + compreffor==0.6.0
 + fontmake==3.11.0
 + fontmath==0.9.4
 + fonttools==4.61.1
 + glyphslib==6.12.6
 + lxml==6.0.2
 + openstep-plist==0.5.1
 + pyclipper==1.4.0
 + ufo2ft==3.7.0
 + ufolib2==0.18.1
 + unicodedata2==17.0.0
-> % python ./build.py
[Train One] Generating TTF
INFO:fontmake.font_project:Building master UFOs and designspace from Glyphs source
INFO:glyphsLib.parser:Parsing .glyphs file
INFO:glyphsLib.builder:Running 'align_alternate_layers' transformation
INFO:glyphsLib.builder:Running 'propagate_all_anchors' transformation
INFO:fontmake.font_project:Loading 1 DesignSpace source UFOs
INFO:fontmake.font_project:Building TTF for TrainOne-Regular
INFO:ufo2ft:Pre-processing glyphs
INFO:ufo2ft.filters:Running EraseOpenCornersFilter on TrainOne-Regular
INFO:ufo2ft.filters:Running DecomposeComponentsFilter on TrainOne-Regular
INFO:ufo2ft.filters:Running RemoveOverlapsFilter on TrainOne-Regular
INFO:ufo2ft.filters:Running CubicToQuadraticFilter on TrainOne-Regular
INFO:ufo2ft.filters.cubicToQuadratic:New spline lengths: 1: 7216, 2: 79047, 3: 21622, 4: 7066, 5: 593, 6: 107, 7: 8
INFO:ufo2ft:Building OpenType tables
INFO:ufo2ft.postProcessor:Renaming glyphs to final production names
INFO:fontmake.font_project:Saving master_ttf/TrainOne-Regular.ttf
[TrainOne-Regular] Adding stub DSIG
[TrainOne-Regular] Making other changes

With fontmake 3.11.1:

-> % uv pip install fontmake==3.11.1 fonttools
Using Python 3.13.11 environment at: venv3
Resolved 14 packages in 9ms
Installed 14 packages in 14ms
 + attrs==25.4.0
 + booleanoperations==0.10.0
 + cffsubr==0.4.0
 + compreffor==0.6.0
 + fontmake==3.11.1
 + fontmath==0.9.4
 + fonttools==4.61.1
 + glyphslib==6.12.6
 + lxml==6.0.2
 + openstep-plist==0.5.1
 + pyclipper==1.4.0
 + ufo2ft==3.7.0
 + ufolib2==0.18.1
 + unicodedata2==17.0.0
-> % python ./build.py
[Train One] Generating TTF
INFO:fontmake.font_project:Building master UFOs and designspace from Glyphs source
INFO:glyphsLib.parser:Parsing .glyphs file
INFO:glyphsLib.builder:Running 'align_alternate_layers' transformation
INFO:glyphsLib.builder:Running 'propagate_all_anchors' transformation
INFO:fontmake.font_project:Loading 1 DesignSpace source UFOs
Traceback (most recent call last):
  File "/home/hosiet/tmp/Train/./build.py", line 8, in <module>
    __main__.main(("-g","sources/TrainOne.glyphs", "-o","ttf",))
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hosiet/tmp/venv3/lib/python3.13/site-packages/fontmake/__main__.py", line 719, in main
    project.run_from_glyphs(inputs.glyphs_path, **args)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/hosiet/tmp/venv3/lib/python3.13/site-packages/fontmake/font_project.py", line 931, in run_from_glyphs
    self.run_from_designspace(
    ~~~~~~~~~~~~~~~~~~~~~~~~~^
        designspace,
        ^^^^^^^^^^^^
    ...<4 lines>...
        **kwargs,
        ^^^^^^^^^
    )
    ^
  File "/home/hosiet/tmp/venv3/lib/python3.13/site-packages/fontmake/font_project.py", line 1182, in run_from_designspace
    assert default_source is not None, "Default source not found!"
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: Default source not found!

Any help, suggestion or hint would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions