@junejs/pdf-font-noto-sans-sc 0.2.1 → 0.2.3
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/dist/node.d.ts +1 -3
- package/dist/node.js +2 -3
- package/dist/{provider-B3tIQZ_n.js → provider-BJeDZB-7.js} +1 -2
- package/dist/{provider-BY0vzFDR.d.ts → provider-BLfQ0ArA.d.ts} +0 -4
- package/dist/unbundled.d.ts +1 -3
- package/dist/unbundled.js +3 -5
- package/dist/workerd.d.ts +1 -3
- package/dist/workerd.js +2 -3
- package/package.json +5 -5
package/dist/node.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { n as NotoSansSCOptions, r as NotoSansSCWeight } from "./provider-
|
|
2
|
-
//#region src/node.d.ts
|
|
1
|
+
import { n as NotoSansSCOptions, r as NotoSansSCWeight } from "./provider-BLfQ0ArA.js";
|
|
3
2
|
export declare function notoSansSC(opts?: NotoSansSCOptions): import("@junejs/pdf-typst-wasm").FontProvider;
|
|
4
|
-
//#endregion
|
|
5
3
|
export type { NotoSansSCOptions, NotoSansSCWeight };
|
package/dist/node.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { i as createNotoSansSC, n as MISSING, t as FILES } from "./provider-
|
|
1
|
+
import { i as createNotoSansSC, n as MISSING, t as FILES } from "./provider-BJeDZB-7.js";
|
|
2
2
|
import { readFile } from "node:fs/promises";
|
|
3
|
-
|
|
3
|
+
// src/node.ts
|
|
4
4
|
function notoSansSC(opts = {}) {
|
|
5
5
|
return createNotoSansSC(async (weight) => {
|
|
6
6
|
try {
|
|
@@ -10,5 +10,4 @@ function notoSansSC(opts = {}) {
|
|
|
10
10
|
}
|
|
11
11
|
}, opts);
|
|
12
12
|
}
|
|
13
|
-
//#endregion
|
|
14
13
|
export { notoSansSC };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// src/provider.ts
|
|
2
2
|
function createNotoSansSC(load, opts = {}, egress = []) {
|
|
3
3
|
const weights = [...new Set(opts.weights ?? [400, 700])];
|
|
4
4
|
for (const w of weights) if (w !== 400 && w !== 700) throw new Error(`notoSansSC: no weight ${w} (this package ships 400 and 700)`);
|
|
@@ -24,5 +24,4 @@ const FILES = {
|
|
|
24
24
|
700: NOTO_SANS_SC[700].name
|
|
25
25
|
};
|
|
26
26
|
const MISSING = "@junejs/pdf-font-noto-sans-sc: its font files are missing — in the June repo, run `bun scripts/fetch-fonts.ts` in packages/pdf-font-noto-sans-sc";
|
|
27
|
-
//#endregion
|
|
28
27
|
export { createNotoSansSC as i, MISSING as n, NOTO_SANS_SC as r, FILES as t };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { FontEgress } from "@junejs/pdf-typst-wasm";
|
|
2
|
-
//#region src/assets.d.ts
|
|
3
2
|
type AssetRef = {
|
|
4
3
|
name: string;
|
|
5
4
|
sha256: string;
|
|
@@ -8,12 +7,9 @@ type AssetRef = {
|
|
|
8
7
|
};
|
|
9
8
|
type AssetLoader = (ref: AssetRef) => Promise<Uint8Array | ArrayBuffer>;
|
|
10
9
|
declare function loadVerified(ref: AssetRef, load: AssetLoader): Promise<Uint8Array>;
|
|
11
|
-
//#endregion
|
|
12
|
-
//#region src/provider.d.ts
|
|
13
10
|
type NotoSansSCWeight = 400 | 700;
|
|
14
11
|
type NotoSansSCOptions = {
|
|
15
12
|
weights?: NotoSansSCWeight[];
|
|
16
13
|
};
|
|
17
14
|
declare const NOTO_SANS_SC: Record<NotoSansSCWeight, AssetRef>;
|
|
18
|
-
//#endregion
|
|
19
15
|
export { AssetRef as a, AssetLoader as i, NotoSansSCOptions as n, loadVerified as o, NotoSansSCWeight as r, NOTO_SANS_SC as t };
|
package/dist/unbundled.d.ts
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { a as AssetRef, i as AssetLoader, n as NotoSansSCOptions, o as loadVerified, r as NotoSansSCWeight, t as NOTO_SANS_SC } from "./provider-
|
|
1
|
+
import { a as AssetRef, i as AssetLoader, n as NotoSansSCOptions, o as loadVerified, r as NotoSansSCWeight, t as NOTO_SANS_SC } from "./provider-BLfQ0ArA.js";
|
|
2
2
|
import { FontEgress } from "@junejs/pdf-typst-wasm";
|
|
3
|
-
//#region src/unbundled.d.ts
|
|
4
3
|
export type UnbundledNotoSansSCOptions = NotoSansSCOptions & {
|
|
5
4
|
load: AssetLoader;
|
|
6
5
|
egress?: FontEgress[];
|
|
7
6
|
};
|
|
8
7
|
export declare function notoSansSC(opts: UnbundledNotoSansSCOptions): import("@junejs/pdf-typst-wasm").FontProvider;
|
|
9
|
-
//#endregion
|
|
10
8
|
export { type AssetLoader, type AssetRef, NOTO_SANS_SC, type NotoSansSCOptions, type NotoSansSCWeight, loadVerified };
|
package/dist/unbundled.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as createNotoSansSC, r as NOTO_SANS_SC } from "./provider-
|
|
2
|
-
|
|
1
|
+
import { i as createNotoSansSC, r as NOTO_SANS_SC } from "./provider-BJeDZB-7.js";
|
|
2
|
+
// src/assets.ts
|
|
3
3
|
async function loadVerified(ref, load) {
|
|
4
4
|
const got = await load(ref);
|
|
5
5
|
const bytes = got instanceof Uint8Array ? got.buffer instanceof SharedArrayBuffer ? got.slice() : got : new Uint8Array(got);
|
|
@@ -9,8 +9,7 @@ async function loadVerified(ref, load) {
|
|
|
9
9
|
if (hex !== ref.sha256) throw new Error(`${ref.name}: the loader returned bytes with sha256 ${hex}, expected ${ref.sha256}`);
|
|
10
10
|
return bytes;
|
|
11
11
|
}
|
|
12
|
-
|
|
13
|
-
//#region src/unbundled.ts
|
|
12
|
+
// src/unbundled.ts
|
|
14
13
|
const HOSTS = [...new Set(Object.values(NOTO_SANS_SC).flatMap((r) => r.urls.map((u) => new URL(u).host)))].map((host) => ({
|
|
15
14
|
host,
|
|
16
15
|
sends: "nothing"
|
|
@@ -19,5 +18,4 @@ function notoSansSC(opts) {
|
|
|
19
18
|
const { load, egress, ...rest } = opts;
|
|
20
19
|
return createNotoSansSC((weight) => loadVerified(NOTO_SANS_SC[weight], load), rest, egress ?? HOSTS);
|
|
21
20
|
}
|
|
22
|
-
//#endregion
|
|
23
21
|
export { NOTO_SANS_SC, loadVerified, notoSansSC };
|
package/dist/workerd.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { n as NotoSansSCOptions, r as NotoSansSCWeight } from "./provider-
|
|
2
|
-
//#region src/workerd.d.ts
|
|
1
|
+
import { n as NotoSansSCOptions, r as NotoSansSCWeight } from "./provider-BLfQ0ArA.js";
|
|
3
2
|
export declare function notoSansSC(opts?: NotoSansSCOptions): import("@junejs/pdf-typst-wasm").FontProvider;
|
|
4
|
-
//#endregion
|
|
5
3
|
export type { NotoSansSCOptions, NotoSansSCWeight };
|
package/dist/workerd.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { i as createNotoSansSC } from "./provider-
|
|
1
|
+
import { i as createNotoSansSC } from "./provider-BJeDZB-7.js";
|
|
2
2
|
import bold from "../fonts/NotoSansSC-Bold.otf";
|
|
3
3
|
import regular from "../fonts/NotoSansSC-Regular.otf";
|
|
4
|
-
|
|
4
|
+
// src/workerd.ts
|
|
5
5
|
function notoSansSC(opts = {}) {
|
|
6
6
|
return createNotoSansSC(async (weight) => new Uint8Array(weight === 700 ? bold : regular), opts);
|
|
7
7
|
}
|
|
8
|
-
//#endregion
|
|
9
8
|
export { notoSansSC };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@junejs/pdf-font-noto-sans-sc",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"description": "June — Noto Sans SC (Simplified Chinese, regular and bold) as an offline font provider for @junejs/pdf-typst-wasm: no network call, on Node, Bun, Deno and Cloudflare Workers.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT AND OFL-1.1",
|
|
@@ -44,12 +44,12 @@
|
|
|
44
44
|
"test": "bun test"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@junejs/pdf-typst-wasm": "^0.2.
|
|
47
|
+
"@junejs/pdf-typst-wasm": "^0.2.3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@junejs/pdf": "^0.2.
|
|
51
|
-
"@junejs/pdf-typst-wasm": "^0.2.
|
|
52
|
-
"@junejs/server": "^0.2.
|
|
50
|
+
"@junejs/pdf": "^0.2.3",
|
|
51
|
+
"@junejs/pdf-typst-wasm": "^0.2.3",
|
|
52
|
+
"@junejs/server": "^0.2.3"
|
|
53
53
|
},
|
|
54
54
|
"keywords": [
|
|
55
55
|
"june",
|