googlefonts / ufomerge

ufomerge
Apache License 2.0
11 stars 3 forks source link

Possible regression? AttributeError: 'LayoutSubsetVisitor' object has no attribute 'filter_glyph_container' #23

Closed justvanrossum closed 4 months ago

justvanrossum commented 4 months ago

This is new in 1.7.0 — the same code + data works fine with 1.6.2:

  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/ufomerge/__init__.py", line 158, in merge
    subsetter.subset(self.ufo2_features)
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/ufomerge/layout.py", line 78, in subset
    visitor.visit(fea)
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/fontTools/misc/visitor.py", line 132, in visit
    ret = visitorFunc(self, obj, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/ufomerge/layout.py", line 346, in visit
    visitor.visitList(block.statements)
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/fontTools/misc/visitor.py", line 102, in visitList
    self.visit(value, *args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/fontTools/misc/visitor.py", line 132, in visit
    ret = visitorFunc(self, obj, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/ufomerge/layout.py", line 346, in visit
    visitor.visitList(block.statements)
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/fontTools/misc/visitor.py", line 102, in visitList
    self.visit(value, *args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/fontTools/misc/visitor.py", line 132, in visit
    ret = visitorFunc(self, obj, *args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/site-packages/ufomerge/layout.py", line 249, in visit
    st.glyph = visitor.filter_glyph_container(st.glyph)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'LayoutSubsetVisitor' object has no attribute 'filter_glyph_container'

Unfortunately I can't instantly provide an easy reproducer.

simoncozens commented 4 months ago

Oops, bother. Will fix. 1.7.0 moved everything to the fontTools visitor pattern, which is very clean but a big bang change.

justvanrossum commented 4 months ago

Thanks for the quick fix!

justvanrossum commented 4 months ago

FWIW: 1.7.1 is visible on PyPI (many thanks!) but not in the Releases in this repo.