refactor(font-system): source substitution evidence from @docfonts/fallbacks#3669
Merged
Merged
Conversation
…llbacks The hand-vendored evidence DATA becomes an import from the published @docfonts/fallbacks registry (pinned 0.2.0), pinned to SuperDoc's local type contract by a const assignment that fails the build if the package shape drifts. The type shapes stay local so the public facade stays self-contained: re-exporting the package's types would leave an unresolvable @docfonts/fallbacks reference in superdoc's emitted .d.ts. One upstream source of truth for the measured data. docfonts owns the evidence and the asset-safe fallback decision; SuperDoc owns what activates. The resolver derives its maps through getRenderableFallback gated by BUNDLED_MANIFEST, so the registry's extra substitutes (Georgia, Arial Narrow, ...) stay inert until their assets ship; key normalization stays normalizeFamilyKey. No behavior change: the same seven rows activate, the default toolbar is unchanged, and FONT_OFFERINGS now classifies the full registry for the later document-specific surface without expanding the toolbar.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SuperDoc's font-fallback evidence was a hand-copied snapshot of the docfonts registry. This sources the measured data from the published
@docfonts/fallbackspackage (pinned 0.2.0) instead, so there's one upstream source of truth and no drift.@docfonts/fallbacksreference consumers can't resolve.getRenderableFallback), gated byBUNDLED_MANIFEST, so substitutes we haven't shipped assets for (Georgia, Arial Narrow, Baskerville) stay inert. Key normalization unchanged.Verified: check:types pass; check:public:superdoc pass (14 stages); frozen-lockfile pass;
@docfonts/fallbacksbundled away (no import/dep in the published package). Unit tests in CI.