Skip to content

fontc crashes on super bezier segments (3+ off-curve points before a curve) #1997

@cmyr

Description

@cmyr

fontc rejects glyphs that contain "super bezier" segments (cubic curve segments with more than 2 consecutive off-curve control points). These exist in some sources, and are supported by fontmake.

python3 -m ttx_diff 'https://github.com/Omnibus-Type/Barrio?8f33bf10cb#Barriecito/sources/Barriecito.glyphs'

fontTools handles this via decomposeSuperBezierSegment in fonttools/Lib/fontTools/pens/basePen.py:389. When BasePen.curveTo receives more than 3 points (i.e. more than 2 control points), it decomposes the super bezier into multiple standard cubic bezier segments that together reproduce the same curve.

Metadata

Metadata

Assignees

No one assigned

    Labels

    craterIssues based on a crater diff

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions