googlefonts / rcjk-tools

Apache License 2.0
3 stars 0 forks source link

buildVarC fails to run #6

Open punchcutter opened 1 year ago

punchcutter commented 1 year ago

I run rcjk2ufo and then fontmake and then try to run buildVarC and get this

Traceback (most recent call last):
  File "/venvs/rcjk/bin/buildvarc", line 33, in <module>
    sys.exit(load_entry_point('rcjktools==0.2.dev213+g36fb741', 'console_scripts', 'buildvarc')())
  File "/venvs/rcjk/lib/python3.10/site-packages/rcjktools/buildVarC.py", line 225, in main
    buildVarC(
  File "/venvs/rcjk/lib/python3.10/site-packages/rcjktools/buildVarC.py", line 178, in buildVarC
    vcFont = VarCoFont(designspacePath)
  File "/venvs/rcjk/lib/python3.10/site-packages/rcjktools/varco.py", line 89, in __init__
    self.axes, self.ufos, self.locations = unpackDesignSpace(doc)
  File "/venvs/rcjk/lib/python3.10/site-packages/rcjktools/varco.py", line 228, in unpackDesignSpace
    ufo = UFont(src.path)
TypeError: Font.__init__() takes 1 positional argument but 2 were given

If I change that line to

ufo = UFont()
ufo.open(src.path)

then I get

Traceback (most recent call last):
  File "/venvs/rcjk/bin/buildvarc", line 33, in <module>
    sys.exit(load_entry_point('rcjktools==0.2.dev213+g36fb741', 'console_scripts', 'buildvarc')())
  File "/venvs/rcjk/lib/python3.10/site-packages/rcjktools/buildVarC.py", line 225, in main
    buildVarC(
  File "/venvs/rcjk/lib/python3.10/site-packages/rcjktools/buildVarC.py", line 178, in buildVarC
    vcFont = VarCoFont(designspacePath)
  File "/venvs/rcjk/lib/python3.10/site-packages/rcjktools/varco.py", line 89, in __init__
    self.axes, self.ufos, self.locations = unpackDesignSpace(doc)
  File "/venvs/rcjk/lib/python3.10/site-packages/rcjktools/varco.py", line 234, in unpackDesignSpace
    ufo = ufo.layers[src.layerName]
  File "/venvs/rcjk/lib/python3.10/site-packages/ufoLib2/objects/layerSet.py", line 227, in __getitem__
    layer_object = self._layers[name]
KeyError: 'wght=1'
justvanrossum commented 1 year ago

As you've noticed, this code is currently quite stale. There are no immediate plans to revive this, as it will be superseded by whatever https://github.com/harfbuzz/boring-expansion-spec/blob/glyf1/glyf1.md is evolving into.

punchcutter commented 1 year ago

No problem. I just wanted to try it out this way. One reason being to see the file size difference of a VarC vs regular flattened file.