@jsxpdf/jsxpdf 0.0.1-alpha.0 → 0.0.1-alpha.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.
- package/dist/core.js +1286 -2
- package/dist/core.js.map +4 -4
- package/dist/index.js +10749 -80
- package/dist/index.js.map +4 -4
- package/dist/jsx-dev-runtime.js +18 -2
- package/dist/jsx-dev-runtime.js.map +3 -3
- package/dist/jsx-runtime.js +18 -2
- package/dist/jsx-runtime.js.map +3 -3
- package/dist/node.js +10824 -77
- package/dist/node.js.map +4 -4
- package/dist/standard-fonts.js +26 -2
- package/dist/standard-fonts.js.map +3 -3
- package/dist/vendor/fonts/LICENSE +102 -0
- package/dist/vendor/fonts/LiberationMono-Bold.ttf +0 -0
- package/dist/vendor/fonts/LiberationMono-BoldItalic.ttf +0 -0
- package/dist/vendor/fonts/LiberationMono-Italic.ttf +0 -0
- package/dist/vendor/fonts/LiberationMono-Regular.ttf +0 -0
- package/dist/vendor/fonts/LiberationSans-Bold.ttf +0 -0
- package/dist/vendor/fonts/LiberationSans-BoldItalic.ttf +0 -0
- package/dist/vendor/fonts/LiberationSans-Italic.ttf +0 -0
- package/dist/vendor/fonts/LiberationSans-Regular.ttf +0 -0
- package/dist/vendor/fonts/LiberationSerif-Bold.ttf +0 -0
- package/dist/vendor/fonts/LiberationSerif-BoldItalic.ttf +0 -0
- package/dist/vendor/fonts/LiberationSerif-Italic.ttf +0 -0
- package/dist/vendor/fonts/LiberationSerif-Regular.ttf +0 -0
- package/dist/vendor/fonts/README.md +27 -0
- package/package.json +6 -2
package/dist/core.js
CHANGED
|
@@ -1,3 +1,1287 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
|
|
1
|
+
// ../core/src/binary.ts
|
|
2
|
+
var isArrayBuffer = (value) => typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer;
|
|
3
|
+
var isBinaryInput = (value) => value instanceof Uint8Array || isArrayBuffer(value);
|
|
4
|
+
var unwrapImageSource = (source) => {
|
|
5
|
+
if (source == null || typeof source === "string" || isBinaryInput(source)) return source;
|
|
6
|
+
if (typeof source !== "object") return source;
|
|
7
|
+
const record = source;
|
|
8
|
+
if (typeof record.uri === "string") return record.uri;
|
|
9
|
+
if (typeof record.url === "string") return record.url;
|
|
10
|
+
if (typeof record.src === "string") return record.src;
|
|
11
|
+
if (record.data != null) return unwrapImageSource(record.data);
|
|
12
|
+
return source;
|
|
13
|
+
};
|
|
14
|
+
var toUint8Array = (value) => value instanceof Uint8Array ? value : new Uint8Array(value);
|
|
15
|
+
var base64ToBytes = (value) => {
|
|
16
|
+
if (typeof Buffer !== "undefined") {
|
|
17
|
+
const buffer = Buffer.from(value, "base64");
|
|
18
|
+
const bytes2 = new Uint8Array(buffer.byteLength);
|
|
19
|
+
bytes2.set(buffer);
|
|
20
|
+
return bytes2;
|
|
21
|
+
}
|
|
22
|
+
const decoded = atob(value);
|
|
23
|
+
const bytes = new Uint8Array(decoded.length);
|
|
24
|
+
for (let index = 0; index < decoded.length; index += 1) {
|
|
25
|
+
bytes[index] = decoded.charCodeAt(index);
|
|
26
|
+
}
|
|
27
|
+
return bytes;
|
|
28
|
+
};
|
|
29
|
+
var base64ToText = (value) => new TextDecoder().decode(base64ToBytes(value));
|
|
30
|
+
var bytesToBase64 = (value) => {
|
|
31
|
+
if (typeof Buffer !== "undefined") {
|
|
32
|
+
return Buffer.from(value).toString("base64");
|
|
33
|
+
}
|
|
34
|
+
let binary = "";
|
|
35
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
36
|
+
binary += String.fromCharCode(value[index]);
|
|
37
|
+
}
|
|
38
|
+
return btoa(binary);
|
|
39
|
+
};
|
|
40
|
+
var concatUint8Arrays = (chunks) => {
|
|
41
|
+
const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0);
|
|
42
|
+
const merged = new Uint8Array(totalLength);
|
|
43
|
+
let offset = 0;
|
|
44
|
+
for (const chunk of chunks) {
|
|
45
|
+
merged.set(chunk, offset);
|
|
46
|
+
offset += chunk.length;
|
|
47
|
+
}
|
|
48
|
+
return merged;
|
|
49
|
+
};
|
|
50
|
+
var readUint32BE = (value, offset) => new DataView(value.buffer, value.byteOffset, value.byteLength).getUint32(offset, false);
|
|
51
|
+
|
|
52
|
+
// ../core/src/binding.ts
|
|
53
|
+
var BINDING_TOKEN_SYMBOL = /* @__PURE__ */ Symbol.for("jsxpdf.bindingToken");
|
|
54
|
+
var BINDING_MARKER_PREFIX = "jsxpdf.binding:";
|
|
55
|
+
var BINDING_MARKER_SUFFIX = "";
|
|
56
|
+
var DEFAULT_BINDING_PRIMITIVE = "";
|
|
57
|
+
var DEFAULT_SCHEMA_NUMBER = 999;
|
|
58
|
+
var encodeBindingPath = (path) => {
|
|
59
|
+
const json = JSON.stringify(path);
|
|
60
|
+
return bytesToBase64(new TextEncoder().encode(json));
|
|
61
|
+
};
|
|
62
|
+
var decodeBindingPath = (encoded) => {
|
|
63
|
+
try {
|
|
64
|
+
const json = base64ToText(encoded);
|
|
65
|
+
const parsed = JSON.parse(json);
|
|
66
|
+
return Array.isArray(parsed) ? parsed : null;
|
|
67
|
+
} catch {
|
|
68
|
+
return null;
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
var serializeBindingMarker = (path) => `${BINDING_MARKER_PREFIX}${encodeBindingPath(path)}${BINDING_MARKER_SUFFIX}`;
|
|
72
|
+
var parseBindingTemplateString = (value) => {
|
|
73
|
+
if (!value.includes(BINDING_MARKER_PREFIX)) return null;
|
|
74
|
+
const parts = [];
|
|
75
|
+
let cursor = 0;
|
|
76
|
+
while (cursor < value.length) {
|
|
77
|
+
const markerStart = value.indexOf(BINDING_MARKER_PREFIX, cursor);
|
|
78
|
+
if (markerStart < 0) {
|
|
79
|
+
if (cursor < value.length) parts.push({ type: "text", value: value.slice(cursor) });
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
if (markerStart > cursor) {
|
|
83
|
+
parts.push({ type: "text", value: value.slice(cursor, markerStart) });
|
|
84
|
+
}
|
|
85
|
+
const encodedStart = markerStart + BINDING_MARKER_PREFIX.length;
|
|
86
|
+
const markerEnd = value.indexOf(BINDING_MARKER_SUFFIX, encodedStart);
|
|
87
|
+
if (markerEnd < 0) return null;
|
|
88
|
+
const path = decodeBindingPath(value.slice(encodedStart, markerEnd));
|
|
89
|
+
if (!path) return null;
|
|
90
|
+
parts.push({ type: "binding", path });
|
|
91
|
+
cursor = markerEnd + BINDING_MARKER_SUFFIX.length;
|
|
92
|
+
}
|
|
93
|
+
return parts.some((part) => part.type === "binding") ? parts : null;
|
|
94
|
+
};
|
|
95
|
+
var createBindingToken = (path, value = DEFAULT_BINDING_PRIMITIVE, onAccess, templateString = false) => {
|
|
96
|
+
const target = {
|
|
97
|
+
[BINDING_TOKEN_SYMBOL]: true,
|
|
98
|
+
path: [...path],
|
|
99
|
+
value
|
|
100
|
+
};
|
|
101
|
+
return new Proxy(target, {
|
|
102
|
+
get(currentTarget, property, receiver) {
|
|
103
|
+
if (property === BINDING_TOKEN_SYMBOL || property === "path" || property === "value") {
|
|
104
|
+
return Reflect.get(currentTarget, property, receiver);
|
|
105
|
+
}
|
|
106
|
+
if (templateString && (property === "toLocaleDateString" || property === "toDateString" || property === "toLocaleString")) {
|
|
107
|
+
return () => serializeBindingMarker(currentTarget.path);
|
|
108
|
+
}
|
|
109
|
+
if (property === "toString") {
|
|
110
|
+
return () => templateString ? serializeBindingMarker(currentTarget.path) : String(currentTarget.value ?? DEFAULT_BINDING_PRIMITIVE);
|
|
111
|
+
}
|
|
112
|
+
if (property === "valueOf") {
|
|
113
|
+
return () => templateString ? DEFAULT_SCHEMA_NUMBER : currentTarget.value ?? DEFAULT_BINDING_PRIMITIVE;
|
|
114
|
+
}
|
|
115
|
+
if (property === Symbol.toPrimitive) {
|
|
116
|
+
return (hint) => templateString ? hint === "number" ? DEFAULT_SCHEMA_NUMBER : serializeBindingMarker(currentTarget.path) : currentTarget.value ?? DEFAULT_BINDING_PRIMITIVE;
|
|
117
|
+
}
|
|
118
|
+
if (typeof property === "symbol") return Reflect.get(currentTarget, property, receiver);
|
|
119
|
+
const nextPath = [...currentTarget.path, property];
|
|
120
|
+
onAccess?.(nextPath);
|
|
121
|
+
return createBindingToken(nextPath, DEFAULT_BINDING_PRIMITIVE, onAccess, templateString);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
var isBindingToken = (value) => {
|
|
126
|
+
return Boolean(value && typeof value === "object" && value[BINDING_TOKEN_SYMBOL] === true);
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
// ../core/src/color.ts
|
|
130
|
+
import colorString from "color-string";
|
|
131
|
+
var clampOpacity = (value) => {
|
|
132
|
+
if (value == null || Number.isNaN(value)) return 1;
|
|
133
|
+
return Math.max(0, Math.min(1, value));
|
|
134
|
+
};
|
|
135
|
+
var RESOLVE_COLOR_CACHE_LIMIT = 2048;
|
|
136
|
+
var resolveColorCache = /* @__PURE__ */ new Map();
|
|
137
|
+
var resolveColor = (input, fallback = "#000000") => {
|
|
138
|
+
if (!input) return { value: fallback, opacity: 1 };
|
|
139
|
+
const cached = resolveColorCache.get(input);
|
|
140
|
+
if (cached) return cached;
|
|
141
|
+
const parsed = colorString.get(input);
|
|
142
|
+
let resolved;
|
|
143
|
+
if (!parsed) {
|
|
144
|
+
resolved = { value: input, opacity: 1 };
|
|
145
|
+
} else if (parsed.model === "rgb") {
|
|
146
|
+
const [red, green, blue, alpha] = parsed.value;
|
|
147
|
+
resolved = {
|
|
148
|
+
value: colorString.to.hex(red, green, blue) ?? input,
|
|
149
|
+
opacity: clampOpacity(alpha)
|
|
150
|
+
};
|
|
151
|
+
} else {
|
|
152
|
+
const rgb = colorString.to.rgb(...parsed.value);
|
|
153
|
+
const parsedRgb = rgb ? colorString.get(rgb) : null;
|
|
154
|
+
if (!parsedRgb || parsedRgb.model !== "rgb") {
|
|
155
|
+
resolved = { value: input, opacity: 1 };
|
|
156
|
+
} else {
|
|
157
|
+
const [red, green, blue, alpha] = parsedRgb.value;
|
|
158
|
+
resolved = {
|
|
159
|
+
value: colorString.to.hex(red, green, blue) ?? input,
|
|
160
|
+
opacity: clampOpacity(alpha)
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
if (resolveColorCache.size >= RESOLVE_COLOR_CACHE_LIMIT) {
|
|
165
|
+
resolveColorCache = /* @__PURE__ */ new Map();
|
|
166
|
+
}
|
|
167
|
+
resolveColorCache.set(input, resolved);
|
|
168
|
+
return resolved;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
// ../core/src/vendor/base14-font-metrics.json
|
|
172
|
+
var base14_font_metrics_default = { Courier: { ascender: 629, descender: -157, capHeight: 562, xHeight: 426, lineGap: 269, widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 600, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 600, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0], names: [".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", ".notdef", "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", "Zcaron", ".notdef", ".notdef", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", ".notdef", "zcaron", "ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis\\"] }, "Courier-Bold": { ascender: 629, descender: -157, capHeight: 562, xHeight: 439, lineGap: 265, widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 600, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 600, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0], names: [".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", ".notdef", "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", "Zcaron", ".notdef", ".notdef", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", ".notdef", "zcaron", "ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis\\"] }, "Courier-Oblique": { ascender: 629, descender: -157, capHeight: 562, xHeight: 426, lineGap: 269, widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 600, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 600, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0], names: [".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", ".notdef", "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", "Zcaron", ".notdef", ".notdef", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", ".notdef", "zcaron", "ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis\\"] }, "Courier-BoldOblique": { ascender: 629, descender: -157, capHeight: 562, xHeight: 439, lineGap: 265, widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 600, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 600, 0, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 0], names: [".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", ".notdef", "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", "Zcaron", ".notdef", ".notdef", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", ".notdef", "zcaron", "ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis\\"] }, Helvetica: { ascender: 718, descender: -207, capHeight: 718, xHeight: 523, lineGap: 231, widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 0, 556, 0, 222, 556, 333, 1e3, 556, 556, 333, 1e3, 667, 333, 1e3, 0, 611, 0, 0, 222, 222, 333, 333, 350, 556, 1e3, 333, 1e3, 500, 333, 944, 0, 500, 500, 278, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 333, 737, 333, 400, 584, 333, 333, 333, 556, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1e3, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 584, 611, 556, 556, 556, 556, 500, 556, 0], names: [".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", ".notdef", "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", "Zcaron", ".notdef", ".notdef", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", ".notdef", "zcaron", "ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis\\"] }, "Helvetica-Bold": { ascender: 718, descender: -207, capHeight: 718, xHeight: 532, lineGap: 265, widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 0, 556, 0, 278, 556, 500, 1e3, 556, 556, 333, 1e3, 667, 333, 1e3, 0, 611, 0, 0, 278, 278, 500, 500, 350, 556, 1e3, 333, 1e3, 556, 333, 944, 0, 500, 556, 278, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 333, 737, 333, 400, 584, 333, 333, 333, 611, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1e3, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 584, 611, 611, 611, 611, 611, 556, 611, 0], names: [".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", ".notdef", "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", "Zcaron", ".notdef", ".notdef", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", ".notdef", "zcaron", "ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis\\"] }, "Helvetica-Oblique": { ascender: 718, descender: -207, capHeight: 718, xHeight: 523, lineGap: 231, widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 0, 556, 0, 222, 556, 333, 1e3, 556, 556, 333, 1e3, 667, 333, 1e3, 0, 611, 0, 0, 222, 222, 333, 333, 350, 556, 1e3, 333, 1e3, 500, 333, 944, 0, 500, 500, 278, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 333, 737, 333, 400, 584, 333, 333, 333, 556, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1e3, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 584, 611, 556, 556, 556, 556, 500, 556, 0], names: [".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", ".notdef", "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", "Zcaron", ".notdef", ".notdef", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", ".notdef", "zcaron", "ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis\\"] }, "Helvetica-BoldOblique": { ascender: 718, descender: -207, capHeight: 718, xHeight: 532, lineGap: 265, widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 0, 556, 0, 278, 556, 500, 1e3, 556, 556, 333, 1e3, 667, 333, 1e3, 0, 611, 0, 0, 278, 278, 500, 500, 350, 556, 1e3, 333, 1e3, 556, 333, 944, 0, 500, 556, 278, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 333, 737, 333, 400, 584, 333, 333, 333, 611, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1e3, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 584, 611, 611, 611, 611, 611, 556, 611, 0], names: [".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", ".notdef", "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", "Zcaron", ".notdef", ".notdef", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", ".notdef", "zcaron", "ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis\\"] }, "Times-Roman": { ascender: 683, descender: -217, capHeight: 662, xHeight: 450, lineGap: 216, widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 408, 500, 500, 833, 778, 180, 333, 333, 500, 564, 250, 333, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 278, 278, 564, 564, 564, 444, 921, 722, 667, 667, 722, 611, 556, 722, 722, 333, 389, 722, 611, 889, 722, 722, 556, 722, 667, 556, 611, 722, 722, 944, 722, 722, 611, 333, 278, 333, 469, 500, 333, 444, 500, 444, 500, 444, 333, 500, 500, 278, 278, 500, 278, 778, 500, 500, 500, 500, 333, 389, 278, 500, 500, 722, 500, 500, 444, 480, 200, 480, 541, 0, 500, 0, 333, 500, 444, 1e3, 500, 500, 333, 1e3, 556, 333, 889, 0, 611, 0, 0, 333, 333, 444, 444, 350, 500, 1e3, 333, 980, 389, 333, 722, 0, 444, 500, 250, 333, 500, 500, 500, 500, 200, 500, 333, 760, 276, 500, 564, 333, 760, 333, 400, 564, 300, 300, 333, 500, 453, 250, 333, 300, 310, 500, 750, 750, 750, 444, 722, 722, 722, 722, 722, 722, 889, 667, 611, 611, 611, 611, 333, 333, 333, 333, 722, 722, 722, 722, 722, 722, 722, 564, 722, 722, 722, 722, 722, 722, 556, 500, 444, 444, 444, 444, 444, 444, 667, 444, 444, 444, 444, 444, 278, 278, 278, 278, 500, 500, 500, 500, 500, 500, 500, 564, 500, 500, 500, 500, 500, 500, 500, 0], names: [".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", ".notdef", "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", "Zcaron", ".notdef", ".notdef", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", ".notdef", "zcaron", "ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis\\"] }, "Times-Bold": { ascender: 683, descender: -217, capHeight: 676, xHeight: 461, lineGap: 253, widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 555, 500, 500, 1e3, 833, 278, 333, 333, 500, 570, 250, 333, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 570, 570, 570, 500, 930, 722, 667, 722, 722, 667, 611, 778, 778, 389, 500, 778, 667, 944, 722, 778, 611, 778, 722, 556, 667, 722, 722, 1e3, 722, 722, 667, 333, 278, 333, 581, 500, 333, 500, 556, 444, 556, 444, 333, 500, 556, 278, 333, 556, 278, 833, 556, 500, 556, 556, 444, 389, 333, 556, 500, 722, 500, 500, 444, 394, 220, 394, 520, 0, 500, 0, 333, 500, 500, 1e3, 500, 500, 333, 1e3, 556, 333, 1e3, 0, 667, 0, 0, 333, 333, 500, 500, 350, 500, 1e3, 333, 1e3, 389, 333, 722, 0, 444, 500, 250, 333, 500, 500, 500, 500, 220, 500, 333, 747, 300, 500, 570, 333, 747, 333, 400, 570, 300, 300, 333, 556, 540, 250, 333, 300, 330, 500, 750, 750, 750, 500, 722, 722, 722, 722, 722, 722, 1e3, 722, 667, 667, 667, 667, 389, 389, 389, 389, 722, 722, 778, 778, 778, 778, 778, 570, 778, 722, 722, 722, 722, 722, 611, 556, 500, 500, 500, 500, 500, 500, 722, 444, 444, 444, 444, 444, 278, 278, 278, 278, 500, 556, 500, 500, 500, 500, 500, 570, 500, 556, 556, 556, 556, 500, 556, 0], names: [".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", ".notdef", "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", "Zcaron", ".notdef", ".notdef", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", ".notdef", "zcaron", "ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis\\"] }, "Times-Italic": { ascender: 683, descender: -217, capHeight: 653, xHeight: 441, lineGap: 200, widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 420, 500, 500, 833, 778, 214, 333, 333, 500, 675, 250, 333, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 675, 675, 675, 500, 920, 611, 611, 667, 722, 611, 611, 722, 722, 333, 444, 667, 556, 833, 667, 722, 611, 722, 611, 500, 556, 722, 611, 833, 611, 556, 556, 389, 278, 389, 422, 500, 333, 500, 500, 444, 500, 444, 278, 500, 500, 278, 278, 444, 278, 722, 500, 500, 500, 500, 389, 389, 278, 500, 444, 667, 444, 444, 389, 400, 275, 400, 541, 0, 500, 0, 333, 500, 556, 889, 500, 500, 333, 1e3, 500, 333, 944, 0, 556, 0, 0, 333, 333, 556, 556, 350, 500, 889, 333, 980, 389, 333, 667, 0, 389, 444, 250, 389, 500, 500, 500, 500, 275, 500, 333, 760, 276, 500, 675, 333, 760, 333, 400, 675, 300, 300, 333, 500, 523, 250, 333, 300, 310, 500, 750, 750, 750, 500, 611, 611, 611, 611, 611, 611, 889, 667, 611, 611, 611, 611, 333, 333, 333, 333, 722, 667, 722, 722, 722, 722, 722, 675, 722, 722, 722, 722, 722, 556, 611, 500, 500, 500, 500, 500, 500, 500, 667, 444, 444, 444, 444, 444, 278, 278, 278, 278, 500, 500, 500, 500, 500, 500, 500, 675, 500, 500, 500, 500, 500, 444, 500, 0], names: [".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", ".notdef", "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", "Zcaron", ".notdef", ".notdef", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", ".notdef", "zcaron", "ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis\\"] }, "Times-BoldItalic": { ascender: 683, descender: -217, capHeight: 669, xHeight: 462, lineGap: 239, widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 389, 555, 500, 500, 833, 778, 278, 333, 333, 500, 570, 250, 333, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 333, 333, 570, 570, 570, 500, 832, 667, 667, 667, 722, 667, 667, 722, 778, 389, 500, 667, 611, 889, 722, 722, 611, 722, 667, 556, 611, 722, 667, 889, 667, 611, 611, 333, 278, 333, 570, 500, 333, 500, 500, 444, 500, 444, 333, 500, 556, 278, 278, 500, 278, 778, 556, 500, 500, 500, 389, 389, 278, 556, 444, 667, 500, 444, 389, 348, 220, 348, 570, 0, 500, 0, 333, 500, 500, 1e3, 500, 500, 333, 1e3, 556, 333, 944, 0, 611, 0, 0, 333, 333, 500, 500, 350, 500, 1e3, 333, 1e3, 389, 333, 722, 0, 389, 444, 250, 389, 500, 500, 500, 500, 220, 500, 333, 747, 266, 500, 606, 333, 747, 333, 400, 570, 300, 300, 333, 576, 500, 250, 333, 300, 300, 500, 750, 750, 750, 500, 667, 667, 667, 667, 667, 667, 944, 667, 667, 667, 667, 667, 389, 389, 389, 389, 722, 722, 722, 722, 722, 722, 722, 570, 722, 722, 722, 722, 722, 611, 611, 500, 500, 500, 500, 500, 500, 500, 722, 444, 444, 444, 444, 444, 278, 278, 278, 278, 500, 556, 500, 500, 500, 500, 500, 570, 500, 556, 556, 556, 556, 444, 500, 0], names: [".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", ".notdef", "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", "Zcaron", ".notdef", ".notdef", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", ".notdef", "zcaron", "ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis\\"] }, Symbol: { ascender: 0, descender: 0, capHeight: 0, xHeight: 0, lineGap: 1303, widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 333, 0, 500, 0, 833, 778, 0, 333, 333, 0, 549, 250, 0, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 278, 278, 549, 549, 549, 444, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 333, 0, 333, 0, 500, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 480, 200, 480, 0, 0, 750, 0, 0, 500, 0, 1e3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 460, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 250, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 713, 0, 0, 0, 400, 549, 0, 0, 0, 576, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 549, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 549, 0, 0, 0, 0, 0, 0, 0, 0], names: [".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", ".notdef", "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", "Zcaron", ".notdef", ".notdef", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", ".notdef", "zcaron", "ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis\\"] }, ZapfDingbats: { ascender: 0, descender: 0, capHeight: 0, xHeight: 0, lineGap: 963, widths: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 278, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], names: [".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", ".notdef", "Euro", ".notdef", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", ".notdef", "Zcaron", ".notdef", ".notdef", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", ".notdef", "zcaron", "ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis\\"] } };
|
|
173
|
+
|
|
174
|
+
// ../core/src/font.ts
|
|
175
|
+
var FONT_WEIGHT_KEYWORDS = /* @__PURE__ */ new Set([
|
|
176
|
+
"thin",
|
|
177
|
+
"ultralight",
|
|
178
|
+
"light",
|
|
179
|
+
"normal",
|
|
180
|
+
"medium",
|
|
181
|
+
"semibold",
|
|
182
|
+
"bold",
|
|
183
|
+
"ultrabold",
|
|
184
|
+
"heavy"
|
|
185
|
+
]);
|
|
186
|
+
var BUILTIN_PDF_FONTS = new Set(Object.keys(base14_font_metrics_default));
|
|
187
|
+
var BASE14_ALIASES = {};
|
|
188
|
+
for (const name of Object.keys(base14_font_metrics_default)) {
|
|
189
|
+
BASE14_ALIASES[name.toLowerCase().replaceAll("-", "")] = name;
|
|
190
|
+
}
|
|
191
|
+
var normalizeStandardFamily = (family) => BASE14_ALIASES[family.toLowerCase().replaceAll("-", "")] ?? family;
|
|
192
|
+
var VENDORED_FACE_FILES = {
|
|
193
|
+
Helvetica: "LiberationSans-Regular.ttf",
|
|
194
|
+
"Helvetica-Bold": "LiberationSans-Bold.ttf",
|
|
195
|
+
"Helvetica-Oblique": "LiberationSans-Italic.ttf",
|
|
196
|
+
"Helvetica-BoldOblique": "LiberationSans-BoldItalic.ttf",
|
|
197
|
+
"Times-Roman": "LiberationSerif-Regular.ttf",
|
|
198
|
+
"Times-Bold": "LiberationSerif-Bold.ttf",
|
|
199
|
+
"Times-Italic": "LiberationSerif-Italic.ttf",
|
|
200
|
+
"Times-BoldItalic": "LiberationSerif-BoldItalic.ttf",
|
|
201
|
+
Courier: "LiberationMono-Regular.ttf",
|
|
202
|
+
"Courier-Bold": "LiberationMono-Bold.ttf",
|
|
203
|
+
"Courier-Oblique": "LiberationMono-Italic.ttf",
|
|
204
|
+
"Courier-BoldOblique": "LiberationMono-BoldItalic.ttf"
|
|
205
|
+
};
|
|
206
|
+
var vendoredFontUrl = (file) => new URL(`./vendor/fonts/${file}`, import.meta.url).href;
|
|
207
|
+
var resolveStandardFace = (family, fontWeight, fontStyle) => {
|
|
208
|
+
const normalized = normalizeStandardFamily(family);
|
|
209
|
+
if (!BUILTIN_PDF_FONTS.has(normalized)) return null;
|
|
210
|
+
if (/-(Bold|Oblique|Italic|BoldOblique|BoldItalic|Roman)$/.test(normalized)) return normalized;
|
|
211
|
+
const weightValue = typeof fontWeight === "number" ? fontWeight : {
|
|
212
|
+
thin: 100,
|
|
213
|
+
ultralight: 200,
|
|
214
|
+
light: 300,
|
|
215
|
+
normal: 400,
|
|
216
|
+
medium: 500,
|
|
217
|
+
semibold: 600,
|
|
218
|
+
bold: 700,
|
|
219
|
+
ultrabold: 800,
|
|
220
|
+
heavy: 900
|
|
221
|
+
}[fontWeight ?? "normal"] ?? 400;
|
|
222
|
+
const isBold = weightValue >= 600;
|
|
223
|
+
const isItalic = fontStyle === "italic" || fontStyle === "oblique";
|
|
224
|
+
const hasItalicName = /Italic/.test(normalized);
|
|
225
|
+
let suffix = "";
|
|
226
|
+
if (isBold && isItalic) suffix = hasItalicName ? "BoldItalic" : "BoldOblique";
|
|
227
|
+
else if (isBold) suffix = "Bold";
|
|
228
|
+
else if (isItalic) suffix = hasItalicName ? "Italic" : "Oblique";
|
|
229
|
+
if (suffix === "") return normalized;
|
|
230
|
+
const candidate = `${normalized}-${suffix}`;
|
|
231
|
+
return BUILTIN_PDF_FONTS.has(candidate) ? candidate : normalized;
|
|
232
|
+
};
|
|
233
|
+
var getStandardFontMetrics = (name) => {
|
|
234
|
+
const direct = base14_font_metrics_default[name];
|
|
235
|
+
if (direct) return direct;
|
|
236
|
+
return base14_font_metrics_default[BASE14_ALIASES[name.toLowerCase().replaceAll("-", "")]];
|
|
237
|
+
};
|
|
238
|
+
var fontkitPromise = null;
|
|
239
|
+
var loadFontkit = () => {
|
|
240
|
+
fontkitPromise ??= import("fontkit");
|
|
241
|
+
return fontkitPromise;
|
|
242
|
+
};
|
|
243
|
+
var normalizeFontWeight = (fontWeight) => {
|
|
244
|
+
if (typeof fontWeight === "number") return fontWeight;
|
|
245
|
+
return fontWeight && FONT_WEIGHT_KEYWORDS.has(fontWeight) ? fontWeight : void 0;
|
|
246
|
+
};
|
|
247
|
+
var toFontFamilyList = (fontFamily) => {
|
|
248
|
+
if (fontFamily == null) return [];
|
|
249
|
+
return Array.isArray(fontFamily) ? fontFamily : [fontFamily];
|
|
250
|
+
};
|
|
251
|
+
var FONT_WEIGHT_VALUE_BY_NAME = {
|
|
252
|
+
thin: 100,
|
|
253
|
+
ultralight: 200,
|
|
254
|
+
light: 300,
|
|
255
|
+
normal: 400,
|
|
256
|
+
medium: 500,
|
|
257
|
+
semibold: 600,
|
|
258
|
+
bold: 700,
|
|
259
|
+
ultrabold: 800,
|
|
260
|
+
heavy: 900
|
|
261
|
+
};
|
|
262
|
+
var weightDistance = (registered, requested) => {
|
|
263
|
+
if (requested == null || registered == null) return 0;
|
|
264
|
+
const a = typeof registered === "number" ? registered : FONT_WEIGHT_VALUE_BY_NAME[registered] ?? 400;
|
|
265
|
+
const b = typeof requested === "number" ? requested : FONT_WEIGHT_VALUE_BY_NAME[requested] ?? 400;
|
|
266
|
+
return Math.abs(a - b);
|
|
267
|
+
};
|
|
268
|
+
var isBrowserRuntime = () => typeof window !== "undefined" && typeof document !== "undefined";
|
|
269
|
+
var FontRegistry = class {
|
|
270
|
+
fonts = /* @__PURE__ */ new Map();
|
|
271
|
+
hyphenationCallback = null;
|
|
272
|
+
sourceCache = /* @__PURE__ */ new Map();
|
|
273
|
+
renderSourceCache = /* @__PURE__ */ new Map();
|
|
274
|
+
renderSourceBySrc = /* @__PURE__ */ new Map();
|
|
275
|
+
fontDataCache = /* @__PURE__ */ new Map();
|
|
276
|
+
fontDataMemo = /* @__PURE__ */ new Map();
|
|
277
|
+
binaryBySrc = /* @__PURE__ */ new Map();
|
|
278
|
+
descriptorKey(descriptor) {
|
|
279
|
+
const families = toFontFamilyList(descriptor.fontFamily).join(",");
|
|
280
|
+
const weight = normalizeFontWeight(descriptor.fontWeight);
|
|
281
|
+
const weightKey = weight == null || weight === "normal" || weight === 400 ? "" : String(weight);
|
|
282
|
+
const styleKey = !descriptor.fontStyle || descriptor.fontStyle === "normal" ? "" : descriptor.fontStyle;
|
|
283
|
+
return `${families}::${weightKey}::${styleKey}`;
|
|
284
|
+
}
|
|
285
|
+
register(font) {
|
|
286
|
+
this.sourceCache.clear();
|
|
287
|
+
this.renderSourceCache.clear();
|
|
288
|
+
this.renderSourceBySrc.clear();
|
|
289
|
+
this.fontDataCache.clear();
|
|
290
|
+
this.fontDataMemo.clear();
|
|
291
|
+
const entries = "fonts" in font ? font.fonts.map((entry) => ({ family: font.family, ...entry })) : [{ family: font.family, src: font.src, fontWeight: font.fontWeight, fontStyle: font.fontStyle }];
|
|
292
|
+
this.fonts.set(font.family, entries);
|
|
293
|
+
}
|
|
294
|
+
get(family) {
|
|
295
|
+
for (const entry of toFontFamilyList(family)) {
|
|
296
|
+
const resolved = this.fonts.get(entry)?.[0];
|
|
297
|
+
if (resolved) return resolved;
|
|
298
|
+
}
|
|
299
|
+
return void 0;
|
|
300
|
+
}
|
|
301
|
+
clear() {
|
|
302
|
+
this.fonts.clear();
|
|
303
|
+
this.hyphenationCallback = null;
|
|
304
|
+
this.sourceCache.clear();
|
|
305
|
+
this.renderSourceCache.clear();
|
|
306
|
+
this.renderSourceBySrc.clear();
|
|
307
|
+
this.fontDataCache.clear();
|
|
308
|
+
this.fontDataMemo.clear();
|
|
309
|
+
this.binaryBySrc.clear();
|
|
310
|
+
}
|
|
311
|
+
registerHyphenationCallback(callback) {
|
|
312
|
+
this.hyphenationCallback = callback;
|
|
313
|
+
}
|
|
314
|
+
getHyphenationCallback() {
|
|
315
|
+
return this.hyphenationCallback;
|
|
316
|
+
}
|
|
317
|
+
clearHyphenationCallback() {
|
|
318
|
+
this.hyphenationCallback = null;
|
|
319
|
+
}
|
|
320
|
+
/**
|
|
321
|
+
* Resolve and parse the best matching font face for a descriptor.
|
|
322
|
+
* Standard PDF base-14 faces resolve without any I/O; custom families are
|
|
323
|
+
* fetched/read and parsed with fontkit exactly once and then cached.
|
|
324
|
+
*/
|
|
325
|
+
async load(descriptor) {
|
|
326
|
+
let lastError;
|
|
327
|
+
for (const family of toFontFamilyList(descriptor.fontFamily)) {
|
|
328
|
+
try {
|
|
329
|
+
return await this.resolveFontData({
|
|
330
|
+
fontFamily: family,
|
|
331
|
+
fontWeight: descriptor.fontWeight,
|
|
332
|
+
fontStyle: descriptor.fontStyle
|
|
333
|
+
});
|
|
334
|
+
} catch (error) {
|
|
335
|
+
lastError = error;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
if (lastError) throw lastError;
|
|
339
|
+
throw new Error(
|
|
340
|
+
`Unable to load font for family "${toFontFamilyList(descriptor.fontFamily).join(", ")}". Register it with Font.register(...) first.`
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
getFontData(descriptor) {
|
|
344
|
+
const fullKey = this.descriptorKey(descriptor);
|
|
345
|
+
const memo = this.fontDataMemo.get(fullKey);
|
|
346
|
+
if (memo !== void 0) return memo;
|
|
347
|
+
const resolved = this.resolveFontDataSlow(descriptor);
|
|
348
|
+
this.fontDataMemo.set(fullKey, resolved);
|
|
349
|
+
return resolved;
|
|
350
|
+
}
|
|
351
|
+
resolveFontDataSlow(descriptor) {
|
|
352
|
+
const preloaded = this.fontDataCache.get(this.descriptorKey(descriptor));
|
|
353
|
+
if (preloaded && preloaded.kind === "embedded") return preloaded;
|
|
354
|
+
for (const family of toFontFamilyList(descriptor.fontFamily)) {
|
|
355
|
+
if (!this.fonts.has(family)) {
|
|
356
|
+
const face = resolveStandardFace(family, descriptor.fontWeight, descriptor.fontStyle);
|
|
357
|
+
if (face) {
|
|
358
|
+
return { kind: "standard", name: face, metrics: getStandardFontMetrics(face) };
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
const cached = this.fontDataCache.get(this.descriptorKey({ ...descriptor, fontFamily: family }));
|
|
362
|
+
if (cached) return cached;
|
|
363
|
+
}
|
|
364
|
+
for (const family of toFontFamilyList(descriptor.fontFamily)) {
|
|
365
|
+
const prefix = `${family}::`;
|
|
366
|
+
for (const [key, value] of this.fontDataCache) {
|
|
367
|
+
if (key.startsWith(prefix)) return value;
|
|
368
|
+
}
|
|
369
|
+
}
|
|
370
|
+
return null;
|
|
371
|
+
}
|
|
372
|
+
getSource(descriptor) {
|
|
373
|
+
const cacheKey = this.descriptorKey(descriptor);
|
|
374
|
+
if (this.sourceCache.has(cacheKey)) return this.sourceCache.get(cacheKey);
|
|
375
|
+
let source;
|
|
376
|
+
for (const family of toFontFamilyList(descriptor.fontFamily)) {
|
|
377
|
+
if (!this.fonts.has(family)) continue;
|
|
378
|
+
const registrations = this.fonts.get(family);
|
|
379
|
+
const requestedWeight = normalizeFontWeight(descriptor.fontWeight);
|
|
380
|
+
const requestedStyle = descriptor.fontStyle ?? "normal";
|
|
381
|
+
const best = registrations.map((registration, index) => ({
|
|
382
|
+
registration,
|
|
383
|
+
score: weightDistance(registration.fontWeight, requestedWeight) + ((registration.fontStyle ?? "normal") === requestedStyle ? 0 : 10) + index * 0.01
|
|
384
|
+
})).sort((a, b) => a.score - b.score)[0]?.registration;
|
|
385
|
+
if (best?.src) {
|
|
386
|
+
source = best.src;
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
if (source == null) {
|
|
391
|
+
for (const family of toFontFamilyList(descriptor.fontFamily)) {
|
|
392
|
+
if (this.fonts.has(family)) continue;
|
|
393
|
+
const face = resolveStandardFace(family, descriptor.fontWeight, descriptor.fontStyle);
|
|
394
|
+
const file = face ? VENDORED_FACE_FILES[face] : void 0;
|
|
395
|
+
if (file) {
|
|
396
|
+
source = vendoredFontUrl(file);
|
|
397
|
+
break;
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
this.sourceCache.set(cacheKey, source);
|
|
402
|
+
return source;
|
|
403
|
+
}
|
|
404
|
+
getRenderSource(descriptor) {
|
|
405
|
+
const cacheKey = this.descriptorKey(descriptor);
|
|
406
|
+
if (this.renderSourceCache.has(cacheKey)) return this.renderSourceCache.get(cacheKey);
|
|
407
|
+
const source = this.getSource(descriptor);
|
|
408
|
+
if (source == null) return void 0;
|
|
409
|
+
if (BUILTIN_PDF_FONTS.has(source)) {
|
|
410
|
+
this.renderSourceCache.set(cacheKey, source);
|
|
411
|
+
return source;
|
|
412
|
+
}
|
|
413
|
+
const cachedBySrc = this.renderSourceBySrc.get(source);
|
|
414
|
+
if (cachedBySrc) {
|
|
415
|
+
this.renderSourceCache.set(cacheKey, cachedBySrc);
|
|
416
|
+
return cachedBySrc;
|
|
417
|
+
}
|
|
418
|
+
if (isBrowserRuntime()) {
|
|
419
|
+
throw new Error(
|
|
420
|
+
`Font source "${source}" was not preloaded for browser rendering. Register the font with a browser-accessible URL or data URI before rendering.`
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
this.renderSourceCache.set(cacheKey, source);
|
|
424
|
+
return source;
|
|
425
|
+
}
|
|
426
|
+
async fetchBinary(source) {
|
|
427
|
+
const cached = this.binaryBySrc.get(source);
|
|
428
|
+
if (cached) return cached;
|
|
429
|
+
let bytes;
|
|
430
|
+
if (/^data:/.test(source)) {
|
|
431
|
+
const response = await fetch(source);
|
|
432
|
+
bytes = new Uint8Array(await response.arrayBuffer());
|
|
433
|
+
} else if (isBrowserRuntime()) {
|
|
434
|
+
const response = await fetch(source);
|
|
435
|
+
if (!response.ok) {
|
|
436
|
+
throw new Error(`Unable to load font from "${source}". Use a public URL, imported asset URL, or data URI.`);
|
|
437
|
+
}
|
|
438
|
+
bytes = new Uint8Array(await response.arrayBuffer());
|
|
439
|
+
} else {
|
|
440
|
+
const loadNodeFs = new Function("return import('node:fs/promises')");
|
|
441
|
+
const fsModule = await loadNodeFs();
|
|
442
|
+
bytes = new Uint8Array(await fsModule.readFile(source.startsWith("file:") ? new URL(source) : source));
|
|
443
|
+
}
|
|
444
|
+
this.binaryBySrc.set(source, bytes);
|
|
445
|
+
return bytes;
|
|
446
|
+
}
|
|
447
|
+
standardFromSrc(src, descriptor) {
|
|
448
|
+
if (!BUILTIN_PDF_FONTS.has(src)) return null;
|
|
449
|
+
const face = resolveStandardFace(src, descriptor.fontWeight, descriptor.fontStyle);
|
|
450
|
+
const metrics = face ? getStandardFontMetrics(face) : void 0;
|
|
451
|
+
return face && metrics ? { kind: "standard", name: face, metrics } : null;
|
|
452
|
+
}
|
|
453
|
+
async tryVendoredFace(family, descriptor) {
|
|
454
|
+
const face = resolveStandardFace(family, descriptor.fontWeight, descriptor.fontStyle);
|
|
455
|
+
const file = face ? VENDORED_FACE_FILES[face] : void 0;
|
|
456
|
+
const metrics = face ? getStandardFontMetrics(face) : void 0;
|
|
457
|
+
if (!face || !file || !metrics) return null;
|
|
458
|
+
const src = vendoredFontUrl(file);
|
|
459
|
+
try {
|
|
460
|
+
const bytes = await this.fetchBinary(src);
|
|
461
|
+
const fontkit = await loadFontkit();
|
|
462
|
+
const created = fontkit.create(bytes);
|
|
463
|
+
const font = Array.isArray(created.fonts) ? created.fonts[0] : created;
|
|
464
|
+
if (!font || typeof font.layout !== "function") return null;
|
|
465
|
+
const resolved = { kind: "embedded", src, font, metrics };
|
|
466
|
+
this.renderSourceBySrc.set(src, bytes);
|
|
467
|
+
return resolved;
|
|
468
|
+
} catch {
|
|
469
|
+
return null;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
async resolveFontData(descriptor) {
|
|
473
|
+
const cacheKey = this.descriptorKey(descriptor);
|
|
474
|
+
const cached = this.fontDataCache.get(cacheKey);
|
|
475
|
+
if (cached) return cached;
|
|
476
|
+
for (const family of toFontFamilyList(descriptor.fontFamily)) {
|
|
477
|
+
if (!this.fonts.has(family)) {
|
|
478
|
+
const vendored = await this.tryVendoredFace(family, descriptor);
|
|
479
|
+
if (vendored) {
|
|
480
|
+
this.fontDataCache.set(cacheKey, vendored);
|
|
481
|
+
return vendored;
|
|
482
|
+
}
|
|
483
|
+
const face = resolveStandardFace(family, descriptor.fontWeight, descriptor.fontStyle);
|
|
484
|
+
const metrics = face ? getStandardFontMetrics(face) : void 0;
|
|
485
|
+
if (face && metrics) {
|
|
486
|
+
const resolved2 = { kind: "standard", name: face, metrics };
|
|
487
|
+
this.fontDataCache.set(cacheKey, resolved2);
|
|
488
|
+
return resolved2;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
const src = this.getSource({ ...descriptor, fontFamily: family });
|
|
492
|
+
if (!src) continue;
|
|
493
|
+
const fromSrc = this.standardFromSrc(src, descriptor);
|
|
494
|
+
if (fromSrc) {
|
|
495
|
+
this.fontDataCache.set(cacheKey, fromSrc);
|
|
496
|
+
return fromSrc;
|
|
497
|
+
}
|
|
498
|
+
const bytes = await this.fetchBinary(src);
|
|
499
|
+
const fontkit = await loadFontkit();
|
|
500
|
+
const created = fontkit.create(bytes);
|
|
501
|
+
const font = Array.isArray(created.fonts) ? created.fonts[0] : created;
|
|
502
|
+
if (!font || typeof font.layout !== "function") {
|
|
503
|
+
throw new Error(`Unsupported font file for family "${family}": ${src}`);
|
|
504
|
+
}
|
|
505
|
+
const resolved = { kind: "embedded", src, font };
|
|
506
|
+
this.fontDataCache.set(this.descriptorKey({ ...descriptor, fontFamily: family }), resolved);
|
|
507
|
+
this.renderSourceBySrc.set(src, bytes);
|
|
508
|
+
return resolved;
|
|
509
|
+
}
|
|
510
|
+
throw new Error(
|
|
511
|
+
`Font family "${toFontFamilyList(descriptor.fontFamily).join(", ")}" is not registered. Register it with Font.register(...) before rendering, or use a built-in PDF font like Helvetica.`
|
|
512
|
+
);
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
var Font = new FontRegistry();
|
|
516
|
+
|
|
517
|
+
// ../core/src/primitives.ts
|
|
518
|
+
var Document = "DOCUMENT";
|
|
519
|
+
var Page = "PAGE";
|
|
520
|
+
var PageBreak = "PAGE_BREAK";
|
|
521
|
+
var View = "VIEW";
|
|
522
|
+
var Table = "TABLE";
|
|
523
|
+
var TableHead = "TABLE_HEAD";
|
|
524
|
+
var TableBody = "TABLE_BODY";
|
|
525
|
+
var TableRow = "TABLE_ROW";
|
|
526
|
+
var TableCell = "TABLE_CELL";
|
|
527
|
+
var TableFooter = "TABLE_FOOTER";
|
|
528
|
+
var Text = "TEXT";
|
|
529
|
+
var Image = "IMAGE";
|
|
530
|
+
var Link = "LINK";
|
|
531
|
+
var Note = "NOTE";
|
|
532
|
+
var Canvas = "CANVAS";
|
|
533
|
+
var FieldSet = "FIELD_SET";
|
|
534
|
+
var TextInput = "TEXT_INPUT";
|
|
535
|
+
var Select = "SELECT";
|
|
536
|
+
var Checkbox = "CHECKBOX";
|
|
537
|
+
var List = "LIST";
|
|
538
|
+
var Svg = "SVG";
|
|
539
|
+
var G = "G";
|
|
540
|
+
var Path = "PATH";
|
|
541
|
+
var Rect = "RECT";
|
|
542
|
+
var Line = "LINE";
|
|
543
|
+
var Circle = "CIRCLE";
|
|
544
|
+
var Ellipse = "ELLIPSE";
|
|
545
|
+
var Polygon = "POLYGON";
|
|
546
|
+
var Polyline = "POLYLINE";
|
|
547
|
+
var Defs = "DEFS";
|
|
548
|
+
var ClipPath = "CLIP_PATH";
|
|
549
|
+
var LinearGradient = "LINEAR_GRADIENT";
|
|
550
|
+
var RadialGradient = "RADIAL_GRADIENT";
|
|
551
|
+
var Stop = "STOP";
|
|
552
|
+
var Tspan = "TSPAN";
|
|
553
|
+
var TextInstance = "TEXT_INSTANCE";
|
|
554
|
+
|
|
555
|
+
// ../core/src/jsx.ts
|
|
556
|
+
var flattenChildren = (input) => {
|
|
557
|
+
if (!Array.isArray(input)) return [input];
|
|
558
|
+
const out = [];
|
|
559
|
+
const pending = [input];
|
|
560
|
+
while (pending.length > 0) {
|
|
561
|
+
const current = pending.pop();
|
|
562
|
+
if (Array.isArray(current)) {
|
|
563
|
+
for (let index = current.length - 1; index >= 0; index -= 1) pending.push(current[index]);
|
|
564
|
+
} else {
|
|
565
|
+
out.push(current);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
return out;
|
|
569
|
+
};
|
|
570
|
+
var createElement = (type, props, key) => {
|
|
571
|
+
const normalizedProps = props ?? {};
|
|
572
|
+
return {
|
|
573
|
+
type,
|
|
574
|
+
key,
|
|
575
|
+
props: normalizedProps
|
|
576
|
+
};
|
|
577
|
+
};
|
|
578
|
+
var materializeChildren = (children) => {
|
|
579
|
+
if (!Array.isArray(children)) {
|
|
580
|
+
return children === void 0 || children === false || children === null ? [] : [children];
|
|
581
|
+
}
|
|
582
|
+
let hasNested = false;
|
|
583
|
+
for (let index = 0; index < children.length; index += 1) {
|
|
584
|
+
if (Array.isArray(children[index])) {
|
|
585
|
+
hasNested = true;
|
|
586
|
+
break;
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
if (!hasNested) {
|
|
590
|
+
const out = [];
|
|
591
|
+
for (let index = 0; index < children.length; index += 1) {
|
|
592
|
+
const value = children[index];
|
|
593
|
+
if (value !== void 0 && value !== false && value !== null) out.push(value);
|
|
594
|
+
}
|
|
595
|
+
return out;
|
|
596
|
+
}
|
|
597
|
+
return flattenChildren(children).filter((value) => value !== void 0 && value !== false && value !== null);
|
|
598
|
+
};
|
|
599
|
+
var createTextElement = (value) => ({
|
|
600
|
+
type: TextInstance,
|
|
601
|
+
props: {
|
|
602
|
+
children: String(value)
|
|
603
|
+
}
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
// ../core/src/style.ts
|
|
607
|
+
var defaultBorder = () => ({ width: 0, color: "#000000", style: "solid" });
|
|
608
|
+
var BORDER_STYLE_TOKENS = /* @__PURE__ */ new Set(["solid", "dashed", "dotted", "none"]);
|
|
609
|
+
var FLEX_DEFAULTS = [1, 1, 0];
|
|
610
|
+
var FLEX_AUTO_DEFAULTS = [1, 1, "auto"];
|
|
611
|
+
var STYLE_CACHE_LIMIT = 4096;
|
|
612
|
+
var resolvedStyleCache = /* @__PURE__ */ new Map();
|
|
613
|
+
var serializedStyleValueCache = /* @__PURE__ */ new WeakMap();
|
|
614
|
+
var isPlainObject = (value) => {
|
|
615
|
+
if (typeof value !== "object" || value === null) return false;
|
|
616
|
+
const prototype = Object.getPrototypeOf(value);
|
|
617
|
+
return prototype === Object.prototype || prototype === null;
|
|
618
|
+
};
|
|
619
|
+
var stableSerializeStyleValue = (value) => {
|
|
620
|
+
if (value == null) return "null";
|
|
621
|
+
if (typeof value === "string") return `s:${value}`;
|
|
622
|
+
if (typeof value === "number") return Number.isFinite(value) ? `n:${value}` : null;
|
|
623
|
+
if (typeof value === "boolean") return value ? "b:1" : "b:0";
|
|
624
|
+
if (typeof value === "object") {
|
|
625
|
+
if (value.__jsxpdfInheritedTextStyle === true) {
|
|
626
|
+
return serializeInheritedTextStyle(value);
|
|
627
|
+
}
|
|
628
|
+
const cached = serializedStyleValueCache.get(value);
|
|
629
|
+
if (cached !== void 0) return cached;
|
|
630
|
+
const serialized = Array.isArray(value) ? serializeArrayParts(value) : isPlainObject(value) ? serializeObjectParts(value) : null;
|
|
631
|
+
serializedStyleValueCache.set(value, serialized);
|
|
632
|
+
return serialized;
|
|
633
|
+
}
|
|
634
|
+
return null;
|
|
635
|
+
};
|
|
636
|
+
var serializeInheritedTextStyle = (value) => {
|
|
637
|
+
const rawFontFamily = value.fontFamily;
|
|
638
|
+
const fontFamilyPart = Array.isArray(rawFontFamily) ? serializeArrayParts(rawFontFamily) : `${typeof rawFontFamily}:${String(rawFontFamily)}`;
|
|
639
|
+
return `i{fontSize:${typeof value.fontSize}:${value.fontSize}|lineHeight:${typeof value.lineHeight}:${value.lineHeight}|color:${typeof value.color}:${value.color}|fontFamily:${fontFamilyPart}|fontWeight:${typeof value.fontWeight}:${String(value.fontWeight)}|fontStyle:${typeof value.fontStyle}:${value.fontStyle}|letterSpacing:${typeof value.letterSpacing}:${value.letterSpacing}|opacity:${typeof value.opacity}:${value.opacity}|textDecoration:${typeof value.textDecoration}:${value.textDecoration}|textDecorationColor:${typeof value.textDecorationColor}:${value.textDecorationColor}|textDecorationStyle:${typeof value.textDecorationStyle}:${value.textDecorationStyle}|textAlign:${typeof value.textAlign}:${value.textAlign}|direction:${typeof value.direction}:${value.direction}|lang:${typeof value.lang}:${value.lang}}`;
|
|
640
|
+
};
|
|
641
|
+
var serializeArrayParts = (value) => {
|
|
642
|
+
let result = "[";
|
|
643
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
644
|
+
const serialized = stableSerializeStyleValue(value[index]);
|
|
645
|
+
if (serialized == null) return null;
|
|
646
|
+
if (index > 0) result += ",";
|
|
647
|
+
result += serialized;
|
|
648
|
+
}
|
|
649
|
+
return `${result}]`;
|
|
650
|
+
};
|
|
651
|
+
var serializeObjectParts = (value) => {
|
|
652
|
+
const keys = Object.keys(value).sort();
|
|
653
|
+
let result = "{";
|
|
654
|
+
for (let index = 0; index < keys.length; index += 1) {
|
|
655
|
+
const serialized = stableSerializeStyleValue(value[keys[index]]);
|
|
656
|
+
if (serialized == null) return null;
|
|
657
|
+
if (index > 0) result += ",";
|
|
658
|
+
result += `${keys[index]}:${serialized}`;
|
|
659
|
+
}
|
|
660
|
+
return `${result}}`;
|
|
661
|
+
};
|
|
662
|
+
var getResolvedStyleCacheKey = (styleInput, inheritedTextStyle) => {
|
|
663
|
+
const styleKey = stableSerializeStyleValue(styleInput ?? null);
|
|
664
|
+
const inheritedKey = stableSerializeStyleValue(inheritedTextStyle ?? null);
|
|
665
|
+
if (styleKey == null || inheritedKey == null) return null;
|
|
666
|
+
return `${styleKey}::${inheritedKey}`;
|
|
667
|
+
};
|
|
668
|
+
var toNumber = (value) => {
|
|
669
|
+
if (typeof value === "number") return value;
|
|
670
|
+
if (!value) return 0;
|
|
671
|
+
const parsed = Number.parseFloat(value);
|
|
672
|
+
return Number.isFinite(parsed) ? parsed : 0;
|
|
673
|
+
};
|
|
674
|
+
var parseFlexShorthand = (value) => {
|
|
675
|
+
if (value == null) return {};
|
|
676
|
+
const parts = value === "auto" ? [...FLEX_AUTO_DEFAULTS] : `${value}`.trim().split(/\s+/).filter(Boolean);
|
|
677
|
+
const flexGrow = Number.parseFloat(`${parts[0] ?? FLEX_DEFAULTS[0]}`);
|
|
678
|
+
const flexShrink = Number.parseFloat(`${parts[1] ?? FLEX_DEFAULTS[1]}`);
|
|
679
|
+
const flexBasis = parts[2] ?? FLEX_DEFAULTS[2];
|
|
680
|
+
return {
|
|
681
|
+
flexGrow: Number.isFinite(flexGrow) ? flexGrow : void 0,
|
|
682
|
+
flexShrink: Number.isFinite(flexShrink) ? flexShrink : void 0,
|
|
683
|
+
flexBasis
|
|
684
|
+
};
|
|
685
|
+
};
|
|
686
|
+
var parseBorderStyleToken = (value) => {
|
|
687
|
+
if (!value) return void 0;
|
|
688
|
+
const normalized = value.trim().toLowerCase();
|
|
689
|
+
return BORDER_STYLE_TOKENS.has(normalized) ? normalized : void 0;
|
|
690
|
+
};
|
|
691
|
+
var parseBorder = (value) => {
|
|
692
|
+
if (typeof value === "number") {
|
|
693
|
+
return { width: value, color: "#000000", style: "solid" };
|
|
694
|
+
}
|
|
695
|
+
if (!value) return defaultBorder();
|
|
696
|
+
const parts = value.trim().split(/\s+/).filter(Boolean);
|
|
697
|
+
let width = 0;
|
|
698
|
+
let color = "#000000";
|
|
699
|
+
let style = "solid";
|
|
700
|
+
let sawWidth = false;
|
|
701
|
+
for (const part of parts) {
|
|
702
|
+
const borderStyle = parseBorderStyleToken(part);
|
|
703
|
+
if (borderStyle) {
|
|
704
|
+
style = borderStyle;
|
|
705
|
+
continue;
|
|
706
|
+
}
|
|
707
|
+
if (!sawWidth && /^-?\d/.test(part)) {
|
|
708
|
+
width = toNumber(part);
|
|
709
|
+
sawWidth = true;
|
|
710
|
+
continue;
|
|
711
|
+
}
|
|
712
|
+
color = part;
|
|
713
|
+
}
|
|
714
|
+
if (!sawWidth && parts.length === 1 && !parseBorderStyleToken(parts[0])) {
|
|
715
|
+
width = toNumber(parts[0]);
|
|
716
|
+
}
|
|
717
|
+
if (style === "none") width = 0;
|
|
718
|
+
return { width, color, style };
|
|
719
|
+
};
|
|
720
|
+
var resolveLineHeight = (lineHeight, fontSize) => {
|
|
721
|
+
if (lineHeight > 0 && lineHeight <= 4) return lineHeight * fontSize;
|
|
722
|
+
return lineHeight;
|
|
723
|
+
};
|
|
724
|
+
var flattenStyle = (style) => {
|
|
725
|
+
if (!style) return {};
|
|
726
|
+
if (!Array.isArray(style)) return { ...style };
|
|
727
|
+
return style.reduce((acc, entry) => Object.assign(acc, flattenStyle(entry)), {});
|
|
728
|
+
};
|
|
729
|
+
var resolveStyle = (styleInput, inheritedTextStyle) => {
|
|
730
|
+
const cacheKey = getResolvedStyleCacheKey(styleInput, inheritedTextStyle);
|
|
731
|
+
if (cacheKey) {
|
|
732
|
+
const cached = resolvedStyleCache.get(cacheKey);
|
|
733
|
+
if (cached) return cached;
|
|
734
|
+
}
|
|
735
|
+
const flattenedStyle = flattenStyle(styleInput);
|
|
736
|
+
const flexShorthand = parseFlexShorthand(flattenedStyle.flex);
|
|
737
|
+
const style = { ...flattenedStyle, ...flexShorthand };
|
|
738
|
+
const marginVertical = toNumber(style.marginVertical ?? style.margin);
|
|
739
|
+
const marginHorizontal = toNumber(style.marginHorizontal ?? style.margin);
|
|
740
|
+
const paddingVertical = toNumber(style.paddingVertical ?? style.padding);
|
|
741
|
+
const paddingHorizontal = toNumber(style.paddingHorizontal ?? style.padding);
|
|
742
|
+
const border = parseBorder(style.border);
|
|
743
|
+
const borderTop = style.borderTop != null ? parseBorder(style.borderTop) : { ...border };
|
|
744
|
+
const borderRight = style.borderRight != null ? parseBorder(style.borderRight) : { ...border };
|
|
745
|
+
const borderBottom = style.borderBottom != null ? parseBorder(style.borderBottom) : { ...border };
|
|
746
|
+
const borderLeft = style.borderLeft != null ? parseBorder(style.borderLeft) : { ...border };
|
|
747
|
+
if (style.borderWidth != null) {
|
|
748
|
+
const width = toNumber(style.borderWidth);
|
|
749
|
+
if (style.borderTopWidth == null) borderTop.width = width;
|
|
750
|
+
if (style.borderRightWidth == null) borderRight.width = width;
|
|
751
|
+
if (style.borderBottomWidth == null) borderBottom.width = width;
|
|
752
|
+
if (style.borderLeftWidth == null) borderLeft.width = width;
|
|
753
|
+
}
|
|
754
|
+
if (style.borderTopWidth != null) borderTop.width = toNumber(style.borderTopWidth);
|
|
755
|
+
if (style.borderRightWidth != null) borderRight.width = toNumber(style.borderRightWidth);
|
|
756
|
+
if (style.borderBottomWidth != null) borderBottom.width = toNumber(style.borderBottomWidth);
|
|
757
|
+
if (style.borderLeftWidth != null) borderLeft.width = toNumber(style.borderLeftWidth);
|
|
758
|
+
const defaultBorderStyle = parseBorderStyleToken(style.borderStyle) ?? border.style ?? "solid";
|
|
759
|
+
borderTop.style = parseBorderStyleToken(style.borderTopStyle) ?? (style.borderTop != null ? borderTop.style : defaultBorderStyle) ?? "solid";
|
|
760
|
+
borderRight.style = parseBorderStyleToken(style.borderRightStyle) ?? (style.borderRight != null ? borderRight.style : defaultBorderStyle) ?? "solid";
|
|
761
|
+
borderBottom.style = parseBorderStyleToken(style.borderBottomStyle) ?? (style.borderBottom != null ? borderBottom.style : defaultBorderStyle) ?? "solid";
|
|
762
|
+
borderLeft.style = parseBorderStyleToken(style.borderLeftStyle) ?? (style.borderLeft != null ? borderLeft.style : defaultBorderStyle) ?? "solid";
|
|
763
|
+
borderTop.color = style.borderTopColor ?? style.borderColor ?? borderTop.color;
|
|
764
|
+
borderRight.color = style.borderRightColor ?? style.borderColor ?? borderRight.color;
|
|
765
|
+
borderBottom.color = style.borderBottomColor ?? style.borderColor ?? borderBottom.color;
|
|
766
|
+
borderLeft.color = style.borderLeftColor ?? style.borderColor ?? borderLeft.color;
|
|
767
|
+
const fontSize = style.fontSize ?? inheritedTextStyle?.fontSize ?? 12;
|
|
768
|
+
const hasExplicitLineHeight = style.lineHeight != null;
|
|
769
|
+
const lineHeight = style.lineHeight != null ? resolveLineHeight(style.lineHeight, fontSize) : style.fontSize != null ? fontSize : inheritedTextStyle?.lineHeight ?? fontSize;
|
|
770
|
+
const resolved = {
|
|
771
|
+
...style,
|
|
772
|
+
marginTop: toNumber(style.marginTop ?? marginVertical),
|
|
773
|
+
marginRight: toNumber(style.marginRight ?? marginHorizontal),
|
|
774
|
+
marginBottom: toNumber(style.marginBottom ?? marginVertical),
|
|
775
|
+
marginLeft: toNumber(style.marginLeft ?? marginHorizontal),
|
|
776
|
+
paddingTop: toNumber(style.paddingTop ?? paddingVertical),
|
|
777
|
+
paddingRight: toNumber(style.paddingRight ?? paddingHorizontal),
|
|
778
|
+
paddingBottom: toNumber(style.paddingBottom ?? paddingVertical),
|
|
779
|
+
paddingLeft: toNumber(style.paddingLeft ?? paddingHorizontal),
|
|
780
|
+
borderTop,
|
|
781
|
+
borderRight,
|
|
782
|
+
borderBottom,
|
|
783
|
+
borderLeft,
|
|
784
|
+
fontSize,
|
|
785
|
+
lineHeight,
|
|
786
|
+
flexDirection: style.flexDirection ?? "column",
|
|
787
|
+
color: style.color ?? inheritedTextStyle?.color ?? "#000000",
|
|
788
|
+
fontFamily: style.fontFamily ?? inheritedTextStyle?.fontFamily ?? "Helvetica",
|
|
789
|
+
fontWeight: style.fontWeight ?? inheritedTextStyle?.fontWeight,
|
|
790
|
+
fontStyle: style.fontStyle ?? inheritedTextStyle?.fontStyle ?? "normal",
|
|
791
|
+
letterSpacing: style.letterSpacing ?? inheritedTextStyle?.letterSpacing ?? 0,
|
|
792
|
+
opacity: style.opacity ?? inheritedTextStyle?.opacity ?? 1,
|
|
793
|
+
textDecoration: style.textDecoration ?? inheritedTextStyle?.textDecoration,
|
|
794
|
+
textDecorationColor: style.textDecorationColor ?? inheritedTextStyle?.textDecorationColor,
|
|
795
|
+
textDecorationStyle: style.textDecorationStyle ?? inheritedTextStyle?.textDecorationStyle,
|
|
796
|
+
textAlign: style.textAlign ?? inheritedTextStyle?.textAlign ?? "left",
|
|
797
|
+
direction: style.direction ?? inheritedTextStyle?.direction ?? "ltr",
|
|
798
|
+
lang: style.lang ?? inheritedTextStyle?.lang ?? void 0,
|
|
799
|
+
display: style.display ?? "flex",
|
|
800
|
+
hasExplicitLineHeight
|
|
801
|
+
};
|
|
802
|
+
if (cacheKey) {
|
|
803
|
+
if (resolvedStyleCache.size >= STYLE_CACHE_LIMIT) {
|
|
804
|
+
resolvedStyleCache = /* @__PURE__ */ new Map();
|
|
805
|
+
}
|
|
806
|
+
resolvedStyleCache.set(cacheKey, resolved);
|
|
807
|
+
}
|
|
808
|
+
return resolved;
|
|
809
|
+
};
|
|
810
|
+
var StyleSheet = {
|
|
811
|
+
create(styles) {
|
|
812
|
+
return styles;
|
|
813
|
+
}
|
|
814
|
+
};
|
|
815
|
+
var isPercent = (value) => typeof value === "string" && value.trim().endsWith("%");
|
|
816
|
+
var parseUnitValue = (value, dpi) => {
|
|
817
|
+
const match = /^(-?\d*\.?\d+)(in|mm|cm|pt|px)?$/i.exec(value.trim());
|
|
818
|
+
if (!match) return void 0;
|
|
819
|
+
const scalar = Number.parseFloat(match[1] ?? "");
|
|
820
|
+
if (!Number.isFinite(scalar)) return void 0;
|
|
821
|
+
switch ((match[2] ?? "pt").toLowerCase()) {
|
|
822
|
+
case "in":
|
|
823
|
+
return scalar * 72;
|
|
824
|
+
case "mm":
|
|
825
|
+
return scalar * (72 / 25.4);
|
|
826
|
+
case "cm":
|
|
827
|
+
return scalar * (72 / 2.54);
|
|
828
|
+
case "px":
|
|
829
|
+
return scalar * (72 / dpi);
|
|
830
|
+
default:
|
|
831
|
+
return scalar;
|
|
832
|
+
}
|
|
833
|
+
};
|
|
834
|
+
var parseSizeValue = (value, total, dpi = 72) => {
|
|
835
|
+
if (value == null) return void 0;
|
|
836
|
+
if (typeof value === "number") return value;
|
|
837
|
+
if (isPercent(value)) return Number.parseFloat(value) / 100 * total;
|
|
838
|
+
return parseUnitValue(value, dpi);
|
|
839
|
+
};
|
|
840
|
+
|
|
841
|
+
// ../core/src/node.ts
|
|
842
|
+
var DEFAULT_DYNAMIC_RENDER_CONTEXT = {
|
|
843
|
+
pageNumber: 999,
|
|
844
|
+
totalPages: 999
|
|
845
|
+
};
|
|
846
|
+
var STRING_NODE_TYPES = /* @__PURE__ */ new Set([
|
|
847
|
+
"DOCUMENT",
|
|
848
|
+
"PAGE",
|
|
849
|
+
"PAGE_BREAK",
|
|
850
|
+
"VIEW",
|
|
851
|
+
"TABLE",
|
|
852
|
+
"TABLE_HEAD",
|
|
853
|
+
"TABLE_BODY",
|
|
854
|
+
"TABLE_ROW",
|
|
855
|
+
"TABLE_CELL",
|
|
856
|
+
"TABLE_FOOTER",
|
|
857
|
+
"TEXT",
|
|
858
|
+
"IMAGE",
|
|
859
|
+
"LINK",
|
|
860
|
+
"NOTE",
|
|
861
|
+
"CANVAS",
|
|
862
|
+
"FIELD_SET",
|
|
863
|
+
"TEXT_INPUT",
|
|
864
|
+
"SELECT",
|
|
865
|
+
"CHECKBOX",
|
|
866
|
+
"LIST",
|
|
867
|
+
"SVG",
|
|
868
|
+
"G",
|
|
869
|
+
"PATH",
|
|
870
|
+
"RECT",
|
|
871
|
+
"LINE",
|
|
872
|
+
"CIRCLE",
|
|
873
|
+
"ELLIPSE",
|
|
874
|
+
"POLYGON",
|
|
875
|
+
"POLYLINE",
|
|
876
|
+
"DEFS",
|
|
877
|
+
"CLIP_PATH",
|
|
878
|
+
"LINEAR_GRADIENT",
|
|
879
|
+
"RADIAL_GRADIENT",
|
|
880
|
+
"STOP",
|
|
881
|
+
"TSPAN",
|
|
882
|
+
"ROOT",
|
|
883
|
+
"TEXT_INSTANCE"
|
|
884
|
+
]);
|
|
885
|
+
var isElement = (value) => {
|
|
886
|
+
return typeof value === "object" && value !== null && "type" in value && "props" in value;
|
|
887
|
+
};
|
|
888
|
+
var normalizeType = (type) => {
|
|
889
|
+
switch (type) {
|
|
890
|
+
case Document:
|
|
891
|
+
return "DOCUMENT";
|
|
892
|
+
case Page:
|
|
893
|
+
return "PAGE";
|
|
894
|
+
case PageBreak:
|
|
895
|
+
return "PAGE_BREAK";
|
|
896
|
+
case Table:
|
|
897
|
+
return "TABLE";
|
|
898
|
+
case TableHead:
|
|
899
|
+
return "TABLE_HEAD";
|
|
900
|
+
case TableBody:
|
|
901
|
+
return "TABLE_BODY";
|
|
902
|
+
case TableRow:
|
|
903
|
+
return "TABLE_ROW";
|
|
904
|
+
case TableCell:
|
|
905
|
+
return "TABLE_CELL";
|
|
906
|
+
case TableFooter:
|
|
907
|
+
return "TABLE_FOOTER";
|
|
908
|
+
case View:
|
|
909
|
+
return "VIEW";
|
|
910
|
+
case Text:
|
|
911
|
+
return "TEXT";
|
|
912
|
+
case Image:
|
|
913
|
+
return "IMAGE";
|
|
914
|
+
case Link:
|
|
915
|
+
return "LINK";
|
|
916
|
+
case Note:
|
|
917
|
+
return "NOTE";
|
|
918
|
+
case Canvas:
|
|
919
|
+
return "CANVAS";
|
|
920
|
+
case FieldSet:
|
|
921
|
+
return "FIELD_SET";
|
|
922
|
+
case TextInput:
|
|
923
|
+
return "TEXT_INPUT";
|
|
924
|
+
case Select:
|
|
925
|
+
return "SELECT";
|
|
926
|
+
case Checkbox:
|
|
927
|
+
return "CHECKBOX";
|
|
928
|
+
case List:
|
|
929
|
+
return "LIST";
|
|
930
|
+
case Svg:
|
|
931
|
+
return "SVG";
|
|
932
|
+
case G:
|
|
933
|
+
return "G";
|
|
934
|
+
case Path:
|
|
935
|
+
return "PATH";
|
|
936
|
+
case Rect:
|
|
937
|
+
return "RECT";
|
|
938
|
+
case Line:
|
|
939
|
+
return "LINE";
|
|
940
|
+
case Circle:
|
|
941
|
+
return "CIRCLE";
|
|
942
|
+
case Ellipse:
|
|
943
|
+
return "ELLIPSE";
|
|
944
|
+
case Polygon:
|
|
945
|
+
return "POLYGON";
|
|
946
|
+
case Polyline:
|
|
947
|
+
return "POLYLINE";
|
|
948
|
+
case Defs:
|
|
949
|
+
return "DEFS";
|
|
950
|
+
case ClipPath:
|
|
951
|
+
return "CLIP_PATH";
|
|
952
|
+
case LinearGradient:
|
|
953
|
+
return "LINEAR_GRADIENT";
|
|
954
|
+
case RadialGradient:
|
|
955
|
+
return "RADIAL_GRADIENT";
|
|
956
|
+
case Stop:
|
|
957
|
+
return "STOP";
|
|
958
|
+
case Tspan:
|
|
959
|
+
return "TSPAN";
|
|
960
|
+
case TextInstance:
|
|
961
|
+
return "TEXT_INSTANCE";
|
|
962
|
+
default: {
|
|
963
|
+
if (typeof type === "string") {
|
|
964
|
+
const normalized = type.includes("_") || type === type.toUpperCase() ? type : type.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/-/g, "_").toUpperCase();
|
|
965
|
+
if (STRING_NODE_TYPES.has(normalized)) return normalized;
|
|
966
|
+
}
|
|
967
|
+
throw new Error(`Unsupported node type: ${String(type)}`);
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
};
|
|
971
|
+
var materializedElementCache = /* @__PURE__ */ new WeakMap();
|
|
972
|
+
var materializeElement = (value) => {
|
|
973
|
+
if (!isElement(value)) return value;
|
|
974
|
+
if (typeof value.type === "function") {
|
|
975
|
+
const cached = materializedElementCache.get(value);
|
|
976
|
+
if (cached) return cached;
|
|
977
|
+
const materialized = materializeElement(value.type(value.props));
|
|
978
|
+
materializedElementCache.set(value, materialized);
|
|
979
|
+
return materialized;
|
|
980
|
+
}
|
|
981
|
+
const sourceChildren = typeof value.props.render === "function" ? value.props.render(DEFAULT_DYNAMIC_RENDER_CONTEXT) : value.props.children ?? [];
|
|
982
|
+
const flattened = materializeChildren(sourceChildren);
|
|
983
|
+
const children = [];
|
|
984
|
+
for (let index = 0; index < flattened.length; index += 1) {
|
|
985
|
+
children.push(materializeElement(flattened[index]));
|
|
986
|
+
}
|
|
987
|
+
return {
|
|
988
|
+
...value,
|
|
989
|
+
props: {
|
|
990
|
+
...value.props,
|
|
991
|
+
children
|
|
992
|
+
}
|
|
993
|
+
};
|
|
994
|
+
};
|
|
995
|
+
var INHERITED_TEXT_STYLE_MARKER = "__jsxpdfInheritedTextStyle";
|
|
996
|
+
var inheritTextStyle = (style) => {
|
|
997
|
+
const inherited = {
|
|
998
|
+
fontSize: style.fontSize,
|
|
999
|
+
lineHeight: style.lineHeight,
|
|
1000
|
+
color: style.color,
|
|
1001
|
+
fontFamily: style.fontFamily,
|
|
1002
|
+
fontWeight: style.fontWeight,
|
|
1003
|
+
fontStyle: style.fontStyle,
|
|
1004
|
+
letterSpacing: style.letterSpacing,
|
|
1005
|
+
opacity: style.opacity,
|
|
1006
|
+
textDecoration: style.textDecoration,
|
|
1007
|
+
textDecorationColor: style.textDecorationColor,
|
|
1008
|
+
textDecorationStyle: style.textDecorationStyle,
|
|
1009
|
+
textAlign: style.textAlign,
|
|
1010
|
+
direction: style.direction,
|
|
1011
|
+
lang: style.lang
|
|
1012
|
+
};
|
|
1013
|
+
Object.defineProperty(inherited, INHERITED_TEXT_STYLE_MARKER, { value: true, enumerable: false });
|
|
1014
|
+
return inherited;
|
|
1015
|
+
};
|
|
1016
|
+
var buildNodeChildren = (childrenValue, inheritedTextStyle) => {
|
|
1017
|
+
const childrenValues = materializeChildren(childrenValue);
|
|
1018
|
+
const children = [];
|
|
1019
|
+
for (let index = 0; index < childrenValues.length; index += 1) {
|
|
1020
|
+
const child = childrenValues[index];
|
|
1021
|
+
if (typeof child === "string" || typeof child === "number") {
|
|
1022
|
+
children.push(buildNodeTree({
|
|
1023
|
+
type: TextInstance,
|
|
1024
|
+
props: { children: String(child) }
|
|
1025
|
+
}, inheritedTextStyle));
|
|
1026
|
+
continue;
|
|
1027
|
+
}
|
|
1028
|
+
if (isBindingToken(child)) {
|
|
1029
|
+
children.push(buildNodeTree({
|
|
1030
|
+
type: TextInstance,
|
|
1031
|
+
props: { children: String(child.value) }
|
|
1032
|
+
}, inheritedTextStyle));
|
|
1033
|
+
continue;
|
|
1034
|
+
}
|
|
1035
|
+
if (!isElement(child)) continue;
|
|
1036
|
+
children.push(buildNodeTree(materializeElement(child), inheritedTextStyle));
|
|
1037
|
+
}
|
|
1038
|
+
return children;
|
|
1039
|
+
};
|
|
1040
|
+
var buildNodeTree = (element, inheritedTextStyle) => {
|
|
1041
|
+
const nodeType = normalizeType(element.type);
|
|
1042
|
+
const resolved = resolveStyle(element.props.style, inheritedTextStyle);
|
|
1043
|
+
const style = nodeType === "DOCUMENT" && resolved.lang == null && typeof element.props.language === "string" && element.props.language ? { ...resolved, lang: element.props.language } : resolved;
|
|
1044
|
+
if (nodeType === "TEXT_INSTANCE") {
|
|
1045
|
+
return {
|
|
1046
|
+
type: nodeType,
|
|
1047
|
+
props: element.props,
|
|
1048
|
+
style,
|
|
1049
|
+
children: [],
|
|
1050
|
+
text: String(element.props.children ?? "")
|
|
1051
|
+
};
|
|
1052
|
+
}
|
|
1053
|
+
const children = buildNodeChildren(element.props.children ?? [], inheritTextStyle(style));
|
|
1054
|
+
return {
|
|
1055
|
+
type: nodeType,
|
|
1056
|
+
props: element.props,
|
|
1057
|
+
style,
|
|
1058
|
+
children,
|
|
1059
|
+
text: void 0
|
|
1060
|
+
};
|
|
1061
|
+
};
|
|
1062
|
+
var extractText = (node) => {
|
|
1063
|
+
if (node.type === "TEXT_INSTANCE") return node.text ?? "";
|
|
1064
|
+
if (node.children.length === 0 && typeof node.text === "string") return node.text;
|
|
1065
|
+
return node.children.map((child) => extractText(child)).join("");
|
|
1066
|
+
};
|
|
1067
|
+
var mergeAdjacentTextRuns = (runs) => {
|
|
1068
|
+
const merged = [];
|
|
1069
|
+
for (const run of runs) {
|
|
1070
|
+
if (!run.text) continue;
|
|
1071
|
+
const previous = merged.length > 0 ? merged[merged.length - 1] : void 0;
|
|
1072
|
+
if (previous && previous.style.fontFamily === run.style.fontFamily && previous.style.fontSize === run.style.fontSize && previous.style.fontWeight === run.style.fontWeight && previous.style.fontStyle === run.style.fontStyle && previous.style.lineHeight === run.style.lineHeight && previous.style.hasExplicitLineHeight === run.style.hasExplicitLineHeight && previous.style.color === run.style.color && previous.style.letterSpacing === run.style.letterSpacing && previous.style.opacity === run.style.opacity && previous.style.textDecoration === run.style.textDecoration && previous.style.textDecorationColor === run.style.textDecorationColor && previous.style.textDecorationStyle === run.style.textDecorationStyle && previous.style.textAlign === run.style.textAlign && previous.style.direction === run.style.direction && previous.style.lang === run.style.lang) {
|
|
1073
|
+
previous.text += run.text;
|
|
1074
|
+
continue;
|
|
1075
|
+
}
|
|
1076
|
+
merged.push({ text: run.text, style: run.style });
|
|
1077
|
+
}
|
|
1078
|
+
return merged;
|
|
1079
|
+
};
|
|
1080
|
+
var extractTextRuns = (node) => {
|
|
1081
|
+
if (node.type === "TEXT_INSTANCE") {
|
|
1082
|
+
return node.text ? [{ text: node.text, style: node.style }] : [];
|
|
1083
|
+
}
|
|
1084
|
+
const childRuns = mergeAdjacentTextRuns(node.children.flatMap((child) => extractTextRuns(child)));
|
|
1085
|
+
if (childRuns.length > 0) return childRuns;
|
|
1086
|
+
if ((node.type === "TEXT" || node.type === "LINK") && typeof node.text === "string" && node.text.length > 0) {
|
|
1087
|
+
return [{ text: node.text, style: node.style }];
|
|
1088
|
+
}
|
|
1089
|
+
return [];
|
|
1090
|
+
};
|
|
1091
|
+
|
|
1092
|
+
// ../core/src/profile.ts
|
|
1093
|
+
var defaultCounters = () => ({
|
|
1094
|
+
elementNodes: 0,
|
|
1095
|
+
textInstances: 0,
|
|
1096
|
+
pages: 0,
|
|
1097
|
+
images: 0,
|
|
1098
|
+
textRuns: 0,
|
|
1099
|
+
backendOps: 0,
|
|
1100
|
+
textMeasureCalls: 0,
|
|
1101
|
+
textMeasureCacheHits: 0,
|
|
1102
|
+
textMeasureCacheMisses: 0,
|
|
1103
|
+
textShapeCalls: 0,
|
|
1104
|
+
textMeasureDistinctCacheKeys: 0,
|
|
1105
|
+
textMeasureDistinctRunFingerprints: 0,
|
|
1106
|
+
textMeasureDistinctWidths: 0,
|
|
1107
|
+
specializedTablesUsed: 0,
|
|
1108
|
+
fastCellsMeasured: 0,
|
|
1109
|
+
fallbackCellsMeasured: 0,
|
|
1110
|
+
rowCacheHits: 0,
|
|
1111
|
+
rowCacheMisses: 0
|
|
1112
|
+
});
|
|
1113
|
+
var appendProfileLog = async (logFile, payload) => {
|
|
1114
|
+
if (typeof process === "undefined" || !process.versions?.node) return;
|
|
1115
|
+
const loadNodeFs = new Function("return import('node:fs')");
|
|
1116
|
+
const { default: fs } = await loadNodeFs();
|
|
1117
|
+
fs.appendFileSync(logFile, payload);
|
|
1118
|
+
};
|
|
1119
|
+
var ProfileCollector = class {
|
|
1120
|
+
constructor(options) {
|
|
1121
|
+
this.options = options;
|
|
1122
|
+
this.enabled = options != null;
|
|
1123
|
+
}
|
|
1124
|
+
stages = [];
|
|
1125
|
+
counters = defaultCounters();
|
|
1126
|
+
totalStart = performance.now();
|
|
1127
|
+
/** When false, stage/record/addCounter are no-ops so un-profiled renders pay no collection cost. */
|
|
1128
|
+
enabled;
|
|
1129
|
+
async stage(name, fn) {
|
|
1130
|
+
if (!this.enabled) return fn();
|
|
1131
|
+
const start = performance.now();
|
|
1132
|
+
const result = await fn();
|
|
1133
|
+
this.record(name, performance.now() - start);
|
|
1134
|
+
return result;
|
|
1135
|
+
}
|
|
1136
|
+
record(name, durationMs) {
|
|
1137
|
+
if (!this.enabled) return;
|
|
1138
|
+
this.stages.push({ name, durationMs });
|
|
1139
|
+
}
|
|
1140
|
+
addCounter(name, value = 1) {
|
|
1141
|
+
if (!this.enabled) return;
|
|
1142
|
+
this.counters[name] += value;
|
|
1143
|
+
}
|
|
1144
|
+
finish() {
|
|
1145
|
+
const trace = {
|
|
1146
|
+
stages: [...this.stages],
|
|
1147
|
+
totalMs: performance.now() - this.totalStart,
|
|
1148
|
+
counters: { ...this.counters }
|
|
1149
|
+
};
|
|
1150
|
+
this.write(trace);
|
|
1151
|
+
return trace;
|
|
1152
|
+
}
|
|
1153
|
+
write(trace) {
|
|
1154
|
+
const logFile = this.options?.logFile ?? (typeof process !== "undefined" && process.versions?.node ? process.env.PDF_JSX_PERF_LOG : void 0);
|
|
1155
|
+
if (!logFile) return;
|
|
1156
|
+
const payload = {
|
|
1157
|
+
ts: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1158
|
+
label: this.options?.label ?? "jsxpdf.render.total",
|
|
1159
|
+
...this.options?.context,
|
|
1160
|
+
trace
|
|
1161
|
+
};
|
|
1162
|
+
void appendProfileLog(logFile, `${JSON.stringify(payload)}
|
|
1163
|
+
`);
|
|
1164
|
+
}
|
|
1165
|
+
};
|
|
1166
|
+
var normalizeProfileOptions = (profile) => {
|
|
1167
|
+
if (!profile) return void 0;
|
|
1168
|
+
if (profile === true) return { enabled: true };
|
|
1169
|
+
return { enabled: true, ...profile };
|
|
1170
|
+
};
|
|
1171
|
+
|
|
1172
|
+
// ../core/src/winansi.ts
|
|
1173
|
+
var WIN_ANSI_MAP = {
|
|
1174
|
+
338: 140,
|
|
1175
|
+
339: 156,
|
|
1176
|
+
352: 138,
|
|
1177
|
+
353: 154,
|
|
1178
|
+
376: 159,
|
|
1179
|
+
381: 142,
|
|
1180
|
+
382: 158,
|
|
1181
|
+
402: 131,
|
|
1182
|
+
710: 136,
|
|
1183
|
+
732: 152,
|
|
1184
|
+
8211: 150,
|
|
1185
|
+
8212: 151,
|
|
1186
|
+
8216: 145,
|
|
1187
|
+
8217: 146,
|
|
1188
|
+
8218: 130,
|
|
1189
|
+
8220: 147,
|
|
1190
|
+
8221: 148,
|
|
1191
|
+
8222: 132,
|
|
1192
|
+
8224: 134,
|
|
1193
|
+
8225: 135,
|
|
1194
|
+
8226: 149,
|
|
1195
|
+
8230: 133,
|
|
1196
|
+
8240: 137,
|
|
1197
|
+
8249: 139,
|
|
1198
|
+
8250: 155,
|
|
1199
|
+
8364: 128,
|
|
1200
|
+
8482: 153
|
|
1201
|
+
};
|
|
1202
|
+
var toWinAnsiByte = (codePoint) => {
|
|
1203
|
+
const mapped = WIN_ANSI_MAP[codePoint] ?? codePoint;
|
|
1204
|
+
return mapped >= 0 && mapped <= 255 ? mapped : 63;
|
|
1205
|
+
};
|
|
1206
|
+
var toWinAnsiBytes = (text) => {
|
|
1207
|
+
const bytes = [];
|
|
1208
|
+
for (const char of text) {
|
|
1209
|
+
bytes.push(toWinAnsiByte(char.codePointAt(0) ?? 63));
|
|
1210
|
+
}
|
|
1211
|
+
return bytes;
|
|
1212
|
+
};
|
|
1213
|
+
export {
|
|
1214
|
+
BUILTIN_PDF_FONTS,
|
|
1215
|
+
Canvas,
|
|
1216
|
+
Checkbox,
|
|
1217
|
+
Circle,
|
|
1218
|
+
ClipPath,
|
|
1219
|
+
Defs,
|
|
1220
|
+
Document,
|
|
1221
|
+
Ellipse,
|
|
1222
|
+
FieldSet,
|
|
1223
|
+
Font,
|
|
1224
|
+
G,
|
|
1225
|
+
Image,
|
|
1226
|
+
Line,
|
|
1227
|
+
LinearGradient,
|
|
1228
|
+
Link,
|
|
1229
|
+
List,
|
|
1230
|
+
Note,
|
|
1231
|
+
Page,
|
|
1232
|
+
PageBreak,
|
|
1233
|
+
Path,
|
|
1234
|
+
Polygon,
|
|
1235
|
+
Polyline,
|
|
1236
|
+
ProfileCollector,
|
|
1237
|
+
RadialGradient,
|
|
1238
|
+
Rect,
|
|
1239
|
+
Select,
|
|
1240
|
+
Stop,
|
|
1241
|
+
StyleSheet,
|
|
1242
|
+
Svg,
|
|
1243
|
+
Table,
|
|
1244
|
+
TableBody,
|
|
1245
|
+
TableCell,
|
|
1246
|
+
TableFooter,
|
|
1247
|
+
TableHead,
|
|
1248
|
+
TableRow,
|
|
1249
|
+
Text,
|
|
1250
|
+
TextInput,
|
|
1251
|
+
TextInstance,
|
|
1252
|
+
Tspan,
|
|
1253
|
+
View,
|
|
1254
|
+
base64ToBytes,
|
|
1255
|
+
base64ToText,
|
|
1256
|
+
buildNodeChildren,
|
|
1257
|
+
buildNodeTree,
|
|
1258
|
+
bytesToBase64,
|
|
1259
|
+
concatUint8Arrays,
|
|
1260
|
+
createBindingToken,
|
|
1261
|
+
createElement,
|
|
1262
|
+
createTextElement,
|
|
1263
|
+
extractText,
|
|
1264
|
+
extractTextRuns,
|
|
1265
|
+
flattenStyle,
|
|
1266
|
+
getStandardFontMetrics,
|
|
1267
|
+
inheritTextStyle,
|
|
1268
|
+
isArrayBuffer,
|
|
1269
|
+
isBinaryInput,
|
|
1270
|
+
isBindingToken,
|
|
1271
|
+
isPercent,
|
|
1272
|
+
materializeChildren,
|
|
1273
|
+
materializeElement,
|
|
1274
|
+
normalizeProfileOptions,
|
|
1275
|
+
normalizeStandardFamily,
|
|
1276
|
+
parseBindingTemplateString,
|
|
1277
|
+
parseSizeValue,
|
|
1278
|
+
readUint32BE,
|
|
1279
|
+
resolveColor,
|
|
1280
|
+
resolveStandardFace,
|
|
1281
|
+
resolveStyle,
|
|
1282
|
+
toUint8Array,
|
|
1283
|
+
toWinAnsiByte,
|
|
1284
|
+
toWinAnsiBytes,
|
|
1285
|
+
unwrapImageSource
|
|
1286
|
+
};
|
|
3
1287
|
//# sourceMappingURL=core.js.map
|