fontbakery icon indicating copy to clipboard operation
fontbakery copied to clipboard

[com.google.fonts/check/outline_direction] failed with `ZeroDivisionError`: float division by zero

Open RickyDaMa opened this issue 1 year ago • 3 comments

Observed behaviour

The check errors:

image

Expected behaviour

The check should fail (I think). I'm guessing this exception should be caught and repackaged as the check failing?

Resources and steps needed to reproduce

I'll link this issue on the private repo in question, so you'll see the backlink below if you have access :)

RickyDaMa avatar May 07 '24 16:05 RickyDaMa

@simoncozens unsure if the issue here lies in the check code, or in your beziers library, but if you'd be able to take a look, I'd really appreciate it!

The exception is being raised when a QuadraticBezier has a length of zero (all three co-ordinates are the same). We tried looking in the sources for these co-ordinates, and came up empty

RickyDaMa avatar May 09 '24 12:05 RickyDaMa

It's clearly in beziers.py. You won't find a length-zero bezier in your sources; it's probably a bug in how we're sampling them.

simoncozens avatar May 09 '24 13:05 simoncozens

Should be fixed in beziers 0.6.0, just uploaded.

simoncozens avatar May 09 '24 15:05 simoncozens

Anything breaking in the API, or am I safe to PR for this repo moving to 0.6? We're pinned on 0.5.x currently

https://github.com/fonttools/fontbakery/blob/95d1c4f6f733c2cff6aeac147518f621b6c8fa53/pyproject.toml#L44

RickyDaMa avatar May 10 '24 10:05 RickyDaMa

Should be fixed in beziers 0.6.0, just uploaded.

Even though I see version 0.6.0 at PyPI (https://pypi.org/project/beziers/), I don't see the corresponding commits / git tag for this version at https://github.com/simoncozens/beziers.py

felipesanches avatar May 10 '24 18:05 felipesanches

This should now be fixed.

simoncozens avatar Jun 11 '24 08:06 simoncozens