pdf-parser.js 3.0.7 → 4.5.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.
Files changed (240) hide show
  1. package/README.md +105 -54
  2. package/dist/{afm-widths-Dxucrg7D.js → afm-widths-BTu0IDp2.cjs} +1517 -4
  3. package/dist/{afm-widths-DyDq56Ph.d.cts → afm-widths-CneRyu5l.d.cts} +1 -1
  4. package/dist/{afm-widths-DyDq56Ph.d.ts → afm-widths-CneRyu5l.d.ts} +1 -1
  5. package/dist/{afm-widths-BoeTOK2r.cjs → afm-widths-De_QMWgC.js} +1416 -51
  6. package/dist/afm-widths.cjs +1 -1
  7. package/dist/afm-widths.d.cts +1 -1
  8. package/dist/afm-widths.d.ts +1 -1
  9. package/dist/afm-widths.js +1 -1
  10. package/dist/annotations.cjs +104 -0
  11. package/dist/annotations.d.cts +9 -0
  12. package/dist/annotations.d.ts +9 -0
  13. package/dist/annotations.js +103 -0
  14. package/dist/attachments.cjs +65 -0
  15. package/dist/attachments.d.cts +8 -0
  16. package/dist/attachments.d.ts +8 -0
  17. package/dist/attachments.js +64 -0
  18. package/dist/builtin-encoding.cjs +221 -0
  19. package/dist/builtin-encoding.d.cts +8 -0
  20. package/dist/builtin-encoding.d.ts +8 -0
  21. package/dist/builtin-encoding.js +220 -0
  22. package/dist/bytes/flate.cjs +1 -1
  23. package/dist/bytes/flate.js +1 -1
  24. package/dist/cff.cjs +14 -0
  25. package/dist/cff.d.cts +4 -1
  26. package/dist/cff.d.ts +4 -1
  27. package/dist/cff.js +12 -1
  28. package/dist/cmap-table.cjs +76 -13
  29. package/dist/cmap-table.d.cts +9 -1
  30. package/dist/cmap-table.d.ts +9 -1
  31. package/dist/cmap-table.js +77 -15
  32. package/dist/codec.cjs +1 -1
  33. package/dist/codec.d.cts +134 -0
  34. package/dist/codec.d.ts +134 -0
  35. package/dist/codec.js +1 -1
  36. package/dist/content-read.cjs +1 -1
  37. package/dist/content-read.d.cts +3 -3
  38. package/dist/content-read.d.ts +3 -3
  39. package/dist/content-read.js +1 -1
  40. package/dist/content-write.cjs +32 -10
  41. package/dist/content-write.d.cts +12 -5
  42. package/dist/content-write.d.ts +12 -5
  43. package/dist/content-write.js +32 -10
  44. package/dist/crypto/random.cjs +9 -0
  45. package/dist/crypto/random.d.cts +4 -0
  46. package/dist/crypto/random.d.ts +4 -0
  47. package/dist/crypto/random.js +8 -0
  48. package/dist/diagnostics.d.cts +1 -1
  49. package/dist/diagnostics.d.ts +1 -1
  50. package/dist/document.cjs +12 -3
  51. package/dist/document.d.cts +3 -1
  52. package/dist/document.d.ts +3 -1
  53. package/dist/document.js +12 -3
  54. package/dist/{embedded-font-fREdbxnr.d.ts → embedded-font-B4p9a3O3.d.ts} +3 -1
  55. package/dist/{embedded-font-BU6Jgcof.d.cts → embedded-font-oc65VGlr.d.cts} +3 -1
  56. package/dist/embedded-font-write.cjs +1 -1
  57. package/dist/embedded-font-write.d.cts +3 -3
  58. package/dist/embedded-font-write.d.ts +3 -3
  59. package/dist/embedded-font-write.js +1 -1
  60. package/dist/embedded-font.cjs +46 -15
  61. package/dist/embedded-font.d.cts +1 -1
  62. package/dist/embedded-font.d.ts +1 -1
  63. package/dist/embedded-font.js +46 -15
  64. package/dist/encoding.cjs +10 -1
  65. package/dist/encoding.d.cts +10 -1
  66. package/dist/encoding.d.ts +10 -1
  67. package/dist/encoding.js +2 -2
  68. package/dist/encrypt-write.cjs +234 -0
  69. package/dist/encrypt-write.d.cts +31 -0
  70. package/dist/encrypt-write.d.ts +31 -0
  71. package/dist/encrypt-write.js +231 -0
  72. package/dist/encrypt.cjs +51 -21
  73. package/dist/encrypt.d.cts +19 -3
  74. package/dist/encrypt.d.ts +19 -3
  75. package/dist/encrypt.js +36 -22
  76. package/dist/filters.cjs +18 -14
  77. package/dist/filters.d.cts +1 -1
  78. package/dist/filters.d.ts +1 -1
  79. package/dist/filters.js +18 -14
  80. package/dist/font-read.cjs +68 -13
  81. package/dist/font-read.d.cts +1 -1
  82. package/dist/font-read.d.ts +1 -1
  83. package/dist/font-read.js +69 -14
  84. package/dist/font-registry.cjs +1 -1
  85. package/dist/font-registry.d.cts +4 -4
  86. package/dist/font-registry.d.ts +4 -4
  87. package/dist/font-registry.js +1 -1
  88. package/dist/font-substitutes.d.cts +1 -1
  89. package/dist/font-substitutes.d.ts +1 -1
  90. package/dist/font-tables.cjs +31 -0
  91. package/dist/font-tables.d.cts +3 -1
  92. package/dist/font-tables.d.ts +3 -1
  93. package/dist/font-tables.js +31 -2
  94. package/dist/fonts.d.cts +2 -2
  95. package/dist/fonts.d.ts +2 -2
  96. package/dist/form.cjs +138 -0
  97. package/dist/form.d.cts +9 -0
  98. package/dist/form.d.ts +9 -0
  99. package/dist/form.js +137 -0
  100. package/dist/gsub-table-BRTQ8EUW.d.ts +10 -0
  101. package/dist/gsub-table-URczLd85.d.cts +10 -0
  102. package/dist/gsub-table.cjs +225 -0
  103. package/dist/gsub-table.d.cts +2 -0
  104. package/dist/gsub-table.d.ts +2 -0
  105. package/dist/gsub-table.js +224 -0
  106. package/dist/image/ccitt-encode.cjs +119 -0
  107. package/dist/image/ccitt-encode.d.cts +9 -0
  108. package/dist/image/ccitt-encode.d.ts +9 -0
  109. package/dist/image/ccitt-encode.js +118 -0
  110. package/dist/image/ccitt.cjs +3 -0
  111. package/dist/image/ccitt.d.cts +4 -1
  112. package/dist/image/ccitt.d.ts +4 -1
  113. package/dist/image/ccitt.js +1 -1
  114. package/dist/image/jbig2-bitmap.d.cts +1 -1
  115. package/dist/image/jbig2-bitmap.d.ts +1 -1
  116. package/dist/image/jbig2.cjs +3 -1
  117. package/dist/image/jbig2.js +3 -1
  118. package/dist/image/jp2-boxes.d.cts +1 -1
  119. package/dist/image/jp2-boxes.d.ts +1 -1
  120. package/dist/image/jpeg2000-codestream.d.cts +3 -3
  121. package/dist/image/jpeg2000-codestream.d.ts +3 -3
  122. package/dist/image/jpeg2000-t1.d.cts +1 -1
  123. package/dist/image/jpeg2000-t1.d.ts +1 -1
  124. package/dist/image/jpeg2000.cjs +1 -0
  125. package/dist/image/jpeg2000.d.cts +3 -0
  126. package/dist/image/jpeg2000.d.ts +3 -0
  127. package/dist/image/jpeg2000.js +1 -0
  128. package/dist/image/png-decode.cjs +1 -1
  129. package/dist/image/png-decode.js +1 -1
  130. package/dist/image/png-filter.d.cts +1 -1
  131. package/dist/image/png-filter.d.ts +1 -1
  132. package/dist/images-read.cjs +18 -12
  133. package/dist/images-read.d.cts +2 -2
  134. package/dist/images-read.d.ts +2 -2
  135. package/dist/images-read.js +15 -9
  136. package/dist/index.cjs +17 -4
  137. package/dist/index.d.cts +7 -6
  138. package/dist/index.d.ts +7 -6
  139. package/dist/index.js +6 -5
  140. package/dist/interpret.cjs +178 -56
  141. package/dist/interpret.d.cts +27 -12
  142. package/dist/interpret.d.ts +27 -12
  143. package/dist/interpret.js +178 -56
  144. package/dist/layout.cjs +149 -2
  145. package/dist/layout.d.cts +394 -1
  146. package/dist/layout.d.ts +394 -1
  147. package/dist/layout.js +140 -4
  148. package/dist/lexer.d.cts +9 -9
  149. package/dist/lexer.d.ts +9 -9
  150. package/dist/math-content-write.cjs +1 -1
  151. package/dist/math-content-write.js +1 -1
  152. package/dist/math-font-write.cjs +1 -1
  153. package/dist/math-font-write.d.cts +1 -1
  154. package/dist/math-font-write.d.ts +1 -1
  155. package/dist/math-font-write.js +1 -1
  156. package/dist/math-font.cjs +2 -2
  157. package/dist/math-font.d.cts +1 -1
  158. package/dist/math-font.d.ts +1 -1
  159. package/dist/math-font.js +2 -2
  160. package/dist/{math-stretch-a_rHNRvc.d.ts → math-stretch-BbC2o4Br.d.ts} +1 -1
  161. package/dist/{math-stretch-E26z6byT.d.cts → math-stretch-C2JanDAz.d.cts} +1 -1
  162. package/dist/math-stretch.d.cts +1 -1
  163. package/dist/math-stretch.d.ts +1 -1
  164. package/dist/measure.cjs +1 -1
  165. package/dist/measure.d.cts +1 -1
  166. package/dist/measure.d.ts +1 -1
  167. package/dist/measure.js +1 -1
  168. package/dist/names.cjs +41 -0
  169. package/dist/names.d.cts +11 -0
  170. package/dist/names.d.ts +11 -0
  171. package/dist/names.js +40 -0
  172. package/dist/navigation.cjs +210 -0
  173. package/dist/navigation.d.cts +18 -0
  174. package/dist/navigation.d.ts +18 -0
  175. package/dist/navigation.js +207 -0
  176. package/dist/notes-annotation-author.cjs +5 -0
  177. package/dist/notes-annotation-author.d.cts +4 -0
  178. package/dist/notes-annotation-author.d.ts +4 -0
  179. package/dist/notes-annotation-author.js +4 -0
  180. package/dist/objects-B7HdMeWS.d.cts +59 -0
  181. package/dist/objects-B7HdMeWS.d.ts +59 -0
  182. package/dist/objects.d.cts +1 -58
  183. package/dist/objects.d.ts +1 -58
  184. package/dist/optional-content.cjs +63 -0
  185. package/dist/optional-content.d.cts +12 -0
  186. package/dist/optional-content.d.ts +12 -0
  187. package/dist/optional-content.js +62 -0
  188. package/dist/parse.cjs +1 -1
  189. package/dist/parse.d.cts +2 -2
  190. package/dist/parse.d.ts +2 -2
  191. package/dist/parse.js +1 -1
  192. package/dist/pdf-text.cjs +21 -0
  193. package/dist/pdf-text.d.cts +5 -0
  194. package/dist/pdf-text.d.ts +5 -0
  195. package/dist/pdf-text.js +19 -0
  196. package/dist/predictors.d.cts +1 -1
  197. package/dist/predictors.d.ts +1 -1
  198. package/dist/read.cjs +287 -72
  199. package/dist/read.d.cts +2 -4
  200. package/dist/read.d.ts +2 -4
  201. package/dist/read.js +284 -67
  202. package/dist/serialize.cjs +5 -1
  203. package/dist/serialize.d.cts +3 -2
  204. package/dist/serialize.d.ts +3 -2
  205. package/dist/serialize.js +5 -2
  206. package/dist/sfnt-subset.cjs +10 -3
  207. package/dist/sfnt-subset.d.cts +1 -1
  208. package/dist/sfnt-subset.d.ts +1 -1
  209. package/dist/sfnt-subset.js +10 -3
  210. package/dist/structure.cjs +184 -0
  211. package/dist/structure.d.cts +12 -0
  212. package/dist/structure.d.ts +12 -0
  213. package/dist/structure.js +183 -0
  214. package/dist/tounicode.cjs +8 -3
  215. package/dist/tounicode.d.cts +2 -2
  216. package/dist/tounicode.d.ts +2 -2
  217. package/dist/tounicode.js +8 -3
  218. package/dist/util/base64.cjs +4 -4
  219. package/dist/util/base64.js +4 -4
  220. package/dist/winansi.cjs +1 -1
  221. package/dist/winansi.d.cts +1 -1
  222. package/dist/winansi.d.ts +1 -1
  223. package/dist/winansi.js +1 -1
  224. package/dist/write.cjs +464 -21
  225. package/dist/write.d.cts +4 -3
  226. package/dist/write.d.ts +4 -3
  227. package/dist/write.js +464 -20
  228. package/dist/xmp.cjs +46 -0
  229. package/dist/xmp.d.cts +14 -0
  230. package/dist/xmp.d.ts +14 -0
  231. package/dist/xmp.js +45 -0
  232. package/dist/xref.cjs +2 -2
  233. package/dist/xref.d.cts +3 -3
  234. package/dist/xref.d.ts +3 -3
  235. package/dist/xref.js +2 -2
  236. package/package.json +46 -31
  237. package/dist/image/png-encode.cjs +0 -64
  238. package/dist/image/png-encode.d.cts +0 -8
  239. package/dist/image/png-encode.d.ts +0 -8
  240. package/dist/image/png-encode.js +0 -63
@@ -1,9 +1,9 @@
1
- import { o as encodeForShow } from "./afm-widths-Dxucrg7D.js";
2
- import { ByteWriter } from "./bytes/writer.js";
1
+ import { h as encodeForShow } from "./afm-widths-De_QMWgC.js";
3
2
  import { pdfArray, pdfHexString, pdfNum } from "./objects.js";
3
+ import { ByteWriter } from "./bytes/writer.js";
4
+ import { formatNumber, writeObject } from "./serialize.js";
4
5
  import { BEZIER_KAPPA, multiplyMatrices, rotationMatrix, scaleMatrix, translationMatrix } from "./matrix.js";
5
6
  import { encodeForShowEmbedded } from "./embedded-font.js";
6
- import { formatNumber, writeObject } from "./serialize.js";
7
7
  //#region src/content-write.ts
8
8
  const GLYPH_SPACE_UNITS_PER_EM = 1e3;
9
9
  const EMBEDDED_HORIZONTAL_SCALE_PERCENT = 100;
@@ -312,16 +312,38 @@ function writeContentStream(items, context) {
312
312
  const writer = new ByteWriter();
313
313
  const substitutions = [];
314
314
  const missingGlyphs = [];
315
- for (const item of items) if (item.kind === "text") writeText(writer, item, context, substitutions, missingGlyphs);
316
- else if (item.kind === "image") writeImage(writer, item, context);
317
- else if (item.kind === "rect") writeRect(writer, item);
318
- else if (item.kind === "line") writeLine(writer, item);
319
- else if (item.kind === "ellipse") writeEllipse(writer, item);
320
- else if (item.kind === "path") writePath(writer, item);
315
+ const markedStructure = [];
316
+ for (const item of items) {
317
+ const itemLayer = "layer" in item ? item.layer : void 0;
318
+ const itemStructure = "structure" in item ? item.structure : void 0;
319
+ const layerObjectNum = itemLayer !== void 0 ? context.layerObjectNumberOf?.(itemLayer) : void 0;
320
+ const marked = itemStructure !== void 0 || layerObjectNum !== void 0;
321
+ if (marked) {
322
+ writer.writeAscii("/P <<");
323
+ if (itemStructure !== void 0 && context.nextMcid !== void 0) {
324
+ const mcid = context.nextMcid();
325
+ markedStructure.push({
326
+ mcid,
327
+ structureId: itemStructure
328
+ });
329
+ writer.writeAscii(` /MCID ${mcid}`);
330
+ }
331
+ if (layerObjectNum !== void 0) writer.writeAscii(` /OC ${layerObjectNum} 0 R`);
332
+ writer.writeAscii(" >> BDC\n");
333
+ }
334
+ if (item.kind === "text") writeText(writer, item, context, substitutions, missingGlyphs);
335
+ else if (item.kind === "image") writeImage(writer, item, context);
336
+ else if (item.kind === "rect") writeRect(writer, item);
337
+ else if (item.kind === "line") writeLine(writer, item);
338
+ else if (item.kind === "ellipse") writeEllipse(writer, item);
339
+ else if (item.kind === "path") writePath(writer, item);
340
+ if (marked) writer.writeAscii("EMC\n");
341
+ }
321
342
  return {
322
343
  bytes: writer.toBytes(),
323
344
  substitutions,
324
- missingGlyphs
345
+ missingGlyphs,
346
+ markedStructure
325
347
  };
326
348
  }
327
349
  //#endregion
@@ -0,0 +1,9 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ //#region src/crypto/random.ts
3
+ function randomBytes(length) {
4
+ const bytes = new Uint8Array(length);
5
+ globalThis.crypto.getRandomValues(bytes);
6
+ return bytes;
7
+ }
8
+ //#endregion
9
+ exports.randomBytes = randomBytes;
@@ -0,0 +1,4 @@
1
+ //#region src/crypto/random.d.ts
2
+ declare function randomBytes(length: number): Uint8Array<ArrayBuffer>;
3
+ //#endregion
4
+ export { randomBytes };
@@ -0,0 +1,4 @@
1
+ //#region src/crypto/random.d.ts
2
+ declare function randomBytes(length: number): Uint8Array<ArrayBuffer>;
3
+ //#endregion
4
+ export { randomBytes };
@@ -0,0 +1,8 @@
1
+ //#region src/crypto/random.ts
2
+ function randomBytes(length) {
3
+ const bytes = new Uint8Array(length);
4
+ globalThis.crypto.getRandomValues(bytes);
5
+ return bytes;
6
+ }
7
+ //#endregion
8
+ export { randomBytes };
@@ -1,5 +1,5 @@
1
1
  //#region src/diagnostics.d.ts
2
- type PdfDiagnosticSeverity = 'info' | 'warning';
2
+ type PdfDiagnosticSeverity = "info" | "warning";
3
3
  interface PdfDiagnostic {
4
4
  readonly code: string;
5
5
  readonly severity: PdfDiagnosticSeverity;
@@ -1,5 +1,5 @@
1
1
  //#region src/diagnostics.d.ts
2
- type PdfDiagnosticSeverity = 'info' | 'warning';
2
+ type PdfDiagnosticSeverity = "info" | "warning";
3
3
  interface PdfDiagnostic {
4
4
  readonly code: string;
5
5
  readonly severity: PdfDiagnosticSeverity;
package/dist/document.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_objects = require("./objects.cjs");
2
3
  const require_bytes_reader = require("./bytes/reader.cjs");
4
+ const require_filters = require("./filters.cjs");
3
5
  const require_lexer = require("./lexer.cjs");
4
6
  const require_diagnostics = require("./diagnostics.cjs");
5
- const require_objects = require("./objects.cjs");
6
7
  const require_encrypt = require("./encrypt.cjs");
7
- const require_filters = require("./filters.cjs");
8
8
  const require_parse = require("./parse.cjs");
9
9
  const require_xref = require("./xref.cjs");
10
10
  //#region src/document.ts
@@ -150,10 +150,12 @@ function openPdfDocument(bytes, sink) {
150
150
  decryptor = require_encrypt.createStandardDecryptor(encryptDict, firstFileId(xref.trailer), sink);
151
151
  }
152
152
  const catalog = requireCatalog(resolveDict(require_objects.dictGet(xref.trailer, "Root")));
153
+ const originalLeaves = /* @__PURE__ */ new Map();
153
154
  function pages() {
154
155
  const pagesRoot = resolveDict(require_objects.dictGet(catalog, "Pages"));
155
156
  if (pagesRoot === void 0) return [];
156
157
  const result = [];
158
+ originalLeaves.clear();
157
159
  walkPageTree(pagesRoot, {}, /* @__PURE__ */ new Set(), result);
158
160
  return result;
159
161
  }
@@ -176,6 +178,7 @@ function openPdfDocument(bytes, sink) {
176
178
  if (kids === void 0) {
177
179
  const entries = new Map(node.entries);
178
180
  for (const key of INHERITABLE_PAGE_KEYS) if (!entries.has(key) && merged[key] !== void 0) entries.set(key, merged[key]);
181
+ originalLeaves.set(node, result.length);
179
182
  result.push({
180
183
  kind: "dict",
181
184
  entries
@@ -187,11 +190,17 @@ function openPdfDocument(bytes, sink) {
187
190
  if (kidDict !== void 0) walkPageTree(kidDict, merged, visited, result);
188
191
  }
189
192
  }
193
+ function pageIndex(obj) {
194
+ const dict = require_objects.asDict(resolve(obj));
195
+ return dict !== void 0 ? originalLeaves.get(dict) : void 0;
196
+ }
190
197
  return {
191
198
  trailer: xref.trailer,
199
+ catalog,
192
200
  resolve,
193
201
  resolveDict,
194
- pages
202
+ pages,
203
+ pageIndex
195
204
  };
196
205
  }
197
206
  //#endregion
@@ -1,11 +1,13 @@
1
1
  import { PdfDiagnosticSink } from "./diagnostics.cjs";
2
- import { PdfDict, PdfObject } from "./objects.cjs";
2
+ import { n as PdfDict, r as PdfObject } from "./objects-B7HdMeWS.cjs";
3
3
  //#region src/document.d.ts
4
4
  interface PdfDocument {
5
5
  readonly trailer: PdfDict;
6
+ readonly catalog: PdfDict;
6
7
  resolve(obj: PdfObject | undefined): PdfObject | undefined;
7
8
  resolveDict(obj: PdfObject | undefined): PdfDict | undefined;
8
9
  pages(): PdfDict[];
10
+ pageIndex(obj: PdfObject | undefined): number | undefined;
9
11
  }
10
12
  declare function openPdfDocument(bytes: Uint8Array<ArrayBuffer>, sink: PdfDiagnosticSink): PdfDocument;
11
13
  //#endregion
@@ -1,11 +1,13 @@
1
1
  import { PdfDiagnosticSink } from "./diagnostics.js";
2
- import { PdfDict, PdfObject } from "./objects.js";
2
+ import { n as PdfDict, r as PdfObject } from "./objects-B7HdMeWS.js";
3
3
  //#region src/document.d.ts
4
4
  interface PdfDocument {
5
5
  readonly trailer: PdfDict;
6
+ readonly catalog: PdfDict;
6
7
  resolve(obj: PdfObject | undefined): PdfObject | undefined;
7
8
  resolveDict(obj: PdfObject | undefined): PdfDict | undefined;
8
9
  pages(): PdfDict[];
10
+ pageIndex(obj: PdfObject | undefined): number | undefined;
9
11
  }
10
12
  declare function openPdfDocument(bytes: Uint8Array<ArrayBuffer>, sink: PdfDiagnosticSink): PdfDocument;
11
13
  //#endregion
package/dist/document.js CHANGED
@@ -1,9 +1,9 @@
1
+ import { asArray, asDict, asNumber, dictGet, isName, pdfNull } from "./objects.js";
1
2
  import { ByteReader } from "./bytes/reader.js";
3
+ import { decodeStream } from "./filters.js";
2
4
  import { nextToken } from "./lexer.js";
3
5
  import { PdfEncryptedError, PdfParseError } from "./diagnostics.js";
4
- import { asArray, asDict, asNumber, dictGet, isName, pdfNull } from "./objects.js";
5
6
  import { createStandardDecryptor } from "./encrypt.js";
6
- import { decodeStream } from "./filters.js";
7
7
  import { parseIndirectObject, parseValue } from "./parse.js";
8
8
  import { readXref } from "./xref.js";
9
9
  //#region src/document.ts
@@ -149,10 +149,12 @@ function openPdfDocument(bytes, sink) {
149
149
  decryptor = createStandardDecryptor(encryptDict, firstFileId(xref.trailer), sink);
150
150
  }
151
151
  const catalog = requireCatalog(resolveDict(dictGet(xref.trailer, "Root")));
152
+ const originalLeaves = /* @__PURE__ */ new Map();
152
153
  function pages() {
153
154
  const pagesRoot = resolveDict(dictGet(catalog, "Pages"));
154
155
  if (pagesRoot === void 0) return [];
155
156
  const result = [];
157
+ originalLeaves.clear();
156
158
  walkPageTree(pagesRoot, {}, /* @__PURE__ */ new Set(), result);
157
159
  return result;
158
160
  }
@@ -175,6 +177,7 @@ function openPdfDocument(bytes, sink) {
175
177
  if (kids === void 0) {
176
178
  const entries = new Map(node.entries);
177
179
  for (const key of INHERITABLE_PAGE_KEYS) if (!entries.has(key) && merged[key] !== void 0) entries.set(key, merged[key]);
180
+ originalLeaves.set(node, result.length);
178
181
  result.push({
179
182
  kind: "dict",
180
183
  entries
@@ -186,11 +189,17 @@ function openPdfDocument(bytes, sink) {
186
189
  if (kidDict !== void 0) walkPageTree(kidDict, merged, visited, result);
187
190
  }
188
191
  }
192
+ function pageIndex(obj) {
193
+ const dict = asDict(resolve(obj));
194
+ return dict !== void 0 ? originalLeaves.get(dict) : void 0;
195
+ }
189
196
  return {
190
197
  trailer: xref.trailer,
198
+ catalog,
191
199
  resolve,
192
200
  resolveDict,
193
- pages
201
+ pages,
202
+ pageIndex
194
203
  };
195
204
  }
196
205
  //#endregion
@@ -1,4 +1,5 @@
1
1
  import { t as SfntFont } from "./sfnt-V08bb5ut.js";
2
+ import { t as GsubShaper } from "./gsub-table-BRTQ8EUW.js";
2
3
  //#region src/embedded-font.d.ts
3
4
  declare const NOTDEF_GLYPH_ID = 0;
4
5
  interface EmbeddedFaceMetrics {
@@ -27,6 +28,7 @@ interface EmbeddedFace {
27
28
  glyphId(codePoint: number): number | undefined;
28
29
  glyphSpaceWidth(glyphId: number): number;
29
30
  kernGlyphSpace(leftGlyphId: number, rightGlyphId: number): number;
31
+ readonly gsubShaper: GsubShaper | undefined;
30
32
  }
31
33
  declare function loadEmbeddedFace(font: SfntFont): EmbeddedFace | undefined;
32
34
  interface EmbeddedFaceSubstitution {
@@ -43,6 +45,6 @@ interface EmbeddedShow {
43
45
  readonly kerns: readonly EmbeddedKern[];
44
46
  }
45
47
  declare function encodeForShowEmbedded(text: string, face: EmbeddedFace): EmbeddedShow;
46
- declare function collectEmbeddedGlyphs(texts: Iterable<string>, face: EmbeddedFace): ReadonlyMap<number, number>;
48
+ declare function collectEmbeddedGlyphs(texts: Iterable<string>, face: EmbeddedFace): ReadonlyMap<number, readonly number[]>;
47
49
  //#endregion
48
50
  export { EmbeddedShow as a, encodeForShowEmbedded as c, EmbeddedKern as i, loadEmbeddedFace as l, EmbeddedFaceMetrics as n, NOTDEF_GLYPH_ID as o, EmbeddedFaceSubstitution as r, collectEmbeddedGlyphs as s, EmbeddedFace as t };
@@ -1,4 +1,5 @@
1
1
  import { t as SfntFont } from "./sfnt-V08bb5ut.cjs";
2
+ import { t as GsubShaper } from "./gsub-table-URczLd85.cjs";
2
3
  //#region src/embedded-font.d.ts
3
4
  declare const NOTDEF_GLYPH_ID = 0;
4
5
  interface EmbeddedFaceMetrics {
@@ -27,6 +28,7 @@ interface EmbeddedFace {
27
28
  glyphId(codePoint: number): number | undefined;
28
29
  glyphSpaceWidth(glyphId: number): number;
29
30
  kernGlyphSpace(leftGlyphId: number, rightGlyphId: number): number;
31
+ readonly gsubShaper: GsubShaper | undefined;
30
32
  }
31
33
  declare function loadEmbeddedFace(font: SfntFont): EmbeddedFace | undefined;
32
34
  interface EmbeddedFaceSubstitution {
@@ -43,6 +45,6 @@ interface EmbeddedShow {
43
45
  readonly kerns: readonly EmbeddedKern[];
44
46
  }
45
47
  declare function encodeForShowEmbedded(text: string, face: EmbeddedFace): EmbeddedShow;
46
- declare function collectEmbeddedGlyphs(texts: Iterable<string>, face: EmbeddedFace): ReadonlyMap<number, number>;
48
+ declare function collectEmbeddedGlyphs(texts: Iterable<string>, face: EmbeddedFace): ReadonlyMap<number, readonly number[]>;
47
49
  //#endregion
48
50
  export { EmbeddedShow as a, encodeForShowEmbedded as c, EmbeddedKern as i, loadEmbeddedFace as l, EmbeddedFaceMetrics as n, NOTDEF_GLYPH_ID as o, EmbeddedFaceSubstitution as r, collectEmbeddedGlyphs as s, EmbeddedFace as t };
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_bytes_crc32 = require("./bytes/crc32.cjs");
3
2
  const require_objects = require("./objects.cjs");
4
3
  const require_bytes_flate = require("./bytes/flate.cjs");
4
+ const require_bytes_crc32 = require("./bytes/crc32.cjs");
5
5
  const require_tounicode = require("./tounicode.cjs");
6
6
  //#region src/embedded-font-write.ts
7
7
  const FLAG_SERIF = 2;
@@ -1,5 +1,5 @@
1
- import { PdfDict, PdfObject } from "./objects.cjs";
2
- import { t as EmbeddedFace } from "./embedded-font-BU6Jgcof.cjs";
1
+ import { n as PdfDict, r as PdfObject } from "./objects-B7HdMeWS.cjs";
2
+ import { t as EmbeddedFace } from "./embedded-font-oc65VGlr.cjs";
3
3
  import { SfntSubsetResult } from "./sfnt-subset.cjs";
4
4
  //#region src/embedded-font-write.d.ts
5
5
  declare function embeddedSubsetTag(postScriptName: string, glyphIds: readonly number[]): string;
@@ -17,6 +17,6 @@ interface EmbeddedFontObjects {
17
17
  readonly fontFile: PdfObject;
18
18
  readonly toUnicode: PdfObject;
19
19
  }
20
- declare function buildEmbeddedFontObjects(face: EmbeddedFace, subset: SfntSubsetResult, usedGlyphs: ReadonlyMap<number, number>, refs: EmbeddedFontObjectRefs, compress: boolean): EmbeddedFontObjects;
20
+ declare function buildEmbeddedFontObjects(face: EmbeddedFace, subset: SfntSubsetResult, usedGlyphs: ReadonlyMap<number, readonly number[]>, refs: EmbeddedFontObjectRefs, compress: boolean): EmbeddedFontObjects;
21
21
  //#endregion
22
22
  export { EmbeddedFontObjectRefs, EmbeddedFontObjects, buildEmbeddedFontObjects, embeddedSubsetTag };
@@ -1,5 +1,5 @@
1
- import { PdfDict, PdfObject } from "./objects.js";
2
- import { t as EmbeddedFace } from "./embedded-font-fREdbxnr.js";
1
+ import { n as PdfDict, r as PdfObject } from "./objects-B7HdMeWS.js";
2
+ import { t as EmbeddedFace } from "./embedded-font-B4p9a3O3.js";
3
3
  import { SfntSubsetResult } from "./sfnt-subset.js";
4
4
  //#region src/embedded-font-write.d.ts
5
5
  declare function embeddedSubsetTag(postScriptName: string, glyphIds: readonly number[]): string;
@@ -17,6 +17,6 @@ interface EmbeddedFontObjects {
17
17
  readonly fontFile: PdfObject;
18
18
  readonly toUnicode: PdfObject;
19
19
  }
20
- declare function buildEmbeddedFontObjects(face: EmbeddedFace, subset: SfntSubsetResult, usedGlyphs: ReadonlyMap<number, number>, refs: EmbeddedFontObjectRefs, compress: boolean): EmbeddedFontObjects;
20
+ declare function buildEmbeddedFontObjects(face: EmbeddedFace, subset: SfntSubsetResult, usedGlyphs: ReadonlyMap<number, readonly number[]>, refs: EmbeddedFontObjectRefs, compress: boolean): EmbeddedFontObjects;
21
21
  //#endregion
22
22
  export { EmbeddedFontObjectRefs, EmbeddedFontObjects, buildEmbeddedFontObjects, embeddedSubsetTag };
@@ -1,6 +1,6 @@
1
- import { crc32 } from "./bytes/crc32.js";
2
1
  import { pdfArray, pdfDict, pdfHexString, pdfName, pdfNum, pdfStream } from "./objects.js";
3
2
  import { deflate } from "./bytes/flate.js";
3
+ import { crc32 } from "./bytes/crc32.js";
4
4
  import { buildToUnicodeCMap } from "./tounicode.js";
5
5
  //#region src/embedded-font-write.ts
6
6
  const FLAG_SERIF = 2;
@@ -4,6 +4,7 @@ const require_cmap_table = require("./cmap-table.cjs");
4
4
  const require_font_tables = require("./font-tables.cjs");
5
5
  const require_glyf = require("./glyf.cjs");
6
6
  const require_gpos_table = require("./gpos-table.cjs");
7
+ const require_gsub_table = require("./gsub-table.cjs");
7
8
  const require_hmtx_table = require("./hmtx-table.cjs");
8
9
  //#region src/embedded-font.ts
9
10
  const GLYPH_SPACE_UNITS_PER_EM = 1e3;
@@ -57,10 +58,12 @@ function readEmbeddedFace(font) {
57
58
  const scale = (designUnits) => scaleToGlyphSpace(designUnits, unitsPerEm);
58
59
  const capHeight = resolveCapHeight(font, cmap, os2?.sCapHeight, hhea.ascent);
59
60
  const kern = require_gpos_table.buildGposKernLookup(font);
61
+ const gsubShaper = require_gsub_table.buildGsubShaper(font);
60
62
  return {
61
63
  font,
62
64
  postScriptName: name.postScriptName,
63
65
  numGlyphs: maxp.numGlyphs,
66
+ gsubShaper,
64
67
  metrics: {
65
68
  unitsPerEm,
66
69
  ascentGlyphSpace: scale(hhea.ascent),
@@ -109,30 +112,31 @@ function parseHhea(font) {
109
112
  }
110
113
  const CID_BYTE_LENGTH = 2;
111
114
  function encodeForShowEmbedded(text, face) {
112
- const glyphIds = [];
115
+ const resolvedGlyphIds = [];
113
116
  const substitutions = [];
114
- const kerns = [];
115
- let width1000 = 0;
116
117
  for (const character of text) {
117
118
  const glyphId = face.glyphId(character.codePointAt(0));
118
119
  if (glyphId === void 0) substitutions.push({ from: character });
119
- const shown = glyphId ?? 0;
120
- const previous = glyphIds[glyphIds.length - 1];
121
- if (previous !== void 0) {
122
- const adjustment1000 = face.kernGlyphSpace(previous, shown);
120
+ resolvedGlyphIds.push(glyphId ?? 0);
121
+ }
122
+ const shownGlyphIds = face.gsubShaper === void 0 ? resolvedGlyphIds : face.gsubShaper(resolvedGlyphIds).glyphIds;
123
+ const kerns = [];
124
+ let width1000 = 0;
125
+ for (const [index, shown] of shownGlyphIds.entries()) {
126
+ if (index > 0) {
127
+ const adjustment1000 = face.kernGlyphSpace(shownGlyphIds[index - 1], shown);
123
128
  if (adjustment1000 !== 0) {
124
129
  kerns.push({
125
- codeOffset: glyphIds.length * CID_BYTE_LENGTH,
130
+ codeOffset: index * CID_BYTE_LENGTH,
126
131
  adjustment1000
127
132
  });
128
133
  width1000 += adjustment1000;
129
134
  }
130
135
  }
131
- glyphIds.push(shown);
132
136
  width1000 += face.glyphSpaceWidth(shown);
133
137
  }
134
- const codes = new Uint8Array(glyphIds.length * CID_BYTE_LENGTH);
135
- glyphIds.forEach((glyphId, index) => {
138
+ const codes = new Uint8Array(shownGlyphIds.length * CID_BYTE_LENGTH);
139
+ shownGlyphIds.forEach((glyphId, index) => {
136
140
  codes[index * CID_BYTE_LENGTH] = glyphId >> 8 & 255;
137
141
  codes[index * CID_BYTE_LENGTH + 1] = glyphId & 255;
138
142
  });
@@ -145,10 +149,37 @@ function encodeForShowEmbedded(text, face) {
145
149
  }
146
150
  function collectEmbeddedGlyphs(texts, face) {
147
151
  const used = /* @__PURE__ */ new Map();
148
- for (const text of texts) for (const character of text) {
149
- const codePoint = character.codePointAt(0);
150
- const glyphId = face.glyphId(codePoint);
151
- if (glyphId !== void 0 && !used.has(glyphId)) used.set(glyphId, codePoint);
152
+ for (const text of texts) {
153
+ const resolvedGlyphIds = [];
154
+ const codePoints = [];
155
+ for (const character of text) {
156
+ const codePoint = character.codePointAt(0);
157
+ const glyphId = face.glyphId(codePoint);
158
+ if (glyphId === void 0) {
159
+ resolvedGlyphIds.push(0);
160
+ codePoints.push(void 0);
161
+ } else {
162
+ resolvedGlyphIds.push(glyphId);
163
+ codePoints.push(codePoint);
164
+ }
165
+ }
166
+ const shaping = face.gsubShaper === void 0 ? {
167
+ glyphIds: resolvedGlyphIds,
168
+ spans: resolvedGlyphIds.map(() => 1)
169
+ } : face.gsubShaper(resolvedGlyphIds);
170
+ let cursor = 0;
171
+ for (const [index, glyphId] of shaping.glyphIds.entries()) {
172
+ const span = shaping.spans[index];
173
+ const sequence = [];
174
+ for (let s = 0; s < span; s++) {
175
+ const codePoint = codePoints[cursor + s];
176
+ if (codePoint !== void 0) sequence.push(codePoint);
177
+ }
178
+ cursor += span;
179
+ if (glyphId !== 0 && sequence.length > 0) {
180
+ if (used.get(glyphId) === void 0) used.set(glyphId, sequence);
181
+ }
182
+ }
152
183
  }
153
184
  return used;
154
185
  }
@@ -1,2 +1,2 @@
1
- import { a as EmbeddedShow, c as encodeForShowEmbedded, i as EmbeddedKern, l as loadEmbeddedFace, n as EmbeddedFaceMetrics, o as NOTDEF_GLYPH_ID, r as EmbeddedFaceSubstitution, s as collectEmbeddedGlyphs, t as EmbeddedFace } from "./embedded-font-BU6Jgcof.cjs";
1
+ import { a as EmbeddedShow, c as encodeForShowEmbedded, i as EmbeddedKern, l as loadEmbeddedFace, n as EmbeddedFaceMetrics, o as NOTDEF_GLYPH_ID, r as EmbeddedFaceSubstitution, s as collectEmbeddedGlyphs, t as EmbeddedFace } from "./embedded-font-oc65VGlr.cjs";
2
2
  export { EmbeddedFace, EmbeddedFaceMetrics, EmbeddedFaceSubstitution, EmbeddedKern, EmbeddedShow, NOTDEF_GLYPH_ID, collectEmbeddedGlyphs, encodeForShowEmbedded, loadEmbeddedFace };
@@ -1,2 +1,2 @@
1
- import { a as EmbeddedShow, c as encodeForShowEmbedded, i as EmbeddedKern, l as loadEmbeddedFace, n as EmbeddedFaceMetrics, o as NOTDEF_GLYPH_ID, r as EmbeddedFaceSubstitution, s as collectEmbeddedGlyphs, t as EmbeddedFace } from "./embedded-font-fREdbxnr.js";
1
+ import { a as EmbeddedShow, c as encodeForShowEmbedded, i as EmbeddedKern, l as loadEmbeddedFace, n as EmbeddedFaceMetrics, o as NOTDEF_GLYPH_ID, r as EmbeddedFaceSubstitution, s as collectEmbeddedGlyphs, t as EmbeddedFace } from "./embedded-font-B4p9a3O3.js";
2
2
  export { EmbeddedFace, EmbeddedFaceMetrics, EmbeddedFaceSubstitution, EmbeddedKern, EmbeddedShow, NOTDEF_GLYPH_ID, collectEmbeddedGlyphs, encodeForShowEmbedded, loadEmbeddedFace };
@@ -3,6 +3,7 @@ import { buildCmapLookup } from "./cmap-table.js";
3
3
  import { parseHead, parseMaxp, parseName, parseOs2, parsePost } from "./font-tables.js";
4
4
  import { parseGlyf } from "./glyf.js";
5
5
  import { buildGposKernLookup } from "./gpos-table.js";
6
+ import { buildGsubShaper } from "./gsub-table.js";
6
7
  import { parseHmtx } from "./hmtx-table.js";
7
8
  //#region src/embedded-font.ts
8
9
  const GLYPH_SPACE_UNITS_PER_EM = 1e3;
@@ -56,10 +57,12 @@ function readEmbeddedFace(font) {
56
57
  const scale = (designUnits) => scaleToGlyphSpace(designUnits, unitsPerEm);
57
58
  const capHeight = resolveCapHeight(font, cmap, os2?.sCapHeight, hhea.ascent);
58
59
  const kern = buildGposKernLookup(font);
60
+ const gsubShaper = buildGsubShaper(font);
59
61
  return {
60
62
  font,
61
63
  postScriptName: name.postScriptName,
62
64
  numGlyphs: maxp.numGlyphs,
65
+ gsubShaper,
63
66
  metrics: {
64
67
  unitsPerEm,
65
68
  ascentGlyphSpace: scale(hhea.ascent),
@@ -108,30 +111,31 @@ function parseHhea(font) {
108
111
  }
109
112
  const CID_BYTE_LENGTH = 2;
110
113
  function encodeForShowEmbedded(text, face) {
111
- const glyphIds = [];
114
+ const resolvedGlyphIds = [];
112
115
  const substitutions = [];
113
- const kerns = [];
114
- let width1000 = 0;
115
116
  for (const character of text) {
116
117
  const glyphId = face.glyphId(character.codePointAt(0));
117
118
  if (glyphId === void 0) substitutions.push({ from: character });
118
- const shown = glyphId ?? 0;
119
- const previous = glyphIds[glyphIds.length - 1];
120
- if (previous !== void 0) {
121
- const adjustment1000 = face.kernGlyphSpace(previous, shown);
119
+ resolvedGlyphIds.push(glyphId ?? 0);
120
+ }
121
+ const shownGlyphIds = face.gsubShaper === void 0 ? resolvedGlyphIds : face.gsubShaper(resolvedGlyphIds).glyphIds;
122
+ const kerns = [];
123
+ let width1000 = 0;
124
+ for (const [index, shown] of shownGlyphIds.entries()) {
125
+ if (index > 0) {
126
+ const adjustment1000 = face.kernGlyphSpace(shownGlyphIds[index - 1], shown);
122
127
  if (adjustment1000 !== 0) {
123
128
  kerns.push({
124
- codeOffset: glyphIds.length * CID_BYTE_LENGTH,
129
+ codeOffset: index * CID_BYTE_LENGTH,
125
130
  adjustment1000
126
131
  });
127
132
  width1000 += adjustment1000;
128
133
  }
129
134
  }
130
- glyphIds.push(shown);
131
135
  width1000 += face.glyphSpaceWidth(shown);
132
136
  }
133
- const codes = new Uint8Array(glyphIds.length * CID_BYTE_LENGTH);
134
- glyphIds.forEach((glyphId, index) => {
137
+ const codes = new Uint8Array(shownGlyphIds.length * CID_BYTE_LENGTH);
138
+ shownGlyphIds.forEach((glyphId, index) => {
135
139
  codes[index * CID_BYTE_LENGTH] = glyphId >> 8 & 255;
136
140
  codes[index * CID_BYTE_LENGTH + 1] = glyphId & 255;
137
141
  });
@@ -144,10 +148,37 @@ function encodeForShowEmbedded(text, face) {
144
148
  }
145
149
  function collectEmbeddedGlyphs(texts, face) {
146
150
  const used = /* @__PURE__ */ new Map();
147
- for (const text of texts) for (const character of text) {
148
- const codePoint = character.codePointAt(0);
149
- const glyphId = face.glyphId(codePoint);
150
- if (glyphId !== void 0 && !used.has(glyphId)) used.set(glyphId, codePoint);
151
+ for (const text of texts) {
152
+ const resolvedGlyphIds = [];
153
+ const codePoints = [];
154
+ for (const character of text) {
155
+ const codePoint = character.codePointAt(0);
156
+ const glyphId = face.glyphId(codePoint);
157
+ if (glyphId === void 0) {
158
+ resolvedGlyphIds.push(0);
159
+ codePoints.push(void 0);
160
+ } else {
161
+ resolvedGlyphIds.push(glyphId);
162
+ codePoints.push(codePoint);
163
+ }
164
+ }
165
+ const shaping = face.gsubShaper === void 0 ? {
166
+ glyphIds: resolvedGlyphIds,
167
+ spans: resolvedGlyphIds.map(() => 1)
168
+ } : face.gsubShaper(resolvedGlyphIds);
169
+ let cursor = 0;
170
+ for (const [index, glyphId] of shaping.glyphIds.entries()) {
171
+ const span = shaping.spans[index];
172
+ const sequence = [];
173
+ for (let s = 0; s < span; s++) {
174
+ const codePoint = codePoints[cursor + s];
175
+ if (codePoint !== void 0) sequence.push(codePoint);
176
+ }
177
+ cursor += span;
178
+ if (glyphId !== 0 && sequence.length > 0) {
179
+ if (used.get(glyphId) === void 0) used.set(glyphId, sequence);
180
+ }
181
+ }
151
182
  }
152
183
  return used;
153
184
  }
package/dist/encoding.cjs CHANGED
@@ -1,5 +1,14 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_afm_widths = require("./afm-widths-BoeTOK2r.cjs");
2
+ const require_afm_widths = require("./afm-widths-BTu0IDp2.cjs");
3
+ exports.MACROMAN_GLYPH_NAMES = require_afm_widths.MACROMAN_GLYPH_NAMES;
4
+ exports.STANDARD_GLYPH_NAMES = require_afm_widths.STANDARD_GLYPH_NAMES;
5
+ exports.SYMBOL_GLYPH_NAMES = require_afm_widths.SYMBOL_GLYPH_NAMES;
3
6
  exports.WINANSI_GLYPH_NAMES = require_afm_widths.WINANSI_GLYPH_NAMES;
7
+ exports.ZAPFDINGBATS_GLYPH_NAMES = require_afm_widths.ZAPFDINGBATS_GLYPH_NAMES;
4
8
  exports.glyphNameToUnicode = require_afm_widths.glyphNameToUnicode;
9
+ exports.macRomanGlyphName = require_afm_widths.macRomanGlyphName;
10
+ exports.namedEncodingGlyphName = require_afm_widths.namedEncodingGlyphName;
11
+ exports.standardGlyphName = require_afm_widths.standardGlyphName;
12
+ exports.symbolGlyphName = require_afm_widths.symbolGlyphName;
5
13
  exports.winAnsiGlyphName = require_afm_widths.winAnsiGlyphName;
14
+ exports.zapfDingbatsGlyphName = require_afm_widths.zapfDingbatsGlyphName;
@@ -1,6 +1,15 @@
1
1
  //#region src/encoding.d.ts
2
2
  declare const WINANSI_GLYPH_NAMES: readonly string[];
3
3
  declare function winAnsiGlyphName(code: number): string | undefined;
4
+ declare const SYMBOL_GLYPH_NAMES: readonly string[];
5
+ declare function symbolGlyphName(code: number): string | undefined;
6
+ declare const ZAPFDINGBATS_GLYPH_NAMES: readonly string[];
7
+ declare const STANDARD_GLYPH_NAMES: readonly string[];
8
+ declare function standardGlyphName(code: number): string | undefined;
9
+ declare const MACROMAN_GLYPH_NAMES: readonly string[];
10
+ declare function macRomanGlyphName(code: number): string | undefined;
11
+ declare function namedEncodingGlyphName(encodingName: string): ((code: number) => string | undefined) | undefined;
12
+ declare function zapfDingbatsGlyphName(code: number): string | undefined;
4
13
  declare function glyphNameToUnicode(name: string): number | undefined;
5
14
  //#endregion
6
- export { WINANSI_GLYPH_NAMES, glyphNameToUnicode, winAnsiGlyphName };
15
+ export { MACROMAN_GLYPH_NAMES, STANDARD_GLYPH_NAMES, SYMBOL_GLYPH_NAMES, WINANSI_GLYPH_NAMES, ZAPFDINGBATS_GLYPH_NAMES, glyphNameToUnicode, macRomanGlyphName, namedEncodingGlyphName, standardGlyphName, symbolGlyphName, winAnsiGlyphName, zapfDingbatsGlyphName };
@@ -1,6 +1,15 @@
1
1
  //#region src/encoding.d.ts
2
2
  declare const WINANSI_GLYPH_NAMES: readonly string[];
3
3
  declare function winAnsiGlyphName(code: number): string | undefined;
4
+ declare const SYMBOL_GLYPH_NAMES: readonly string[];
5
+ declare function symbolGlyphName(code: number): string | undefined;
6
+ declare const ZAPFDINGBATS_GLYPH_NAMES: readonly string[];
7
+ declare const STANDARD_GLYPH_NAMES: readonly string[];
8
+ declare function standardGlyphName(code: number): string | undefined;
9
+ declare const MACROMAN_GLYPH_NAMES: readonly string[];
10
+ declare function macRomanGlyphName(code: number): string | undefined;
11
+ declare function namedEncodingGlyphName(encodingName: string): ((code: number) => string | undefined) | undefined;
12
+ declare function zapfDingbatsGlyphName(code: number): string | undefined;
4
13
  declare function glyphNameToUnicode(name: string): number | undefined;
5
14
  //#endregion
6
- export { WINANSI_GLYPH_NAMES, glyphNameToUnicode, winAnsiGlyphName };
15
+ export { MACROMAN_GLYPH_NAMES, STANDARD_GLYPH_NAMES, SYMBOL_GLYPH_NAMES, WINANSI_GLYPH_NAMES, ZAPFDINGBATS_GLYPH_NAMES, glyphNameToUnicode, macRomanGlyphName, namedEncodingGlyphName, standardGlyphName, symbolGlyphName, winAnsiGlyphName, zapfDingbatsGlyphName };
package/dist/encoding.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as winAnsiGlyphName, i as glyphNameToUnicode, r as WINANSI_GLYPH_NAMES } from "./afm-widths-Dxucrg7D.js";
2
- export { WINANSI_GLYPH_NAMES, glyphNameToUnicode, winAnsiGlyphName };
1
+ import { a as SYMBOL_GLYPH_NAMES, c as glyphNameToUnicode, d as standardGlyphName, f as symbolGlyphName, i as STANDARD_GLYPH_NAMES, l as macRomanGlyphName, m as zapfDingbatsGlyphName, o as WINANSI_GLYPH_NAMES, p as winAnsiGlyphName, r as MACROMAN_GLYPH_NAMES, s as ZAPFDINGBATS_GLYPH_NAMES, u as namedEncodingGlyphName } from "./afm-widths-De_QMWgC.js";
2
+ export { MACROMAN_GLYPH_NAMES, STANDARD_GLYPH_NAMES, SYMBOL_GLYPH_NAMES, WINANSI_GLYPH_NAMES, ZAPFDINGBATS_GLYPH_NAMES, glyphNameToUnicode, macRomanGlyphName, namedEncodingGlyphName, standardGlyphName, symbolGlyphName, winAnsiGlyphName, zapfDingbatsGlyphName };