@betteroffice/fonts-cjk 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +26 -20
- package/package.json +4 -1
package/LICENSE
CHANGED
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
same "printed page" as the copyright notice for easier
|
|
187
187
|
identification within third-party archives.
|
|
188
188
|
|
|
189
|
-
Copyright 2026 The OpenOOXML
|
|
189
|
+
Copyright 2026 Elia Hilse, The OpenOOXML Project
|
|
190
190
|
|
|
191
191
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
192
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
# @betteroffice/fonts-cjk
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Chinese, Japanese and Korean faces for [`@betteroffice/fonts`](https://www.npmjs.com/package/@betteroffice/fonts).
|
|
4
|
+
The five faces add 33 MB, so they ship as a separate, optional package.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
## Install
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
bun add @betteroffice/fonts @betteroffice/fonts-cjk
|
|
7
10
|
```
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
## Usage
|
|
10
13
|
|
|
11
|
-
|
|
14
|
+
No import from this package is needed. Install it next to `@betteroffice/fonts` and configure that
|
|
15
|
+
package once; it loads these faces through an optional dynamic import.
|
|
12
16
|
|
|
13
|
-
|
|
17
|
+
```ts
|
|
18
|
+
import { configureDefaultFonts } from '@betteroffice/docx/layout';
|
|
19
|
+
import * as fonts from '@betteroffice/fonts';
|
|
14
20
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
| `@betteroffice/fonts` | 65 | 14.2 MB |
|
|
18
|
-
| `@betteroffice/fonts-cjk` | 5 | 33 MB |
|
|
21
|
+
configureDefaultFonts({ fonts });
|
|
22
|
+
```
|
|
19
23
|
|
|
20
|
-
The
|
|
24
|
+
The `@betteroffice/fonts/cdn` entry loads the CJK faces from a CDN without installing this package.
|
|
21
25
|
|
|
22
26
|
## Contents
|
|
23
27
|
|
|
@@ -29,22 +33,24 @@ The overwhelming majority of documents need only the base package. Measured over
|
|
|
29
33
|
| Noto Sans JP | MS (P)Gothic, MS (P)Mincho, Meiryo, Yu Gothic, Yu Mincho (MS ゴシック, MS 明朝, メイリオ, 游ゴシック, 游明朝) | `cjk-jp` | OFL 1.1 | 2.004 |
|
|
30
34
|
| Noto Sans KR | Malgun Gothic, Gulim, Dotum, Batang, Gungsuh (맑은 고딕, 굴림, 돋움, 바탕, 궁서) | `cjk-kr` | OFL 1.1 | 2.004 |
|
|
31
35
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
- Each face ships Regular. Ming, Mincho and Batang families map to regional Noto Sans faces.
|
|
36
|
-
- These are noto-cjk's static `SubsetOTF` Regulars, so browser and Rust measurement read identical advances.
|
|
36
|
+
Each face ships Regular. Ming, Mincho and Batang families map to the regional Noto Sans faces. The
|
|
37
|
+
files are noto-cjk's static `SubsetOTF` Regulars, so the browser and the engine measure the same
|
|
38
|
+
advances.
|
|
37
39
|
|
|
38
40
|
## API
|
|
39
41
|
|
|
40
|
-
You do not normally import this package. `@betteroffice/fonts` resolves it on its own; the single export exists so bundlers emit the assets.
|
|
41
|
-
|
|
42
42
|
```ts
|
|
43
43
|
import { CJK_FONT_ASSET_URLS } from '@betteroffice/fonts-cjk';
|
|
44
44
|
```
|
|
45
45
|
|
|
46
|
-
`CJK_FONT_ASSET_URLS` maps
|
|
46
|
+
`CJK_FONT_ASSET_URLS` maps each asset filename, as named in the `@betteroffice/fonts` manifest, to a
|
|
47
|
+
`() => URL` resolver. It exists so bundlers emit the assets; hosts do not normally import it.
|
|
48
|
+
|
|
49
|
+
## Documentation
|
|
50
|
+
|
|
51
|
+
- [`@betteroffice/fonts`](https://www.npmjs.com/package/@betteroffice/fonts)
|
|
52
|
+
- [Packages and fonts](https://docs.betteroffice.dev/docs/packages#fonts)
|
|
47
53
|
|
|
48
54
|
## Licensing
|
|
49
55
|
|
|
50
|
-
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
|
|
56
|
+
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](https://github.com/notofonts/noto-cjk) at commit `f8d157532fbfaeda587e826d4cd5b21a49186f7c` (`Sans/SubsetOTF/{SC,TC,JP,KR}/`, `Serif/SubsetOTF/SC/`).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@betteroffice/fonts-cjk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "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.",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -47,6 +47,9 @@
|
|
|
47
47
|
"url": "https://github.com/openooxml/betteroffice.git",
|
|
48
48
|
"directory": "packages/fonts-cjk"
|
|
49
49
|
},
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/openooxml/betteroffice/issues"
|
|
52
|
+
},
|
|
50
53
|
"publishConfig": {
|
|
51
54
|
"access": "public"
|
|
52
55
|
}
|