@reductoai/portable-fonts
v0.0.1
Published
Portable Latin, Arabic, Devanagari, Hebrew, Thai, and pan-CJK fonts for deterministic document rendering on hosts without fonts.
Readme
@reductoai/portable-fonts
Portable runtime fonts for @reductoai/docx and @reductoai/pptx. Both
packages depend on this one, so a host that installs both downloads the 16 MB of
font bytes once.
The profile contains:
- metric-compatible Latin faces for common Microsoft Office families (Liberation Serif / Sans / Sans Narrow / Mono, Carlito, Caladea)
- Lato Light, an OFL approximation of Calibri Light
- Noto Sans Arabic, Devanagari, Hebrew, Thai, Symbols 2 and Noto Emoji
- Droid Sans Fallback, an Apache-licensed pan-CJK face
Usage
Most hosts never import this package directly. Call registerPortableFonts()
from @reductoai/docx/node or @reductoai/pptx/node and the engine reads the
faces from here.
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;
Droid Sans Fallback is Apache 2.0 (notice in DROID-NOTICE).
