@reductoai/portable-fonts
v0.0.5
Published
Portable Latin, math, Arabic, Devanagari, Hebrew, Thai, and pan-CJK fonts for deterministic document rendering on hosts without fonts.
Readme
@reductoai/portable-fonts
Portable runtime fonts for deterministic document rendering on hosts without system fonts. The 18 MB of font bytes live in one package, so every renderer that depends on it shares one download.
The profile contains:
- metric-compatible Latin faces for common Microsoft Office families (Liberation Serif / Sans / Sans Narrow / Mono, Carlito, Caladea, Gelasio for Georgia, Selawik for Segoe UI)
- Lato Light, an OFL approximation of Calibri Light
- STIX Two Math, an OFL math face (MATH table, Greek, math alphabets) in the place of Cambria Math
- Noto Sans Arabic, Devanagari, Hebrew, Thai, Symbols 2 and Noto Emoji
- Droid Sans Fallback, an Apache-licensed pan-CJK face
Usage
import { portableCjkFontPath, portableFontPaths } from "@reductoai/portable-fonts";
portableFontPaths["Carlito-Regular.ttf"]; // absolute path to the .ttf
portableCjkFontPath; // absolute path to DroidSansFallback.ttfA bundler can serve one face as a URL:
import cjkUrl from "@reductoai/portable-fonts/files/DroidSansFallback.ttf?url";The exported paths come from literal new URL() references, so Node file
tracers include the font assets in Docker and serverless deployments.
Licenses
See LICENSE.md. The Latin and Noto faces are SIL OFL 1.1
(Gelasio, Selawik and Noto carry their own texts: OFL-Gelasio.txt, OFL-Selawik.txt, OFL-Noto.txt);
Droid Sans Fallback is Apache 2.0 (notice in DROID-NOTICE).
