Skip to content

feat(fonts): config-gated bundled font availability and curation (SD-3441)#3732

Closed
caio-pizzol wants to merge 6 commits into
mainfrom
caio-pizzol/font-availability-contract
Closed

feat(fonts): config-gated bundled font availability and curation (SD-3441)#3732
caio-pizzol wants to merge 6 commits into
mainfrom
caio-pizzol/font-availability-contract

Conversation

@caio-pizzol

@caio-pizzol caio-pizzol commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Bundled font availability is now explicit and predictable, closing the gap the 1.40 toolbar rollback left open. Without a configured pack, SuperDoc shows a safe baseline (one Word font per CSS generic: Arial, Times New Roman, Courier New) and renders logical names with system fonts, so an unconfigured app never fetches a substitute it cannot serve. Configuring the pack (superdocFonts, fonts.assetBaseUrl / fonts.resolveAssetUrl, or the CDN build) lights up the full reviewed set, gated by config presence rather than a runtime probe.

  • createSuperDocFonts({ include / exclude }) curates the pack by Word family name, validated against the offerings so a typo fails fast at setup time.
  • Availability and curation are document-scoped in the resolver and offerings (shared per-FontFaceSet registration is untouched) and folded into the resolver signature, so a no-pack or curated document never reuses a full-pack document's measures.
  • A CI drift check keeps the generated curatable list in sync with the font-system offerings.
  • Also renames the optional pack to @superdoc-dev/fonts (the org's npm scope) so it can be published, updating the runtime warning, the getting-started examples, the docs, and the docs import allow-list.

@superdoc-dev/fonts@0.1.0 still needs its first manual publish before the examples can leave workspace:*.

…3441)

Without a configured pack SuperDoc advertises and renders only a safe baseline (one font per CSS generic), so an unconfigured app never fetches a bundled substitute it cannot serve. Configuring the pack (@superdoc/fonts, fonts.assetBaseUrl/resolveAssetUrl, or the CDN build) lights up the full reviewed set, gated by config presence rather than a runtime probe.

createSuperDocFonts({ include / exclude }) curates the pack by Word family name, validated against the offerings so a typo fails fast at setup time. Activation is document-scoped in the resolver and offerings and folded into the resolver signature, so a no-pack or curated document never reuses a full-pack document's measures. A CI drift check keeps the generated curatable list in sync with the offerings.
@caio-pizzol caio-pizzol requested a review from a team as a code owner June 13, 2026 15:43
@linear-code

linear-code Bot commented Jun 13, 2026

Copy link
Copy Markdown

SD-3441

@github-actions

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 02aa7d5c10

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread packages/super-editor/src/editors/v1/components/toolbar/constants.test.js Outdated
Comment thread shared/font-system/src/activation.ts Outdated
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

The optional bundled-font pack publishes under the org's npm scope, @superdoc-dev, not @superdoc. Renames the package and every reference: the runtime install warning, the getting-started examples (deps + imports), the docs plus the docs import allow-list, and the workspace lockfile. @superdoc/font-system (the internal, unpublished package) is unchanged.
Georgia is a pack-enabled rich option, not part of the one-per-generic
baseline, so the no-pack union expectation should not list it. Drop the
stale entry that failed once the baseline dropped to three.
Cut code-narrating and cross-file-repeating prose flagged in review: the
baseline and curatable-names JSDoc, the createSuperDocFonts and
composeToolbarFontOptions headers, and a headless-toolbar paragraph the
constants table already covers. The load-bearing why stays.
The package was renamed to @superdoc-dev/fonts, but the manual-publish
prose still named the old @superdoc org/scope. A stale operator runbook
can misdirect the publish, so align it with the package name.
A non-array include/exclude in hand-written fonts.bundled (e.g.
`include: 'Calibri'`) made normalizeList call .map on a string and throw
during editor init, and made warnUnknownBundledSelection spread the
string into per-character warnings. Coerce non-arrays to empty in both
paths so a wrong shape degrades to the full pack and warns once, honoring
the warn-not-crash contract. createSuperDocFonts stays the strict path.
@superdoc-bot superdoc-bot Bot closed this in 6a694fc Jun 13, 2026
@superdoc-bot

superdoc-bot Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

This pull request landed on main as 6a694fc.

@superdoc-bot

superdoc-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in superdoc-cli v0.18.0

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in superdoc-sdk v1.17.0

@superdoc-bot

superdoc-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in @superdoc-dev/mcp v0.13.0

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in superdoc v1.41.0

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in @superdoc-dev/react v1.12.0

The release is available on GitHub release

@superdoc-bot

superdoc-bot Bot commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in vscode-ext v2.13.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants