Skip to content

superdoc-dev/docfonts

Repository files navigation

docfonts

npm version License: MIT

Document font substitution, measured.

docfonts publishes @docfonts/fallbacks, a small runtime package for document renderers. It maps common proprietary document fonts to reviewed open-font fallback decisions.

The package ships no font binaries and no proprietary data. It contains a public evidence snapshot, asset-aware lookup helpers, and tests that prove the npm package only includes supported runtime files.

Built by the team behind SuperDoc. Standalone and neutral.

Package

  • packages/fallbacks - runtime fallback decisions and lookup helpers.

Workflows

  • Runtime: install @docfonts/fallbacks and call the lookup helpers.
  • Acquire: run bun run --cwd packages/fallbacks acquire to download reviewed open-font source archives into an ignored local cache and write local hash snapshots.
  • Compare: planned local tooling. Results should stay local unless deliberately published through a curated product surface.

API

  • getRenderableFallback - returns the open family to render, or null when none is renderable.
  • getFallbackDecision - explains the outcome for UI, diagnostics, and reporting.
  • createFallbackMap - builds a resolver map from only the font families you can render.
  • normalizeFamilyName - normalizes map lookup keys.

Install

npm install @docfonts/fallbacks

Dev

bun install
bun run typecheck
bun run test
bun run lint
bun run build

Release

@docfonts/fallbacks is released by the release-fallbacks workflow on every push to main. semantic-release publishes a new version when the merged commits contain a releasable Conventional Commit. The same workflow can still run manually as a dry run.