silnrsi / font-pendot-latin

Prototype writing education font for the Latin script
SIL Open Font License 1.1
1 stars 1 forks source link

Build failing on bezierTools.py #18

Open jvgaultney opened 10 months ago

jvgaultney commented 10 months ago

My local build just now started failing after make clean:

Traceback (most recent call last):
  File "/Users/victor/Work/Repos/font-pendot-latin/venv/bin/pendot", line 8, in <module>
    sys.exit(main())
  File "/Users/victor/Work/Repos/font-pendot-latin/venv/lib/python3.10/site-packages/pendot/__main__.py", line 37, in main
    dot_font(font, params)
  File "/Users/victor/Work/Repos/font-pendot-latin/venv/lib/python3.10/site-packages/pendot/__init__.py", line 27, in dot_font
    doDotter(layer, params)
  File "/Users/victor/Work/Repos/font-pendot-latin/venv/lib/python3.10/site-packages/pendot/dotter.py", line 358, in doDotter
    splitPathsAtIntersections(paths)
  File "/Users/victor/Work/Repos/font-pendot-latin/venv/lib/python3.10/site-packages/pendot/dotter.py", line 324, in splitPathsAtIntersections
    intersections = findIntersections(s1, s2)
  File "/Users/victor/Work/Repos/font-pendot-latin/venv/lib/python3.10/site-packages/pendot/dotter.py", line 117, in findIntersections
    return segmentSegmentIntersections(seg1, seg2)
  File "Lib/fontTools/misc/bezierTools.py", line 1453, in fontTools.misc.bezierTools.segmentSegmentIntersections
  File "Lib/fontTools/misc/bezierTools.py", line 1403, in fontTools.misc.bezierTools.curveCurveIntersections
  File "Lib/fontTools/misc/bezierTools.py", line 1188, in fontTools.misc.bezierTools.lineLineIntersections
ZeroDivisionError: division by zero

ninja: build stopped: subcommand failed.
make: *** [build.stamp] Error 1

@simoncozens

jvgaultney commented 10 months ago

This is failing on the GH action too - some tool must have changed since 11:50 am Thursday and is still broken as of 10 am today:

https://github.com/silnrsi/font-pendot-latin/actions/runs/7220533136

simoncozens commented 10 months ago

This is related to the issue of intersection removal not being applied. We fixes this by decomposing components; in turn, that's producing more dots for us to compare and look for intersections, and this in turn is exposing a problem in fontTools' Bezier intersection code. I'll file a fontTools bug and try to fix it.

simoncozens commented 10 months ago

Fixed, put this in your requirements.txt

fontTools @ git+https://github.com/fonttools/fonttools@lineline-edge-cases

until the next fontTools release.

However, my decomposing-components code appears to have done something impressively wrong with transformation matrixes:

Screenshot 2023-12-15 at 11 47 55

I'll fix that.

jvgaultney commented 10 months ago

Thanks! Build working again

simoncozens commented 10 months ago

Decomposition problem in pendot should now be fixed as of 7e54468.

jvgaultney commented 10 months ago

Confirmed looking better again

jvgaultney commented 10 months ago

(not closing yet as a reminder to remove fontTools freeze from requirements.txt on next fontTools release)