Unifont is a framework-agnostic JavaScript/TypeScript library designed to streamline access to font data from various Content Delivery Networks (CDNs) and font providers. It abstracts away the complexities of fetching and resolving fonts, supporting popular services like Google Fonts, Adobe Fonts, Bunny Fonts, Fontshare, and Fontsource. The library is currently at version 0.7.4 and maintains an active release cadence, frequently adding new provider features and addressing bug fixes, as seen in its recent updates like npm package resolution support and Adobe race condition handling. A key differentiator is its modular provider architecture, allowing users to integrate multiple font sources and even develop custom providers, simplifying font management and optimization across projects. It is an ESM-only package.
npm install unifontVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize Unifont with multiple providers, list available fonts, and resolve specific font families with optional configurations like variable axis settings for Google Fonts.
Review font resolution configurations and explicitly request all desired variable font faces if they are not being loaded as expected.
Ensure your project is configured for ESM, typically by setting `"type": "module"` in `package.json` or using `.mjs` file extensions, and use `import` statements.
When initializing `providers.adobe()`, ensure you pass the `id` option, e.g., `providers.adobe({ id: process.env.ADOBE_KIT_ID ?? '' })`.Upgrade to v0.7.4 or later. For very high-concurrency scenarios, consider implementing custom retry logic or rate limiting around `unifont.resolveFont()` calls.
Ensure your project uses ES Modules (ESM). For Node.js, set `"type": "module"` in `package.json`. For bundlers, verify that your configuration supports ESM imports. Also, check for incorrect named vs default imports.
Pass the Adobe Fonts kit ID to the provider initialization: `providers.adobe({ id: 'your-adobe-kit-id' })`. It is recommended to load this from an environment variable.Ensure you are using one of the built-in providers (e.g., `providers.google()`, `providers.adobe()`) or a correctly implemented custom provider.
No dependency data recorded yet.