@eternalheart/vue-file-preview 1.7.0 → 1.7.2
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 +6 -1
- package/lib/FilePreviewModal.vue.d.ts +6 -1
- package/lib/chunks/{EmptyState.vue_vue_type_script_setup_true_lang--ZOobbGi.mjs → EmptyState.vue_vue_type_script_setup_true_lang-Dna6LmVT.mjs} +1 -1
- package/lib/chunks/{avifLoader-CAUzjn-d-CnJpGYJ2.mjs → avifLoader-CAUzjn-d-dPsP28D5.mjs} +1 -1
- package/lib/chunks/{heicLoader-D_9PukkA-g_dLrWLP.mjs → heicLoader-D_9PukkA-T-k1DSgY.mjs} +1 -1
- package/lib/chunks/{index-c-pYJEmH.mjs → index-B5hprvcF.mjs} +1747 -1709
- package/lib/chunks/index-BN__EwfT.mjs +333 -0
- package/lib/chunks/{index-z9RqL2wI.mjs → index-BPutNVAf.mjs} +453 -453
- package/lib/chunks/{index-BfOWoMpY.mjs → index-B_Spz6Wn.mjs} +77 -77
- package/lib/chunks/{index-D5IF9F-D.mjs → index-BjHEHkZ8.mjs} +22 -22
- package/lib/chunks/{index-LPGxJDnT.mjs → index-BlZ6RmeR.mjs} +18 -18
- package/lib/chunks/{index-CrVQPnFj.mjs → index-C95y29OL.mjs} +18 -18
- package/lib/chunks/{index-DFeKS8tR.mjs → index-CegPYMyO.mjs} +22 -22
- package/lib/chunks/{index-C4hIk6pa.mjs → index-CqOGKCyE.mjs} +2 -2
- package/lib/chunks/{index-6XZXYqbp.mjs → index-Cv3Sg87O.mjs} +29 -32
- package/lib/chunks/{index-zLQlyNR2.mjs → index-DHba2Axz.mjs} +62 -62
- package/lib/chunks/{index-CWPdNhoe.mjs → index-DInI3RTN.mjs} +60 -60
- package/lib/chunks/{index-C8lyQPe3.mjs → index-DXzvgRuo.mjs} +3 -3
- package/lib/chunks/{index-BPSzwMOC.mjs → index-DcvlMm9Q.mjs} +46 -46
- package/lib/chunks/index-Dnyl1HQk.mjs +51 -0
- package/lib/chunks/{index-aKiIuKKx.mjs → index-JjVQZbDt.mjs} +50 -50
- package/lib/chunks/{index-DZe0BxAB.mjs → index-QPk2c2Tl.mjs} +20 -20
- package/lib/chunks/{index-DM8Dfl-m.mjs → index-TZv0MqBH.mjs} +15 -15
- package/lib/chunks/{index-BzwJ0VWu.mjs → index-cRhwUlQN.mjs} +33 -33
- package/lib/chunks/{index-BYQ9S7Mk.mjs → index-dOxDeWYi.mjs} +30 -30
- package/lib/chunks/{index-Bg8poMIm.mjs → index-eNZr1h6f.mjs} +29 -29
- package/lib/chunks/{index-Bf94DwQu.mjs → index-oJF-hur2.mjs} +24 -24
- package/lib/chunks/{jp2Loader-Dig19xyo-fCO1knZ0.mjs → jp2Loader-Dig19xyo-hrIg_KJ3.mjs} +1 -1
- package/lib/chunks/{psdLoader-C0tKUXXl-DihMskai.mjs → psdLoader-C0tKUXXl-B2cJ4s7t.mjs} +1 -1
- package/lib/chunks/{rawLoader-C-tPeFAB-BSfDPl-z.mjs → rawLoader-C-tPeFAB-BNV-Wmzr.mjs} +1 -1
- package/lib/chunks/{tiffLoader-BlhByX8w-JY5DaTre.mjs → tiffLoader-BlhByX8w-BzSrLE9Y.mjs} +1 -1
- package/lib/chunks/{useShikiHighlight-C-ztcJBE.mjs → useShikiHighlight-CpL0RAQg.mjs} +1 -1
- package/lib/composables/usePreviewEvents.d.ts +2 -2
- package/lib/composables/useRequest.d.ts +8 -2
- package/lib/core/events.d.ts +18 -1
- package/lib/core/index.d.ts +1 -1
- package/lib/index.cjs +54 -54
- package/lib/index.css +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.mjs +5 -5
- package/package.json +1 -1
- package/lib/chunks/index-C41YET0_.mjs +0 -51
- package/lib/chunks/index-GFcSJEwj.mjs +0 -330
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as ws, ref as Ie, onMounted as Es, onBeforeUnmount as Rs, watch as Pr, openBlock as ge, createElementBlock as ke, normalizeStyle as Br, toDisplayString as Z, computed as mt, createElementVNode as P, unref as K, 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, a as zr, b as jr,
|
|
2
|
+
import { u as Vr, a as zr, b as jr, e as Wr, J as $t } from "./index-B5hprvcF.mjs";
|
|
3
3
|
import { _ as qr } from "./RendererError.vue_vue_type_script_setup_true_lang-FmkMQHB8.mjs";
|
|
4
4
|
var yn = 0, Is = -3;
|
|
5
5
|
function at() {
|
|
@@ -89,9 +89,9 @@ function Kr(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 @@ ze.prototype.addY = function(e) {
|
|
|
176
176
|
this.addPoint(null, e);
|
|
177
177
|
};
|
|
178
178
|
ze.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 E = -g / d;
|
|
186
|
-
0 < E && E < 1 && (
|
|
186
|
+
0 < E && E < 1 && (f === 0 && this.addX($e(l[f], c[f], u[f], p[f], E)), f === 1 && this.addY($e(l[f], c[f], u[f], p[f], E)));
|
|
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 O = (-d + Math.sqrt(y)) / (2 * h);
|
|
192
|
-
0 < O && O < 1 && (
|
|
192
|
+
0 < O && O < 1 && (f === 0 && this.addX($e(l[f], c[f], u[f], p[f], O)), f === 1 && this.addY($e(l[f], c[f], u[f], p[f], O)));
|
|
193
193
|
const C = (-d - Math.sqrt(y)) / (2 * h);
|
|
194
|
-
0 < C && C < 1 && (
|
|
194
|
+
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)));
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
197
|
ze.prototype.addQuad = function(e, t, n, s, r, a) {
|
|
@@ -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,17 +321,17 @@ $.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
|
};
|
|
@@ -1116,13 +1116,13 @@ function ca(e, t, n) {
|
|
|
1116
1116
|
s <<= 8, s += e.getUint8(t + r);
|
|
1117
1117
|
return s;
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function fa(e, t, n) {
|
|
1120
1120
|
const s = [];
|
|
1121
1121
|
for (let r = t; r < n; r += 1)
|
|
1122
1122
|
s.push(e.getUint8(r));
|
|
1123
1123
|
return s;
|
|
1124
1124
|
}
|
|
1125
|
-
function
|
|
1125
|
+
function pa(e) {
|
|
1126
1126
|
let t = "";
|
|
1127
1127
|
for (let n = 0; n < e.length; n += 1)
|
|
1128
1128
|
t += String.fromCharCode(e[n]);
|
|
@@ -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;
|
|
@@ -1591,22 +1591,22 @@ m.prototype.parseTupleVariationStore = function(e, t, n, s, r) {
|
|
|
1591
1591
|
const o = this.parseUShort(), i = !!(o & J.SHARED_POINT_NUMBERS), l = o & J.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, O = this.relativeOffset, C = (E) => {
|
|
1605
1605
|
let L, U;
|
|
1606
1606
|
const F = () => {
|
|
1607
1607
|
let M = 0;
|
|
1608
1608
|
if (n === "gvar") {
|
|
1609
|
-
if (M = g.privatePoints.length ||
|
|
1609
|
+
if (M = g.privatePoints.length || p.length, !M) {
|
|
1610
1610
|
const H = s.get(r);
|
|
1611
1611
|
H.path, M = H.points.length, M += 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", C.call(this, "deltas")), n === "gvar" && Object.defineProperty(g, "deltasY", C.call(this, "deltasY")),
|
|
1626
|
+
Object.defineProperty(g, "deltas", C.call(this, "deltas")), n === "gvar" && Object.defineProperty(g, "deltasY", C.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 & J.EMBEDDED_PEAK_TUPLE), a = !!(s & J.INTERMEDIATE_REGION), o = !!(s & J.PRIVATE_POINT_NUMBERS), i = r ? void 0 : s & J.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,
|
|
1635
|
+
const n = this.parseUShort(), s = this.parseUShort(), r = !!(s & J.EMBEDDED_PEAK_TUPLE), a = !!(s & J.INTERMEDIATE_REGION), o = !!(s & J.PRIVATE_POINT_NUMBERS), i = r ? void 0 : s & J.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,7 +1643,7 @@ 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 = [];
|
|
@@ -1683,8 +1683,8 @@ var x = {
|
|
|
1683
1683
|
getFixed: Hs,
|
|
1684
1684
|
getTag: ua,
|
|
1685
1685
|
getOffset: ca,
|
|
1686
|
-
getBytes:
|
|
1687
|
-
bytesToString:
|
|
1686
|
+
getBytes: fa,
|
|
1687
|
+
bytesToString: pa,
|
|
1688
1688
|
Parser: m
|
|
1689
1689
|
}, Dt = [
|
|
1690
1690
|
"copyright",
|
|
@@ -2435,7 +2435,7 @@ function va(e) {
|
|
|
2435
2435
|
function ba(e, t, n) {
|
|
2436
2436
|
const s = {}, r = new x.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 = ga(c, p, n), O = Sn(c, u, p), C = va(c);
|
|
2439
2439
|
if (O !== void 0 && y !== void 0 && C !== void 0) {
|
|
2440
2440
|
let E;
|
|
2441
2441
|
if (O === un ? E = Qe.UTF16(e, i + g, h) : E = Qe.MACSTRING(e, i + g, h, O), E) {
|
|
@@ -2491,16 +2491,16 @@ function Sa(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 O = g[y];
|
|
2506
2506
|
if (d === 1 || d === 0) {
|
|
@@ -2584,11 +2584,11 @@ function Ca(e, t, n, s, r) {
|
|
|
2584
2584
|
e.segCount = a = t.parseUShort() >> 1, t.skip("uShort", 3), e.glyphIndexMap = {};
|
|
2585
2585
|
const o = new x.Parser(n, s + r + 14), i = new x.Parser(n, s + r + 16 + a * 2), l = new x.Parser(n, s + r + 16 + a * 4), c = new x.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 O = h; O <= d; O += 1)
|
|
2591
|
-
y !== 0 ? (u = c.offset + c.relativeOffset - 2, u += y, u += (O - h) * 2,
|
|
2591
|
+
y !== 0 ? (u = c.offset + c.relativeOffset - 2, u += y, u += (O - h) * 2, f = x.getUShort(n, u), f !== 0 && (f = f + g & 65535)) : f = O + g & 65535, e.glyphIndexMap[O] = f;
|
|
2592
2592
|
}
|
|
2593
2593
|
}
|
|
2594
2594
|
function Oa(e, t) {
|
|
@@ -2608,12 +2608,12 @@ function Oa(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 wa(e, t) {
|
|
|
2625
2625
|
n.version = x.getUShort(e, t), R.argument(n.version === 0, "cmap table version should be 0."), n.numTables = x.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 = x.getUShort(e, t + 4 +
|
|
2628
|
+
for (let p = n.numTables - 1; p >= 0; p -= 1)
|
|
2629
|
+
if (o = x.getUShort(e, t + 4 + p * 8), i = x.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 = x.getULong(e, t + 4 +
|
|
2631
|
+
if (a = x.getULong(e, t + 4 + p * 8 + 4), s)
|
|
2632
2632
|
break;
|
|
2633
2633
|
} else if (o === 0 && i === 5) {
|
|
2634
|
-
if (r = x.getULong(e, t + 4 +
|
|
2634
|
+
if (r = x.getULong(e, t + 4 + p * 8 + 4), s = new x.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 La(e) {
|
|
|
2718
2718
|
return d.start - h.start;
|
|
2719
2719
|
}), r.segments = Ia(r.segments), Ra(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 La(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
|
}
|
|
@@ -4711,50 +4711,50 @@ ee.prototype.getPath = function(e, t, n, s, r) {
|
|
|
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
|
ee.prototype.getLayers = function(e) {
|
|
4760
4760
|
if (!e)
|
|
@@ -4797,25 +4797,25 @@ ee.prototype.draw = function(e, t, n, s, r, a) {
|
|
|
4797
4797
|
};
|
|
4798
4798
|
ee.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);
|
|
@@ -4942,15 +4942,15 @@ function Te(e, t, n, s) {
|
|
|
4942
4942
|
if (o !== 0) {
|
|
4943
4943
|
const u = x.getByte(e, t + i);
|
|
4944
4944
|
l = t + (o + 1) * u + i;
|
|
4945
|
-
let
|
|
4946
|
-
for (let
|
|
4947
|
-
r.push(x.getOffset(e,
|
|
4945
|
+
let p = t + i + 1;
|
|
4946
|
+
for (let f = 0; f < o + 1; f += 1)
|
|
4947
|
+
r.push(x.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 = x.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 ro(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, O, C, E, L = 0, U = [], F, M = 0;
|
|
5235
5235
|
const H = e.tables.cff2 || e.tables.cff;
|
|
5236
5236
|
if (C = H.topDict._defaultWidthX, E = H.topDict._nominalWidthX, r = r || e.variation && e.variation.get(), t.getBlendPath || (t.getBlendPath = function(T) {
|
|
5237
|
-
return
|
|
5237
|
+
return fn(e, t, n, s, T);
|
|
5238
5238
|
}), e.isCIDFont || s > 1) {
|
|
5239
5239
|
const T = H.topDict._fdSelect ? H.topDict._fdSelect[t.index] : 0, S = H.topDict._fdArray[T];
|
|
5240
5240
|
y = S._subrs, O = S._subrsBias, s > 1 ? (U = H.topDict._vstore.itemVariationStore, L = S._privateDict.vsindex) : (C = S._defaultWidthX, E = S._nominalWidthX);
|
|
@@ -5247,13 +5247,13 @@ function pn(e, t, n, s, r) {
|
|
|
5247
5247
|
}
|
|
5248
5248
|
function N() {
|
|
5249
5249
|
let T;
|
|
5250
|
-
T = (u.length & 1) !== 0, T && !
|
|
5250
|
+
T = (u.length & 1) !== 0, T && !f && (I = u.shift() + E), p += u.length >> 1, u.length = 0, f = !0;
|
|
5251
5251
|
}
|
|
5252
5252
|
function k(T) {
|
|
5253
|
-
let S,
|
|
5253
|
+
let S, V, q, te, Ee, X, Y, ce, Q, oe, ne, se, j = 0;
|
|
5254
5254
|
for (; j < T.length; ) {
|
|
5255
|
-
let
|
|
5256
|
-
switch (j += 1,
|
|
5255
|
+
let pe = T[j];
|
|
5256
|
+
switch (j += 1, pe) {
|
|
5257
5257
|
case 1:
|
|
5258
5258
|
N();
|
|
5259
5259
|
break;
|
|
@@ -5261,7 +5261,7 @@ function pn(e, t, n, s, r) {
|
|
|
5261
5261
|
N();
|
|
5262
5262
|
break;
|
|
5263
5263
|
case 4:
|
|
5264
|
-
u.length > 1 && !
|
|
5264
|
+
u.length > 1 && !f && (I = u.shift() + E, f = !0), g += u.pop(), D(h, g);
|
|
5265
5265
|
break;
|
|
5266
5266
|
case 5:
|
|
5267
5267
|
for (; u.length > 0; )
|
|
@@ -5295,7 +5295,7 @@ function pn(e, t, n, s, r) {
|
|
|
5295
5295
|
}
|
|
5296
5296
|
return;
|
|
5297
5297
|
case 12:
|
|
5298
|
-
switch (
|
|
5298
|
+
switch (pe = T[j], j += 1, pe) {
|
|
5299
5299
|
case 35:
|
|
5300
5300
|
a = h + u.shift(), o = g + u.shift(), i = a + u.shift(), l = o + u.shift(), Y = i + u.shift(), ce = l + u.shift(), Q = Y + u.shift(), oe = ce + u.shift(), ne = Q + u.shift(), se = oe + u.shift(), h = ne + u.shift(), g = se + u.shift(), u.shift(), c.curveTo(a, o, i, l, Y, ce), c.curveTo(Q, oe, ne, se, h, g);
|
|
5301
5301
|
break;
|
|
@@ -5309,7 +5309,7 @@ function pn(e, t, n, s, r) {
|
|
|
5309
5309
|
a = h + u.shift(), o = g + u.shift(), i = a + u.shift(), l = o + u.shift(), Y = i + u.shift(), ce = l + u.shift(), Q = Y + u.shift(), oe = ce + u.shift(), ne = Q + u.shift(), se = oe + u.shift(), Math.abs(ne - h) > Math.abs(se - g) ? h = ne + u.shift() : g = se + u.shift(), c.curveTo(a, o, i, l, Y, ce), c.curveTo(Q, oe, ne, se, 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 && (I = u.shift() + E, f = !0);
|
|
5342
5342
|
d && ue !== 2 && (c.closePath(), d = !1);
|
|
5343
5343
|
break;
|
|
5344
5344
|
case 15:
|
|
@@ -5354,7 +5354,7 @@ function pn(e, t, n, s, r) {
|
|
|
5354
5354
|
break;
|
|
5355
5355
|
}
|
|
5356
5356
|
F || (F = e.variation && r && e.variation.process.getBlendVector(U, L, r));
|
|
5357
|
-
var G = u.pop(), ae = F ? F.length : U.itemVariationSubtables[L].regionIndexes.length,
|
|
5357
|
+
var G = u.pop(), ae = F ? F.length : U.itemVariationSubtables[L].regionIndexes.length, fe = G * ae, de = u.length - fe, Re = de - G;
|
|
5358
5358
|
if (F)
|
|
5359
5359
|
for (let _e = 0; _e < G; _e++) {
|
|
5360
5360
|
var An = u[Re + _e];
|
|
@@ -5362,7 +5362,7 @@ function pn(e, t, n, s, r) {
|
|
|
5362
5362
|
An += F[qe] * u[de++];
|
|
5363
5363
|
u[Re + _e] = An;
|
|
5364
5364
|
}
|
|
5365
|
-
for (;
|
|
5365
|
+
for (; fe--; )
|
|
5366
5366
|
u.pop();
|
|
5367
5367
|
break;
|
|
5368
5368
|
case 18:
|
|
@@ -5370,13 +5370,13 @@ function pn(e, t, n, s, r) {
|
|
|
5370
5370
|
break;
|
|
5371
5371
|
case 19:
|
|
5372
5372
|
case 20:
|
|
5373
|
-
N(), j +=
|
|
5373
|
+
N(), j += p + 7 >> 3;
|
|
5374
5374
|
break;
|
|
5375
5375
|
case 21:
|
|
5376
|
-
u.length > 2 && !
|
|
5376
|
+
u.length > 2 && !f && (I = u.shift() + E, f = !0), g += u.pop(), h += u.pop(), D(h, g);
|
|
5377
5377
|
break;
|
|
5378
5378
|
case 22:
|
|
5379
|
-
u.length > 1 && !
|
|
5379
|
+
u.length > 1 && !f && (I = u.shift() + E, f = !0), h += u.pop(), D(h, g);
|
|
5380
5380
|
break;
|
|
5381
5381
|
case 23:
|
|
5382
5382
|
N();
|
|
@@ -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
|
-
S = T[j],
|
|
5403
|
+
S = T[j], V = T[j + 1], u.push((S << 24 | V << 16) >> 16), j += 2;
|
|
5404
5404
|
break;
|
|
5405
5405
|
case 29:
|
|
5406
5406
|
if (Ee = u.pop() + e.gsubrsBias, X = e.gsubrs[Ee], X) {
|
|
@@ -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 ? (S = T[j], j += 1, u.push((pe - 247) * 256 + S + 108)) : pe < 255 ? (S = T[j], j += 1, u.push(-(pe - 251) * 256 - S - 108)) : (S = T[j], V = T[j + 1], q = T[j + 2], te = T[j + 3], j += 4, u.push((S << 24 | V << 16 | q << 8 | te) / 65536));
|
|
5424
5424
|
}
|
|
5425
5425
|
}
|
|
5426
5426
|
}
|
|
5427
5427
|
return k(n), e.variation && r && (c.commands = c.commands.map((T) => {
|
|
5428
5428
|
const S = Object.keys(T);
|
|
5429
|
-
for (let
|
|
5430
|
-
const q = S[
|
|
5429
|
+
for (let V = 0; V < S.length; V++) {
|
|
5430
|
+
const q = S[V];
|
|
5431
5431
|
q !== "type" && (T[q] = Math.round(T[q]));
|
|
5432
5432
|
}
|
|
5433
5433
|
return T;
|
|
5434
|
-
})),
|
|
5434
|
+
})), f && (t.advanceWidth = I), 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 lo(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 = x.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 = ro(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 = $a(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 = Aa : u.charset === 1 ? f = Ua : u.charset === 2 ? f = Da : f = ao(e, t + u.charset, n.nGlyphs, l.objects, n.isCIDFont), u.encoding === 0 ? d = cn : u.encoding === 1 ? d = Fa : d = oo(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 = Xa(
|
|
5513
|
-
n.glyphs.push(
|
|
5511
|
+
n._push = function(f) {
|
|
5512
|
+
const d = Xa(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 x.Parser(e, t + u.vstore);
|
|
5522
|
+
u._vstore = f.parseVariationStore();
|
|
5523
5523
|
}
|
|
5524
5524
|
}
|
|
5525
5525
|
function sr(e, t) {
|
|
@@ -5564,7 +5564,7 @@ function Xn(e) {
|
|
|
5564
5564
|
]);
|
|
5565
5565
|
return t.topDicts = [{ name: "topDict_0", type: "TABLE", value: e }], t;
|
|
5566
5566
|
}
|
|
5567
|
-
function
|
|
5567
|
+
function fo(e) {
|
|
5568
5568
|
const t = new v.Record("String INDEX", [
|
|
5569
5569
|
{ name: "strings", type: "INDEX", value: [] }
|
|
5570
5570
|
]);
|
|
@@ -5573,7 +5573,7 @@ function po(e) {
|
|
|
5573
5573
|
t.strings.push({ name: "string_" + n, type: "STRING", value: e[n] });
|
|
5574
5574
|
return t;
|
|
5575
5575
|
}
|
|
5576
|
-
function
|
|
5576
|
+
function po() {
|
|
5577
5577
|
return new v.Record("Global Subr INDEX", [
|
|
5578
5578
|
{ name: "subrs", type: "INDEX", value: [] }
|
|
5579
5579
|
]);
|
|
@@ -5595,15 +5595,15 @@ function go(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 go(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 vo(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 = uo(), n.nameIndex = co([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 = po(), n.charsets = ho(i, c), n.charStringsIndex = mo(e), n.privateDict = yo(o, c), n.stringIndex = fo(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: lo, make: vo };
|
|
5671
5671
|
function bo(e, t) {
|
|
5672
5672
|
const n = {}, s = new x.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(), R.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 Bo(e) {
|
|
|
6462
6462
|
{ name: "lookups", type: "TABLE", value: new v.LookupList(e.lookups, je) }
|
|
6463
6463
|
]);
|
|
6464
6464
|
}
|
|
6465
|
-
var
|
|
6465
|
+
var fr = { parse: Po, make: Bo };
|
|
6466
6466
|
function No(e, t) {
|
|
6467
6467
|
const n = new x.Parser(e, t), s = n.parseULong();
|
|
6468
6468
|
R.argument(s === 1, "Unsupported META table version."), n.parseULong(), n.parseULong();
|
|
@@ -6491,7 +6491,7 @@ function _o(e) {
|
|
|
6491
6491
|
}
|
|
6492
6492
|
return r.fields.push({ name: "stringPool", type: "CHARARRAY", value: n }), r;
|
|
6493
6493
|
}
|
|
6494
|
-
var
|
|
6494
|
+
var pr = { parse: No, make: _o };
|
|
6495
6495
|
function Go(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 $o(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(zo(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(Wo(e, f + d * c, u, n, c));
|
|
6621
|
+
return { axes: u, instances: p };
|
|
6622
6622
|
}
|
|
6623
6623
|
var dr = { make: qo, parse: $o }, Xo = {
|
|
6624
6624
|
tag: m.tag,
|
|
@@ -6678,20 +6678,20 @@ function Zo(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 && R.argument(l >= n.axes.length, "STAT axis count must be greater than or equal to fvar axis count"), u > 0 && R.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(Xo));
|
|
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(Yo.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 si(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,19 +6898,19 @@ function ci(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;
|
|
6908
6908
|
}
|
|
6909
|
-
function
|
|
6909
|
+
function fi(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,18 +6920,18 @@ function pi(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: O } = 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: O };
|
|
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 = {
|
|
6934
|
-
make:
|
|
6934
|
+
make: fi,
|
|
6935
6935
|
parse: ci
|
|
6936
6936
|
};
|
|
6937
6937
|
function Yn(e) {
|
|
@@ -6987,7 +6987,7 @@ function Kn(e, t, n) {
|
|
|
6987
6987
|
}
|
|
6988
6988
|
return n;
|
|
6989
6989
|
}
|
|
6990
|
-
function
|
|
6990
|
+
function pi(e) {
|
|
6991
6991
|
let t = 0;
|
|
6992
6992
|
for (let n = 0; n < e.length; n += 1)
|
|
6993
6993
|
t += e[n];
|
|
@@ -6995,19 +6995,19 @@ function fi(e) {
|
|
|
6995
6995
|
}
|
|
6996
6996
|
function hi(e) {
|
|
6997
6997
|
const t = [], n = [], s = [], r = [], a = [], o = [], i = [];
|
|
6998
|
-
let l, c = 0, u = 0,
|
|
6998
|
+
let l, c = 0, u = 0, p = 0, f = 0, d = 0;
|
|
6999
6999
|
for (let G = 0; G < e.glyphs.length; G += 1) {
|
|
7000
|
-
const ae = e.glyphs.get(G),
|
|
7000
|
+
const ae = e.glyphs.get(G), fe = ae.unicode | 0;
|
|
7001
7001
|
if (isNaN(ae.advanceWidth))
|
|
7002
7002
|
throw new Error("Glyph " + ae.name + " (" + G + "): advanceWidth is not a number.");
|
|
7003
|
-
(l >
|
|
7004
|
-
const de = dn.getUnicodeRange(
|
|
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 hi(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: pi(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 hi(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).
|
|
@@ -7090,7 +7090,7 @@ function hi(e) {
|
|
|
7090
7090
|
I[G].postScriptName || (I[G].postScriptName = { en: ue });
|
|
7091
7091
|
}
|
|
7092
7092
|
I.unicode.preferredFamily || (I.unicode.preferredFamily = D.fontFamily || N.fontFamily || k.fontFamily), I.macintosh.preferredFamily || (I.macintosh.preferredFamily = N.fontFamily || D.fontFamily || k.fontFamily), I.windows.preferredFamily || (I.windows.preferredFamily = k.fontFamily || D.fontFamily || N.fontFamily), I.unicode.preferredSubfamily || (I.unicode.preferredSubfamily = D.fontSubfamily || N.fontSubfamily || k.fontSubfamily), I.macintosh.preferredSubfamily || (I.macintosh.preferredSubfamily = N.fontSubfamily || D.fontSubfamily || k.fontSubfamily), I.windows.preferredSubfamily || (I.windows.preferredSubfamily = k.fontSubfamily || D.fontSubfamily || N.fontSubfamily);
|
|
7093
|
-
const T = [], S = Ws.make(I, T),
|
|
7093
|
+
const T = [], S = Ws.make(I, T), V = T.length > 0 ? lr.make(T) : void 0, q = cr.make(e), te = pn.make(e.glyphs, {
|
|
7094
7094
|
version: e.getEnglishName("version"),
|
|
7095
7095
|
fullName: H,
|
|
7096
7096
|
familyName: F,
|
|
@@ -7099,10 +7099,10 @@ function hi(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
|
-
}), Ee = e.metas && Object.keys(e.metas).length > 0 ?
|
|
7103
|
-
|
|
7102
|
+
}), Ee = e.metas && Object.keys(e.metas).length > 0 ? pr.make(e.metas) : void 0, X = [y, O, C, E, S, U, q, te, L];
|
|
7103
|
+
V && X.push(V);
|
|
7104
7104
|
const Y = {
|
|
7105
|
-
gsub:
|
|
7105
|
+
gsub: fr,
|
|
7106
7106
|
cpal: Qs,
|
|
7107
7107
|
colr: hr,
|
|
7108
7108
|
stat: gr,
|
|
@@ -7119,8 +7119,8 @@ function hi(e) {
|
|
|
7119
7119
|
for (let G in Y) {
|
|
7120
7120
|
const ae = e.tables[G];
|
|
7121
7121
|
if (ae) {
|
|
7122
|
-
const
|
|
7123
|
-
|
|
7122
|
+
const fe = Y[G].make.call(e, ae, ...ce[G] || []);
|
|
7123
|
+
fe && X.push(fe);
|
|
7124
7124
|
}
|
|
7125
7125
|
}
|
|
7126
7126
|
Ee && X.push(Ee);
|
|
@@ -7551,15 +7551,15 @@ ie.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 @@ ie.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 @@ ie.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 @@ ie.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 @@ ie.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 (mi(u[
|
|
7668
|
+
for (let p = 0; p < u.length; p++)
|
|
7669
|
+
if (mi(u[p].components, i))
|
|
7670
7670
|
return;
|
|
7671
7671
|
u.push(l);
|
|
7672
7672
|
} else
|
|
@@ -7841,7 +7841,7 @@ var Ti = ie, 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 Ti = ie, 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 Ti = ie, 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 Ti = ie, 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
|
}, Ci = class {
|
|
@@ -8128,10 +8128,10 @@ function Ai(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: Mi }, Pi = 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: Mi }, Pi = 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 = Si(l),
|
|
8430
|
-
|
|
8431
|
-
const
|
|
8432
|
-
t.splice(o,
|
|
8429
|
+
const l = e.components[i], c = this.font.glyphs.get(l.glyphIndex), u = Si(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: Mi }, Pi = 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: Mi }, Pi = class {
|
|
|
8492
8492
|
let O = d[y];
|
|
8493
8493
|
if (O < t.length) {
|
|
8494
8494
|
let C = h[O];
|
|
8495
|
-
s === "gvar" ? (g[O] = !0, C.x +=
|
|
8495
|
+
s === "gvar" ? (g[O] = !0, C.x += p.deltas[y] * f, C.y += p.deltasY[y] * f) : s === "cvar" && (c[O] = Math.round(C + p.deltas[y] * f));
|
|
8496
8496
|
}
|
|
8497
8497
|
}
|
|
8498
8498
|
if (s === "gvar") {
|
|
@@ -8593,8 +8593,8 @@ var Er = { getPath: In, parse: Mi }, Pi = 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(Le);
|
|
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 * Le.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 ? Le : new
|
|
8936
|
+
return e /= n, t /= n, e === 1 && t === 0 ? Oe : e === 0 && t === 1 ? Le : new ft(e, t);
|
|
8937
8937
|
}
|
|
8938
8938
|
function Ae(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 Me("glyf",
|
|
9020
|
-
const
|
|
9018
|
+
const u = r[c], p = l.glyphs.get(u.glyphIndex);
|
|
9019
|
+
i = new Me("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 O = 0; O < h.length; O++) {
|
|
9022
9022
|
const C = h[O];
|
|
9023
|
-
C.xTouched = C.yTouched = !1, C.xo = C.x = C.x +
|
|
9023
|
+
C.xTouched = C.yTouched = !1, C.xo = C.x = C.x + f, C.yo = C.y = C.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 Ae(
|
|
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 Ae(0, 0),
|
|
9052
9052
|
new Ae(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 ji(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 Wi(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 qi(e) {
|
|
9126
9126
|
const t = e.stack, n = e.pv;
|
|
@@ -9134,7 +9134,7 @@ function Xi(e) {
|
|
|
9134
9134
|
e.fv = e.pv;
|
|
9135
9135
|
}
|
|
9136
9136
|
function Yi(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, O = u.y, C = p.x, E = p.y, L = f.x, U = f.y, F = (h - y) * (E - U) - (g - O) * (C - L), M = h * O - g * y, H = C * U - E * L;
|
|
9138
9138
|
d.x = (M * (C - L) - H * (h - y)) / F, d.y = (M * (E - U) - H * (g - O)) / F;
|
|
9139
9139
|
}
|
|
9140
9140
|
function Zi(e) {
|
|
@@ -9229,10 +9229,10 @@ function cl(e) {
|
|
|
9229
9229
|
function Qt(e) {
|
|
9230
9230
|
e.stack.pop();
|
|
9231
9231
|
}
|
|
9232
|
-
function
|
|
9232
|
+
function fl(e) {
|
|
9233
9233
|
e.stack.length = 0;
|
|
9234
9234
|
}
|
|
9235
|
-
function
|
|
9235
|
+
function pl(e) {
|
|
9236
9236
|
const t = e.stack, n = t.pop(), s = t.pop();
|
|
9237
9237
|
t.push(n), t.push(s);
|
|
9238
9238
|
}
|
|
@@ -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 bl(e) {
|
|
9325
9325
|
const t = e.stack;
|
|
@@ -9336,8 +9336,8 @@ function xl(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 zl(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 tu(e) {
|
|
@@ -9617,7 +9617,7 @@ function ou(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 iu(e) {
|
|
9623
9623
|
const t = e.stack, n = t.pop();
|
|
@@ -9636,10 +9636,10 @@ function cu(e) {
|
|
|
9636
9636
|
const t = e.stack, n = t.pop(), s = t.pop();
|
|
9637
9637
|
t.push(Math.min(s, n));
|
|
9638
9638
|
}
|
|
9639
|
-
function
|
|
9639
|
+
function fu(e) {
|
|
9640
9640
|
e.stack.pop();
|
|
9641
9641
|
}
|
|
9642
|
-
function
|
|
9642
|
+
function pu(e) {
|
|
9643
9643
|
const t = e.stack.pop();
|
|
9644
9644
|
let n = e.stack.pop();
|
|
9645
9645
|
switch (t) {
|
|
@@ -9669,9 +9669,9 @@ function De(e, t) {
|
|
|
9669
9669
|
t.ip = n;
|
|
9670
9670
|
}
|
|
9671
9671
|
function w(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, O;
|
|
9674
|
-
g = h.distance(
|
|
9674
|
+
g = h.distance(p, u, !0, !0), y = g >= 0 ? 1 : -1, g = Math.abs(g), e && (O = a.cvt[i], s && Math.abs(g - O) < a.cvCutIn && (g = O)), 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 */
|
|
@@ -9745,9 +9745,9 @@ Rr = [
|
|
|
9745
9745
|
/* 0x21 */
|
|
9746
9746
|
Qt,
|
|
9747
9747
|
/* 0x22 */
|
|
9748
|
-
pl,
|
|
9749
|
-
/* 0x23 */
|
|
9750
9748
|
fl,
|
|
9749
|
+
/* 0x23 */
|
|
9750
|
+
pl,
|
|
9751
9751
|
/* 0x24 */
|
|
9752
9752
|
hl,
|
|
9753
9753
|
/* 0x25 */
|
|
@@ -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
|
bl,
|
|
9796
9796
|
/* 0x39 */
|
|
@@ -9978,9 +9978,9 @@ Rr = [
|
|
|
9978
9978
|
/* 0x8C */
|
|
9979
9979
|
cu,
|
|
9980
9980
|
/* 0x8D */
|
|
9981
|
-
pu,
|
|
9982
|
-
/* 0x8E */
|
|
9983
9981
|
fu,
|
|
9982
|
+
/* 0x8E */
|
|
9983
|
+
pu,
|
|
9984
9984
|
/* 0x8F */
|
|
9985
9985
|
void 0,
|
|
9986
9986
|
/* 0x90 */
|
|
@@ -10266,7 +10266,7 @@ function gu(e) {
|
|
|
10266
10266
|
);
|
|
10267
10267
|
}
|
|
10268
10268
|
}
|
|
10269
|
-
function
|
|
10269
|
+
function z(e) {
|
|
10270
10270
|
this.tokens = [], this.registeredContexts = {}, this.contextCheckers = [], this.events = {}, this.registeredModifiers = [], gu.call(this, e);
|
|
10271
10271
|
}
|
|
10272
10272
|
nt.prototype.setState = function(e, t) {
|
|
@@ -10275,10 +10275,10 @@ nt.prototype.setState = function(e, t) {
|
|
|
10275
10275
|
nt.prototype.getState = function(e) {
|
|
10276
10276
|
return this.state[e] || null;
|
|
10277
10277
|
};
|
|
10278
|
-
|
|
10278
|
+
z.prototype.inboundIndex = function(e) {
|
|
10279
10279
|
return e >= 0 && e < this.tokens.length;
|
|
10280
10280
|
};
|
|
10281
|
-
|
|
10281
|
+
z.prototype.composeRUD = function(e) {
|
|
10282
10282
|
const n = e.map((r) => this[r[0]].apply(this, r.slice(1).concat(!0))), s = (r) => typeof r == "object" && Object.prototype.hasOwnProperty.call(r, "FAIL");
|
|
10283
10283
|
if (n.every(s))
|
|
10284
10284
|
return {
|
|
@@ -10287,7 +10287,7 @@ V.prototype.composeRUD = function(e) {
|
|
|
10287
10287
|
};
|
|
10288
10288
|
this.dispatch("composeRUD", [n.filter((r) => !s(r))]);
|
|
10289
10289
|
};
|
|
10290
|
-
|
|
10290
|
+
z.prototype.replaceRange = function(e, t, n, s) {
|
|
10291
10291
|
t = t !== null ? t : this.tokens.length;
|
|
10292
10292
|
const r = n.every((a) => a instanceof nt);
|
|
10293
10293
|
if (!isNaN(e) && this.inboundIndex(e) && r) {
|
|
@@ -10299,26 +10299,26 @@ V.prototype.replaceRange = function(e, t, n, s) {
|
|
|
10299
10299
|
} else
|
|
10300
10300
|
return { FAIL: "replaceRange: invalid tokens or startIndex." };
|
|
10301
10301
|
};
|
|
10302
|
-
|
|
10302
|
+
z.prototype.replaceToken = function(e, t, n) {
|
|
10303
10303
|
if (!isNaN(e) && this.inboundIndex(e) && t instanceof nt) {
|
|
10304
10304
|
const s = this.tokens.splice(e, 1, t);
|
|
10305
10305
|
return n || this.dispatch("replaceToken", [e, t]), [s[0], t];
|
|
10306
10306
|
} else
|
|
10307
10307
|
return { FAIL: "replaceToken: invalid token or index." };
|
|
10308
10308
|
};
|
|
10309
|
-
|
|
10309
|
+
z.prototype.removeRange = function(e, t, n) {
|
|
10310
10310
|
t = isNaN(t) ? this.tokens.length : t;
|
|
10311
10311
|
const s = this.tokens.splice(e, t);
|
|
10312
10312
|
return n || this.dispatch("removeRange", [s, e, t]), s;
|
|
10313
10313
|
};
|
|
10314
|
-
|
|
10314
|
+
z.prototype.removeToken = function(e, t) {
|
|
10315
10315
|
if (!isNaN(e) && this.inboundIndex(e)) {
|
|
10316
10316
|
const n = this.tokens.splice(e, 1);
|
|
10317
10317
|
return t || this.dispatch("removeToken", [n, e]), n;
|
|
10318
10318
|
} else
|
|
10319
10319
|
return { FAIL: "removeToken: invalid token index." };
|
|
10320
10320
|
};
|
|
10321
|
-
|
|
10321
|
+
z.prototype.insertToken = function(e, t, n) {
|
|
10322
10322
|
return e.every(
|
|
10323
10323
|
(r) => r instanceof nt
|
|
10324
10324
|
) ? (this.tokens.splice.apply(
|
|
@@ -10326,7 +10326,7 @@ V.prototype.insertToken = function(e, t, n) {
|
|
|
10326
10326
|
[t, 0].concat(e)
|
|
10327
10327
|
), n || this.dispatch("insertToken", [e, t]), e) : { FAIL: "insertToken: invalid token(s)." };
|
|
10328
10328
|
};
|
|
10329
|
-
|
|
10329
|
+
z.prototype.registerModifier = function(e, t, n) {
|
|
10330
10330
|
this.events.newToken.subscribe(function(s, r) {
|
|
10331
10331
|
const a = [s, r], o = t === null || t.apply(this, a) === !0, i = [s, r];
|
|
10332
10332
|
if (o) {
|
|
@@ -10356,28 +10356,28 @@ re.prototype.get = function(e) {
|
|
|
10356
10356
|
return null;
|
|
10357
10357
|
}
|
|
10358
10358
|
};
|
|
10359
|
-
|
|
10359
|
+
z.prototype.rangeToText = function(e) {
|
|
10360
10360
|
if (e instanceof Ln)
|
|
10361
10361
|
return this.getRangeTokens(e).map((t) => t.char).join("");
|
|
10362
10362
|
};
|
|
10363
|
-
|
|
10363
|
+
z.prototype.getText = function() {
|
|
10364
10364
|
return this.tokens.map((e) => e.char).join("");
|
|
10365
10365
|
};
|
|
10366
|
-
|
|
10366
|
+
z.prototype.getContext = function(e) {
|
|
10367
10367
|
let t = this.registeredContexts[e];
|
|
10368
10368
|
return t || null;
|
|
10369
10369
|
};
|
|
10370
|
-
|
|
10370
|
+
z.prototype.on = function(e, t) {
|
|
10371
10371
|
const n = this.events[e];
|
|
10372
10372
|
return n ? n.subscribe(t) : null;
|
|
10373
10373
|
};
|
|
10374
|
-
|
|
10374
|
+
z.prototype.dispatch = function(e, t) {
|
|
10375
10375
|
const n = this.events[e];
|
|
10376
10376
|
if (n instanceof Vt)
|
|
10377
10377
|
for (let s = 0; s < n.subscribers.length; s++)
|
|
10378
10378
|
n.subscribers[s].apply(this, t || []);
|
|
10379
10379
|
};
|
|
10380
|
-
|
|
10380
|
+
z.prototype.registerContextChecker = function(e, t, n) {
|
|
10381
10381
|
if (this.getContext(e)) return {
|
|
10382
10382
|
FAIL: `context name '${e}' is already registered.`
|
|
10383
10383
|
};
|
|
@@ -10394,17 +10394,17 @@ V.prototype.registerContextChecker = function(e, t, n) {
|
|
|
10394
10394
|
);
|
|
10395
10395
|
return this.registeredContexts[e] = s, this.contextCheckers.push(s), s;
|
|
10396
10396
|
};
|
|
10397
|
-
|
|
10397
|
+
z.prototype.getRangeTokens = function(e) {
|
|
10398
10398
|
const t = e.startIndex + e.endOffset;
|
|
10399
10399
|
return [].concat(
|
|
10400
10400
|
this.tokens.slice(e.startIndex, t)
|
|
10401
10401
|
);
|
|
10402
10402
|
};
|
|
10403
|
-
|
|
10403
|
+
z.prototype.getContextRanges = function(e) {
|
|
10404
10404
|
const t = this.getContext(e);
|
|
10405
10405
|
return t ? t.ranges : { FAIL: `context checker '${e}' is not registered.` };
|
|
10406
10406
|
};
|
|
10407
|
-
|
|
10407
|
+
z.prototype.resetContextsRanges = function() {
|
|
10408
10408
|
const e = this.registeredContexts;
|
|
10409
10409
|
for (const t in e)
|
|
10410
10410
|
if (Object.prototype.hasOwnProperty.call(e, t)) {
|
|
@@ -10412,7 +10412,7 @@ V.prototype.resetContextsRanges = function() {
|
|
|
10412
10412
|
n.ranges = [];
|
|
10413
10413
|
}
|
|
10414
10414
|
};
|
|
10415
|
-
|
|
10415
|
+
z.prototype.updateContextsRanges = function() {
|
|
10416
10416
|
this.resetContextsRanges();
|
|
10417
10417
|
const e = this.tokens.map((t) => t.char);
|
|
10418
10418
|
for (let t = 0; t < e.length; t++) {
|
|
@@ -10421,13 +10421,13 @@ V.prototype.updateContextsRanges = function() {
|
|
|
10421
10421
|
}
|
|
10422
10422
|
this.dispatch("updateContextsRanges", [this.registeredContexts]);
|
|
10423
10423
|
};
|
|
10424
|
-
|
|
10424
|
+
z.prototype.setEndOffset = function(e, t) {
|
|
10425
10425
|
const n = this.getContext(t).openRange.startIndex;
|
|
10426
10426
|
let s = new Ln(n, e, t);
|
|
10427
10427
|
const r = this.getContext(t).ranges;
|
|
10428
10428
|
return s.rangeId = `${t}.${r.length}`, r.push(s), this.getContext(t).openRange = null, s;
|
|
10429
10429
|
};
|
|
10430
|
-
|
|
10430
|
+
z.prototype.runContextCheck = function(e) {
|
|
10431
10431
|
const t = e.index;
|
|
10432
10432
|
for (let n = 0; n < this.contextCheckers.length; n++) {
|
|
10433
10433
|
const s = this.contextCheckers[n];
|
|
@@ -10438,7 +10438,7 @@ V.prototype.runContextCheck = function(e) {
|
|
|
10438
10438
|
}
|
|
10439
10439
|
}
|
|
10440
10440
|
};
|
|
10441
|
-
|
|
10441
|
+
z.prototype.tokenize = function(e) {
|
|
10442
10442
|
this.tokens = [], this.resetContextsRanges();
|
|
10443
10443
|
let t = Array.from(e);
|
|
10444
10444
|
this.dispatch("start");
|
|
@@ -10450,7 +10450,7 @@ V.prototype.tokenize = function(e) {
|
|
|
10450
10450
|
}
|
|
10451
10451
|
return this.dispatch("end", [this.tokens]), this.tokens;
|
|
10452
10452
|
};
|
|
10453
|
-
var mu =
|
|
10453
|
+
var mu = z;
|
|
10454
10454
|
function Pe(e) {
|
|
10455
10455
|
return /[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e);
|
|
10456
10456
|
}
|
|
@@ -10540,24 +10540,24 @@ function xu(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 O = 0; O < y.subtables.length; O++) {
|
|
10549
10549
|
let C = y.subtables[O], E, L = this.getSubstitutionType(y, C);
|
|
10550
10550
|
if (L === "71" ? (L = this.getSubstitutionType(C, C.extension), E = this.getLookupMethod(C, C.extension), C = C.extension) : E = this.getLookupMethod(y, C), L === "12") {
|
|
10551
10551
|
const U = e.get(h.sequenceIndex), F = E(U);
|
|
10552
|
-
F &&
|
|
10552
|
+
F && f.push(F);
|
|
10553
10553
|
} else if (L === "21") {
|
|
10554
10554
|
const U = e.get(h.sequenceIndex), F = E(U);
|
|
10555
|
-
F &&
|
|
10555
|
+
F && f.push(F);
|
|
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 Su(e, t) {
|
|
10563
10563
|
let n = e.current, s = Ne(n, t.coverage);
|
|
@@ -10591,9 +10591,9 @@ function Tu(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
|
-
Ne(c[
|
|
10596
|
+
Ne(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 ku(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 @@ le.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 Fe({
|
|
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 Fe({
|
|
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 Fe({
|
|
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 Fe({
|
|
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 Fe({
|
|
10774
10774
|
id: 21,
|
|
10775
10775
|
tag: e.tag,
|
|
10776
10776
|
substitution: d
|
|
@@ -10778,8 +10778,8 @@ le.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 Fe({
|
|
10782
|
+
id: parseInt(p),
|
|
10783
10783
|
tag: e.tag,
|
|
10784
10784
|
substitution: d
|
|
10785
10785
|
}));
|
|
@@ -10960,9 +10960,9 @@ function Nu(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 Fe && (We(f, s, p), r.context[p] = f.substitution);
|
|
10966
10966
|
}
|
|
10967
10967
|
}
|
|
10968
10968
|
}
|
|
@@ -11198,7 +11198,7 @@ function cc(e) {
|
|
|
11198
11198
|
}
|
|
11199
11199
|
}
|
|
11200
11200
|
}
|
|
11201
|
-
var
|
|
11201
|
+
var fc = cc;
|
|
11202
11202
|
function he(e) {
|
|
11203
11203
|
this.baseDir = e || "ltr", this.tokenizer = new mu(), this.featuresTags = {};
|
|
11204
11204
|
}
|
|
@@ -11221,7 +11221,7 @@ function Ye(e) {
|
|
|
11221
11221
|
t.endCheck
|
|
11222
11222
|
);
|
|
11223
11223
|
}
|
|
11224
|
-
function
|
|
11224
|
+
function pc() {
|
|
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
11227
|
function hc() {
|
|
@@ -11300,7 +11300,7 @@ function vc() {
|
|
|
11300
11300
|
const e = this.tokenizer.getContextRanges("unicodeVariationSequence");
|
|
11301
11301
|
for (let t = 0; t < e.length; t++) {
|
|
11302
11302
|
const n = e[t];
|
|
11303
|
-
|
|
11303
|
+
fc.call(this, n);
|
|
11304
11304
|
}
|
|
11305
11305
|
}
|
|
11306
11306
|
function bc() {
|
|
@@ -11321,7 +11321,7 @@ 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), pc.call(this), this.applyFeaturesToContexts());
|
|
11325
11325
|
};
|
|
11326
11326
|
he.prototype.getBidiText = function(e) {
|
|
11327
11327
|
return this.processText(e), this.tokenizer.getText();
|
|
@@ -11466,8 +11466,8 @@ _.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 @@ _.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 zc(e, t = {}) {
|
|
|
11901
11901
|
throw new Error("WOFF2 require an external decompressor library, see examples at: " + k);
|
|
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, O, C, E, L, U, F, M, H, ue, I;
|
|
11905
11905
|
for (let k = 0; k < o; k += 1) {
|
|
11906
11906
|
const T = i[k];
|
|
11907
11907
|
let S;
|
|
@@ -11916,10 +11916,10 @@ function zc(e, t = {}) {
|
|
|
11916
11916
|
S = B(a, T), I = new x.Parser(S.data, S.offset), r.tables.cvt = I.parseShortList(T.length / 2);
|
|
11917
11917
|
break;
|
|
11918
11918
|
case "fvar":
|
|
11919
|
-
|
|
11919
|
+
p = T;
|
|
11920
11920
|
break;
|
|
11921
11921
|
case "STAT":
|
|
11922
|
-
|
|
11922
|
+
f = T;
|
|
11923
11923
|
break;
|
|
11924
11924
|
case "gvar":
|
|
11925
11925
|
d = T;
|
|
@@ -11996,8 +11996,8 @@ function zc(e, t = {}) {
|
|
|
11996
11996
|
case "gasp":
|
|
11997
11997
|
try {
|
|
11998
11998
|
S = B(a, T), r.tables.gasp = br.parse(S.data, S.offset);
|
|
11999
|
-
} catch (
|
|
12000
|
-
console.warn("Failed to parse gasp table, skipping."), console.warn(
|
|
11999
|
+
} catch (V) {
|
|
12000
|
+
console.warn("Failed to parse gasp table, skipping."), console.warn(V);
|
|
12001
12001
|
}
|
|
12002
12002
|
break;
|
|
12003
12003
|
case "SVG ":
|
|
@@ -12007,14 +12007,14 @@ function zc(e, t = {}) {
|
|
|
12007
12007
|
}
|
|
12008
12008
|
const D = B(a, H);
|
|
12009
12009
|
if (r.tables.name = Ws.parse(D.data, D.offset, s), r.names = r.tables.name, y && M) {
|
|
12010
|
-
const k = n === 0, T = B(a, M), S = Hc.parse(T.data, T.offset, r.numGlyphs, k),
|
|
12011
|
-
r.glyphs = Er.parse(
|
|
12010
|
+
const k = n === 0, T = B(a, M), S = Hc.parse(T.data, T.offset, r.numGlyphs, k), V = B(a, y);
|
|
12011
|
+
r.glyphs = Er.parse(V.data, V.offset, S, r, t);
|
|
12012
12012
|
} else if (c) {
|
|
12013
12013
|
const k = B(a, c);
|
|
12014
|
-
|
|
12014
|
+
pn.parse(k.data, k.offset, r, t);
|
|
12015
12015
|
} else if (u) {
|
|
12016
12016
|
const k = B(a, u);
|
|
12017
|
-
|
|
12017
|
+
pn.parse(k.data, k.offset, r, t);
|
|
12018
12018
|
} else
|
|
12019
12019
|
throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");
|
|
12020
12020
|
const N = B(a, L);
|
|
@@ -12033,39 +12033,39 @@ function zc(e, t = {}) {
|
|
|
12033
12033
|
}
|
|
12034
12034
|
if (E) {
|
|
12035
12035
|
const k = B(a, E);
|
|
12036
|
-
r.tables.gsub =
|
|
12037
|
-
}
|
|
12038
|
-
if (f) {
|
|
12039
|
-
const k = B(a, f);
|
|
12040
|
-
r.tables.fvar = dr.parse(k.data, k.offset, r.names);
|
|
12036
|
+
r.tables.gsub = fr.parse(k.data, k.offset);
|
|
12041
12037
|
}
|
|
12042
12038
|
if (p) {
|
|
12043
12039
|
const k = B(a, p);
|
|
12040
|
+
r.tables.fvar = dr.parse(k.data, k.offset, r.names);
|
|
12041
|
+
}
|
|
12042
|
+
if (f) {
|
|
12043
|
+
const k = B(a, f);
|
|
12044
12044
|
r.tables.stat = gr.parse(k.data, k.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 k = B(a, d);
|
|
12049
12049
|
r.tables.gvar = vr.parse(k.data, k.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 k = B(a, h);
|
|
12054
12054
|
r.tables.cvar = yr.parse(k.data, k.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 k = B(a, g);
|
|
12059
12059
|
r.tables.avar = mr.parse(k.data, k.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 k = B(a, U);
|
|
12064
12064
|
r.tables.hvar = Cc.parse(k.data, k.offset, r.tables.fvar);
|
|
12065
12065
|
}
|
|
12066
12066
|
if (ue) {
|
|
12067
12067
|
const k = B(a, ue);
|
|
12068
|
-
r.tables.meta =
|
|
12068
|
+
r.tables.meta = pr.parse(k.data, k.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 = (E) => {
|
|
12088
12088
|
if (!E) return [""];
|
|
12089
12089
|
const L = [];
|
|
12090
12090
|
let U = "";
|
|
@@ -12098,12 +12098,12 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12098
12098
|
`).forEach((E) => {
|
|
12099
12099
|
h(E).forEach((L) => g.push(L));
|
|
12100
12100
|
});
|
|
12101
|
-
const y = c, O =
|
|
12101
|
+
const y = c, O = p * g.length + 4;
|
|
12102
12102
|
l.width = Math.max(1, Math.floor(y * u)), l.height = Math.max(1, Math.floor(O * u)), l.style.width = `${y}px`, l.style.height = `${O}px`;
|
|
12103
12103
|
const C = l.getContext("2d");
|
|
12104
12104
|
C && (C.setTransform(u, 0, 0, u, 0, 0), C.clearRect(0, 0, y, O), g.forEach((E, L) => {
|
|
12105
|
-
const U = d.getPath(E, 0, t.fontSize + L *
|
|
12106
|
-
U.fill =
|
|
12105
|
+
const U = d.getPath(E, 0, t.fontSize + L * p, t.fontSize);
|
|
12106
|
+
U.fill = f, U.draw(C);
|
|
12107
12107
|
}));
|
|
12108
12108
|
}, o = () => {
|
|
12109
12109
|
if (r && (r.disconnect(), r = null), t.renderMode !== "canvas" || typeof ResizeObserver > "u") return;
|
|
@@ -12148,13 +12148,13 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12148
12148
|
}, qc = { class: "vfp-renderer-loading-content" }, $c = { class: "vfp-renderer-loading-text" }, Xc = { 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" }, Yc = { class: "vfp-grid vfp-grid-cols-2 vfp-gap-x-6 vfp-gap-y-2 vfp-text-sm vfp-min-w-0" }, Zc = { class: "vfp-flex vfp-items-center vfp-gap-2 vfp-min-w-0" }, Kc = { class: "vfp-text-fg-tertiary vfp-flex-shrink-0" }, Qc = { class: "vfp-text-fg-primary vfp-font-semibold vfp-truncate" }, Jc = {
|
|
12149
12149
|
key: 0,
|
|
12150
12150
|
class: "vfp-flex vfp-items-center vfp-gap-2 vfp-min-w-0"
|
|
12151
|
-
},
|
|
12151
|
+
}, ef = { class: "vfp-text-fg-tertiary vfp-flex-shrink-0" }, tf = { class: "vfp-text-fg-primary vfp-truncate" }, nf = { class: "vfp-flex vfp-items-center vfp-gap-2 vfp-min-w-0" }, sf = { class: "vfp-text-fg-tertiary vfp-flex-shrink-0" }, rf = { class: "vfp-text-fg-primary vfp-truncate" }, af = { class: "vfp-flex vfp-items-center vfp-gap-2 vfp-min-w-0" }, of = { class: "vfp-text-fg-tertiary vfp-flex-shrink-0" }, lf = { class: "vfp-text-fg-primary vfp-truncate" }, uf = {
|
|
12152
12152
|
key: 1,
|
|
12153
12153
|
class: "vfp-flex vfp-items-center vfp-gap-2 vfp-min-w-0"
|
|
12154
|
-
},
|
|
12154
|
+
}, cf = { class: "vfp-text-fg-tertiary vfp-flex-shrink-0" }, ff = { class: "vfp-text-fg-primary vfp-truncate" }, pf = {
|
|
12155
12155
|
key: 2,
|
|
12156
12156
|
class: "vfp-flex vfp-items-center vfp-gap-2 vfp-min-w-0"
|
|
12157
|
-
},
|
|
12157
|
+
}, hf = { class: "vfp-text-fg-tertiary vfp-flex-shrink-0" }, df = { class: "vfp-text-fg-primary vfp-truncate" }, gf = { class: "vfp-flex-1 vfp-overflow-auto vfp-min-w-0" }, mf = { class: "vfp-px-6 vfp-py-6 vfp-space-y-8 vfp-min-w-0" }, yf = { class: "vfp-min-w-0" }, vf = { class: "vfp-block vfp-text-xs vfp-text-fg-tertiary vfp-mb-2" }, bf = ["placeholder"], xf = { class: "vfp-space-y-6 vfp-min-w-0" }, Sf = { class: "vfp-text-xs vfp-text-fg-tertiary" }, Tf = { class: "vfp-space-y-6 vfp-pt-6 vfp-border-t vfp-border-line-weak vfp-min-w-0" }, kf = { class: "vfp-min-w-0" }, Cf = { class: "vfp-text-sm vfp-text-fg-tertiary vfp-mb-3" }, Of = { class: "vfp-min-w-0" }, wf = { class: "vfp-text-sm vfp-text-fg-tertiary vfp-mb-3" }, Ef = 2001684018, Rf = 2001684038, If = 1330926671, Lf = 65536, Af = 1953658213, Mf = /* @__PURE__ */ ws({
|
|
12158
12158
|
__name: "index",
|
|
12159
12159
|
props: {
|
|
12160
12160
|
url: {}
|
|
@@ -12163,11 +12163,11 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12163
12163
|
const n = (I) => {
|
|
12164
12164
|
if (I.byteLength < 4) return "unknown";
|
|
12165
12165
|
const D = new DataView(I).getUint32(0);
|
|
12166
|
-
return D ===
|
|
12167
|
-
}, s = [72, 48, 36, 24, 18], r = e, { t: a } = Vr(), o = zr(), i = jr(), l = Wr(), c = Ie(null), u = Ie(null),
|
|
12166
|
+
return D === Ef ? "woff2" : D === Rf ? "woff" : D === If ? "otf" : D === Lf || D === Af ? "ttf" : "unknown";
|
|
12167
|
+
}, s = [72, 48, 36, 24, 18], r = e, { t: a } = Vr(), o = zr(), i = jr(), l = Wr(), c = Ie(null), u = Ie(null), p = Ie("loading"), f = Ie(!0), d = Ie(null), h = Ie(""), g = Ie("fontface");
|
|
12168
12168
|
let y = null;
|
|
12169
|
-
const O = mt(() => h.value || a.value("font.sample_pangram")), C = mt(() =>
|
|
12170
|
-
() =>
|
|
12169
|
+
const O = mt(() => h.value || a.value("font.sample_pangram")), C = mt(() => p.value !== "ready"), E = mt(
|
|
12170
|
+
() => p.value === "loading" ? a.value("font.metadata_loading") : a.value("font.metadata_unavailable")
|
|
12171
12171
|
), L = mt(() => g.value === "canvas" && c.value ? "canvas" : "fontface"), U = (I) => {
|
|
12172
12172
|
var k;
|
|
12173
12173
|
const D = ((k = I.split(".").pop()) == null ? void 0 : k.toLowerCase().split("?")[0]) || "";
|
|
@@ -12202,7 +12202,7 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12202
12202
|
}
|
|
12203
12203
|
const te = k[q];
|
|
12204
12204
|
return (te == null ? void 0 : te.en) || (te == null ? void 0 : te["zh-Hans"]) || "";
|
|
12205
|
-
},
|
|
12205
|
+
}, V = {
|
|
12206
12206
|
family: S("fontFamily") || S("postScriptName") || "Unknown",
|
|
12207
12207
|
subfamily: S("fontSubfamily"),
|
|
12208
12208
|
version: S("version"),
|
|
@@ -12210,23 +12210,23 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12210
12210
|
glyphCount: N.numGlyphs || 0,
|
|
12211
12211
|
format: F(D, r.url)
|
|
12212
12212
|
};
|
|
12213
|
-
c.value = N, u.value =
|
|
12213
|
+
c.value = N, u.value = V, p.value = "ready";
|
|
12214
12214
|
};
|
|
12215
12215
|
return Es(async () => {
|
|
12216
12216
|
if (i.begin(r.url), !!r.url)
|
|
12217
12217
|
try {
|
|
12218
|
-
|
|
12218
|
+
f.value = !0, d.value = null, p.value = "loading";
|
|
12219
12219
|
const I = await o.value(r.url);
|
|
12220
12220
|
if (!I.ok)
|
|
12221
12221
|
throw new $t("font.load_failed");
|
|
12222
|
-
const D = await I.arrayBuffer(), N = D.slice(0), k = n(D), T = M(N), S = H(D, k), [
|
|
12223
|
-
if (
|
|
12224
|
-
if (
|
|
12222
|
+
const D = await I.arrayBuffer(), N = D.slice(0), k = n(D), T = M(N), S = H(D, k), [V, q] = await Promise.allSettled([T, S]);
|
|
12223
|
+
if (V.status === "fulfilled" && i.ready(), f.value = !1, q.status === "rejected") {
|
|
12224
|
+
if (V.status === "rejected") throw V.reason;
|
|
12225
12225
|
const te = q.reason;
|
|
12226
12226
|
k !== "woff2" && console.warn(
|
|
12227
12227
|
"[FontRenderer] Metadata parse failed, font is still rendered via FontFace:",
|
|
12228
12228
|
te instanceof Error ? te.message : String(te)
|
|
12229
|
-
),
|
|
12229
|
+
), p.value = "unavailable", u.value = {
|
|
12230
12230
|
family: "Unknown",
|
|
12231
12231
|
subfamily: "",
|
|
12232
12232
|
version: "",
|
|
@@ -12239,14 +12239,14 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12239
12239
|
console.warn(
|
|
12240
12240
|
"[FontRenderer] Failed to load font:",
|
|
12241
12241
|
I instanceof Error ? I.message : String(I)
|
|
12242
|
-
), d.value = a.value("font.load_failed"),
|
|
12242
|
+
), d.value = a.value("font.load_failed"), f.value = !1, p.value = "unavailable", i.error(I);
|
|
12243
12243
|
}
|
|
12244
12244
|
}), Rs(() => {
|
|
12245
12245
|
y && (document.fonts.delete(y), y = null);
|
|
12246
12246
|
}), t({
|
|
12247
12247
|
getToolbarGroups: () => []
|
|
12248
12248
|
}), (I, D) => (ge(), ke("div", jc, [
|
|
12249
|
-
|
|
12249
|
+
f.value ? (ge(), ke("div", Wc, [
|
|
12250
12250
|
P("div", qc, [
|
|
12251
12251
|
D[1] || (D[1] = P("div", { class: "vfp-renderer-spinner" }, null, -1)),
|
|
12252
12252
|
P("span", $c, Z(K(a)("font.loading")), 1)
|
|
@@ -12262,47 +12262,47 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12262
12262
|
P("span", Qc, Z(C.value ? E.value : u.value.family), 1)
|
|
12263
12263
|
]),
|
|
12264
12264
|
u.value.subfamily ? (ge(), ke("div", Jc, [
|
|
12265
|
-
P("span",
|
|
12266
|
-
P("span",
|
|
12265
|
+
P("span", ef, Z(K(a)("font.meta.subfamily")) + ":", 1),
|
|
12266
|
+
P("span", tf, Z(u.value.subfamily), 1)
|
|
12267
12267
|
])) : Wt("", !0),
|
|
12268
|
-
P("div",
|
|
12269
|
-
P("span",
|
|
12270
|
-
P("span",
|
|
12268
|
+
P("div", nf, [
|
|
12269
|
+
P("span", sf, Z(K(a)("font.meta.format")) + ":", 1),
|
|
12270
|
+
P("span", rf, Z(u.value.format), 1)
|
|
12271
12271
|
]),
|
|
12272
|
-
P("div",
|
|
12273
|
-
P("span",
|
|
12274
|
-
P("span",
|
|
12272
|
+
P("div", af, [
|
|
12273
|
+
P("span", of, Z(K(a)("font.meta.glyphs")) + ":", 1),
|
|
12274
|
+
P("span", lf, Z(C.value ? E.value : u.value.glyphCount), 1)
|
|
12275
12275
|
]),
|
|
12276
|
-
u.value.designer ? (ge(), ke("div",
|
|
12277
|
-
P("span",
|
|
12278
|
-
P("span",
|
|
12276
|
+
u.value.designer ? (ge(), ke("div", uf, [
|
|
12277
|
+
P("span", cf, Z(K(a)("font.meta.designer")) + ":", 1),
|
|
12278
|
+
P("span", ff, Z(u.value.designer), 1)
|
|
12279
12279
|
])) : Wt("", !0),
|
|
12280
|
-
u.value.version ? (ge(), ke("div",
|
|
12281
|
-
P("span",
|
|
12282
|
-
P("span",
|
|
12280
|
+
u.value.version ? (ge(), ke("div", pf, [
|
|
12281
|
+
P("span", hf, Z(K(a)("font.meta.version")) + ":", 1),
|
|
12282
|
+
P("span", df, Z(u.value.version), 1)
|
|
12283
12283
|
])) : Wt("", !0)
|
|
12284
12284
|
])
|
|
12285
12285
|
]),
|
|
12286
|
-
P("div",
|
|
12287
|
-
P("div",
|
|
12288
|
-
P("div",
|
|
12289
|
-
P("label",
|
|
12286
|
+
P("div", gf, [
|
|
12287
|
+
P("div", mf, [
|
|
12288
|
+
P("div", yf, [
|
|
12289
|
+
P("label", vf, Z(K(a)("font.sample_text_placeholder")), 1),
|
|
12290
12290
|
_r(P("textarea", {
|
|
12291
12291
|
"onUpdate:modelValue": D[0] || (D[0] = (N) => h.value = N),
|
|
12292
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",
|
|
12293
12293
|
rows: "2",
|
|
12294
12294
|
placeholder: K(a)("font.sample_text_placeholder"),
|
|
12295
12295
|
style: { minHeight: "64px", maxHeight: "160px" }
|
|
12296
|
-
}, null, 8,
|
|
12296
|
+
}, null, 8, bf), [
|
|
12297
12297
|
[Gr, h.value]
|
|
12298
12298
|
])
|
|
12299
12299
|
]),
|
|
12300
|
-
P("div",
|
|
12300
|
+
P("div", xf, [
|
|
12301
12301
|
(ge(), ke(Fn, null, Hr(s, (N) => P("div", {
|
|
12302
12302
|
key: N,
|
|
12303
12303
|
class: "vfp-space-y-2 vfp-min-w-0"
|
|
12304
12304
|
}, [
|
|
12305
|
-
P("div",
|
|
12305
|
+
P("div", Sf, Z(N) + "px", 1),
|
|
12306
12306
|
qt(rn, {
|
|
12307
12307
|
font: c.value,
|
|
12308
12308
|
text: O.value,
|
|
@@ -12312,9 +12312,9 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12312
12312
|
}, null, 8, ["font", "text", "font-size", "render-mode", "theme"])
|
|
12313
12313
|
])), 64))
|
|
12314
12314
|
]),
|
|
12315
|
-
P("div",
|
|
12316
|
-
P("div",
|
|
12317
|
-
P("div",
|
|
12315
|
+
P("div", Tf, [
|
|
12316
|
+
P("div", kf, [
|
|
12317
|
+
P("div", Cf, Z(K(a)("font.latin_samples")), 1),
|
|
12318
12318
|
qt(rn, {
|
|
12319
12319
|
font: c.value,
|
|
12320
12320
|
text: K(a)("font.sample_latin"),
|
|
@@ -12323,8 +12323,8 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12323
12323
|
theme: K(l)
|
|
12324
12324
|
}, null, 8, ["font", "text", "render-mode", "theme"])
|
|
12325
12325
|
]),
|
|
12326
|
-
P("div",
|
|
12327
|
-
P("div",
|
|
12326
|
+
P("div", Of, [
|
|
12327
|
+
P("div", wf, Z(K(a)("font.chinese_samples")), 1),
|
|
12328
12328
|
qt(rn, {
|
|
12329
12329
|
font: c.value,
|
|
12330
12330
|
text: K(a)("font.sample_chinese"),
|
|
@@ -12341,5 +12341,5 @@ const rn = /* @__PURE__ */ ws({
|
|
|
12341
12341
|
}
|
|
12342
12342
|
});
|
|
12343
12343
|
export {
|
|
12344
|
-
|
|
12344
|
+
Mf as default
|
|
12345
12345
|
};
|