New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@reportwright/fonts-cjk

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@reportwright/fonts-cjk

Chinese, Japanese, Korean and emoji fonts (Noto, OFL) for @reportwright/engine, downloaded on demand: npx reportwright-fonts-cjk.

Source
npmnpm
Version
0.13.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@reportwright/fonts-cjk (optional)

npm license Socket

Chinese, Japanese, Korean and emoji fonts for ReportWright (Noto, SIL Open Font License). They are not in @reportwright/fonts because they are large:

FileCoversSize
NotoSansJP.ttfkana, Han (the default for Han text), CJK punctuation, full-width forms9.6 MB
NotoSansKR.ttfHangul10.4 MB
NotoSansSC.ttfSimplified Chinese Han shapes (set fontFamily: "Noto Sans SC")17.8 MB
NotoEmoji.ttfemoji (monochrome)2.0 MB
total39.8 MB (the bundled fonts are 5.0 MB)

The package is small: the fonts are downloaded on demand (no install script runs), from google/fonts at a pinned commit, and each file is checked against its SHA-256 before it is written.

npm i @reportwright/engine @reportwright/fonts @reportwright/fonts-cjk
npx reportwright-fonts-cjk              # into the cache folder (below), where defaultFontStore() looks
npx reportwright-fonts-cjk public/pw/fonts/cjk   # or a folder you serve to the viewer (fontsUrl + cjk/)
import { fetchCjkFonts } from '@reportwright/fonts-cjk';
await fetchCjkFonts();                 // the same, from code (e.g. in your Docker build)

The fonts go to a cache folder outside node_modules, so upgrading or reinstalling the package keeps them:

Folder
REPORTWRIGHT_FONTS_DIR setthat folder
XDG_CACHE_HOME set$XDG_CACHE_HOME/reportwright/fonts-cjk
Windows%LOCALAPPDATA%\reportwright\fonts-cjk
otherwise~/.cache/reportwright/fonts-cjk

defaultFontStore() reads that folder first, then node_modules/@reportwright/fonts-cjk/fonts, where earlier versions downloaded them (so an existing install keeps working until its next upgrade). In a Docker image, set REPORTWRIGHT_FONTS_DIR for both the download step and the server, or run the download as the user the server runs as. cacheDir() and fontPath(name) give the folder and a downloaded file's path from code.

In the ReportWright app repository: npm run fonts:cjk (into public/fonts/cjk).

Licences: the fonts are SIL Open Font License 1.1 (OFL.txt is downloaded with them); the downloader is MIT.

The engine loads a face only when text needs it (FontStore asks for cjk/NotoSansJP.ttf through fontFile(key)), and a PDF embeds only the glyphs it uses: a line of Japanese, Korean and emoji adds about 8 KB. Without the files, those characters draw as boxes and the render warns how to add them. The fonts are variable fonts drawn at their default (regular) weight; bold CJK text is drawn regular.

Keywords

reportwright

FAQs

Package last updated on 08 Oct 2026

Related posts