Skip to content

fix: dedupe fonts.json fetches and resolve missing style fonts - #57

Merged
mlightcad merged 2 commits into
mainfrom
fix/font-loader-dedupe-and-style-resolve
Sep 7, 2026
Merged

mlightcad merged 2 commits into
mainfrom
fix/font-loader-dedupe-and-style-resolve

Conversation

@mlightcad

Copy link
Copy Markdown
Owner

Summary

  • Deduplicate concurrent fonts.json metadata fetches in DefaultFontLoader, with correct in-flight promise cleanup when baseUrl changes (including A→B→A).
  • Resolve missing text-style fonts via findAndReplaceFont before the first glyph so scale/blank width and font face use the default chain.
  • Prefer pagehide over deprecated unload when closing IndexedDB font cache; bump package to 0.12.5.

Test plan

  • vitest run test/font/defaultFontLoader.test.ts (including concurrent dedupe and A→B→A cases)
  • CI unit/build checks pass on the PR
  • Spot-check: many entities requesting fonts at once should hit fonts.json once
  • Spot-check: MText with an unloaded style font falls back to the default font chain

Concurrent lazy font loads shared one metadata request; style fonts now go through findAndReplaceFont before the first glyph. Also prefer pagehide over unload for IndexedDB cleanup.
@mlightcad mlightcad self-assigned this Sep 7, 2026
@mlightcad mlightcad added the enhancement New feature or request label Sep 7, 2026
@mlightcad
mlightcad merged commit 6f94668 into main Sep 7, 2026
2 checks passed
@mlightcad
mlightcad deleted the fix/font-loader-dedupe-and-style-resolve branch September 7, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant