@junejs/pdf-font-noto-sans-tc 0.2.2 → 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 CHANGED
@@ -1,5 +1,3 @@
1
- import { n as NotoSansTCOptions, r as NotoSansTCWeight } from "./provider-DIaL_q7p.js";
2
- //#region src/node.d.ts
1
+ import { n as NotoSansTCOptions, r as NotoSansTCWeight } from "./provider-B63Xdhd1.js";
3
2
  export declare function notoSansTC(opts?: NotoSansTCOptions): import("@junejs/pdf-typst-wasm").FontProvider;
4
- //#endregion
5
3
  export type { NotoSansTCOptions, NotoSansTCWeight };
package/dist/node.js CHANGED
@@ -1,6 +1,6 @@
1
- import { i as createNotoSansTC, n as MISSING, t as FILES } from "./provider-g4uaDoUt.js";
1
+ import { i as createNotoSansTC, n as MISSING, t as FILES } from "./provider-DW0Run3v.js";
2
2
  import { readFile } from "node:fs/promises";
3
- //#region src/node.ts
3
+ // src/node.ts
4
4
  function notoSansTC(opts = {}) {
5
5
  return createNotoSansTC(async (weight) => {
6
6
  try {
@@ -10,5 +10,4 @@ function notoSansTC(opts = {}) {
10
10
  }
11
11
  }, opts);
12
12
  }
13
- //#endregion
14
13
  export { notoSansTC };
@@ -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 NotoSansTCWeight = 400 | 700;
14
11
  type NotoSansTCOptions = {
15
12
  weights?: NotoSansTCWeight[];
16
13
  };
17
14
  declare const NOTO_SANS_TC: Record<NotoSansTCWeight, AssetRef>;
18
- //#endregion
19
15
  export { AssetRef as a, AssetLoader as i, NotoSansTCOptions as n, loadVerified as o, NotoSansTCWeight as r, NOTO_SANS_TC as t };
@@ -1,4 +1,4 @@
1
- //#region src/provider.ts
1
+ // src/provider.ts
2
2
  function createNotoSansTC(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(`notoSansTC: no weight ${w} (this package ships 400 and 700)`);
@@ -24,5 +24,4 @@ const FILES = {
24
24
  700: NOTO_SANS_TC[700].name
25
25
  };
26
26
  const MISSING = "@junejs/pdf-font-noto-sans-tc: its font files are missing — in the June repo, run `bun scripts/fetch-fonts.ts` in packages/pdf-font-noto-sans-tc";
27
- //#endregion
28
27
  export { createNotoSansTC as i, MISSING as n, NOTO_SANS_TC as r, FILES as t };
@@ -1,10 +1,8 @@
1
- import { a as AssetRef, i as AssetLoader, n as NotoSansTCOptions, o as loadVerified, r as NotoSansTCWeight, t as NOTO_SANS_TC } from "./provider-DIaL_q7p.js";
1
+ import { a as AssetRef, i as AssetLoader, n as NotoSansTCOptions, o as loadVerified, r as NotoSansTCWeight, t as NOTO_SANS_TC } from "./provider-B63Xdhd1.js";
2
2
  import { FontEgress } from "@junejs/pdf-typst-wasm";
3
- //#region src/unbundled.d.ts
4
3
  export type UnbundledNotoSansTCOptions = NotoSansTCOptions & {
5
4
  load: AssetLoader;
6
5
  egress?: FontEgress[];
7
6
  };
8
7
  export declare function notoSansTC(opts: UnbundledNotoSansTCOptions): import("@junejs/pdf-typst-wasm").FontProvider;
9
- //#endregion
10
8
  export { type AssetLoader, type AssetRef, NOTO_SANS_TC, type NotoSansTCOptions, type NotoSansTCWeight, loadVerified };
package/dist/unbundled.js CHANGED
@@ -1,5 +1,5 @@
1
- import { i as createNotoSansTC, r as NOTO_SANS_TC } from "./provider-g4uaDoUt.js";
2
- //#region src/assets.ts
1
+ import { i as createNotoSansTC, r as NOTO_SANS_TC } from "./provider-DW0Run3v.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
- //#endregion
13
- //#region src/unbundled.ts
12
+ // src/unbundled.ts
14
13
  const HOSTS = [...new Set(Object.values(NOTO_SANS_TC).flatMap((r) => r.urls.map((u) => new URL(u).host)))].map((host) => ({
15
14
  host,
16
15
  sends: "nothing"
@@ -19,5 +18,4 @@ function notoSansTC(opts) {
19
18
  const { load, egress, ...rest } = opts;
20
19
  return createNotoSansTC((weight) => loadVerified(NOTO_SANS_TC[weight], load), rest, egress ?? HOSTS);
21
20
  }
22
- //#endregion
23
21
  export { NOTO_SANS_TC, loadVerified, notoSansTC };
package/dist/workerd.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { n as NotoSansTCOptions, r as NotoSansTCWeight } from "./provider-DIaL_q7p.js";
2
- //#region src/workerd.d.ts
1
+ import { n as NotoSansTCOptions, r as NotoSansTCWeight } from "./provider-B63Xdhd1.js";
3
2
  export declare function notoSansTC(opts?: NotoSansTCOptions): import("@junejs/pdf-typst-wasm").FontProvider;
4
- //#endregion
5
3
  export type { NotoSansTCOptions, NotoSansTCWeight };
package/dist/workerd.js CHANGED
@@ -1,9 +1,8 @@
1
- import { i as createNotoSansTC } from "./provider-g4uaDoUt.js";
1
+ import { i as createNotoSansTC } from "./provider-DW0Run3v.js";
2
2
  import bold from "../fonts/NotoSansTC-Bold.otf";
3
3
  import regular from "../fonts/NotoSansTC-Regular.otf";
4
- //#region src/workerd.ts
4
+ // src/workerd.ts
5
5
  function notoSansTC(opts = {}) {
6
6
  return createNotoSansTC(async (weight) => new Uint8Array(weight === 700 ? bold : regular), opts);
7
7
  }
8
- //#endregion
9
8
  export { notoSansTC };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junejs/pdf-font-noto-sans-tc",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "June — Noto Sans TC (Traditional 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.2"
47
+ "@junejs/pdf-typst-wasm": "^0.2.3"
48
48
  },
49
49
  "devDependencies": {
50
- "@junejs/pdf": "^0.2.2",
51
- "@junejs/pdf-typst-wasm": "^0.2.2",
52
- "@junejs/server": "^0.2.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",