openpencil/crates
Kayshen-X a218115010 feat(web): user font import — family-aware CanvasKit + import UI + IndexedDB (phases 3-4)
Bring user-imported fonts to the browser host, matching the native flow.

Phase 3 — family-aware CanvasKit text (the web BLOCKER): drawText now
carries font_family and a new measureTextFamilyStyled FFI mirrors it, so
the editor measures caret/layout with the same family it draws (closing
the family-blind trap). op_ck_bridge.js keys imported typefaces by family
and resolves them PER CHARACTER: chars the imported face covers draw with
it, the rest fall to the existing script-segmented system/CJK/emoji path
(no tofu, no dropped family) — draw + measure split on identical
importedCoverage segments so advances agree. register/removeImportedFont
with replace + wasm-heap free.

Phase 4 — import UI + persistence: web ImportFont opens a hidden
.ttf/.otf file input -> FileReader -> 16 MiB cap -> family parsed in Rust
via ttf-parser (font_meta.rs; the vendored CanvasKit exposes no
getFamilyName) -> register + persist bytes in IndexedDB (font_store_idb.rs;
DB openpencil / store imported_fonts, keyed by family, async errors
logged) -> refresh snapshot + repaint. Remove drops registry + IndexedDB.
Mount re-registers persisted fonts (skipping any the user already changed
this session) before the first family-aware paint. font_import_supported
is true on web, so the picker's imported group + Import row are live.

font_meta family extraction is unit-tested (real .ttf bytes -> family)
so the core is verified headlessly; runtime IndexedDB/FileReader/rendering
need a browser smoke test. Codex-reviewed (2 rounds) — getFamilyName
BLOCKER, mixed-script fallback, IndexedDB async errors, and the mount
race all addressed.
2026-07-05 14:21:51 +08:00
..
op-acp
op-ai merge: sync mesh/shader rendering, web live-sync and platform fixes from remote 2026-07-03 01:25:08 +08:00
op-ai-skills fix(ai): drop the 'prefer K()' kit-catalog push from the design-loop prompt 2026-07-05 04:01:09 +08:00
op-cli feat(openpencil): add code-to-design conversion flow 2026-07-04 13:23:28 +08:00
op-codegen feat(openpencil): add code-to-design conversion flow 2026-07-04 13:23:28 +08:00
op-config-store
op-design-lint feat(orchestrator): teach the geometry detectors design intent 2026-07-03 03:02:43 +08:00
op-editor-core feat(panels): font-picker import UI + native import/remove dispatch (phase 2b) 2026-07-05 14:21:48 +08:00
op-editor-host-core feat(editor): collapse the design loop's model narration 2026-07-04 18:23:43 +08:00
op-editor-ui feat(web): user font import — family-aware CanvasKit + import UI + IndexedDB (phases 3-4) 2026-07-05 14:21:51 +08:00
op-figma fix(figma): skip swapped instances in derived pre-seeding 2026-07-04 16:48:14 +08:00
op-git
op-host-desktop fix(desktop): prune superseded font file only after the index is saved 2026-07-05 14:21:50 +08:00
op-host-native feat(panels): font-picker import UI + native import/remove dispatch (phase 2b) 2026-07-05 14:21:48 +08:00
op-host-services fix(ai): stop a stray selection hijacking a new-design prompt 2026-07-04 16:26:13 +08:00
op-host-web feat(web): user font import — family-aware CanvasKit + import UI + IndexedDB (phases 3-4) 2026-07-05 14:21:51 +08:00
op-host-web-server fix(editor): repair strokes and legacy render layout 2026-06-21 16:52:31 +08:00
op-i18n chore(editor): refresh quick examples with a travel booking prompt 2026-07-04 02:17:37 +08:00
op-mcp feat(mcp): add K() batch_design op to instantiate built-in UI kits 2026-07-04 19:51:59 +08:00
op-opmerge
op-orchestrator fix(orchestrator): recognize CJK-named bottom nav + dedup duplicate bottom-nav sections 2026-07-05 02:40:10 +08:00
op-pen-loader feat(renderer): font-generation invalidation for imported fonts (phase 1) 2026-07-05 14:21:46 +08:00
op-process-io
op-rpc-transport
op-smoke feat(ai): seed a numeric artboard when the first loop batch skips it 2026-07-04 14:34:55 +08:00
op-web-sdk feat(openpencil): add code-to-design conversion flow 2026-07-04 13:23:28 +08:00
CLAUDE.md feat(ai): make script-gen the only subagent output protocol 2026-07-04 17:31:22 +08:00