@eternalheart/vue-file-preview 1.6.12 → 1.6.13
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/README.md +2 -0
- package/README.zh-CN.md +2 -0
- package/lib/FilePreviewContent.vue.d.ts +9 -1
- package/lib/FilePreviewEmbed.vue.d.ts +4 -1
- package/lib/FilePreviewModal.vue.d.ts +4 -1
- package/lib/chunks/EmptyState.vue_vue_type_script_setup_true_lang-C7qk6wj0.mjs +20 -0
- package/lib/chunks/RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs +32 -0
- package/lib/chunks/{avifLoader-CAUzjn-d-CTy7cevh.mjs → avifLoader-CAUzjn-d-C0KRpetN.mjs} +1 -1
- package/lib/chunks/{heicLoader-D_9PukkA-DdDu94xL.mjs → heicLoader-D_9PukkA-Czof_5FJ.mjs} +1 -1
- package/lib/chunks/{index-CLM9sOKN.mjs → index--612Smof.mjs} +112 -112
- package/lib/chunks/{index-De-oaCgN.mjs → index-8Vpbg2kS.mjs} +2 -2
- package/lib/chunks/{index-2VQLB2Mi.mjs → index-B21EAyWz.mjs} +53 -49
- package/lib/chunks/{index-DmEMePjL.mjs → index-BASg1cr4.mjs} +2 -2
- package/lib/chunks/index-BB0i4QqI.mjs +117 -0
- package/lib/chunks/{index-Bmqn45d_.mjs → index-BVdrGK3Q.mjs} +72 -72
- package/lib/chunks/index-BlrFFeqc.mjs +330 -0
- package/lib/chunks/index-Bp9CuvMZ.mjs +157 -0
- package/lib/chunks/{index-i-KacQvS.mjs → index-BuqPb5mP.mjs} +3 -3
- package/lib/chunks/{index-DVG1fZAv.mjs → index-BvBqDq3O.mjs} +2 -2
- package/lib/chunks/{index-D6te_qaB.mjs → index-Bxpf9v5j.mjs} +26 -26
- package/lib/chunks/{index-D9z6lQat.mjs → index-C9mAajbD.mjs} +225 -220
- package/lib/chunks/{index-CM11hSQu.mjs → index-CDg6vIbT.mjs} +11 -11
- package/lib/chunks/{index-BxmX005K.mjs → index-CWE-hKSs.mjs} +11 -11
- package/lib/chunks/{index-BPmyF7Wr.mjs → index-CY3xzGgt.mjs} +18 -18
- package/lib/chunks/{index-t9kSzzMg.mjs → index-CxKZKUJj.mjs} +521 -523
- package/lib/chunks/{index-CuiEjR23.mjs → index-D30L8tm9.mjs} +15 -15
- package/lib/chunks/{index-DOAOk6m5.mjs → index-DN4Ui0Gh.mjs} +11 -11
- package/lib/chunks/{index-CEk6FKm3.mjs → index-DZZN3kYi.mjs} +551 -531
- package/lib/chunks/{index-D6Pjjxi0.mjs → index-Dkro_8Fy.mjs} +20 -20
- package/lib/chunks/{index-CiGUKdlt.mjs → index-VdzIFJJW.mjs} +23 -23
- package/lib/chunks/{index-WcAnJA2t.mjs → index-aoXgVLBb.mjs} +14 -14
- package/lib/chunks/{jp2Loader-Dig19xyo-BBR3tcPW.mjs → jp2Loader-Dig19xyo-CKUaGhPl.mjs} +1 -1
- package/lib/chunks/{psdLoader-C0tKUXXl-DGOmJwkQ.mjs → psdLoader-C0tKUXXl-CYWoQis5.mjs} +1 -1
- package/lib/chunks/{rawLoader-C-tPeFAB-CrCtXMup.mjs → rawLoader-C-tPeFAB-C35zC8nZ.mjs} +1 -1
- package/lib/chunks/{tiffLoader-BlhByX8w-jsxHlbyu.mjs → tiffLoader-BlhByX8w-BOxg_Du5.mjs} +1 -1
- package/lib/chunks/{useShikiHighlight-BdhPCj48.mjs → useShikiHighlight-BPmcxA-h.mjs} +1 -1
- package/lib/index.cjs +59 -59
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.mjs +4 -4
- package/lib/renderers/EmptyState.vue.d.ts +2 -0
- package/lib/renderers/Json/index.vue.d.ts +5 -0
- package/lib/renderers/Pptx/index.vue.d.ts +3 -0
- package/lib/renderers/Text/index.vue.d.ts +3 -0
- package/lib/renderers/Xlsx/index.vue.d.ts +3 -0
- package/lib/renderers/registry.d.ts +3 -1
- package/package.json +1 -1
- package/lib/chunks/RendererError.vue_vue_type_script_setup_true_lang-BNoENOWX.mjs +0 -30
- package/lib/chunks/index-Bfg5zM8l.mjs +0 -141
- package/lib/chunks/index-Cud9j9Xy.mjs +0 -322
- package/lib/chunks/index-D4jhvs5m.mjs +0 -113
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { defineComponent as ws, ref as Re, onMounted as Es, onBeforeUnmount as Rs, watch as Pr, openBlock as ge, createElementBlock as ke, normalizeStyle as Br, toDisplayString as
|
|
2
|
-
import { u as Vr,
|
|
3
|
-
import { _ as Wr } from "./RendererError.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { defineComponent as ws, ref as Re, onMounted as Es, onBeforeUnmount as Rs, watch as Pr, openBlock as ge, createElementBlock as ke, normalizeStyle as Br, toDisplayString as Y, computed as mt, createElementVNode as M, unref as Z, createBlock as Nr, Fragment as Fn, createCommentVNode as Wt, withDirectives as _r, vModelText as Gr, renderList as Hr, createVNode as qt } from "vue";
|
|
2
|
+
import { u as Vr, c as zr, g as jr, k as $t } from "./index-DZZN3kYi.mjs";
|
|
3
|
+
import { _ as Wr } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
|
|
4
4
|
var yn = 0, Is = -3;
|
|
5
5
|
function at() {
|
|
6
6
|
this.table = new Uint16Array(16), this.trans = new Uint16Array(288);
|
|
@@ -89,9 +89,9 @@ function Zr(e, t, n) {
|
|
|
89
89
|
var u = an(e, Mn);
|
|
90
90
|
switch (u) {
|
|
91
91
|
case 16:
|
|
92
|
-
var
|
|
92
|
+
var p = Se[i - 1];
|
|
93
93
|
for (l = Ce(e, 2, 3); l; --l)
|
|
94
|
-
Se[i++] =
|
|
94
|
+
Se[i++] = p;
|
|
95
95
|
break;
|
|
96
96
|
case 17:
|
|
97
97
|
for (l = Ce(e, 3, 3); l; --l)
|
|
@@ -176,22 +176,22 @@ Ve.prototype.addY = function(e) {
|
|
|
176
176
|
this.addPoint(null, e);
|
|
177
177
|
};
|
|
178
178
|
Ve.prototype.addBezier = function(e, t, n, s, r, a, o, i) {
|
|
179
|
-
const l = [e, t], c = [n, s], u = [r, a],
|
|
179
|
+
const l = [e, t], c = [n, s], u = [r, a], p = [o, i];
|
|
180
180
|
this.addPoint(e, t), this.addPoint(o, i);
|
|
181
|
-
for (let
|
|
182
|
-
const d = 6 * l[
|
|
181
|
+
for (let f = 0; f <= 1; f++) {
|
|
182
|
+
const d = 6 * l[f] - 12 * c[f] + 6 * u[f], h = -3 * l[f] + 9 * c[f] - 9 * u[f] + 3 * p[f], g = 3 * c[f] - 3 * l[f];
|
|
183
183
|
if (h === 0) {
|
|
184
184
|
if (d === 0) continue;
|
|
185
185
|
const w = -g / d;
|
|
186
|
-
0 < w && w < 1 && (
|
|
186
|
+
0 < w && w < 1 && (f === 0 && this.addX($e(l[f], c[f], u[f], p[f], w)), f === 1 && this.addY($e(l[f], c[f], u[f], p[f], w)));
|
|
187
187
|
continue;
|
|
188
188
|
}
|
|
189
189
|
const y = Math.pow(d, 2) - 4 * g * h;
|
|
190
190
|
if (y < 0) continue;
|
|
191
191
|
const C = (-d + Math.sqrt(y)) / (2 * h);
|
|
192
|
-
0 < C && C < 1 && (
|
|
192
|
+
0 < C && C < 1 && (f === 0 && this.addX($e(l[f], c[f], u[f], p[f], C)), f === 1 && this.addY($e(l[f], c[f], u[f], p[f], C)));
|
|
193
193
|
const k = (-d - Math.sqrt(y)) / (2 * h);
|
|
194
|
-
0 < k && k < 1 && (
|
|
194
|
+
0 < k && k < 1 && (f === 0 && this.addX($e(l[f], c[f], u[f], p[f], k)), f === 1 && this.addY($e(l[f], c[f], u[f], p[f], k)));
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
197
|
Ve.prototype.addQuad = function(e, t, n, s, r, a) {
|
|
@@ -199,7 +199,7 @@ Ve.prototype.addQuad = function(e, t, n, s, r, a) {
|
|
|
199
199
|
this.addBezier(e, t, o, i, l, c, r, a);
|
|
200
200
|
};
|
|
201
201
|
var Ps = Ve;
|
|
202
|
-
function
|
|
202
|
+
function X() {
|
|
203
203
|
this.commands = [], this.fill = "black", this.stroke = null, this.strokeWidth = 1;
|
|
204
204
|
}
|
|
205
205
|
var st = {};
|
|
@@ -239,7 +239,7 @@ function Jr(e) {
|
|
|
239
239
|
flipYBase: void 0
|
|
240
240
|
}, e);
|
|
241
241
|
}
|
|
242
|
-
|
|
242
|
+
X.prototype.fromSVG = function(e, t = {}) {
|
|
243
243
|
typeof SVGPathElement < "u" && e instanceof SVGPathElement && (e = e.getAttribute("d")), t = Qr(t), this.commands = [];
|
|
244
244
|
const n = "0123456789", s = "MmLlQqCcZzHhVv", r = "SsTtAa", a = "-+";
|
|
245
245
|
let o = {}, i = [""], l = !1;
|
|
@@ -257,7 +257,7 @@ $.prototype.fromSVG = function(e, t = {}) {
|
|
|
257
257
|
h[y] += g[y & 1 ? "y" : "x"];
|
|
258
258
|
return h;
|
|
259
259
|
}
|
|
260
|
-
function
|
|
260
|
+
function p() {
|
|
261
261
|
if (o.type === void 0)
|
|
262
262
|
return;
|
|
263
263
|
const h = o.type.toUpperCase(), g = h !== "Z" && o.type.toUpperCase() !== o.type;
|
|
@@ -311,7 +311,7 @@ $.prototype.fromSVG = function(e, t = {}) {
|
|
|
311
311
|
else
|
|
312
312
|
continue;
|
|
313
313
|
else if (s.indexOf(g) > -1)
|
|
314
|
-
o.type ? (
|
|
314
|
+
o.type ? (p.apply(this), o = { type: g }) : o.type = g;
|
|
315
315
|
else {
|
|
316
316
|
if (r.indexOf(g) > -1)
|
|
317
317
|
throw new Error("Unsupported path command: " + g + ". Currently supported commands are " + s.split("").join(", ") + ".");
|
|
@@ -321,38 +321,38 @@ $.prototype.fromSVG = function(e, t = {}) {
|
|
|
321
321
|
if (l)
|
|
322
322
|
throw new Error("Unexpected character: " + g + " at offset " + h);
|
|
323
323
|
}
|
|
324
|
-
|
|
325
|
-
const
|
|
324
|
+
p.apply(this), t.optimize && (this.commands = Ns(this.commands));
|
|
325
|
+
const f = t.flipY;
|
|
326
326
|
let d = t.flipYBase;
|
|
327
|
-
if (
|
|
327
|
+
if (f === !0 && t.flipYBase === void 0) {
|
|
328
328
|
const h = this.getBoundingBox();
|
|
329
329
|
d = h.y1 + h.y2;
|
|
330
330
|
}
|
|
331
331
|
for (const h in this.commands) {
|
|
332
332
|
const g = this.commands[h];
|
|
333
333
|
for (const y in g)
|
|
334
|
-
["x", "x1", "x2"].includes(y) ? this.commands[h][y] = t.x + g[y] * t.scale : ["y", "y1", "y2"].includes(y) && (this.commands[h][y] = t.y + (
|
|
334
|
+
["x", "x1", "x2"].includes(y) ? this.commands[h][y] = t.x + g[y] * t.scale : ["y", "y1", "y2"].includes(y) && (this.commands[h][y] = t.y + (f ? d - g[y] : g[y]) * t.scale);
|
|
335
335
|
}
|
|
336
336
|
return this;
|
|
337
337
|
};
|
|
338
|
-
|
|
339
|
-
return new
|
|
338
|
+
X.fromSVG = function(e, t) {
|
|
339
|
+
return new X().fromSVG(e, t);
|
|
340
340
|
};
|
|
341
|
-
|
|
341
|
+
X.prototype.moveTo = function(e, t) {
|
|
342
342
|
this.commands.push({
|
|
343
343
|
type: "M",
|
|
344
344
|
x: e,
|
|
345
345
|
y: t
|
|
346
346
|
});
|
|
347
347
|
};
|
|
348
|
-
|
|
348
|
+
X.prototype.lineTo = function(e, t) {
|
|
349
349
|
this.commands.push({
|
|
350
350
|
type: "L",
|
|
351
351
|
x: e,
|
|
352
352
|
y: t
|
|
353
353
|
});
|
|
354
354
|
};
|
|
355
|
-
|
|
355
|
+
X.prototype.curveTo = X.prototype.bezierCurveTo = function(e, t, n, s, r, a) {
|
|
356
356
|
this.commands.push({
|
|
357
357
|
type: "C",
|
|
358
358
|
x1: e,
|
|
@@ -363,7 +363,7 @@ $.prototype.curveTo = $.prototype.bezierCurveTo = function(e, t, n, s, r, a) {
|
|
|
363
363
|
y: a
|
|
364
364
|
});
|
|
365
365
|
};
|
|
366
|
-
|
|
366
|
+
X.prototype.quadTo = X.prototype.quadraticCurveTo = function(e, t, n, s) {
|
|
367
367
|
this.commands.push({
|
|
368
368
|
type: "Q",
|
|
369
369
|
x1: e,
|
|
@@ -372,12 +372,12 @@ $.prototype.quadTo = $.prototype.quadraticCurveTo = function(e, t, n, s) {
|
|
|
372
372
|
y: s
|
|
373
373
|
});
|
|
374
374
|
};
|
|
375
|
-
|
|
375
|
+
X.prototype.close = X.prototype.closePath = function() {
|
|
376
376
|
this.commands.push({
|
|
377
377
|
type: "Z"
|
|
378
378
|
});
|
|
379
379
|
};
|
|
380
|
-
|
|
380
|
+
X.prototype.extend = function(e) {
|
|
381
381
|
if (e.commands)
|
|
382
382
|
e = e.commands;
|
|
383
383
|
else if (e instanceof Ps) {
|
|
@@ -387,7 +387,7 @@ $.prototype.extend = function(e) {
|
|
|
387
387
|
}
|
|
388
388
|
Array.prototype.push.apply(this.commands, e);
|
|
389
389
|
};
|
|
390
|
-
|
|
390
|
+
X.prototype.getBoundingBox = function() {
|
|
391
391
|
const e = new Ps();
|
|
392
392
|
let t = 0, n = 0, s = 0, r = 0;
|
|
393
393
|
for (let a = 0; a < this.commands.length; a++) {
|
|
@@ -414,7 +414,7 @@ $.prototype.getBoundingBox = function() {
|
|
|
414
414
|
}
|
|
415
415
|
return e.isEmpty() && e.addPoint(0, 0), e;
|
|
416
416
|
};
|
|
417
|
-
|
|
417
|
+
X.prototype.draw = function(e) {
|
|
418
418
|
const t = this._layers;
|
|
419
419
|
if (t && t.length) {
|
|
420
420
|
for (let s = 0; s < t.length; s++)
|
|
@@ -433,7 +433,7 @@ $.prototype.draw = function(e) {
|
|
|
433
433
|
}
|
|
434
434
|
this.fill && (e.fillStyle = this.fill, e.fill()), this.stroke && (e.strokeStyle = this.stroke, e.lineWidth = this.strokeWidth, e.stroke());
|
|
435
435
|
};
|
|
436
|
-
|
|
436
|
+
X.prototype.toPathData = function(e) {
|
|
437
437
|
e = Jr(e);
|
|
438
438
|
function t(i) {
|
|
439
439
|
const l = Bs(i, e.decimalPlaces);
|
|
@@ -452,7 +452,7 @@ $.prototype.toPathData = function(e) {
|
|
|
452
452
|
const r = e.flipY;
|
|
453
453
|
let a = e.flipYBase;
|
|
454
454
|
if (r === !0 && a === void 0) {
|
|
455
|
-
const i = new
|
|
455
|
+
const i = new X();
|
|
456
456
|
i.extend(s);
|
|
457
457
|
const l = i.getBoundingBox();
|
|
458
458
|
a = l.y1 + l.y2;
|
|
@@ -482,17 +482,17 @@ $.prototype.toPathData = function(e) {
|
|
|
482
482
|
}
|
|
483
483
|
return o;
|
|
484
484
|
};
|
|
485
|
-
|
|
485
|
+
X.prototype.toSVG = function(e, t) {
|
|
486
486
|
this._layers && this._layers.length && console.warn("toSVG() does not support colr font layers yet"), this._image && console.warn("toSVG() does not support SVG glyphs yet"), t || (t = this.toPathData(e));
|
|
487
487
|
let n = '<path d="';
|
|
488
488
|
return n += t, n += '"', this.fill !== void 0 && this.fill !== "black" && (this.fill === null ? n += ' fill="none"' : n += ' fill="' + this.fill + '"'), this.stroke && (n += ' stroke="' + this.stroke + '" stroke-width="' + this.strokeWidth + '"'), n += "/>", n;
|
|
489
489
|
};
|
|
490
|
-
|
|
490
|
+
X.prototype.toDOMElement = function(e, t) {
|
|
491
491
|
this._layers && this._layers.length && console.warn("toDOMElement() does not support colr font layers yet"), t || (t = this.toPathData(e));
|
|
492
492
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
493
493
|
return n.setAttribute("d", t), this.fill !== void 0 && this.fill !== "black" && (this.fill === null ? n.setAttribute("fill", "none") : n.setAttribute("fill", this.fill)), this.stroke && (n.setAttribute("stroke", this.stroke), n.setAttribute("stroke-width", this.strokeWidth)), n;
|
|
494
494
|
};
|
|
495
|
-
var Ke =
|
|
495
|
+
var Ke = X;
|
|
496
496
|
function _s(e) {
|
|
497
497
|
throw new Error(e);
|
|
498
498
|
}
|
|
@@ -1122,13 +1122,13 @@ function ca(e, t, n) {
|
|
|
1122
1122
|
s.push(e.getUint8(r));
|
|
1123
1123
|
return s;
|
|
1124
1124
|
}
|
|
1125
|
-
function
|
|
1125
|
+
function fa(e) {
|
|
1126
1126
|
let t = "";
|
|
1127
1127
|
for (let n = 0; n < e.length; n += 1)
|
|
1128
1128
|
t += String.fromCharCode(e[n]);
|
|
1129
1129
|
return t;
|
|
1130
1130
|
}
|
|
1131
|
-
var
|
|
1131
|
+
var pa = {
|
|
1132
1132
|
byte: 1,
|
|
1133
1133
|
uShort: 2,
|
|
1134
1134
|
f2dot14: 2,
|
|
@@ -1138,7 +1138,7 @@ var fa = {
|
|
|
1138
1138
|
fixed: 4,
|
|
1139
1139
|
longDateTime: 8,
|
|
1140
1140
|
tag: 4
|
|
1141
|
-
},
|
|
1141
|
+
}, Q = {
|
|
1142
1142
|
LONG_WORDS: 32768,
|
|
1143
1143
|
WORD_DELTA_COUNT_MASK: 32767,
|
|
1144
1144
|
SHARED_POINT_NUMBERS: 32768,
|
|
@@ -1219,7 +1219,7 @@ m.prototype.parseVersion = function(e) {
|
|
|
1219
1219
|
return this.relativeOffset += 4, e === void 0 && (e = 4096), t + n / e / 10;
|
|
1220
1220
|
};
|
|
1221
1221
|
m.prototype.skip = function(e, t) {
|
|
1222
|
-
t === void 0 && (t = 1), this.relativeOffset +=
|
|
1222
|
+
t === void 0 && (t = 1), this.relativeOffset += pa[e] * t;
|
|
1223
1223
|
};
|
|
1224
1224
|
m.prototype.parseULongList = function(e) {
|
|
1225
1225
|
e === void 0 && (e = this.parseULong());
|
|
@@ -1535,7 +1535,7 @@ m.prototype.parseDeltaSetIndexMap = function() {
|
|
|
1535
1535
|
format: e,
|
|
1536
1536
|
entryFormat: t
|
|
1537
1537
|
};
|
|
1538
|
-
const r = (t &
|
|
1538
|
+
const r = (t & Q.INNER_INDEX_BIT_COUNT_MASK) + 1, a = ((t & Q.MAP_ENTRY_SIZE_MASK) >> 4) + 1;
|
|
1539
1539
|
for (let o = 0; o < s; o++) {
|
|
1540
1540
|
let i;
|
|
1541
1541
|
if (a === 1)
|
|
@@ -1558,7 +1558,7 @@ m.prototype.parseDeltaSetIndexMap = function() {
|
|
|
1558
1558
|
};
|
|
1559
1559
|
};
|
|
1560
1560
|
m.prototype.parseDeltaSets = function(e, t, n) {
|
|
1561
|
-
const s = Array.from({ length: e }, () => []), r = t &
|
|
1561
|
+
const s = Array.from({ length: e }, () => []), r = t & Q.LONG_WORDS, a = t & Q.WORD_DELTA_COUNT_MASK;
|
|
1562
1562
|
if (a > n)
|
|
1563
1563
|
throw Error("wordCount must be less than or equal to regionIndexCount");
|
|
1564
1564
|
const o = (r ? this.parseLong : this.parseShort).bind(this), i = (r ? this.parseShort : this.parseChar).bind(this);
|
|
@@ -1572,15 +1572,15 @@ m.prototype.parseTupleVariationStoreList = function(e, t, n) {
|
|
|
1572
1572
|
let c = i();
|
|
1573
1573
|
a || (c *= 2);
|
|
1574
1574
|
let u;
|
|
1575
|
-
for (let
|
|
1575
|
+
for (let p = 0; p < s; p++) {
|
|
1576
1576
|
u = i(), a || (u *= 2);
|
|
1577
|
-
const
|
|
1578
|
-
l[
|
|
1577
|
+
const f = u - c;
|
|
1578
|
+
l[p] = f ? this.parseTupleVariationStore(
|
|
1579
1579
|
o + c,
|
|
1580
1580
|
e,
|
|
1581
1581
|
t,
|
|
1582
1582
|
n,
|
|
1583
|
-
|
|
1583
|
+
p
|
|
1584
1584
|
) : void 0, c = u;
|
|
1585
1585
|
}
|
|
1586
1586
|
return l;
|
|
@@ -1588,25 +1588,25 @@ m.prototype.parseTupleVariationStoreList = function(e, t, n) {
|
|
|
1588
1588
|
m.prototype.parseTupleVariationStore = function(e, t, n, s, r) {
|
|
1589
1589
|
const a = this.relativeOffset;
|
|
1590
1590
|
this.relativeOffset = e, n === "cvar" && (this.relativeOffset += 4);
|
|
1591
|
-
const o = this.parseUShort(), i = !!(o &
|
|
1591
|
+
const o = this.parseUShort(), i = !!(o & Q.SHARED_POINT_NUMBERS), l = o & Q.COUNT_MASK;
|
|
1592
1592
|
let c = this.parseOffset16();
|
|
1593
1593
|
const u = [];
|
|
1594
|
-
let
|
|
1594
|
+
let p = [];
|
|
1595
1595
|
for (let h = 0; h < l; h++) {
|
|
1596
1596
|
const g = this.parseTupleVariationHeader(t, n);
|
|
1597
1597
|
u.push(g);
|
|
1598
1598
|
}
|
|
1599
|
-
this.relativeOffset !== e + c && (console.warn(`Unexpected offset after parsing tuple variation headers! Expected ${e + c}, actually ${this.relativeOffset}`), this.relativeOffset = e + c), i && (
|
|
1600
|
-
let
|
|
1599
|
+
this.relativeOffset !== e + c && (console.warn(`Unexpected offset after parsing tuple variation headers! Expected ${e + c}, actually ${this.relativeOffset}`), this.relativeOffset = e + c), i && (p = this.parsePackedPointNumbers());
|
|
1600
|
+
let f = this.relativeOffset;
|
|
1601
1601
|
for (let h = 0; h < l; h++) {
|
|
1602
1602
|
const g = u[h];
|
|
1603
|
-
g.privatePoints = [], this.relativeOffset =
|
|
1603
|
+
g.privatePoints = [], this.relativeOffset = f, n === "cvar" && !g.peakTuple && console.warn("An embedded peak tuple is required in TupleVariationHeaders for the cvar table."), g.flags.privatePointNumbers && (g.privatePoints = this.parsePackedPointNumbers()), delete g.flags;
|
|
1604
1604
|
const y = this.offset, C = this.relativeOffset, k = (w) => {
|
|
1605
1605
|
let L, U;
|
|
1606
1606
|
const D = () => {
|
|
1607
1607
|
let F = 0;
|
|
1608
1608
|
if (n === "gvar") {
|
|
1609
|
-
if (F = g.privatePoints.length ||
|
|
1609
|
+
if (F = g.privatePoints.length || p.length, !F) {
|
|
1610
1610
|
const z = s.get(r);
|
|
1611
1611
|
z.path, F = z.points.length, F += 4;
|
|
1612
1612
|
}
|
|
@@ -1623,16 +1623,16 @@ m.prototype.parseTupleVariationStore = function(e, t, n, s, r) {
|
|
|
1623
1623
|
}
|
|
1624
1624
|
};
|
|
1625
1625
|
};
|
|
1626
|
-
Object.defineProperty(g, "deltas", k.call(this, "deltas")), n === "gvar" && Object.defineProperty(g, "deltasY", k.call(this, "deltasY")),
|
|
1626
|
+
Object.defineProperty(g, "deltas", k.call(this, "deltas")), n === "gvar" && Object.defineProperty(g, "deltasY", k.call(this, "deltasY")), f += g.variationDataSize, delete g.variationDataSize;
|
|
1627
1627
|
}
|
|
1628
1628
|
this.relativeOffset = a;
|
|
1629
1629
|
const d = {
|
|
1630
1630
|
headers: u
|
|
1631
1631
|
};
|
|
1632
|
-
return d.sharedPoints =
|
|
1632
|
+
return d.sharedPoints = p, d;
|
|
1633
1633
|
};
|
|
1634
1634
|
m.prototype.parseTupleVariationHeader = function(e, t) {
|
|
1635
|
-
const n = this.parseUShort(), s = this.parseUShort(), r = !!(s &
|
|
1635
|
+
const n = this.parseUShort(), s = this.parseUShort(), r = !!(s & Q.EMBEDDED_PEAK_TUPLE), a = !!(s & Q.INTERMEDIATE_REGION), o = !!(s & Q.PRIVATE_POINT_NUMBERS), i = r ? void 0 : s & Q.TUPLE_INDEX_MASK, l = r ? this.parseTupleRecords(1, e)[0] : void 0, c = a ? this.parseTupleRecords(1, e)[0] : void 0, u = a ? this.parseTupleRecords(1, e)[0] : void 0, p = {
|
|
1636
1636
|
variationDataSize: n,
|
|
1637
1637
|
peakTuple: l,
|
|
1638
1638
|
intermediateStartTuple: c,
|
|
@@ -1643,19 +1643,19 @@ m.prototype.parseTupleVariationHeader = function(e, t) {
|
|
|
1643
1643
|
privatePointNumbers: o
|
|
1644
1644
|
}
|
|
1645
1645
|
};
|
|
1646
|
-
return t === "gvar" && (
|
|
1646
|
+
return t === "gvar" && (p.sharedTupleRecordsIndex = i), p;
|
|
1647
1647
|
};
|
|
1648
1648
|
m.prototype.parsePackedPointNumbers = function() {
|
|
1649
1649
|
const e = this.parseByte(), t = [];
|
|
1650
1650
|
let n = e;
|
|
1651
1651
|
if (e >= 128) {
|
|
1652
1652
|
const r = this.parseByte();
|
|
1653
|
-
n = (e &
|
|
1653
|
+
n = (e & Q.POINT_RUN_COUNT_MASK) << 8 | r;
|
|
1654
1654
|
}
|
|
1655
1655
|
let s = 0;
|
|
1656
1656
|
for (; t.length < n; ) {
|
|
1657
|
-
const r = this.parseByte(), a = !!(r &
|
|
1658
|
-
let o = (r &
|
|
1657
|
+
const r = this.parseByte(), a = !!(r & Q.POINTS_ARE_WORDS);
|
|
1658
|
+
let o = (r & Q.POINT_RUN_COUNT_MASK) + 1;
|
|
1659
1659
|
for (let i = 0; i < o && t.length < n; i++) {
|
|
1660
1660
|
let l;
|
|
1661
1661
|
a ? l = this.parseUShort() : l = this.parseByte(), s = s + l, t.push(s);
|
|
@@ -1666,7 +1666,7 @@ m.prototype.parsePackedPointNumbers = function() {
|
|
|
1666
1666
|
m.prototype.parsePackedDeltas = function(e) {
|
|
1667
1667
|
const t = [];
|
|
1668
1668
|
for (; t.length < e; ) {
|
|
1669
|
-
const n = this.parseByte(), s = !!(n &
|
|
1669
|
+
const n = this.parseByte(), s = !!(n & Q.DELTAS_ARE_ZERO), r = !!(n & Q.DELTAS_ARE_WORDS), a = (n & Q.DELTA_RUN_COUNT_MASK) + 1;
|
|
1670
1670
|
for (let o = 0; o < a && t.length < e; o++)
|
|
1671
1671
|
s ? t.push(0) : r ? t.push(this.parseShort()) : t.push(this.parseChar());
|
|
1672
1672
|
}
|
|
@@ -1684,7 +1684,7 @@ var S = {
|
|
|
1684
1684
|
getTag: la,
|
|
1685
1685
|
getOffset: ua,
|
|
1686
1686
|
getBytes: ca,
|
|
1687
|
-
bytesToString:
|
|
1687
|
+
bytesToString: fa,
|
|
1688
1688
|
Parser: m
|
|
1689
1689
|
}, Dt = [
|
|
1690
1690
|
"copyright",
|
|
@@ -2435,7 +2435,7 @@ function ya(e) {
|
|
|
2435
2435
|
function va(e, t, n) {
|
|
2436
2436
|
const s = {}, r = new S.Parser(e, t), a = r.parseUShort(), o = r.parseUShort(), i = r.offset + r.parseUShort();
|
|
2437
2437
|
for (let l = 0; l < o; l++) {
|
|
2438
|
-
const c = r.parseUShort(), u = r.parseUShort(),
|
|
2438
|
+
const c = r.parseUShort(), u = r.parseUShort(), p = r.parseUShort(), f = r.parseUShort(), d = Dt[f] || f, h = r.parseUShort(), g = r.parseUShort(), y = da(c, p, n), C = Sn(c, u, p), k = ya(c);
|
|
2439
2439
|
if (C !== void 0 && y !== void 0 && k !== void 0) {
|
|
2440
2440
|
let w;
|
|
2441
2441
|
if (C === un ? w = Qe.UTF16(e, i + g, h) : w = Qe.MACSTRING(e, i + g, h, C), w) {
|
|
@@ -2491,16 +2491,16 @@ function xa(e, t) {
|
|
|
2491
2491
|
const n = xt(js), s = xt(Vs), r = xt(zs), a = [], o = [];
|
|
2492
2492
|
for (let l in e) {
|
|
2493
2493
|
let c;
|
|
2494
|
-
const u = [],
|
|
2494
|
+
const u = [], p = {}, f = xt(Dt), d = n[l];
|
|
2495
2495
|
for (let h in e[l]) {
|
|
2496
|
-
let g =
|
|
2496
|
+
let g = f[h];
|
|
2497
2497
|
if (g === void 0 && (g = h), c = parseInt(g), isNaN(c))
|
|
2498
2498
|
throw new Error('Name table entry "' + h + '" does not exist, see nameTableNames for complete list.');
|
|
2499
|
-
|
|
2499
|
+
p[c] = e[l][h], u.push(c);
|
|
2500
2500
|
}
|
|
2501
2501
|
for (let h = 0; h < u.length; h++) {
|
|
2502
2502
|
c = u[h];
|
|
2503
|
-
const g =
|
|
2503
|
+
const g = p[c];
|
|
2504
2504
|
for (let y in g) {
|
|
2505
2505
|
const C = g[y];
|
|
2506
2506
|
if (d === 1 || d === 0) {
|
|
@@ -2584,11 +2584,11 @@ function ka(e, t, n, s, r) {
|
|
|
2584
2584
|
e.segCount = a = t.parseUShort() >> 1, t.skip("uShort", 3), e.glyphIndexMap = {};
|
|
2585
2585
|
const o = new S.Parser(n, s + r + 14), i = new S.Parser(n, s + r + 16 + a * 2), l = new S.Parser(n, s + r + 16 + a * 4), c = new S.Parser(n, s + r + 16 + a * 6);
|
|
2586
2586
|
let u = s + r + 16 + a * 8;
|
|
2587
|
-
for (let
|
|
2588
|
-
let
|
|
2587
|
+
for (let p = 0; p < a - 1; p += 1) {
|
|
2588
|
+
let f;
|
|
2589
2589
|
const d = o.parseUShort(), h = i.parseUShort(), g = l.parseShort(), y = c.parseUShort();
|
|
2590
2590
|
for (let C = h; C <= d; C += 1)
|
|
2591
|
-
y !== 0 ? (u = c.offset + c.relativeOffset - 2, u += y, u += (C - h) * 2,
|
|
2591
|
+
y !== 0 ? (u = c.offset + c.relativeOffset - 2, u += y, u += (C - h) * 2, f = S.getUShort(n, u), f !== 0 && (f = f + g & 65535)) : f = C + g & 65535, e.glyphIndexMap[C] = f;
|
|
2592
2592
|
}
|
|
2593
2593
|
}
|
|
2594
2594
|
function Ca(e, t) {
|
|
@@ -2608,12 +2608,12 @@ function Ca(e, t) {
|
|
|
2608
2608
|
}
|
|
2609
2609
|
})), l && (t.relativeOffset = l, o.nonDefaultUVS = t.parseStruct({
|
|
2610
2610
|
uvsMappings: function() {
|
|
2611
|
-
const u = {},
|
|
2611
|
+
const u = {}, p = t.parseRecordList32({
|
|
2612
2612
|
unicodeValue: t.parseUInt24,
|
|
2613
2613
|
glyphID: t.parseUShort
|
|
2614
2614
|
});
|
|
2615
|
-
for (let
|
|
2616
|
-
u[f
|
|
2615
|
+
for (let f = 0; f < p.length; f += 1)
|
|
2616
|
+
u[p[f].unicodeValue] = p[f];
|
|
2617
2617
|
return u;
|
|
2618
2618
|
}
|
|
2619
2619
|
})), n[a] = o, t.relativeOffset = c;
|
|
@@ -2625,13 +2625,13 @@ function Oa(e, t) {
|
|
|
2625
2625
|
n.version = S.getUShort(e, t), I.argument(n.version === 0, "cmap table version should be 0."), n.numTables = S.getUShort(e, t + 2);
|
|
2626
2626
|
let s = null, r = -1, a = -1, o = null, i = null;
|
|
2627
2627
|
const l = [0, 1, 2, 3, 4, 6], c = [0, 1, 10];
|
|
2628
|
-
for (let
|
|
2629
|
-
if (o = S.getUShort(e, t + 4 +
|
|
2628
|
+
for (let p = n.numTables - 1; p >= 0; p -= 1)
|
|
2629
|
+
if (o = S.getUShort(e, t + 4 + p * 8), i = S.getUShort(e, t + 4 + p * 8 + 2), o === 3 && c.includes(i) || o === 0 && l.includes(i) || o === 1 && i === 0) {
|
|
2630
2630
|
if (a > 0) continue;
|
|
2631
|
-
if (a = S.getULong(e, t + 4 +
|
|
2631
|
+
if (a = S.getULong(e, t + 4 + p * 8 + 4), s)
|
|
2632
2632
|
break;
|
|
2633
2633
|
} else if (o === 0 && i === 5) {
|
|
2634
|
-
if (r = S.getULong(e, t + 4 +
|
|
2634
|
+
if (r = S.getULong(e, t + 4 + p * 8 + 4), s = new S.Parser(e, t + r), s.parseUShort() !== 14)
|
|
2635
2635
|
r = -1, s = null;
|
|
2636
2636
|
else if (a > 0)
|
|
2637
2637
|
break;
|
|
@@ -2718,10 +2718,10 @@ function Ia(e) {
|
|
|
2718
2718
|
return d.start - h.start;
|
|
2719
2719
|
}), r.segments = Ra(r.segments), Ea(r);
|
|
2720
2720
|
const a = r.segments.length;
|
|
2721
|
-
let o = 0, i = [], l = [], c = [], u = [],
|
|
2721
|
+
let o = 0, i = [], l = [], c = [], u = [], p = [], f = [];
|
|
2722
2722
|
for (n = 0; n < a; n += 1) {
|
|
2723
2723
|
const d = r.segments[n];
|
|
2724
|
-
d.end <= 65535 && d.start <= 65535 ? (i.push({ name: "end_" + n, type: "USHORT", value: d.end }), l.push({ name: "start_" + n, type: "USHORT", value: d.start }), c.push({ name: "idDelta_" + n, type: "SHORT", value: d.delta }), u.push({ name: "idRangeOffset_" + n, type: "USHORT", value: d.offset }), d.glyphId !== void 0 &&
|
|
2724
|
+
d.end <= 65535 && d.start <= 65535 ? (i.push({ name: "end_" + n, type: "USHORT", value: d.end }), l.push({ name: "start_" + n, type: "USHORT", value: d.start }), c.push({ name: "idDelta_" + n, type: "SHORT", value: d.delta }), u.push({ name: "idRangeOffset_" + n, type: "USHORT", value: d.offset }), d.glyphId !== void 0 && p.push({ name: "glyph_" + n, type: "USHORT", value: d.glyphId })) : o += 1, !t && d.glyphIndex !== void 0 && (f.push({ name: "cmap12Start_" + n, type: "ULONG", value: d.start }), f.push({ name: "cmap12End_" + n, type: "ULONG", value: d.end }), f.push({ name: "cmap12Glyph_" + n, type: "ULONG", value: d.glyphIndex }));
|
|
2725
2725
|
}
|
|
2726
2726
|
r.segCountX2 = (a - o) * 2, r.searchRange = Math.pow(2, Math.floor(Math.log(a - o) / Math.log(2))) * 2, r.entrySelector = Math.log(r.searchRange / 2) / Math.log(2), r.rangeShift = r.segCountX2 - r.searchRange;
|
|
2727
2727
|
for (let d = 0; d < i.length; d++)
|
|
@@ -2733,16 +2733,16 @@ function Ia(e) {
|
|
|
2733
2733
|
r.fields.push(c[d]);
|
|
2734
2734
|
for (let d = 0; d < u.length; d++)
|
|
2735
2735
|
r.fields.push(u[d]);
|
|
2736
|
-
for (let d = 0; d <
|
|
2737
|
-
r.fields.push(
|
|
2736
|
+
for (let d = 0; d < p.length; d++)
|
|
2737
|
+
r.fields.push(p[d]);
|
|
2738
2738
|
if (r.cmap4Length = 14 + // Subtable header
|
|
2739
2739
|
i.length * 2 + 2 + // reservedPad
|
|
2740
|
-
l.length * 2 + c.length * 2 + u.length * 2 +
|
|
2740
|
+
l.length * 2 + c.length * 2 + u.length * 2 + p.length * 2, !t) {
|
|
2741
2741
|
const d = 16 + // Subtable header
|
|
2742
|
-
|
|
2743
|
-
r.cmap12Offset = 12 + 2 * 2 + 4 + r.cmap4Length, r.fields.push({ name: "cmap12Format", type: "USHORT", value: 12 }, { name: "cmap12Reserved", type: "USHORT", value: 0 }, { name: "cmap12Length", type: "ULONG", value: d }, { name: "cmap12Language", type: "ULONG", value: 0 }, { name: "cmap12nGroups", type: "ULONG", value:
|
|
2744
|
-
for (let h = 0; h <
|
|
2745
|
-
r.fields.push(
|
|
2742
|
+
f.length * 4;
|
|
2743
|
+
r.cmap12Offset = 12 + 2 * 2 + 4 + r.cmap4Length, r.fields.push({ name: "cmap12Format", type: "USHORT", value: 12 }, { name: "cmap12Reserved", type: "USHORT", value: 0 }, { name: "cmap12Length", type: "ULONG", value: d }, { name: "cmap12Language", type: "ULONG", value: 0 }, { name: "cmap12nGroups", type: "ULONG", value: f.length / 3 });
|
|
2744
|
+
for (let h = 0; h < f.length; h++)
|
|
2745
|
+
r.fields.push(f[h]);
|
|
2746
2746
|
}
|
|
2747
2747
|
return r;
|
|
2748
2748
|
}
|
|
@@ -4691,82 +4691,82 @@ function Va(e, t) {
|
|
|
4691
4691
|
}
|
|
4692
4692
|
};
|
|
4693
4693
|
}
|
|
4694
|
-
function
|
|
4694
|
+
function J(e) {
|
|
4695
4695
|
this.bindConstructorValues(e);
|
|
4696
4696
|
}
|
|
4697
|
-
|
|
4697
|
+
J.prototype.bindConstructorValues = function(e) {
|
|
4698
4698
|
if (this.index = e.index || 0, e.name === ".notdef" ? e.unicode = void 0 : e.name === ".null" && (e.unicode = 0), e.unicode === 0 && e.name !== ".null")
|
|
4699
4699
|
throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');
|
|
4700
4700
|
this.name = e.name || null, this.unicode = e.unicode, this.unicodes = e.unicodes || (e.unicode !== void 0 ? [e.unicode] : []), "xMin" in e && (this.xMin = e.xMin), "yMin" in e && (this.yMin = e.yMin), "xMax" in e && (this.xMax = e.xMax), "yMax" in e && (this.yMax = e.yMax), "advanceWidth" in e && (this.advanceWidth = e.advanceWidth), "leftSideBearing" in e && (this.leftSideBearing = e.leftSideBearing), "points" in e && (this.points = e.points), Object.defineProperty(this, "path", Va(this, e.path));
|
|
4701
4701
|
};
|
|
4702
|
-
|
|
4702
|
+
J.prototype.addUnicode = function(e) {
|
|
4703
4703
|
this.unicodes.length === 0 && (this.unicode = e), this.unicodes.push(e);
|
|
4704
4704
|
};
|
|
4705
|
-
|
|
4705
|
+
J.prototype.getBoundingBox = function() {
|
|
4706
4706
|
return this.path.getBoundingBox();
|
|
4707
4707
|
};
|
|
4708
|
-
|
|
4708
|
+
J.prototype.getPath = function(e, t, n, s, r) {
|
|
4709
4709
|
e = e !== void 0 ? e : 0, t = t !== void 0 ? t : 0, n = n !== void 0 ? n : 72, s = Object.assign({}, r && r.defaultRenderOptions, s);
|
|
4710
4710
|
let a, o, i = s.xScale, l = s.yScale;
|
|
4711
4711
|
const c = 1 / (this.path.unitsPerEm || 1e3) * n;
|
|
4712
4712
|
let u = this;
|
|
4713
4713
|
r && r.variation && (u = r.variation.getTransform(this, s.variation), a = u.path.commands), s.hinting && r && r.hinting && (o = u.path && r.hinting.exec(u, n, s)), o ? (a = r.hinting.getCommands(o), e = Math.round(e), t = Math.round(t), i = l = 1) : (a = u.path.commands, i === void 0 && (i = c), l === void 0 && (l = c));
|
|
4714
|
-
const
|
|
4714
|
+
const p = new Ke();
|
|
4715
4715
|
if (s.drawSVG) {
|
|
4716
|
-
const
|
|
4717
|
-
if (
|
|
4716
|
+
const f = this.getSvgImage(r);
|
|
4717
|
+
if (f) {
|
|
4718
4718
|
const d = new Ke();
|
|
4719
4719
|
return d._image = {
|
|
4720
|
-
image:
|
|
4721
|
-
x: e +
|
|
4722
|
-
y: t -
|
|
4723
|
-
width:
|
|
4724
|
-
height:
|
|
4725
|
-
},
|
|
4720
|
+
image: f.image,
|
|
4721
|
+
x: e + f.leftSideBearing * c,
|
|
4722
|
+
y: t - f.baseline * c,
|
|
4723
|
+
width: f.image.width * c,
|
|
4724
|
+
height: f.image.height * c
|
|
4725
|
+
}, p._layers = [d], p;
|
|
4726
4726
|
}
|
|
4727
4727
|
}
|
|
4728
4728
|
if (s.drawLayers) {
|
|
4729
|
-
const
|
|
4730
|
-
if (
|
|
4731
|
-
|
|
4732
|
-
for (let d = 0; d <
|
|
4733
|
-
const h =
|
|
4729
|
+
const f = this.getLayers(r);
|
|
4730
|
+
if (f && f.length) {
|
|
4731
|
+
p._layers = [];
|
|
4732
|
+
for (let d = 0; d < f.length; d += 1) {
|
|
4733
|
+
const h = f[d];
|
|
4734
4734
|
let g = kn(r, h.paletteIndex, s.usePalette);
|
|
4735
|
-
g === "currentColor" ? g = s.fill || "black" : g = tt(g, s.colorFormat || "rgba"), s = Object.assign({}, s, { fill: g }),
|
|
4735
|
+
g === "currentColor" ? g = s.fill || "black" : g = tt(g, s.colorFormat || "rgba"), s = Object.assign({}, s, { fill: g }), p._layers.push(this.getPath.call(h.glyph, e, t, n, s, r));
|
|
4736
4736
|
}
|
|
4737
|
-
return
|
|
4737
|
+
return p;
|
|
4738
4738
|
}
|
|
4739
4739
|
}
|
|
4740
|
-
|
|
4741
|
-
for (let
|
|
4742
|
-
const d = a[
|
|
4743
|
-
d.type === "M" ?
|
|
4740
|
+
p.fill = s.fill || this.path.fill, p.stroke = this.path.stroke, p.strokeWidth = this.path.strokeWidth * c;
|
|
4741
|
+
for (let f = 0; f < a.length; f += 1) {
|
|
4742
|
+
const d = a[f];
|
|
4743
|
+
d.type === "M" ? p.moveTo(e + d.x * i, t + -d.y * l) : d.type === "L" ? p.lineTo(e + d.x * i, t + -d.y * l) : d.type === "Q" ? p.quadraticCurveTo(
|
|
4744
4744
|
e + d.x1 * i,
|
|
4745
4745
|
t + -d.y1 * l,
|
|
4746
4746
|
e + d.x * i,
|
|
4747
4747
|
t + -d.y * l
|
|
4748
|
-
) : d.type === "C" ?
|
|
4748
|
+
) : d.type === "C" ? p.curveTo(
|
|
4749
4749
|
e + d.x1 * i,
|
|
4750
4750
|
t + -d.y1 * l,
|
|
4751
4751
|
e + d.x2 * i,
|
|
4752
4752
|
t + -d.y2 * l,
|
|
4753
4753
|
e + d.x * i,
|
|
4754
4754
|
t + -d.y * l
|
|
4755
|
-
) : d.type === "Z" &&
|
|
4755
|
+
) : d.type === "Z" && p.stroke && p.strokeWidth && p.closePath();
|
|
4756
4756
|
}
|
|
4757
|
-
return
|
|
4757
|
+
return p;
|
|
4758
4758
|
};
|
|
4759
|
-
|
|
4759
|
+
J.prototype.getLayers = function(e) {
|
|
4760
4760
|
if (!e)
|
|
4761
4761
|
throw new Error("The font object is required to read the colr/cpal tables in order to get the layers.");
|
|
4762
4762
|
return e.layers.get(this.index);
|
|
4763
4763
|
};
|
|
4764
|
-
|
|
4764
|
+
J.prototype.getSvgImage = function(e) {
|
|
4765
4765
|
if (!e)
|
|
4766
4766
|
throw new Error("The font object is required to read the svg table in order to get the image.");
|
|
4767
4767
|
return e.svgImages.get(this.index);
|
|
4768
4768
|
};
|
|
4769
|
-
|
|
4769
|
+
J.prototype.getContours = function(e = null) {
|
|
4770
4770
|
if (this.points === void 0 && !e)
|
|
4771
4771
|
return [];
|
|
4772
4772
|
const t = [];
|
|
@@ -4777,7 +4777,7 @@ Q.prototype.getContours = function(e = null) {
|
|
|
4777
4777
|
}
|
|
4778
4778
|
return I.argument(n.length === 0, "There are still points left in the current contour."), t;
|
|
4779
4779
|
};
|
|
4780
|
-
|
|
4780
|
+
J.prototype.getMetrics = function() {
|
|
4781
4781
|
const e = this.path.commands, t = [], n = [];
|
|
4782
4782
|
for (let r = 0; r < e.length; r += 1) {
|
|
4783
4783
|
const a = e[r];
|
|
@@ -4792,35 +4792,35 @@ Q.prototype.getMetrics = function() {
|
|
|
4792
4792
|
};
|
|
4793
4793
|
return isFinite(s.xMin) || (s.xMin = 0), isFinite(s.xMax) || (s.xMax = this.advanceWidth), isFinite(s.yMin) || (s.yMin = 0), isFinite(s.yMax) || (s.yMax = 0), s.rightSideBearing = this.advanceWidth - s.leftSideBearing - (s.xMax - s.xMin), s;
|
|
4794
4794
|
};
|
|
4795
|
-
|
|
4795
|
+
J.prototype.draw = function(e, t, n, s, r, a) {
|
|
4796
4796
|
r = Object.assign({}, a && a.defaultRenderOptions, r), this.getPath(t, n, s, r, a).draw(e);
|
|
4797
4797
|
};
|
|
4798
|
-
|
|
4798
|
+
J.prototype.drawPoints = function(e, t, n, s, r, a) {
|
|
4799
4799
|
if (r = Object.assign({}, a && a.defaultRenderOptions, r), r.drawLayers) {
|
|
4800
|
-
const
|
|
4801
|
-
if (
|
|
4802
|
-
for (let d = 0; d <
|
|
4803
|
-
|
|
4800
|
+
const f = this.getLayers(a);
|
|
4801
|
+
if (f && f.length) {
|
|
4802
|
+
for (let d = 0; d < f.length; d += 1)
|
|
4803
|
+
f[d].glyph.index !== this.index && this.drawPoints.call(f[d].glyph, e, t, n, s);
|
|
4804
4804
|
return;
|
|
4805
4805
|
}
|
|
4806
4806
|
}
|
|
4807
|
-
function o(
|
|
4807
|
+
function o(f, d, h, g) {
|
|
4808
4808
|
e.beginPath();
|
|
4809
|
-
for (let y = 0; y <
|
|
4810
|
-
e.moveTo(d +
|
|
4809
|
+
for (let y = 0; y < f.length; y += 1)
|
|
4810
|
+
e.moveTo(d + f[y].x * g, h + f[y].y * g), e.arc(d + f[y].x * g, h + f[y].y * g, 2, 0, Math.PI * 2, !1);
|
|
4811
4811
|
e.fill();
|
|
4812
4812
|
}
|
|
4813
4813
|
t = t !== void 0 ? t : 0, n = n !== void 0 ? n : 0, s = s !== void 0 ? s : 24;
|
|
4814
4814
|
const i = 1 / this.path.unitsPerEm * s, l = [], c = [];
|
|
4815
|
-
let
|
|
4816
|
-
a && a.variation && (
|
|
4817
|
-
for (let
|
|
4818
|
-
const d = f
|
|
4815
|
+
let p = this.path.commands;
|
|
4816
|
+
a && a.variation && (p = a.variation.getTransform(this, r.variation).path.commands);
|
|
4817
|
+
for (let f = 0; f < p.length; f += 1) {
|
|
4818
|
+
const d = p[f];
|
|
4819
4819
|
d.x !== void 0 && l.push({ x: d.x, y: -d.y }), d.x1 !== void 0 && c.push({ x: d.x1, y: -d.y1 }), d.x2 !== void 0 && c.push({ x: d.x2, y: -d.y2 });
|
|
4820
4820
|
}
|
|
4821
4821
|
e.fillStyle = "blue", o(l, t, n, i), e.fillStyle = "red", o(c, t, n, i);
|
|
4822
4822
|
};
|
|
4823
|
-
|
|
4823
|
+
J.prototype.drawMetrics = function(e, t, n, s) {
|
|
4824
4824
|
let r;
|
|
4825
4825
|
t = t !== void 0 ? t : 0, n = n !== void 0 ? n : 0, s = s !== void 0 ? s : 24, r = 1 / this.path.unitsPerEm * s, e.lineWidth = 1, e.strokeStyle = "black", _e.line(e, t, -1e4, t, 1e4), _e.line(e, -1e4, n, 1e4, n);
|
|
4826
4826
|
const a = this.xMin || 0;
|
|
@@ -4830,26 +4830,26 @@ Q.prototype.drawMetrics = function(e, t, n, s) {
|
|
|
4830
4830
|
const c = this.advanceWidth || 0;
|
|
4831
4831
|
e.strokeStyle = "blue", _e.line(e, t + a * r, -1e4, t + a * r, 1e4), _e.line(e, t + i * r, -1e4, t + i * r, 1e4), _e.line(e, -1e4, n + -o * r, 1e4, n + -o * r), _e.line(e, -1e4, n + -l * r, 1e4, n + -l * r), e.strokeStyle = "green", _e.line(e, t + c * r, -1e4, t + c * r, 1e4);
|
|
4832
4832
|
};
|
|
4833
|
-
|
|
4833
|
+
J.prototype.toPathData = function(e, t) {
|
|
4834
4834
|
e = Object.assign({}, { variation: t && t.defaultRenderOptions.variation }, e);
|
|
4835
4835
|
let n = this;
|
|
4836
4836
|
t && t.variation && (n = t.variation.getTransform(this, e.variation));
|
|
4837
4837
|
let s = n.points && e.pointsTransform ? e.pointsTransform(n.points) : n.path;
|
|
4838
4838
|
return e.pathTransform && (s = e.pathTransform(s)), s.toPathData(e);
|
|
4839
4839
|
};
|
|
4840
|
-
|
|
4840
|
+
J.prototype.fromSVG = function(e, t = {}) {
|
|
4841
4841
|
return this.path.fromSVG(e, t);
|
|
4842
4842
|
};
|
|
4843
|
-
|
|
4843
|
+
J.prototype.toSVG = function(e, t) {
|
|
4844
4844
|
const n = this.toPathData.apply(this, [e, t]);
|
|
4845
4845
|
return this.path.toSVG(e, n);
|
|
4846
4846
|
};
|
|
4847
|
-
|
|
4847
|
+
J.prototype.toDOMElement = function(e, t) {
|
|
4848
4848
|
e = Object.assign({}, { variation: t && t.defaultRenderOptions.variation }, e);
|
|
4849
4849
|
let n = this.path;
|
|
4850
4850
|
return t && t.variation && (n = t.variation.getTransform(this, e.variation).path), n.toDOMElement(e);
|
|
4851
4851
|
};
|
|
4852
|
-
var ot =
|
|
4852
|
+
var ot = J;
|
|
4853
4853
|
function Xe(e, t, n) {
|
|
4854
4854
|
Object.defineProperty(e, t, {
|
|
4855
4855
|
get: function() {
|
|
@@ -4942,15 +4942,15 @@ function Te(e, t, n, s) {
|
|
|
4942
4942
|
if (o !== 0) {
|
|
4943
4943
|
const u = S.getByte(e, t + i);
|
|
4944
4944
|
l = t + (o + 1) * u + i;
|
|
4945
|
-
let
|
|
4946
|
-
for (let
|
|
4947
|
-
r.push(S.getOffset(e,
|
|
4945
|
+
let p = t + i + 1;
|
|
4946
|
+
for (let f = 0; f < o + 1; f += 1)
|
|
4947
|
+
r.push(S.getOffset(e, p, u)), p += u;
|
|
4948
4948
|
c = l + r[o];
|
|
4949
4949
|
} else
|
|
4950
4950
|
c = t + i;
|
|
4951
4951
|
for (let u = 0; u < r.length - 1; u += 1) {
|
|
4952
|
-
let
|
|
4953
|
-
n && (
|
|
4952
|
+
let p = S.getBytes(e, l + r[u], l + r[u + 1]);
|
|
4953
|
+
n && (p = n(p, e, t, s)), a.push(p);
|
|
4954
4954
|
}
|
|
4955
4955
|
return { objects: a, startOffset: t, endOffset: c };
|
|
4956
4956
|
}
|
|
@@ -5149,8 +5149,8 @@ function so(e, t, n) {
|
|
|
5149
5149
|
if (i !== 0 && l !== 0) {
|
|
5150
5150
|
const c = wn(e, l + t, i, [], 2);
|
|
5151
5151
|
if (c.subrs) {
|
|
5152
|
-
const u = l + c.subrs,
|
|
5153
|
-
o._subrs =
|
|
5152
|
+
const u = l + c.subrs, p = Te(e, u + t, void 0, 2);
|
|
5153
|
+
o._subrs = p.objects, o._subrsBias = Pt(o._subrs);
|
|
5154
5154
|
}
|
|
5155
5155
|
o._privateDict = c;
|
|
5156
5156
|
}
|
|
@@ -5165,12 +5165,12 @@ function Yt(e, t, n, s, r) {
|
|
|
5165
5165
|
l._subrs = [], l._subrsBias = 0, l._defaultWidthX = 0, l._nominalWidthX = 0;
|
|
5166
5166
|
const c = r < 2 ? l.private[0] : 0, u = r < 2 ? l.private[1] : 0;
|
|
5167
5167
|
if (c !== 0 && u !== 0) {
|
|
5168
|
-
const
|
|
5169
|
-
if (l._defaultWidthX =
|
|
5170
|
-
const
|
|
5168
|
+
const p = wn(e, u + t, c, s, r);
|
|
5169
|
+
if (l._defaultWidthX = p.defaultWidthX, l._nominalWidthX = p.nominalWidthX, p.subrs !== 0) {
|
|
5170
|
+
const f = u + p.subrs, d = Te(e, f + t, void 0, r);
|
|
5171
5171
|
l._subrs = d.objects, l._subrsBias = Pt(l._subrs);
|
|
5172
5172
|
}
|
|
5173
|
-
l._privateDict =
|
|
5173
|
+
l._privateDict = p;
|
|
5174
5174
|
}
|
|
5175
5175
|
a.push(l);
|
|
5176
5176
|
}
|
|
@@ -5228,13 +5228,13 @@ function nr(e, t) {
|
|
|
5228
5228
|
const n = e.tables.cff && e.tables.cff.topDict && e.tables.cff.topDict.paintType || 0;
|
|
5229
5229
|
return n === 2 && (t.fill = null, t.stroke = "black", t.strokeWidth = e.tables.cff.topDict.strokeWidth || 0), n;
|
|
5230
5230
|
}
|
|
5231
|
-
function
|
|
5231
|
+
function fn(e, t, n, s, r) {
|
|
5232
5232
|
let a, o, i, l;
|
|
5233
5233
|
const c = new Ke(), u = [];
|
|
5234
|
-
let
|
|
5234
|
+
let p = 0, f = !1, d = !1, h = 0, g = 0, y, C, k, w, L = 0, U = [], D, F = 0;
|
|
5235
5235
|
const z = e.tables.cff2 || e.tables.cff;
|
|
5236
5236
|
if (k = z.topDict._defaultWidthX, w = z.topDict._nominalWidthX, r = r || e.variation && e.variation.get(), t.getBlendPath || (t.getBlendPath = function(x) {
|
|
5237
|
-
return
|
|
5237
|
+
return fn(e, t, n, s, x);
|
|
5238
5238
|
}), e.isCIDFont || s > 1) {
|
|
5239
5239
|
const x = z.topDict._fdSelect ? z.topDict._fdSelect[t.index] : 0, T = z.topDict._fdArray[x];
|
|
5240
5240
|
y = T._subrs, C = T._subrsBias, s > 1 ? (U = z.topDict._vstore.itemVariationStore, L = T._privateDict.vsindex) : (k = T._defaultWidthX, w = T._nominalWidthX);
|
|
@@ -5245,23 +5245,23 @@ function pn(e, t, n, s, r) {
|
|
|
5245
5245
|
function _(x, T) {
|
|
5246
5246
|
d && B !== 2 && c.closePath(), c.moveTo(x, T), d = !0;
|
|
5247
5247
|
}
|
|
5248
|
-
function
|
|
5248
|
+
function V() {
|
|
5249
5249
|
let x;
|
|
5250
|
-
x = (u.length & 1) !== 0, x && !
|
|
5250
|
+
x = (u.length & 1) !== 0, x && !f && (O = u.shift() + w), p += u.length >> 1, u.length = 0, f = !0;
|
|
5251
5251
|
}
|
|
5252
5252
|
function E(x) {
|
|
5253
|
-
let T,
|
|
5253
|
+
let T, G, $, We, re, ae, ee, ce, K, ie, te, ne, W = 0;
|
|
5254
5254
|
for (; W < x.length; ) {
|
|
5255
|
-
let
|
|
5256
|
-
switch (W += 1,
|
|
5255
|
+
let pe = x[W];
|
|
5256
|
+
switch (W += 1, pe) {
|
|
5257
5257
|
case 1:
|
|
5258
|
-
|
|
5258
|
+
V();
|
|
5259
5259
|
break;
|
|
5260
5260
|
case 3:
|
|
5261
|
-
|
|
5261
|
+
V();
|
|
5262
5262
|
break;
|
|
5263
5263
|
case 4:
|
|
5264
|
-
u.length > 1 && !
|
|
5264
|
+
u.length > 1 && !f && (O = u.shift() + w, f = !0), g += u.pop(), _(h, g);
|
|
5265
5265
|
break;
|
|
5266
5266
|
case 5:
|
|
5267
5267
|
for (; u.length > 0; )
|
|
@@ -5295,21 +5295,21 @@ function pn(e, t, n, s, r) {
|
|
|
5295
5295
|
}
|
|
5296
5296
|
return;
|
|
5297
5297
|
case 12:
|
|
5298
|
-
switch (
|
|
5298
|
+
switch (pe = x[W], W += 1, pe) {
|
|
5299
5299
|
case 35:
|
|
5300
|
-
a = h + u.shift(), o = g + u.shift(), i = a + u.shift(), l = o + u.shift(), ee = i + u.shift(), ce = l + u.shift(),
|
|
5300
|
+
a = h + u.shift(), o = g + u.shift(), i = a + u.shift(), l = o + u.shift(), ee = i + u.shift(), ce = l + u.shift(), K = ee + u.shift(), ie = ce + u.shift(), te = K + u.shift(), ne = ie + u.shift(), h = te + u.shift(), g = ne + u.shift(), u.shift(), c.curveTo(a, o, i, l, ee, ce), c.curveTo(K, ie, te, ne, h, g);
|
|
5301
5301
|
break;
|
|
5302
5302
|
case 34:
|
|
5303
|
-
a = h + u.shift(), o = g, i = a + u.shift(), l = o + u.shift(), ee = i + u.shift(), ce = l,
|
|
5303
|
+
a = h + u.shift(), o = g, i = a + u.shift(), l = o + u.shift(), ee = i + u.shift(), ce = l, K = ee + u.shift(), ie = l, te = K + u.shift(), ne = g, h = te + u.shift(), c.curveTo(a, o, i, l, ee, ce), c.curveTo(K, ie, te, ne, h, g);
|
|
5304
5304
|
break;
|
|
5305
5305
|
case 36:
|
|
5306
|
-
a = h + u.shift(), o = g + u.shift(), i = a + u.shift(), l = o + u.shift(), ee = i + u.shift(), ce = l,
|
|
5306
|
+
a = h + u.shift(), o = g + u.shift(), i = a + u.shift(), l = o + u.shift(), ee = i + u.shift(), ce = l, K = ee + u.shift(), ie = l, te = K + u.shift(), ne = ie + u.shift(), h = te + u.shift(), c.curveTo(a, o, i, l, ee, ce), c.curveTo(K, ie, te, ne, h, g);
|
|
5307
5307
|
break;
|
|
5308
5308
|
case 37:
|
|
5309
|
-
a = h + u.shift(), o = g + u.shift(), i = a + u.shift(), l = o + u.shift(), ee = i + u.shift(), ce = l + u.shift(),
|
|
5309
|
+
a = h + u.shift(), o = g + u.shift(), i = a + u.shift(), l = o + u.shift(), ee = i + u.shift(), ce = l + u.shift(), K = ee + u.shift(), ie = ce + u.shift(), te = K + u.shift(), ne = ie + u.shift(), Math.abs(te - h) > Math.abs(ne - g) ? h = te + u.shift() : g = ne + u.shift(), c.curveTo(a, o, i, l, ee, ce), c.curveTo(K, ie, te, ne, h, g);
|
|
5310
5310
|
break;
|
|
5311
5311
|
default:
|
|
5312
|
-
console.log("Glyph " + t.index + ": unknown operator 1200" +
|
|
5312
|
+
console.log("Glyph " + t.index + ": unknown operator 1200" + pe), u.length = 0;
|
|
5313
5313
|
}
|
|
5314
5314
|
break;
|
|
5315
5315
|
case 14:
|
|
@@ -5338,7 +5338,7 @@ function pn(e, t, n, s, r) {
|
|
|
5338
5338
|
}
|
|
5339
5339
|
c.extend(zt);
|
|
5340
5340
|
}
|
|
5341
|
-
} else u.length > 0 && !
|
|
5341
|
+
} else u.length > 0 && !f && (O = u.shift() + w, f = !0);
|
|
5342
5342
|
d && B !== 2 && (c.closePath(), d = !1);
|
|
5343
5343
|
break;
|
|
5344
5344
|
case 15:
|
|
@@ -5354,32 +5354,32 @@ function pn(e, t, n, s, r) {
|
|
|
5354
5354
|
break;
|
|
5355
5355
|
}
|
|
5356
5356
|
D || (D = e.variation && r && e.variation.process.getBlendVector(U, L, r));
|
|
5357
|
-
var
|
|
5357
|
+
var H = u.pop(), oe = D ? D.length : U.itemVariationSubtables[L].regionIndexes.length, fe = H * oe, de = u.length - fe, Ee = de - H;
|
|
5358
5358
|
if (D)
|
|
5359
|
-
for (let Ne = 0; Ne <
|
|
5359
|
+
for (let Ne = 0; Ne < H; Ne++) {
|
|
5360
5360
|
var An = u[Ee + Ne];
|
|
5361
5361
|
for (let qe = 0; qe < oe; qe++)
|
|
5362
5362
|
An += D[qe] * u[de++];
|
|
5363
5363
|
u[Ee + Ne] = An;
|
|
5364
5364
|
}
|
|
5365
|
-
for (;
|
|
5365
|
+
for (; fe--; )
|
|
5366
5366
|
u.pop();
|
|
5367
5367
|
break;
|
|
5368
5368
|
case 18:
|
|
5369
|
-
|
|
5369
|
+
V();
|
|
5370
5370
|
break;
|
|
5371
5371
|
case 19:
|
|
5372
5372
|
case 20:
|
|
5373
|
-
|
|
5373
|
+
V(), W += p + 7 >> 3;
|
|
5374
5374
|
break;
|
|
5375
5375
|
case 21:
|
|
5376
|
-
u.length > 2 && !
|
|
5376
|
+
u.length > 2 && !f && (O = u.shift() + w, f = !0), g += u.pop(), h += u.pop(), _(h, g);
|
|
5377
5377
|
break;
|
|
5378
5378
|
case 22:
|
|
5379
|
-
u.length > 1 && !
|
|
5379
|
+
u.length > 1 && !f && (O = u.shift() + w, f = !0), h += u.pop(), _(h, g);
|
|
5380
5380
|
break;
|
|
5381
5381
|
case 23:
|
|
5382
|
-
|
|
5382
|
+
V();
|
|
5383
5383
|
break;
|
|
5384
5384
|
case 24:
|
|
5385
5385
|
for (; u.length > 2; )
|
|
@@ -5400,7 +5400,7 @@ function pn(e, t, n, s, r) {
|
|
|
5400
5400
|
a = h + u.shift(), o = g, i = a + u.shift(), l = o + u.shift(), h = i + u.shift(), g = l, c.curveTo(a, o, i, l, h, g);
|
|
5401
5401
|
break;
|
|
5402
5402
|
case 28:
|
|
5403
|
-
T = x[W],
|
|
5403
|
+
T = x[W], G = x[W + 1], u.push((T << 24 | G << 16) >> 16), W += 2;
|
|
5404
5404
|
break;
|
|
5405
5405
|
case 29:
|
|
5406
5406
|
if (re = u.pop() + e.gsubrsBias, ae = e.gsubrs[re], ae) {
|
|
@@ -5420,18 +5420,18 @@ function pn(e, t, n, s, r) {
|
|
|
5420
5420
|
a = h, o = g + u.shift(), i = a + u.shift(), l = o + u.shift(), h = i + u.shift(), g = l + (u.length === 1 ? u.shift() : 0), c.curveTo(a, o, i, l, h, g);
|
|
5421
5421
|
break;
|
|
5422
5422
|
default:
|
|
5423
|
-
|
|
5423
|
+
pe < 32 ? console.log("Glyph " + t.index + ": unknown operator " + pe) : pe < 247 ? u.push(pe - 139) : pe < 251 ? (T = x[W], W += 1, u.push((pe - 247) * 256 + T + 108)) : pe < 255 ? (T = x[W], W += 1, u.push(-(pe - 251) * 256 - T - 108)) : (T = x[W], G = x[W + 1], $ = x[W + 2], We = x[W + 3], W += 4, u.push((T << 24 | G << 16 | $ << 8 | We) / 65536));
|
|
5424
5424
|
}
|
|
5425
5425
|
}
|
|
5426
5426
|
}
|
|
5427
5427
|
return E(n), e.variation && r && (c.commands = c.commands.map((x) => {
|
|
5428
5428
|
const T = Object.keys(x);
|
|
5429
|
-
for (let
|
|
5430
|
-
const
|
|
5431
|
-
|
|
5429
|
+
for (let G = 0; G < T.length; G++) {
|
|
5430
|
+
const $ = T[G];
|
|
5431
|
+
$ !== "type" && (x[$] = Math.round(x[$]));
|
|
5432
5432
|
}
|
|
5433
5433
|
return x;
|
|
5434
|
-
})),
|
|
5434
|
+
})), f && (t.advanceWidth = O), c;
|
|
5435
5435
|
}
|
|
5436
5436
|
function qn(e, t, n, s, r) {
|
|
5437
5437
|
const a = [];
|
|
@@ -5448,18 +5448,18 @@ function qn(e, t, n, s, r) {
|
|
|
5448
5448
|
let u = l === 4 ? i.parseULong() : i.parseCard16();
|
|
5449
5449
|
if (u !== 0)
|
|
5450
5450
|
throw new Error(`CFF Table CID Font FDSelect format ${l} range has bad initial GID ${u}`);
|
|
5451
|
-
let
|
|
5452
|
-
for (let
|
|
5453
|
-
if (o = l === 4 ? i.parseUShort() : i.parseCard8(),
|
|
5451
|
+
let p;
|
|
5452
|
+
for (let f = 0; f < c; f++) {
|
|
5453
|
+
if (o = l === 4 ? i.parseUShort() : i.parseCard8(), p = l === 4 ? i.parseULong() : i.parseCard16(), o >= s)
|
|
5454
5454
|
throw new Error("CFF table CID Font FDSelect has bad FD index value " + o + " (FD count " + s + ")");
|
|
5455
|
-
if (
|
|
5456
|
-
throw new Error(`CFF Table CID Font FDSelect format ${r} range has bad GID ${
|
|
5457
|
-
for (; u <
|
|
5455
|
+
if (p > n)
|
|
5456
|
+
throw new Error(`CFF Table CID Font FDSelect format ${r} range has bad GID ${p}`);
|
|
5457
|
+
for (; u < p; u++)
|
|
5458
5458
|
a.push(o);
|
|
5459
|
-
u =
|
|
5459
|
+
u = p;
|
|
5460
5460
|
}
|
|
5461
|
-
if (
|
|
5462
|
-
throw new Error("CFF Table CID Font FDSelect format 3 range has bad final (Sentinal) GID " +
|
|
5461
|
+
if (p !== n)
|
|
5462
|
+
throw new Error("CFF Table CID Font FDSelect format 3 range has bad final (Sentinal) GID " + p);
|
|
5463
5463
|
} else
|
|
5464
5464
|
throw new Error("CFF Table CID Font FDSelect table has unsupported format " + l);
|
|
5465
5465
|
return a;
|
|
@@ -5472,54 +5472,54 @@ function io(e, t, n, s) {
|
|
|
5472
5472
|
n.gsubrs = c.objects, n.gsubrsBias = Pt(n.gsubrs);
|
|
5473
5473
|
let u;
|
|
5474
5474
|
if (a.formatMajor > 1) {
|
|
5475
|
-
const
|
|
5475
|
+
const f = t + a.size, d = S.getBytes(e, f, f + a.topDictLength);
|
|
5476
5476
|
u = Yt(e, 0, [d], void 0, a.formatMajor)[0];
|
|
5477
5477
|
} else {
|
|
5478
|
-
const
|
|
5479
|
-
if (
|
|
5480
|
-
throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " +
|
|
5481
|
-
u =
|
|
5478
|
+
const f = Yt(e, t, i.objects, l.objects, a.formatMajor);
|
|
5479
|
+
if (f.length !== 1)
|
|
5480
|
+
throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " + f.length);
|
|
5481
|
+
u = f[0];
|
|
5482
5482
|
}
|
|
5483
5483
|
if (r.topDict = u, u._privateDict && (n.defaultWidthX = u._privateDict.defaultWidthX, n.nominalWidthX = u._privateDict.nominalWidthX), a.formatMajor < 2 && u.ros[0] !== void 0 && u.ros[1] !== void 0 && (n.isCIDFont = !0), a.formatMajor > 1) {
|
|
5484
|
-
let
|
|
5485
|
-
if (!
|
|
5484
|
+
let f = u.fdArray, d = u.fdSelect;
|
|
5485
|
+
if (!f)
|
|
5486
5486
|
throw new Error("This is a CFF2 font, but FDArray information is missing");
|
|
5487
|
-
const h = Te(e, t +
|
|
5487
|
+
const h = Te(e, t + f, null, a.formatMajor), g = so(e, t, h.objects);
|
|
5488
5488
|
u._fdArray = g, d && (u._fdSelect = qn(e, t + d, n.numGlyphs, g.length, a.formatMajor));
|
|
5489
5489
|
} else if (n.isCIDFont) {
|
|
5490
|
-
let
|
|
5491
|
-
if (
|
|
5490
|
+
let f = u.fdArray, d = u.fdSelect;
|
|
5491
|
+
if (f === 0 || d === 0)
|
|
5492
5492
|
throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
|
|
5493
|
-
|
|
5494
|
-
const h = Te(e,
|
|
5493
|
+
f += t;
|
|
5494
|
+
const h = Te(e, f), g = Yt(e, t, h.objects, l.objects, a.formatMajor);
|
|
5495
5495
|
u._fdArray = g, d += t, u._fdSelect = qn(e, d, n.numGlyphs, g.length, a.formatMajor);
|
|
5496
5496
|
}
|
|
5497
5497
|
if (a.formatMajor < 2) {
|
|
5498
|
-
const
|
|
5498
|
+
const f = t + u.private[1], d = wn(e, f, u.private[0], l.objects, a.formatMajor);
|
|
5499
5499
|
if (n.defaultWidthX = d.defaultWidthX, n.nominalWidthX = d.nominalWidthX, d.subrs !== 0) {
|
|
5500
|
-
const h =
|
|
5500
|
+
const h = f + d.subrs, g = Te(e, h);
|
|
5501
5501
|
n.subrs = g.objects, n.subrsBias = Pt(n.subrs);
|
|
5502
5502
|
} else
|
|
5503
5503
|
n.subrs = [], n.subrsBias = 0;
|
|
5504
5504
|
}
|
|
5505
|
-
let
|
|
5506
|
-
if (s.lowMemory ? (
|
|
5507
|
-
let
|
|
5508
|
-
u.charset === 0 ?
|
|
5505
|
+
let p;
|
|
5506
|
+
if (s.lowMemory ? (p = qa(e, t + u.charStrings, a.formatMajor), n.nGlyphs = p.offsets.length - (a.formatMajor > 1 ? 1 : 0)) : (p = Te(e, t + u.charStrings, null, a.formatMajor), n.nGlyphs = p.objects.length), a.formatMajor > 1 && n.tables.maxp && n.nGlyphs !== n.tables.maxp.numGlyphs && console.error(`Glyph count in the CFF2 table (${n.nGlyphs}) must correspond to the glyph count in the maxp table (${n.tables.maxp.numGlyphs})`), a.formatMajor < 2) {
|
|
5507
|
+
let f = [], d = [];
|
|
5508
|
+
u.charset === 0 ? f = La : u.charset === 1 ? f = Aa : u.charset === 2 ? f = Ua : f = ro(e, t + u.charset, n.nGlyphs, l.objects, n.isCIDFont), u.encoding === 0 ? d = cn : u.encoding === 1 ? d = Da : d = ao(e, t + u.encoding), n.cffEncoding = new Ys(d, f), n.encoding = n.encoding || n.cffEncoding;
|
|
5509
5509
|
}
|
|
5510
5510
|
if (n.glyphs = new we.GlyphSet(n), s.lowMemory)
|
|
5511
|
-
n._push = function(
|
|
5512
|
-
const d = $a(
|
|
5513
|
-
n.glyphs.push(
|
|
5511
|
+
n._push = function(f) {
|
|
5512
|
+
const d = $a(f, p.offsets, e, t + u.charStrings, void 0, a.formatMajor);
|
|
5513
|
+
n.glyphs.push(f, we.cffGlyphLoader(n, f, fn, d, a.formatMajor));
|
|
5514
5514
|
};
|
|
5515
5515
|
else
|
|
5516
|
-
for (let
|
|
5517
|
-
const d =
|
|
5518
|
-
n.glyphs.push(
|
|
5516
|
+
for (let f = 0; f < n.nGlyphs; f += 1) {
|
|
5517
|
+
const d = p.objects[f];
|
|
5518
|
+
n.glyphs.push(f, we.cffGlyphLoader(n, f, fn, d, a.formatMajor));
|
|
5519
5519
|
}
|
|
5520
5520
|
if (u.vstore) {
|
|
5521
|
-
const
|
|
5522
|
-
u._vstore =
|
|
5521
|
+
const f = new S.Parser(e, t + u.vstore);
|
|
5522
|
+
u._vstore = f.parseVariationStore();
|
|
5523
5523
|
}
|
|
5524
5524
|
}
|
|
5525
5525
|
function sr(e, t) {
|
|
@@ -5573,12 +5573,12 @@ function co(e) {
|
|
|
5573
5573
|
t.strings.push({ name: "string_" + n, type: "STRING", value: e[n] });
|
|
5574
5574
|
return t;
|
|
5575
5575
|
}
|
|
5576
|
-
function
|
|
5576
|
+
function fo() {
|
|
5577
5577
|
return new v.Record("Global Subr INDEX", [
|
|
5578
5578
|
{ name: "subrs", type: "INDEX", value: [] }
|
|
5579
5579
|
]);
|
|
5580
5580
|
}
|
|
5581
|
-
function
|
|
5581
|
+
function po(e, t) {
|
|
5582
5582
|
const n = new v.Record("Charsets", [
|
|
5583
5583
|
{ name: "format", type: "Card8", value: 0 }
|
|
5584
5584
|
]);
|
|
@@ -5595,15 +5595,15 @@ function ho(e, t) {
|
|
|
5595
5595
|
for (let o = 0; o < s.commands.length; o += 1) {
|
|
5596
5596
|
let i, l, c = s.commands[o];
|
|
5597
5597
|
if (c.type === "Q") {
|
|
5598
|
-
const u = 0.3333333333333333,
|
|
5598
|
+
const u = 0.3333333333333333, p = 2 / 3;
|
|
5599
5599
|
c = {
|
|
5600
5600
|
type: "C",
|
|
5601
5601
|
x: c.x,
|
|
5602
5602
|
y: c.y,
|
|
5603
|
-
x1: Math.round(u * r +
|
|
5604
|
-
y1: Math.round(u * a +
|
|
5605
|
-
x2: Math.round(u * c.x +
|
|
5606
|
-
y2: Math.round(u * c.y +
|
|
5603
|
+
x1: Math.round(u * r + p * c.x1),
|
|
5604
|
+
y1: Math.round(u * a + p * c.y1),
|
|
5605
|
+
x2: Math.round(u * c.x + p * c.x1),
|
|
5606
|
+
y2: Math.round(u * c.y + p * c.y1)
|
|
5607
5607
|
};
|
|
5608
5608
|
}
|
|
5609
5609
|
if (c.type === "M")
|
|
@@ -5611,8 +5611,8 @@ function ho(e, t) {
|
|
|
5611
5611
|
else if (c.type === "L")
|
|
5612
5612
|
i = Math.round(c.x - r), l = Math.round(c.y - a), n.push({ name: "dx", type: "NUMBER", value: i }), n.push({ name: "dy", type: "NUMBER", value: l }), n.push({ name: "rlineto", type: "OP", value: 5 }), r = Math.round(c.x), a = Math.round(c.y);
|
|
5613
5613
|
else if (c.type === "C") {
|
|
5614
|
-
const u = Math.round(c.x1 - r),
|
|
5615
|
-
i = Math.round(c.x - c.x2), l = Math.round(c.y - c.y2), n.push({ name: "dx1", type: "NUMBER", value: u }), n.push({ name: "dy1", type: "NUMBER", value:
|
|
5614
|
+
const u = Math.round(c.x1 - r), p = Math.round(c.y1 - a), f = Math.round(c.x2 - c.x1), d = Math.round(c.y2 - c.y1);
|
|
5615
|
+
i = Math.round(c.x - c.x2), l = Math.round(c.y - c.y2), n.push({ name: "dx1", type: "NUMBER", value: u }), n.push({ name: "dy1", type: "NUMBER", value: p }), n.push({ name: "dx2", type: "NUMBER", value: f }), n.push({ name: "dy2", type: "NUMBER", value: d }), n.push({ name: "dx", type: "NUMBER", value: i }), n.push({ name: "dy", type: "NUMBER", value: l }), n.push({ name: "rrcurveto", type: "OP", value: 8 }), r = Math.round(c.x), a = Math.round(c.y);
|
|
5616
5616
|
}
|
|
5617
5617
|
}
|
|
5618
5618
|
return n.push({ name: "endchar", type: "OP", value: 14 }), n;
|
|
@@ -5658,16 +5658,16 @@ function yo(e, t) {
|
|
|
5658
5658
|
a.paintType && (r.paintType = a.paintType, r.strokeWidth = a.strokeWidth || 0);
|
|
5659
5659
|
const o = {}, i = [];
|
|
5660
5660
|
let l;
|
|
5661
|
-
for (let
|
|
5662
|
-
l = e.get(
|
|
5661
|
+
for (let f = 1; f < e.length; f += 1)
|
|
5662
|
+
l = e.get(f), i.push(l.name);
|
|
5663
5663
|
const c = [];
|
|
5664
5664
|
n.header = lo(), n.nameIndex = uo([t.postScriptName]);
|
|
5665
5665
|
let u = $n(r, c);
|
|
5666
|
-
n.topDictIndex = Xn(u), n.globalSubrIndex =
|
|
5667
|
-
const
|
|
5668
|
-
return r.charset =
|
|
5666
|
+
n.topDictIndex = Xn(u), n.globalSubrIndex = fo(), n.charsets = po(i, c), n.charStringsIndex = go(e), n.privateDict = mo(o, c), n.stringIndex = co(c);
|
|
5667
|
+
const p = n.header.sizeOf() + n.nameIndex.sizeOf() + n.topDictIndex.sizeOf() + n.stringIndex.sizeOf() + n.globalSubrIndex.sizeOf();
|
|
5668
|
+
return r.charset = p, r.encoding = 0, r.charStrings = r.charset + n.charsets.sizeOf(), r.private[1] = r.charStrings + n.charStringsIndex.sizeOf(), u = $n(r, c), n.topDictIndex = Xn(u), n;
|
|
5669
5669
|
}
|
|
5670
|
-
var
|
|
5670
|
+
var pn = { parse: io, make: yo };
|
|
5671
5671
|
function vo(e, t) {
|
|
5672
5672
|
const n = {}, s = new S.Parser(e, t);
|
|
5673
5673
|
return n.version = s.parseVersion(), n.fontRevision = Math.round(s.parseFixed() * 1e3) / 1e3, n.checkSumAdjustment = s.parseULong(), n.magicNumber = s.parseULong(), I.argument(n.magicNumber === 1594834165, "Font header has wrong magic number."), n.flags = s.parseUShort(), n.unitsPerEm = s.parseUShort(), n.created = s.parseLongDateTime(), n.modified = s.parseLongDateTime(), n.xMin = s.parseShort(), n.yMin = s.parseShort(), n.xMax = s.parseShort(), n.yMax = s.parseShort(), n.macStyle = s.parseUShort(), n.lowestRecPPEM = s.parseUShort(), n.fontDirectionHint = s.parseShort(), n.indexToLocFormat = s.parseShort(), n.glyphDataFormat = s.parseShort(), n;
|
|
@@ -6462,7 +6462,7 @@ function Po(e) {
|
|
|
6462
6462
|
{ name: "lookups", type: "TABLE", value: new v.LookupList(e.lookups, ze) }
|
|
6463
6463
|
]);
|
|
6464
6464
|
}
|
|
6465
|
-
var
|
|
6465
|
+
var fr = { parse: Mo, make: Po };
|
|
6466
6466
|
function Bo(e, t) {
|
|
6467
6467
|
const n = new S.Parser(e, t), s = n.parseULong();
|
|
6468
6468
|
I.argument(s === 1, "Unsupported META table version."), n.parseULong(), n.parseULong();
|
|
@@ -6491,7 +6491,7 @@ function No(e) {
|
|
|
6491
6491
|
}
|
|
6492
6492
|
return r.fields.push({ name: "stringPool", type: "CHARARRAY", value: n }), r;
|
|
6493
6493
|
}
|
|
6494
|
-
var
|
|
6494
|
+
var pr = { parse: Bo, make: No };
|
|
6495
6495
|
function _o(e, t) {
|
|
6496
6496
|
const n = new m(e, t), s = n.parseUShort();
|
|
6497
6497
|
s !== 0 && console.warn("Only COLRv0 is currently fully supported. A subset of color glyphs might be available in this font if provided in the v0 format.");
|
|
@@ -6615,10 +6615,10 @@ function qo(e, t, n) {
|
|
|
6615
6615
|
const o = s.parseUShort(), i = s.parseUShort(), l = s.parseUShort(), c = s.parseUShort(), u = [];
|
|
6616
6616
|
for (let d = 0; d < o; d++)
|
|
6617
6617
|
u.push(Vo(e, t + a + d * i, n));
|
|
6618
|
-
const
|
|
6618
|
+
const p = [], f = t + a + o * i;
|
|
6619
6619
|
for (let d = 0; d < l; d++)
|
|
6620
|
-
|
|
6621
|
-
return { axes: u, instances:
|
|
6620
|
+
p.push(jo(e, f + d * c, u, n, c));
|
|
6621
|
+
return { axes: u, instances: p };
|
|
6622
6622
|
}
|
|
6623
6623
|
var dr = { make: Wo, parse: qo }, $o = {
|
|
6624
6624
|
tag: m.tag,
|
|
@@ -6678,20 +6678,20 @@ function Yo(e, t, n) {
|
|
|
6678
6678
|
const o = [
|
|
6679
6679
|
r,
|
|
6680
6680
|
a
|
|
6681
|
-
], i = s.parseUShort(), l = s.parseUShort(), c = s.parseOffset32(), u = s.parseUShort(),
|
|
6681
|
+
], i = s.parseUShort(), l = s.parseUShort(), c = s.parseOffset32(), u = s.parseUShort(), p = s.parseOffset32(), f = r > 1 || a > 0 ? s.parseUShort() : void 0;
|
|
6682
6682
|
n !== void 0 && I.argument(l >= n.axes.length, "STAT axis count must be greater than or equal to fvar axis count"), u > 0 && I.argument(l >= 0, "STAT axis count must be greater than 0 if STAT axis value count is greater than 0");
|
|
6683
6683
|
const d = [];
|
|
6684
6684
|
for (let y = 0; y < l; y++)
|
|
6685
6685
|
s.offset = t + c, s.relativeOffset = y * i, d.push(s.parseStruct($o));
|
|
6686
|
-
s.offset = t, s.relativeOffset =
|
|
6686
|
+
s.offset = t, s.relativeOffset = p;
|
|
6687
6687
|
const h = s.parseUShortList(u), g = [];
|
|
6688
6688
|
for (let y = 0; y < u; y++)
|
|
6689
|
-
s.offset = t +
|
|
6689
|
+
s.offset = t + p, s.relativeOffset = h[y], g.push(Xo.apply(s));
|
|
6690
6690
|
return {
|
|
6691
6691
|
version: o,
|
|
6692
6692
|
axes: d,
|
|
6693
6693
|
values: g,
|
|
6694
|
-
elidedFallbackNameID:
|
|
6694
|
+
elidedFallbackNameID: f
|
|
6695
6695
|
};
|
|
6696
6696
|
}
|
|
6697
6697
|
var ut = new Array(5);
|
|
@@ -6821,10 +6821,10 @@ function ni(e, t, n) {
|
|
|
6821
6821
|
const i = [];
|
|
6822
6822
|
for (let l = 0; l < o; l++) {
|
|
6823
6823
|
const c = [], u = s.parseUShort();
|
|
6824
|
-
for (let
|
|
6825
|
-
const
|
|
6824
|
+
for (let p = 0; p < u; p++) {
|
|
6825
|
+
const f = s.parseF2Dot14(), d = s.parseF2Dot14();
|
|
6826
6826
|
c.push({
|
|
6827
|
-
fromCoordinate:
|
|
6827
|
+
fromCoordinate: f,
|
|
6828
6828
|
toCoordinate: d
|
|
6829
6829
|
});
|
|
6830
6830
|
}
|
|
@@ -6898,10 +6898,10 @@ function ui(e, t) {
|
|
|
6898
6898
|
r.relativeOffset = r.parseOffset32();
|
|
6899
6899
|
const o = e.byteOffset + t + r.relativeOffset, i = r.parseUShort(), l = /* @__PURE__ */ new Map();
|
|
6900
6900
|
for (let c = 0; c < i; c++) {
|
|
6901
|
-
const u = r.parseUShort(),
|
|
6902
|
-
let h = l.get(
|
|
6903
|
-
h === void 0 && (h = new Uint8Array(s,
|
|
6904
|
-
for (let g = u; g <=
|
|
6901
|
+
const u = r.parseUShort(), p = r.parseUShort(), f = o + r.parseOffset32(), d = r.parseULong();
|
|
6902
|
+
let h = l.get(f);
|
|
6903
|
+
h === void 0 && (h = new Uint8Array(s, f, d), l.set(f, h));
|
|
6904
|
+
for (let g = u; g <= p; g++)
|
|
6905
6905
|
n.set(g, h);
|
|
6906
6906
|
}
|
|
6907
6907
|
return n;
|
|
@@ -6909,8 +6909,8 @@ function ui(e, t) {
|
|
|
6909
6909
|
function ci(e) {
|
|
6910
6910
|
const t = Array.from(e.keys()).sort(), n = [], s = [], r = /* @__PURE__ */ new Map();
|
|
6911
6911
|
let a = 0, o = { endGlyphID: null };
|
|
6912
|
-
for (let
|
|
6913
|
-
const h = t[
|
|
6912
|
+
for (let f = 0, d = t.length; f < d; f++) {
|
|
6913
|
+
const h = t[f], g = e.get(h);
|
|
6914
6914
|
let y = r.get(g);
|
|
6915
6915
|
y === void 0 && (y = a, s.push(g), r.set(g, y), a += g.byteLength), h - 1 === o.endGlyphID && y === o.svgDocOffset ? o.endGlyphID = h : (o = {
|
|
6916
6916
|
startGlyphID: h,
|
|
@@ -6920,14 +6920,14 @@ function ci(e) {
|
|
|
6920
6920
|
}, n.push(o));
|
|
6921
6921
|
}
|
|
6922
6922
|
const i = n.length, l = s.length, c = 2 + i * 12, u = new Array(4 + i * 4 + l);
|
|
6923
|
-
let
|
|
6924
|
-
u[
|
|
6925
|
-
for (let
|
|
6926
|
-
const d = "documentRecord_" +
|
|
6927
|
-
u[
|
|
6928
|
-
}
|
|
6929
|
-
for (let
|
|
6930
|
-
u[
|
|
6923
|
+
let p = 0;
|
|
6924
|
+
u[p++] = { name: "version", type: "USHORT", value: 0 }, u[p++] = { name: "svgDocumentListOffset", type: "ULONG", value: 10 }, u[p++] = { name: "reserved", type: "ULONG", value: 0 }, u[p++] = { name: "numEntries", type: "USHORT", value: i };
|
|
6925
|
+
for (let f = 0; f < i; f++) {
|
|
6926
|
+
const d = "documentRecord_" + f, { startGlyphID: h, endGlyphID: g, svgDocOffset: y, svgDocLength: C } = n[f];
|
|
6927
|
+
u[p++] = { name: d + "_startGlyphID", type: "USHORT", value: h }, u[p++] = { name: d + "_endGlyphID", type: "USHORT", value: g }, u[p++] = { name: d + "_svgDocOffset", type: "ULONG", value: c + y }, u[p++] = { name: d + "_svgDocLength", type: "ULONG", value: C };
|
|
6928
|
+
}
|
|
6929
|
+
for (let f = 0; f < l; f++)
|
|
6930
|
+
u[p++] = { name: "svgDoc_" + f, type: "LITERAL", value: s[f] };
|
|
6931
6931
|
return new v.Table("SVG ", u);
|
|
6932
6932
|
}
|
|
6933
6933
|
var xr = {
|
|
@@ -6987,27 +6987,27 @@ function Kn(e, t, n) {
|
|
|
6987
6987
|
}
|
|
6988
6988
|
return n;
|
|
6989
6989
|
}
|
|
6990
|
-
function
|
|
6990
|
+
function fi(e) {
|
|
6991
6991
|
let t = 0;
|
|
6992
6992
|
for (let n = 0; n < e.length; n += 1)
|
|
6993
6993
|
t += e[n];
|
|
6994
6994
|
return t / e.length;
|
|
6995
6995
|
}
|
|
6996
|
-
function
|
|
6996
|
+
function pi(e) {
|
|
6997
6997
|
const t = [], n = [], s = [], r = [], a = [], o = [], i = [];
|
|
6998
|
-
let l, c = 0, u = 0,
|
|
6999
|
-
for (let
|
|
7000
|
-
const oe = e.glyphs.get(
|
|
6998
|
+
let l, c = 0, u = 0, p = 0, f = 0, d = 0;
|
|
6999
|
+
for (let H = 0; H < e.glyphs.length; H += 1) {
|
|
7000
|
+
const oe = e.glyphs.get(H), fe = oe.unicode | 0;
|
|
7001
7001
|
if (isNaN(oe.advanceWidth))
|
|
7002
|
-
throw new Error("Glyph " + oe.name + " (" +
|
|
7003
|
-
(l >
|
|
7004
|
-
const de = dn.getUnicodeRange(
|
|
7002
|
+
throw new Error("Glyph " + oe.name + " (" + H + "): advanceWidth is not a number.");
|
|
7003
|
+
(l > fe || l === void 0) && fe > 0 && (l = fe), c < fe && (c = fe);
|
|
7004
|
+
const de = dn.getUnicodeRange(fe);
|
|
7005
7005
|
if (de < 32)
|
|
7006
7006
|
u |= 1 << de;
|
|
7007
7007
|
else if (de < 64)
|
|
7008
|
-
|
|
7008
|
+
p |= 1 << de - 32;
|
|
7009
7009
|
else if (de < 96)
|
|
7010
|
-
|
|
7010
|
+
f |= 1 << de - 64;
|
|
7011
7011
|
else if (de < 123)
|
|
7012
7012
|
d |= 1 << de - 96;
|
|
7013
7013
|
else
|
|
@@ -7022,7 +7022,7 @@ function fi(e) {
|
|
|
7022
7022
|
xMax: Math.max.apply(null, s),
|
|
7023
7023
|
yMax: Math.max.apply(null, r),
|
|
7024
7024
|
advanceWidthMax: Math.max.apply(null, a),
|
|
7025
|
-
advanceWidthAvg:
|
|
7025
|
+
advanceWidthAvg: fi(a),
|
|
7026
7026
|
minLeftSideBearing: Math.min.apply(null, o),
|
|
7027
7027
|
maxLeftSideBearing: Math.max.apply(null, o),
|
|
7028
7028
|
minRightSideBearing: Math.min.apply(null, i)
|
|
@@ -7054,8 +7054,8 @@ function fi(e) {
|
|
|
7054
7054
|
usFirstCharIndex: l,
|
|
7055
7055
|
usLastCharIndex: c,
|
|
7056
7056
|
ulUnicodeRange1: u,
|
|
7057
|
-
ulUnicodeRange2:
|
|
7058
|
-
ulUnicodeRange3:
|
|
7057
|
+
ulUnicodeRange2: p,
|
|
7058
|
+
ulUnicodeRange3: f,
|
|
7059
7059
|
ulUnicodeRange4: d,
|
|
7060
7060
|
// See http://typophile.com/node/13081 for more info on vertical metrics.
|
|
7061
7061
|
// We get metrics for typical characters (such as "x" for xHeight).
|
|
@@ -7078,19 +7078,19 @@ function fi(e) {
|
|
|
7078
7078
|
let B = e.getEnglishName("postScriptName");
|
|
7079
7079
|
B || (B = D.replace(/\s/g, "") + "-" + F);
|
|
7080
7080
|
const O = {};
|
|
7081
|
-
for (let
|
|
7082
|
-
O[
|
|
7081
|
+
for (let H in e.names)
|
|
7082
|
+
O[H] = e.names[H];
|
|
7083
7083
|
O.unicode = O.unicode || {}, O.macintosh = O.macintosh || {}, O.windows = O.windows || {};
|
|
7084
|
-
const _ = e.names.unicode || {},
|
|
7085
|
-
for (const
|
|
7086
|
-
if (O[
|
|
7084
|
+
const _ = e.names.unicode || {}, V = e.names.macintosh || {}, E = e.names.windows || {};
|
|
7085
|
+
for (const H in O) {
|
|
7086
|
+
if (O[H] = O[H] || {}, !O[H].uniqueID) {
|
|
7087
7087
|
const oe = e.getEnglishName("manufacturer") || "";
|
|
7088
|
-
O[
|
|
7088
|
+
O[H].uniqueID = { en: `${oe}: ${z}` };
|
|
7089
7089
|
}
|
|
7090
|
-
O[
|
|
7090
|
+
O[H].postScriptName || (O[H].postScriptName = { en: B });
|
|
7091
7091
|
}
|
|
7092
|
-
O.unicode.preferredFamily || (O.unicode.preferredFamily = _.fontFamily ||
|
|
7093
|
-
const x = [], T = Ws.make(O, x),
|
|
7092
|
+
O.unicode.preferredFamily || (O.unicode.preferredFamily = _.fontFamily || V.fontFamily || E.fontFamily), O.macintosh.preferredFamily || (O.macintosh.preferredFamily = V.fontFamily || _.fontFamily || E.fontFamily), O.windows.preferredFamily || (O.windows.preferredFamily = E.fontFamily || _.fontFamily || V.fontFamily), O.unicode.preferredSubfamily || (O.unicode.preferredSubfamily = _.fontSubfamily || V.fontSubfamily || E.fontSubfamily), O.macintosh.preferredSubfamily || (O.macintosh.preferredSubfamily = V.fontSubfamily || _.fontSubfamily || E.fontSubfamily), O.windows.preferredSubfamily || (O.windows.preferredSubfamily = E.fontSubfamily || _.fontSubfamily || V.fontSubfamily);
|
|
7093
|
+
const x = [], T = Ws.make(O, x), G = x.length > 0 ? lr.make(x) : void 0, $ = cr.make(e), We = pn.make(e.glyphs, {
|
|
7094
7094
|
version: e.getEnglishName("version"),
|
|
7095
7095
|
fullName: z,
|
|
7096
7096
|
familyName: D,
|
|
@@ -7099,10 +7099,10 @@ function fi(e) {
|
|
|
7099
7099
|
unitsPerEm: e.unitsPerEm,
|
|
7100
7100
|
fontBBox: [0, h.yMin, h.ascender, h.advanceWidthMax],
|
|
7101
7101
|
topDict: e.tables.cff && e.tables.cff.topDict || {}
|
|
7102
|
-
}), re = e.metas && Object.keys(e.metas).length > 0 ?
|
|
7103
|
-
|
|
7102
|
+
}), re = e.metas && Object.keys(e.metas).length > 0 ? pr.make(e.metas) : void 0, ae = [y, C, k, w, T, U, $, We, L];
|
|
7103
|
+
G && ae.push(G);
|
|
7104
7104
|
const ee = {
|
|
7105
|
-
gsub:
|
|
7105
|
+
gsub: fr,
|
|
7106
7106
|
cpal: Qs,
|
|
7107
7107
|
colr: hr,
|
|
7108
7108
|
stat: gr,
|
|
@@ -7116,26 +7116,26 @@ function fi(e) {
|
|
|
7116
7116
|
avar: [e.tables.fvar],
|
|
7117
7117
|
fvar: [e.names]
|
|
7118
7118
|
};
|
|
7119
|
-
for (let
|
|
7120
|
-
const oe = e.tables[
|
|
7119
|
+
for (let H in ee) {
|
|
7120
|
+
const oe = e.tables[H];
|
|
7121
7121
|
if (oe) {
|
|
7122
|
-
const
|
|
7123
|
-
|
|
7122
|
+
const fe = ee[H].make.call(e, oe, ...ce[H] || []);
|
|
7123
|
+
fe && ae.push(fe);
|
|
7124
7124
|
}
|
|
7125
7125
|
}
|
|
7126
7126
|
re && ae.push(re);
|
|
7127
|
-
const
|
|
7127
|
+
const K = Sr(ae), ie = K.encode(), te = En(ie), ne = K.fields;
|
|
7128
7128
|
let W = !1;
|
|
7129
|
-
for (let
|
|
7130
|
-
if (ne[
|
|
7131
|
-
ne[
|
|
7129
|
+
for (let H = 0; H < ne.length; H += 1)
|
|
7130
|
+
if (ne[H].name === "head table") {
|
|
7131
|
+
ne[H].value.checkSumAdjustment = 2981146554 - te, W = !0;
|
|
7132
7132
|
break;
|
|
7133
7133
|
}
|
|
7134
7134
|
if (!W)
|
|
7135
7135
|
throw new Error("Could not find head table with checkSum to adjust.");
|
|
7136
|
-
return
|
|
7136
|
+
return K;
|
|
7137
7137
|
}
|
|
7138
|
-
var hi = { make: Sr, fontToTable:
|
|
7138
|
+
var hi = { make: Sr, fontToTable: pi, computeCheckSum: En };
|
|
7139
7139
|
function Zt(e, t) {
|
|
7140
7140
|
let n = 0, s = e.length - 1;
|
|
7141
7141
|
for (; n <= s; ) {
|
|
@@ -7551,15 +7551,15 @@ le.prototype.getSingle = function(e, t, n) {
|
|
|
7551
7551
|
const l = o[i], c = this.expandCoverage(l.coverage);
|
|
7552
7552
|
let u;
|
|
7553
7553
|
if (l.substFormat === 1) {
|
|
7554
|
-
const
|
|
7554
|
+
const p = l.deltaGlyphId;
|
|
7555
7555
|
for (u = 0; u < c.length; u++) {
|
|
7556
|
-
const
|
|
7557
|
-
s.push({ sub:
|
|
7556
|
+
const f = c[u];
|
|
7557
|
+
s.push({ sub: f, by: f + p });
|
|
7558
7558
|
}
|
|
7559
7559
|
} else {
|
|
7560
|
-
const
|
|
7560
|
+
const p = l.substitute;
|
|
7561
7561
|
for (u = 0; u < c.length; u++)
|
|
7562
|
-
s.push({ sub: c[u], by:
|
|
7562
|
+
s.push({ sub: c[u], by: p[u] });
|
|
7563
7563
|
}
|
|
7564
7564
|
}
|
|
7565
7565
|
}
|
|
@@ -7573,8 +7573,8 @@ le.prototype.getMultiple = function(e, t, n) {
|
|
|
7573
7573
|
const l = o[i], c = this.expandCoverage(l.coverage);
|
|
7574
7574
|
let u;
|
|
7575
7575
|
for (u = 0; u < c.length; u++) {
|
|
7576
|
-
const
|
|
7577
|
-
s.push({ sub:
|
|
7576
|
+
const p = c[u], f = l.sequences[u];
|
|
7577
|
+
s.push({ sub: p, by: f });
|
|
7578
7578
|
}
|
|
7579
7579
|
}
|
|
7580
7580
|
}
|
|
@@ -7586,8 +7586,8 @@ le.prototype.getAlternates = function(e, t, n) {
|
|
|
7586
7586
|
const o = r[a].subtables;
|
|
7587
7587
|
for (let i = 0; i < o.length; i++) {
|
|
7588
7588
|
const l = o[i], c = this.expandCoverage(l.coverage), u = l.alternateSets;
|
|
7589
|
-
for (let
|
|
7590
|
-
s.push({ sub: c[
|
|
7589
|
+
for (let p = 0; p < c.length; p++)
|
|
7590
|
+
s.push({ sub: c[p], by: u[p] });
|
|
7591
7591
|
}
|
|
7592
7592
|
}
|
|
7593
7593
|
return s;
|
|
@@ -7598,12 +7598,12 @@ le.prototype.getLigatures = function(e, t, n) {
|
|
|
7598
7598
|
const o = r[a].subtables;
|
|
7599
7599
|
for (let i = 0; i < o.length; i++) {
|
|
7600
7600
|
const l = o[i], c = this.expandCoverage(l.coverage), u = l.ligatureSets;
|
|
7601
|
-
for (let
|
|
7602
|
-
const
|
|
7601
|
+
for (let p = 0; p < c.length; p++) {
|
|
7602
|
+
const f = c[p], d = u[p];
|
|
7603
7603
|
for (let h = 0; h < d.length; h++) {
|
|
7604
7604
|
const g = d[h];
|
|
7605
7605
|
s.push({
|
|
7606
|
-
sub: [
|
|
7606
|
+
sub: [f].concat(g.components),
|
|
7607
7607
|
by: g.ligGlyph
|
|
7608
7608
|
});
|
|
7609
7609
|
}
|
|
@@ -7665,8 +7665,8 @@ le.prototype.addLigature = function(e, t, n, s) {
|
|
|
7665
7665
|
let c = this.binSearch(a.coverage.glyphs, o);
|
|
7666
7666
|
if (c >= 0) {
|
|
7667
7667
|
const u = a.ligatureSets[c];
|
|
7668
|
-
for (let
|
|
7669
|
-
if (gi(u[
|
|
7668
|
+
for (let p = 0; p < u.length; p++)
|
|
7669
|
+
if (gi(u[p].components, i))
|
|
7670
7670
|
return;
|
|
7671
7671
|
u.push(l);
|
|
7672
7672
|
} else
|
|
@@ -7841,7 +7841,7 @@ var Si = le, Cr = class {
|
|
|
7841
7841
|
if (t > n.numPaletteEntries - 1)
|
|
7842
7842
|
throw Error(`Replacement index out of range: numPaletteEntries after deletion: ${n.numPaletteEntries - 1}, replacementIndex: ${t})`);
|
|
7843
7843
|
for (let i = 0; i < s.length; i++) {
|
|
7844
|
-
const c = s[i].filter((u,
|
|
7844
|
+
const c = s[i].filter((u, p) => p !== e);
|
|
7845
7845
|
r.push(c);
|
|
7846
7846
|
}
|
|
7847
7847
|
const a = this.font.tables.colr;
|
|
@@ -7853,8 +7853,8 @@ var Si = le, Cr = class {
|
|
|
7853
7853
|
i[l].paletteIndex -= 1;
|
|
7854
7854
|
else if (c === e) {
|
|
7855
7855
|
let u = 0;
|
|
7856
|
-
for (let
|
|
7857
|
-
if (t > e && t <= e + s[
|
|
7856
|
+
for (let p = 0; p < s.length; p++)
|
|
7857
|
+
if (t > e && t <= e + s[p].length) {
|
|
7858
7858
|
u++;
|
|
7859
7859
|
break;
|
|
7860
7860
|
}
|
|
@@ -8009,9 +8009,9 @@ var Si = le, Cr = class {
|
|
|
8009
8009
|
}
|
|
8010
8010
|
const o = s.baseGlyphRecords[r], i = o.numLayers, l = t.length, c = l - i;
|
|
8011
8011
|
if (c > 0) {
|
|
8012
|
-
const u = t.slice(i).map((
|
|
8013
|
-
glyphID:
|
|
8014
|
-
paletteIndex:
|
|
8012
|
+
const u = t.slice(i).map((p) => ({
|
|
8013
|
+
glyphID: p.glyphID,
|
|
8014
|
+
paletteIndex: p.paletteIndex
|
|
8015
8015
|
}));
|
|
8016
8016
|
s.layerRecords.splice(o.firstLayerIndex + i, 0, ...u);
|
|
8017
8017
|
} else c < 0 && s.layerRecords.splice(o.firstLayerIndex + l, -c);
|
|
@@ -8022,8 +8022,8 @@ var Si = le, Cr = class {
|
|
|
8022
8022
|
};
|
|
8023
8023
|
if (o.numLayers = l, c !== 0)
|
|
8024
8024
|
for (let u = 0; u < s.baseGlyphRecords.length; u++) {
|
|
8025
|
-
const
|
|
8026
|
-
u === r ||
|
|
8025
|
+
const p = s.baseGlyphRecords[u];
|
|
8026
|
+
u === r || p.firstLayerIndex < o.firstLayerIndex || (s.baseGlyphRecords[u].firstLayerIndex += c);
|
|
8027
8027
|
}
|
|
8028
8028
|
}
|
|
8029
8029
|
}, ki = class {
|
|
@@ -8128,10 +8128,10 @@ function Li(e, t) {
|
|
|
8128
8128
|
c.style.position = "fixed", c.style.visibility = "hidden", c.appendChild(s), document.body.appendChild(c);
|
|
8129
8129
|
const u = s.getBBox();
|
|
8130
8130
|
document.body.removeChild(c);
|
|
8131
|
-
const
|
|
8131
|
+
const p = (u.x - r.x) * i, f = (r.y - u.y) * l, d = u.width * i, h = u.height * l;
|
|
8132
8132
|
s.setAttribute("viewBox", [u.x, u.y, u.width, u.height].join(" ")), i !== 1 && s.setAttribute("width", d), l !== 1 && s.setAttribute("height", h);
|
|
8133
8133
|
const g = new Image(d, h);
|
|
8134
|
-
return g.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(s.outerHTML), { leftSideBearing:
|
|
8134
|
+
return g.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(s.outerHTML), { leftSideBearing: p, baseline: f, image: g };
|
|
8135
8135
|
}
|
|
8136
8136
|
var Kt = /* @__PURE__ */ new WeakMap();
|
|
8137
8137
|
function ts(e, t, n, s, r) {
|
|
@@ -8161,14 +8161,14 @@ function Or(e, t, n) {
|
|
|
8161
8161
|
const l = [];
|
|
8162
8162
|
let c;
|
|
8163
8163
|
if (i > 0) {
|
|
8164
|
-
for (let
|
|
8165
|
-
a = r[
|
|
8164
|
+
for (let f = 0; f < i; f += 1)
|
|
8165
|
+
a = r[f], c = {}, c.onCurve = !!(a & 1), c.lastPointOfContour = o.indexOf(f) >= 0, l.push(c);
|
|
8166
8166
|
let u = 0;
|
|
8167
|
-
for (let
|
|
8168
|
-
a = r[
|
|
8169
|
-
let
|
|
8170
|
-
for (let
|
|
8171
|
-
a = r[
|
|
8167
|
+
for (let f = 0; f < i; f += 1)
|
|
8168
|
+
a = r[f], c = l[f], c.x = ts(s, a, u, 2, 16), u = c.x;
|
|
8169
|
+
let p = 0;
|
|
8170
|
+
for (let f = 0; f < i; f += 1)
|
|
8171
|
+
a = r[f], c = l[f], c.y = ts(s, a, p, 4, 32), p = c.y;
|
|
8172
8172
|
}
|
|
8173
8173
|
e.points = l;
|
|
8174
8174
|
} else
|
|
@@ -8390,12 +8390,12 @@ var Er = { getPath: In, parse: Fi }, Mi = class {
|
|
|
8390
8390
|
var i = n;
|
|
8391
8391
|
n = s, s = i;
|
|
8392
8392
|
}
|
|
8393
|
-
let u = r[n][c],
|
|
8394
|
-
if (u !==
|
|
8395
|
-
let h = u ===
|
|
8393
|
+
let u = r[n][c], p = r[s][c], f = a[n][c], d = a[s][c];
|
|
8394
|
+
if (u !== p || f === d) {
|
|
8395
|
+
let h = u === p ? 0 : (d - f) / (p - u);
|
|
8396
8396
|
for (let g = e; g <= t; g++) {
|
|
8397
8397
|
let y = r[g][c];
|
|
8398
|
-
y <= u ? y +=
|
|
8398
|
+
y <= u ? y += f - u : y >= p ? y += d - p : y = f + (y - u) * h, a[g][c] = y;
|
|
8399
8399
|
}
|
|
8400
8400
|
}
|
|
8401
8401
|
}
|
|
@@ -8426,10 +8426,10 @@ var Er = { getPath: In, parse: Fi }, Mi = class {
|
|
|
8426
8426
|
transformComponents(e, t, n, s, r, a) {
|
|
8427
8427
|
let o = 0;
|
|
8428
8428
|
for (let i = 0; i < e.components.length; i++) {
|
|
8429
|
-
const l = e.components[i], c = this.font.glyphs.get(l.glyphIndex), u = xi(l),
|
|
8430
|
-
|
|
8431
|
-
const
|
|
8432
|
-
t.splice(o,
|
|
8429
|
+
const l = e.components[i], c = this.font.glyphs.get(l.glyphIndex), u = xi(l), p = s.indexOf(i);
|
|
8430
|
+
p > -1 && (u.dx += Math.round(r.deltas[p] * a), u.dy += Math.round(r.deltasY[p] * a));
|
|
8431
|
+
const f = kt(this.getTransform(c, n).points, u);
|
|
8432
|
+
t.splice(o, f.length, ...f), o += c.points.length;
|
|
8433
8433
|
}
|
|
8434
8434
|
}
|
|
8435
8435
|
applyTupleVariationStore(e, t, n, s = "gvar", r = {}) {
|
|
@@ -8438,51 +8438,51 @@ var Er = { getPath: In, parse: Fi }, Mi = class {
|
|
|
8438
8438
|
let c;
|
|
8439
8439
|
s === "gvar" ? c = t.map(es) : s === "cvar" && (c = [...t]);
|
|
8440
8440
|
for (let u = 0; u < o.length; u++) {
|
|
8441
|
-
const
|
|
8442
|
-
let
|
|
8441
|
+
const p = o[u];
|
|
8442
|
+
let f = 1;
|
|
8443
8443
|
for (let h = 0; h < l; h++) {
|
|
8444
8444
|
let g = [0];
|
|
8445
8445
|
switch (s) {
|
|
8446
8446
|
case "gvar":
|
|
8447
|
-
g =
|
|
8447
|
+
g = p.peakTuple ? p.peakTuple : this.gvar().sharedTuples[p.sharedTupleRecordsIndex];
|
|
8448
8448
|
break;
|
|
8449
8449
|
case "cvar":
|
|
8450
|
-
g =
|
|
8450
|
+
g = p.peakTuple;
|
|
8451
8451
|
break;
|
|
8452
8452
|
}
|
|
8453
8453
|
if (g[h] !== 0) {
|
|
8454
8454
|
if (a[h] === 0) {
|
|
8455
|
-
|
|
8455
|
+
f = 0;
|
|
8456
8456
|
break;
|
|
8457
8457
|
}
|
|
8458
|
-
if (
|
|
8459
|
-
if (a[h] <
|
|
8460
|
-
|
|
8458
|
+
if (p.intermediateStartTuple)
|
|
8459
|
+
if (a[h] < p.intermediateStartTuple[h] || a[h] > p.intermediateEndTuple[h]) {
|
|
8460
|
+
f = 0;
|
|
8461
8461
|
break;
|
|
8462
|
-
} else a[h] < g[h] ?
|
|
8462
|
+
} else a[h] < g[h] ? f = f * (a[h] - p.intermediateStartTuple[h] + Number.EPSILON) / (g[h] - p.intermediateStartTuple[h] + Number.EPSILON) : f = f * (p.intermediateEndTuple[h] - a[h] + Number.EPSILON) / (p.intermediateEndTuple[h] - g[h] + Number.EPSILON);
|
|
8463
8463
|
else {
|
|
8464
8464
|
if (a[h] < Math.min(0, g[h]) || a[h] > Math.max(0, g[h])) {
|
|
8465
|
-
|
|
8465
|
+
f = 0;
|
|
8466
8466
|
break;
|
|
8467
8467
|
}
|
|
8468
|
-
|
|
8468
|
+
f = (f * a[h] + Number.EPSILON) / (g[h] + Number.EPSILON);
|
|
8469
8469
|
}
|
|
8470
8470
|
}
|
|
8471
8471
|
}
|
|
8472
|
-
if (
|
|
8472
|
+
if (f === 0)
|
|
8473
8473
|
continue;
|
|
8474
|
-
const d =
|
|
8474
|
+
const d = p.privatePoints.length ? p.privatePoints : i;
|
|
8475
8475
|
if (s === "gvar" && r.glyph && r.glyph.isComposite)
|
|
8476
|
-
this.transformComponents(r.glyph, c, n, d,
|
|
8476
|
+
this.transformComponents(r.glyph, c, n, d, p, f);
|
|
8477
8477
|
else if (d.length === 0)
|
|
8478
8478
|
for (let h = 0; h < c.length; h++) {
|
|
8479
8479
|
const g = c[h];
|
|
8480
8480
|
s === "gvar" ? c[h] = {
|
|
8481
|
-
x: Math.round(g.x +
|
|
8482
|
-
y: Math.round(g.y +
|
|
8481
|
+
x: Math.round(g.x + p.deltas[h] * f),
|
|
8482
|
+
y: Math.round(g.y + p.deltasY[h] * f),
|
|
8483
8483
|
onCurve: g.onCurve,
|
|
8484
8484
|
lastPointOfContour: g.lastPointOfContour
|
|
8485
|
-
} : s === "cvar" && (c[h] = Math.round(g +
|
|
8485
|
+
} : s === "cvar" && (c[h] = Math.round(g + p.deltas[h] * f));
|
|
8486
8486
|
}
|
|
8487
8487
|
else {
|
|
8488
8488
|
let h;
|
|
@@ -8492,7 +8492,7 @@ var Er = { getPath: In, parse: Fi }, Mi = class {
|
|
|
8492
8492
|
let C = d[y];
|
|
8493
8493
|
if (C < t.length) {
|
|
8494
8494
|
let k = h[C];
|
|
8495
|
-
s === "gvar" ? (g[C] = !0, k.x +=
|
|
8495
|
+
s === "gvar" ? (g[C] = !0, k.x += p.deltas[y] * f, k.y += p.deltasY[y] * f) : s === "cvar" && (c[C] = Math.round(k + p.deltas[y] * f));
|
|
8496
8496
|
}
|
|
8497
8497
|
}
|
|
8498
8498
|
if (s === "gvar") {
|
|
@@ -8593,8 +8593,8 @@ var Er = { getPath: In, parse: Fi }, Mi = class {
|
|
|
8593
8593
|
for (let o = 0; o < s.regionIndexes.length; o++) {
|
|
8594
8594
|
let i = 1, l = s.regionIndexes[o], c = e.variationRegions[l].regionAxes;
|
|
8595
8595
|
for (let u = 0; u < c.length; u++) {
|
|
8596
|
-
let
|
|
8597
|
-
|
|
8596
|
+
let p = c[u], f;
|
|
8597
|
+
p.startCoord > p.peakCoord || p.peakCoord > p.endCoord || p.startCoord < 0 && p.endCoord > 0 && p.peakCoord !== 0 || p.peakCoord === 0 ? f = 1 : r[u] < p.startCoord || r[u] > p.endCoord ? f = 0 : r[u] === p.peakCoord ? f = 1 : r[u] < p.peakCoord ? f = (r[u] - p.startCoord + Number.EPSILON) / (p.peakCoord - p.startCoord + Number.EPSILON) : f = (p.endCoord - r[u] + Number.EPSILON) / (p.endCoord - p.peakCoord + Number.EPSILON), i *= f;
|
|
8598
8598
|
}
|
|
8599
8599
|
a[o] = i;
|
|
8600
8600
|
}
|
|
@@ -8909,13 +8909,13 @@ var Ur = function(e) {
|
|
|
8909
8909
|
};
|
|
8910
8910
|
Object.freeze(Oe);
|
|
8911
8911
|
Object.freeze(Ie);
|
|
8912
|
-
function
|
|
8912
|
+
function ft(e, t) {
|
|
8913
8913
|
this.x = e, this.y = t, this.axis = void 0, this.slope = t / e, this.normalSlope = -e / t, Object.freeze(this);
|
|
8914
8914
|
}
|
|
8915
|
-
|
|
8915
|
+
ft.prototype.distance = function(e, t, n, s) {
|
|
8916
8916
|
return this.x * Oe.distance(e, t, n, s) + this.y * Ie.distance(e, t, n, s);
|
|
8917
8917
|
};
|
|
8918
|
-
|
|
8918
|
+
ft.prototype.interpolate = function(e, t, n, s) {
|
|
8919
8919
|
let r, a, o, i, l, c, u;
|
|
8920
8920
|
if (o = s.distance(e, t, !0, !0), i = s.distance(e, n, !0, !0), r = s.distance(t, t, !1, !0), a = s.distance(n, n, !1, !0), l = Math.abs(o), c = Math.abs(i), u = l + c, u === 0) {
|
|
8921
8921
|
this.setRelative(e, e, (r + a) / 2, s, !0);
|
|
@@ -8923,17 +8923,17 @@ pt.prototype.interpolate = function(e, t, n, s) {
|
|
|
8923
8923
|
}
|
|
8924
8924
|
this.setRelative(e, e, (r * c + a * l) / u, s, !0);
|
|
8925
8925
|
};
|
|
8926
|
-
|
|
8926
|
+
ft.prototype.setRelative = function(e, t, n, s, r) {
|
|
8927
8927
|
s = s || this;
|
|
8928
|
-
const a = r ? t.xo : t.x, o = r ? t.yo : t.y, i = a + n * s.x, l = o + n * s.y, c = s.normalSlope, u = this.slope,
|
|
8929
|
-
e.x = (u *
|
|
8928
|
+
const a = r ? t.xo : t.x, o = r ? t.yo : t.y, i = a + n * s.x, l = o + n * s.y, c = s.normalSlope, u = this.slope, p = e.x, f = e.y;
|
|
8929
|
+
e.x = (u * p - c * i + l - f) / (u - c), e.y = u * (e.x - p) + f;
|
|
8930
8930
|
};
|
|
8931
|
-
|
|
8931
|
+
ft.prototype.touch = function(e) {
|
|
8932
8932
|
e.xTouched = !0, e.yTouched = !0;
|
|
8933
8933
|
};
|
|
8934
|
-
function
|
|
8934
|
+
function pt(e, t) {
|
|
8935
8935
|
const n = Math.sqrt(e * e + t * t);
|
|
8936
|
-
return e /= n, t /= n, e === 1 && t === 0 ? Oe : e === 0 && t === 1 ? Ie : new
|
|
8936
|
+
return e /= n, t /= n, e === 1 && t === 0 ? Oe : e === 0 && t === 1 ? Ie : new ft(e, t);
|
|
8937
8937
|
}
|
|
8938
8938
|
function Le(e, t, n, s) {
|
|
8939
8939
|
this.x = this.xo = Math.round(e * 64) / 64, this.y = this.yo = Math.round(t * 64) / 64, this.lastPointOfContour = n, this.onCurve = s, this.prevPointOnContour = void 0, this.nextPointOnContour = void 0, this.xTouched = !1, this.yTouched = !1, Object.preventExtensions(this);
|
|
@@ -9015,12 +9015,12 @@ Ir = function(e, t) {
|
|
|
9015
9015
|
const l = t.font;
|
|
9016
9016
|
o = [], a = [];
|
|
9017
9017
|
for (let c = 0; c < r.length; c++) {
|
|
9018
|
-
const u = r[c],
|
|
9019
|
-
i = new Fe("glyf",
|
|
9020
|
-
const
|
|
9018
|
+
const u = r[c], p = l.glyphs.get(u.glyphIndex);
|
|
9019
|
+
i = new Fe("glyf", p.instructions), i.instructionCount = 0, i.callDepth = 0, gn(p, i, n, s);
|
|
9020
|
+
const f = Math.round(u.dx * n), d = Math.round(u.dy * s), h = i.gZone, g = i.contours;
|
|
9021
9021
|
for (let C = 0; C < h.length; C++) {
|
|
9022
9022
|
const k = h[C];
|
|
9023
|
-
k.xTouched = k.yTouched = !1, k.xo = k.x = k.x +
|
|
9023
|
+
k.xTouched = k.yTouched = !1, k.xo = k.x = k.x + f, k.yo = k.y = k.y + d;
|
|
9024
9024
|
}
|
|
9025
9025
|
const y = o.length;
|
|
9026
9026
|
o.push.apply(o, h);
|
|
@@ -9037,16 +9037,16 @@ Ir = function(e, t) {
|
|
|
9037
9037
|
gn = function(e, t, n, s) {
|
|
9038
9038
|
const r = e.points || [], a = r.length, o = t.gZone = t.z0 = t.z1 = t.z2 = [], i = t.contours = [];
|
|
9039
9039
|
let l;
|
|
9040
|
-
for (let
|
|
9041
|
-
l = r[
|
|
9040
|
+
for (let p = 0; p < a; p++)
|
|
9041
|
+
l = r[p], o[p] = new Le(
|
|
9042
9042
|
l.x * n,
|
|
9043
9043
|
l.y * s,
|
|
9044
9044
|
l.lastPointOfContour,
|
|
9045
9045
|
l.onCurve
|
|
9046
9046
|
);
|
|
9047
9047
|
let c, u;
|
|
9048
|
-
for (let
|
|
9049
|
-
l = o[
|
|
9048
|
+
for (let p = 0; p < a; p++)
|
|
9049
|
+
l = o[p], c || (c = l, i.push(p)), l.lastPointOfContour ? (l.nextPointOnContour = c, c.prevPointOnContour = l, c = void 0) : (u = o[p + 1], l.nextPointOnContour = u, u.prevPointOnContour = l);
|
|
9050
9050
|
t.inhibitGridFit || (o.push(
|
|
9051
9051
|
new Le(0, 0),
|
|
9052
9052
|
new Le(Math.round(e.advanceWidth * n), 0)
|
|
@@ -9107,20 +9107,20 @@ function as(e, t) {
|
|
|
9107
9107
|
function os(e, t) {
|
|
9108
9108
|
const n = t.stack, s = n.pop(), r = n.pop(), a = t.z2[s], o = t.z1[r];
|
|
9109
9109
|
let i, l;
|
|
9110
|
-
e ? (i = a.y - o.y, l = o.x - a.x) : (i = o.x - a.x, l = o.y - a.y), t.pv = t.dpv =
|
|
9110
|
+
e ? (i = a.y - o.y, l = o.x - a.x) : (i = o.x - a.x, l = o.y - a.y), t.pv = t.dpv = pt(i, l);
|
|
9111
9111
|
}
|
|
9112
9112
|
function is(e, t) {
|
|
9113
9113
|
const n = t.stack, s = n.pop(), r = n.pop(), a = t.z2[s], o = t.z1[r];
|
|
9114
9114
|
let i, l;
|
|
9115
|
-
e ? (i = a.y - o.y, l = o.x - a.x) : (i = o.x - a.x, l = o.y - a.y), t.fv =
|
|
9115
|
+
e ? (i = a.y - o.y, l = o.x - a.x) : (i = o.x - a.x, l = o.y - a.y), t.fv = pt(i, l);
|
|
9116
9116
|
}
|
|
9117
9117
|
function zi(e) {
|
|
9118
9118
|
const t = e.stack, n = t.pop(), s = t.pop();
|
|
9119
|
-
e.pv = e.dpv =
|
|
9119
|
+
e.pv = e.dpv = pt(s, n);
|
|
9120
9120
|
}
|
|
9121
9121
|
function ji(e) {
|
|
9122
9122
|
const t = e.stack, n = t.pop(), s = t.pop();
|
|
9123
|
-
e.fv =
|
|
9123
|
+
e.fv = pt(s, n);
|
|
9124
9124
|
}
|
|
9125
9125
|
function Wi(e) {
|
|
9126
9126
|
const t = e.stack, n = e.pv;
|
|
@@ -9134,7 +9134,7 @@ function $i(e) {
|
|
|
9134
9134
|
e.fv = e.pv;
|
|
9135
9135
|
}
|
|
9136
9136
|
function Xi(e) {
|
|
9137
|
-
const t = e.stack, n = t.pop(), s = t.pop(), r = t.pop(), a = t.pop(), o = t.pop(), i = e.z0, l = e.z1, c = i[n], u = i[s],
|
|
9137
|
+
const t = e.stack, n = t.pop(), s = t.pop(), r = t.pop(), a = t.pop(), o = t.pop(), i = e.z0, l = e.z1, c = i[n], u = i[s], p = l[r], f = l[a], d = e.z2[o], h = c.x, g = c.y, y = u.x, C = u.y, k = p.x, w = p.y, L = f.x, U = f.y, D = (h - y) * (w - U) - (g - C) * (k - L), F = h * C - g * y, z = k * U - w * L;
|
|
9138
9138
|
d.x = (F * (k - L) - z * (h - y)) / D, d.y = (F * (w - U) - z * (g - C)) / D;
|
|
9139
9139
|
}
|
|
9140
9140
|
function Yi(e) {
|
|
@@ -9232,11 +9232,11 @@ function Qt(e) {
|
|
|
9232
9232
|
function cl(e) {
|
|
9233
9233
|
e.stack.length = 0;
|
|
9234
9234
|
}
|
|
9235
|
-
function
|
|
9235
|
+
function fl(e) {
|
|
9236
9236
|
const t = e.stack, n = t.pop(), s = t.pop();
|
|
9237
9237
|
t.push(n), t.push(s);
|
|
9238
9238
|
}
|
|
9239
|
-
function
|
|
9239
|
+
function pl(e) {
|
|
9240
9240
|
const t = e.stack;
|
|
9241
9241
|
t.push(t.length);
|
|
9242
9242
|
}
|
|
@@ -9290,12 +9290,12 @@ function cs(e, t) {
|
|
|
9290
9290
|
let i = t.loop;
|
|
9291
9291
|
const l = t.z2;
|
|
9292
9292
|
for (; i--; ) {
|
|
9293
|
-
const c = n.pop(), u = l[c],
|
|
9294
|
-
a.setRelative(u, u,
|
|
9293
|
+
const c = n.pop(), u = l[c], p = o.distance(r, r, !1, !0);
|
|
9294
|
+
a.setRelative(u, u, p, o), a.touch(u);
|
|
9295
9295
|
}
|
|
9296
9296
|
t.loop = 1;
|
|
9297
9297
|
}
|
|
9298
|
-
function
|
|
9298
|
+
function fs(e, t) {
|
|
9299
9299
|
const n = t.stack, s = e ? t.rp1 : t.rp2, r = (e ? t.z0 : t.z1)[s], a = t.fv, o = t.pv, i = n.pop(), l = t.z2[t.contours[i]];
|
|
9300
9300
|
let c = l;
|
|
9301
9301
|
const u = o.distance(r, r, !1, !0);
|
|
@@ -9303,7 +9303,7 @@ function ps(e, t) {
|
|
|
9303
9303
|
c !== r && a.setRelative(c, c, u, o), c = c.nextPointOnContour;
|
|
9304
9304
|
while (c !== l);
|
|
9305
9305
|
}
|
|
9306
|
-
function
|
|
9306
|
+
function ps(e, t) {
|
|
9307
9307
|
const n = t.stack, s = e ? t.rp1 : t.rp2, r = (e ? t.z0 : t.z1)[s], a = t.fv, o = t.pv, i = n.pop();
|
|
9308
9308
|
let l;
|
|
9309
9309
|
switch (i) {
|
|
@@ -9317,9 +9317,9 @@ function fs(e, t) {
|
|
|
9317
9317
|
throw new Error("Invalid zone");
|
|
9318
9318
|
}
|
|
9319
9319
|
let c;
|
|
9320
|
-
const u = o.distance(r, r, !1, !0),
|
|
9321
|
-
for (let
|
|
9322
|
-
c = l[
|
|
9320
|
+
const u = o.distance(r, r, !1, !0), p = l.length - 2;
|
|
9321
|
+
for (let f = 0; f < p; f++)
|
|
9322
|
+
c = l[f], a.setRelative(c, c, u, o);
|
|
9323
9323
|
}
|
|
9324
9324
|
function vl(e) {
|
|
9325
9325
|
const t = e.stack;
|
|
@@ -9336,8 +9336,8 @@ function bl(e) {
|
|
|
9336
9336
|
let r = e.loop;
|
|
9337
9337
|
const a = e.z0[n], o = e.z1[s], i = e.fv, l = e.dpv, c = e.z2;
|
|
9338
9338
|
for (; r--; ) {
|
|
9339
|
-
const u = t.pop(),
|
|
9340
|
-
i.interpolate(
|
|
9339
|
+
const u = t.pop(), p = c[u];
|
|
9340
|
+
i.interpolate(p, a, o, l), i.touch(p);
|
|
9341
9341
|
}
|
|
9342
9342
|
e.loop = 1;
|
|
9343
9343
|
}
|
|
@@ -9464,11 +9464,11 @@ function Vl(e) {
|
|
|
9464
9464
|
function Jt(e, t) {
|
|
9465
9465
|
const n = t.stack, s = n.pop(), r = t.fv, a = t.pv, o = t.ppem, i = t.deltaBase + (e - 1) * 16, l = t.deltaShift, c = t.z0;
|
|
9466
9466
|
for (let u = 0; u < s; u++) {
|
|
9467
|
-
const
|
|
9468
|
-
if (i + ((
|
|
9469
|
-
let h = (
|
|
9467
|
+
const p = n.pop(), f = n.pop();
|
|
9468
|
+
if (i + ((f & 240) >> 4) !== o) continue;
|
|
9469
|
+
let h = (f & 15) - 8;
|
|
9470
9470
|
h >= 0 && h++;
|
|
9471
|
-
const g = c[
|
|
9471
|
+
const g = c[p];
|
|
9472
9472
|
r.setRelative(g, g, h * l, a);
|
|
9473
9473
|
}
|
|
9474
9474
|
}
|
|
@@ -9526,10 +9526,10 @@ function en(e, t) {
|
|
|
9526
9526
|
for (let i = 0; i < s; i++) {
|
|
9527
9527
|
const l = n.pop(), c = n.pop();
|
|
9528
9528
|
if (a + ((c & 240) >> 4) !== r) continue;
|
|
9529
|
-
let
|
|
9530
|
-
|
|
9531
|
-
const
|
|
9532
|
-
t.cvt[l] +=
|
|
9529
|
+
let p = (c & 15) - 8;
|
|
9530
|
+
p >= 0 && p++;
|
|
9531
|
+
const f = p * o;
|
|
9532
|
+
t.cvt[l] += f;
|
|
9533
9533
|
}
|
|
9534
9534
|
}
|
|
9535
9535
|
function eu(e) {
|
|
@@ -9617,7 +9617,7 @@ function au(e) {
|
|
|
9617
9617
|
function ys(e, t) {
|
|
9618
9618
|
const n = t.stack, s = n.pop(), r = n.pop(), a = t.z2[s], o = t.z1[r];
|
|
9619
9619
|
let i, l;
|
|
9620
|
-
e ? (i = a.y - o.y, l = o.x - a.x) : (i = o.x - a.x, l = o.y - a.y), t.dpv =
|
|
9620
|
+
e ? (i = a.y - o.y, l = o.x - a.x) : (i = o.x - a.x, l = o.y - a.y), t.dpv = pt(i, l);
|
|
9621
9621
|
}
|
|
9622
9622
|
function ou(e) {
|
|
9623
9623
|
const t = e.stack, n = t.pop();
|
|
@@ -9639,7 +9639,7 @@ function uu(e) {
|
|
|
9639
9639
|
function cu(e) {
|
|
9640
9640
|
e.stack.pop();
|
|
9641
9641
|
}
|
|
9642
|
-
function
|
|
9642
|
+
function fu(e) {
|
|
9643
9643
|
const t = e.stack.pop();
|
|
9644
9644
|
let n = e.stack.pop();
|
|
9645
9645
|
switch (t) {
|
|
@@ -9669,9 +9669,9 @@ function Ue(e, t) {
|
|
|
9669
9669
|
t.ip = n;
|
|
9670
9670
|
}
|
|
9671
9671
|
function R(e, t, n, s, r, a) {
|
|
9672
|
-
const o = a.stack, i = e && o.pop(), l = o.pop(), c = a.rp0, u = a.z0[c],
|
|
9672
|
+
const o = a.stack, i = e && o.pop(), l = o.pop(), c = a.rp0, u = a.z0[c], p = a.z1[l], f = a.minDis, d = a.fv, h = a.dpv;
|
|
9673
9673
|
let g, y, C;
|
|
9674
|
-
g = h.distance(
|
|
9674
|
+
g = h.distance(p, u, !0, !0), y = g >= 0 ? 1 : -1, g = Math.abs(g), e && (C = a.cvt[i], s && Math.abs(g - C) < a.cvCutIn && (g = C)), n && g < f && (g = f), s && (g = a.round(g)), d.setRelative(p, u, y * g, h), d.touch(p), a.rp1 = a.rp0, a.rp2 = l, t && (a.rp0 = l);
|
|
9675
9675
|
}
|
|
9676
9676
|
Rr = [
|
|
9677
9677
|
/* 0x00 */
|
|
@@ -9747,9 +9747,9 @@ Rr = [
|
|
|
9747
9747
|
/* 0x22 */
|
|
9748
9748
|
cl,
|
|
9749
9749
|
/* 0x23 */
|
|
9750
|
-
pl,
|
|
9751
|
-
/* 0x24 */
|
|
9752
9750
|
fl,
|
|
9751
|
+
/* 0x24 */
|
|
9752
|
+
pl,
|
|
9753
9753
|
/* 0x25 */
|
|
9754
9754
|
gl,
|
|
9755
9755
|
/* 0x26 */
|
|
@@ -9784,13 +9784,13 @@ Rr = [
|
|
|
9784
9784
|
/* 0x33 */
|
|
9785
9785
|
cs.bind(void 0, 1),
|
|
9786
9786
|
/* 0x34 */
|
|
9787
|
-
|
|
9787
|
+
fs.bind(void 0, 0),
|
|
9788
9788
|
/* 0x35 */
|
|
9789
|
-
|
|
9789
|
+
fs.bind(void 0, 1),
|
|
9790
9790
|
/* 0x36 */
|
|
9791
|
-
|
|
9791
|
+
ps.bind(void 0, 0),
|
|
9792
9792
|
/* 0x37 */
|
|
9793
|
-
|
|
9793
|
+
ps.bind(void 0, 1),
|
|
9794
9794
|
/* 0x38 */
|
|
9795
9795
|
vl,
|
|
9796
9796
|
/* 0x39 */
|
|
@@ -9980,7 +9980,7 @@ Rr = [
|
|
|
9980
9980
|
/* 0x8D */
|
|
9981
9981
|
cu,
|
|
9982
9982
|
/* 0x8E */
|
|
9983
|
-
|
|
9983
|
+
fu,
|
|
9984
9984
|
/* 0x8F */
|
|
9985
9985
|
void 0,
|
|
9986
9986
|
/* 0x90 */
|
|
@@ -10208,7 +10208,7 @@ Rr = [
|
|
|
10208
10208
|
/* 0xFF */
|
|
10209
10209
|
R.bind(void 0, 1, 1, 1, 1, 3)
|
|
10210
10210
|
];
|
|
10211
|
-
var
|
|
10211
|
+
var pu = Lr;
|
|
10212
10212
|
function nt(e) {
|
|
10213
10213
|
this.char = e, this.state = {}, this.activeState = null;
|
|
10214
10214
|
}
|
|
@@ -10540,24 +10540,24 @@ function bu(e, t) {
|
|
|
10540
10540
|
t.backtrackCoverage,
|
|
10541
10541
|
c
|
|
10542
10542
|
);
|
|
10543
|
-
const
|
|
10544
|
-
let
|
|
10545
|
-
if (
|
|
10543
|
+
const p = s.length === t.inputCoverage.length && i.length === t.lookaheadCoverage.length && u.length === t.backtrackCoverage.length;
|
|
10544
|
+
let f = [];
|
|
10545
|
+
if (p)
|
|
10546
10546
|
for (let d = 0; d < t.lookupRecords.length; d++) {
|
|
10547
10547
|
const h = t.lookupRecords[d], g = h.lookupListIndex, y = this.getLookupByIndex(g);
|
|
10548
10548
|
for (let C = 0; C < y.subtables.length; C++) {
|
|
10549
10549
|
let k = y.subtables[C], w, L = this.getSubstitutionType(y, k);
|
|
10550
10550
|
if (L === "71" ? (L = this.getSubstitutionType(k, k.extension), w = this.getLookupMethod(k, k.extension), k = k.extension) : w = this.getLookupMethod(y, k), L === "12") {
|
|
10551
10551
|
const U = e.get(h.sequenceIndex), D = w(U);
|
|
10552
|
-
D &&
|
|
10552
|
+
D && f.push(D);
|
|
10553
10553
|
} else if (L === "21") {
|
|
10554
10554
|
const U = e.get(h.sequenceIndex), D = w(U);
|
|
10555
|
-
D &&
|
|
10555
|
+
D && f.push(D);
|
|
10556
10556
|
} else
|
|
10557
10557
|
throw new Error(`Substitution type ${L} is not supported in chaining substitution`);
|
|
10558
10558
|
}
|
|
10559
10559
|
}
|
|
10560
|
-
return
|
|
10560
|
+
return f;
|
|
10561
10561
|
}
|
|
10562
10562
|
function xu(e, t) {
|
|
10563
10563
|
let n = e.current, s = Be(n, t.coverage);
|
|
@@ -10591,9 +10591,9 @@ function Su(e, t) {
|
|
|
10591
10591
|
for (let c = 0; c < a.input.length; c++)
|
|
10592
10592
|
i.push(a.input[c]);
|
|
10593
10593
|
const l = (c, u) => {
|
|
10594
|
-
const { lookupListIndex:
|
|
10594
|
+
const { lookupListIndex: p, sequenceIndex: f } = u, { subtables: d } = this.getLookupByIndex(p);
|
|
10595
10595
|
for (const h of d)
|
|
10596
|
-
Be(c[
|
|
10596
|
+
Be(c[f], h.coverage) !== -1 && (c[f] = h.deltaGlyphId);
|
|
10597
10597
|
};
|
|
10598
10598
|
for (let c = 0; c < a.lookupRecords.length; c++) {
|
|
10599
10599
|
const u = a.lookupRecords[c];
|
|
@@ -10618,11 +10618,11 @@ function Tu(e, t) {
|
|
|
10618
10618
|
for (let i = 0; i < o.subtables.length; i++) {
|
|
10619
10619
|
let l = o.subtables[i], c, u = this.getSubstitutionType(o, l);
|
|
10620
10620
|
if (u === "71" ? (u = this.getSubstitutionType(l, l.extension), c = this.getLookupMethod(l, l.extension), l = l.extension) : c = this.getLookupMethod(o, l), u === "12") {
|
|
10621
|
-
const
|
|
10622
|
-
|
|
10621
|
+
const p = e.get(r.sequenceIndex), f = c(p);
|
|
10622
|
+
f && n.push(f);
|
|
10623
10623
|
} else if (u === "21") {
|
|
10624
|
-
const
|
|
10625
|
-
|
|
10624
|
+
const p = e.get(r.sequenceIndex), f = c(p);
|
|
10625
|
+
f && n.push(f);
|
|
10626
10626
|
}
|
|
10627
10627
|
}
|
|
10628
10628
|
}
|
|
@@ -10737,40 +10737,40 @@ ue.prototype.lookupFeature = function(e) {
|
|
|
10737
10737
|
for (let o = 0; o < r.length; o++) {
|
|
10738
10738
|
const i = r[o], l = this.getLookupSubtables(i);
|
|
10739
10739
|
for (let c = 0; c < l.length; c++) {
|
|
10740
|
-
let u = l[c],
|
|
10741
|
-
|
|
10740
|
+
let u = l[c], p = this.getSubstitutionType(i, u), f;
|
|
10741
|
+
p === "71" ? (p = this.getSubstitutionType(u, u.extension), f = this.getLookupMethod(u, u.extension), u = u.extension) : f = this.getLookupMethod(i, u);
|
|
10742
10742
|
let d;
|
|
10743
|
-
switch (
|
|
10743
|
+
switch (p) {
|
|
10744
10744
|
case "11":
|
|
10745
|
-
d =
|
|
10745
|
+
d = f(t.current), d && a.splice(n, 1, new De({
|
|
10746
10746
|
id: 11,
|
|
10747
10747
|
tag: e.tag,
|
|
10748
10748
|
substitution: d
|
|
10749
10749
|
}));
|
|
10750
10750
|
break;
|
|
10751
10751
|
case "12":
|
|
10752
|
-
d =
|
|
10752
|
+
d = f(t.current), d && a.splice(n, 1, new De({
|
|
10753
10753
|
id: 12,
|
|
10754
10754
|
tag: e.tag,
|
|
10755
10755
|
substitution: d
|
|
10756
10756
|
}));
|
|
10757
10757
|
break;
|
|
10758
10758
|
case "63":
|
|
10759
|
-
d =
|
|
10759
|
+
d = f(t), Array.isArray(d) && d.length && a.splice(n, 1, new De({
|
|
10760
10760
|
id: 63,
|
|
10761
10761
|
tag: e.tag,
|
|
10762
10762
|
substitution: d
|
|
10763
10763
|
}));
|
|
10764
10764
|
break;
|
|
10765
10765
|
case "41":
|
|
10766
|
-
d =
|
|
10766
|
+
d = f(t), d && a.splice(n, 1, new De({
|
|
10767
10767
|
id: 41,
|
|
10768
10768
|
tag: e.tag,
|
|
10769
10769
|
substitution: d
|
|
10770
10770
|
}));
|
|
10771
10771
|
break;
|
|
10772
10772
|
case "21":
|
|
10773
|
-
d =
|
|
10773
|
+
d = f(t.current), d && a.splice(n, 1, new De({
|
|
10774
10774
|
id: 21,
|
|
10775
10775
|
tag: e.tag,
|
|
10776
10776
|
substitution: d
|
|
@@ -10778,8 +10778,8 @@ ue.prototype.lookupFeature = function(e) {
|
|
|
10778
10778
|
break;
|
|
10779
10779
|
case "51":
|
|
10780
10780
|
case "53":
|
|
10781
|
-
d =
|
|
10782
|
-
id: parseInt(
|
|
10781
|
+
d = f(t), Array.isArray(d) && d.length && a.splice(n, 1, new De({
|
|
10782
|
+
id: parseInt(p),
|
|
10783
10783
|
tag: e.tag,
|
|
10784
10784
|
substitution: d
|
|
10785
10785
|
}));
|
|
@@ -10960,9 +10960,9 @@ function Bu(e) {
|
|
|
10960
10960
|
console.info(u.message);
|
|
10961
10961
|
continue;
|
|
10962
10962
|
}
|
|
10963
|
-
for (let
|
|
10964
|
-
const
|
|
10965
|
-
|
|
10963
|
+
for (let p = 0; p < u.length; p++) {
|
|
10964
|
+
const f = u[p];
|
|
10965
|
+
f instanceof De && (je(f, s, p), r.context[p] = f.substitution);
|
|
10966
10966
|
}
|
|
10967
10967
|
}
|
|
10968
10968
|
}
|
|
@@ -11221,10 +11221,10 @@ function Ye(e) {
|
|
|
11221
11221
|
t.endCheck
|
|
11222
11222
|
);
|
|
11223
11223
|
}
|
|
11224
|
-
function
|
|
11224
|
+
function fc() {
|
|
11225
11225
|
return Ye.call(this, "ccmpReplacement"), Ye.call(this, "latinWord"), Ye.call(this, "arabicWord"), Ye.call(this, "arabicSentence"), Ye.call(this, "thaiWord"), Ye.call(this, "unicodeVariationSequence"), this.tokenizer.tokenize(this.text);
|
|
11226
11226
|
}
|
|
11227
|
-
function
|
|
11227
|
+
function pc() {
|
|
11228
11228
|
const e = this.tokenizer.getContextRanges("arabicSentence");
|
|
11229
11229
|
for (let t = 0; t < e.length; t++) {
|
|
11230
11230
|
const n = e[t];
|
|
@@ -11315,13 +11315,13 @@ he.prototype.checkContextReady = function(e) {
|
|
|
11315
11315
|
return !!this.tokenizer.getContext(e);
|
|
11316
11316
|
};
|
|
11317
11317
|
he.prototype.applyFeaturesToContexts = function() {
|
|
11318
|
-
this.checkContextReady("ccmpReplacement") && dc.call(this), this.checkContextReady("arabicWord") && (hc.call(this), gc.call(this)), this.checkContextReady("latinWord") && mc.call(this), this.checkContextReady("arabicSentence") &&
|
|
11318
|
+
this.checkContextReady("ccmpReplacement") && dc.call(this), this.checkContextReady("arabicWord") && (hc.call(this), gc.call(this)), this.checkContextReady("latinWord") && mc.call(this), this.checkContextReady("arabicSentence") && pc.call(this), this.checkContextReady("thaiWord") && vc.call(this), this.checkContextReady("unicodeVariationSequence") && yc.call(this);
|
|
11319
11319
|
};
|
|
11320
11320
|
he.prototype.hasFeatureEnabled = function(e, t) {
|
|
11321
11321
|
return (this.featuresTags[e] || []).indexOf(t) !== -1;
|
|
11322
11322
|
};
|
|
11323
11323
|
he.prototype.processText = function(e) {
|
|
11324
|
-
(!this.text || this.text !== e) && (this.setText(e),
|
|
11324
|
+
(!this.text || this.text !== e) && (this.setText(e), fc.call(this), this.applyFeaturesToContexts());
|
|
11325
11325
|
};
|
|
11326
11326
|
he.prototype.getBidiText = function(e) {
|
|
11327
11327
|
return this.processText(e), this.tokenizer.getText();
|
|
@@ -11388,7 +11388,7 @@ function N(e) {
|
|
|
11388
11388
|
set: (t, n, s) => (t[n] = s, t.fvar && (t.gvar || t.cff2) && !this.variation && (this.variation = new Pi(this)), !0)
|
|
11389
11389
|
}), this.palettes = new Cr(this), this.layers = new Ti(this), this.svgImages = new ki(this), this._push = null, this._hmtxTableData = {}, Object.defineProperty(this, "hinting", {
|
|
11390
11390
|
get: function() {
|
|
11391
|
-
return this._hinting ? this._hinting : this.outlinesFormat === "truetype" ? this._hinting = new
|
|
11391
|
+
return this._hinting ? this._hinting : this.outlinesFormat === "truetype" ? this._hinting = new pu(this) : null;
|
|
11392
11392
|
}
|
|
11393
11393
|
});
|
|
11394
11394
|
}
|
|
@@ -11466,8 +11466,8 @@ N.prototype.forEachGlyph = function(e, t, n, s, r, a) {
|
|
|
11466
11466
|
for (let c = 0; c < i.length; c += 1) {
|
|
11467
11467
|
const u = i[c];
|
|
11468
11468
|
if (a.call(this, u, t, n, s, r), u.advanceWidth && (t += u.advanceWidth * o), r.kerning && c < i.length - 1) {
|
|
11469
|
-
const
|
|
11470
|
-
t +=
|
|
11469
|
+
const p = l ? this.position.getKerningValue(l, u.index, i[c + 1].index) : this.getKerningValue(u, i[c + 1]);
|
|
11470
|
+
t += p * o;
|
|
11471
11471
|
}
|
|
11472
11472
|
r.letterSpacing ? t += r.letterSpacing * s : r.tracking && (t += r.tracking / 1e3 * s);
|
|
11473
11473
|
}
|
|
@@ -11483,10 +11483,10 @@ N.prototype.getPath = function(e, t, n, s, r) {
|
|
|
11483
11483
|
return this.forEachGlyph(e, t, n, s, r, (o, i, l, c) => {
|
|
11484
11484
|
const u = o.getPath(i, l, c, r, this);
|
|
11485
11485
|
if (r.drawSVG || r.drawLayers) {
|
|
11486
|
-
const
|
|
11487
|
-
if (
|
|
11488
|
-
for (let
|
|
11489
|
-
const d = f
|
|
11486
|
+
const p = u._layers;
|
|
11487
|
+
if (p && p.length) {
|
|
11488
|
+
for (let f = 0; f < p.length; f++) {
|
|
11489
|
+
const d = p[f];
|
|
11490
11490
|
a._layers.push(d);
|
|
11491
11491
|
}
|
|
11492
11492
|
return;
|
|
@@ -11901,7 +11901,7 @@ function Vc(e, t = {}) {
|
|
|
11901
11901
|
throw new Error("WOFF2 require an external decompressor library, see examples at: " + E);
|
|
11902
11902
|
} else
|
|
11903
11903
|
throw new Error("Unsupported OpenType signature " + l);
|
|
11904
|
-
let c, u,
|
|
11904
|
+
let c, u, p, f, d, h, g, y, C, k, w, L, U, D, F, z, B, O;
|
|
11905
11905
|
for (let E = 0; E < o; E += 1) {
|
|
11906
11906
|
const x = i[E];
|
|
11907
11907
|
let T;
|
|
@@ -11916,10 +11916,10 @@ function Vc(e, t = {}) {
|
|
|
11916
11916
|
T = P(a, x), O = new S.Parser(T.data, T.offset), r.tables.cvt = O.parseShortList(x.length / 2);
|
|
11917
11917
|
break;
|
|
11918
11918
|
case "fvar":
|
|
11919
|
-
|
|
11919
|
+
p = x;
|
|
11920
11920
|
break;
|
|
11921
11921
|
case "STAT":
|
|
11922
|
-
|
|
11922
|
+
f = x;
|
|
11923
11923
|
break;
|
|
11924
11924
|
case "gvar":
|
|
11925
11925
|
d = x;
|
|
@@ -11996,8 +11996,8 @@ function Vc(e, t = {}) {
|
|
|
11996
11996
|
case "gasp":
|
|
11997
11997
|
try {
|
|
11998
11998
|
T = P(a, x), r.tables.gasp = br.parse(T.data, T.offset);
|
|
11999
|
-
} catch (
|
|
12000
|
-
console.warn("Failed to parse gasp table, skipping."), console.warn(
|
|
11999
|
+
} catch (G) {
|
|
12000
|
+
console.warn("Failed to parse gasp table, skipping."), console.warn(G);
|
|
12001
12001
|
}
|
|
12002
12002
|
break;
|
|
12003
12003
|
case "SVG ":
|
|
@@ -12007,18 +12007,18 @@ function Vc(e, t = {}) {
|
|
|
12007
12007
|
}
|
|
12008
12008
|
const _ = P(a, z);
|
|
12009
12009
|
if (r.tables.name = Ws.parse(_.data, _.offset, s), r.names = r.tables.name, y && F) {
|
|
12010
|
-
const E = n === 0, x = P(a, F), T = Gc.parse(x.data, x.offset, r.numGlyphs, E),
|
|
12011
|
-
r.glyphs = Er.parse(
|
|
12010
|
+
const E = n === 0, x = P(a, F), T = Gc.parse(x.data, x.offset, r.numGlyphs, E), G = P(a, y);
|
|
12011
|
+
r.glyphs = Er.parse(G.data, G.offset, T, r, t);
|
|
12012
12012
|
} else if (c) {
|
|
12013
12013
|
const E = P(a, c);
|
|
12014
|
-
|
|
12014
|
+
pn.parse(E.data, E.offset, r, t);
|
|
12015
12015
|
} else if (u) {
|
|
12016
12016
|
const E = P(a, u);
|
|
12017
|
-
|
|
12017
|
+
pn.parse(E.data, E.offset, r, t);
|
|
12018
12018
|
} else
|
|
12019
12019
|
throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");
|
|
12020
|
-
const
|
|
12021
|
-
if (ir.parse(r,
|
|
12020
|
+
const V = P(a, L);
|
|
12021
|
+
if (ir.parse(r, V.data, V.offset, r.numberOfHMetrics, r.numGlyphs, r.glyphs, t), Pa(r, t), D) {
|
|
12022
12022
|
const E = P(a, D);
|
|
12023
12023
|
r.kerningPairs = Nc.parse(E.data, E.offset);
|
|
12024
12024
|
} else
|
|
@@ -12033,39 +12033,39 @@ function Vc(e, t = {}) {
|
|
|
12033
12033
|
}
|
|
12034
12034
|
if (w) {
|
|
12035
12035
|
const E = P(a, w);
|
|
12036
|
-
r.tables.gsub =
|
|
12037
|
-
}
|
|
12038
|
-
if (f) {
|
|
12039
|
-
const E = P(a, f);
|
|
12040
|
-
r.tables.fvar = dr.parse(E.data, E.offset, r.names);
|
|
12036
|
+
r.tables.gsub = fr.parse(E.data, E.offset);
|
|
12041
12037
|
}
|
|
12042
12038
|
if (p) {
|
|
12043
12039
|
const E = P(a, p);
|
|
12040
|
+
r.tables.fvar = dr.parse(E.data, E.offset, r.names);
|
|
12041
|
+
}
|
|
12042
|
+
if (f) {
|
|
12043
|
+
const E = P(a, f);
|
|
12044
12044
|
r.tables.stat = gr.parse(E.data, E.offset, r.tables.fvar);
|
|
12045
12045
|
}
|
|
12046
12046
|
if (d) {
|
|
12047
|
-
|
|
12047
|
+
p || console.warn("This font provides a gvar table, but no fvar table, which is required for variable fonts."), y || console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");
|
|
12048
12048
|
const E = P(a, d);
|
|
12049
12049
|
r.tables.gvar = vr.parse(E.data, E.offset, r.tables.fvar, r.glyphs);
|
|
12050
12050
|
}
|
|
12051
12051
|
if (h) {
|
|
12052
|
-
|
|
12052
|
+
p || console.warn("This font provides a cvar table, but no fvar table, which is required for variable fonts."), r.tables.cvt || console.warn("This font provides a cvar table, but no cvt table which could be made variable."), y || console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");
|
|
12053
12053
|
const E = P(a, h);
|
|
12054
12054
|
r.tables.cvar = yr.parse(E.data, E.offset, r.tables.fvar, r.tables.cvt || []);
|
|
12055
12055
|
}
|
|
12056
12056
|
if (g) {
|
|
12057
|
-
|
|
12057
|
+
p || console.warn("This font provides an avar table, but no fvar table, which is required for variable fonts.");
|
|
12058
12058
|
const E = P(a, g);
|
|
12059
12059
|
r.tables.avar = mr.parse(E.data, E.offset, r.tables.fvar);
|
|
12060
12060
|
}
|
|
12061
12061
|
if (U) {
|
|
12062
|
-
|
|
12062
|
+
p || console.warn("This font provides an HVAR table, but no fvar table, which is required for variable fonts."), L || console.warn("This font provides an HVAR table, but no hmtx table to vary.");
|
|
12063
12063
|
const E = P(a, U);
|
|
12064
12064
|
r.tables.hvar = kc.parse(E.data, E.offset, r.tables.fvar);
|
|
12065
12065
|
}
|
|
12066
12066
|
if (B) {
|
|
12067
12067
|
const E = P(a, B);
|
|
12068
|
-
r.tables.meta =
|
|
12068
|
+
r.tables.meta = pr.parse(E.data, E.offset), r.metas = r.tables.meta;
|
|
12069
12069
|
}
|
|
12070
12070
|
return r.palettes = new Cr(r), r;
|
|
12071
12071
|
}
|
|
@@ -12084,7 +12084,7 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12084
12084
|
const a = () => {
|
|
12085
12085
|
const i = n.value, l = s.value;
|
|
12086
12086
|
if (!i || !l || t.renderMode !== "canvas" || !t.font) return;
|
|
12087
|
-
const c = i.clientWidth || 600, u = window.devicePixelRatio || 1,
|
|
12087
|
+
const c = i.clientWidth || 600, u = window.devicePixelRatio || 1, p = t.fontSize * 1.4, f = t.theme === "light" ? "#1f2937" : "#f3f4f6", d = t.font, h = (w) => {
|
|
12088
12088
|
if (!w) return [""];
|
|
12089
12089
|
const L = [];
|
|
12090
12090
|
let U = "";
|
|
@@ -12098,12 +12098,12 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12098
12098
|
`).forEach((w) => {
|
|
12099
12099
|
h(w).forEach((L) => g.push(L));
|
|
12100
12100
|
});
|
|
12101
|
-
const y = c, C =
|
|
12101
|
+
const y = c, C = p * g.length + 4;
|
|
12102
12102
|
l.width = Math.max(1, Math.floor(y * u)), l.height = Math.max(1, Math.floor(C * u)), l.style.width = `${y}px`, l.style.height = `${C}px`;
|
|
12103
12103
|
const k = l.getContext("2d");
|
|
12104
12104
|
k && (k.setTransform(u, 0, 0, u, 0, 0), k.clearRect(0, 0, y, C), g.forEach((w, L) => {
|
|
12105
|
-
const U = d.getPath(w, 0, t.fontSize + L *
|
|
12106
|
-
U.fill =
|
|
12105
|
+
const U = d.getPath(w, 0, t.fontSize + L * p, t.fontSize);
|
|
12106
|
+
U.fill = f, U.draw(k);
|
|
12107
12107
|
}));
|
|
12108
12108
|
}, o = () => {
|
|
12109
12109
|
if (r && (r.disconnect(), r = null), t.renderMode !== "canvas" || typeof ResizeObserver > "u") return;
|
|
@@ -12139,7 +12139,7 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12139
12139
|
fontSize: `${e.fontSize}px`,
|
|
12140
12140
|
lineHeight: 1.4
|
|
12141
12141
|
})
|
|
12142
|
-
},
|
|
12142
|
+
}, Y(e.text), 5))
|
|
12143
12143
|
], 512));
|
|
12144
12144
|
}
|
|
12145
12145
|
}), zc = { class: "vfp-flex vfp-flex-col vfp-w-full vfp-h-full vfp-overflow-hidden" }, jc = {
|
|
@@ -12148,13 +12148,13 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12148
12148
|
}, Wc = { class: "vfp-renderer-loading-content" }, qc = { class: "vfp-renderer-loading-text" }, $c = { class: "vfp-flex-shrink-0 vfp-px-6 vfp-py-4 vfp-bg-surface-1 vfp-border-b vfp-border-line-weak vfp-min-w-0" }, Xc = { class: "vfp-grid vfp-grid-cols-2 vfp-gap-x-6 vfp-gap-y-2 vfp-text-sm vfp-min-w-0" }, Yc = { class: "vfp-flex vfp-items-center vfp-gap-2 vfp-min-w-0" }, Zc = { class: "vfp-text-fg-tertiary vfp-flex-shrink-0" }, Kc = { class: "vfp-text-fg-primary vfp-font-semibold vfp-truncate" }, Qc = {
|
|
12149
12149
|
key: 0,
|
|
12150
12150
|
class: "vfp-flex vfp-items-center vfp-gap-2 vfp-min-w-0"
|
|
12151
|
-
}, Jc = { class: "vfp-text-fg-tertiary vfp-flex-shrink-0" },
|
|
12151
|
+
}, Jc = { class: "vfp-text-fg-tertiary vfp-flex-shrink-0" }, ef = { class: "vfp-text-fg-primary vfp-truncate" }, tf = { class: "vfp-flex vfp-items-center vfp-gap-2 vfp-min-w-0" }, nf = { class: "vfp-text-fg-tertiary vfp-flex-shrink-0" }, sf = { class: "vfp-text-fg-primary vfp-truncate" }, rf = { class: "vfp-flex vfp-items-center vfp-gap-2 vfp-min-w-0" }, af = { class: "vfp-text-fg-tertiary vfp-flex-shrink-0" }, of = { class: "vfp-text-fg-primary vfp-truncate" }, lf = {
|
|
12152
12152
|
key: 1,
|
|
12153
12153
|
class: "vfp-flex vfp-items-center vfp-gap-2 vfp-min-w-0"
|
|
12154
|
-
},
|
|
12154
|
+
}, uf = { class: "vfp-text-fg-tertiary vfp-flex-shrink-0" }, cf = { class: "vfp-text-fg-primary vfp-truncate" }, ff = {
|
|
12155
12155
|
key: 2,
|
|
12156
12156
|
class: "vfp-flex vfp-items-center vfp-gap-2 vfp-min-w-0"
|
|
12157
|
-
},
|
|
12157
|
+
}, pf = { class: "vfp-text-fg-tertiary vfp-flex-shrink-0" }, hf = { class: "vfp-text-fg-primary vfp-truncate" }, df = { class: "vfp-flex-1 vfp-overflow-auto vfp-min-w-0" }, gf = { class: "vfp-px-6 vfp-py-6 vfp-space-y-8 vfp-min-w-0" }, mf = { class: "vfp-min-w-0" }, yf = { class: "vfp-block vfp-text-xs vfp-text-fg-tertiary vfp-mb-2" }, vf = ["placeholder"], bf = { class: "vfp-space-y-6 vfp-min-w-0" }, xf = { class: "vfp-text-xs vfp-text-fg-tertiary" }, Sf = { class: "vfp-space-y-6 vfp-pt-6 vfp-border-t vfp-border-line-weak vfp-min-w-0" }, Tf = { class: "vfp-min-w-0" }, kf = { class: "vfp-text-sm vfp-text-fg-tertiary vfp-mb-3" }, Cf = { class: "vfp-min-w-0" }, Of = { class: "vfp-text-sm vfp-text-fg-tertiary vfp-mb-3" }, wf = 2001684018, Ef = 2001684038, Rf = 1330926671, If = 65536, Lf = 1953658213, Ff = /* @__PURE__ */ ws({
|
|
12158
12158
|
__name: "index",
|
|
12159
12159
|
props: {
|
|
12160
12160
|
url: {}
|
|
@@ -12163,14 +12163,14 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12163
12163
|
const n = (B) => {
|
|
12164
12164
|
if (B.byteLength < 4) return "unknown";
|
|
12165
12165
|
const O = new DataView(B).getUint32(0);
|
|
12166
|
-
return O ===
|
|
12167
|
-
}, s = [72, 48, 36, 24, 18], r = e, { t: a } = Vr(), o = zr(), i = jr(), l = Re(null), c = Re(null), u = Re("loading"),
|
|
12166
|
+
return O === wf ? "woff2" : O === Ef ? "woff" : O === Rf ? "otf" : O === If || O === Lf ? "ttf" : "unknown";
|
|
12167
|
+
}, s = [72, 48, 36, 24, 18], r = e, { t: a } = Vr(), o = zr(), i = jr(), l = Re(null), c = Re(null), u = Re("loading"), p = Re(!0), f = Re(null), d = Re(""), h = Re("fontface");
|
|
12168
12168
|
let g = null;
|
|
12169
12169
|
const y = mt(() => d.value || a.value("font.sample_pangram")), C = mt(() => u.value !== "ready"), k = mt(
|
|
12170
12170
|
() => u.value === "loading" ? a.value("font.metadata_loading") : a.value("font.metadata_unavailable")
|
|
12171
12171
|
), w = mt(() => h.value === "canvas" && l.value ? "canvas" : "fontface"), L = (B) => {
|
|
12172
|
-
var
|
|
12173
|
-
const O = ((
|
|
12172
|
+
var V;
|
|
12173
|
+
const O = ((V = B.split(".").pop()) == null ? void 0 : V.toLowerCase().split("?")[0]) || "";
|
|
12174
12174
|
return {
|
|
12175
12175
|
ttf: "TrueType (TTF)",
|
|
12176
12176
|
otf: "OpenType (OTF)",
|
|
@@ -12195,13 +12195,13 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12195
12195
|
const _ = Vc(B);
|
|
12196
12196
|
if (!_)
|
|
12197
12197
|
throw new $t("font.invalid_data");
|
|
12198
|
-
const
|
|
12198
|
+
const V = _.names || {}, E = ["windows", "macintosh", "unicode"].map((G) => V[G]).filter((G) => !!G && typeof G == "object"), x = (G) => {
|
|
12199
12199
|
for (const We of E) {
|
|
12200
|
-
const re = We[
|
|
12200
|
+
const re = We[G], ae = (re == null ? void 0 : re.en) || (re == null ? void 0 : re["zh-Hans"]);
|
|
12201
12201
|
if (ae) return ae;
|
|
12202
12202
|
}
|
|
12203
|
-
const
|
|
12204
|
-
return (
|
|
12203
|
+
const $ = V[G];
|
|
12204
|
+
return ($ == null ? void 0 : $.en) || ($ == null ? void 0 : $["zh-Hans"]) || "";
|
|
12205
12205
|
}, T = {
|
|
12206
12206
|
family: x("fontFamily") || x("postScriptName") || "Unknown",
|
|
12207
12207
|
subfamily: x("fontSubfamily"),
|
|
@@ -12215,124 +12215,122 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12215
12215
|
return Es(async () => {
|
|
12216
12216
|
if (r.url)
|
|
12217
12217
|
try {
|
|
12218
|
-
|
|
12218
|
+
p.value = !0, f.value = null, u.value = "loading";
|
|
12219
12219
|
const B = await o.value(r.url);
|
|
12220
12220
|
if (!B.ok)
|
|
12221
12221
|
throw new $t("font.load_failed");
|
|
12222
|
-
const O = await B.arrayBuffer(), _ = O.slice(0),
|
|
12223
|
-
|
|
12224
|
-
|
|
12225
|
-
|
|
12226
|
-
|
|
12227
|
-
} catch (T) {
|
|
12228
|
-
H !== "woff2" && console.warn(
|
|
12222
|
+
const O = await B.arrayBuffer(), _ = O.slice(0), V = n(O), E = D(_), x = F(O, V), [T, G] = await Promise.allSettled([E, x]);
|
|
12223
|
+
if (p.value = !1, G.status === "rejected") {
|
|
12224
|
+
if (T.status === "rejected") throw T.reason;
|
|
12225
|
+
const $ = G.reason;
|
|
12226
|
+
V !== "woff2" && console.warn(
|
|
12229
12227
|
"[FontRenderer] Metadata parse failed, font is still rendered via FontFace:",
|
|
12230
|
-
|
|
12228
|
+
$ instanceof Error ? $.message : String($)
|
|
12231
12229
|
), u.value = "unavailable", c.value = {
|
|
12232
12230
|
family: "Unknown",
|
|
12233
12231
|
subfamily: "",
|
|
12234
12232
|
version: "",
|
|
12235
12233
|
designer: "",
|
|
12236
12234
|
glyphCount: 0,
|
|
12237
|
-
format: U(
|
|
12235
|
+
format: U(V, r.url)
|
|
12238
12236
|
};
|
|
12239
12237
|
}
|
|
12240
12238
|
} catch (B) {
|
|
12241
12239
|
console.warn(
|
|
12242
12240
|
"[FontRenderer] Failed to load font:",
|
|
12243
12241
|
B instanceof Error ? B.message : String(B)
|
|
12244
|
-
),
|
|
12242
|
+
), f.value = a.value("font.load_failed"), p.value = !1, u.value = "unavailable";
|
|
12245
12243
|
}
|
|
12246
12244
|
}), Rs(() => {
|
|
12247
12245
|
g && (document.fonts.delete(g), g = null);
|
|
12248
12246
|
}), t({
|
|
12249
12247
|
getToolbarGroups: () => []
|
|
12250
12248
|
}), (B, O) => (ge(), ke("div", zc, [
|
|
12251
|
-
|
|
12249
|
+
p.value ? (ge(), ke("div", jc, [
|
|
12252
12250
|
M("div", Wc, [
|
|
12253
12251
|
O[1] || (O[1] = M("div", { class: "vfp-renderer-spinner" }, null, -1)),
|
|
12254
|
-
M("span", qc,
|
|
12252
|
+
M("span", qc, Y(Z(a)("font.loading")), 1)
|
|
12255
12253
|
])
|
|
12256
|
-
])) :
|
|
12254
|
+
])) : f.value || !c.value ? (ge(), Nr(Wr, {
|
|
12257
12255
|
key: 1,
|
|
12258
|
-
message:
|
|
12256
|
+
message: f.value || Z(a)("font.parse_failed")
|
|
12259
12257
|
}, null, 8, ["message"])) : (ge(), ke(Fn, { key: 2 }, [
|
|
12260
12258
|
M("div", $c, [
|
|
12261
12259
|
M("div", Xc, [
|
|
12262
12260
|
M("div", Yc, [
|
|
12263
|
-
M("span", Zc,
|
|
12264
|
-
M("span", Kc,
|
|
12261
|
+
M("span", Zc, Y(Z(a)("font.meta.family")) + ":", 1),
|
|
12262
|
+
M("span", Kc, Y(C.value ? k.value : c.value.family), 1)
|
|
12265
12263
|
]),
|
|
12266
12264
|
c.value.subfamily ? (ge(), ke("div", Qc, [
|
|
12267
|
-
M("span", Jc,
|
|
12268
|
-
M("span",
|
|
12265
|
+
M("span", Jc, Y(Z(a)("font.meta.subfamily")) + ":", 1),
|
|
12266
|
+
M("span", ef, Y(c.value.subfamily), 1)
|
|
12269
12267
|
])) : Wt("", !0),
|
|
12270
|
-
M("div",
|
|
12271
|
-
M("span",
|
|
12272
|
-
M("span",
|
|
12268
|
+
M("div", tf, [
|
|
12269
|
+
M("span", nf, Y(Z(a)("font.meta.format")) + ":", 1),
|
|
12270
|
+
M("span", sf, Y(c.value.format), 1)
|
|
12273
12271
|
]),
|
|
12274
|
-
M("div",
|
|
12275
|
-
M("span",
|
|
12276
|
-
M("span",
|
|
12272
|
+
M("div", rf, [
|
|
12273
|
+
M("span", af, Y(Z(a)("font.meta.glyphs")) + ":", 1),
|
|
12274
|
+
M("span", of, Y(C.value ? k.value : c.value.glyphCount), 1)
|
|
12277
12275
|
]),
|
|
12278
|
-
c.value.designer ? (ge(), ke("div",
|
|
12279
|
-
M("span",
|
|
12280
|
-
M("span",
|
|
12276
|
+
c.value.designer ? (ge(), ke("div", lf, [
|
|
12277
|
+
M("span", uf, Y(Z(a)("font.meta.designer")) + ":", 1),
|
|
12278
|
+
M("span", cf, Y(c.value.designer), 1)
|
|
12281
12279
|
])) : Wt("", !0),
|
|
12282
|
-
c.value.version ? (ge(), ke("div",
|
|
12283
|
-
M("span",
|
|
12284
|
-
M("span",
|
|
12280
|
+
c.value.version ? (ge(), ke("div", ff, [
|
|
12281
|
+
M("span", pf, Y(Z(a)("font.meta.version")) + ":", 1),
|
|
12282
|
+
M("span", hf, Y(c.value.version), 1)
|
|
12285
12283
|
])) : Wt("", !0)
|
|
12286
12284
|
])
|
|
12287
12285
|
]),
|
|
12288
|
-
M("div",
|
|
12289
|
-
M("div",
|
|
12290
|
-
M("div",
|
|
12291
|
-
M("label",
|
|
12286
|
+
M("div", df, [
|
|
12287
|
+
M("div", gf, [
|
|
12288
|
+
M("div", mf, [
|
|
12289
|
+
M("label", yf, Y(Z(a)("font.sample_text_placeholder")), 1),
|
|
12292
12290
|
_r(M("textarea", {
|
|
12293
12291
|
"onUpdate:modelValue": O[0] || (O[0] = (_) => d.value = _),
|
|
12294
12292
|
class: "vfp-block vfp-w-full vfp-box-border vfp-px-3 vfp-py-2.5 vfp-bg-surface-2 vfp-text-fg-primary vfp-text-sm vfp-leading-relaxed vfp-border vfp-border-line vfp-rounded-md vfp-resize-y focus:vfp-outline-none focus:vfp-border-line-strong",
|
|
12295
12293
|
rows: "2",
|
|
12296
|
-
placeholder:
|
|
12294
|
+
placeholder: Z(a)("font.sample_text_placeholder"),
|
|
12297
12295
|
style: { minHeight: "64px", maxHeight: "160px" }
|
|
12298
|
-
}, null, 8,
|
|
12296
|
+
}, null, 8, vf), [
|
|
12299
12297
|
[Gr, d.value]
|
|
12300
12298
|
])
|
|
12301
12299
|
]),
|
|
12302
|
-
M("div",
|
|
12300
|
+
M("div", bf, [
|
|
12303
12301
|
(ge(), ke(Fn, null, Hr(s, (_) => M("div", {
|
|
12304
12302
|
key: _,
|
|
12305
12303
|
class: "vfp-space-y-2 vfp-min-w-0"
|
|
12306
12304
|
}, [
|
|
12307
|
-
M("div",
|
|
12305
|
+
M("div", xf, Y(_) + "px", 1),
|
|
12308
12306
|
qt(rn, {
|
|
12309
12307
|
font: l.value,
|
|
12310
12308
|
text: y.value,
|
|
12311
12309
|
"font-size": _,
|
|
12312
12310
|
"render-mode": w.value,
|
|
12313
|
-
theme:
|
|
12311
|
+
theme: Z(i)
|
|
12314
12312
|
}, null, 8, ["font", "text", "font-size", "render-mode", "theme"])
|
|
12315
12313
|
])), 64))
|
|
12316
12314
|
]),
|
|
12317
|
-
M("div",
|
|
12318
|
-
M("div",
|
|
12319
|
-
M("div",
|
|
12315
|
+
M("div", Sf, [
|
|
12316
|
+
M("div", Tf, [
|
|
12317
|
+
M("div", kf, Y(Z(a)("font.latin_samples")), 1),
|
|
12320
12318
|
qt(rn, {
|
|
12321
12319
|
font: l.value,
|
|
12322
|
-
text:
|
|
12320
|
+
text: Z(a)("font.sample_latin"),
|
|
12323
12321
|
"font-size": 24,
|
|
12324
12322
|
"render-mode": w.value,
|
|
12325
|
-
theme:
|
|
12323
|
+
theme: Z(i)
|
|
12326
12324
|
}, null, 8, ["font", "text", "render-mode", "theme"])
|
|
12327
12325
|
]),
|
|
12328
|
-
M("div",
|
|
12329
|
-
M("div",
|
|
12326
|
+
M("div", Cf, [
|
|
12327
|
+
M("div", Of, Y(Z(a)("font.chinese_samples")), 1),
|
|
12330
12328
|
qt(rn, {
|
|
12331
12329
|
font: l.value,
|
|
12332
|
-
text:
|
|
12330
|
+
text: Z(a)("font.sample_chinese"),
|
|
12333
12331
|
"font-size": 24,
|
|
12334
12332
|
"render-mode": w.value,
|
|
12335
|
-
theme:
|
|
12333
|
+
theme: Z(i)
|
|
12336
12334
|
}, null, 8, ["font", "text", "render-mode", "theme"])
|
|
12337
12335
|
])
|
|
12338
12336
|
])
|
|
@@ -12343,5 +12341,5 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12343
12341
|
}
|
|
12344
12342
|
});
|
|
12345
12343
|
export {
|
|
12346
|
-
|
|
12344
|
+
Ff as default
|
|
12347
12345
|
};
|