booleanOperations icon indicating copy to clipboard operation
booleanOperations copied to clipboard

ValueError raised instead of BooleanOperationsError

Open moyogo opened this issue 4 years ago • 11 comments

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

moyogo avatar Mar 29 '21 12:03 moyogo

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

typemytype avatar Mar 29 '21 15:03 typemytype

@moyogo who/what tool created that ufo?

anthrotype avatar May 20 '21 10:05 anthrotype

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

moyogo avatar May 21 '21 08:05 moyogo

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.

anthrotype avatar May 21 '21 09:05 anthrotype

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.

moyogo avatar May 21 '21 09:05 moyogo

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

anthrotype avatar May 21 '21 10:05 anthrotype

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

moyogo avatar May 21 '21 10:05 moyogo

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

moyogo avatar May 21 '21 10:05 moyogo

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

moyogo avatar May 21 '21 10:05 moyogo

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

anthrotype avatar May 21 '21 10:05 anthrotype

@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

vv-monsalve avatar May 21 '21 14:05 vv-monsalve