typemytype / booleanOperations

Boolean operations on paths
MIT License
38 stars 18 forks source link

ValueError raised instead of BooleanOperationsError #62

Open moyogo opened 3 years ago

moyogo commented 3 years ago

This is a followup to https://github.com/googlefonts/ufo2ft/pull/492#issuecomment-809282587

booleanOperations should probably raise a BooleanOperationsError instead of a ValueError with the two glyphs taken from https://github.com/googlefonts/festive: https://github.com/googlefonts/ufo2ft/files/6221735/OutlineTest.ufo.zip

typemytype commented 3 years ago

this is an edge case...

and the spec allows this https://unifiedfontobject.org/versions/ufo3/glyphs/glif/#point-types

If the number of offcurve points is zero, a straight line is drawn.

BooleanOperation should treat it like a line segment...

image

anthrotype commented 3 years ago

@moyogo who/what tool created that ufo?

moyogo commented 3 years ago

@anthrotype Festive has the issue in the Glyphs files, the issue isn't created when glyphsLib generates the UFOs.

anthrotype commented 3 years ago

I don't understand. You tried running booleanOperations from within Glyphs.app? Or on a UFO exported from Glyphs.app? I'm just curious to know how widespread these are, and in what circumestances they appear. I would go as far as potentially deprecating this in a future UFO version, as it just complicates parsing the outlines.

moyogo commented 3 years ago

I don't understand. You tried running booleanOperations from within Glyphs.app? Or on a UFO exported from Glyphs.app?

Neither. Fontmake was used on the Glyphs file.

anthrotype commented 3 years ago

So you saying that the .glyphs source itself contains curve segments without offcurve points. Is that even legal for Glyphs.app?

moyogo commented 3 years ago

@vv-monsalve Did Festive have Glyphs sources initially or did they come from a different format?

moyogo commented 3 years ago

@anthrotype the outlines were definitely broken in Glyphs.app so it's not valid there.

moyogo commented 3 years ago

The issue is not that the outlines are bad, but that a meaningful error should be raised when it is the case.

anthrotype commented 3 years ago

well, actually they are valid at least according to the current UFO spec, as frederik pointed out above.

vv-monsalve commented 3 years ago

@vv-monsalve Did Festive have Glyphs sources initially or did they come from a different format?

The designer provided Glyphs sources, although I understand they used to be Fontlab files originally