How fonts are chosen
The renderer asks a font registry for each family name in the workbook (Calibri, Aptos, Arial …). The registry gives a face, or a fallback.
@reductoai/portable-fonts ships a portable profile: open fonts with the same metrics as the Office fonts, such as Carlito for Calibri and Liberation Sans for Arial, plus fallbacks for CJK and other scripts.
Node
toPdf and toPng register fonts the first time they paint:
- If
DOCX_FONT_MIRRORis set, they use the portable profile plus the faces in that folder. - Else, on a Mac with the Office fonts installed, they use those fonts. This gives the closest match to Microsoft Excel.
- Else (Linux servers, CI), they use the portable profile and write one warning:
Browser
The grid needs a face provider before it paints.@reductoai/xlsx-editor sets one up for you: by default it loads the portable fonts from the npm CDN. To serve them yourself, copy node_modules/@reductoai/portable-fonts/files to your site and pass its URL:
@reductoai/xlsx/view alone, install the provider yourself. See View.