pdf-codec 5.3.30 → 5.3.31

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.
@@ -694,14 +694,17 @@ const STANDARD_METRICS = {
694
694
  widths: parseWidths("space 600 exclam 600 quotedbl 600 numbersign 600 dollar 600 percent 600 ampersand 600 quoteright 600 parenleft 600 parenright 600 asterisk 600 plus 600 comma 600 hyphen 600 period 600 slash 600 zero 600 one 600 two 600 three 600 four 600 five 600 six 600 seven 600 eight 600 nine 600 colon 600 semicolon 600 less 600 equal 600 greater 600 question 600 at 600 A 600 B 600 C 600 D 600 E 600 F 600 G 600 H 600 I 600 J 600 K 600 L 600 M 600 N 600 O 600 P 600 Q 600 R 600 S 600 T 600 U 600 V 600 W 600 X 600 Y 600 Z 600 bracketleft 600 backslash 600 bracketright 600 asciicircum 600 underscore 600 quoteleft 600 a 600 b 600 c 600 d 600 e 600 f 600 g 600 h 600 i 600 j 600 k 600 l 600 m 600 n 600 o 600 p 600 q 600 r 600 s 600 t 600 u 600 v 600 w 600 x 600 y 600 z 600 braceleft 600 bar 600 braceright 600 asciitilde 600 exclamdown 600 cent 600 sterling 600 fraction 600 yen 600 florin 600 section 600 currency 600 quotesingle 600 quotedblleft 600 guillemotleft 600 guilsinglleft 600 guilsinglright 600 fi 600 fl 600 endash 600 dagger 600 daggerdbl 600 periodcentered 600 paragraph 600 bullet 600 quotesinglbase 600 quotedblbase 600 quotedblright 600 guillemotright 600 ellipsis 600 perthousand 600 questiondown 600 grave 600 acute 600 circumflex 600 tilde 600 macron 600 breve 600 dotaccent 600 dieresis 600 ring 600 cedilla 600 hungarumlaut 600 ogonek 600 caron 600 emdash 600 AE 600 ordfeminine 600 Lslash 600 Oslash 600 OE 600 ordmasculine 600 ae 600 dotlessi 600 lslash 600 oslash 600 oe 600 germandbls 600 Idieresis 600 eacute 600 abreve 600 uhungarumlaut 600 ecaron 600 Ydieresis 600 divide 600 Yacute 600 Acircumflex 600 aacute 600 Ucircumflex 600 yacute 600 scommaaccent 600 ecircumflex 600 Uring 600 Udieresis 600 aogonek 600 Uacute 600 uogonek 600 Edieresis 600 Dcroat 600 commaaccent 600 copyright 600 Emacron 600 ccaron 600 aring 600 Ncommaaccent 600 lacute 600 agrave 600 Tcommaaccent 600 Cacute 600 atilde 600 Edotaccent 600 scaron 600 scedilla 600 iacute 600 lozenge 600 Rcaron 600 Gcommaaccent 600 ucircumflex 600 acircumflex 600 Amacron 600 rcaron 600 ccedilla 600 Zdotaccent 600 Thorn 600 Omacron 600 Racute 600 Sacute 600 dcaron 600 Umacron 600 uring 600 threesuperior 600 Ograve 600 Agrave 600 Abreve 600 multiply 600 uacute 600 Tcaron 600 partialdiff 600 ydieresis 600 Nacute 600 icircumflex 600 Ecircumflex 600 adieresis 600 edieresis 600 cacute 600 nacute 600 umacron 600 Ncaron 600 Iacute 600 plusminus 600 brokenbar 600 registered 600 Gbreve 600 Idotaccent 600 summation 600 Egrave 600 racute 600 omacron 600 Zacute 600 Zcaron 600 greaterequal 600 Eth 600 Ccedilla 600 lcommaaccent 600 tcaron 600 eogonek 600 Uogonek 600 Aacute 600 Adieresis 600 egrave 600 zacute 600 iogonek 600 Oacute 600 oacute 600 amacron 600 sacute 600 idieresis 600 Ocircumflex 600 Ugrave 600 Delta 600 thorn 600 twosuperior 600 Odieresis 600 mu 600 igrave 600 ohungarumlaut 600 Eogonek 600 dcroat 600 threequarters 600 Scedilla 600 lcaron 600 Kcommaaccent 600 Lacute 600 trademark 600 edotaccent 600 Igrave 600 Imacron 600 Lcaron 600 onehalf 600 lessequal 600 ocircumflex 600 ntilde 600 Uhungarumlaut 600 Eacute 600 emacron 600 gbreve 600 onequarter 600 Scaron 600 Scommaaccent 600 Ohungarumlaut 600 degree 600 ograve 600 Ccaron 600 ugrave 600 radical 600 Dcaron 600 rcommaaccent 600 Ntilde 600 otilde 600 Rcommaaccent 600 Lcommaaccent 600 Atilde 600 Aogonek 600 Aring 600 Otilde 600 zdotaccent 600 Ecaron 600 Iogonek 600 kcommaaccent 600 minus 600 Icircumflex 600 ncaron 600 tcommaaccent 600 logicalnot 600 odieresis 600 udieresis 600 notequal 600 gcommaaccent 600 eth 600 zcaron 600 ncommaaccent 600 onesuperior 600 imacron 600 Euro 600")
695
695
  }
696
696
  };
697
- function widthOfCode(font, code) {
697
+ function afmWidthOfCode(font, code) {
698
698
  const metrics = STANDARD_METRICS[font];
699
699
  if (metrics.fixedWidth !== void 0) return metrics.fixedWidth;
700
700
  const glyphName = winAnsiGlyphName(code);
701
- if (glyphName === void 0) throw new Error(`character code ${code} has no WinAnsi glyph mapping`);
702
- const width = metrics.widths.get(glyphName);
703
- if (width === void 0) throw new Error(`${font} has no AFM width for glyph '${glyphName}' (code ${code})`);
704
- return width;
701
+ return glyphName === void 0 ? void 0 : metrics.widths.get(glyphName);
702
+ }
703
+ function widthOfCode(font, code) {
704
+ const width = afmWidthOfCode(font, code);
705
+ if (width !== void 0) return width;
706
+ if (winAnsiGlyphName(code) === void 0) throw new Error(`character code ${code} has no WinAnsi glyph mapping`);
707
+ throw new Error(`${font} has no AFM width for glyph '${winAnsiGlyphName(code)}' (code ${code})`);
705
708
  }
706
709
  //#endregion
707
- export { namedEncodingGlyphName as a, sanitizeToWinAnsi as c, glyphNameToUnicode as i, winAnsiCodeToUnicode as l, widthOfCode as n, winAnsiGlyphName as o, WINANSI_GLYPH_NAMES as r, encodeForShow as s, STANDARD_METRICS as t };
710
+ export { glyphNameToUnicode as a, encodeForShow as c, WINANSI_GLYPH_NAMES as i, sanitizeToWinAnsi as l, afmWidthOfCode as n, namedEncodingGlyphName as o, widthOfCode as r, winAnsiGlyphName as s, STANDARD_METRICS as t, winAnsiCodeToUnicode as u };
@@ -14,6 +14,7 @@ interface FontMetrics {
14
14
  readonly widths: ReadonlyMap<string, number>;
15
15
  }
16
16
  declare const STANDARD_METRICS: Readonly<Record<StandardFontName, FontMetrics>>;
17
+ declare function afmWidthOfCode(font: StandardFontName, code: number): number | undefined;
17
18
  declare function widthOfCode(font: StandardFontName, code: number): number;
18
19
  //#endregion
19
- export { widthOfCode as i, STANDARD_METRICS as n, StandardFontName as r, FontMetrics as t };
20
+ export { widthOfCode as a, afmWidthOfCode as i, STANDARD_METRICS as n, StandardFontName as r, FontMetrics as t };
@@ -14,6 +14,7 @@ interface FontMetrics {
14
14
  readonly widths: ReadonlyMap<string, number>;
15
15
  }
16
16
  declare const STANDARD_METRICS: Readonly<Record<StandardFontName, FontMetrics>>;
17
+ declare function afmWidthOfCode(font: StandardFontName, code: number): number | undefined;
17
18
  declare function widthOfCode(font: StandardFontName, code: number): number;
18
19
  //#endregion
19
- export { widthOfCode as i, STANDARD_METRICS as n, StandardFontName as r, FontMetrics as t };
20
+ export { widthOfCode as a, afmWidthOfCode as i, STANDARD_METRICS as n, StandardFontName as r, FontMetrics as t };
@@ -694,14 +694,17 @@ const STANDARD_METRICS = {
694
694
  widths: parseWidths("space 600 exclam 600 quotedbl 600 numbersign 600 dollar 600 percent 600 ampersand 600 quoteright 600 parenleft 600 parenright 600 asterisk 600 plus 600 comma 600 hyphen 600 period 600 slash 600 zero 600 one 600 two 600 three 600 four 600 five 600 six 600 seven 600 eight 600 nine 600 colon 600 semicolon 600 less 600 equal 600 greater 600 question 600 at 600 A 600 B 600 C 600 D 600 E 600 F 600 G 600 H 600 I 600 J 600 K 600 L 600 M 600 N 600 O 600 P 600 Q 600 R 600 S 600 T 600 U 600 V 600 W 600 X 600 Y 600 Z 600 bracketleft 600 backslash 600 bracketright 600 asciicircum 600 underscore 600 quoteleft 600 a 600 b 600 c 600 d 600 e 600 f 600 g 600 h 600 i 600 j 600 k 600 l 600 m 600 n 600 o 600 p 600 q 600 r 600 s 600 t 600 u 600 v 600 w 600 x 600 y 600 z 600 braceleft 600 bar 600 braceright 600 asciitilde 600 exclamdown 600 cent 600 sterling 600 fraction 600 yen 600 florin 600 section 600 currency 600 quotesingle 600 quotedblleft 600 guillemotleft 600 guilsinglleft 600 guilsinglright 600 fi 600 fl 600 endash 600 dagger 600 daggerdbl 600 periodcentered 600 paragraph 600 bullet 600 quotesinglbase 600 quotedblbase 600 quotedblright 600 guillemotright 600 ellipsis 600 perthousand 600 questiondown 600 grave 600 acute 600 circumflex 600 tilde 600 macron 600 breve 600 dotaccent 600 dieresis 600 ring 600 cedilla 600 hungarumlaut 600 ogonek 600 caron 600 emdash 600 AE 600 ordfeminine 600 Lslash 600 Oslash 600 OE 600 ordmasculine 600 ae 600 dotlessi 600 lslash 600 oslash 600 oe 600 germandbls 600 Idieresis 600 eacute 600 abreve 600 uhungarumlaut 600 ecaron 600 Ydieresis 600 divide 600 Yacute 600 Acircumflex 600 aacute 600 Ucircumflex 600 yacute 600 scommaaccent 600 ecircumflex 600 Uring 600 Udieresis 600 aogonek 600 Uacute 600 uogonek 600 Edieresis 600 Dcroat 600 commaaccent 600 copyright 600 Emacron 600 ccaron 600 aring 600 Ncommaaccent 600 lacute 600 agrave 600 Tcommaaccent 600 Cacute 600 atilde 600 Edotaccent 600 scaron 600 scedilla 600 iacute 600 lozenge 600 Rcaron 600 Gcommaaccent 600 ucircumflex 600 acircumflex 600 Amacron 600 rcaron 600 ccedilla 600 Zdotaccent 600 Thorn 600 Omacron 600 Racute 600 Sacute 600 dcaron 600 Umacron 600 uring 600 threesuperior 600 Ograve 600 Agrave 600 Abreve 600 multiply 600 uacute 600 Tcaron 600 partialdiff 600 ydieresis 600 Nacute 600 icircumflex 600 Ecircumflex 600 adieresis 600 edieresis 600 cacute 600 nacute 600 umacron 600 Ncaron 600 Iacute 600 plusminus 600 brokenbar 600 registered 600 Gbreve 600 Idotaccent 600 summation 600 Egrave 600 racute 600 omacron 600 Zacute 600 Zcaron 600 greaterequal 600 Eth 600 Ccedilla 600 lcommaaccent 600 tcaron 600 eogonek 600 Uogonek 600 Aacute 600 Adieresis 600 egrave 600 zacute 600 iogonek 600 Oacute 600 oacute 600 amacron 600 sacute 600 idieresis 600 Ocircumflex 600 Ugrave 600 Delta 600 thorn 600 twosuperior 600 Odieresis 600 mu 600 igrave 600 ohungarumlaut 600 Eogonek 600 dcroat 600 threequarters 600 Scedilla 600 lcaron 600 Kcommaaccent 600 Lacute 600 trademark 600 edotaccent 600 Igrave 600 Imacron 600 Lcaron 600 onehalf 600 lessequal 600 ocircumflex 600 ntilde 600 Uhungarumlaut 600 Eacute 600 emacron 600 gbreve 600 onequarter 600 Scaron 600 Scommaaccent 600 Ohungarumlaut 600 degree 600 ograve 600 Ccaron 600 ugrave 600 radical 600 Dcaron 600 rcommaaccent 600 Ntilde 600 otilde 600 Rcommaaccent 600 Lcommaaccent 600 Atilde 600 Aogonek 600 Aring 600 Otilde 600 zdotaccent 600 Ecaron 600 Iogonek 600 kcommaaccent 600 minus 600 Icircumflex 600 ncaron 600 tcommaaccent 600 logicalnot 600 odieresis 600 udieresis 600 notequal 600 gcommaaccent 600 eth 600 zcaron 600 ncommaaccent 600 onesuperior 600 imacron 600 Euro 600")
695
695
  }
696
696
  };
697
- function widthOfCode(font, code) {
697
+ function afmWidthOfCode(font, code) {
698
698
  const metrics = STANDARD_METRICS[font];
699
699
  if (metrics.fixedWidth !== void 0) return metrics.fixedWidth;
700
700
  const glyphName = winAnsiGlyphName(code);
701
- if (glyphName === void 0) throw new Error(`character code ${code} has no WinAnsi glyph mapping`);
702
- const width = metrics.widths.get(glyphName);
703
- if (width === void 0) throw new Error(`${font} has no AFM width for glyph '${glyphName}' (code ${code})`);
704
- return width;
701
+ return glyphName === void 0 ? void 0 : metrics.widths.get(glyphName);
702
+ }
703
+ function widthOfCode(font, code) {
704
+ const width = afmWidthOfCode(font, code);
705
+ if (width !== void 0) return width;
706
+ if (winAnsiGlyphName(code) === void 0) throw new Error(`character code ${code} has no WinAnsi glyph mapping`);
707
+ throw new Error(`${font} has no AFM width for glyph '${winAnsiGlyphName(code)}' (code ${code})`);
705
708
  }
706
709
  //#endregion
707
710
  Object.defineProperty(exports, "STANDARD_METRICS", {
@@ -716,6 +719,12 @@ Object.defineProperty(exports, "WINANSI_GLYPH_NAMES", {
716
719
  return WINANSI_GLYPH_NAMES;
717
720
  }
718
721
  });
722
+ Object.defineProperty(exports, "afmWidthOfCode", {
723
+ enumerable: true,
724
+ get: function() {
725
+ return afmWidthOfCode;
726
+ }
727
+ });
719
728
  Object.defineProperty(exports, "encodeForShow", {
720
729
  enumerable: true,
721
730
  get: function() {
@@ -1,4 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_afm_widths = require("./afm-widths-C6U0SQj9.cjs");
2
+ const require_afm_widths = require("./afm-widths-sjaRvmQX.cjs");
3
3
  exports.STANDARD_METRICS = require_afm_widths.STANDARD_METRICS;
4
+ exports.afmWidthOfCode = require_afm_widths.afmWidthOfCode;
4
5
  exports.widthOfCode = require_afm_widths.widthOfCode;
@@ -1,2 +1,2 @@
1
- import { i as widthOfCode, n as STANDARD_METRICS, r as StandardFontName, t as FontMetrics } from "./afm-widths-CneRyu5l.cjs";
2
- export { FontMetrics, STANDARD_METRICS, StandardFontName, widthOfCode };
1
+ import { a as widthOfCode, i as afmWidthOfCode, n as STANDARD_METRICS, r as StandardFontName, t as FontMetrics } from "./afm-widths-D0Lu9kLv.cjs";
2
+ export { FontMetrics, STANDARD_METRICS, StandardFontName, afmWidthOfCode, widthOfCode };
@@ -1,2 +1,2 @@
1
- import { i as widthOfCode, n as STANDARD_METRICS, r as StandardFontName, t as FontMetrics } from "./afm-widths-CneRyu5l.js";
2
- export { FontMetrics, STANDARD_METRICS, StandardFontName, widthOfCode };
1
+ import { a as widthOfCode, i as afmWidthOfCode, n as STANDARD_METRICS, r as StandardFontName, t as FontMetrics } from "./afm-widths-D0Lu9kLv.js";
2
+ export { FontMetrics, STANDARD_METRICS, StandardFontName, afmWidthOfCode, widthOfCode };
@@ -1,2 +1,2 @@
1
- import { n as widthOfCode, t as STANDARD_METRICS } from "./afm-widths-p3UfaXme.js";
2
- export { STANDARD_METRICS, widthOfCode };
1
+ import { n as afmWidthOfCode, r as widthOfCode, t as STANDARD_METRICS } from "./afm-widths-BNI8qa2S.js";
2
+ export { STANDARD_METRICS, afmWidthOfCode, widthOfCode };
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_encoding_standard_tables = require("./encoding-standard-tables.cjs");
3
- const require_afm_widths = require("./afm-widths-C6U0SQj9.cjs");
3
+ const require_afm_widths = require("./afm-widths-sjaRvmQX.cjs");
4
4
  const require_sfnt = require("./sfnt.cjs");
5
5
  const require_cff = require("./cff.cjs");
6
6
  const require_cmap_table = require("./cmap-table.cjs");
@@ -1,5 +1,5 @@
1
1
  import { standardGlyphName } from "./encoding-standard-tables.js";
2
- import { i as glyphNameToUnicode } from "./afm-widths-p3UfaXme.js";
2
+ import { a as glyphNameToUnicode } from "./afm-widths-BNI8qa2S.js";
3
3
  import { hasBytes, parseSfnt, sfntTableBytes, u16, u8 } from "./sfnt.js";
4
4
  import { cffStringForSid, parseCffDict, readCffIndex } from "./cff.js";
5
5
  import { readCmapSubtables } from "./cmap-table.js";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_afm_widths = require("./afm-widths-C6U0SQj9.cjs");
2
+ const require_afm_widths = require("./afm-widths-sjaRvmQX.cjs");
3
3
  const require_objects = require("./objects.cjs");
4
4
  const require_bytes_writer = require("./bytes/writer.cjs");
5
5
  const require_serialize = require("./serialize.cjs");
@@ -1,4 +1,4 @@
1
- import { r as StandardFontName } from "./afm-widths-CneRyu5l.cjs";
1
+ import { r as StandardFontName } from "./afm-widths-D0Lu9kLv.cjs";
2
2
  import { LayoutItem } from "./layout.cjs";
3
3
  import { r as EmbeddedFaceSubstitution, t as EmbeddedFace } from "./embedded-font-CqePfvrl.cjs";
4
4
  import { WinAnsiSubstitution } from "./winansi.cjs";
@@ -1,4 +1,4 @@
1
- import { r as StandardFontName } from "./afm-widths-CneRyu5l.js";
1
+ import { r as StandardFontName } from "./afm-widths-D0Lu9kLv.js";
2
2
  import { LayoutItem } from "./layout.js";
3
3
  import { r as EmbeddedFaceSubstitution, t as EmbeddedFace } from "./embedded-font-CQZbTTDM.js";
4
4
  import { WinAnsiSubstitution } from "./winansi.js";
@@ -1,4 +1,4 @@
1
- import { s as encodeForShow } from "./afm-widths-p3UfaXme.js";
1
+ import { c as encodeForShow } from "./afm-widths-BNI8qa2S.js";
2
2
  import { pdfArray, pdfHexString, pdfNum } from "./objects.js";
3
3
  import { ByteWriter } from "./bytes/writer.js";
4
4
  import { formatNumber, writeObject } from "./serialize.js";
package/dist/encoding.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_afm_widths = require("./afm-widths-C6U0SQj9.cjs");
2
+ const require_afm_widths = require("./afm-widths-sjaRvmQX.cjs");
3
3
  exports.WINANSI_GLYPH_NAMES = require_afm_widths.WINANSI_GLYPH_NAMES;
4
4
  exports.glyphNameToUnicode = require_afm_widths.glyphNameToUnicode;
5
5
  exports.namedEncodingGlyphName = require_afm_widths.namedEncodingGlyphName;
package/dist/encoding.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as namedEncodingGlyphName, i as glyphNameToUnicode, o as winAnsiGlyphName, r as WINANSI_GLYPH_NAMES } from "./afm-widths-p3UfaXme.js";
1
+ import { a as glyphNameToUnicode, i as WINANSI_GLYPH_NAMES, o as namedEncodingGlyphName, s as winAnsiGlyphName } from "./afm-widths-BNI8qa2S.js";
2
2
  export { WINANSI_GLYPH_NAMES, glyphNameToUnicode, namedEncodingGlyphName, winAnsiGlyphName };
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_afm_widths = require("./afm-widths-C6U0SQj9.cjs");
2
+ const require_afm_widths = require("./afm-widths-sjaRvmQX.cjs");
3
3
  const require_objects = require("./objects.cjs");
4
4
  const require_filters = require("./filters.cjs");
5
5
  const require_builtin_encoding = require("./builtin-encoding.cjs");
@@ -78,7 +78,20 @@ function buildSimpleFont(fontDict, context) {
78
78
  if (widthsArr !== void 0) widthOf = (code) => require_objects.asNumber(widthsArr[code - firstChar]) ?? missingWidth;
79
79
  else {
80
80
  const standardMatch = require_fonts.resolveStandardFont(baseFamily, bold, italic);
81
- widthOf = (code) => require_afm_widths.widthOfCode(standardMatch.standardName, code);
81
+ let reportedUnmapped = false;
82
+ widthOf = (code) => {
83
+ const width = require_afm_widths.afmWidthOfCode(standardMatch.standardName, code);
84
+ if (width !== void 0) return width;
85
+ if (!reportedUnmapped) {
86
+ reportedUnmapped = true;
87
+ context.sink({
88
+ code: "pdf/font-width-unmapped-code",
89
+ severity: "warning",
90
+ message: `font "${baseFont}" has no /Widths array and the standard-14 metrics define no width for character code ${code}; using /MissingWidth (${missingWidth}) for such codes`
91
+ });
92
+ }
93
+ return missingWidth;
94
+ };
82
95
  if (!standardMatch.matched) context.sink({
83
96
  code: "pdf/font-widths-missing",
84
97
  severity: "warning",
package/dist/font-read.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a as namedEncodingGlyphName, i as glyphNameToUnicode, n as widthOfCode, o as winAnsiGlyphName } from "./afm-widths-p3UfaXme.js";
1
+ import { a as glyphNameToUnicode, n as afmWidthOfCode, o as namedEncodingGlyphName, s as winAnsiGlyphName } from "./afm-widths-BNI8qa2S.js";
2
2
  import { asArray, asName, asNumber, dictGet, isName } from "./objects.js";
3
3
  import { decodeStream } from "./filters.js";
4
4
  import { readFontProgramEncoding } from "./builtin-encoding.js";
@@ -77,7 +77,20 @@ function buildSimpleFont(fontDict, context) {
77
77
  if (widthsArr !== void 0) widthOf = (code) => asNumber(widthsArr[code - firstChar]) ?? missingWidth;
78
78
  else {
79
79
  const standardMatch = resolveStandardFont(baseFamily, bold, italic);
80
- widthOf = (code) => widthOfCode(standardMatch.standardName, code);
80
+ let reportedUnmapped = false;
81
+ widthOf = (code) => {
82
+ const width = afmWidthOfCode(standardMatch.standardName, code);
83
+ if (width !== void 0) return width;
84
+ if (!reportedUnmapped) {
85
+ reportedUnmapped = true;
86
+ context.sink({
87
+ code: "pdf/font-width-unmapped-code",
88
+ severity: "warning",
89
+ message: `font "${baseFont}" has no /Widths array and the standard-14 metrics define no width for character code ${code}; using /MissingWidth (${missingWidth}) for such codes`
90
+ });
91
+ }
92
+ return missingWidth;
93
+ };
81
94
  if (!standardMatch.matched) context.sink({
82
95
  code: "pdf/font-widths-missing",
83
96
  severity: "warning",
@@ -1,4 +1,4 @@
1
- import { r as StandardFontName } from "./afm-widths-CneRyu5l.cjs";
1
+ import { r as StandardFontName } from "./afm-widths-D0Lu9kLv.cjs";
2
2
  import { t as EmbeddedFace } from "./embedded-font-CqePfvrl.cjs";
3
3
  import { FontRegistryOptions, LayoutFont } from "document-schema.js";
4
4
  //#region src/font-registry.d.ts
@@ -1,4 +1,4 @@
1
- import { r as StandardFontName } from "./afm-widths-CneRyu5l.js";
1
+ import { r as StandardFontName } from "./afm-widths-D0Lu9kLv.js";
2
2
  import { t as EmbeddedFace } from "./embedded-font-CQZbTTDM.js";
3
3
  import { FontRegistryOptions, LayoutFont } from "document-schema.js";
4
4
  //#region src/font-registry.d.ts
package/dist/fonts.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { r as StandardFontName } from "./afm-widths-CneRyu5l.cjs";
1
+ import { r as StandardFontName } from "./afm-widths-D0Lu9kLv.cjs";
2
2
  //#region src/fonts.d.ts
3
3
  type StandardFamily = "helvetica" | "times" | "courier";
4
4
  declare function normalizeFamilyName(raw: string): string;
package/dist/fonts.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { r as StandardFontName } from "./afm-widths-CneRyu5l.js";
1
+ import { r as StandardFontName } from "./afm-widths-D0Lu9kLv.js";
2
2
  //#region src/fonts.d.ts
3
3
  type StandardFamily = "helvetica" | "times" | "courier";
4
4
  declare function normalizeFamilyName(raw: string): string;
package/dist/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_afm_widths = require("./afm-widths-C6U0SQj9.cjs");
2
+ const require_afm_widths = require("./afm-widths-sjaRvmQX.cjs");
3
3
  const require_image_ccitt = require("./image/ccitt.cjs");
4
4
  const require_image_jbig2_errors = require("./image/jbig2-errors.cjs");
5
5
  const require_image_jbig2 = require("./image/jbig2.cjs");
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as STANDARD_METRICS, r as StandardFontName, t as FontMetrics } from "./afm-widths-CneRyu5l.cjs";
1
+ import { n as STANDARD_METRICS, r as StandardFontName, t as FontMetrics } from "./afm-widths-D0Lu9kLv.cjs";
2
2
  import { a as PdfEncryptedError, i as PdfDiagnosticSink, n as PdfDiagnostic, o as PdfParseError, r as PdfDiagnosticSeverity, s as PdfPasswordRequiredError, t as NOOP_DIAGNOSTIC_SINK } from "./diagnostics-C9FxfZ6H.cjs";
3
3
  import { LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema } from "./layout.cjs";
4
4
  import { t as GlyphInkBounds } from "./glyph-bounds-BV_Z40KS.cjs";
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as STANDARD_METRICS, r as StandardFontName, t as FontMetrics } from "./afm-widths-CneRyu5l.js";
1
+ import { n as STANDARD_METRICS, r as StandardFontName, t as FontMetrics } from "./afm-widths-D0Lu9kLv.js";
2
2
  import { a as PdfEncryptedError, i as PdfDiagnosticSink, n as PdfDiagnostic, o as PdfParseError, r as PdfDiagnosticSeverity, s as PdfPasswordRequiredError, t as NOOP_DIAGNOSTIC_SINK } from "./diagnostics-C9FxfZ6H.js";
3
3
  import { LAYOUT_FORMAT_VERSION, LayoutAnnotation, LayoutAnnotationQuad, LayoutAnnotationQuadSchema, LayoutAnnotationSchema, LayoutAttachment, LayoutAttachmentSchema, LayoutDestination, LayoutDestinationSchema, LayoutDestinationTarget, LayoutDestinationTargetSchema, LayoutDocument, LayoutDocumentSchema, LayoutEllipse, LayoutEllipseSchema, LayoutFormField, LayoutFormFieldSchema, LayoutFormWidget, LayoutFormWidgetSchema, LayoutImage, LayoutImageAsset, LayoutImageAssetSchema, LayoutImageSchema, LayoutInternalLink, LayoutInternalLinkSchema, LayoutItem, LayoutItemSchema, LayoutLayer, LayoutLayerSchema, LayoutLine, LayoutLineSchema, LayoutLink, LayoutLinkSchema, LayoutOutlineItem, LayoutOutlineItemSchema, LayoutPage, LayoutPageSchema, LayoutPath, LayoutPathSchema, LayoutPathSegment, LayoutPathSegmentSchema, LayoutRect, LayoutRectSchema, LayoutStructureElement, LayoutStructureElementSchema, LayoutSubpath, LayoutSubpathSchema, LayoutText, LayoutTextSchema } from "./layout.js";
4
4
  import { t as GlyphInkBounds } from "./glyph-bounds-BV_Z40KS.js";
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as STANDARD_METRICS } from "./afm-widths-p3UfaXme.js";
1
+ import { t as STANDARD_METRICS } from "./afm-widths-BNI8qa2S.js";
2
2
  import { decodeCcittFax } from "./image/ccitt.js";
3
3
  import { Jbig2ParseError, Jbig2UnsupportedError } from "./image/jbig2-errors.js";
4
4
  import { decodeJbig2Embedded } from "./image/jbig2.js";
package/dist/measure.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_afm_widths = require("./afm-widths-C6U0SQj9.cjs");
2
+ const require_afm_widths = require("./afm-widths-sjaRvmQX.cjs");
3
3
  const require_embedded_font = require("./embedded-font.cjs");
4
4
  const require_font_registry = require("./font-registry.cjs");
5
5
  //#region src/measure.ts
package/dist/measure.js CHANGED
@@ -1,4 +1,4 @@
1
- import { s as encodeForShow, t as STANDARD_METRICS } from "./afm-widths-p3UfaXme.js";
1
+ import { c as encodeForShow, t as STANDARD_METRICS } from "./afm-widths-BNI8qa2S.js";
2
2
  import { encodeForShowEmbedded } from "./embedded-font.js";
3
3
  import { resolveFaceWithRegistry } from "./font-registry.js";
4
4
  //#region src/measure.ts
package/dist/winansi.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_afm_widths = require("./afm-widths-C6U0SQj9.cjs");
2
+ const require_afm_widths = require("./afm-widths-sjaRvmQX.cjs");
3
3
  exports.encodeForShow = require_afm_widths.encodeForShow;
4
4
  exports.sanitizeToWinAnsi = require_afm_widths.sanitizeToWinAnsi;
5
5
  exports.winAnsiCodeToUnicode = require_afm_widths.winAnsiCodeToUnicode;
@@ -1,4 +1,4 @@
1
- import { r as StandardFontName } from "./afm-widths-CneRyu5l.cjs";
1
+ import { r as StandardFontName } from "./afm-widths-D0Lu9kLv.cjs";
2
2
  //#region src/winansi.d.ts
3
3
  declare function winAnsiCodeToUnicode(code: number): number | undefined;
4
4
  interface WinAnsiSubstitution {
package/dist/winansi.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { r as StandardFontName } from "./afm-widths-CneRyu5l.js";
1
+ import { r as StandardFontName } from "./afm-widths-D0Lu9kLv.js";
2
2
  //#region src/winansi.d.ts
3
3
  declare function winAnsiCodeToUnicode(code: number): number | undefined;
4
4
  interface WinAnsiSubstitution {
package/dist/winansi.js CHANGED
@@ -1,2 +1,2 @@
1
- import { c as sanitizeToWinAnsi, l as winAnsiCodeToUnicode, s as encodeForShow } from "./afm-widths-p3UfaXme.js";
1
+ import { c as encodeForShow, l as sanitizeToWinAnsi, u as winAnsiCodeToUnicode } from "./afm-widths-BNI8qa2S.js";
2
2
  export { encodeForShow, sanitizeToWinAnsi, winAnsiCodeToUnicode };
package/dist/write.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_afm_widths = require("./afm-widths-C6U0SQj9.cjs");
2
+ const require_afm_widths = require("./afm-widths-sjaRvmQX.cjs");
3
3
  const require_objects = require("./objects.cjs");
4
4
  const require_bytes_writer = require("./bytes/writer.cjs");
5
5
  const require_serialize = require("./serialize.cjs");
package/dist/write.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as widthOfCode, t as STANDARD_METRICS } from "./afm-widths-p3UfaXme.js";
1
+ import { r as widthOfCode, t as STANDARD_METRICS } from "./afm-widths-BNI8qa2S.js";
2
2
  import { pdfArray, pdfDict, pdfHexString, pdfLiteralString, pdfName, pdfNull, pdfNum, pdfRef, pdfStream } from "./objects.js";
3
3
  import { ByteWriter } from "./bytes/writer.js";
4
4
  import { writeObject } from "./serialize.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pdf-codec",
3
- "version": "5.3.30",
3
+ "version": "5.3.31",
4
4
  "description": "Hand-written, dependency-minimal PDF codec: parses arbitrary real-world PDFs and generates new ones, built on its own codec-owned LayoutDocument item model and Zod 4 codecs.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -100,7 +100,7 @@
100
100
  "packageManager": "pnpm@12.4.1+sha512.2e81e399d73fe8390dab25e06aa788ab7a5908248d2f5a370f82b481147a6a7a367bf8048f9a6fdb6460f21a66f0542dedb8b94ca2c8723596741920b1656d4c",
101
101
  "dependencies": {
102
102
  "byte-codec": "2.0.2",
103
- "document-schema.js": "7.16.0",
103
+ "document-schema.js": "7.16.1",
104
104
  "fflate": "0.8.3",
105
105
  "zod": "4.4.3"
106
106
  },