Closed stenson closed 2 years ago
thanks. we should try not import directly ufoLib2 or defcon, but use something like the _getNewGlyphFactory
method from ufo2ft.util
module:
https://github.com/googlefonts/ufo2ft/blob/036cb54e44e7cbdd1889d83c5f1bf02dee51a842/Lib/ufo2ft/util.py#L101-L118
thanks for the fix!
I'm using ufo2ft with an embedded python (python3.10 in Blender 3.2), using
defcon
as the backend rather thanufoLib2
, and when run this linefrom ufo2ft.featureCompiler import FeatureCompiler
, I get anModuleNotFoundError
with this traceback:If I install
ufoLib2
into the embedded python, obviously the issue goes away completely, but the weirder thing is, if I don't have ufoLib2 installed and I run the same import twice (from ufo2ft.featureCompiler import FeatureCompiler
), there is no ModuleNotFoundError and everything works as it should (though presumably the function that actually usesufoLib2.objects.Glyph
inDottedCircleFilter
does not work). So an easy workaround here is to try/exceptfrom ufo2ft.featureCompiler import FeatureCompiler
before running the rest of my code, and everything seems to work. (I'd love to know why this happens if anyone can shed some light on that? 🤔)All that said, I wrote a patch for DottedCircleFilter to use the defcon equivalent of the ufoLib2
Glyph
class when ufoLib2 isn't available (pasted below) and would be happy to submit a PR, though I think it might run counter to some of the code patterns in this library: