Skip to content

Exporting a font containing glyph with a cubic curve segment containing a single off-curve point results in broken output #4327

@ctrlcctrlv

Description

@ctrlcctrlv

When reporting a bug/issue:

  • Screenshot
    Teardrop.sfd's Q:
    image
    When roundtripped:
    image

    Teardrop.sfd's R:
    image
    When roundtripped:
    image

    Teardrop.sfd's S:
    image
    When roundtripped:
    image

  • The FontForge version and the operating system you're using
    21d929b, Win32 (also tested same version on Xubuntu)

  • The behavior you expect to see, and the actual behavior
    FontForge generates a bad UFO that neither it, nor fontmake, can understand. As @skef has pointed out in Optionally only interpolate compatible glyphs/layers #4321:

    01:19:22 skef As I note in that bug it's just a FontForge design error that you can create a cubic spline with one control point on a segment.
    01:20:07 skef Any time there is one control point the other control point should be treated as present and co-located with its on-curve point

    Our S.glif gets written, though, as:

    <?xml version="1.0" encoding="UTF-8"?>
    <glyph name="S" format="2">
      <advance width="1000"/>
      <unicode hex="0053"/>
      <outline>
        <contour>
          <point x="123" y="524" type="line"/>
          <point x="609" y="716"/>
          <point x="823" y="524" type="curve"/>
          <point x="823" y="208" type="line"/>
          <point x="123" y="208" type="line"/>
        </contour>
      </outline>
    </glyph>
  • Steps to reproduce the behavior

  1. File teardrop.sfd
  2. Export UFO
  3. Reopen UFO, or use in fontmake
  • (optional) Possible solution/fix/workaround
    Always write two off-curve points for cubic splines. Co-locate one if missing.

Can you please fix this @frank-trampe ? I don't have time to patch it right now.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions