@reogrid/font-jp
v2.0.0
Published
Noto Sans JP subset (Thin/Regular/Bold) for ReoGrid PDF export (ja).
Readme
@reogrid/font-jp
Noto Sans JP — subset to the EUC-JP repertoire and instanced at Thin (100), Regular (400), Bold (700) — packaged for ReoGrid PDF export, so a browser never has to fetch a 9.15 MB variable font from a CDN.
npm install @reogrid/font-jpimport { registerPdfFont, preloadPdfFont } from '@reogrid/pro';
import { notoSansJP } from '@reogrid/font-jp';
registerPdfFont('ja', notoSansJP); // all three weights
await preloadPdfFont('ja'); // once, at app start
grid.saveAsPdf({ locale: 'ja', filename: 'report.pdf' });Bold cells print with real Bold outlines instead of a stroked approximation. To keep the download to a single face, register just that one:
import { loadNotoSansJPRegular } from '@reogrid/font-jp';
registerPdfFont('ja', loadNotoSansJPRegular);The per-weight form needs
@reogrid/pro1.6.0 or newer. Older versions accept the single-face form above.
What is in it
| | |
|---|---|
| Upstream | notosansjp @ 7ff85c87f9 |
| Characters | 6,979 (EUC-JP repertoire + ASCII + ¥₩€£¢) |
| Upstream | 9.15 MB (variable) |
| Thin — NotoSansJP-Thin.ttf | 2559 KB |
| Regular — NotoSansJP-Regular.ttf | 2557 KB |
| Bold — NotoSansJP-Bold.ttf | 2557 KB |
Each weight is a plain static face: fvar/gvar are gone, OS/2.usWeightClass
is set, and the name table says which weight it is. A consumer that embeds
glyf outlines without applying variations — which is what a PDF engine does —
therefore draws the weight you asked for. (Upstream's variable font defaults to
wght 100, which is why embedding it directly produces a hairline document.)
Characters outside that repertoire fall back to .notdef — pass your own font
bytes to registerPdfFont if you need wider coverage.
Without a bundler
The .ttf files are published in the package, so a CDN serves them directly:
https://cdn.jsdelivr.net/npm/@reogrid/[email protected]/NotoSansJP-Regular.ttfThat is where ReoGrid's built-in { locale: 'ja' } font comes from when
you have not registered anything yourself.
Licence
Noto Sans JP is licensed under the SIL Open Font License 1.1, which is included in this package and applies to the subset as well. The build scripts are MIT.
