googlefonts / ufo2ft

A bridge from UFOs to FontTools objects (and therefore, OTFs and TTFs).
MIT License
151 stars 43 forks source link

prevent recursion error with cyclical components and provide descriptive error message #813

Closed anthrotype closed 8 months ago

anthrotype commented 8 months ago

Fixes https://github.com/googlefonts/fontmake/issues/1066

cc @emmamarichal

anthrotype commented 8 months ago

@emmamarichal with this, you should now get a more friendly error message than a RecursionError, telling you exactly how to find the cycle:

$ fontmake ../Gelasio/master_ufo/Gelasio.designspace -o variable
INFO:fontmake.font_project:Building variable fonts variable_ttf/Gelasio-VF.ttf
INFO:ufo2ft:Features are compatible across masters; building later
INFO:ufo2ft:Pre-processing glyphs
INFO:ufo2ft.filters:Running EraseOpenCornersFilter on Gelasio-Regular
fontmake: Error: In '../Gelasio/master_ufo/Gelasio.designspace': Generating fonts from Designspace failed: cyclical component reference: Ccedilla -> cedillacomb.case -> cedilla -> cedillacomb => cedilla
emmamarichal commented 8 months ago

Excellent! Thank you @anthrotype!