npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@reportwright/fonts-cjk

v1.0.0

Published

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

Readme

@reportwright/fonts-cjk (optional)

Chinese, Japanese, Korean and emoji fonts for ReportWright, downloaded on demand and checked by SHA-256.

npm license Socket

Live demo: mrarun005.github.io/reportwright-demo (the gallery and the designer playground; the demo serves the bundled fonts, so CJK text there needs this package's files in its fontsUrl folder).

The fonts are Noto (SIL Open Font License). They are not in @reportwright/fonts because they are large:

| File | Covers | Size | |---|---|---| | NotoSansJP.ttf | kana, Han (the default for Han text), CJK punctuation, full-width forms | 9.6 MB | | NotoSansKR.ttf | Hangul | 10.4 MB | | NotoSansSC.ttf | Simplified Chinese Han shapes (set fontFamily: "Noto Sans SC") | 17.8 MB | | NotoEmoji.ttf | emoji (monochrome) | 2.0 MB | | total | | 39.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 set | that 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.

Quick start (30 seconds)

After npx reportwright-fonts-cjk, CJK text renders with no other change:

import { render, defaultFontStore, exportPdf } from '@reportwright/engine';
const fonts = defaultFontStore();   // also reads the CJK cache folder
const def = { $schema: 'reportwright/report@1', name: 'Hello', page: { size: 'A4', margins: [36, 36, 36, 36] },
  sections: { body: { items: [{ type: 'textbox', name: 'Hi', x: 0, y: 0, w: 400, h: 24, value: 'こんにちは · 안녕하세요 · 你好' }] } } };
const pdf = await exportPdf(await render(def, { fontStore: fonts }), { fonts });

Verified against this version in Node 20 (Japanese, Korean and Simplified Chinese; the emoji download returned HTTP 504 from the upstream host on the day it was checked, and the command stops at the first failed file).

Examples

Docker image: download at build time into a fixed folder the server also reads.

ENV REPORTWRIGHT_FONTS_DIR=/opt/reportwright/fonts
RUN npx reportwright-fonts-cjk

Simplified Chinese shapes instead of the default (Japanese) Han shapes: "style": { "fontFamily": "Noto Sans SC" }.

Browser viewer: download into the served fonts folder, under cjk/: npx reportwright-fonts-cjk public/pw/fonts/cjk with fontsUrl: '/pw/fonts/'.

API

| Export | What | |---|---| | fetchCjkFonts(dir?, { log?, fetch? }) | downloads and checks every file into dir (default cacheDir()) | | cacheDir(env?, platform?, home?) | the folder the fonts go to (rules below) | | fontPath(name) | a downloaded file's path | | CJK_FONTS | the files: upstream path, file name, SHA-256 | | CLI reportwright-fonts-cjk [dir] | fetchCjkFonts from the command line |

Requires Node 20.9 or later (it uses the global fetch). Related: @reportwright/fonts (the bundled fonts), @reportwright/engine, @reportwright/viewer.