Skip to content

feat(core,elements): data-carried webfonts - #74

Merged
hblee12294 merged 1 commit into
mainfrom
feat/data-fonts
Aug 8, 2026
Merged

feat(core,elements): data-carried webfonts#74
hblee12294 merged 1 commit into
mainfrom
feat/data-fonts

Conversation

@hblee12294

Copy link
Copy Markdown
Member

What

data.fonts carries the same {family, url, weight?, style?} entries as config.fonts, so hosts can register faces without a recompile — the unlock for full-catalog font knobs (swapping a family becomes a pure data edit).

  • One dedup'd registrar (family|weight|style|url) feeds from both sources; always emitted, so data fonts work on configs that declare none.
  • Boot faces (config + data) are awaited before scene setup and element render — capped 4s, fail-open — preserving the capture/chunk parity contract.
  • setData faces register lazily; each face's load completion re-rasters text elements (rerasterAll → per-instance refreshRaster(), a re-draw with unchanged values through the existing coalescing queue), so the real face replaces the fallback that painted first. Split text keeps its boot-only rule.

Tests

Compile pins (registrar emitted with and without a fonts block, boot feeds both sources, setData block registers + re-rasters), elements pin (refreshRaster swaps the texture under a stable mesh with unchanged values). Full repo build/lint/test green.

data.fonts accepts the same {family, url, weight?, style?} entries as
config.fonts through one dedup'd registrar: boot faces from both sources
are awaited before first render (capped, fail-open); faces arriving via
setData register lazily and re-raster text elements when they land, so
the real face replaces the fallback without a recompile — font swaps
become pure data edits. New element-system API: rerasterAll(elementMap)
+ per-instance refreshRaster() (re-draw with unchanged values).
@hblee12294
hblee12294 merged commit beb07a0 into main Aug 8, 2026
3 checks passed
@hblee12294
hblee12294 deleted the feat/data-fonts branch August 8, 2026 20:08
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