@junejs/pdf-font-noto-sans-jp 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 NotoSansJPOptions, r as NotoSansJPWeight } from "./provider-BQunweLO.js";
2
- //#region src/node.d.ts
1
+ import { n as NotoSansJPOptions, r as NotoSansJPWeight } from "./provider-NPQ9KZ0I.js";
3
2
  export declare function notoSansJP(opts?: NotoSansJPOptions): import("@junejs/pdf-typst-wasm").FontProvider;
4
- //#endregion
5
3
  export type { NotoSansJPOptions, NotoSansJPWeight };
package/dist/node.js CHANGED
@@ -1,6 +1,6 @@
1
- import { i as createNotoSansJP, n as MISSING, t as FILES } from "./provider-DXfXGRsb.js";
1
+ import { i as createNotoSansJP, n as MISSING, t as FILES } from "./provider-DFf0Ymkb.js";
2
2
  import { readFile } from "node:fs/promises";
3
- //#region src/node.ts
3
+ // src/node.ts
4
4
  function notoSansJP(opts = {}) {
5
5
  return createNotoSansJP(async (weight) => {
6
6
  try {
@@ -10,5 +10,4 @@ function notoSansJP(opts = {}) {
10
10
  }
11
11
  }, opts);
12
12
  }
13
- //#endregion
14
13
  export { notoSansJP };
@@ -1,4 +1,4 @@
1
- //#region src/provider.ts
1
+ // src/provider.ts
2
2
  function createNotoSansJP(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(`notoSansJP: no weight ${w} (this package ships 400 and 700)`);
@@ -24,5 +24,4 @@ const FILES = {
24
24
  700: NOTO_SANS_JP[700].name
25
25
  };
26
26
  const MISSING = "@junejs/pdf-font-noto-sans-jp: its font files are missing — in the June repo, run `bun scripts/fetch-fonts.ts` in packages/pdf-font-noto-sans-jp";
27
- //#endregion
28
27
  export { createNotoSansJP as i, MISSING as n, NOTO_SANS_JP 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 NotoSansJPWeight = 400 | 700;
14
11
  type NotoSansJPOptions = {
15
12
  weights?: NotoSansJPWeight[];
16
13
  };
17
14
  declare const NOTO_SANS_JP: Record<NotoSansJPWeight, AssetRef>;
18
- //#endregion
19
15
  export { AssetRef as a, AssetLoader as i, NotoSansJPOptions as n, loadVerified as o, NotoSansJPWeight as r, NOTO_SANS_JP as t };
@@ -1,10 +1,8 @@
1
- import { a as AssetRef, i as AssetLoader, n as NotoSansJPOptions, o as loadVerified, r as NotoSansJPWeight, t as NOTO_SANS_JP } from "./provider-BQunweLO.js";
1
+ import { a as AssetRef, i as AssetLoader, n as NotoSansJPOptions, o as loadVerified, r as NotoSansJPWeight, t as NOTO_SANS_JP } from "./provider-NPQ9KZ0I.js";
2
2
  import { FontEgress } from "@junejs/pdf-typst-wasm";
3
- //#region src/unbundled.d.ts
4
3
  export type UnbundledNotoSansJPOptions = NotoSansJPOptions & {
5
4
  load: AssetLoader;
6
5
  egress?: FontEgress[];
7
6
  };
8
7
  export declare function notoSansJP(opts: UnbundledNotoSansJPOptions): import("@junejs/pdf-typst-wasm").FontProvider;
9
- //#endregion
10
8
  export { type AssetLoader, type AssetRef, NOTO_SANS_JP, type NotoSansJPOptions, type NotoSansJPWeight, loadVerified };
package/dist/unbundled.js CHANGED
@@ -1,5 +1,5 @@
1
- import { i as createNotoSansJP, r as NOTO_SANS_JP } from "./provider-DXfXGRsb.js";
2
- //#region src/assets.ts
1
+ import { i as createNotoSansJP, r as NOTO_SANS_JP } from "./provider-DFf0Ymkb.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_JP).flatMap((r) => r.urls.map((u) => new URL(u).host)))].map((host) => ({
15
14
  host,
16
15
  sends: "nothing"
@@ -19,5 +18,4 @@ function notoSansJP(opts) {
19
18
  const { load, egress, ...rest } = opts;
20
19
  return createNotoSansJP((weight) => loadVerified(NOTO_SANS_JP[weight], load), rest, egress ?? HOSTS);
21
20
  }
22
- //#endregion
23
21
  export { NOTO_SANS_JP, loadVerified, notoSansJP };
package/dist/workerd.d.ts CHANGED
@@ -1,5 +1,3 @@
1
- import { n as NotoSansJPOptions, r as NotoSansJPWeight } from "./provider-BQunweLO.js";
2
- //#region src/workerd.d.ts
1
+ import { n as NotoSansJPOptions, r as NotoSansJPWeight } from "./provider-NPQ9KZ0I.js";
3
2
  export declare function notoSansJP(opts?: NotoSansJPOptions): import("@junejs/pdf-typst-wasm").FontProvider;
4
- //#endregion
5
3
  export type { NotoSansJPOptions, NotoSansJPWeight };
package/dist/workerd.js CHANGED
@@ -1,9 +1,8 @@
1
- import { i as createNotoSansJP } from "./provider-DXfXGRsb.js";
1
+ import { i as createNotoSansJP } from "./provider-DFf0Ymkb.js";
2
2
  import bold from "../fonts/NotoSansJP-Bold.otf";
3
3
  import regular from "../fonts/NotoSansJP-Regular.otf";
4
- //#region src/workerd.ts
4
+ // src/workerd.ts
5
5
  function notoSansJP(opts = {}) {
6
6
  return createNotoSansJP(async (weight) => new Uint8Array(weight === 700 ? bold : regular), opts);
7
7
  }
8
- //#endregion
9
8
  export { notoSansJP };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@junejs/pdf-font-noto-sans-jp",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "June — Noto Sans JP (Japanese, 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",