Skip to content

Stage B, PR 2: drop legacy Glyph fields and DB v6 migration - #66

Merged
aurpelai merged 1 commit into
mainfrom
feat/stage-b-cleanup
Jun 22, 2026
Merged

aurpelai merged 1 commit into
mainfrom
feat/stage-b-cleanup

Conversation

@aurpelai

@aurpelai aurpelai commented Jun 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

Finalises the layers-only Glyph shape. The deprecated top-level pixels / width / height / xoffset / yoffset / xadvance fields are removed from the interface; the bmf sub-object is now the only source of BMF char-line metadata, and the layer stack is the only source of ink. syncLegacyFields and the defensive normaliseBmf are gone.

  • DB v6 migration backfills bmf from the legacy fields on disk and deletes them. v3→v6 jumps replay through earlier upgrades; existing local fonts should load cleanly.
  • PixelEditor drawCanvas / recenterCanvas now read the flatten origin via flattenGlyph(currentGlyph) — the two legacy-field call sites PR 1 left alive.
  • portable.ts still serialises v2 wire format, but now sources the flat bitmap from flattenGlyph and the BMF metadata from glyph.bmf. PR 3 introduces v3 with full layer-stack round-trip.
  • makeBlankGlyph / initializeGlyphs shed the unused height parameter (blank layers are 0×0).
  • Tests: rewrote glyphs.test.ts and portable.test.ts against the new blank semantics; cleaned legacy-field writes from pack.test.ts, layers.test.ts, integration.test.ts; cast legacy reads in db.test.ts.

Test plan

  • pnpm test (13 files, 107 tests)
  • pnpm build
  • pnpm lint
  • Manual: open an existing local font in the running app, confirm v5→v6 upgrade lands cleanly and editing/saving works
  • Manual: round-trip a font through Export Portable → Import Portable

🤖 Generated with Claude Code

…PR 2)

Finalises the layers-only Glyph shape. The deprecated top-level
`pixels`/`width`/`height`/`xoffset`/`yoffset`/`xadvance` fields are
removed from the interface; the `bmf` sub-object is now the only source
of BMF char-line metadata, and the layer stack is the only source of
ink. `syncLegacyFields` and the defensive `normaliseBmf` are gone.

DB v6 backfills `bmf` from the legacy fields on disk and deletes them.
PixelEditor `drawCanvas` / `recenterCanvas` now read flatten origin
through `flattenGlyph(currentGlyph)`. `portable.ts` still serialises v2
wire format but sources data from `flattenGlyph` and `glyph.bmf`; PR 3
introduces v3 with full layer-stack round-trip.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@aurpelai
aurpelai merged commit b0787b7 into main Jun 22, 2026
1 check passed
@aurpelai
aurpelai deleted the feat/stage-b-cleanup branch June 22, 2026 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant