@betteroffice/fonts-cjk 0.2.0 → 0.4.0
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/README.md +5 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,15 +8,13 @@ npm install @betteroffice/fonts @betteroffice/fonts-cjk
|
|
|
8
8
|
|
|
9
9
|
Then hand the base module to the engine once, before any editor mounts — `configureDefaultFonts({ fonts })` from `@betteroffice/docx/layout`, as the [`@betteroffice/fonts` README](https://www.npmjs.com/package/@betteroffice/fonts) shows. `@betteroffice/fonts` picks these faces up through an optional dynamic import, so once the base package is configured the CJK script-fallback chain resolves as soon as this one is present.
|
|
10
10
|
|
|
11
|
-
Without it nothing breaks: a CJK face resolves to a loader that rejects, the engine logs it once and measures the run with the Latin last-resort face instead. That keeps pagination on the native path, but the ideographs are measured with a font that has no glyphs for them, so CJK line breaking will be wrong.
|
|
12
|
-
|
|
13
11
|
## Why a separate package
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
A separate package makes CJK binaries an explicit installation choice.
|
|
16
14
|
|
|
17
15
|
| Package | Faces | Size on disk |
|
|
18
16
|
| ------------------------- | ----- | ------------ |
|
|
19
|
-
| `@betteroffice/fonts` |
|
|
17
|
+
| `@betteroffice/fonts` | 65 | 14.2 MB |
|
|
20
18
|
| `@betteroffice/fonts-cjk` | 5 | 33 MB |
|
|
21
19
|
|
|
22
20
|
The overwhelming majority of documents need only the base package. Measured over 100 real-world English documents, Calibri appears in 91%, Times New Roman in 79%, Arial in 56% and Cambria in 52% — all covered by the base package's metric-compatible Latin set.
|
|
@@ -33,9 +31,9 @@ The overwhelming majority of documents need only the base package. Measured over
|
|
|
33
31
|
|
|
34
32
|
Notes:
|
|
35
33
|
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
-
|
|
34
|
+
- These Noto faces provide Chinese, Japanese and Korean glyph coverage.
|
|
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.
|
|
39
37
|
|
|
40
38
|
## API
|
|
41
39
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@betteroffice/fonts-cjk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
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",
|