npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@superdoc-dev/fonts

v0.1.3

Published

Optional bundled metric-compatible font substitutes for SuperDoc, shipped as bundler-resolvable assets.

Downloads

3,234

Readme

@superdoc-dev/fonts

The reviewed metric-compatible font substitutes SuperDoc renders when a document asks for a proprietary font (Carlito for Calibri, Liberation Serif for Times New Roman, and so on). This package holds the .woff2 binaries and hands SuperDoc a URL for each face that your bundler emits and rewrites automatically.

It is optional. Install it when you want SuperDoc's built-in fallbacks to render everywhere without hosting the fonts yourself. If you load your own fonts (or only need fonts the user's OS already has), you can skip it.

Why a separate package

The pack is about 6 MB of font binaries. Keeping it out of the superdoc core means the core stays small, and apps that do not need the fallbacks do not pay for them. The faces still load lazily in the browser: only the few a document actually uses are fetched.

Usage

import { SuperDoc } from 'superdoc';
import { resolveBundledFontAssetUrl } from '@superdoc-dev/fonts';

new SuperDoc({
  selector: '#editor',
  document: 'contract.docx',
  fonts: { resolveAssetUrl: resolveBundledFontAssetUrl },
});

Or pass the ready-made config object:

import { superdocFonts } from '@superdoc-dev/fonts';

new SuperDoc({ selector: '#editor', document, fonts: superdocFonts });

That is the whole setup. No copying files into public/, no assetBaseUrl. The asset URLs are written as new URL('../assets/<file>', import.meta.url), which Vite, Webpack 5, Next, Nuxt, esbuild, and Parcel all detect, emit, and rewrite to the final hashed path.

CDN / <script> tag (no bundler)

For a plain HTML page, load the browser build and use the SuperDocFonts global. It exposes the same API, and the faces resolve relative to the script, so there is no bundler and no path config:

<script src="https://cdn.jsdelivr.net/npm/superdoc/dist/superdoc.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@superdoc-dev/fonts/dist/superdoc-fonts.min.js"></script>
<script>
  new SuperDoc({
    selector: '#editor',
    document: 'contract.docx',
    fonts: SuperDocFonts.superdocFonts, // or SuperDocFonts.createSuperDocFonts({ exclude: [...] })
  });
</script>

The superdoc CDN build ships no fonts and shows the baseline until you add this script. Self-hosting works too: keep the package's dist/ and assets/ in their relative layout, since the faces resolve to ../assets/ next to superdoc-fonts.min.js.

Choosing which fonts

superdocFonts enables every reviewed family. To narrow the set, use createSuperDocFonts and name the families by their Word name (Calibri, not the substitute Carlito):

import { createSuperDocFonts } from '@superdoc-dev/fonts';

// Everything except a couple:
new SuperDoc({ selector: '#editor', document, fonts: createSuperDocFonts({ exclude: ['Cooper Black'] }) });

// Or only an explicit set:
new SuperDoc({ selector: '#editor', document, fonts: createSuperDocFonts({ include: ['Calibri', 'Cambria'] }) });

include is an allow-list; exclude keeps everything but the named families. Curation drives the toolbar list and which families SuperDoc substitutes. Your own licensed fonts stay separate (fonts.families).

Hosting the assets another way

If you serve the fonts from a CDN or a signed path instead, you do not need this package's resolver. Point SuperDoc at your location with fonts.assetBaseUrl or your own fonts.resolveAssetUrl.

Versioning

@superdoc-dev/fonts and superdoc version independently, but they share the bundled font set. Update them together. If the two drift, the resolver throws on an unknown face filename rather than degrading silently, so a mismatch surfaces immediately instead of turning into a missing font at render time.

Licenses

Each bundled family keeps its upstream license. See assets/LICENSES.md and the license texts in assets/.