Skip to content

[codex] Add stable ID font index#65

Merged
kostyafarber merged 1 commit into
mainfrom
codex/stable-id-font-index
Jun 6, 2026
Merged

[codex] Add stable ID font index#65
kostyafarber merged 1 commit into
mainfrom
codex/stable-id-font-index

Conversation

@kostyafarber
Copy link
Copy Markdown
Collaborator

Summary

Adds the stable-ID font substrate for shift-font.

  • Stores glyphs by stable GlyphId in an ordered IndexMap instead of keying authored state by glyph name.
  • Adds a private runtime FontIndex beside serializable FontData inside FontState.
  • Exposes explicit lookup and identity mutation APIs on Font, including name, Unicode, layer, and glyph/source lookup paths.
  • Removes broad attached-glyph mutation from callers and updates workspace, bridge, store, and backend paths to go through Font operations.
  • Keeps Font cheap to clone with Arc copy-on-write semantics.

Design Notes

FontData is now authored serializable data only. FontIndex is derived runtime state and is rebuilt/validated when deserializing. Bulk glyph insertion uses incremental index validation/update to avoid quadratic font construction, while broader identity edits still rebuild/validate indexes for now.

Tests

  • cargo test --workspace
  • pnpm --filter @shift/desktop typecheck
  • commit hook also ran cargo check, cargo fmt, cargo clippy, and cargo test

Added coverage for glyph name uniqueness, stable glyph order, Unicode multi-match lookup, layer lookup freshness, serde index rebuilds, and perf marks for rename/Unicode/layer index rebuilds.

@kostyafarber kostyafarber marked this pull request as ready for review June 6, 2026 08:14
@kostyafarber kostyafarber merged commit 337b9e0 into main Jun 6, 2026
10 of 12 checks passed
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