Skip to content

Designspace fidelity: per-master kerning/fontinfo/lib and undeclared layers are lost at read time #122

Description

@kostyafarber

Found during the fix/designspace-save work. The writer-side structure bugs are fixed there (multi-UFO write-back, atomic XML, no phantom-master promotion), but a read-side modeling limitation remains that bounds designspace round-trip fidelity:

The gap

The designspace reader loads companion UFOs for their glyph geometry only. Dropped at read time:

  • Each companion UFO's own kerning — per-master kerning is the normal case in variable font projects (kerning interpolates across masters). Shift models kerning at Font level, so on save every companion receives a duplicate of the default's kerning. Duplicating is the safe choice (empty kerning would make compiled VF kerning interpolate toward 0), but master-specific kerning that existed on disk is lost.
  • Companion UFOs' own fontinfo, lib, features (per-master vertical metrics, blues, etc. — these also legitimately vary across masters).
  • UFO layers not declared as designspace <source> entries (including the default UFO's background layers).
  • Glyphs existing only in companion UFOs.

Why it matters

With #119 + the designspace-save branch, structure survives a round-trip, but a real production multi-master project's per-master data does not. Until this is modeled, "Shift is safe in the middle of a designspace pipeline" only holds for projects whose masters share kerning/fontinfo — which excludes most serious VF projects.

Direction

  • Per-source kerning (and per-source fontinfo overlays) in the IR is the real fix — it's also required eventually for kerning editing in a multi-master workflow, so it's on the production-parity path anyway, not throwaway interop work.
  • Undeclared layers can now be retained as SourceRole::Layer sources with filenames — the IR marker from the designspace-save branch makes this expressible; the reader needs to stop discarding them.
  • Interim posture: treat designspace save-in-place as export for multi-UFO projects, or warn on open when companions carry kerning/fontinfo that will not round-trip (the reader knows — it's dropping it).

Acceptance

Round-trip a fixture designspace with two masters carrying different kerning, different ascenders, a background layer, and a companion-only glyph — everything survives.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions