@betteroffice/fonts-cjk

中文文档
0.4.2发布于 2026/10/27(Apache-2.0 AND OFL-1.1)TypeScriptES Module零依赖构建来源已验证近 30 天下载 3.9万

Optional CJK font binaries for @betteroffice/fonts: Noto Sans SC/TC/JP/KR and Noto Serif SC coverage faces for Chinese, Japanese and Korean documents.

原始使用文档
文档目录6 节
  1. Install
  2. Usage
  3. Contents
  4. API
  5. Documentation
  6. Licensing

@betteroffice/fonts-cjk

Chinese, Japanese and Korean faces for @betteroffice/fonts. The five faces add 33 MB, so they ship as a separate, optional package.

Install

bun add @betteroffice/fonts @betteroffice/fonts-cjk

Usage

No import from this package is needed. Install it next to @betteroffice/fonts and configure that package once; it loads these faces through an optional dynamic import.

import { configureDefaultFonts } from '@betteroffice/docx/layout';
import * as fonts from '@betteroffice/fonts';

configureDefaultFonts({ fonts });

The @betteroffice/fonts/cdn entry loads the CJK faces from a CDN without installing this package.

Contents

Bundled familySubstitutes for (Word families)Script bucketLicenseVersion
Noto Sans SCMicrosoft YaHei, SimHei, DengXian (微软雅黑, 黑体, 等线)cjk-scOFL 1.12.004
Noto Serif SCSimSun, NSimSun, FangSong, KaiTi (宋体, 仿宋, 楷体)cjk-scOFL 1.12.003
Noto Sans TCMicrosoft JhengHei, PMingLiU, MingLiU, DFKai-SB (微軟正黑體, 新細明體, 細明體, 標楷體)cjk-tcOFL 1.12.004
Noto Sans JPMS (P)Gothic, MS (P)Mincho, Meiryo, Yu Gothic, Yu Mincho (MS ゴシック, MS 明朝, メイリオ, 游ゴシック, 游明朝)cjk-jpOFL 1.12.004
Noto Sans KRMalgun Gothic, Gulim, Dotum, Batang, Gungsuh (맑은 고딕, 굴림, 돋움, 바탕, 궁서)cjk-krOFL 1.12.004

Each face ships Regular. Ming, Mincho and Batang families map to the regional Noto Sans faces. The files are noto-cjk's static SubsetOTF Regulars, so the browser and the engine measure the same advances.

API

import { CJK_FONT_ASSET_URLS } from '@betteroffice/fonts-cjk';

CJK_FONT_ASSET_URLS maps each asset filename, as named in the @betteroffice/fonts manifest, to a () => URL resolver. It exists so bundlers emit the assets; hosts do not normally import it.

Documentation

Licensing

The loader code is Apache-2.0 (see LICENSE). The font binaries are licensed under the SIL Open Font License 1.1; LICENSES/OFL-NotoCJK.txt carries the full license text preceded by the copyright notices it applies to. Notices: Copyright 2014-2021 Adobe for Noto Sans SC/TC/JP/KR, and Copyright 2017-2024 Adobe for Noto Serif SC, both with Reserved Font Name "Source". Static SubsetOTF Regulars vendored from notofonts/noto-cjk at commit f8d157532fbfaeda587e826d4cd5b21a49186f7c (Sans/SubsetOTF/{SC,TC,JP,KR}/, Serif/SubsetOTF/SC/).

版本与发布记录

@betteroffice/fonts-cjk 共发布 7 个版本,首次发布于 2026/08/20;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.4.2latest2026/10/2712 天前
0.4.12026/10/2613 天前
0.4.02026/10/011 个月前
0.3.02026/09/291 个月前
0.2.02026/09/161 个月前
0.1.02026/08/202 个月前

关于 @betteroffice/fonts-cjk 的常见问题

@betteroffice/fonts-cjk 是什么?

Optional CJK font binaries for @betteroffice/fonts: Noto Sans SC/TC/JP/KR and Noto Serif SC coverage faces for Chinese, Japanese and Korean documents.

如何安装 @betteroffice/fonts-cjk?

在项目目录运行 npm install @betteroffice/fonts-cjk,或使用 pnpm add / yarn add / bun add。

@betteroffice/fonts-cjk 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@betteroffice/fonts-cjk 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@betteroffice/fonts-cjk 可以商用吗?

@betteroffice/fonts-cjk 使用 (Apache-2.0 AND OFL-1.1) 许可。声明的许可为 (Apache-2.0 AND OFL-1.1),请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@betteroffice/fonts-cjk 的下载量有多少?

根据 npm 官方下载统计,@betteroffice/fonts-cjk 在 2026/10/08 – 2026/11/06 这 30 天内被下载 39,028 次,日均约 1,301 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@betteroffice/fonts-cjk 还在维护吗?

最新版本 0.4.2 发布于 2026/10/27(12 天前);至今共发布 7 个版本,其中过去 12 个月发布了 7 个;首次发布于 2026/08/20。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。