googlefonts/ufo2ft

fontTools.varLib.errors.VariationModelError: Locations must be unique

clauseggers opened this issue · 1 comments

Installed a fix of glyphsLib using pip install -e git+https://github.com/googlefonts/glyphsLib.git@floatFactorsInTokens#egg=glyphsLib in a regular virtual environment install of gftools. I ran gftools builder config.yaml and got this:

Traceback (most recent call last):
  File "/Users/claus/.local/virtualenv/gftools/venv/lib/python3.11/site-packages/fontmake/font_project.py", line 1146, in run_from_designspace
    self._run_from_designspace_interpolatable(
  File "/Users/claus/.local/virtualenv/gftools/venv/lib/python3.11/site-packages/fontmake/font_project.py", line 1242, in _run_from_designspace_interpolatable
    self.build_variable_fonts(
  File "/Users/claus/.local/virtualenv/gftools/venv/lib/python3.11/site-packages/fontmake/font_project.py", line 424, in build_variable_fonts
    fonts = ufo2ft.compileVariableTTFs(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/claus/.local/virtualenv/gftools/venv/lib/python3.11/site-packages/ufo2ft/__init__.py", line 646, in compileVariableTTFs
    vfNameToTTFont = varLib.build_many(
                     ^^^^^^^^^^^^^^^^^^
  File "/Users/claus/.local/virtualenv/gftools/venv/lib/python3.11/site-packages/fontTools/varLib/__init__.py", line 1104, in build_many
    vf = build(
         ^^^^^^
  File "/Users/claus/.local/virtualenv/gftools/venv/lib/python3.11/site-packages/fontTools/varLib/__init__.py", line 1178, in build
    model = models.VariationModel(normalized_master_locs, axisOrder=axisTags)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/claus/.local/virtualenv/gftools/venv/lib/python3.11/site-packages/fontTools/varLib/models.py", line 253, in __init__
    raise VariationModelError("Locations must be unique.")
fontTools.varLib.errors.VariationModelError: Locations must be unique.

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

Traceback (most recent call last):
  File "/Users/claus/.local/bin/gftools", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/claus/.local/virtualenv/gftools/venv/lib/python3.11/site-packages/gftools/scripts/__init__.py", line 91, in main
    mod.main(args[2:])
  File "/Users/claus/.local/virtualenv/gftools/venv/lib/python3.11/site-packages/gftools/builder/__init__.py", line 672, in main
    builder.build()
  File "/Users/claus/.local/virtualenv/gftools/venv/lib/python3.11/site-packages/gftools/builder/__init__.py", line 207, in build
    self.build_variable()
  File "/Users/claus/.local/virtualenv/gftools/venv/lib/python3.11/site-packages/gftools/builder/__init__.py", line 335, in build_variable
    output_files = self.run_fontmake(source, args)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/claus/.local/virtualenv/gftools/venv/lib/python3.11/site-packages/gftools/builder/__init__.py", line 389, in run_fontmake
    FontProject().run_from_glyphs(source, **args)
  File "/Users/claus/.local/virtualenv/gftools/venv/lib/python3.11/site-packages/fontmake/font_project.py", line 856, in run_from_glyphs
    self.run_from_designspace(
  File "/Users/claus/.local/virtualenv/gftools/venv/lib/python3.11/site-packages/fontmake/font_project.py", line 1161, in run_from_designspace
    raise FontmakeError(
fontmake.errors.FontmakeError: In 'Playfair-2_1-Roman.glyphs' -> 'master_ufo/Playfair.designspace': Generating fonts from Designspace failed: Locations must be unique.

Did I install the branch with the fix correctly?

The Glyphs files causing this are here https://github.com/clauseggers/Playfair/tree/new_width_definition/sources

m4rc1e commented

Closing this since the issue isn't really relevant to ufo2ft. I'm working with Claus so we'll open up any issues which are relevant.