fonttools / skia-pathops

Python bindings for the Skia library's Path Ops
https://skia.org/docs/dev/present/pathops/
BSD 3-Clause "New" or "Revised" License
47 stars 14 forks source link

oncurve less contour bug #43

Closed typemytype closed 1 year ago

typemytype commented 3 years ago

the last point of such a contour is `None in a pen

  File "src/python/pathops/_pathops.pyx", line 903, in pathops._pathops.PathPen.qCurveTo
  File "src/python/pathops/_pathops.pyx", line 906, in pathops._pathops.PathPen._qCurveToOne
TypeError: 'NoneType' object is not subscriptable
<?xml version='1.0' encoding='UTF-8'?>
<glyph name="test" format="2">
  <advance width="500"/>
  <outline>
    <contour>
      <point x="79" y="132"/>
      <point x="81" y="363"/>
      <point x="324" y="361"/>
      <point x="335" y="141"/>
    </contour>
  </outline>
</glyph>

I assume the default fontTools basePen behaviour could be implemented here: https://github.com/fonttools/skia-pathops/blob/master/src/python/pathops/_pathops.pyx#L901-L903

anthrotype commented 1 year ago

Fixed by #66