@mlightcad/mtext-renderer 0.12.6 → 0.12.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +948 -826
- package/dist/index.umd.cjs +8 -8
- package/dist/mtext-renderer-worker.js +715 -634
- package/lib/font/fontManager.d.ts +37 -0
- package/lib/worker/unifiedRenderer.d.ts +8 -0
- package/lib/worker/webWorkerRenderer.d.ts +11 -0
- package/package.json +1 -1
|
@@ -1195,7 +1195,7 @@ class Wi {
|
|
|
1195
1195
|
* Copyright 2010-2024 Three.js Authors
|
|
1196
1196
|
* SPDX-License-Identifier: MIT
|
|
1197
1197
|
*/
|
|
1198
|
-
const ch = "172", Vr = 0, su = 1, za = 1, Ha = 100, Ga = 204, Va = 205, Wa = 3, iu = 0, hh = 300, qa = 1e3, Os = 1001, ja = 1002, ru = 1006, au = 1008, ou = 1009, cu = 1015, hu = 1023, lh = "", re = "srgb", Xa = "srgb-linear", Ya = "linear", qi = "srgb", bn = 7680, $a = 519, Za = 35044,
|
|
1198
|
+
const ch = "172", Vr = 0, su = 1, za = 1, Ha = 100, Ga = 204, Va = 205, Wa = 3, iu = 0, hh = 300, qa = 1e3, Os = 1001, ja = 1002, ru = 1006, au = 1008, ou = 1009, cu = 1015, hu = 1023, lh = "", re = "srgb", Xa = "srgb-linear", Ya = "linear", qi = "srgb", bn = 7680, $a = 519, Za = 35044, Ls = 2e3, Ja = 2001;
|
|
1199
1199
|
class Ii {
|
|
1200
1200
|
addEventListener(t, e) {
|
|
1201
1201
|
this._listeners === void 0 && (this._listeners = {});
|
|
@@ -1227,10 +1227,10 @@ class Ii {
|
|
|
1227
1227
|
}
|
|
1228
1228
|
}
|
|
1229
1229
|
}
|
|
1230
|
-
const
|
|
1230
|
+
const Lt = ["00", "01", "02", "03", "04", "05", "06", "07", "08", "09", "0a", "0b", "0c", "0d", "0e", "0f", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "1a", "1b", "1c", "1d", "1e", "1f", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "2a", "2b", "2c", "2d", "2e", "2f", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "3a", "3b", "3c", "3d", "3e", "3f", "40", "41", "42", "43", "44", "45", "46", "47", "48", "49", "4a", "4b", "4c", "4d", "4e", "4f", "50", "51", "52", "53", "54", "55", "56", "57", "58", "59", "5a", "5b", "5c", "5d", "5e", "5f", "60", "61", "62", "63", "64", "65", "66", "67", "68", "69", "6a", "6b", "6c", "6d", "6e", "6f", "70", "71", "72", "73", "74", "75", "76", "77", "78", "79", "7a", "7b", "7c", "7d", "7e", "7f", "80", "81", "82", "83", "84", "85", "86", "87", "88", "89", "8a", "8b", "8c", "8d", "8e", "8f", "90", "91", "92", "93", "94", "95", "96", "97", "98", "99", "9a", "9b", "9c", "9d", "9e", "9f", "a0", "a1", "a2", "a3", "a4", "a5", "a6", "a7", "a8", "a9", "aa", "ab", "ac", "ad", "ae", "af", "b0", "b1", "b2", "b3", "b4", "b5", "b6", "b7", "b8", "b9", "ba", "bb", "bc", "bd", "be", "bf", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "ca", "cb", "cc", "cd", "ce", "cf", "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8", "d9", "da", "db", "dc", "dd", "de", "df", "e0", "e1", "e2", "e3", "e4", "e5", "e6", "e7", "e8", "e9", "ea", "eb", "ec", "ed", "ee", "ef", "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", "f9", "fa", "fb", "fc", "fd", "fe", "ff"];
|
|
1231
1231
|
function Yn() {
|
|
1232
1232
|
const n = Math.random() * 4294967295 | 0, t = Math.random() * 4294967295 | 0, e = Math.random() * 4294967295 | 0, s = Math.random() * 4294967295 | 0;
|
|
1233
|
-
return (
|
|
1233
|
+
return (Lt[n & 255] + Lt[n >> 8 & 255] + Lt[n >> 16 & 255] + Lt[n >> 24 & 255] + "-" + Lt[t & 255] + Lt[t >> 8 & 255] + "-" + Lt[t >> 16 & 15 | 64] + Lt[t >> 24 & 255] + "-" + Lt[e & 63 | 128] + Lt[e >> 8 & 255] + "-" + Lt[e >> 16 & 255] + Lt[e >> 24 & 255] + Lt[s & 255] + Lt[s >> 8 & 255] + Lt[s >> 16 & 255] + Lt[s >> 24 & 255]).toLowerCase();
|
|
1234
1234
|
}
|
|
1235
1235
|
function Z(n, t, e) {
|
|
1236
1236
|
return Math.max(t, Math.min(e, n));
|
|
@@ -1261,7 +1261,7 @@ function Jn(n, t) {
|
|
|
1261
1261
|
throw new Error("Invalid component type.");
|
|
1262
1262
|
}
|
|
1263
1263
|
}
|
|
1264
|
-
function
|
|
1264
|
+
function Gt(n, t) {
|
|
1265
1265
|
switch (t.constructor) {
|
|
1266
1266
|
case Float32Array:
|
|
1267
1267
|
return n;
|
|
@@ -1712,7 +1712,7 @@ function fu() {
|
|
|
1712
1712
|
*/
|
|
1713
1713
|
spaces: {},
|
|
1714
1714
|
convert: function(i, r, a) {
|
|
1715
|
-
return this.enabled === !1 || r === a || !r || !a || (this.spaces[r].transfer === qi && (i.r = Be(i.r), i.g = Be(i.g), i.b = Be(i.b)), this.spaces[r].primaries !== this.spaces[a].primaries && (i.applyMatrix3(this.spaces[r].toXYZ), i.applyMatrix3(this.spaces[a].fromXYZ)), this.spaces[a].transfer === qi && (i.r =
|
|
1715
|
+
return this.enabled === !1 || r === a || !r || !a || (this.spaces[r].transfer === qi && (i.r = Be(i.r), i.g = Be(i.g), i.b = Be(i.b)), this.spaces[r].primaries !== this.spaces[a].primaries && (i.applyMatrix3(this.spaces[r].toXYZ), i.applyMatrix3(this.spaces[a].fromXYZ)), this.spaces[a].transfer === qi && (i.r = Rn(i.r), i.g = Rn(i.g), i.b = Rn(i.b))), i;
|
|
1716
1716
|
},
|
|
1717
1717
|
fromWorkingColorSpace: function(i, r) {
|
|
1718
1718
|
return this.convert(i, this.workingColorSpace, r);
|
|
@@ -1769,7 +1769,7 @@ const ee = /* @__PURE__ */ fu();
|
|
|
1769
1769
|
function Be(n) {
|
|
1770
1770
|
return n < 0.04045 ? n * 0.0773993808 : Math.pow(n * 0.9478672986 + 0.0521327014, 2.4);
|
|
1771
1771
|
}
|
|
1772
|
-
function
|
|
1772
|
+
function Rn(n) {
|
|
1773
1773
|
return n < 31308e-7 ? n * 12.92 : 1.055 * Math.pow(n, 0.41666) - 0.055;
|
|
1774
1774
|
}
|
|
1775
1775
|
let vn;
|
|
@@ -2626,7 +2626,7 @@ class E {
|
|
|
2626
2626
|
}
|
|
2627
2627
|
}
|
|
2628
2628
|
const $i = /* @__PURE__ */ new E(), eo = /* @__PURE__ */ new gn();
|
|
2629
|
-
class
|
|
2629
|
+
class At {
|
|
2630
2630
|
constructor(t = new E(1 / 0, 1 / 0, 1 / 0), e = new E(-1 / 0, -1 / 0, -1 / 0)) {
|
|
2631
2631
|
this.isBox3 = !0, this.min = t, this.max = e;
|
|
2632
2632
|
}
|
|
@@ -2694,7 +2694,7 @@ class Ft {
|
|
|
2694
2694
|
for (let a = 0, o = r.count; a < o; a++)
|
|
2695
2695
|
t.isMesh === !0 ? t.getVertexPosition(a, ne) : ne.fromBufferAttribute(r, a), ne.applyMatrix4(t.matrixWorld), this.expandByPoint(ne);
|
|
2696
2696
|
else
|
|
2697
|
-
t.boundingBox !== void 0 ? (t.boundingBox === null && t.computeBoundingBox(),
|
|
2697
|
+
t.boundingBox !== void 0 ? (t.boundingBox === null && t.computeBoundingBox(), _s.copy(t.boundingBox)) : (s.boundingBox === null && s.computeBoundingBox(), _s.copy(s.boundingBox)), _s.applyMatrix4(t.matrixWorld), this.union(_s);
|
|
2698
2698
|
}
|
|
2699
2699
|
const i = t.children;
|
|
2700
2700
|
for (let r = 0, a = i.length; r < a; r++)
|
|
@@ -2727,28 +2727,28 @@ class Ft {
|
|
|
2727
2727
|
intersectsTriangle(t) {
|
|
2728
2728
|
if (this.isEmpty())
|
|
2729
2729
|
return !1;
|
|
2730
|
-
this.getCenter(Kn), Is.subVectors(this.max, Kn), Sn.subVectors(t.a, Kn), wn.subVectors(t.b, Kn), Cn.subVectors(t.c, Kn),
|
|
2730
|
+
this.getCenter(Kn), Is.subVectors(this.max, Kn), Sn.subVectors(t.a, Kn), wn.subVectors(t.b, Kn), Cn.subVectors(t.c, Kn), De.subVectors(wn, Sn), Ue.subVectors(Cn, wn), nn.subVectors(Sn, Cn);
|
|
2731
2731
|
let e = [
|
|
2732
2732
|
0,
|
|
2733
|
-
-
|
|
2734
|
-
|
|
2733
|
+
-De.z,
|
|
2734
|
+
De.y,
|
|
2735
2735
|
0,
|
|
2736
2736
|
-Ue.z,
|
|
2737
2737
|
Ue.y,
|
|
2738
2738
|
0,
|
|
2739
2739
|
-nn.z,
|
|
2740
2740
|
nn.y,
|
|
2741
|
-
|
|
2741
|
+
De.z,
|
|
2742
2742
|
0,
|
|
2743
|
-
-
|
|
2743
|
+
-De.x,
|
|
2744
2744
|
Ue.z,
|
|
2745
2745
|
0,
|
|
2746
2746
|
-Ue.x,
|
|
2747
2747
|
nn.z,
|
|
2748
2748
|
0,
|
|
2749
2749
|
-nn.x,
|
|
2750
|
-
-
|
|
2751
|
-
|
|
2750
|
+
-De.y,
|
|
2751
|
+
De.x,
|
|
2752
2752
|
0,
|
|
2753
2753
|
-Ue.y,
|
|
2754
2754
|
Ue.x,
|
|
@@ -2757,7 +2757,7 @@ class Ft {
|
|
|
2757
2757
|
nn.x,
|
|
2758
2758
|
0
|
|
2759
2759
|
];
|
|
2760
|
-
return !Zi(e, Sn, wn, Cn, Is) || (e = [1, 0, 0, 0, 1, 0, 0, 0, 1], !Zi(e, Sn, wn, Cn, Is)) ? !1 : (Bs.crossVectors(
|
|
2760
|
+
return !Zi(e, Sn, wn, Cn, Is) || (e = [1, 0, 0, 0, 1, 0, 0, 0, 1], !Zi(e, Sn, wn, Cn, Is)) ? !1 : (Bs.crossVectors(De, Ue), e = [Bs.x, Bs.y, Bs.z], Zi(e, Sn, wn, Cn, Is));
|
|
2761
2761
|
}
|
|
2762
2762
|
clampPoint(t, e) {
|
|
2763
2763
|
return e.copy(t).clamp(this.min, this.max);
|
|
@@ -2793,7 +2793,7 @@ const Te = [
|
|
|
2793
2793
|
/* @__PURE__ */ new E(),
|
|
2794
2794
|
/* @__PURE__ */ new E(),
|
|
2795
2795
|
/* @__PURE__ */ new E()
|
|
2796
|
-
], ne = /* @__PURE__ */ new E(),
|
|
2796
|
+
], ne = /* @__PURE__ */ new E(), _s = /* @__PURE__ */ new At(), Sn = /* @__PURE__ */ new E(), wn = /* @__PURE__ */ new E(), Cn = /* @__PURE__ */ new E(), De = /* @__PURE__ */ new E(), Ue = /* @__PURE__ */ new E(), nn = /* @__PURE__ */ new E(), Kn = /* @__PURE__ */ new E(), Is = /* @__PURE__ */ new E(), Bs = /* @__PURE__ */ new E(), sn = /* @__PURE__ */ new E();
|
|
2797
2797
|
function Zi(n, t, e, s, i) {
|
|
2798
2798
|
for (let r = 0, a = n.length - 3; r <= a; r += 3) {
|
|
2799
2799
|
sn.fromArray(n, r);
|
|
@@ -2803,7 +2803,7 @@ function Zi(n, t, e, s, i) {
|
|
|
2803
2803
|
}
|
|
2804
2804
|
return !0;
|
|
2805
2805
|
}
|
|
2806
|
-
const yu = /* @__PURE__ */ new
|
|
2806
|
+
const yu = /* @__PURE__ */ new At(), Qn = /* @__PURE__ */ new E(), Ji = /* @__PURE__ */ new E();
|
|
2807
2807
|
class fa {
|
|
2808
2808
|
constructor(t = new E(), e = -1) {
|
|
2809
2809
|
this.isSphere = !0, this.center = t, this.radius = e;
|
|
@@ -2878,7 +2878,7 @@ class fa {
|
|
|
2878
2878
|
return new this.constructor().copy(this);
|
|
2879
2879
|
}
|
|
2880
2880
|
}
|
|
2881
|
-
const Fe = /* @__PURE__ */ new E(), Ki = /* @__PURE__ */ new E(),
|
|
2881
|
+
const Fe = /* @__PURE__ */ new E(), Ki = /* @__PURE__ */ new E(), Rs = /* @__PURE__ */ new E(), Pe = /* @__PURE__ */ new E(), Qi = /* @__PURE__ */ new E(), Ds = /* @__PURE__ */ new E(), tr = /* @__PURE__ */ new E();
|
|
2882
2882
|
class uh {
|
|
2883
2883
|
constructor(t = new E(), e = new E(0, 0, -1)) {
|
|
2884
2884
|
this.origin = t, this.direction = e;
|
|
@@ -2911,8 +2911,8 @@ class uh {
|
|
|
2911
2911
|
return e < 0 ? this.origin.distanceToSquared(t) : (Fe.copy(this.origin).addScaledVector(this.direction, e), Fe.distanceToSquared(t));
|
|
2912
2912
|
}
|
|
2913
2913
|
distanceSqToSegment(t, e, s, i) {
|
|
2914
|
-
Ki.copy(t).add(e).multiplyScalar(0.5),
|
|
2915
|
-
const r = t.distanceTo(e) * 0.5, a = -this.direction.dot(
|
|
2914
|
+
Ki.copy(t).add(e).multiplyScalar(0.5), Rs.copy(e).sub(t).normalize(), Pe.copy(this.origin).sub(Ki);
|
|
2915
|
+
const r = t.distanceTo(e) * 0.5, a = -this.direction.dot(Rs), o = Pe.dot(this.direction), c = -Pe.dot(Rs), h = Pe.lengthSq(), l = Math.abs(1 - a * a);
|
|
2916
2916
|
let u, f, p, d;
|
|
2917
2917
|
if (l > 0)
|
|
2918
2918
|
if (u = a * c - o, f = a * o - c, d = r * l, u >= 0)
|
|
@@ -2928,7 +2928,7 @@ class uh {
|
|
|
2928
2928
|
f <= -d ? (u = Math.max(0, -(-a * r + o)), f = u > 0 ? -r : Math.min(Math.max(-r, -c), r), p = -u * u + f * (f + 2 * c) + h) : f <= d ? (u = 0, f = Math.min(Math.max(-r, -c), r), p = f * (f + 2 * c) + h) : (u = Math.max(0, -(a * r + o)), f = u > 0 ? r : Math.min(Math.max(-r, -c), r), p = -u * u + f * (f + 2 * c) + h);
|
|
2929
2929
|
else
|
|
2930
2930
|
f = a > 0 ? -r : r, u = Math.max(0, -(a * f + o)), p = -u * u + f * (f + 2 * c) + h;
|
|
2931
|
-
return s && s.copy(this.origin).addScaledVector(this.direction, u), i && i.copy(Ki).addScaledVector(
|
|
2931
|
+
return s && s.copy(this.origin).addScaledVector(this.direction, u), i && i.copy(Ki).addScaledVector(Rs, f), p;
|
|
2932
2932
|
}
|
|
2933
2933
|
intersectSphere(t, e) {
|
|
2934
2934
|
Fe.subVectors(t.center, this.origin);
|
|
@@ -2964,7 +2964,7 @@ class uh {
|
|
|
2964
2964
|
return this.intersectBox(t, Fe) !== null;
|
|
2965
2965
|
}
|
|
2966
2966
|
intersectTriangle(t, e, s, i, r) {
|
|
2967
|
-
Qi.subVectors(e, t),
|
|
2967
|
+
Qi.subVectors(e, t), Ds.subVectors(s, t), tr.crossVectors(Qi, Ds);
|
|
2968
2968
|
let a = this.direction.dot(tr), o;
|
|
2969
2969
|
if (a > 0) {
|
|
2970
2970
|
if (i) return null;
|
|
@@ -2974,7 +2974,7 @@ class uh {
|
|
|
2974
2974
|
else
|
|
2975
2975
|
return null;
|
|
2976
2976
|
Pe.subVectors(this.origin, t);
|
|
2977
|
-
const c = o * this.direction.dot(
|
|
2977
|
+
const c = o * this.direction.dot(Ds.crossVectors(Pe, Ds));
|
|
2978
2978
|
if (c < 0)
|
|
2979
2979
|
return null;
|
|
2980
2980
|
const h = o * this.direction.dot(Qi.cross(Pe));
|
|
@@ -3134,8 +3134,8 @@ class mt {
|
|
|
3134
3134
|
return this.multiplyMatrices(t, this);
|
|
3135
3135
|
}
|
|
3136
3136
|
multiplyMatrices(t, e) {
|
|
3137
|
-
const s = t.elements, i = e.elements, r = this.elements, a = s[0], o = s[4], c = s[8], h = s[12], l = s[1], u = s[5], f = s[9], p = s[13], d = s[2], g = s[6], x = s[10], b = s[14], S = s[3], v = s[7], w = s[11], F = s[15], M = i[0], O = i[4], I = i[8], H = i[12],
|
|
3138
|
-
return r[0] = a * M + o *
|
|
3137
|
+
const s = t.elements, i = e.elements, r = this.elements, a = s[0], o = s[4], c = s[8], h = s[12], l = s[1], u = s[5], f = s[9], p = s[13], d = s[2], g = s[6], x = s[10], b = s[14], S = s[3], v = s[7], w = s[11], F = s[15], M = i[0], O = i[4], I = i[8], H = i[12], R = i[1], W = i[5], J = i[9], D = i[13], U = i[2], P = i[6], Q = i[10], yt = i[14], Pt = i[3], Ct = i[7], ut = i[11], j = i[15];
|
|
3138
|
+
return r[0] = a * M + o * R + c * U + h * Pt, r[4] = a * O + o * W + c * P + h * Ct, r[8] = a * I + o * J + c * Q + h * ut, r[12] = a * H + o * D + c * yt + h * j, r[1] = l * M + u * R + f * U + p * Pt, r[5] = l * O + u * W + f * P + p * Ct, r[9] = l * I + u * J + f * Q + p * ut, r[13] = l * H + u * D + f * yt + p * j, r[2] = d * M + g * R + x * U + b * Pt, r[6] = d * O + g * W + x * P + b * Ct, r[10] = d * I + g * J + x * Q + b * ut, r[14] = d * H + g * D + x * yt + b * j, r[3] = S * M + v * R + w * U + F * Pt, r[7] = S * O + v * W + w * P + F * Ct, r[11] = S * I + v * J + w * Q + F * ut, r[15] = S * H + v * D + w * yt + F * j, this;
|
|
3139
3139
|
}
|
|
3140
3140
|
multiplyScalar(t) {
|
|
3141
3141
|
const e = this.elements;
|
|
@@ -3341,10 +3341,10 @@ class mt {
|
|
|
3341
3341
|
const h = 1 / r, l = 1 / a, u = 1 / o;
|
|
3342
3342
|
return se.elements[0] *= h, se.elements[1] *= h, se.elements[2] *= h, se.elements[4] *= l, se.elements[5] *= l, se.elements[6] *= l, se.elements[8] *= u, se.elements[9] *= u, se.elements[10] *= u, e.setFromRotationMatrix(se), s.x = r, s.y = a, s.z = o, this;
|
|
3343
3343
|
}
|
|
3344
|
-
makePerspective(t, e, s, i, r, a, o =
|
|
3344
|
+
makePerspective(t, e, s, i, r, a, o = Ls) {
|
|
3345
3345
|
const c = this.elements, h = 2 * r / (e - t), l = 2 * r / (s - i), u = (e + t) / (e - t), f = (s + i) / (s - i);
|
|
3346
3346
|
let p, d;
|
|
3347
|
-
if (o ===
|
|
3347
|
+
if (o === Ls)
|
|
3348
3348
|
p = -(a + r) / (a - r), d = -2 * a * r / (a - r);
|
|
3349
3349
|
else if (o === Ja)
|
|
3350
3350
|
p = -a / (a - r), d = -a * r / (a - r);
|
|
@@ -3352,10 +3352,10 @@ class mt {
|
|
|
3352
3352
|
throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: " + o);
|
|
3353
3353
|
return c[0] = h, c[4] = 0, c[8] = u, c[12] = 0, c[1] = 0, c[5] = l, c[9] = f, c[13] = 0, c[2] = 0, c[6] = 0, c[10] = p, c[14] = d, c[3] = 0, c[7] = 0, c[11] = -1, c[15] = 0, this;
|
|
3354
3354
|
}
|
|
3355
|
-
makeOrthographic(t, e, s, i, r, a, o =
|
|
3355
|
+
makeOrthographic(t, e, s, i, r, a, o = Ls) {
|
|
3356
3356
|
const c = this.elements, h = 1 / (e - t), l = 1 / (s - i), u = 1 / (a - r), f = (e + t) * h, p = (s + i) * l;
|
|
3357
3357
|
let d, g;
|
|
3358
|
-
if (o ===
|
|
3358
|
+
if (o === Ls)
|
|
3359
3359
|
d = (a + r) * u, g = -2 * u;
|
|
3360
3360
|
else if (o === Ja)
|
|
3361
3361
|
d = r * u, g = -1 * u;
|
|
@@ -4159,7 +4159,7 @@ class $n {
|
|
|
4159
4159
|
return this.r = Be(t.r), this.g = Be(t.g), this.b = Be(t.b), this;
|
|
4160
4160
|
}
|
|
4161
4161
|
copyLinearToSRGB(t) {
|
|
4162
|
-
return this.r =
|
|
4162
|
+
return this.r = Rn(t.r), this.g = Rn(t.g), this.b = Rn(t.b), this;
|
|
4163
4163
|
}
|
|
4164
4164
|
convertSRGBToLinear() {
|
|
4165
4165
|
return this.copySRGBToLinear(this), this;
|
|
@@ -4426,44 +4426,44 @@ class le {
|
|
|
4426
4426
|
return this.normalized && (s = Jn(s, this.array)), s;
|
|
4427
4427
|
}
|
|
4428
4428
|
setComponent(t, e, s) {
|
|
4429
|
-
return this.normalized && (s =
|
|
4429
|
+
return this.normalized && (s = Gt(s, this.array)), this.array[t * this.itemSize + e] = s, this;
|
|
4430
4430
|
}
|
|
4431
4431
|
getX(t) {
|
|
4432
4432
|
let e = this.array[t * this.itemSize];
|
|
4433
4433
|
return this.normalized && (e = Jn(e, this.array)), e;
|
|
4434
4434
|
}
|
|
4435
4435
|
setX(t, e) {
|
|
4436
|
-
return this.normalized && (e =
|
|
4436
|
+
return this.normalized && (e = Gt(e, this.array)), this.array[t * this.itemSize] = e, this;
|
|
4437
4437
|
}
|
|
4438
4438
|
getY(t) {
|
|
4439
4439
|
let e = this.array[t * this.itemSize + 1];
|
|
4440
4440
|
return this.normalized && (e = Jn(e, this.array)), e;
|
|
4441
4441
|
}
|
|
4442
4442
|
setY(t, e) {
|
|
4443
|
-
return this.normalized && (e =
|
|
4443
|
+
return this.normalized && (e = Gt(e, this.array)), this.array[t * this.itemSize + 1] = e, this;
|
|
4444
4444
|
}
|
|
4445
4445
|
getZ(t) {
|
|
4446
4446
|
let e = this.array[t * this.itemSize + 2];
|
|
4447
4447
|
return this.normalized && (e = Jn(e, this.array)), e;
|
|
4448
4448
|
}
|
|
4449
4449
|
setZ(t, e) {
|
|
4450
|
-
return this.normalized && (e =
|
|
4450
|
+
return this.normalized && (e = Gt(e, this.array)), this.array[t * this.itemSize + 2] = e, this;
|
|
4451
4451
|
}
|
|
4452
4452
|
getW(t) {
|
|
4453
4453
|
let e = this.array[t * this.itemSize + 3];
|
|
4454
4454
|
return this.normalized && (e = Jn(e, this.array)), e;
|
|
4455
4455
|
}
|
|
4456
4456
|
setW(t, e) {
|
|
4457
|
-
return this.normalized && (e =
|
|
4457
|
+
return this.normalized && (e = Gt(e, this.array)), this.array[t * this.itemSize + 3] = e, this;
|
|
4458
4458
|
}
|
|
4459
4459
|
setXY(t, e, s) {
|
|
4460
|
-
return t *= this.itemSize, this.normalized && (e =
|
|
4460
|
+
return t *= this.itemSize, this.normalized && (e = Gt(e, this.array), s = Gt(s, this.array)), this.array[t + 0] = e, this.array[t + 1] = s, this;
|
|
4461
4461
|
}
|
|
4462
4462
|
setXYZ(t, e, s, i) {
|
|
4463
|
-
return t *= this.itemSize, this.normalized && (e =
|
|
4463
|
+
return t *= this.itemSize, this.normalized && (e = Gt(e, this.array), s = Gt(s, this.array), i = Gt(i, this.array)), this.array[t + 0] = e, this.array[t + 1] = s, this.array[t + 2] = i, this;
|
|
4464
4464
|
}
|
|
4465
4465
|
setXYZW(t, e, s, i, r) {
|
|
4466
|
-
return t *= this.itemSize, this.normalized && (e =
|
|
4466
|
+
return t *= this.itemSize, this.normalized && (e = Gt(e, this.array), s = Gt(s, this.array), i = Gt(i, this.array), r = Gt(r, this.array)), this.array[t + 0] = e, this.array[t + 1] = s, this.array[t + 2] = i, this.array[t + 3] = r, this;
|
|
4467
4467
|
}
|
|
4468
4468
|
onUpload(t) {
|
|
4469
4469
|
return this.onUploadCallback = t, this;
|
|
@@ -4497,7 +4497,7 @@ class un extends le {
|
|
|
4497
4497
|
}
|
|
4498
4498
|
}
|
|
4499
4499
|
let Eu = 0;
|
|
4500
|
-
const Zt = /* @__PURE__ */ new mt(), lr = /* @__PURE__ */ new Xt(), Mn = /* @__PURE__ */ new E(), qt = /* @__PURE__ */ new
|
|
4500
|
+
const Zt = /* @__PURE__ */ new mt(), lr = /* @__PURE__ */ new Xt(), Mn = /* @__PURE__ */ new E(), qt = /* @__PURE__ */ new At(), es = /* @__PURE__ */ new At(), wt = /* @__PURE__ */ new E();
|
|
4501
4501
|
class Dt extends Ii {
|
|
4502
4502
|
constructor() {
|
|
4503
4503
|
super(), this.isBufferGeometry = !0, Object.defineProperty(this, "id", { value: Eu++ }), this.uuid = Yn(), this.name = "", this.type = "BufferGeometry", this.index = null, this.indirect = null, this.attributes = {}, this.morphAttributes = {}, this.morphTargetsRelative = !1, this.groups = [], this.boundingBox = null, this.boundingSphere = null, this.drawRange = { start: 0, count: 1 / 0 }, this.userData = {};
|
|
@@ -4594,7 +4594,7 @@ class Dt extends Ii {
|
|
|
4594
4594
|
return this;
|
|
4595
4595
|
}
|
|
4596
4596
|
computeBoundingBox() {
|
|
4597
|
-
this.boundingBox === null && (this.boundingBox = new
|
|
4597
|
+
this.boundingBox === null && (this.boundingBox = new At());
|
|
4598
4598
|
const t = this.attributes.position, e = this.morphAttributes.position;
|
|
4599
4599
|
if (t && t.isGLBufferAttribute) {
|
|
4600
4600
|
console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.", this), this.boundingBox.set(
|
|
@@ -4652,10 +4652,10 @@ class Dt extends Ii {
|
|
|
4652
4652
|
for (let I = 0; I < s.count; I++)
|
|
4653
4653
|
o[I] = new E(), c[I] = new E();
|
|
4654
4654
|
const h = new E(), l = new E(), u = new E(), f = new X(), p = new X(), d = new X(), g = new E(), x = new E();
|
|
4655
|
-
function b(I, H,
|
|
4656
|
-
h.fromBufferAttribute(s, I), l.fromBufferAttribute(s, H), u.fromBufferAttribute(s,
|
|
4655
|
+
function b(I, H, R) {
|
|
4656
|
+
h.fromBufferAttribute(s, I), l.fromBufferAttribute(s, H), u.fromBufferAttribute(s, R), f.fromBufferAttribute(r, I), p.fromBufferAttribute(r, H), d.fromBufferAttribute(r, R), l.sub(h), u.sub(h), p.sub(f), d.sub(f);
|
|
4657
4657
|
const W = 1 / (p.x * d.y - d.x * p.y);
|
|
4658
|
-
isFinite(W) && (g.copy(l).multiplyScalar(d.y).addScaledVector(u, -p.y).multiplyScalar(W), x.copy(u).multiplyScalar(p.x).addScaledVector(l, -d.x).multiplyScalar(W), o[I].add(g), o[H].add(g), o[
|
|
4658
|
+
isFinite(W) && (g.copy(l).multiplyScalar(d.y).addScaledVector(u, -p.y).multiplyScalar(W), x.copy(u).multiplyScalar(p.x).addScaledVector(l, -d.x).multiplyScalar(W), o[I].add(g), o[H].add(g), o[R].add(g), c[I].add(x), c[H].add(x), c[R].add(x));
|
|
4659
4659
|
}
|
|
4660
4660
|
let S = this.groups;
|
|
4661
4661
|
S.length === 0 && (S = [{
|
|
@@ -4663,12 +4663,12 @@ class Dt extends Ii {
|
|
|
4663
4663
|
count: t.count
|
|
4664
4664
|
}]);
|
|
4665
4665
|
for (let I = 0, H = S.length; I < H; ++I) {
|
|
4666
|
-
const
|
|
4667
|
-
for (let
|
|
4666
|
+
const R = S[I], W = R.start, J = R.count;
|
|
4667
|
+
for (let D = W, U = W + J; D < U; D += 3)
|
|
4668
4668
|
b(
|
|
4669
|
-
t.getX(
|
|
4670
|
-
t.getX(
|
|
4671
|
-
t.getX(
|
|
4669
|
+
t.getX(D + 0),
|
|
4670
|
+
t.getX(D + 1),
|
|
4671
|
+
t.getX(D + 2)
|
|
4672
4672
|
);
|
|
4673
4673
|
}
|
|
4674
4674
|
const v = new E(), w = new E(), F = new E(), M = new E();
|
|
@@ -4680,9 +4680,9 @@ class Dt extends Ii {
|
|
|
4680
4680
|
a.setXYZW(I, v.x, v.y, v.z, W);
|
|
4681
4681
|
}
|
|
4682
4682
|
for (let I = 0, H = S.length; I < H; ++I) {
|
|
4683
|
-
const
|
|
4684
|
-
for (let
|
|
4685
|
-
O(t.getX(
|
|
4683
|
+
const R = S[I], W = R.start, J = R.count;
|
|
4684
|
+
for (let D = W, U = W + J; D < U; D += 3)
|
|
4685
|
+
O(t.getX(D + 0)), O(t.getX(D + 1)), O(t.getX(D + 2));
|
|
4686
4686
|
}
|
|
4687
4687
|
}
|
|
4688
4688
|
computeVertexNormals() {
|
|
@@ -5228,7 +5228,7 @@ function pa() {
|
|
|
5228
5228
|
};
|
|
5229
5229
|
}
|
|
5230
5230
|
const Zs = /* @__PURE__ */ new E(), pr = /* @__PURE__ */ new pa(), dr = /* @__PURE__ */ new pa(), gr = /* @__PURE__ */ new pa();
|
|
5231
|
-
class
|
|
5231
|
+
class Lu extends we {
|
|
5232
5232
|
constructor(t = [], e = !1, s = "centripetal", i = 0.5) {
|
|
5233
5233
|
super(), this.isCatmullRomCurve3 = !0, this.type = "CatmullRomCurve3", this.points = t, this.closed = e, this.curveType = s, this.tension = i;
|
|
5234
5234
|
}
|
|
@@ -5280,7 +5280,7 @@ function bo(n, t, e, s, i) {
|
|
|
5280
5280
|
const r = (s - t) * 0.5, a = (i - e) * 0.5, o = n * n, c = n * o;
|
|
5281
5281
|
return (2 * e - 2 * s + r + a) * c + (-3 * e + 3 * s - 2 * r - a) * o + r * n + e;
|
|
5282
5282
|
}
|
|
5283
|
-
function
|
|
5283
|
+
function _u(n, t) {
|
|
5284
5284
|
const e = 1 - n;
|
|
5285
5285
|
return e * e * t;
|
|
5286
5286
|
}
|
|
@@ -5291,13 +5291,13 @@ function Bu(n, t) {
|
|
|
5291
5291
|
return n * n * t;
|
|
5292
5292
|
}
|
|
5293
5293
|
function os(n, t, e, s) {
|
|
5294
|
-
return
|
|
5294
|
+
return _u(n, t) + Iu(n, e) + Bu(n, s);
|
|
5295
5295
|
}
|
|
5296
|
-
function
|
|
5296
|
+
function Ru(n, t) {
|
|
5297
5297
|
const e = 1 - n;
|
|
5298
5298
|
return e * e * e * t;
|
|
5299
5299
|
}
|
|
5300
|
-
function
|
|
5300
|
+
function Du(n, t) {
|
|
5301
5301
|
const e = 1 - n;
|
|
5302
5302
|
return 3 * e * e * n * t;
|
|
5303
5303
|
}
|
|
@@ -5308,7 +5308,7 @@ function Pu(n, t) {
|
|
|
5308
5308
|
return n * n * n * t;
|
|
5309
5309
|
}
|
|
5310
5310
|
function cs(n, t, e, s, i) {
|
|
5311
|
-
return
|
|
5311
|
+
return Ru(n, t) + Du(n, e) + Uu(n, s) + Pu(n, i);
|
|
5312
5312
|
}
|
|
5313
5313
|
class yi extends we {
|
|
5314
5314
|
constructor(t = new X(), e = new X(), s = new X(), i = new X()) {
|
|
@@ -5498,7 +5498,7 @@ class yh extends we {
|
|
|
5498
5498
|
var vo = /* @__PURE__ */ Object.freeze({
|
|
5499
5499
|
__proto__: null,
|
|
5500
5500
|
ArcCurve: Ou,
|
|
5501
|
-
CatmullRomCurve3:
|
|
5501
|
+
CatmullRomCurve3: Lu,
|
|
5502
5502
|
CubicBezierCurve: yi,
|
|
5503
5503
|
CubicBezierCurve3: Nu,
|
|
5504
5504
|
EllipseCurve: fs,
|
|
@@ -5685,7 +5685,7 @@ let qr = class extends Gu {
|
|
|
5685
5685
|
return super.fromJSON(t), this.currentPoint.fromArray(t.currentPoint), this;
|
|
5686
5686
|
}
|
|
5687
5687
|
};
|
|
5688
|
-
class
|
|
5688
|
+
class Dn extends qr {
|
|
5689
5689
|
constructor(t) {
|
|
5690
5690
|
super(t), this.uuid = Yn(), this.type = "Shape", this.holes = [];
|
|
5691
5691
|
}
|
|
@@ -6004,7 +6004,7 @@ function Co(n, t) {
|
|
|
6004
6004
|
n.push(t[e].x), n.push(t[e].y);
|
|
6005
6005
|
}
|
|
6006
6006
|
class Un extends Dt {
|
|
6007
|
-
constructor(t = new
|
|
6007
|
+
constructor(t = new Dn([new X(0, 0.5), new X(-0.5, -0.5), new X(0.5, -0.5)]), e = 12) {
|
|
6008
6008
|
super(), this.type = "ShapeGeometry", this.parameters = {
|
|
6009
6009
|
shapes: t,
|
|
6010
6010
|
curveSegments: e
|
|
@@ -6282,7 +6282,7 @@ class wh {
|
|
|
6282
6282
|
function e(b) {
|
|
6283
6283
|
const S = [];
|
|
6284
6284
|
for (let v = 0, w = b.length; v < w; v++) {
|
|
6285
|
-
const F = b[v], M = new
|
|
6285
|
+
const F = b[v], M = new Dn();
|
|
6286
6286
|
M.curves = F.curves, S.push(M);
|
|
6287
6287
|
}
|
|
6288
6288
|
return S;
|
|
@@ -6291,13 +6291,13 @@ class wh {
|
|
|
6291
6291
|
const v = S.length;
|
|
6292
6292
|
let w = !1;
|
|
6293
6293
|
for (let F = v - 1, M = 0; M < v; F = M++) {
|
|
6294
|
-
let O = S[F], I = S[M], H = I.x - O.x,
|
|
6295
|
-
if (Math.abs(
|
|
6296
|
-
if (
|
|
6294
|
+
let O = S[F], I = S[M], H = I.x - O.x, R = I.y - O.y;
|
|
6295
|
+
if (Math.abs(R) > Number.EPSILON) {
|
|
6296
|
+
if (R < 0 && (O = S[M], H = -H, I = S[F], R = -R), b.y < O.y || b.y > I.y) continue;
|
|
6297
6297
|
if (b.y === O.y) {
|
|
6298
6298
|
if (b.x === O.x) return !0;
|
|
6299
6299
|
} else {
|
|
6300
|
-
const W =
|
|
6300
|
+
const W = R * (b.x - O.x) - H * (b.y - O.y);
|
|
6301
6301
|
if (W === 0) return !0;
|
|
6302
6302
|
if (W < 0) continue;
|
|
6303
6303
|
w = !w;
|
|
@@ -6314,14 +6314,14 @@ class wh {
|
|
|
6314
6314
|
let a, o, c;
|
|
6315
6315
|
const h = [];
|
|
6316
6316
|
if (r.length === 1)
|
|
6317
|
-
return o = r[0], c = new
|
|
6317
|
+
return o = r[0], c = new Dn(), c.curves = o.curves, h.push(c), h;
|
|
6318
6318
|
let l = !i(r[0].getPoints());
|
|
6319
6319
|
l = t ? !l : l;
|
|
6320
6320
|
const u = [], f = [];
|
|
6321
6321
|
let p = [], d = 0, g;
|
|
6322
6322
|
f[d] = void 0, p[d] = [];
|
|
6323
6323
|
for (let b = 0, S = r.length; b < S; b++)
|
|
6324
|
-
o = r[b], g = o.getPoints(), a = i(g), a = t ? !a : a, a ? (!l && f[d] && d++, f[d] = { s: new
|
|
6324
|
+
o = r[b], g = o.getPoints(), a = i(g), a = t ? !a : a, a ? (!l && f[d] && d++, f[d] = { s: new Dn(), p: g }, f[d].s.curves = o.curves, l && d++, p[d] = []) : p[d].push({ h: o, p: g[0] });
|
|
6325
6325
|
if (!f[0]) return e(r);
|
|
6326
6326
|
if (f.length > 1) {
|
|
6327
6327
|
let b = !1, S = 0;
|
|
@@ -6551,7 +6551,7 @@ class Fh {
|
|
|
6551
6551
|
this.unsupportedChars[t] || (this.unsupportedChars[t] = 0), this.unsupportedChars[t]++;
|
|
6552
6552
|
}
|
|
6553
6553
|
}
|
|
6554
|
-
class Ah extends
|
|
6554
|
+
class Ah extends Dn {
|
|
6555
6555
|
constructor() {
|
|
6556
6556
|
super(...arguments), this.width = 0;
|
|
6557
6557
|
}
|
|
@@ -6862,7 +6862,7 @@ const mf = (n) => n.substring(n.lastIndexOf(".") + 1), kh = (n) => n.split("/").
|
|
|
6862
6862
|
16777215,
|
|
6863
6863
|
0
|
|
6864
6864
|
], Eh = (n) => yf[n];
|
|
6865
|
-
class
|
|
6865
|
+
class Rt {
|
|
6866
6866
|
/**
|
|
6867
6867
|
* Converts an unsigned byte to a signed byte as used in SHX format.
|
|
6868
6868
|
* Values > 127 are converted to their signed equivalent (-128 to -1).
|
|
@@ -7064,7 +7064,7 @@ function Oh(n) {
|
|
|
7064
7064
|
t[s] = e;
|
|
7065
7065
|
return t;
|
|
7066
7066
|
}
|
|
7067
|
-
function
|
|
7067
|
+
function Lh(n) {
|
|
7068
7068
|
const t = n.indexOf(0);
|
|
7069
7069
|
return t < 0 ? { name: null, bytecode: n } : { name: t > 0 ? new TextDecoder("ascii").decode(n.subarray(0, t)) : null, bytecode: n.subarray(t + 1) };
|
|
7070
7070
|
}
|
|
@@ -7095,7 +7095,7 @@ class vf {
|
|
|
7095
7095
|
r[l] = h;
|
|
7096
7096
|
continue;
|
|
7097
7097
|
}
|
|
7098
|
-
const { name: u, bytecode: f } =
|
|
7098
|
+
const { name: u, bytecode: f } = Lh(h);
|
|
7099
7099
|
r[l] = f, u && (a[u] = l);
|
|
7100
7100
|
}
|
|
7101
7101
|
const o = {
|
|
@@ -7306,7 +7306,7 @@ class wf {
|
|
|
7306
7306
|
if (l > 0) {
|
|
7307
7307
|
const u = t.readBytes(l);
|
|
7308
7308
|
if (u.length === l) {
|
|
7309
|
-
const { name: f, bytecode: p } =
|
|
7309
|
+
const { name: f, bytecode: p } = Lh(u);
|
|
7310
7310
|
p.length > 0 && (a[h] = p, f && (o[f] = h));
|
|
7311
7311
|
}
|
|
7312
7312
|
}
|
|
@@ -7377,7 +7377,7 @@ class bi extends Tf {
|
|
|
7377
7377
|
return !0;
|
|
7378
7378
|
}
|
|
7379
7379
|
}
|
|
7380
|
-
const
|
|
7380
|
+
const Ri = new bi();
|
|
7381
7381
|
class at {
|
|
7382
7382
|
/**
|
|
7383
7383
|
* Creates a new Point instance.
|
|
@@ -7478,7 +7478,7 @@ class at {
|
|
|
7478
7478
|
return Math.sqrt(e * e + s * s);
|
|
7479
7479
|
}
|
|
7480
7480
|
}
|
|
7481
|
-
function
|
|
7481
|
+
function _h(n) {
|
|
7482
7482
|
const { width: t, capHeight: e, descenderHeight: s, origin: i = "baseline" } = n, r = e + s;
|
|
7483
7483
|
return i === "top" ? { minX: -t / 2, maxX: t / 2, minY: -r, maxY: 0 } : { minX: 0, maxX: t, minY: -s, maxY: e };
|
|
7484
7484
|
}
|
|
@@ -7509,7 +7509,7 @@ function Mf(n, t, e, s, i, r, a) {
|
|
|
7509
7509
|
return `<line x1="${n}" y1="${-t}" x2="${e}" y2="${-s}" stroke="${i}" stroke-width="${r}"${o}/>`;
|
|
7510
7510
|
}
|
|
7511
7511
|
function Of(n, t, e) {
|
|
7512
|
-
const { capHeight: s, descenderHeight: i, origin: r = "baseline" } = n, a = s + i, o =
|
|
7512
|
+
const { capHeight: s, descenderHeight: i, origin: r = "baseline" } = n, a = s + i, o = _h(n);
|
|
7513
7513
|
let c, h, l;
|
|
7514
7514
|
r === "top" ? (s > 0 && (c = { minX: o.minX, maxX: o.maxX, minY: -s, maxY: 0 }), i > 0 && (h = {
|
|
7515
7515
|
minX: o.minX,
|
|
@@ -7608,13 +7608,13 @@ class Pn {
|
|
|
7608
7608
|
showFrame: u = !1,
|
|
7609
7609
|
frameColor: f = "red",
|
|
7610
7610
|
frameStrokeWidth: p = "0.5%"
|
|
7611
|
-
} = r, d =
|
|
7611
|
+
} = r, d = _h(r), g = this.bbox;
|
|
7612
7612
|
let x = d;
|
|
7613
7613
|
l && Ff(g) && !Af(d, g) && (x = kf(d, g));
|
|
7614
7614
|
const b = x.maxX - x.minX, S = x.maxY - x.minY, v = b * h, w = S * h, F = x.minX - v, M = x.maxX + v, O = x.minY - w, I = x.maxY + w;
|
|
7615
|
-
o = c((
|
|
7616
|
-
x:
|
|
7617
|
-
y: -
|
|
7615
|
+
o = c((R) => ({
|
|
7616
|
+
x: R.x,
|
|
7617
|
+
y: -R.y
|
|
7618
7618
|
}));
|
|
7619
7619
|
const H = u ? Of(r, f, p) : "";
|
|
7620
7620
|
return a = `${F} ${-I} ${M - F} ${I - O}`, `<svg width="100%" height="100%" viewBox="${a}" preserveAspectRatio="xMidYMid meet">${H}${o}</svg>`;
|
|
@@ -7632,7 +7632,7 @@ class Pn {
|
|
|
7632
7632
|
return `<svg width="100%" height="100%" viewBox="${a}" preserveAspectRatio="xMidYMid meet">${o}</svg>`;
|
|
7633
7633
|
}
|
|
7634
7634
|
}
|
|
7635
|
-
const Eo = 8, Mo = 48,
|
|
7635
|
+
const Eo = 8, Mo = 48, Lf = 0.4, _f = [
|
|
7636
7636
|
52164,
|
|
7637
7637
|
45795,
|
|
7638
7638
|
49829,
|
|
@@ -7684,7 +7684,7 @@ const Eo = 8, Mo = 48, _f = 0.4, Lf = [
|
|
|
7684
7684
|
51965,
|
|
7685
7685
|
55e3
|
|
7686
7686
|
];
|
|
7687
|
-
function
|
|
7687
|
+
function Di(n, t) {
|
|
7688
7688
|
const { height: e, width: s, baseUp: i, baseDown: r } = n, a = e > 0 ? t / e : 1, o = a * i, c = a * r;
|
|
7689
7689
|
return {
|
|
7690
7690
|
size: t,
|
|
@@ -7710,7 +7710,7 @@ function Bf(n, t, e) {
|
|
|
7710
7710
|
const { height: s } = n.content;
|
|
7711
7711
|
if (s <= 0)
|
|
7712
7712
|
return 0;
|
|
7713
|
-
const i = s *
|
|
7713
|
+
const i = s * Lf, r = [], a = /* @__PURE__ */ new Set(), o = (h) => {
|
|
7714
7714
|
if (a.has(h) || h <= 255 || !(h in n.content.data))
|
|
7715
7715
|
return;
|
|
7716
7716
|
a.add(h);
|
|
@@ -7720,7 +7720,7 @@ function Bf(n, t, e) {
|
|
|
7720
7720
|
const u = l.bbox.minY;
|
|
7721
7721
|
u > 0 && u <= i && r.push(u);
|
|
7722
7722
|
};
|
|
7723
|
-
for (const h of
|
|
7723
|
+
for (const h of _f)
|
|
7724
7724
|
if (o(h), r.length >= Mo)
|
|
7725
7725
|
break;
|
|
7726
7726
|
if (r.length < Eo) {
|
|
@@ -7734,12 +7734,12 @@ function Bf(n, t, e) {
|
|
|
7734
7734
|
const c = Math.floor(r.length / 2);
|
|
7735
7735
|
return r.length % 2 === 0 ? (r[c - 1] + r[c]) / 2 : r[c];
|
|
7736
7736
|
}
|
|
7737
|
-
function
|
|
7737
|
+
function Rf(n, t, e) {
|
|
7738
7738
|
if (n.header.fontType !== K.UNIFONT)
|
|
7739
7739
|
return !1;
|
|
7740
7740
|
if (n.content.dualOrientation)
|
|
7741
7741
|
return !0;
|
|
7742
|
-
const s =
|
|
7742
|
+
const s = Di(n.content, e);
|
|
7743
7743
|
for (const i of [48, 65, 78, 49]) {
|
|
7744
7744
|
if (!(i in n.content.data))
|
|
7745
7745
|
continue;
|
|
@@ -7749,7 +7749,7 @@ function Df(n, t, e) {
|
|
|
7749
7749
|
}
|
|
7750
7750
|
return !1;
|
|
7751
7751
|
}
|
|
7752
|
-
function
|
|
7752
|
+
function Df(n, t, e, s = Ri, i = !1, r = 0) {
|
|
7753
7753
|
var a;
|
|
7754
7754
|
let o = n;
|
|
7755
7755
|
if (t.header.fontType === K.BIGFONT && r > 0) {
|
|
@@ -7767,9 +7767,9 @@ function Rf(n, t, e, s = Di, i = !1, r = 0) {
|
|
|
7767
7767
|
h
|
|
7768
7768
|
);
|
|
7769
7769
|
}
|
|
7770
|
-
function Uf(n, t, e, s =
|
|
7771
|
-
const a =
|
|
7772
|
-
return
|
|
7770
|
+
function Uf(n, t, e, s = Ri, i = !1, r = 0) {
|
|
7771
|
+
const a = Di(t.content, e);
|
|
7772
|
+
return Df(
|
|
7773
7773
|
n,
|
|
7774
7774
|
t,
|
|
7775
7775
|
a,
|
|
@@ -8177,7 +8177,7 @@ class zf {
|
|
|
8177
8177
|
return i;
|
|
8178
8178
|
if (this.isVerticalDualBigfontMarker(t, i, "close"))
|
|
8179
8179
|
return i + 1;
|
|
8180
|
-
r = t[i], r === 0 && (i++, r = t[i++] << 8 | t[i++], h.x =
|
|
8180
|
+
r = t[i], r === 0 && (i++, r = t[i++] << 8 | t[i++], h.x = Rt.byteToSByte(t[i++]) * s.scale, h.y = Rt.byteToSByte(t[i++]) * s.scale, this.fontData.content.isExtended ? (c = t[i++] * s.scale, o = t[i] * s.scale) : (o = t[i] * s.scale, c = o));
|
|
8181
8181
|
break;
|
|
8182
8182
|
case K.UNIFONT:
|
|
8183
8183
|
i++, r = t[i++] << 8 | t[i++], i--;
|
|
@@ -8217,13 +8217,13 @@ class zf {
|
|
|
8217
8217
|
handleXYDisplacement(t, e, s) {
|
|
8218
8218
|
let i = e;
|
|
8219
8219
|
const r = new at();
|
|
8220
|
-
return r.x =
|
|
8220
|
+
return r.x = Rt.byteToSByte(t[++i]), r.y = Rt.byteToSByte(t[++i]), s.currentPoint.add(r.multiply(s.scale)), s.isPenDown ? s.currentPolyline.push(s.currentPoint.clone()) : this.notePenUpPositioning(s), i;
|
|
8221
8221
|
}
|
|
8222
8222
|
handleMultipleXYDisplacements(t, e, s) {
|
|
8223
8223
|
let i = e;
|
|
8224
8224
|
for (; !(i + 1 >= t.length); ) {
|
|
8225
8225
|
const r = new at();
|
|
8226
|
-
if (r.x =
|
|
8226
|
+
if (r.x = Rt.byteToSByte(t[++i]), r.y = Rt.byteToSByte(t[++i]), r.x === 0 && r.y === 0)
|
|
8227
8227
|
break;
|
|
8228
8228
|
s.currentPoint.add(r.multiply(s.scale)), s.isPenDown ? s.currentPolyline.push(s.currentPoint.clone()) : this.notePenUpPositioning(s);
|
|
8229
8229
|
}
|
|
@@ -8231,14 +8231,14 @@ class zf {
|
|
|
8231
8231
|
}
|
|
8232
8232
|
handleOctantArc(t, e, s) {
|
|
8233
8233
|
let i = e;
|
|
8234
|
-
const r = t[++i] * s.scale, a =
|
|
8234
|
+
const r = t[++i] * s.scale, a = Rt.byteToSByte(t[++i]), o = (a & 112) >> 4;
|
|
8235
8235
|
let c = a & 7;
|
|
8236
8236
|
const h = a < 0, l = Math.PI / 4 * o, u = s.currentPoint.clone().subtract(new at(Math.cos(l) * r, Math.sin(l) * r)), f = ms.fromOctant(u, r, o, c, h).tessellate();
|
|
8237
8237
|
return s.isPenDown && (s.currentPolyline.pop(), s.currentPolyline.push(...f.slice())), s.currentPoint = f[f.length - 1].clone(), i;
|
|
8238
8238
|
}
|
|
8239
8239
|
handleFractionalArc(t, e, s) {
|
|
8240
8240
|
let i = e;
|
|
8241
|
-
const r = t[++i], a = t[++i], o = t[++i], c = t[++i], h = (o * 255 + c) * s.scale, l =
|
|
8241
|
+
const r = t[++i], a = t[++i], o = t[++i], c = t[++i], h = (o * 255 + c) * s.scale, l = Rt.byteToSByte(t[++i]), u = (l & 112) >> 4;
|
|
8242
8242
|
let f = l & 7;
|
|
8243
8243
|
f === 0 && (f = 8), a !== 0 && f--;
|
|
8244
8244
|
const p = Math.PI / 4;
|
|
@@ -8269,8 +8269,8 @@ class zf {
|
|
|
8269
8269
|
handleBulgeArc(t, e, s) {
|
|
8270
8270
|
let i = e;
|
|
8271
8271
|
const r = new at();
|
|
8272
|
-
r.x =
|
|
8273
|
-
const a =
|
|
8272
|
+
r.x = Rt.byteToSByte(t[++i]), r.y = Rt.byteToSByte(t[++i]);
|
|
8273
|
+
const a = Rt.byteToSByte(t[++i]);
|
|
8274
8274
|
return s.currentPoint = this.handleArcSegment(
|
|
8275
8275
|
s.currentPoint,
|
|
8276
8276
|
r,
|
|
@@ -8284,9 +8284,9 @@ class zf {
|
|
|
8284
8284
|
let i = e;
|
|
8285
8285
|
for (; !(i + 1 >= t.length); ) {
|
|
8286
8286
|
const r = new at();
|
|
8287
|
-
if (r.x =
|
|
8287
|
+
if (r.x = Rt.byteToSByte(t[++i]), r.y = Rt.byteToSByte(t[++i]), r.x === 0 && r.y === 0 || i + 1 >= t.length)
|
|
8288
8288
|
break;
|
|
8289
|
-
const a =
|
|
8289
|
+
const a = Rt.byteToSByte(t[++i]);
|
|
8290
8290
|
s.currentPoint = this.handleArcSegment(
|
|
8291
8291
|
s.currentPoint,
|
|
8292
8292
|
r,
|
|
@@ -8418,7 +8418,7 @@ class Hf {
|
|
|
8418
8418
|
*/
|
|
8419
8419
|
constructor(t) {
|
|
8420
8420
|
if (t instanceof ArrayBuffer) {
|
|
8421
|
-
const e = new
|
|
8421
|
+
const e = new Rt(t), s = new xf().parse(e), i = Cf.createParser(s.fontType).parse(e);
|
|
8422
8422
|
this.fontData = {
|
|
8423
8423
|
header: s,
|
|
8424
8424
|
content: i
|
|
@@ -8476,7 +8476,7 @@ class Hf {
|
|
|
8476
8476
|
* @param size - Target font size in drawing units
|
|
8477
8477
|
*/
|
|
8478
8478
|
getFontMetrics(t) {
|
|
8479
|
-
return
|
|
8479
|
+
return Di(this.fontData.content, t);
|
|
8480
8480
|
}
|
|
8481
8481
|
/**
|
|
8482
8482
|
* Returns a layout-ready glyph: scaled geometry with baseline alignment applied.
|
|
@@ -8486,7 +8486,7 @@ class Hf {
|
|
|
8486
8486
|
* @param code - The character code to get the shape for
|
|
8487
8487
|
* @param size - The desired font size
|
|
8488
8488
|
*/
|
|
8489
|
-
getLayoutCharShape(t, e, s =
|
|
8489
|
+
getLayoutCharShape(t, e, s = Ri) {
|
|
8490
8490
|
const i = this.getCharShape(t, e);
|
|
8491
8491
|
if (i)
|
|
8492
8492
|
return Uf(
|
|
@@ -8523,7 +8523,7 @@ class Hf {
|
|
|
8523
8523
|
* @returns True when baseline-origin UNIFONT shifting should be skipped during layout
|
|
8524
8524
|
*/
|
|
8525
8525
|
usesUnifontBaselineOriginFont(t) {
|
|
8526
|
-
return this.unifontBaselineOriginFont === void 0 && (this.unifontBaselineOriginFont =
|
|
8526
|
+
return this.unifontBaselineOriginFont === void 0 && (this.unifontBaselineOriginFont = Rf(
|
|
8527
8527
|
this.fontData,
|
|
8528
8528
|
(e) => this.getCharShape(e, t),
|
|
8529
8529
|
t
|
|
@@ -8563,14 +8563,14 @@ class Hf {
|
|
|
8563
8563
|
this.shapeParser.release();
|
|
8564
8564
|
}
|
|
8565
8565
|
}
|
|
8566
|
-
function Gf(n, t, e, s =
|
|
8567
|
-
const i =
|
|
8566
|
+
function Gf(n, t, e, s = Ri) {
|
|
8567
|
+
const i = Di(t.content, e);
|
|
8568
8568
|
return s.resolve(n, i.cellWidth);
|
|
8569
8569
|
}
|
|
8570
8570
|
const Yr = (n, t) => t.some((e) => n instanceof e);
|
|
8571
|
-
let
|
|
8571
|
+
let Lo, _o;
|
|
8572
8572
|
function Vf() {
|
|
8573
|
-
return
|
|
8573
|
+
return Lo || (Lo = [
|
|
8574
8574
|
IDBDatabase,
|
|
8575
8575
|
IDBObjectStore,
|
|
8576
8576
|
IDBIndex,
|
|
@@ -8579,7 +8579,7 @@ function Vf() {
|
|
|
8579
8579
|
]);
|
|
8580
8580
|
}
|
|
8581
8581
|
function Wf() {
|
|
8582
|
-
return
|
|
8582
|
+
return _o || (_o = [
|
|
8583
8583
|
IDBCursor.prototype.advance,
|
|
8584
8584
|
IDBCursor.prototype.continue,
|
|
8585
8585
|
IDBCursor.prototype.continuePrimaryKey
|
|
@@ -8694,13 +8694,13 @@ Bh((n) => ({
|
|
|
8694
8694
|
get: (t, e, s) => Io(t, e) || n.get(t, e, s),
|
|
8695
8695
|
has: (t, e) => !!Io(t, e) || n.has(t, e)
|
|
8696
8696
|
}));
|
|
8697
|
-
const Kf = ["continue", "continuePrimaryKey", "advance"], Bo = {}, Kr = /* @__PURE__ */ new WeakMap(),
|
|
8697
|
+
const Kf = ["continue", "continuePrimaryKey", "advance"], Bo = {}, Kr = /* @__PURE__ */ new WeakMap(), Rh = /* @__PURE__ */ new WeakMap(), Qf = {
|
|
8698
8698
|
get(n, t) {
|
|
8699
8699
|
if (!Kf.includes(t))
|
|
8700
8700
|
return n[t];
|
|
8701
8701
|
let e = Bo[t];
|
|
8702
8702
|
return e || (e = Bo[t] = function(...s) {
|
|
8703
|
-
Kr.set(this,
|
|
8703
|
+
Kr.set(this, Rh.get(this)[t](...s));
|
|
8704
8704
|
}), e;
|
|
8705
8705
|
}
|
|
8706
8706
|
};
|
|
@@ -8710,19 +8710,19 @@ async function* tp(...n) {
|
|
|
8710
8710
|
return;
|
|
8711
8711
|
t = t;
|
|
8712
8712
|
const e = new Proxy(t, Qf);
|
|
8713
|
-
for (
|
|
8713
|
+
for (Rh.set(e, t), Ui.set(e, Jr(t)); t; )
|
|
8714
8714
|
yield e, t = await (Kr.get(e) || t.continue()), Kr.delete(e);
|
|
8715
8715
|
}
|
|
8716
|
-
function
|
|
8716
|
+
function Ro(n, t) {
|
|
8717
8717
|
return t === Symbol.asyncIterator && Yr(n, [IDBIndex, IDBObjectStore, IDBCursor]) || t === "iterate" && Yr(n, [IDBIndex, IDBObjectStore]);
|
|
8718
8718
|
}
|
|
8719
8719
|
Bh((n) => ({
|
|
8720
8720
|
...n,
|
|
8721
8721
|
get(t, e, s) {
|
|
8722
|
-
return
|
|
8722
|
+
return Ro(t, e) ? tp : n.get(t, e, s);
|
|
8723
8723
|
},
|
|
8724
8724
|
has(t, e) {
|
|
8725
|
-
return
|
|
8725
|
+
return Ro(t, e) || n.has(t, e);
|
|
8726
8726
|
}
|
|
8727
8727
|
}));
|
|
8728
8728
|
const on = {
|
|
@@ -8906,7 +8906,7 @@ function np(n, t) {
|
|
|
8906
8906
|
return (n + t) * ep;
|
|
8907
8907
|
}
|
|
8908
8908
|
const sp = 2.5, ip = 1.5;
|
|
8909
|
-
function
|
|
8909
|
+
function Dh() {
|
|
8910
8910
|
return {
|
|
8911
8911
|
meshCount: 0,
|
|
8912
8912
|
lineCount: 0,
|
|
@@ -8928,7 +8928,7 @@ const Qr = {
|
|
|
8928
8928
|
international: ["simplex", "amgdt"],
|
|
8929
8929
|
cjk: ["simplex", "amgdt"]
|
|
8930
8930
|
};
|
|
8931
|
-
function
|
|
8931
|
+
function Do(n) {
|
|
8932
8932
|
return Object.prototype.hasOwnProperty.call(Qr, n);
|
|
8933
8933
|
}
|
|
8934
8934
|
var ga = 0, Uh = -3;
|
|
@@ -10000,7 +10000,7 @@ function Fi(n) {
|
|
|
10000
10000
|
}
|
|
10001
10001
|
Fi.prototype = Object.create(gt.prototype);
|
|
10002
10002
|
Fi.prototype.constructor = Fi;
|
|
10003
|
-
var
|
|
10003
|
+
var _ = {
|
|
10004
10004
|
Table: gt,
|
|
10005
10005
|
Record: gt,
|
|
10006
10006
|
Coverage: Si,
|
|
@@ -10068,7 +10068,7 @@ var Fp = {
|
|
|
10068
10068
|
fixed: 4,
|
|
10069
10069
|
longDateTime: 8,
|
|
10070
10070
|
tag: 4
|
|
10071
|
-
},
|
|
10071
|
+
}, It = {
|
|
10072
10072
|
LONG_WORDS: 32768,
|
|
10073
10073
|
WORD_DELTA_COUNT_MASK: 32767,
|
|
10074
10074
|
SHARED_POINT_NUMBERS: 32768,
|
|
@@ -10465,7 +10465,7 @@ A.prototype.parseDeltaSetIndexMap = function() {
|
|
|
10465
10465
|
format: n,
|
|
10466
10466
|
entryFormat: t
|
|
10467
10467
|
};
|
|
10468
|
-
const i = (t &
|
|
10468
|
+
const i = (t & It.INNER_INDEX_BIT_COUNT_MASK) + 1, r = ((t & It.MAP_ENTRY_SIZE_MASK) >> 4) + 1;
|
|
10469
10469
|
for (let a = 0; a < s; a++) {
|
|
10470
10470
|
let o;
|
|
10471
10471
|
if (r === 1)
|
|
@@ -10488,7 +10488,7 @@ A.prototype.parseDeltaSetIndexMap = function() {
|
|
|
10488
10488
|
};
|
|
10489
10489
|
};
|
|
10490
10490
|
A.prototype.parseDeltaSets = function(n, t, e) {
|
|
10491
|
-
const s = Array.from({ length: n }, () => []), i = t &
|
|
10491
|
+
const s = Array.from({ length: n }, () => []), i = t & It.LONG_WORDS, r = t & It.WORD_DELTA_COUNT_MASK;
|
|
10492
10492
|
if (r > e)
|
|
10493
10493
|
throw Error("wordCount must be less than or equal to regionIndexCount");
|
|
10494
10494
|
const a = (i ? this.parseLong : this.parseShort).bind(this), o = (i ? this.parseShort : this.parseChar).bind(this);
|
|
@@ -10518,7 +10518,7 @@ A.prototype.parseTupleVariationStoreList = function(n, t, e) {
|
|
|
10518
10518
|
A.prototype.parseTupleVariationStore = function(n, t, e, s, i) {
|
|
10519
10519
|
const r = this.relativeOffset;
|
|
10520
10520
|
this.relativeOffset = n, e === "cvar" && (this.relativeOffset += 4);
|
|
10521
|
-
const a = this.parseUShort(), o = !!(a &
|
|
10521
|
+
const a = this.parseUShort(), o = !!(a & It.SHARED_POINT_NUMBERS), c = a & It.COUNT_MASK;
|
|
10522
10522
|
let h = this.parseOffset16();
|
|
10523
10523
|
const l = [];
|
|
10524
10524
|
let u = [];
|
|
@@ -10562,7 +10562,7 @@ A.prototype.parseTupleVariationStore = function(n, t, e, s, i) {
|
|
|
10562
10562
|
return p.sharedPoints = u, p;
|
|
10563
10563
|
};
|
|
10564
10564
|
A.prototype.parseTupleVariationHeader = function(n, t) {
|
|
10565
|
-
const e = this.parseUShort(), s = this.parseUShort(), i = !!(s &
|
|
10565
|
+
const e = this.parseUShort(), s = this.parseUShort(), i = !!(s & It.EMBEDDED_PEAK_TUPLE), r = !!(s & It.INTERMEDIATE_REGION), a = !!(s & It.PRIVATE_POINT_NUMBERS), o = i ? void 0 : s & It.TUPLE_INDEX_MASK, c = i ? this.parseTupleRecords(1, n)[0] : void 0, h = r ? this.parseTupleRecords(1, n)[0] : void 0, l = r ? this.parseTupleRecords(1, n)[0] : void 0, u = {
|
|
10566
10566
|
variationDataSize: e,
|
|
10567
10567
|
peakTuple: c,
|
|
10568
10568
|
intermediateStartTuple: h,
|
|
@@ -10580,12 +10580,12 @@ A.prototype.parsePackedPointNumbers = function() {
|
|
|
10580
10580
|
let e = n;
|
|
10581
10581
|
if (n >= 128) {
|
|
10582
10582
|
const i = this.parseByte();
|
|
10583
|
-
e = (n &
|
|
10583
|
+
e = (n & It.POINT_RUN_COUNT_MASK) << 8 | i;
|
|
10584
10584
|
}
|
|
10585
10585
|
let s = 0;
|
|
10586
10586
|
for (; t.length < e; ) {
|
|
10587
|
-
const i = this.parseByte(), r = !!(i &
|
|
10588
|
-
let a = (i &
|
|
10587
|
+
const i = this.parseByte(), r = !!(i & It.POINTS_ARE_WORDS);
|
|
10588
|
+
let a = (i & It.POINT_RUN_COUNT_MASK) + 1;
|
|
10589
10589
|
for (let o = 0; o < a && t.length < e; o++) {
|
|
10590
10590
|
let c;
|
|
10591
10591
|
r ? c = this.parseUShort() : c = this.parseByte(), s = s + c, t.push(s);
|
|
@@ -10596,7 +10596,7 @@ A.prototype.parsePackedPointNumbers = function() {
|
|
|
10596
10596
|
A.prototype.parsePackedDeltas = function(n) {
|
|
10597
10597
|
const t = [];
|
|
10598
10598
|
for (; t.length < n; ) {
|
|
10599
|
-
const e = this.parseByte(), s = !!(e &
|
|
10599
|
+
const e = this.parseByte(), s = !!(e & It.DELTAS_ARE_ZERO), i = !!(e & It.DELTAS_ARE_WORDS), r = (e & It.DELTA_RUN_COUNT_MASK) + 1;
|
|
10600
10600
|
for (let a = 0; a < r && t.length < n; a++)
|
|
10601
10601
|
s ? t.push(0) : i ? t.push(this.parseShort()) : t.push(this.parseChar());
|
|
10602
10602
|
}
|
|
@@ -11362,7 +11362,7 @@ var Kh = {
|
|
|
11362
11362
|
function Op(n) {
|
|
11363
11363
|
return Kh[n];
|
|
11364
11364
|
}
|
|
11365
|
-
function
|
|
11365
|
+
function Lp(n, t, e) {
|
|
11366
11366
|
const s = {}, i = new z.Parser(n, t), r = i.parseUShort(), a = i.parseUShort(), o = i.offset + i.parseUShort();
|
|
11367
11367
|
for (let c = 0; c < a; c++) {
|
|
11368
11368
|
const h = i.parseUShort(), l = i.parseUShort(), u = i.parseUShort(), f = i.parseUShort(), p = ki[f] || f, d = i.parseUShort(), g = i.parseUShort(), x = kp(h, u, e), b = ba(h, l, u), S = Op(h);
|
|
@@ -11385,7 +11385,7 @@ function ni(n) {
|
|
|
11385
11385
|
return t;
|
|
11386
11386
|
}
|
|
11387
11387
|
function qo(n, t, e, s, i, r) {
|
|
11388
|
-
return new
|
|
11388
|
+
return new _.Record("NameRecord", [
|
|
11389
11389
|
{ name: "platformID", type: "USHORT", value: n },
|
|
11390
11390
|
{ name: "encodingID", type: "USHORT", value: t },
|
|
11391
11391
|
{ name: "languageID", type: "USHORT", value: e },
|
|
@@ -11394,7 +11394,7 @@ function qo(n, t, e, s, i, r) {
|
|
|
11394
11394
|
{ name: "offset", type: "USHORT", value: r }
|
|
11395
11395
|
]);
|
|
11396
11396
|
}
|
|
11397
|
-
function
|
|
11397
|
+
function _p(n, t) {
|
|
11398
11398
|
const e = n.length, s = t.length - e + 1;
|
|
11399
11399
|
t:
|
|
11400
11400
|
for (let i = 0; i < s; i++)
|
|
@@ -11407,7 +11407,7 @@ function Lp(n, t) {
|
|
|
11407
11407
|
return -1;
|
|
11408
11408
|
}
|
|
11409
11409
|
function jo(n, t) {
|
|
11410
|
-
let e =
|
|
11410
|
+
let e = _p(n, t);
|
|
11411
11411
|
if (e < 0) {
|
|
11412
11412
|
e = t.length;
|
|
11413
11413
|
let s = 0;
|
|
@@ -11469,7 +11469,7 @@ function Ip(n, t) {
|
|
|
11469
11469
|
r.sort(function(c, h) {
|
|
11470
11470
|
return c.platformID - h.platformID || c.encodingID - h.encodingID || c.languageID - h.languageID || c.nameID - h.nameID;
|
|
11471
11471
|
});
|
|
11472
|
-
const o = new
|
|
11472
|
+
const o = new _.Table("name", [
|
|
11473
11473
|
{ name: "format", type: "USHORT", value: 0 },
|
|
11474
11474
|
{ name: "count", type: "USHORT", value: r.length },
|
|
11475
11475
|
{ name: "stringOffset", type: "USHORT", value: 6 + r.length * 12 }
|
|
@@ -11489,7 +11489,7 @@ function Ei(n, t, e = []) {
|
|
|
11489
11489
|
if (i === t || parseInt(i) === t)
|
|
11490
11490
|
return n[s][i];
|
|
11491
11491
|
}
|
|
11492
|
-
var Qh = { parse:
|
|
11492
|
+
var Qh = { parse: Lp, make: Ip, getNameByID: Ei };
|
|
11493
11493
|
function Bp(n, t, e, s) {
|
|
11494
11494
|
n.length = t.parseUShort(), n.language = t.parseUShort() - 1;
|
|
11495
11495
|
const i = t.parseByteList(n.length), r = Object.assign({}, i), a = ba(e, s, n.language), o = vi[a];
|
|
@@ -11497,7 +11497,7 @@ function Bp(n, t, e, s) {
|
|
|
11497
11497
|
r[o.charCodeAt(c)] = i[128 + c];
|
|
11498
11498
|
n.glyphIndexMap = r;
|
|
11499
11499
|
}
|
|
11500
|
-
function
|
|
11500
|
+
function Rp(n, t, e) {
|
|
11501
11501
|
t.parseUShort(), n.length = t.parseULong(), n.language = t.parseULong();
|
|
11502
11502
|
let s;
|
|
11503
11503
|
n.groupCount = s = t.parseULong(), n.glyphIndexMap = {};
|
|
@@ -11508,7 +11508,7 @@ function Dp(n, t, e) {
|
|
|
11508
11508
|
n.glyphIndexMap[c] = o, e === 12 && o++;
|
|
11509
11509
|
}
|
|
11510
11510
|
}
|
|
11511
|
-
function
|
|
11511
|
+
function Dp(n, t, e, s, i) {
|
|
11512
11512
|
n.length = t.parseUShort(), n.language = t.parseUShort();
|
|
11513
11513
|
let r;
|
|
11514
11514
|
n.segCount = r = t.parseUShort() >> 1, t.skip("uShort", 3), n.glyphIndexMap = {};
|
|
@@ -11572,9 +11572,9 @@ function Pp(n, t) {
|
|
|
11572
11572
|
if (e.format = l.parseUShort(), e.format === 0)
|
|
11573
11573
|
Bp(e, l, a, o);
|
|
11574
11574
|
else if (e.format === 12 || e.format === 13)
|
|
11575
|
-
|
|
11575
|
+
Rp(e, l, e.format);
|
|
11576
11576
|
else if (e.format === 4)
|
|
11577
|
-
|
|
11577
|
+
Dp(e, l, n, t, r);
|
|
11578
11578
|
else
|
|
11579
11579
|
throw new Error(
|
|
11580
11580
|
"Only format 0 (platformId 1, encodingId 0), 4, 12 and 14 cmap tables are supported (found format " + e.format + ", platformId " + a + ", encodingId " + o + ")."
|
|
@@ -11638,7 +11638,7 @@ function Gp(n) {
|
|
|
11638
11638
|
{ name: "entrySelector", type: "USHORT", value: 0 },
|
|
11639
11639
|
{ name: "rangeShift", type: "USHORT", value: 0 }
|
|
11640
11640
|
);
|
|
11641
|
-
const i = new
|
|
11641
|
+
const i = new _.Table("cmap", s);
|
|
11642
11642
|
for (i.segments = [], e = 0; e < n.length; e += 1) {
|
|
11643
11643
|
const p = n.get(e);
|
|
11644
11644
|
for (let d = 0; d < p.unicodes.length; d += 1)
|
|
@@ -13420,7 +13420,7 @@ function Jp(n, t) {
|
|
|
13420
13420
|
};
|
|
13421
13421
|
}
|
|
13422
13422
|
function Kp({ version: n = 0, numPaletteEntries: t = 0, colorRecords: e = [], colorRecordIndices: s = [0] }) {
|
|
13423
|
-
return V.argument(n === 0, "Only CPALv0 are supported."), V.argument(e.length, "No colorRecords given."), V.argument(s.length, "No colorRecordIndices given."), s.length > 1 && V.argument(t, "Can't infer numPaletteEntries on multiple colorRecordIndices"), new
|
|
13423
|
+
return V.argument(n === 0, "Only CPALv0 are supported."), V.argument(e.length, "No colorRecords given."), V.argument(s.length, "No colorRecordIndices given."), s.length > 1 && V.argument(t, "Can't infer numPaletteEntries on multiple colorRecordIndices"), new _.Table("CPAL", [
|
|
13424
13424
|
{ name: "version", type: "USHORT", value: n },
|
|
13425
13425
|
{ name: "numPaletteEntries", type: "USHORT", value: t || e.length },
|
|
13426
13426
|
{ name: "numPalettes", type: "USHORT", value: s.length },
|
|
@@ -13621,21 +13621,21 @@ function ed(n, t) {
|
|
|
13621
13621
|
}
|
|
13622
13622
|
};
|
|
13623
13623
|
}
|
|
13624
|
-
function
|
|
13624
|
+
function Bt(n) {
|
|
13625
13625
|
this.bindConstructorValues(n);
|
|
13626
13626
|
}
|
|
13627
|
-
|
|
13627
|
+
Bt.prototype.bindConstructorValues = function(n) {
|
|
13628
13628
|
if (this.index = n.index || 0, n.name === ".notdef" ? n.unicode = void 0 : n.name === ".null" && (n.unicode = 0), n.unicode === 0 && n.name !== ".null")
|
|
13629
13629
|
throw new Error('The unicode value "0" is reserved for the glyph name ".null" and cannot be used by any other glyph.');
|
|
13630
13630
|
this.name = n.name || null, this.unicode = n.unicode, this.unicodes = n.unicodes || (n.unicode !== void 0 ? [n.unicode] : []), "xMin" in n && (this.xMin = n.xMin), "yMin" in n && (this.yMin = n.yMin), "xMax" in n && (this.xMax = n.xMax), "yMax" in n && (this.yMax = n.yMax), "advanceWidth" in n && (this.advanceWidth = n.advanceWidth), "leftSideBearing" in n && (this.leftSideBearing = n.leftSideBearing), "points" in n && (this.points = n.points), Object.defineProperty(this, "path", ed(this, n.path));
|
|
13631
13631
|
};
|
|
13632
|
-
|
|
13632
|
+
Bt.prototype.addUnicode = function(n) {
|
|
13633
13633
|
this.unicodes.length === 0 && (this.unicode = n), this.unicodes.push(n);
|
|
13634
13634
|
};
|
|
13635
|
-
|
|
13635
|
+
Bt.prototype.getBoundingBox = function() {
|
|
13636
13636
|
return this.path.getBoundingBox();
|
|
13637
13637
|
};
|
|
13638
|
-
|
|
13638
|
+
Bt.prototype.getPath = function(n, t, e, s, i) {
|
|
13639
13639
|
n = n !== void 0 ? n : 0, t = t !== void 0 ? t : 0, e = e !== void 0 ? e : 72, s = Object.assign({}, i && i.defaultRenderOptions, s);
|
|
13640
13640
|
let r, a, o = s.xScale, c = s.yScale;
|
|
13641
13641
|
const h = 1 / (this.path.unitsPerEm || 1e3) * e;
|
|
@@ -13686,17 +13686,17 @@ It.prototype.getPath = function(n, t, e, s, i) {
|
|
|
13686
13686
|
}
|
|
13687
13687
|
return u;
|
|
13688
13688
|
};
|
|
13689
|
-
|
|
13689
|
+
Bt.prototype.getLayers = function(n) {
|
|
13690
13690
|
if (!n)
|
|
13691
13691
|
throw new Error("The font object is required to read the colr/cpal tables in order to get the layers.");
|
|
13692
13692
|
return n.layers.get(this.index);
|
|
13693
13693
|
};
|
|
13694
|
-
|
|
13694
|
+
Bt.prototype.getSvgImage = function(n) {
|
|
13695
13695
|
if (!n)
|
|
13696
13696
|
throw new Error("The font object is required to read the svg table in order to get the image.");
|
|
13697
13697
|
return n.svgImages.get(this.index);
|
|
13698
13698
|
};
|
|
13699
|
-
|
|
13699
|
+
Bt.prototype.getContours = function(n = null) {
|
|
13700
13700
|
if (this.points === void 0 && !n)
|
|
13701
13701
|
return [];
|
|
13702
13702
|
const t = [];
|
|
@@ -13707,7 +13707,7 @@ It.prototype.getContours = function(n = null) {
|
|
|
13707
13707
|
}
|
|
13708
13708
|
return V.argument(e.length === 0, "There are still points left in the current contour."), t;
|
|
13709
13709
|
};
|
|
13710
|
-
|
|
13710
|
+
Bt.prototype.getMetrics = function() {
|
|
13711
13711
|
const n = this.path.commands, t = [], e = [];
|
|
13712
13712
|
for (let i = 0; i < n.length; i += 1) {
|
|
13713
13713
|
const r = n[i];
|
|
@@ -13722,10 +13722,10 @@ It.prototype.getMetrics = function() {
|
|
|
13722
13722
|
};
|
|
13723
13723
|
return isFinite(s.xMin) || (s.xMin = 0), isFinite(s.xMax) || (s.xMax = this.advanceWidth), isFinite(s.yMin) || (s.yMin = 0), isFinite(s.yMax) || (s.yMax = 0), s.rightSideBearing = this.advanceWidth - s.leftSideBearing - (s.xMax - s.xMin), s;
|
|
13724
13724
|
};
|
|
13725
|
-
|
|
13725
|
+
Bt.prototype.draw = function(n, t, e, s, i, r) {
|
|
13726
13726
|
i = Object.assign({}, r && r.defaultRenderOptions, i), this.getPath(t, e, s, i, r).draw(n);
|
|
13727
13727
|
};
|
|
13728
|
-
|
|
13728
|
+
Bt.prototype.drawPoints = function(n, t, e, s, i, r) {
|
|
13729
13729
|
if (i = Object.assign({}, r && r.defaultRenderOptions, i), i.drawLayers) {
|
|
13730
13730
|
const f = this.getLayers(r);
|
|
13731
13731
|
if (f && f.length) {
|
|
@@ -13750,7 +13750,7 @@ It.prototype.drawPoints = function(n, t, e, s, i, r) {
|
|
|
13750
13750
|
}
|
|
13751
13751
|
n.fillStyle = "blue", a(c, t, e, o), n.fillStyle = "red", a(h, t, e, o);
|
|
13752
13752
|
};
|
|
13753
|
-
|
|
13753
|
+
Bt.prototype.drawMetrics = function(n, t, e, s) {
|
|
13754
13754
|
let i;
|
|
13755
13755
|
t = t !== void 0 ? t : 0, e = e !== void 0 ? e : 0, s = s !== void 0 ? s : 24, i = 1 / this.path.unitsPerEm * s, n.lineWidth = 1, n.strokeStyle = "black", an.line(n, t, -1e4, t, 1e4), an.line(n, -1e4, e, 1e4, e);
|
|
13756
13756
|
const r = this.xMin || 0;
|
|
@@ -13760,27 +13760,27 @@ It.prototype.drawMetrics = function(n, t, e, s) {
|
|
|
13760
13760
|
const h = this.advanceWidth || 0;
|
|
13761
13761
|
n.strokeStyle = "blue", an.line(n, t + r * i, -1e4, t + r * i, 1e4), an.line(n, t + o * i, -1e4, t + o * i, 1e4), an.line(n, -1e4, e + -a * i, 1e4, e + -a * i), an.line(n, -1e4, e + -c * i, 1e4, e + -c * i), n.strokeStyle = "green", an.line(n, t + h * i, -1e4, t + h * i, 1e4);
|
|
13762
13762
|
};
|
|
13763
|
-
|
|
13763
|
+
Bt.prototype.toPathData = function(n, t) {
|
|
13764
13764
|
n = Object.assign({}, { variation: t && t.defaultRenderOptions.variation }, n);
|
|
13765
13765
|
let e = this;
|
|
13766
13766
|
t && t.variation && (e = t.variation.getTransform(this, n.variation));
|
|
13767
13767
|
let s = e.points && n.pointsTransform ? n.pointsTransform(e.points) : e.path;
|
|
13768
13768
|
return n.pathTransform && (s = n.pathTransform(s)), s.toPathData(n);
|
|
13769
13769
|
};
|
|
13770
|
-
|
|
13770
|
+
Bt.prototype.fromSVG = function(n, t = {}) {
|
|
13771
13771
|
return this.path.fromSVG(n, t);
|
|
13772
13772
|
};
|
|
13773
|
-
|
|
13773
|
+
Bt.prototype.toSVG = function(n, t) {
|
|
13774
13774
|
const e = this.toPathData.apply(this, [n, t]);
|
|
13775
13775
|
return this.path.toSVG(n, e);
|
|
13776
13776
|
};
|
|
13777
|
-
|
|
13777
|
+
Bt.prototype.toDOMElement = function(n, t) {
|
|
13778
13778
|
n = Object.assign({}, { variation: t && t.defaultRenderOptions.variation }, n);
|
|
13779
13779
|
let e = this.path;
|
|
13780
13780
|
return t && t.variation && (e = t.variation.getTransform(this, n.variation).path), e.toDOMElement(n);
|
|
13781
13781
|
};
|
|
13782
|
-
var xs =
|
|
13783
|
-
function
|
|
13782
|
+
var xs = Bt;
|
|
13783
|
+
function Ln(n, t, e) {
|
|
13784
13784
|
Object.defineProperty(n, t, {
|
|
13785
13785
|
get: function() {
|
|
13786
13786
|
return typeof n[e] > "u" && n.path, n[e];
|
|
@@ -13835,7 +13835,7 @@ function sd(n, t, e, s, i, r) {
|
|
|
13835
13835
|
e(a, s, i);
|
|
13836
13836
|
const o = r(n.glyphs, a);
|
|
13837
13837
|
return o.unitsPerEm = n.unitsPerEm, o;
|
|
13838
|
-
},
|
|
13838
|
+
}, Ln(a, "numberOfContours", "_numberOfContours"), Ln(a, "xMin", "_xMin"), Ln(a, "xMax", "_xMax"), Ln(a, "yMin", "_yMin"), Ln(a, "yMax", "_yMax"), Ln(a, "points", "_points"), a;
|
|
13839
13839
|
};
|
|
13840
13840
|
}
|
|
13841
13841
|
function id(n, t, e, s, i) {
|
|
@@ -14171,19 +14171,19 @@ function ra(n, t, e, s, i) {
|
|
|
14171
14171
|
} else
|
|
14172
14172
|
x = I.topDict._subrs, b = I.topDict._subrsBias;
|
|
14173
14173
|
const H = ll(n, h);
|
|
14174
|
-
let
|
|
14174
|
+
let R = S;
|
|
14175
14175
|
function W(U, P) {
|
|
14176
14176
|
p && H !== 2 && h.closePath(), h.moveTo(U, P), p = !0;
|
|
14177
14177
|
}
|
|
14178
14178
|
function J() {
|
|
14179
14179
|
let U;
|
|
14180
|
-
U = (l.length & 1) !== 0, U && !f && (
|
|
14180
|
+
U = (l.length & 1) !== 0, U && !f && (R = l.shift() + v), u += l.length >> 1, l.length = 0, f = !0;
|
|
14181
14181
|
}
|
|
14182
|
-
function
|
|
14183
|
-
let P, Q, yt,
|
|
14182
|
+
function D(U) {
|
|
14183
|
+
let P, Q, yt, Pt, Ct, ut, j, rt, bt, kt, St, Tt, ht = 0;
|
|
14184
14184
|
for (; ht < U.length; ) {
|
|
14185
|
-
let
|
|
14186
|
-
switch (ht += 1,
|
|
14185
|
+
let Mt = U[ht];
|
|
14186
|
+
switch (ht += 1, Mt) {
|
|
14187
14187
|
case 1:
|
|
14188
14188
|
J();
|
|
14189
14189
|
break;
|
|
@@ -14191,7 +14191,7 @@ function ra(n, t, e, s, i) {
|
|
|
14191
14191
|
J();
|
|
14192
14192
|
break;
|
|
14193
14193
|
case 4:
|
|
14194
|
-
l.length > 1 && !f && (
|
|
14194
|
+
l.length > 1 && !f && (R = l.shift() + v, f = !0), g += l.pop(), W(d, g);
|
|
14195
14195
|
break;
|
|
14196
14196
|
case 5:
|
|
14197
14197
|
for (; l.length > 0; )
|
|
@@ -14215,7 +14215,7 @@ function ra(n, t, e, s, i) {
|
|
|
14215
14215
|
console.warn("CFF charstring subroutine call depth exceeded, skipping callsubr");
|
|
14216
14216
|
break;
|
|
14217
14217
|
}
|
|
14218
|
-
O++,
|
|
14218
|
+
O++, D(ut), O--;
|
|
14219
14219
|
}
|
|
14220
14220
|
break;
|
|
14221
14221
|
case 11:
|
|
@@ -14225,21 +14225,21 @@ function ra(n, t, e, s, i) {
|
|
|
14225
14225
|
}
|
|
14226
14226
|
return;
|
|
14227
14227
|
case 12:
|
|
14228
|
-
switch (
|
|
14228
|
+
switch (Mt = U[ht], ht += 1, Mt) {
|
|
14229
14229
|
case 35:
|
|
14230
|
-
r = d + l.shift(), a = g + l.shift(), o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c + l.shift(), bt = j + l.shift(),
|
|
14230
|
+
r = d + l.shift(), a = g + l.shift(), o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c + l.shift(), bt = j + l.shift(), kt = rt + l.shift(), St = bt + l.shift(), Tt = kt + l.shift(), d = St + l.shift(), g = Tt + l.shift(), l.shift(), h.curveTo(r, a, o, c, j, rt), h.curveTo(bt, kt, St, Tt, d, g);
|
|
14231
14231
|
break;
|
|
14232
14232
|
case 34:
|
|
14233
|
-
r = d + l.shift(), a = g, o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c, bt = j + l.shift(),
|
|
14233
|
+
r = d + l.shift(), a = g, o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c, bt = j + l.shift(), kt = c, St = bt + l.shift(), Tt = g, d = St + l.shift(), h.curveTo(r, a, o, c, j, rt), h.curveTo(bt, kt, St, Tt, d, g);
|
|
14234
14234
|
break;
|
|
14235
14235
|
case 36:
|
|
14236
|
-
r = d + l.shift(), a = g + l.shift(), o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c, bt = j + l.shift(),
|
|
14236
|
+
r = d + l.shift(), a = g + l.shift(), o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c, bt = j + l.shift(), kt = c, St = bt + l.shift(), Tt = kt + l.shift(), d = St + l.shift(), h.curveTo(r, a, o, c, j, rt), h.curveTo(bt, kt, St, Tt, d, g);
|
|
14237
14237
|
break;
|
|
14238
14238
|
case 37:
|
|
14239
|
-
r = d + l.shift(), a = g + l.shift(), o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c + l.shift(), bt = j + l.shift(),
|
|
14239
|
+
r = d + l.shift(), a = g + l.shift(), o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c + l.shift(), bt = j + l.shift(), kt = rt + l.shift(), St = bt + l.shift(), Tt = kt + l.shift(), Math.abs(St - d) > Math.abs(Tt - g) ? d = St + l.shift() : g = Tt + l.shift(), h.curveTo(r, a, o, c, j, rt), h.curveTo(bt, kt, St, Tt, d, g);
|
|
14240
14240
|
break;
|
|
14241
14241
|
default:
|
|
14242
|
-
console.log("Glyph " + t.index + ": unknown operator 1200" +
|
|
14242
|
+
console.log("Glyph " + t.index + ": unknown operator 1200" + Mt), l.length = 0;
|
|
14243
14243
|
}
|
|
14244
14244
|
break;
|
|
14245
14245
|
case 14:
|
|
@@ -14261,14 +14261,14 @@ function ra(n, t, e, s, i) {
|
|
|
14261
14261
|
dx: y,
|
|
14262
14262
|
dy: m
|
|
14263
14263
|
}), h.extend(n.glyphs.get(k).path);
|
|
14264
|
-
const
|
|
14264
|
+
const L = n.glyphs.get(T), B = JSON.parse(JSON.stringify(L.path.commands));
|
|
14265
14265
|
for (let $ = 0; $ < B.length; $ += 1) {
|
|
14266
14266
|
const Y = B[$];
|
|
14267
14267
|
Y.type !== "Z" && (Y.x += y, Y.y += m), (Y.type === "Q" || Y.type === "C") && (Y.x1 += y, Y.y1 += m), Y.type === "C" && (Y.x2 += y, Y.y2 += m);
|
|
14268
14268
|
}
|
|
14269
14269
|
h.extend(B);
|
|
14270
14270
|
}
|
|
14271
|
-
} else l.length > 0 && !f && (
|
|
14271
|
+
} else l.length > 0 && !f && (R = l.shift() + v, f = !0);
|
|
14272
14272
|
p && H !== 2 && (h.closePath(), p = !1);
|
|
14273
14273
|
break;
|
|
14274
14274
|
case 15:
|
|
@@ -14284,15 +14284,15 @@ function ra(n, t, e, s, i) {
|
|
|
14284
14284
|
break;
|
|
14285
14285
|
}
|
|
14286
14286
|
M || (M = n.variation && i && n.variation.process.getBlendVector(F, w, i));
|
|
14287
|
-
var tt = l.pop(),
|
|
14287
|
+
var tt = l.pop(), Et = M ? M.length : F.itemVariationSubtables[w].regionIndexes.length, Nt = tt * Et, zt = l.length - Nt, Ht = zt - tt;
|
|
14288
14288
|
if (M)
|
|
14289
14289
|
for (let Ce = 0; Ce < tt; Ce++) {
|
|
14290
|
-
var Vt = l[
|
|
14291
|
-
for (let C = 0; C <
|
|
14292
|
-
Vt += M[C] * l[
|
|
14293
|
-
l[
|
|
14290
|
+
var Vt = l[Ht + Ce];
|
|
14291
|
+
for (let C = 0; C < Et; C++)
|
|
14292
|
+
Vt += M[C] * l[zt++];
|
|
14293
|
+
l[Ht + Ce] = Vt;
|
|
14294
14294
|
}
|
|
14295
|
-
for (;
|
|
14295
|
+
for (; Nt--; )
|
|
14296
14296
|
l.pop();
|
|
14297
14297
|
break;
|
|
14298
14298
|
case 18:
|
|
@@ -14303,10 +14303,10 @@ function ra(n, t, e, s, i) {
|
|
|
14303
14303
|
J(), ht += u + 7 >> 3;
|
|
14304
14304
|
break;
|
|
14305
14305
|
case 21:
|
|
14306
|
-
l.length > 2 && !f && (
|
|
14306
|
+
l.length > 2 && !f && (R = l.shift() + v, f = !0), g += l.pop(), d += l.pop(), W(d, g);
|
|
14307
14307
|
break;
|
|
14308
14308
|
case 22:
|
|
14309
|
-
l.length > 1 && !f && (
|
|
14309
|
+
l.length > 1 && !f && (R = l.shift() + v, f = !0), d += l.pop(), W(d, g);
|
|
14310
14310
|
break;
|
|
14311
14311
|
case 23:
|
|
14312
14312
|
J();
|
|
@@ -14338,7 +14338,7 @@ function ra(n, t, e, s, i) {
|
|
|
14338
14338
|
console.warn("CFF charstring subroutine call depth exceeded, skipping callgsubr");
|
|
14339
14339
|
break;
|
|
14340
14340
|
}
|
|
14341
|
-
O++,
|
|
14341
|
+
O++, D(ut), O--;
|
|
14342
14342
|
}
|
|
14343
14343
|
break;
|
|
14344
14344
|
case 30:
|
|
@@ -14350,18 +14350,18 @@ function ra(n, t, e, s, i) {
|
|
|
14350
14350
|
r = d, a = g + l.shift(), o = r + l.shift(), c = a + l.shift(), d = o + l.shift(), g = c + (l.length === 1 ? l.shift() : 0), h.curveTo(r, a, o, c, d, g);
|
|
14351
14351
|
break;
|
|
14352
14352
|
default:
|
|
14353
|
-
|
|
14353
|
+
Mt < 32 ? console.log("Glyph " + t.index + ": unknown operator " + Mt) : Mt < 247 ? l.push(Mt - 139) : Mt < 251 ? (P = U[ht], ht += 1, l.push((Mt - 247) * 256 + P + 108)) : Mt < 255 ? (P = U[ht], ht += 1, l.push(-(Mt - 251) * 256 - P - 108)) : (P = U[ht], Q = U[ht + 1], yt = U[ht + 2], Pt = U[ht + 3], ht += 4, l.push((P << 24 | Q << 16 | yt << 8 | Pt) / 65536));
|
|
14354
14354
|
}
|
|
14355
14355
|
}
|
|
14356
14356
|
}
|
|
14357
|
-
return
|
|
14357
|
+
return D(e), n.variation && i && (h.commands = h.commands.map((U) => {
|
|
14358
14358
|
const P = Object.keys(U);
|
|
14359
14359
|
for (let Q = 0; Q < P.length; Q++) {
|
|
14360
14360
|
const yt = P[Q];
|
|
14361
14361
|
yt !== "type" && (U[yt] = Math.round(U[yt]));
|
|
14362
14362
|
}
|
|
14363
14363
|
return U;
|
|
14364
|
-
})), f && (t.advanceWidth =
|
|
14364
|
+
})), f && (t.advanceWidth = R), h;
|
|
14365
14365
|
}
|
|
14366
14366
|
function Yo(n, t, e, s, i) {
|
|
14367
14367
|
const r = [];
|
|
@@ -14457,7 +14457,7 @@ function ul(n, t) {
|
|
|
14457
14457
|
return s >= 0 && (e = s), s = t.indexOf(n), s >= 0 ? e = s + ci.length : (e = ci.length + t.length, t.push(n)), e;
|
|
14458
14458
|
}
|
|
14459
14459
|
function Sd() {
|
|
14460
|
-
return new
|
|
14460
|
+
return new _.Record("Header", [
|
|
14461
14461
|
{ name: "major", type: "Card8", value: 1 },
|
|
14462
14462
|
{ name: "minor", type: "Card8", value: 0 },
|
|
14463
14463
|
{ name: "hdrSize", type: "Card8", value: 4 },
|
|
@@ -14465,7 +14465,7 @@ function Sd() {
|
|
|
14465
14465
|
]);
|
|
14466
14466
|
}
|
|
14467
14467
|
function wd(n) {
|
|
14468
|
-
const t = new
|
|
14468
|
+
const t = new _.Record("Name INDEX", [
|
|
14469
14469
|
{ name: "names", type: "INDEX", value: [] }
|
|
14470
14470
|
]);
|
|
14471
14471
|
t.names = [];
|
|
@@ -14483,19 +14483,19 @@ function fl(n, t, e) {
|
|
|
14483
14483
|
return s;
|
|
14484
14484
|
}
|
|
14485
14485
|
function $o(n, t, e) {
|
|
14486
|
-
const s = new
|
|
14486
|
+
const s = new _.Record("Top DICT", [
|
|
14487
14487
|
{ name: "dict", type: "DICT", value: {} }
|
|
14488
14488
|
]);
|
|
14489
14489
|
return s.dict = fl(cl, n, t), s;
|
|
14490
14490
|
}
|
|
14491
14491
|
function Zo(n) {
|
|
14492
|
-
const t = new
|
|
14492
|
+
const t = new _.Record("Top DICT INDEX", [
|
|
14493
14493
|
{ name: "topDicts", type: "INDEX", value: [] }
|
|
14494
14494
|
]);
|
|
14495
14495
|
return t.topDicts = [{ name: "topDict_0", type: "TABLE", value: n }], t;
|
|
14496
14496
|
}
|
|
14497
14497
|
function Cd(n) {
|
|
14498
|
-
const t = new
|
|
14498
|
+
const t = new _.Record("String INDEX", [
|
|
14499
14499
|
{ name: "strings", type: "INDEX", value: [] }
|
|
14500
14500
|
]);
|
|
14501
14501
|
t.strings = [];
|
|
@@ -14504,12 +14504,12 @@ function Cd(n) {
|
|
|
14504
14504
|
return t;
|
|
14505
14505
|
}
|
|
14506
14506
|
function Td() {
|
|
14507
|
-
return new
|
|
14507
|
+
return new _.Record("Global Subr INDEX", [
|
|
14508
14508
|
{ name: "subrs", type: "INDEX", value: [] }
|
|
14509
14509
|
]);
|
|
14510
14510
|
}
|
|
14511
14511
|
function Fd(n, t) {
|
|
14512
|
-
const e = new
|
|
14512
|
+
const e = new _.Record("Charsets", [
|
|
14513
14513
|
{ name: "format", type: "Card8", value: 0 }
|
|
14514
14514
|
]);
|
|
14515
14515
|
for (let s = 0; s < n.length; s += 1) {
|
|
@@ -14548,7 +14548,7 @@ function Ad(n, t) {
|
|
|
14548
14548
|
return e.push({ name: "endchar", type: "OP", value: 14 }), e;
|
|
14549
14549
|
}
|
|
14550
14550
|
function kd(n, t) {
|
|
14551
|
-
const e = new
|
|
14551
|
+
const e = new _.Record("CharStrings INDEX", [
|
|
14552
14552
|
{ name: "charStrings", type: "INDEX", value: [] }
|
|
14553
14553
|
]);
|
|
14554
14554
|
for (let s = 0; s < n.length; s += 1) {
|
|
@@ -14558,13 +14558,13 @@ function kd(n, t) {
|
|
|
14558
14558
|
return e;
|
|
14559
14559
|
}
|
|
14560
14560
|
function Ed(n, t, e) {
|
|
14561
|
-
const s = new
|
|
14561
|
+
const s = new _.Record("Private DICT", [
|
|
14562
14562
|
{ name: "dict", type: "DICT", value: {} }
|
|
14563
14563
|
]);
|
|
14564
14564
|
return s.dict = fl(hl, n, t), s;
|
|
14565
14565
|
}
|
|
14566
14566
|
function Md(n, t) {
|
|
14567
|
-
const e = new
|
|
14567
|
+
const e = new _.Table("CFF ", [
|
|
14568
14568
|
{ name: "header", type: "RECORD" },
|
|
14569
14569
|
{ name: "nameIndex", type: "RECORD" },
|
|
14570
14570
|
{ name: "topDictIndex", type: "RECORD" },
|
|
@@ -14602,10 +14602,10 @@ function Od(n, t) {
|
|
|
14602
14602
|
const e = {}, s = new z.Parser(n, t);
|
|
14603
14603
|
return e.version = s.parseVersion(), e.fontRevision = Math.round(s.parseFixed() * 1e3) / 1e3, e.checkSumAdjustment = s.parseULong(), e.magicNumber = s.parseULong(), V.argument(e.magicNumber === 1594834165, "Font header has wrong magic number."), e.flags = s.parseUShort(), e.unitsPerEm = s.parseUShort(), e.created = s.parseLongDateTime(), e.modified = s.parseLongDateTime(), e.xMin = s.parseShort(), e.yMin = s.parseShort(), e.xMax = s.parseShort(), e.yMax = s.parseShort(), e.macStyle = s.parseUShort(), e.lowestRecPPEM = s.parseUShort(), e.fontDirectionHint = s.parseShort(), e.indexToLocFormat = s.parseShort(), e.glyphDataFormat = s.parseShort(), e;
|
|
14604
14604
|
}
|
|
14605
|
-
function
|
|
14605
|
+
function Ld(n) {
|
|
14606
14606
|
const t = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3) + 2082844800;
|
|
14607
14607
|
let e = t, s = n.macStyle || 0;
|
|
14608
|
-
return n.createdTimestamp && (e = n.createdTimestamp + 2082844800), new
|
|
14608
|
+
return n.createdTimestamp && (e = n.createdTimestamp + 2082844800), new _.Table("head", [
|
|
14609
14609
|
{ name: "version", type: "FIXED", value: 65536 },
|
|
14610
14610
|
{ name: "fontRevision", type: "FIXED", value: 65536 },
|
|
14611
14611
|
{ name: "checkSumAdjustment", type: "ULONG", value: 0 },
|
|
@@ -14625,13 +14625,13 @@ function _d(n) {
|
|
|
14625
14625
|
{ name: "glyphDataFormat", type: "SHORT", value: 0 }
|
|
14626
14626
|
], n);
|
|
14627
14627
|
}
|
|
14628
|
-
var pl = { parse: Od, make:
|
|
14629
|
-
function
|
|
14628
|
+
var pl = { parse: Od, make: Ld };
|
|
14629
|
+
function _d(n, t) {
|
|
14630
14630
|
const e = {}, s = new z.Parser(n, t);
|
|
14631
14631
|
return e.version = s.parseVersion(), e.ascender = s.parseShort(), e.descender = s.parseShort(), e.lineGap = s.parseShort(), e.advanceWidthMax = s.parseUShort(), e.minLeftSideBearing = s.parseShort(), e.minRightSideBearing = s.parseShort(), e.xMaxExtent = s.parseShort(), e.caretSlopeRise = s.parseShort(), e.caretSlopeRun = s.parseShort(), e.caretOffset = s.parseShort(), s.relativeOffset += 8, e.metricDataFormat = s.parseShort(), e.numberOfHMetrics = s.parseUShort(), e;
|
|
14632
14632
|
}
|
|
14633
14633
|
function Id(n) {
|
|
14634
|
-
return new
|
|
14634
|
+
return new _.Table("hhea", [
|
|
14635
14635
|
{ name: "version", type: "FIXED", value: 65536 },
|
|
14636
14636
|
{ name: "ascender", type: "FWORD", value: 0 },
|
|
14637
14637
|
{ name: "descender", type: "FWORD", value: 0 },
|
|
@@ -14651,7 +14651,7 @@ function Id(n) {
|
|
|
14651
14651
|
{ name: "numberOfHMetrics", type: "USHORT", value: 0 }
|
|
14652
14652
|
], n);
|
|
14653
14653
|
}
|
|
14654
|
-
var dl = { parse:
|
|
14654
|
+
var dl = { parse: _d, make: Id };
|
|
14655
14655
|
function Bd(n, t, e, s, i) {
|
|
14656
14656
|
let r, a;
|
|
14657
14657
|
const o = new z.Parser(n, t);
|
|
@@ -14661,7 +14661,7 @@ function Bd(n, t, e, s, i) {
|
|
|
14661
14661
|
h.advanceWidth = r, h.leftSideBearing = a;
|
|
14662
14662
|
}
|
|
14663
14663
|
}
|
|
14664
|
-
function
|
|
14664
|
+
function Rd(n, t, e, s, i) {
|
|
14665
14665
|
n._hmtxTableData = {};
|
|
14666
14666
|
let r, a;
|
|
14667
14667
|
const o = new z.Parser(t, e);
|
|
@@ -14671,20 +14671,20 @@ function Dd(n, t, e, s, i) {
|
|
|
14671
14671
|
leftSideBearing: a
|
|
14672
14672
|
};
|
|
14673
14673
|
}
|
|
14674
|
-
function
|
|
14675
|
-
a.lowMemory ?
|
|
14674
|
+
function Dd(n, t, e, s, i, r, a) {
|
|
14675
|
+
a.lowMemory ? Rd(n, t, e, s, i) : Bd(t, e, s, i, r);
|
|
14676
14676
|
}
|
|
14677
14677
|
function Ud(n) {
|
|
14678
|
-
const t = new
|
|
14678
|
+
const t = new _.Table("hmtx", []);
|
|
14679
14679
|
for (let e = 0; e < n.length; e += 1) {
|
|
14680
14680
|
const s = n.get(e), i = s.advanceWidth || 0, r = s.leftSideBearing || 0;
|
|
14681
14681
|
t.fields.push({ name: "advanceWidth_" + e, type: "USHORT", value: i }), t.fields.push({ name: "leftSideBearing_" + e, type: "SHORT", value: r });
|
|
14682
14682
|
}
|
|
14683
14683
|
return t;
|
|
14684
14684
|
}
|
|
14685
|
-
var gl = { parse:
|
|
14685
|
+
var gl = { parse: Dd, make: Ud };
|
|
14686
14686
|
function Pd(n) {
|
|
14687
|
-
const t = new
|
|
14687
|
+
const t = new _.Table("ltag", [
|
|
14688
14688
|
{ name: "version", type: "ULONG", value: 1 },
|
|
14689
14689
|
{ name: "flags", type: "ULONG", value: 0 },
|
|
14690
14690
|
{ name: "numTags", type: "ULONG", value: n.length }
|
|
@@ -14716,7 +14716,7 @@ function zd(n, t) {
|
|
|
14716
14716
|
return e.version = s.parseVersion(), e.numGlyphs = s.parseUShort(), e.version === 1 && (e.maxPoints = s.parseUShort(), e.maxContours = s.parseUShort(), e.maxCompositePoints = s.parseUShort(), e.maxCompositeContours = s.parseUShort(), e.maxZones = s.parseUShort(), e.maxTwilightPoints = s.parseUShort(), e.maxStorage = s.parseUShort(), e.maxFunctionDefs = s.parseUShort(), e.maxInstructionDefs = s.parseUShort(), e.maxStackElements = s.parseUShort(), e.maxSizeOfInstructions = s.parseUShort(), e.maxComponentElements = s.parseUShort(), e.maxComponentDepth = s.parseUShort()), e;
|
|
14717
14717
|
}
|
|
14718
14718
|
function Hd(n) {
|
|
14719
|
-
return new
|
|
14719
|
+
return new _.Table("maxp", [
|
|
14720
14720
|
{ name: "version", type: "FIXED", value: 20480 },
|
|
14721
14721
|
{ name: "numGlyphs", type: "USHORT", value: n }
|
|
14722
14722
|
]);
|
|
@@ -14985,7 +14985,7 @@ function Vd(n, t) {
|
|
|
14985
14985
|
return e.ulUnicodeRange1 = s.parseULong(), e.ulUnicodeRange2 = s.parseULong(), e.ulUnicodeRange3 = s.parseULong(), e.ulUnicodeRange4 = s.parseULong(), e.achVendID = String.fromCharCode(s.parseByte(), s.parseByte(), s.parseByte(), s.parseByte()), e.fsSelection = s.parseUShort(), e.usFirstCharIndex = s.parseUShort(), e.usLastCharIndex = s.parseUShort(), e.sTypoAscender = s.parseShort(), e.sTypoDescender = s.parseShort(), e.sTypoLineGap = s.parseShort(), e.usWinAscent = s.parseUShort(), e.usWinDescent = s.parseUShort(), e.version >= 1 && (e.ulCodePageRange1 = s.parseULong(), e.ulCodePageRange2 = s.parseULong()), e.version >= 2 && (e.sxHeight = s.parseShort(), e.sCapHeight = s.parseShort(), e.usDefaultChar = s.parseUShort(), e.usBreakChar = s.parseUShort(), e.usMaxContent = s.parseUShort()), e;
|
|
14986
14986
|
}
|
|
14987
14987
|
function Wd(n) {
|
|
14988
|
-
return new
|
|
14988
|
+
return new _.Table("OS/2", [
|
|
14989
14989
|
{ name: "version", type: "USHORT", value: 3 },
|
|
14990
14990
|
{ name: "xAvgCharWidth", type: "SHORT", value: 0 },
|
|
14991
14991
|
{ name: "usWeightClass", type: "USHORT", value: 0 },
|
|
@@ -15071,7 +15071,7 @@ function jd(n) {
|
|
|
15071
15071
|
minMemType1: o = 0,
|
|
15072
15072
|
maxMemType1: c = 0
|
|
15073
15073
|
} = n.tables.post || {};
|
|
15074
|
-
return new
|
|
15074
|
+
return new _.Table("post", [
|
|
15075
15075
|
{ name: "version", type: "FIXED", value: 196608 },
|
|
15076
15076
|
{ name: "italicAngle", type: "FIXED", value: t },
|
|
15077
15077
|
{ name: "underlinePosition", type: "FWORD", value: e },
|
|
@@ -15250,77 +15250,77 @@ function Xd(n, t) {
|
|
|
15250
15250
|
var yn = new Array(9);
|
|
15251
15251
|
yn[1] = function(t) {
|
|
15252
15252
|
if (t.substFormat === 1)
|
|
15253
|
-
return new
|
|
15253
|
+
return new _.Table("substitutionTable", [
|
|
15254
15254
|
{ name: "substFormat", type: "USHORT", value: 1 },
|
|
15255
|
-
{ name: "coverage", type: "TABLE", value: new
|
|
15255
|
+
{ name: "coverage", type: "TABLE", value: new _.Coverage(t.coverage) },
|
|
15256
15256
|
{ name: "deltaGlyphID", type: "SHORT", value: t.deltaGlyphId }
|
|
15257
15257
|
]);
|
|
15258
15258
|
if (t.substFormat === 2)
|
|
15259
|
-
return new
|
|
15259
|
+
return new _.Table("substitutionTable", [
|
|
15260
15260
|
{ name: "substFormat", type: "USHORT", value: 2 },
|
|
15261
|
-
{ name: "coverage", type: "TABLE", value: new
|
|
15262
|
-
].concat(
|
|
15261
|
+
{ name: "coverage", type: "TABLE", value: new _.Coverage(t.coverage) }
|
|
15262
|
+
].concat(_.ushortList("substitute", t.substitute)));
|
|
15263
15263
|
V.fail("Lookup type 1 substFormat must be 1 or 2.");
|
|
15264
15264
|
};
|
|
15265
15265
|
yn[2] = function(t) {
|
|
15266
|
-
return V.assert(t.substFormat === 1, "Lookup type 2 substFormat must be 1."), new
|
|
15266
|
+
return V.assert(t.substFormat === 1, "Lookup type 2 substFormat must be 1."), new _.Table("substitutionTable", [
|
|
15267
15267
|
{ name: "substFormat", type: "USHORT", value: 1 },
|
|
15268
|
-
{ name: "coverage", type: "TABLE", value: new
|
|
15269
|
-
].concat(
|
|
15270
|
-
return new
|
|
15268
|
+
{ name: "coverage", type: "TABLE", value: new _.Coverage(t.coverage) }
|
|
15269
|
+
].concat(_.tableList("seqSet", t.sequences, function(e) {
|
|
15270
|
+
return new _.Table("sequenceSetTable", _.ushortList("sequence", e));
|
|
15271
15271
|
})));
|
|
15272
15272
|
};
|
|
15273
15273
|
yn[3] = function(t) {
|
|
15274
|
-
return V.assert(t.substFormat === 1, "Lookup type 3 substFormat must be 1."), new
|
|
15274
|
+
return V.assert(t.substFormat === 1, "Lookup type 3 substFormat must be 1."), new _.Table("substitutionTable", [
|
|
15275
15275
|
{ name: "substFormat", type: "USHORT", value: 1 },
|
|
15276
|
-
{ name: "coverage", type: "TABLE", value: new
|
|
15277
|
-
].concat(
|
|
15278
|
-
return new
|
|
15276
|
+
{ name: "coverage", type: "TABLE", value: new _.Coverage(t.coverage) }
|
|
15277
|
+
].concat(_.tableList("altSet", t.alternateSets, function(e) {
|
|
15278
|
+
return new _.Table("alternateSetTable", _.ushortList("alternate", e));
|
|
15279
15279
|
})));
|
|
15280
15280
|
};
|
|
15281
15281
|
yn[4] = function(t) {
|
|
15282
|
-
return V.assert(t.substFormat === 1, "Lookup type 4 substFormat must be 1."), new
|
|
15282
|
+
return V.assert(t.substFormat === 1, "Lookup type 4 substFormat must be 1."), new _.Table("substitutionTable", [
|
|
15283
15283
|
{ name: "substFormat", type: "USHORT", value: 1 },
|
|
15284
|
-
{ name: "coverage", type: "TABLE", value: new
|
|
15285
|
-
].concat(
|
|
15286
|
-
return new
|
|
15287
|
-
return new
|
|
15284
|
+
{ name: "coverage", type: "TABLE", value: new _.Coverage(t.coverage) }
|
|
15285
|
+
].concat(_.tableList("ligSet", t.ligatureSets, function(e) {
|
|
15286
|
+
return new _.Table("ligatureSetTable", _.tableList("ligature", e, function(s) {
|
|
15287
|
+
return new _.Table(
|
|
15288
15288
|
"ligatureTable",
|
|
15289
|
-
[{ name: "ligGlyph", type: "USHORT", value: s.ligGlyph }].concat(
|
|
15289
|
+
[{ name: "ligGlyph", type: "USHORT", value: s.ligGlyph }].concat(_.ushortList("component", s.components, s.components.length + 1))
|
|
15290
15290
|
);
|
|
15291
15291
|
}));
|
|
15292
15292
|
})));
|
|
15293
15293
|
};
|
|
15294
15294
|
yn[5] = function(t) {
|
|
15295
15295
|
if (t.substFormat === 1)
|
|
15296
|
-
return new
|
|
15296
|
+
return new _.Table("contextualSubstitutionTable", [
|
|
15297
15297
|
{ name: "substFormat", type: "USHORT", value: t.substFormat },
|
|
15298
|
-
{ name: "coverage", type: "TABLE", value: new
|
|
15299
|
-
].concat(
|
|
15300
|
-
return e ? new
|
|
15301
|
-
let i =
|
|
15298
|
+
{ name: "coverage", type: "TABLE", value: new _.Coverage(t.coverage) }
|
|
15299
|
+
].concat(_.tableList("sequenceRuleSet", t.ruleSets, function(e) {
|
|
15300
|
+
return e ? new _.Table("sequenceRuleSetTable", _.tableList("sequenceRule", e, function(s) {
|
|
15301
|
+
let i = _.ushortList("seqLookup", [], s.lookupRecords.length).concat(_.ushortList("inputSequence", s.input, s.input.length + 1));
|
|
15302
15302
|
[i[0], i[1]] = [i[1], i[0]];
|
|
15303
15303
|
for (let r = 0; r < s.lookupRecords.length; r++) {
|
|
15304
15304
|
const a = s.lookupRecords[r];
|
|
15305
15305
|
i = i.concat({ name: "sequenceIndex" + r, type: "USHORT", value: a.sequenceIndex }).concat({ name: "lookupListIndex" + r, type: "USHORT", value: a.lookupListIndex });
|
|
15306
15306
|
}
|
|
15307
|
-
return new
|
|
15308
|
-
})) : new
|
|
15307
|
+
return new _.Table("sequenceRuleTable", i);
|
|
15308
|
+
})) : new _.Table("NULL", null);
|
|
15309
15309
|
})));
|
|
15310
15310
|
if (t.substFormat === 2)
|
|
15311
|
-
return new
|
|
15311
|
+
return new _.Table("contextualSubstitutionTable", [
|
|
15312
15312
|
{ name: "substFormat", type: "USHORT", value: t.substFormat },
|
|
15313
|
-
{ name: "coverage", type: "TABLE", value: new
|
|
15314
|
-
{ name: "classDef", type: "TABLE", value: new
|
|
15315
|
-
].concat(
|
|
15316
|
-
return e ? new
|
|
15317
|
-
let i =
|
|
15313
|
+
{ name: "coverage", type: "TABLE", value: new _.Coverage(t.coverage) },
|
|
15314
|
+
{ name: "classDef", type: "TABLE", value: new _.ClassDef(t.classDef) }
|
|
15315
|
+
].concat(_.tableList("classSeqRuleSet", t.classSets, function(e) {
|
|
15316
|
+
return e ? new _.Table("classSeqRuleSetTable", _.tableList("classSeqRule", e, function(s) {
|
|
15317
|
+
let i = _.ushortList("classes", s.classes, s.classes.length + 1).concat(_.ushortList("seqLookupCount", [], s.lookupRecords.length));
|
|
15318
15318
|
for (let r = 0; r < s.lookupRecords.length; r++) {
|
|
15319
15319
|
const a = s.lookupRecords[r];
|
|
15320
15320
|
i = i.concat({ name: "sequenceIndex" + r, type: "USHORT", value: a.sequenceIndex }).concat({ name: "lookupListIndex" + r, type: "USHORT", value: a.lookupListIndex });
|
|
15321
15321
|
}
|
|
15322
|
-
return new
|
|
15323
|
-
})) : new
|
|
15322
|
+
return new _.Table("classSeqRuleTable", i);
|
|
15323
|
+
})) : new _.Table("NULL", null);
|
|
15324
15324
|
})));
|
|
15325
15325
|
if (t.substFormat === 3) {
|
|
15326
15326
|
let e = [
|
|
@@ -15329,29 +15329,29 @@ yn[5] = function(t) {
|
|
|
15329
15329
|
e.push({ name: "inputGlyphCount", type: "USHORT", value: t.coverages.length }), e.push({ name: "substitutionCount", type: "USHORT", value: t.lookupRecords.length });
|
|
15330
15330
|
for (let i = 0; i < t.coverages.length; i++) {
|
|
15331
15331
|
const r = t.coverages[i];
|
|
15332
|
-
e.push({ name: "inputCoverage" + i, type: "TABLE", value: new
|
|
15332
|
+
e.push({ name: "inputCoverage" + i, type: "TABLE", value: new _.Coverage(r) });
|
|
15333
15333
|
}
|
|
15334
15334
|
for (let i = 0; i < t.lookupRecords.length; i++) {
|
|
15335
15335
|
const r = t.lookupRecords[i];
|
|
15336
15336
|
e = e.concat({ name: "sequenceIndex" + i, type: "USHORT", value: r.sequenceIndex }).concat({ name: "lookupListIndex" + i, type: "USHORT", value: r.lookupListIndex });
|
|
15337
15337
|
}
|
|
15338
|
-
return new
|
|
15338
|
+
return new _.Table("contextualSubstitutionTable", e);
|
|
15339
15339
|
}
|
|
15340
15340
|
V.assert(!1, "lookup type 5 format must be 1, 2 or 3.");
|
|
15341
15341
|
};
|
|
15342
15342
|
yn[6] = function(t) {
|
|
15343
15343
|
if (t.substFormat === 1)
|
|
15344
|
-
return new
|
|
15344
|
+
return new _.Table("chainContextTable", [
|
|
15345
15345
|
{ name: "substFormat", type: "USHORT", value: t.substFormat },
|
|
15346
|
-
{ name: "coverage", type: "TABLE", value: new
|
|
15347
|
-
].concat(
|
|
15348
|
-
return new
|
|
15349
|
-
let r =
|
|
15346
|
+
{ name: "coverage", type: "TABLE", value: new _.Coverage(t.coverage) }
|
|
15347
|
+
].concat(_.tableList("chainRuleSet", t.chainRuleSets, function(s) {
|
|
15348
|
+
return new _.Table("chainRuleSetTable", _.tableList("chainRule", s, function(i) {
|
|
15349
|
+
let r = _.ushortList("backtrackGlyph", i.backtrack, i.backtrack.length).concat(_.ushortList("inputGlyph", i.input, i.input.length + 1)).concat(_.ushortList("lookaheadGlyph", i.lookahead, i.lookahead.length)).concat(_.ushortList("substitution", [], i.lookupRecords.length));
|
|
15350
15350
|
for (let a = 0; a < i.lookupRecords.length; a++) {
|
|
15351
15351
|
const o = i.lookupRecords[a];
|
|
15352
15352
|
r = r.concat({ name: "sequenceIndex" + a, type: "USHORT", value: o.sequenceIndex }).concat({ name: "lookupListIndex" + a, type: "USHORT", value: o.lookupListIndex });
|
|
15353
15353
|
}
|
|
15354
|
-
return new
|
|
15354
|
+
return new _.Table("chainRuleTable", r);
|
|
15355
15355
|
}));
|
|
15356
15356
|
})));
|
|
15357
15357
|
if (t.substFormat === 2)
|
|
@@ -15363,33 +15363,33 @@ yn[6] = function(t) {
|
|
|
15363
15363
|
e.push({ name: "backtrackGlyphCount", type: "USHORT", value: t.backtrackCoverage.length });
|
|
15364
15364
|
for (let i = 0; i < t.backtrackCoverage.length; i++) {
|
|
15365
15365
|
const r = t.backtrackCoverage[i];
|
|
15366
|
-
e.push({ name: "backtrackCoverage" + i, type: "TABLE", value: new
|
|
15366
|
+
e.push({ name: "backtrackCoverage" + i, type: "TABLE", value: new _.Coverage(r) });
|
|
15367
15367
|
}
|
|
15368
15368
|
e.push({ name: "inputGlyphCount", type: "USHORT", value: t.inputCoverage.length });
|
|
15369
15369
|
for (let i = 0; i < t.inputCoverage.length; i++) {
|
|
15370
15370
|
const r = t.inputCoverage[i];
|
|
15371
|
-
e.push({ name: "inputCoverage" + i, type: "TABLE", value: new
|
|
15371
|
+
e.push({ name: "inputCoverage" + i, type: "TABLE", value: new _.Coverage(r) });
|
|
15372
15372
|
}
|
|
15373
15373
|
e.push({ name: "lookaheadGlyphCount", type: "USHORT", value: t.lookaheadCoverage.length });
|
|
15374
15374
|
for (let i = 0; i < t.lookaheadCoverage.length; i++) {
|
|
15375
15375
|
const r = t.lookaheadCoverage[i];
|
|
15376
|
-
e.push({ name: "lookaheadCoverage" + i, type: "TABLE", value: new
|
|
15376
|
+
e.push({ name: "lookaheadCoverage" + i, type: "TABLE", value: new _.Coverage(r) });
|
|
15377
15377
|
}
|
|
15378
15378
|
e.push({ name: "substitutionCount", type: "USHORT", value: t.lookupRecords.length });
|
|
15379
15379
|
for (let i = 0; i < t.lookupRecords.length; i++) {
|
|
15380
15380
|
const r = t.lookupRecords[i];
|
|
15381
15381
|
e = e.concat({ name: "sequenceIndex" + i, type: "USHORT", value: r.sequenceIndex }).concat({ name: "lookupListIndex" + i, type: "USHORT", value: r.lookupListIndex });
|
|
15382
15382
|
}
|
|
15383
|
-
return new
|
|
15383
|
+
return new _.Table("chainContextTable", e);
|
|
15384
15384
|
}
|
|
15385
15385
|
V.assert(!1, "lookup type 6 format must be 1, 2 or 3.");
|
|
15386
15386
|
};
|
|
15387
15387
|
function Yd(n) {
|
|
15388
|
-
return new
|
|
15388
|
+
return new _.Table("GSUB", [
|
|
15389
15389
|
{ name: "version", type: "ULONG", value: 65536 },
|
|
15390
|
-
{ name: "scripts", type: "TABLE", value: new
|
|
15391
|
-
{ name: "features", type: "TABLE", value: new
|
|
15392
|
-
{ name: "lookups", type: "TABLE", value: new
|
|
15390
|
+
{ name: "scripts", type: "TABLE", value: new _.ScriptList(n.scripts) },
|
|
15391
|
+
{ name: "features", type: "TABLE", value: new _.FeatureList(n.features) },
|
|
15392
|
+
{ name: "lookups", type: "TABLE", value: new _.LookupList(n.lookups, yn) }
|
|
15393
15393
|
]);
|
|
15394
15394
|
}
|
|
15395
15395
|
var bl = { parse: Xd, make: Yd };
|
|
@@ -15409,7 +15409,7 @@ function $d(n, t) {
|
|
|
15409
15409
|
function Zd(n) {
|
|
15410
15410
|
const t = Object.keys(n).length;
|
|
15411
15411
|
let e = "";
|
|
15412
|
-
const s = 16 + t * 12, i = new
|
|
15412
|
+
const s = 16 + t * 12, i = new _.Table("meta", [
|
|
15413
15413
|
{ name: "version", type: "ULONG", value: 1 },
|
|
15414
15414
|
{ name: "flags", type: "ULONG", value: 0 },
|
|
15415
15415
|
{ name: "offset", type: "ULONG", value: s },
|
|
@@ -15446,7 +15446,7 @@ function Jd(n, t) {
|
|
|
15446
15446
|
function Kd({ version: n = 0, baseGlyphRecords: t = [], layerRecords: e = [] }) {
|
|
15447
15447
|
V.argument(n === 0, "Only COLRv0 supported.");
|
|
15448
15448
|
const s = 14, i = s + t.length * 6;
|
|
15449
|
-
return new
|
|
15449
|
+
return new _.Table("COLR", [
|
|
15450
15450
|
{ name: "version", type: "USHORT", value: n },
|
|
15451
15451
|
{ name: "numBaseGlyphRecords", type: "USHORT", value: t.length },
|
|
15452
15452
|
{ name: "baseGlyphRecordsOffset", type: "ULONG", value: s },
|
|
@@ -15510,7 +15510,7 @@ function n0(n, t, e, s, i) {
|
|
|
15510
15510
|
return r.postScriptNameID = c == 65535 ? void 0 : c, r.postScriptName = r.postScriptNameID !== void 0 ? Ei(s, c, [6]) : "", r;
|
|
15511
15511
|
}
|
|
15512
15512
|
function s0(n, t) {
|
|
15513
|
-
const e = new
|
|
15513
|
+
const e = new _.Table("fvar", [
|
|
15514
15514
|
{ name: "version", type: "ULONG", value: 65536 },
|
|
15515
15515
|
{ name: "offsetToData", type: "USHORT", value: 0 },
|
|
15516
15516
|
{ name: "countSizePairs", type: "USHORT", value: 2 },
|
|
@@ -15670,7 +15670,7 @@ Ts[4] = function(t, e) {
|
|
|
15670
15670
|
return s;
|
|
15671
15671
|
};
|
|
15672
15672
|
function c0(n, t) {
|
|
15673
|
-
return new
|
|
15673
|
+
return new _.Record("axisRecord_" + n, [
|
|
15674
15674
|
{ name: "axisTag_" + n, type: "TAG", value: t.tag },
|
|
15675
15675
|
{ name: "axisNameID_" + n, type: "USHORT", value: t.nameID },
|
|
15676
15676
|
{ name: "axisOrdering_" + n, type: "USHORT", value: t.ordering }
|
|
@@ -15680,10 +15680,10 @@ function h0(n, t) {
|
|
|
15680
15680
|
const e = t.format, s = Ts[e];
|
|
15681
15681
|
V.argument(s !== void 0, `Unknown axis value table format ${e}`);
|
|
15682
15682
|
const i = s(n, t);
|
|
15683
|
-
return new
|
|
15683
|
+
return new _.Table("axisValueTable_" + n, i);
|
|
15684
15684
|
}
|
|
15685
15685
|
function l0(n) {
|
|
15686
|
-
const t = new
|
|
15686
|
+
const t = new _.Table("STAT", [
|
|
15687
15687
|
{ name: "majorVersion", type: "USHORT", value: 1 },
|
|
15688
15688
|
{ name: "minorVersion", type: "USHORT", value: 2 },
|
|
15689
15689
|
{ name: "designAxisSize", type: "USHORT", value: 8 },
|
|
@@ -15712,13 +15712,13 @@ function l0(n) {
|
|
|
15712
15712
|
}
|
|
15713
15713
|
var Cl = { make: l0, parse: o0 };
|
|
15714
15714
|
function u0(n, t) {
|
|
15715
|
-
return new
|
|
15715
|
+
return new _.Record("axisValueMap_" + n, [
|
|
15716
15716
|
{ name: "fromCoordinate_" + n, type: "F2DOT14", value: t.fromCoordinate },
|
|
15717
15717
|
{ name: "toCoordinate_" + n, type: "F2DOT14", value: t.toCoordinate }
|
|
15718
15718
|
]);
|
|
15719
15719
|
}
|
|
15720
15720
|
function f0(n, t) {
|
|
15721
|
-
const e = new
|
|
15721
|
+
const e = new _.Record("segmentMap_" + n, [
|
|
15722
15722
|
{ name: "positionMapCount_" + n, type: "USHORT", value: t.axisValueMaps.length }
|
|
15723
15723
|
]);
|
|
15724
15724
|
let s = [];
|
|
@@ -15730,7 +15730,7 @@ function f0(n, t) {
|
|
|
15730
15730
|
}
|
|
15731
15731
|
function p0(n, t) {
|
|
15732
15732
|
V.argument(n.axisSegmentMaps.length === t.axes.length, "avar axis count must correspond to fvar axis count");
|
|
15733
|
-
const e = new
|
|
15733
|
+
const e = new _.Table("avar", [
|
|
15734
15734
|
{ name: "majorVersion", type: "USHORT", value: 1 },
|
|
15735
15735
|
{ name: "minorVersion", type: "USHORT", value: 0 },
|
|
15736
15736
|
{ name: "reserved", type: "USHORT", value: 0 },
|
|
@@ -15813,7 +15813,7 @@ function b0(n, t) {
|
|
|
15813
15813
|
return e;
|
|
15814
15814
|
}
|
|
15815
15815
|
function v0(n) {
|
|
15816
|
-
const t = new
|
|
15816
|
+
const t = new _.Table("gasp", [
|
|
15817
15817
|
{ name: "version", type: "USHORT", value: 1 },
|
|
15818
15818
|
{ name: "numRanges", type: "USHORT", value: n.numRanges }
|
|
15819
15819
|
]);
|
|
@@ -15858,7 +15858,7 @@ function w0(n) {
|
|
|
15858
15858
|
}
|
|
15859
15859
|
for (let f = 0; f < c; f++)
|
|
15860
15860
|
l[u++] = { name: "svgDoc_" + f, type: "LITERAL", value: s[f] };
|
|
15861
|
-
return new
|
|
15861
|
+
return new _.Table("SVG ", l);
|
|
15862
15862
|
}
|
|
15863
15863
|
var El = {
|
|
15864
15864
|
make: w0,
|
|
@@ -15876,7 +15876,7 @@ function Fa(n) {
|
|
|
15876
15876
|
return t %= Math.pow(2, 32), t;
|
|
15877
15877
|
}
|
|
15878
15878
|
function Ko(n, t, e, s) {
|
|
15879
|
-
return new
|
|
15879
|
+
return new _.Record("Table Record", [
|
|
15880
15880
|
{ name: "tag", type: "TAG", value: n !== void 0 ? n : "" },
|
|
15881
15881
|
{ name: "checkSum", type: "ULONG", value: t !== void 0 ? t : 0 },
|
|
15882
15882
|
{ name: "offset", type: "ULONG", value: e !== void 0 ? e : 0 },
|
|
@@ -15884,7 +15884,7 @@ function Ko(n, t, e, s) {
|
|
|
15884
15884
|
]);
|
|
15885
15885
|
}
|
|
15886
15886
|
function Ml(n) {
|
|
15887
|
-
const t = new
|
|
15887
|
+
const t = new _.Table("sfnt", [
|
|
15888
15888
|
{ name: "version", type: "TAG", value: "OTTO" },
|
|
15889
15889
|
{ name: "numTables", type: "USHORT", value: 0 },
|
|
15890
15890
|
{ name: "searchRange", type: "USHORT", value: 0 },
|
|
@@ -15927,24 +15927,24 @@ function T0(n) {
|
|
|
15927
15927
|
const t = [], e = [], s = [], i = [], r = [], a = [], o = [];
|
|
15928
15928
|
let c, h = 0, l = 0, u = 0, f = 0, p = 0;
|
|
15929
15929
|
for (let tt = 0; tt < n.glyphs.length; tt += 1) {
|
|
15930
|
-
const
|
|
15931
|
-
if (isNaN(
|
|
15932
|
-
throw new Error("Glyph " +
|
|
15933
|
-
(c >
|
|
15934
|
-
const
|
|
15935
|
-
if (
|
|
15936
|
-
l |= 1 <<
|
|
15937
|
-
else if (
|
|
15938
|
-
u |= 1 <<
|
|
15939
|
-
else if (
|
|
15940
|
-
f |= 1 <<
|
|
15941
|
-
else if (
|
|
15942
|
-
p |= 1 <<
|
|
15930
|
+
const Et = n.glyphs.get(tt), Nt = Et.unicode | 0;
|
|
15931
|
+
if (isNaN(Et.advanceWidth))
|
|
15932
|
+
throw new Error("Glyph " + Et.name + " (" + tt + "): advanceWidth is not a number.");
|
|
15933
|
+
(c > Nt || c === void 0) && Nt > 0 && (c = Nt), h < Nt && (h = Nt);
|
|
15934
|
+
const zt = ca.getUnicodeRange(Nt);
|
|
15935
|
+
if (zt < 32)
|
|
15936
|
+
l |= 1 << zt;
|
|
15937
|
+
else if (zt < 64)
|
|
15938
|
+
u |= 1 << zt - 32;
|
|
15939
|
+
else if (zt < 96)
|
|
15940
|
+
f |= 1 << zt - 64;
|
|
15941
|
+
else if (zt < 123)
|
|
15942
|
+
p |= 1 << zt - 96;
|
|
15943
15943
|
else
|
|
15944
15944
|
throw new Error("Unicode ranges bits > 123 are reserved for internal usage");
|
|
15945
|
-
if (
|
|
15946
|
-
const
|
|
15947
|
-
t.push(
|
|
15945
|
+
if (Et.name === ".notdef") continue;
|
|
15946
|
+
const Ht = Et.getMetrics();
|
|
15947
|
+
t.push(Ht.xMin), e.push(Ht.yMin), s.push(Ht.xMax), i.push(Ht.yMax), a.push(Ht.leftSideBearing), o.push(Ht.rightSideBearing), r.push(Et.advanceWidth);
|
|
15948
15948
|
}
|
|
15949
15949
|
const d = {
|
|
15950
15950
|
xMin: Math.min.apply(null, t),
|
|
@@ -16007,20 +16007,20 @@ function T0(n) {
|
|
|
16007
16007
|
}, n.tables.os2)), w = gl.make(n.glyphs), F = tl.make(n.glyphs), M = n.getEnglishName("fontFamily"), O = n.getEnglishName("fontSubfamily"), I = M + " " + O;
|
|
16008
16008
|
let H = n.getEnglishName("postScriptName");
|
|
16009
16009
|
H || (H = M.replace(/\s/g, "") + "-" + O);
|
|
16010
|
-
const
|
|
16010
|
+
const R = {};
|
|
16011
16011
|
for (let tt in n.names)
|
|
16012
|
-
|
|
16013
|
-
|
|
16014
|
-
const W = n.names.unicode || {}, J = n.names.macintosh || {},
|
|
16015
|
-
for (const tt in
|
|
16016
|
-
if (
|
|
16017
|
-
const
|
|
16018
|
-
|
|
16019
|
-
}
|
|
16020
|
-
|
|
16021
|
-
}
|
|
16022
|
-
|
|
16023
|
-
const U = [], P = Qh.make(
|
|
16012
|
+
R[tt] = n.names[tt];
|
|
16013
|
+
R.unicode = R.unicode || {}, R.macintosh = R.macintosh || {}, R.windows = R.windows || {};
|
|
16014
|
+
const W = n.names.unicode || {}, J = n.names.macintosh || {}, D = n.names.windows || {};
|
|
16015
|
+
for (const tt in R) {
|
|
16016
|
+
if (R[tt] = R[tt] || {}, !R[tt].uniqueID) {
|
|
16017
|
+
const Et = n.getEnglishName("manufacturer") || "";
|
|
16018
|
+
R[tt].uniqueID = { en: `${Et}: ${I}` };
|
|
16019
|
+
}
|
|
16020
|
+
R[tt].postScriptName || (R[tt].postScriptName = { en: H });
|
|
16021
|
+
}
|
|
16022
|
+
R.unicode.preferredFamily || (R.unicode.preferredFamily = W.fontFamily || J.fontFamily || D.fontFamily), R.macintosh.preferredFamily || (R.macintosh.preferredFamily = J.fontFamily || W.fontFamily || D.fontFamily), R.windows.preferredFamily || (R.windows.preferredFamily = D.fontFamily || W.fontFamily || J.fontFamily), R.unicode.preferredSubfamily || (R.unicode.preferredSubfamily = W.fontSubfamily || J.fontSubfamily || D.fontSubfamily), R.macintosh.preferredSubfamily || (R.macintosh.preferredSubfamily = J.fontSubfamily || W.fontSubfamily || D.fontSubfamily), R.windows.preferredSubfamily || (R.windows.preferredSubfamily = D.fontSubfamily || W.fontSubfamily || J.fontSubfamily);
|
|
16023
|
+
const U = [], P = Qh.make(R, U), Q = U.length > 0 ? ml.make(U) : void 0, yt = xl.make(n), Pt = aa.make(n.glyphs, {
|
|
16024
16024
|
version: n.getEnglishName("version"),
|
|
16025
16025
|
fullName: I,
|
|
16026
16026
|
familyName: M,
|
|
@@ -16029,7 +16029,7 @@ function T0(n) {
|
|
|
16029
16029
|
unitsPerEm: n.unitsPerEm,
|
|
16030
16030
|
fontBBox: [0, d.yMin, d.ascender, d.advanceWidthMax],
|
|
16031
16031
|
topDict: n.tables.cff && n.tables.cff.topDict || {}
|
|
16032
|
-
}), Ct = n.metas && Object.keys(n.metas).length > 0 ? vl.make(n.metas) : void 0, ut = [x, b, S, v, P, F, yt,
|
|
16032
|
+
}), Ct = n.metas && Object.keys(n.metas).length > 0 ? vl.make(n.metas) : void 0, ut = [x, b, S, v, P, F, yt, Pt, w];
|
|
16033
16033
|
Q && ut.push(Q);
|
|
16034
16034
|
const j = {
|
|
16035
16035
|
gsub: bl,
|
|
@@ -16047,14 +16047,14 @@ function T0(n) {
|
|
|
16047
16047
|
fvar: [n.names]
|
|
16048
16048
|
};
|
|
16049
16049
|
for (let tt in j) {
|
|
16050
|
-
const
|
|
16051
|
-
if (
|
|
16052
|
-
const
|
|
16053
|
-
|
|
16050
|
+
const Et = n.tables[tt];
|
|
16051
|
+
if (Et) {
|
|
16052
|
+
const Nt = j[tt].make.call(n, Et, ...rt[tt] || []);
|
|
16053
|
+
Nt && ut.push(Nt);
|
|
16054
16054
|
}
|
|
16055
16055
|
}
|
|
16056
16056
|
Ct && ut.push(Ct);
|
|
16057
|
-
const bt = Ml(ut),
|
|
16057
|
+
const bt = Ml(ut), kt = bt.encode(), St = Fa(kt), Tt = bt.fields;
|
|
16058
16058
|
let ht = !1;
|
|
16059
16059
|
for (let tt = 0; tt < Tt.length; tt += 1)
|
|
16060
16060
|
if (Tt[tt].name === "head table") {
|
|
@@ -16411,10 +16411,10 @@ function O0(n, t, e) {
|
|
|
16411
16411
|
}
|
|
16412
16412
|
return n.splice(s, 0, e), s;
|
|
16413
16413
|
}
|
|
16414
|
-
function
|
|
16414
|
+
function Ll(n) {
|
|
16415
16415
|
return n[0] === 31 && n[1] === 139 && n[2] === 8;
|
|
16416
16416
|
}
|
|
16417
|
-
function
|
|
16417
|
+
function L0(n) {
|
|
16418
16418
|
const t = new DataView(n.buffer, n.byteOffset, n.byteLength);
|
|
16419
16419
|
let e = 10;
|
|
16420
16420
|
const s = n.byteLength - 8, i = t.getInt8(3);
|
|
@@ -16434,7 +16434,7 @@ function nc(n) {
|
|
|
16434
16434
|
lastPointOfContour: n.lastPointOfContour
|
|
16435
16435
|
};
|
|
16436
16436
|
}
|
|
16437
|
-
function
|
|
16437
|
+
function _0(n) {
|
|
16438
16438
|
return {
|
|
16439
16439
|
glyphIndex: n.glyphIndex,
|
|
16440
16440
|
xScale: n.xScale,
|
|
@@ -16634,7 +16634,7 @@ Yt.prototype.add = function(n, t, e, s) {
|
|
|
16634
16634
|
return t.by instanceof Array ? this.addMultiple(n, t, e, s) : this.addLigature(n, t, e, s);
|
|
16635
16635
|
}
|
|
16636
16636
|
};
|
|
16637
|
-
var I0 = Yt,
|
|
16637
|
+
var I0 = Yt, _l = class {
|
|
16638
16638
|
// private properties don't work with reify
|
|
16639
16639
|
// @TODO: refactor once we migrated to ES6 modules, see https://github.com/opentypejs/opentype.js/pull/579
|
|
16640
16640
|
// #font = null;
|
|
@@ -16956,7 +16956,7 @@ var I0 = Yt, Ll = class {
|
|
|
16956
16956
|
l === i || u.firstLayerIndex < a.firstLayerIndex || (s.baseGlyphRecords[l].firstLayerIndex += h);
|
|
16957
16957
|
}
|
|
16958
16958
|
}
|
|
16959
|
-
},
|
|
16959
|
+
}, R0 = class {
|
|
16960
16960
|
/**
|
|
16961
16961
|
* @param {opentype.Font} font
|
|
16962
16962
|
*/
|
|
@@ -16989,7 +16989,7 @@ var I0 = Yt, Ll = class {
|
|
|
16989
16989
|
const e = t.get(n);
|
|
16990
16990
|
if (e === void 0) return;
|
|
16991
16991
|
let s = this.cache.get(e);
|
|
16992
|
-
s === void 0 && (s =
|
|
16992
|
+
s === void 0 && (s = D0(e), this.cache.set(e, s));
|
|
16993
16993
|
let i = s.images.get(n);
|
|
16994
16994
|
return i === void 0 && (i = U0(this.font, s.template, n), i.promise.then((r) => {
|
|
16995
16995
|
if (i.image = r, typeof this.font.onGlyphUpdated == "function")
|
|
@@ -17001,7 +17001,7 @@ var I0 = Yt, Ll = class {
|
|
|
17001
17001
|
}), s.images.set(n, i)), i;
|
|
17002
17002
|
}
|
|
17003
17003
|
};
|
|
17004
|
-
function
|
|
17004
|
+
function D0(n) {
|
|
17005
17005
|
return {
|
|
17006
17006
|
template: P0(n).then(H0),
|
|
17007
17007
|
images: /* @__PURE__ */ new Map()
|
|
@@ -17021,13 +17021,13 @@ function U0(n, t, e) {
|
|
|
17021
17021
|
var P0 = typeof DecompressionStream == "function" ? z0 : N0;
|
|
17022
17022
|
function N0(n) {
|
|
17023
17023
|
try {
|
|
17024
|
-
return Promise.resolve(new TextDecoder().decode(
|
|
17024
|
+
return Promise.resolve(new TextDecoder().decode(Ll(n) ? L0(n) : n));
|
|
17025
17025
|
} catch (t) {
|
|
17026
17026
|
return Promise.reject(t);
|
|
17027
17027
|
}
|
|
17028
17028
|
}
|
|
17029
17029
|
function z0(n) {
|
|
17030
|
-
if (
|
|
17030
|
+
if (Ll(n))
|
|
17031
17031
|
return new Response(new Response(n).body.pipeThrough(new DecompressionStream("gzip"))).text();
|
|
17032
17032
|
try {
|
|
17033
17033
|
return Promise.resolve(new TextDecoder().decode(n));
|
|
@@ -17234,7 +17234,7 @@ function q0(n, t, e, s) {
|
|
|
17234
17234
|
function j0(n, t, e, s, i) {
|
|
17235
17235
|
return i.lowMemory ? q0(n, t, e, s) : W0(n, t, e, s);
|
|
17236
17236
|
}
|
|
17237
|
-
var
|
|
17237
|
+
var Rl = { getPath: ka, parse: j0 }, X0 = class {
|
|
17238
17238
|
constructor(n) {
|
|
17239
17239
|
this.font = n;
|
|
17240
17240
|
}
|
|
@@ -17356,7 +17356,7 @@ var Dl = { getPath: ka, parse: j0 }, X0 = class {
|
|
|
17356
17356
|
transformComponents(n, t, e, s, i, r) {
|
|
17357
17357
|
let a = 0;
|
|
17358
17358
|
for (let o = 0; o < n.components.length; o++) {
|
|
17359
|
-
const c = n.components[o], h = this.font.glyphs.get(c.glyphIndex), l =
|
|
17359
|
+
const c = n.components[o], h = this.font.glyphs.get(c.glyphIndex), l = _0(c), u = s.indexOf(o);
|
|
17360
17360
|
u > -1 && (l.dx += Math.round(i.deltas[u] * r), l.dy += Math.round(i.deltasY[u] * r));
|
|
17361
17361
|
const f = hi(this.getTransform(h, e).points, l);
|
|
17362
17362
|
t.splice(a, f.length, ...f), a += h.points.length;
|
|
@@ -17678,10 +17678,10 @@ var Dl = { getPath: ka, parse: j0 }, X0 = class {
|
|
|
17678
17678
|
hvar() {
|
|
17679
17679
|
return this.font.tables.hvar;
|
|
17680
17680
|
}
|
|
17681
|
-
}, ic = 1e6,
|
|
17681
|
+
}, ic = 1e6, Li = 64, _i = 1e4, Dl, dn, Ul, ha;
|
|
17682
17682
|
function Pl(n) {
|
|
17683
17683
|
this.font = n, this.getCommands = function(t) {
|
|
17684
|
-
return
|
|
17684
|
+
return Rl.getPath(t).commands;
|
|
17685
17685
|
}, this._fpgmState = this._prepState = void 0, this._errorState = 0;
|
|
17686
17686
|
}
|
|
17687
17687
|
function $0(n) {
|
|
@@ -17865,20 +17865,20 @@ function ks(n, t) {
|
|
|
17865
17865
|
const e = Math.sqrt(n * n + t * t);
|
|
17866
17866
|
return n /= e, t /= e, n === 1 && t === 0 ? be : n === 0 && t === 1 ? Ie : new As(n, t);
|
|
17867
17867
|
}
|
|
17868
|
-
function
|
|
17868
|
+
function Re(n, t, e, s) {
|
|
17869
17869
|
this.x = this.xo = Math.round(n * 64) / 64, this.y = this.yo = Math.round(t * 64) / 64, this.lastPointOfContour = e, this.onCurve = s, this.prevPointOnContour = void 0, this.nextPointOnContour = void 0, this.xTouched = !1, this.yTouched = !1, Object.preventExtensions(this);
|
|
17870
17870
|
}
|
|
17871
|
-
|
|
17871
|
+
Re.prototype.nextTouched = function(n) {
|
|
17872
17872
|
let t = this.nextPointOnContour;
|
|
17873
17873
|
for (; !n.touched(t) && t !== this; ) t = t.nextPointOnContour;
|
|
17874
17874
|
return t;
|
|
17875
17875
|
};
|
|
17876
|
-
|
|
17876
|
+
Re.prototype.prevTouched = function(n) {
|
|
17877
17877
|
let t = this.prevPointOnContour;
|
|
17878
17878
|
for (; !n.touched(t) && t !== this; ) t = t.prevPointOnContour;
|
|
17879
17879
|
return t;
|
|
17880
17880
|
};
|
|
17881
|
-
var bs = Object.freeze(new
|
|
17881
|
+
var bs = Object.freeze(new Re(0, 0)), t1 = {
|
|
17882
17882
|
cvCutIn: 17 / 16,
|
|
17883
17883
|
// control value cut in
|
|
17884
17884
|
deltaBase: 9,
|
|
@@ -17958,8 +17958,8 @@ Ul = function(n, t) {
|
|
|
17958
17958
|
r.push(g[b] + x);
|
|
17959
17959
|
}
|
|
17960
17960
|
n.instructions && !o.inhibitGridFit && (o = new $e("glyf", n.instructions), o.gZone = o.z0 = o.z1 = o.z2 = a, o.contours = r, a.push(
|
|
17961
|
-
new
|
|
17962
|
-
new
|
|
17961
|
+
new Re(0, 0),
|
|
17962
|
+
new Re(Math.round(n.advanceWidth * e), 0)
|
|
17963
17963
|
), dn(o), a.length -= 2);
|
|
17964
17964
|
}
|
|
17965
17965
|
return a;
|
|
@@ -17968,7 +17968,7 @@ ha = function(n, t, e, s) {
|
|
|
17968
17968
|
const i = n.points || [], r = i.length, a = t.gZone = t.z0 = t.z1 = t.z2 = [], o = t.contours = [];
|
|
17969
17969
|
let c;
|
|
17970
17970
|
for (let u = 0; u < r; u++)
|
|
17971
|
-
c = i[u], a[u] = new
|
|
17971
|
+
c = i[u], a[u] = new Re(
|
|
17972
17972
|
c.x * e,
|
|
17973
17973
|
c.y * s,
|
|
17974
17974
|
c.lastPointOfContour,
|
|
@@ -17978,8 +17978,8 @@ ha = function(n, t, e, s) {
|
|
|
17978
17978
|
for (let u = 0; u < r; u++)
|
|
17979
17979
|
c = a[u], h || (h = c, o.push(u)), c.lastPointOfContour ? (c.nextPointOnContour = h, h.prevPointOnContour = c, h = void 0) : (l = a[u + 1], c.nextPointOnContour = l, l.prevPointOnContour = c);
|
|
17980
17980
|
t.inhibitGridFit || (a.push(
|
|
17981
|
-
new
|
|
17982
|
-
new
|
|
17981
|
+
new Re(0, 0),
|
|
17982
|
+
new Re(Math.round(n.advanceWidth * e), 0)
|
|
17983
17983
|
), dn(t), a.length -= 2);
|
|
17984
17984
|
};
|
|
17985
17985
|
dn = function(n) {
|
|
@@ -17992,7 +17992,7 @@ dn = function(n) {
|
|
|
17992
17992
|
throw new Error(
|
|
17993
17993
|
"Hinting instructions exceeded maximum of " + ic
|
|
17994
17994
|
);
|
|
17995
|
-
if (s =
|
|
17995
|
+
if (s = Dl[t[n.ip]], !s)
|
|
17996
17996
|
throw new Error(
|
|
17997
17997
|
"unknown instruction: 0x" + Number(t[n.ip]).toString(16)
|
|
17998
17998
|
);
|
|
@@ -18002,7 +18002,7 @@ dn = function(n) {
|
|
|
18002
18002
|
function zi(n) {
|
|
18003
18003
|
const t = n.tZone = new Array(n.gZone.length);
|
|
18004
18004
|
for (let e = 0; e < t.length; e++)
|
|
18005
|
-
t[e] = new
|
|
18005
|
+
t[e] = new Re(0, 0);
|
|
18006
18006
|
}
|
|
18007
18007
|
function Hl(n, t) {
|
|
18008
18008
|
const e = n.prog;
|
|
@@ -18129,7 +18129,7 @@ function p1(n) {
|
|
|
18129
18129
|
}
|
|
18130
18130
|
}
|
|
18131
18131
|
function d1(n) {
|
|
18132
|
-
n.loop = n.stack.pop(), n.loop >
|
|
18132
|
+
n.loop = n.stack.pop(), n.loop > _i && (n.loop = _i);
|
|
18133
18133
|
}
|
|
18134
18134
|
function g1(n) {
|
|
18135
18135
|
n.round = Nl;
|
|
@@ -18173,8 +18173,8 @@ function T1(n) {
|
|
|
18173
18173
|
function F1(n) {
|
|
18174
18174
|
const t = n.stack, e = t.pop();
|
|
18175
18175
|
let s = t.pop();
|
|
18176
|
-
if (s >
|
|
18177
|
-
throw new Error("Hinting call depth exceeded maximum of " +
|
|
18176
|
+
if (s > _i && (s = _i), ++n.callDepth > Li)
|
|
18177
|
+
throw new Error("Hinting call depth exceeded maximum of " + Li);
|
|
18178
18178
|
const i = n.ip, r = n.prog;
|
|
18179
18179
|
n.prog = n.funcs[e];
|
|
18180
18180
|
for (let a = 0; a < s; a++)
|
|
@@ -18183,8 +18183,8 @@ function F1(n) {
|
|
|
18183
18183
|
}
|
|
18184
18184
|
function A1(n) {
|
|
18185
18185
|
const t = n.stack.pop();
|
|
18186
|
-
if (++n.callDepth >
|
|
18187
|
-
throw new Error("Hinting call depth exceeded maximum of " +
|
|
18186
|
+
if (++n.callDepth > Li)
|
|
18187
|
+
throw new Error("Hinting call depth exceeded maximum of " + Li);
|
|
18188
18188
|
const e = n.ip, s = n.prog;
|
|
18189
18189
|
n.prog = n.funcs[t], dn(n), n.ip = e, n.prog = s, n.callDepth--;
|
|
18190
18190
|
}
|
|
@@ -18261,7 +18261,7 @@ function O1(n) {
|
|
|
18261
18261
|
}
|
|
18262
18262
|
n.loop = 1;
|
|
18263
18263
|
}
|
|
18264
|
-
function
|
|
18264
|
+
function L1(n) {
|
|
18265
18265
|
const t = n.stack, e = n.rp1, s = n.rp2;
|
|
18266
18266
|
let i = n.loop;
|
|
18267
18267
|
const r = n.z0[e], a = n.z1[s], o = n.fv, c = n.dpv, h = n.z2;
|
|
@@ -18275,7 +18275,7 @@ function gc(n, t) {
|
|
|
18275
18275
|
const e = t.stack, s = e.pop() / 64, i = e.pop(), r = t.z1[i], a = t.z0[t.rp0], o = t.fv, c = t.pv;
|
|
18276
18276
|
o.setRelative(r, a, s, c), o.touch(r), t.rp1 = t.rp0, t.rp2 = i, n && (t.rp0 = i);
|
|
18277
18277
|
}
|
|
18278
|
-
function
|
|
18278
|
+
function _1(n) {
|
|
18279
18279
|
const t = n.stack, e = n.rp0, s = n.z0[e];
|
|
18280
18280
|
let i = n.loop;
|
|
18281
18281
|
const r = n.fv, a = n.pv, o = n.z1;
|
|
@@ -18300,7 +18300,7 @@ function B1(n) {
|
|
|
18300
18300
|
for (let r = 0; r < i; r++) s.push(t[++e]);
|
|
18301
18301
|
n.ip = e;
|
|
18302
18302
|
}
|
|
18303
|
-
function
|
|
18303
|
+
function R1(n) {
|
|
18304
18304
|
let t = n.ip;
|
|
18305
18305
|
const e = n.prog, s = n.stack, i = e[++t];
|
|
18306
18306
|
for (let r = 0; r < i; r++) {
|
|
@@ -18309,7 +18309,7 @@ function D1(n) {
|
|
|
18309
18309
|
}
|
|
18310
18310
|
n.ip = t;
|
|
18311
18311
|
}
|
|
18312
|
-
function
|
|
18312
|
+
function D1(n) {
|
|
18313
18313
|
const t = n.stack;
|
|
18314
18314
|
let e = n.store;
|
|
18315
18315
|
e || (e = n.store = []);
|
|
@@ -18603,7 +18603,7 @@ function G(n, t, e, s, i, r) {
|
|
|
18603
18603
|
let g, x, b;
|
|
18604
18604
|
g = d.distance(u, l, !0, !0), x = g >= 0 ? 1 : -1, g = Math.abs(g), n && (b = r.cvt[o], s && Math.abs(g - b) < r.cvCutIn && (g = b)), e && g < f && (g = f), s && (g = r.round(g)), p.setRelative(u, l, x * g, d), p.touch(u), r.rp1 = r.rp0, r.rp2 = c, t && (r.rp0 = c);
|
|
18605
18605
|
}
|
|
18606
|
-
|
|
18606
|
+
Dl = [
|
|
18607
18607
|
/* 0x00 */
|
|
18608
18608
|
rc.bind(void 0, Ie),
|
|
18609
18609
|
/* 0x01 */
|
|
@@ -18724,13 +18724,13 @@ Rl = [
|
|
|
18724
18724
|
/* 0x38 */
|
|
18725
18725
|
O1,
|
|
18726
18726
|
/* 0x39 */
|
|
18727
|
-
|
|
18727
|
+
L1,
|
|
18728
18728
|
/* 0x3A */
|
|
18729
18729
|
gc.bind(void 0, 0),
|
|
18730
18730
|
/* 0x3B */
|
|
18731
18731
|
gc.bind(void 0, 1),
|
|
18732
18732
|
/* 0x3C */
|
|
18733
|
-
|
|
18733
|
+
_1,
|
|
18734
18734
|
/* 0x3D */
|
|
18735
18735
|
I1,
|
|
18736
18736
|
/* 0x3E */
|
|
@@ -18740,9 +18740,9 @@ Rl = [
|
|
|
18740
18740
|
/* 0x40 */
|
|
18741
18741
|
B1,
|
|
18742
18742
|
/* 0x41 */
|
|
18743
|
-
D1,
|
|
18744
|
-
/* 0x42 */
|
|
18745
18743
|
R1,
|
|
18744
|
+
/* 0x42 */
|
|
18745
|
+
D1,
|
|
18746
18746
|
/* 0x43 */
|
|
18747
18747
|
U1,
|
|
18748
18748
|
/* 0x44 */
|
|
@@ -19148,7 +19148,7 @@ function Ea(n, t, e) {
|
|
|
19148
19148
|
function Fg(n, t, e) {
|
|
19149
19149
|
this.contextName = n, this.openRange = null, this.ranges = [], this.checkStart = t, this.checkEnd = e;
|
|
19150
19150
|
}
|
|
19151
|
-
function
|
|
19151
|
+
function Ut(n, t) {
|
|
19152
19152
|
this.context = n, this.index = t, this.length = n.length, this.current = n[t], this.backtrack = n.slice(0, t), this.lookahead = n.slice(t + 1);
|
|
19153
19153
|
}
|
|
19154
19154
|
function Hi(n) {
|
|
@@ -19271,10 +19271,10 @@ Hi.prototype.subscribe = function(n) {
|
|
|
19271
19271
|
Hi.prototype.unsubscribe = function(n) {
|
|
19272
19272
|
this.subscribers.splice(n, 1);
|
|
19273
19273
|
};
|
|
19274
|
-
|
|
19274
|
+
Ut.prototype.setCurrentIndex = function(n) {
|
|
19275
19275
|
this.index = n, this.current = this.context[n], this.backtrack = this.context.slice(0, n), this.lookahead = this.context.slice(n + 1);
|
|
19276
19276
|
};
|
|
19277
|
-
|
|
19277
|
+
Ut.prototype.get = function(n) {
|
|
19278
19278
|
switch (!0) {
|
|
19279
19279
|
case n === 0:
|
|
19280
19280
|
return this.current;
|
|
@@ -19346,7 +19346,7 @@ pt.prototype.updateContextsRanges = function() {
|
|
|
19346
19346
|
this.resetContextsRanges();
|
|
19347
19347
|
const n = this.tokens.map((t) => t.char);
|
|
19348
19348
|
for (let t = 0; t < n.length; t++) {
|
|
19349
|
-
const e = new
|
|
19349
|
+
const e = new Ut(n, t);
|
|
19350
19350
|
this.runContextCheck(e);
|
|
19351
19351
|
}
|
|
19352
19352
|
this.dispatch("updateContextsRanges", [this.registeredContexts]);
|
|
@@ -19373,7 +19373,7 @@ pt.prototype.tokenize = function(n) {
|
|
|
19373
19373
|
let t = Array.from(n);
|
|
19374
19374
|
this.dispatch("start");
|
|
19375
19375
|
for (let e = 0; e < t.length; e++) {
|
|
19376
|
-
const s = t[e], i = new
|
|
19376
|
+
const s = t[e], i = new Ut(t, e);
|
|
19377
19377
|
this.dispatch("next", [i]), this.runContextCheck(i);
|
|
19378
19378
|
let r = new Zn(s);
|
|
19379
19379
|
this.tokens.push(r), this.dispatch("newToken", [r, i]);
|
|
@@ -19444,7 +19444,7 @@ function kr(n, t) {
|
|
|
19444
19444
|
}
|
|
19445
19445
|
return e.length !== n.length ? -1 : e;
|
|
19446
19446
|
}
|
|
19447
|
-
function
|
|
19447
|
+
function Lg(n, t) {
|
|
19448
19448
|
const e = t.inputCoverage.length + t.lookaheadCoverage.length + t.backtrackCoverage.length;
|
|
19449
19449
|
if (n.context.length < e) return [];
|
|
19450
19450
|
let s = kr(
|
|
@@ -19457,7 +19457,7 @@ function _g(n, t) {
|
|
|
19457
19457
|
let r = n.lookahead.slice(i);
|
|
19458
19458
|
for (; r.length && Ke(r[0].char); )
|
|
19459
19459
|
r.shift();
|
|
19460
|
-
const a = new
|
|
19460
|
+
const a = new Ut(r, 0);
|
|
19461
19461
|
let o = kr(
|
|
19462
19462
|
t.lookaheadCoverage,
|
|
19463
19463
|
a
|
|
@@ -19465,7 +19465,7 @@ function _g(n, t) {
|
|
|
19465
19465
|
for (c.reverse(); c.length && Ke(c[0].char); )
|
|
19466
19466
|
c.shift();
|
|
19467
19467
|
if (c.length < t.backtrackCoverage.length) return [];
|
|
19468
|
-
const h = new
|
|
19468
|
+
const h = new Ut(c, 0);
|
|
19469
19469
|
let l = kr(
|
|
19470
19470
|
t.backtrackCoverage,
|
|
19471
19471
|
h
|
|
@@ -19489,7 +19489,7 @@ function _g(n, t) {
|
|
|
19489
19489
|
}
|
|
19490
19490
|
return f;
|
|
19491
19491
|
}
|
|
19492
|
-
function
|
|
19492
|
+
function _g(n, t) {
|
|
19493
19493
|
let e = n.current, s = Qe(e, t.coverage);
|
|
19494
19494
|
if (s === -1) return null;
|
|
19495
19495
|
let i, r = t.ligatureSets[s];
|
|
@@ -19558,7 +19558,7 @@ function Bg(n, t) {
|
|
|
19558
19558
|
}
|
|
19559
19559
|
return e;
|
|
19560
19560
|
}
|
|
19561
|
-
function
|
|
19561
|
+
function Rg(n, t) {
|
|
19562
19562
|
let e = Qe(n, t.coverage);
|
|
19563
19563
|
return e === -1 ? null : t.sequences[e];
|
|
19564
19564
|
}
|
|
@@ -19624,17 +19624,17 @@ $t.prototype.getLookupMethod = function(n, t) {
|
|
|
19624
19624
|
[s, t]
|
|
19625
19625
|
);
|
|
19626
19626
|
case "63":
|
|
19627
|
-
return (s) =>
|
|
19627
|
+
return (s) => Lg.apply(
|
|
19628
19628
|
this,
|
|
19629
19629
|
[s, t]
|
|
19630
19630
|
);
|
|
19631
19631
|
case "41":
|
|
19632
|
-
return (s) =>
|
|
19632
|
+
return (s) => _g.apply(
|
|
19633
19633
|
this,
|
|
19634
19634
|
[s, t]
|
|
19635
19635
|
);
|
|
19636
19636
|
case "21":
|
|
19637
|
-
return (s) =>
|
|
19637
|
+
return (s) => Rg.apply(
|
|
19638
19638
|
this,
|
|
19639
19639
|
[s, t]
|
|
19640
19640
|
);
|
|
@@ -19715,7 +19715,7 @@ $t.prototype.lookupFeature = function(n) {
|
|
|
19715
19715
|
}));
|
|
19716
19716
|
break;
|
|
19717
19717
|
}
|
|
19718
|
-
t = new
|
|
19718
|
+
t = new Ut(r, e), !(Array.isArray(p) && !p.length) && (p = null);
|
|
19719
19719
|
}
|
|
19720
19720
|
}
|
|
19721
19721
|
return r.length ? r : null;
|
|
@@ -19743,7 +19743,7 @@ $t.prototype.getFeature = function(t) {
|
|
|
19743
19743
|
const e = this.features[t.script];
|
|
19744
19744
|
return e ? e.tags[t.tag] ? this.features[t.script].tags[t.tag] : null : { FAIL: `No feature for script ${t.script}` };
|
|
19745
19745
|
};
|
|
19746
|
-
var
|
|
19746
|
+
var Dg = $t;
|
|
19747
19747
|
function Ug(n) {
|
|
19748
19748
|
const t = n.current, e = n.get(-1);
|
|
19749
19749
|
return (
|
|
@@ -19850,13 +19850,13 @@ function Yg(n) {
|
|
|
19850
19850
|
function $g(n) {
|
|
19851
19851
|
const t = "arab", e = this.featuresTags[t], s = this.tokenizer.getRangeTokens(n);
|
|
19852
19852
|
if (s.length === 1) return;
|
|
19853
|
-
let i = new
|
|
19853
|
+
let i = new Ut(
|
|
19854
19854
|
s.map(
|
|
19855
19855
|
(a) => a.getState("glyphIndex")
|
|
19856
19856
|
),
|
|
19857
19857
|
0
|
|
19858
19858
|
);
|
|
19859
|
-
const r = new
|
|
19859
|
+
const r = new Ut(
|
|
19860
19860
|
s.map(
|
|
19861
19861
|
(a) => a.char
|
|
19862
19862
|
),
|
|
@@ -19899,7 +19899,7 @@ function $g(n) {
|
|
|
19899
19899
|
var Zg = $g;
|
|
19900
19900
|
function Sc(n, t) {
|
|
19901
19901
|
const e = n.map((s) => s.activeState.value);
|
|
19902
|
-
return new
|
|
19902
|
+
return new Ut(e, 0);
|
|
19903
19903
|
}
|
|
19904
19904
|
function Jg(n) {
|
|
19905
19905
|
const t = "arab";
|
|
@@ -19933,7 +19933,7 @@ var em = {
|
|
|
19933
19933
|
};
|
|
19934
19934
|
function wc(n, t) {
|
|
19935
19935
|
const e = n.map((s) => s.activeState.value);
|
|
19936
|
-
return new
|
|
19936
|
+
return new Ut(e, 0);
|
|
19937
19937
|
}
|
|
19938
19938
|
function nm(n) {
|
|
19939
19939
|
const t = "delf", e = "ccmp";
|
|
@@ -19979,7 +19979,7 @@ var am = {
|
|
|
19979
19979
|
};
|
|
19980
19980
|
function Cc(n, t) {
|
|
19981
19981
|
const e = n.map((s) => s.activeState.value);
|
|
19982
|
-
return new
|
|
19982
|
+
return new Ut(e, 0);
|
|
19983
19983
|
}
|
|
19984
19984
|
function om(n) {
|
|
19985
19985
|
const t = "latn";
|
|
@@ -20023,7 +20023,7 @@ var um = {
|
|
|
20023
20023
|
};
|
|
20024
20024
|
function Tc(n, t) {
|
|
20025
20025
|
const e = n.map((s) => s.activeState.value);
|
|
20026
|
-
return new
|
|
20026
|
+
return new Ut(e, t || 0);
|
|
20027
20027
|
}
|
|
20028
20028
|
function fm(n) {
|
|
20029
20029
|
const t = "thai";
|
|
@@ -20047,7 +20047,7 @@ function fm(n) {
|
|
|
20047
20047
|
var pm = fm;
|
|
20048
20048
|
function Fc(n, t) {
|
|
20049
20049
|
const e = n.map((s) => s.activeState.value);
|
|
20050
|
-
return new
|
|
20050
|
+
return new Ut(e, t || 0);
|
|
20051
20051
|
}
|
|
20052
20052
|
function dm(n) {
|
|
20053
20053
|
const t = "thai";
|
|
@@ -20071,7 +20071,7 @@ function dm(n) {
|
|
|
20071
20071
|
var gm = dm;
|
|
20072
20072
|
function Ac(n, t) {
|
|
20073
20073
|
const e = n.map((s) => s.activeState.value);
|
|
20074
|
-
return new
|
|
20074
|
+
return new Ut(e, t || 0);
|
|
20075
20075
|
}
|
|
20076
20076
|
function mm(n) {
|
|
20077
20077
|
const t = "thai";
|
|
@@ -20143,7 +20143,7 @@ te.prototype.contextChecks = {
|
|
|
20143
20143
|
thaiWordCheck: um,
|
|
20144
20144
|
unicodeVariationSequenceCheck: vm
|
|
20145
20145
|
};
|
|
20146
|
-
function
|
|
20146
|
+
function _n(n) {
|
|
20147
20147
|
const t = this.contextChecks[`${n}Check`];
|
|
20148
20148
|
return this.tokenizer.registerContextChecker(
|
|
20149
20149
|
n,
|
|
@@ -20152,7 +20152,7 @@ function Ln(n) {
|
|
|
20152
20152
|
);
|
|
20153
20153
|
}
|
|
20154
20154
|
function Cm() {
|
|
20155
|
-
return
|
|
20155
|
+
return _n.call(this, "ccmpReplacement"), _n.call(this, "latinWord"), _n.call(this, "arabicWord"), _n.call(this, "arabicSentence"), _n.call(this, "thaiWord"), _n.call(this, "unicodeVariationSequence"), this.tokenizer.tokenize(this.text);
|
|
20156
20156
|
}
|
|
20157
20157
|
function Tm() {
|
|
20158
20158
|
const n = this.tokenizer.getContextRanges("arabicSentence");
|
|
@@ -20176,7 +20176,7 @@ te.prototype.applyFeatures = function(n, t) {
|
|
|
20176
20176
|
if (!n) throw new Error(
|
|
20177
20177
|
"No valid font was provided to apply features"
|
|
20178
20178
|
);
|
|
20179
|
-
this.query || (this.query = new
|
|
20179
|
+
this.query || (this.query = new Dg(n));
|
|
20180
20180
|
for (let e = 0; e < t.length; e++) {
|
|
20181
20181
|
const s = t[e];
|
|
20182
20182
|
this.query.supports({ script: s.script }) && this.registerFeatures(s.script, s.tags);
|
|
@@ -20267,7 +20267,7 @@ te.prototype.getTextGlyphs = function(n) {
|
|
|
20267
20267
|
}
|
|
20268
20268
|
return t;
|
|
20269
20269
|
};
|
|
20270
|
-
var
|
|
20270
|
+
var Lm = te;
|
|
20271
20271
|
function Mr(n) {
|
|
20272
20272
|
return {
|
|
20273
20273
|
fontFamily: { en: n.familyName || " " },
|
|
@@ -20316,7 +20316,7 @@ function it(n) {
|
|
|
20316
20316
|
}
|
|
20317
20317
|
this.supported = !0, this.glyphs = new Se.GlyphSet(this, n.glyphs || []), this.encoding = new el(this), this.position = new A0(this), this.substitution = new I0(this), this.tables = this.tables || {}, this.tables = new Proxy(this.tables, {
|
|
20318
20318
|
set: (t, e, s) => (t[e] = s, t.fvar && (t.gvar || t.cff2) && !this.variation && (this.variation = new Y0(this)), !0)
|
|
20319
|
-
}), this.palettes = new
|
|
20319
|
+
}), this.palettes = new _l(this), this.layers = new B0(this), this.svgImages = new R0(this), this._push = null, this._hmtxTableData = {}, Object.defineProperty(this, "hinting", {
|
|
20320
20320
|
get: function() {
|
|
20321
20321
|
return this._hinting ? this._hinting : this.outlinesFormat === "truetype" ? this._hinting = new Tg(this) : null;
|
|
20322
20322
|
}
|
|
@@ -20340,7 +20340,7 @@ it.prototype.updateFeatures = function(n) {
|
|
|
20340
20340
|
} : t);
|
|
20341
20341
|
};
|
|
20342
20342
|
it.prototype.stringToGlyphIndexes = function(n, t) {
|
|
20343
|
-
const e = new
|
|
20343
|
+
const e = new Lm(), s = (r) => this.charToGlyphIndex(r.char);
|
|
20344
20344
|
e.registerModifier("glyphIndex", null, s);
|
|
20345
20345
|
let i = t ? this.updateFeatures(t.features) : this.defaultRenderOptions.features;
|
|
20346
20346
|
return e.applyFeatures(this, i), e.getTextGlyphs(n);
|
|
@@ -20554,7 +20554,7 @@ it.prototype.usWeightClasses = {
|
|
|
20554
20554
|
EXTRA_BOLD: 800,
|
|
20555
20555
|
BLACK: 900
|
|
20556
20556
|
};
|
|
20557
|
-
var
|
|
20557
|
+
var _m = it;
|
|
20558
20558
|
function Im(n, t) {
|
|
20559
20559
|
const e = new z.Parser(n, t), s = e.parseUShort(), i = e.parseUShort();
|
|
20560
20560
|
s !== 1 && console.warn(`Unsupported hvar table version ${s}.${i}`);
|
|
@@ -20581,7 +20581,7 @@ function Im(n, t) {
|
|
|
20581
20581
|
function Bm() {
|
|
20582
20582
|
console.warn("Writing of hvar tables is not yet supported.");
|
|
20583
20583
|
}
|
|
20584
|
-
var
|
|
20584
|
+
var Rm = { make: Bm, parse: Im }, Dm = function() {
|
|
20585
20585
|
return {
|
|
20586
20586
|
coverage: this.parsePointer(A.coverage),
|
|
20587
20587
|
attachPoints: this.parseList(A.pointer(A.uShortList))
|
|
@@ -20617,7 +20617,7 @@ function Hm(n, t) {
|
|
|
20617
20617
|
var i = {
|
|
20618
20618
|
version: s,
|
|
20619
20619
|
classDef: e.parsePointer(A.classDef),
|
|
20620
|
-
attachList: e.parsePointer(
|
|
20620
|
+
attachList: e.parsePointer(Dm),
|
|
20621
20621
|
ligCaretList: e.parsePointer(Nm),
|
|
20622
20622
|
markAttachClassDef: e.parsePointer(A.classDef)
|
|
20623
20623
|
};
|
|
@@ -20719,11 +20719,11 @@ function Vm(n, t) {
|
|
|
20719
20719
|
}
|
|
20720
20720
|
var Wm = new Array(10);
|
|
20721
20721
|
function qm(n) {
|
|
20722
|
-
return new
|
|
20722
|
+
return new _.Table("GPOS", [
|
|
20723
20723
|
{ name: "version", type: "ULONG", value: 65536 },
|
|
20724
|
-
{ name: "scripts", type: "TABLE", value: new
|
|
20725
|
-
{ name: "features", type: "TABLE", value: new
|
|
20726
|
-
{ name: "lookups", type: "TABLE", value: new
|
|
20724
|
+
{ name: "scripts", type: "TABLE", value: new _.ScriptList(n.scripts) },
|
|
20725
|
+
{ name: "features", type: "TABLE", value: new _.FeatureList(n.features) },
|
|
20726
|
+
{ name: "lookups", type: "TABLE", value: new _.LookupList(n.lookups, Wm) }
|
|
20727
20727
|
]);
|
|
20728
20728
|
}
|
|
20729
20729
|
var jm = { parse: Vm, make: qm };
|
|
@@ -20808,7 +20808,7 @@ function et(n, t) {
|
|
|
20808
20808
|
}
|
|
20809
20809
|
function ty(n, t = {}) {
|
|
20810
20810
|
let e, s;
|
|
20811
|
-
const i = new
|
|
20811
|
+
const i = new _m({ empty: !0 });
|
|
20812
20812
|
n.constructor !== ArrayBuffer && (n = new Uint8Array(n).buffer);
|
|
20813
20813
|
const r = new DataView(n, 0);
|
|
20814
20814
|
let a, o = [];
|
|
@@ -20818,22 +20818,22 @@ function ty(n, t = {}) {
|
|
|
20818
20818
|
else if (c === "OTTO")
|
|
20819
20819
|
i.outlinesFormat = "cff", a = z.getUShort(r, 4), o = kc(r, a);
|
|
20820
20820
|
else if (c === "wOFF") {
|
|
20821
|
-
const
|
|
20822
|
-
if (
|
|
20821
|
+
const D = z.getTag(r, 4);
|
|
20822
|
+
if (D === "\0\0\0")
|
|
20823
20823
|
i.outlinesFormat = "truetype";
|
|
20824
|
-
else if (
|
|
20824
|
+
else if (D === "OTTO")
|
|
20825
20825
|
i.outlinesFormat = "cff";
|
|
20826
20826
|
else
|
|
20827
20827
|
throw new Error("Unsupported OpenType flavor " + c);
|
|
20828
20828
|
a = z.getUShort(r, 12), o = Qm(r, a);
|
|
20829
20829
|
} else if (c === "wOF2") {
|
|
20830
|
-
const
|
|
20831
|
-
throw new Error("WOFF2 require an external decompressor library, see examples at: " +
|
|
20830
|
+
const D = "https://github.com/opentypejs/opentype.js/issues/183#issuecomment-1147228025";
|
|
20831
|
+
throw new Error("WOFF2 require an external decompressor library, see examples at: " + D);
|
|
20832
20832
|
} else
|
|
20833
20833
|
throw new Error("Unsupported OpenType signature " + c);
|
|
20834
|
-
let h, l, u, f, p, d, g, x, b, S, v, w, F, M, O, I, H,
|
|
20835
|
-
for (let
|
|
20836
|
-
const U = o[
|
|
20834
|
+
let h, l, u, f, p, d, g, x, b, S, v, w, F, M, O, I, H, R;
|
|
20835
|
+
for (let D = 0; D < a; D += 1) {
|
|
20836
|
+
const U = o[D];
|
|
20837
20837
|
let P;
|
|
20838
20838
|
switch (U.tag) {
|
|
20839
20839
|
case "avar":
|
|
@@ -20843,7 +20843,7 @@ function ty(n, t = {}) {
|
|
|
20843
20843
|
P = et(r, U), i.tables.cmap = tl.parse(P.data, P.offset), i.encoding = new nl(i.tables.cmap);
|
|
20844
20844
|
break;
|
|
20845
20845
|
case "cvt ":
|
|
20846
|
-
P = et(r, U),
|
|
20846
|
+
P = et(r, U), R = new z.Parser(P.data, P.offset), i.tables.cvt = R.parseShortList(U.length / 2);
|
|
20847
20847
|
break;
|
|
20848
20848
|
case "fvar":
|
|
20849
20849
|
u = U;
|
|
@@ -20858,7 +20858,7 @@ function ty(n, t = {}) {
|
|
|
20858
20858
|
d = U;
|
|
20859
20859
|
break;
|
|
20860
20860
|
case "fpgm":
|
|
20861
|
-
P = et(r, U),
|
|
20861
|
+
P = et(r, U), R = new z.Parser(P.data, P.offset), i.tables.fpgm = R.parseByteList(U.length);
|
|
20862
20862
|
break;
|
|
20863
20863
|
case "head":
|
|
20864
20864
|
P = et(r, U), i.tables.head = pl.parse(P.data, P.offset), i.unitsPerEm = i.tables.head.unitsPerEm, e = i.tables.head.indexToLocFormat;
|
|
@@ -20894,7 +20894,7 @@ function ty(n, t = {}) {
|
|
|
20894
20894
|
P = et(r, U), i.tables.post = xl.parse(P.data, P.offset), i.glyphNames = new va(i.tables.post);
|
|
20895
20895
|
break;
|
|
20896
20896
|
case "prep":
|
|
20897
|
-
P = et(r, U),
|
|
20897
|
+
P = et(r, U), R = new z.Parser(P.data, P.offset), i.tables.prep = R.parseByteList(U.length);
|
|
20898
20898
|
break;
|
|
20899
20899
|
case "glyf":
|
|
20900
20900
|
x = U;
|
|
@@ -20937,67 +20937,67 @@ function ty(n, t = {}) {
|
|
|
20937
20937
|
}
|
|
20938
20938
|
const W = et(r, I);
|
|
20939
20939
|
if (i.tables.name = Qh.parse(W.data, W.offset, s), i.names = i.tables.name, x && O) {
|
|
20940
|
-
const
|
|
20941
|
-
i.glyphs =
|
|
20940
|
+
const D = e === 0, U = et(r, O), P = Km.parse(U.data, U.offset, i.numGlyphs, D), Q = et(r, x);
|
|
20941
|
+
i.glyphs = Rl.parse(Q.data, Q.offset, P, i, t);
|
|
20942
20942
|
} else if (h) {
|
|
20943
|
-
const
|
|
20944
|
-
aa.parse(
|
|
20943
|
+
const D = et(r, h);
|
|
20944
|
+
aa.parse(D.data, D.offset, i, t);
|
|
20945
20945
|
} else if (l) {
|
|
20946
|
-
const
|
|
20947
|
-
aa.parse(
|
|
20946
|
+
const D = et(r, l);
|
|
20947
|
+
aa.parse(D.data, D.offset, i, t);
|
|
20948
20948
|
} else
|
|
20949
20949
|
throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");
|
|
20950
20950
|
const J = et(r, w);
|
|
20951
20951
|
if (gl.parse(i, J.data, J.offset, i.numberOfHMetrics, i.numGlyphs, i.glyphs, t), $p(i, t), M) {
|
|
20952
|
-
const
|
|
20953
|
-
i.kerningPairs = Zm.parse(
|
|
20952
|
+
const D = et(r, M);
|
|
20953
|
+
i.kerningPairs = Zm.parse(D.data, D.offset);
|
|
20954
20954
|
} else
|
|
20955
20955
|
i.kerningPairs = {};
|
|
20956
20956
|
if (b) {
|
|
20957
|
-
const
|
|
20958
|
-
i.tables.gdef = Gm.parse(
|
|
20957
|
+
const D = et(r, b);
|
|
20958
|
+
i.tables.gdef = Gm.parse(D.data, D.offset);
|
|
20959
20959
|
}
|
|
20960
20960
|
if (S) {
|
|
20961
|
-
const
|
|
20962
|
-
i.tables.gpos = jm.parse(
|
|
20961
|
+
const D = et(r, S);
|
|
20962
|
+
i.tables.gpos = jm.parse(D.data, D.offset), i.position.init();
|
|
20963
20963
|
}
|
|
20964
20964
|
if (v) {
|
|
20965
|
-
const
|
|
20966
|
-
i.tables.gsub = bl.parse(
|
|
20965
|
+
const D = et(r, v);
|
|
20966
|
+
i.tables.gsub = bl.parse(D.data, D.offset);
|
|
20967
20967
|
}
|
|
20968
20968
|
if (u) {
|
|
20969
|
-
const
|
|
20970
|
-
i.tables.fvar = wl.parse(
|
|
20969
|
+
const D = et(r, u);
|
|
20970
|
+
i.tables.fvar = wl.parse(D.data, D.offset, i.names);
|
|
20971
20971
|
}
|
|
20972
20972
|
if (f) {
|
|
20973
|
-
const
|
|
20974
|
-
i.tables.stat = Cl.parse(
|
|
20973
|
+
const D = et(r, f);
|
|
20974
|
+
i.tables.stat = Cl.parse(D.data, D.offset, i.tables.fvar);
|
|
20975
20975
|
}
|
|
20976
20976
|
if (p) {
|
|
20977
20977
|
u || console.warn("This font provides a gvar table, but no fvar table, which is required for variable fonts."), x || console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");
|
|
20978
|
-
const
|
|
20979
|
-
i.tables.gvar = Al.parse(
|
|
20978
|
+
const D = et(r, p);
|
|
20979
|
+
i.tables.gvar = Al.parse(D.data, D.offset, i.tables.fvar, i.glyphs);
|
|
20980
20980
|
}
|
|
20981
20981
|
if (d) {
|
|
20982
20982
|
u || console.warn("This font provides a cvar table, but no fvar table, which is required for variable fonts."), i.tables.cvt || console.warn("This font provides a cvar table, but no cvt table which could be made variable."), x || console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");
|
|
20983
|
-
const
|
|
20984
|
-
i.tables.cvar = Fl.parse(
|
|
20983
|
+
const D = et(r, d);
|
|
20984
|
+
i.tables.cvar = Fl.parse(D.data, D.offset, i.tables.fvar, i.tables.cvt || []);
|
|
20985
20985
|
}
|
|
20986
20986
|
if (g) {
|
|
20987
20987
|
u || console.warn("This font provides an avar table, but no fvar table, which is required for variable fonts.");
|
|
20988
|
-
const
|
|
20989
|
-
i.tables.avar = Tl.parse(
|
|
20988
|
+
const D = et(r, g);
|
|
20989
|
+
i.tables.avar = Tl.parse(D.data, D.offset, i.tables.fvar);
|
|
20990
20990
|
}
|
|
20991
20991
|
if (F) {
|
|
20992
20992
|
u || console.warn("This font provides an HVAR table, but no fvar table, which is required for variable fonts."), w || console.warn("This font provides an HVAR table, but no hmtx table to vary.");
|
|
20993
|
-
const
|
|
20994
|
-
i.tables.hvar =
|
|
20993
|
+
const D = et(r, F);
|
|
20994
|
+
i.tables.hvar = Rm.parse(D.data, D.offset, i.tables.fvar);
|
|
20995
20995
|
}
|
|
20996
20996
|
if (H) {
|
|
20997
|
-
const
|
|
20998
|
-
i.tables.meta = vl.parse(
|
|
20997
|
+
const D = et(r, H);
|
|
20998
|
+
i.tables.meta = vl.parse(D.data, D.offset), i.metas = i.tables.meta;
|
|
20999
20999
|
}
|
|
21000
|
-
return i.palettes = new
|
|
21000
|
+
return i.palettes = new _l(i), i;
|
|
21001
21001
|
}
|
|
21002
21002
|
function ey(n, t = !1) {
|
|
21003
21003
|
const e = n[0].index !== null, s = new Set(Object.keys(n[0].attributes)), i = new Set(Object.keys(n[0].morphAttributes)), r = {}, a = {}, o = n[0].morphTargetsRelative, c = new Dt();
|
|
@@ -21120,16 +21120,16 @@ function ny(n, t = 1e-4) {
|
|
|
21120
21120
|
let w = "";
|
|
21121
21121
|
for (let F = 0, M = o.length; F < M; F++) {
|
|
21122
21122
|
const O = o[F], I = n.getAttribute(O), H = I.itemSize;
|
|
21123
|
-
for (let
|
|
21124
|
-
w += `${~~(I[u[
|
|
21123
|
+
for (let R = 0; R < H; R++)
|
|
21124
|
+
w += `${~~(I[u[R]](v) * g + x)},`;
|
|
21125
21125
|
}
|
|
21126
21126
|
if (w in e)
|
|
21127
21127
|
l.push(e[w]);
|
|
21128
21128
|
else {
|
|
21129
21129
|
for (let F = 0, M = o.length; F < M; F++) {
|
|
21130
|
-
const O = o[F], I = n.getAttribute(O), H = n.morphAttributes[O],
|
|
21131
|
-
for (let
|
|
21132
|
-
const U = u[
|
|
21130
|
+
const O = o[F], I = n.getAttribute(O), H = n.morphAttributes[O], R = I.itemSize, W = c[O], J = h[O];
|
|
21131
|
+
for (let D = 0; D < R; D++) {
|
|
21132
|
+
const U = u[D], P = f[D];
|
|
21133
21133
|
if (W[P](a, I[U](v)), H)
|
|
21134
21134
|
for (let Q = 0, yt = H.length; Q < yt; Q++)
|
|
21135
21135
|
J[Q][P](a, H[Q][U](v));
|
|
@@ -21429,7 +21429,7 @@ function dy(n) {
|
|
|
21429
21429
|
return t;
|
|
21430
21430
|
}
|
|
21431
21431
|
function Oc(n, t) {
|
|
21432
|
-
const e = Ze.area(n.getPoints(32)) > 0, s = t === e ? n.curves.slice() : dy(n.curves), i = new
|
|
21432
|
+
const e = Ze.area(n.getPoints(32)) > 0, s = t === e ? n.curves.slice() : dy(n.curves), i = new Dn();
|
|
21433
21433
|
return i.curves.push(...s), i;
|
|
21434
21434
|
}
|
|
21435
21435
|
function gy(n, t = 32) {
|
|
@@ -21897,7 +21897,7 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
21897
21897
|
return y.length === 0 || C.copy(y, 0, 0, m), y;
|
|
21898
21898
|
}
|
|
21899
21899
|
if (C.length !== void 0)
|
|
21900
|
-
return typeof C.length != "number" ||
|
|
21900
|
+
return typeof C.length != "number" || Mt(C.length) ? a(0) : p(C);
|
|
21901
21901
|
if (C.type === "Buffer" && Array.isArray(C.data))
|
|
21902
21902
|
return p(C.data);
|
|
21903
21903
|
}
|
|
@@ -21917,9 +21917,9 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
21917
21917
|
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
21918
21918
|
);
|
|
21919
21919
|
if (m === y) return 0;
|
|
21920
|
-
for (var T = m.length, k = y.length,
|
|
21921
|
-
if (m[
|
|
21922
|
-
T = m[
|
|
21920
|
+
for (var T = m.length, k = y.length, L = 0, B = Math.min(T, k); L < B; ++L)
|
|
21921
|
+
if (m[L] !== y[L]) {
|
|
21922
|
+
T = m[L], k = y[L];
|
|
21923
21923
|
break;
|
|
21924
21924
|
}
|
|
21925
21925
|
return T < k ? -1 : k < T ? 1 : 0;
|
|
@@ -21949,20 +21949,20 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
21949
21949
|
if (y === void 0)
|
|
21950
21950
|
for (y = 0, T = 0; T < m.length; ++T)
|
|
21951
21951
|
y += m[T].length;
|
|
21952
|
-
var k = o.allocUnsafe(y),
|
|
21952
|
+
var k = o.allocUnsafe(y), L = 0;
|
|
21953
21953
|
for (T = 0; T < m.length; ++T) {
|
|
21954
21954
|
var B = m[T];
|
|
21955
21955
|
if (Vt(B, Uint8Array))
|
|
21956
|
-
|
|
21956
|
+
L + B.length > k.length ? o.from(B).copy(k, L) : Uint8Array.prototype.set.call(
|
|
21957
21957
|
k,
|
|
21958
21958
|
B,
|
|
21959
|
-
|
|
21959
|
+
L
|
|
21960
21960
|
);
|
|
21961
21961
|
else if (o.isBuffer(B))
|
|
21962
|
-
B.copy(k,
|
|
21962
|
+
B.copy(k, L);
|
|
21963
21963
|
else
|
|
21964
21964
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
21965
|
-
|
|
21965
|
+
L += B.length;
|
|
21966
21966
|
}
|
|
21967
21967
|
return k;
|
|
21968
21968
|
};
|
|
@@ -21994,7 +21994,7 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
21994
21994
|
case "hex":
|
|
21995
21995
|
return y >>> 1;
|
|
21996
21996
|
case "base64":
|
|
21997
|
-
return
|
|
21997
|
+
return zt(C).length;
|
|
21998
21998
|
default:
|
|
21999
21999
|
if (k)
|
|
22000
22000
|
return T ? -1 : tt(C).length;
|
|
@@ -22017,9 +22017,9 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22017
22017
|
return yt(this, m, y);
|
|
22018
22018
|
case "latin1":
|
|
22019
22019
|
case "binary":
|
|
22020
|
-
return
|
|
22020
|
+
return Pt(this, m, y);
|
|
22021
22021
|
case "base64":
|
|
22022
|
-
return
|
|
22022
|
+
return D(this, m, y);
|
|
22023
22023
|
case "ucs2":
|
|
22024
22024
|
case "ucs-2":
|
|
22025
22025
|
case "utf16le":
|
|
@@ -22065,30 +22065,30 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22065
22065
|
}, o.prototype.inspect = function() {
|
|
22066
22066
|
var m = "", y = n.INSPECT_MAX_BYTES;
|
|
22067
22067
|
return m = this.toString("hex", 0, y).replace(/(.{2})/g, "$1 ").trim(), this.length > y && (m += " ... "), "<Buffer " + m + ">";
|
|
22068
|
-
}, s && (o.prototype[s] = o.prototype.inspect), o.prototype.compare = function(m, y, T, k,
|
|
22068
|
+
}, s && (o.prototype[s] = o.prototype.inspect), o.prototype.compare = function(m, y, T, k, L) {
|
|
22069
22069
|
if (Vt(m, Uint8Array) && (m = o.from(m, m.offset, m.byteLength)), !o.isBuffer(m))
|
|
22070
22070
|
throw new TypeError(
|
|
22071
22071
|
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof m
|
|
22072
22072
|
);
|
|
22073
|
-
if (y === void 0 && (y = 0), T === void 0 && (T = m ? m.length : 0), k === void 0 && (k = 0),
|
|
22073
|
+
if (y === void 0 && (y = 0), T === void 0 && (T = m ? m.length : 0), k === void 0 && (k = 0), L === void 0 && (L = this.length), y < 0 || T > m.length || k < 0 || L > this.length)
|
|
22074
22074
|
throw new RangeError("out of range index");
|
|
22075
|
-
if (k >=
|
|
22075
|
+
if (k >= L && y >= T)
|
|
22076
22076
|
return 0;
|
|
22077
|
-
if (k >=
|
|
22077
|
+
if (k >= L)
|
|
22078
22078
|
return -1;
|
|
22079
22079
|
if (y >= T)
|
|
22080
22080
|
return 1;
|
|
22081
|
-
if (y >>>= 0, T >>>= 0, k >>>= 0,
|
|
22082
|
-
for (var B =
|
|
22083
|
-
if (ot[ft] !==
|
|
22084
|
-
B = ot[ft], $ =
|
|
22081
|
+
if (y >>>= 0, T >>>= 0, k >>>= 0, L >>>= 0, this === m) return 0;
|
|
22082
|
+
for (var B = L - k, $ = T - y, Y = Math.min(B, $), ot = this.slice(k, L), Ot = m.slice(y, T), ft = 0; ft < Y; ++ft)
|
|
22083
|
+
if (ot[ft] !== Ot[ft]) {
|
|
22084
|
+
B = ot[ft], $ = Ot[ft];
|
|
22085
22085
|
break;
|
|
22086
22086
|
}
|
|
22087
22087
|
return B < $ ? -1 : $ < B ? 1 : 0;
|
|
22088
22088
|
};
|
|
22089
22089
|
function M(C, m, y, T, k) {
|
|
22090
22090
|
if (C.length === 0) return -1;
|
|
22091
|
-
if (typeof y == "string" ? (T = y, y = 0) : y > 2147483647 ? y = 2147483647 : y < -2147483648 && (y = -2147483648), y = +y,
|
|
22091
|
+
if (typeof y == "string" ? (T = y, y = 0) : y > 2147483647 ? y = 2147483647 : y < -2147483648 && (y = -2147483648), y = +y, Mt(y) && (y = k ? 0 : C.length - 1), y < 0 && (y = C.length + y), y >= C.length) {
|
|
22092
22092
|
if (k) return -1;
|
|
22093
22093
|
y = C.length - 1;
|
|
22094
22094
|
} else if (y < 0)
|
|
@@ -22101,23 +22101,23 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22101
22101
|
throw new TypeError("val must be string, number or Buffer");
|
|
22102
22102
|
}
|
|
22103
22103
|
function O(C, m, y, T, k) {
|
|
22104
|
-
var
|
|
22104
|
+
var L = 1, B = C.length, $ = m.length;
|
|
22105
22105
|
if (T !== void 0 && (T = String(T).toLowerCase(), T === "ucs2" || T === "ucs-2" || T === "utf16le" || T === "utf-16le")) {
|
|
22106
22106
|
if (C.length < 2 || m.length < 2)
|
|
22107
22107
|
return -1;
|
|
22108
|
-
|
|
22108
|
+
L = 2, B /= 2, $ /= 2, y /= 2;
|
|
22109
22109
|
}
|
|
22110
22110
|
function Y(Ua, Pa) {
|
|
22111
|
-
return
|
|
22111
|
+
return L === 1 ? Ua[Pa] : Ua.readUInt16BE(Pa * L);
|
|
22112
22112
|
}
|
|
22113
22113
|
var ot;
|
|
22114
22114
|
if (k) {
|
|
22115
|
-
var
|
|
22115
|
+
var Ot = -1;
|
|
22116
22116
|
for (ot = y; ot < B; ot++)
|
|
22117
|
-
if (Y(C, ot) === Y(m,
|
|
22118
|
-
if (
|
|
22117
|
+
if (Y(C, ot) === Y(m, Ot === -1 ? 0 : ot - Ot)) {
|
|
22118
|
+
if (Ot === -1 && (Ot = ot), ot - Ot + 1 === $) return Ot * L;
|
|
22119
22119
|
} else
|
|
22120
|
-
|
|
22120
|
+
Ot !== -1 && (ot -= ot - Ot), Ot = -1;
|
|
22121
22121
|
} else
|
|
22122
22122
|
for (y + $ > B && (y = B - $), ot = y; ot >= 0; ot--) {
|
|
22123
22123
|
for (var ft = !0, Ms = 0; Ms < $; Ms++)
|
|
@@ -22140,26 +22140,26 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22140
22140
|
y = Number(y) || 0;
|
|
22141
22141
|
var k = C.length - y;
|
|
22142
22142
|
T ? (T = Number(T), T > k && (T = k)) : T = k;
|
|
22143
|
-
var
|
|
22144
|
-
T >
|
|
22143
|
+
var L = m.length;
|
|
22144
|
+
T > L / 2 && (T = L / 2);
|
|
22145
22145
|
for (var B = 0; B < T; ++B) {
|
|
22146
22146
|
var $ = parseInt(m.substr(B * 2, 2), 16);
|
|
22147
|
-
if (
|
|
22147
|
+
if (Mt($)) return B;
|
|
22148
22148
|
C[y + B] = $;
|
|
22149
22149
|
}
|
|
22150
22150
|
return B;
|
|
22151
22151
|
}
|
|
22152
22152
|
function H(C, m, y, T) {
|
|
22153
|
-
return
|
|
22153
|
+
return Ht(tt(m, C.length - y), C, y, T);
|
|
22154
22154
|
}
|
|
22155
|
-
function
|
|
22156
|
-
return
|
|
22155
|
+
function R(C, m, y, T) {
|
|
22156
|
+
return Ht(Et(m), C, y, T);
|
|
22157
22157
|
}
|
|
22158
22158
|
function W(C, m, y, T) {
|
|
22159
|
-
return zt(
|
|
22159
|
+
return Ht(zt(m), C, y, T);
|
|
22160
22160
|
}
|
|
22161
22161
|
function J(C, m, y, T) {
|
|
22162
|
-
return
|
|
22162
|
+
return Ht(Nt(m, C.length - y), C, y, T);
|
|
22163
22163
|
}
|
|
22164
22164
|
o.prototype.write = function(m, y, T, k) {
|
|
22165
22165
|
if (y === void 0)
|
|
@@ -22172,8 +22172,8 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22172
22172
|
throw new Error(
|
|
22173
22173
|
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
22174
22174
|
);
|
|
22175
|
-
var
|
|
22176
|
-
if ((T === void 0 || T >
|
|
22175
|
+
var L = this.length - y;
|
|
22176
|
+
if ((T === void 0 || T > L) && (T = L), m.length > 0 && (T < 0 || y < 0) || y > this.length)
|
|
22177
22177
|
throw new RangeError("Attempt to write outside buffer bounds");
|
|
22178
22178
|
k || (k = "utf8");
|
|
22179
22179
|
for (var B = !1; ; )
|
|
@@ -22186,7 +22186,7 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22186
22186
|
case "ascii":
|
|
22187
22187
|
case "latin1":
|
|
22188
22188
|
case "binary":
|
|
22189
|
-
return
|
|
22189
|
+
return R(this, m, y, T);
|
|
22190
22190
|
case "base64":
|
|
22191
22191
|
return W(this, m, y, T);
|
|
22192
22192
|
case "ucs2":
|
|
@@ -22204,27 +22204,27 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22204
22204
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
22205
22205
|
};
|
|
22206
22206
|
};
|
|
22207
|
-
function
|
|
22207
|
+
function D(C, m, y) {
|
|
22208
22208
|
return m === 0 && y === C.length ? t.fromByteArray(C) : t.fromByteArray(C.slice(m, y));
|
|
22209
22209
|
}
|
|
22210
22210
|
function U(C, m, y) {
|
|
22211
22211
|
y = Math.min(C.length, y);
|
|
22212
22212
|
for (var T = [], k = m; k < y; ) {
|
|
22213
|
-
var
|
|
22213
|
+
var L = C[k], B = null, $ = L > 239 ? 4 : L > 223 ? 3 : L > 191 ? 2 : 1;
|
|
22214
22214
|
if (k + $ <= y) {
|
|
22215
|
-
var Y, ot,
|
|
22215
|
+
var Y, ot, Ot, ft;
|
|
22216
22216
|
switch ($) {
|
|
22217
22217
|
case 1:
|
|
22218
|
-
|
|
22218
|
+
L < 128 && (B = L);
|
|
22219
22219
|
break;
|
|
22220
22220
|
case 2:
|
|
22221
|
-
Y = C[k + 1], (Y & 192) === 128 && (ft = (
|
|
22221
|
+
Y = C[k + 1], (Y & 192) === 128 && (ft = (L & 31) << 6 | Y & 63, ft > 127 && (B = ft));
|
|
22222
22222
|
break;
|
|
22223
22223
|
case 3:
|
|
22224
|
-
Y = C[k + 1], ot = C[k + 2], (Y & 192) === 128 && (ot & 192) === 128 && (ft = (
|
|
22224
|
+
Y = C[k + 1], ot = C[k + 2], (Y & 192) === 128 && (ot & 192) === 128 && (ft = (L & 15) << 12 | (Y & 63) << 6 | ot & 63, ft > 2047 && (ft < 55296 || ft > 57343) && (B = ft));
|
|
22225
22225
|
break;
|
|
22226
22226
|
case 4:
|
|
22227
|
-
Y = C[k + 1], ot = C[k + 2],
|
|
22227
|
+
Y = C[k + 1], ot = C[k + 2], Ot = C[k + 3], (Y & 192) === 128 && (ot & 192) === 128 && (Ot & 192) === 128 && (ft = (L & 15) << 18 | (Y & 63) << 12 | (ot & 63) << 6 | Ot & 63, ft > 65535 && ft < 1114112 && (B = ft));
|
|
22228
22228
|
}
|
|
22229
22229
|
}
|
|
22230
22230
|
B === null ? (B = 65533, $ = 1) : B > 65535 && (B -= 65536, T.push(B >>> 10 & 1023 | 55296), B = 56320 | B & 1023), T.push(B), k += $;
|
|
@@ -22250,7 +22250,7 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22250
22250
|
T += String.fromCharCode(C[k] & 127);
|
|
22251
22251
|
return T;
|
|
22252
22252
|
}
|
|
22253
|
-
function
|
|
22253
|
+
function Pt(C, m, y) {
|
|
22254
22254
|
var T = "";
|
|
22255
22255
|
y = Math.min(C.length, y);
|
|
22256
22256
|
for (var k = m; k < y; ++k)
|
|
@@ -22260,13 +22260,13 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22260
22260
|
function Ct(C, m, y) {
|
|
22261
22261
|
var T = C.length;
|
|
22262
22262
|
(!m || m < 0) && (m = 0), (!y || y < 0 || y > T) && (y = T);
|
|
22263
|
-
for (var k = "",
|
|
22264
|
-
k += Ce[C[
|
|
22263
|
+
for (var k = "", L = m; L < y; ++L)
|
|
22264
|
+
k += Ce[C[L]];
|
|
22265
22265
|
return k;
|
|
22266
22266
|
}
|
|
22267
22267
|
function ut(C, m, y) {
|
|
22268
|
-
for (var T = C.slice(m, y), k = "",
|
|
22269
|
-
k += String.fromCharCode(T[
|
|
22268
|
+
for (var T = C.slice(m, y), k = "", L = 0; L < T.length - 1; L += 2)
|
|
22269
|
+
k += String.fromCharCode(T[L] + T[L + 1] * 256);
|
|
22270
22270
|
return k;
|
|
22271
22271
|
}
|
|
22272
22272
|
o.prototype.slice = function(m, y) {
|
|
@@ -22281,13 +22281,13 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22281
22281
|
}
|
|
22282
22282
|
o.prototype.readUintLE = o.prototype.readUIntLE = function(m, y, T) {
|
|
22283
22283
|
m = m >>> 0, y = y >>> 0, T || j(m, y, this.length);
|
|
22284
|
-
for (var k = this[m],
|
|
22285
|
-
k += this[m + B] *
|
|
22284
|
+
for (var k = this[m], L = 1, B = 0; ++B < y && (L *= 256); )
|
|
22285
|
+
k += this[m + B] * L;
|
|
22286
22286
|
return k;
|
|
22287
22287
|
}, o.prototype.readUintBE = o.prototype.readUIntBE = function(m, y, T) {
|
|
22288
22288
|
m = m >>> 0, y = y >>> 0, T || j(m, y, this.length);
|
|
22289
|
-
for (var k = this[m + --y],
|
|
22290
|
-
k += this[m + --y] *
|
|
22289
|
+
for (var k = this[m + --y], L = 1; y > 0 && (L *= 256); )
|
|
22290
|
+
k += this[m + --y] * L;
|
|
22291
22291
|
return k;
|
|
22292
22292
|
}, o.prototype.readUint8 = o.prototype.readUInt8 = function(m, y) {
|
|
22293
22293
|
return m = m >>> 0, y || j(m, 1, this.length), this[m];
|
|
@@ -22301,14 +22301,14 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22301
22301
|
return m = m >>> 0, y || j(m, 4, this.length), this[m] * 16777216 + (this[m + 1] << 16 | this[m + 2] << 8 | this[m + 3]);
|
|
22302
22302
|
}, o.prototype.readIntLE = function(m, y, T) {
|
|
22303
22303
|
m = m >>> 0, y = y >>> 0, T || j(m, y, this.length);
|
|
22304
|
-
for (var k = this[m],
|
|
22305
|
-
k += this[m + B] *
|
|
22306
|
-
return
|
|
22304
|
+
for (var k = this[m], L = 1, B = 0; ++B < y && (L *= 256); )
|
|
22305
|
+
k += this[m + B] * L;
|
|
22306
|
+
return L *= 128, k >= L && (k -= Math.pow(2, 8 * y)), k;
|
|
22307
22307
|
}, o.prototype.readIntBE = function(m, y, T) {
|
|
22308
22308
|
m = m >>> 0, y = y >>> 0, T || j(m, y, this.length);
|
|
22309
|
-
for (var k = y,
|
|
22310
|
-
B += this[m + --k] *
|
|
22311
|
-
return
|
|
22309
|
+
for (var k = y, L = 1, B = this[m + --k]; k > 0 && (L *= 256); )
|
|
22310
|
+
B += this[m + --k] * L;
|
|
22311
|
+
return L *= 128, B >= L && (B -= Math.pow(2, 8 * y)), B;
|
|
22312
22312
|
}, o.prototype.readInt8 = function(m, y) {
|
|
22313
22313
|
return m = m >>> 0, y || j(m, 1, this.length), this[m] & 128 ? (255 - this[m] + 1) * -1 : this[m];
|
|
22314
22314
|
}, o.prototype.readInt16LE = function(m, y) {
|
|
@@ -22332,15 +22332,15 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22332
22332
|
}, o.prototype.readDoubleBE = function(m, y) {
|
|
22333
22333
|
return m = m >>> 0, y || j(m, 8, this.length), e.read(this, m, !1, 52, 8);
|
|
22334
22334
|
};
|
|
22335
|
-
function rt(C, m, y, T, k,
|
|
22335
|
+
function rt(C, m, y, T, k, L) {
|
|
22336
22336
|
if (!o.isBuffer(C)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
22337
|
-
if (m > k || m <
|
|
22337
|
+
if (m > k || m < L) throw new RangeError('"value" argument is out of bounds');
|
|
22338
22338
|
if (y + T > C.length) throw new RangeError("Index out of range");
|
|
22339
22339
|
}
|
|
22340
22340
|
o.prototype.writeUintLE = o.prototype.writeUIntLE = function(m, y, T, k) {
|
|
22341
22341
|
if (m = +m, y = y >>> 0, T = T >>> 0, !k) {
|
|
22342
|
-
var
|
|
22343
|
-
rt(this, m, y, T,
|
|
22342
|
+
var L = Math.pow(2, 8 * T) - 1;
|
|
22343
|
+
rt(this, m, y, T, L, 0);
|
|
22344
22344
|
}
|
|
22345
22345
|
var B = 1, $ = 0;
|
|
22346
22346
|
for (this[y] = m & 255; ++$ < T && (B *= 256); )
|
|
@@ -22348,8 +22348,8 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22348
22348
|
return y + T;
|
|
22349
22349
|
}, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(m, y, T, k) {
|
|
22350
22350
|
if (m = +m, y = y >>> 0, T = T >>> 0, !k) {
|
|
22351
|
-
var
|
|
22352
|
-
rt(this, m, y, T,
|
|
22351
|
+
var L = Math.pow(2, 8 * T) - 1;
|
|
22352
|
+
rt(this, m, y, T, L, 0);
|
|
22353
22353
|
}
|
|
22354
22354
|
var B = T - 1, $ = 1;
|
|
22355
22355
|
for (this[y + B] = m & 255; --B >= 0 && ($ *= 256); )
|
|
@@ -22367,8 +22367,8 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22367
22367
|
return m = +m, y = y >>> 0, T || rt(this, m, y, 4, 4294967295, 0), this[y] = m >>> 24, this[y + 1] = m >>> 16, this[y + 2] = m >>> 8, this[y + 3] = m & 255, y + 4;
|
|
22368
22368
|
}, o.prototype.writeIntLE = function(m, y, T, k) {
|
|
22369
22369
|
if (m = +m, y = y >>> 0, !k) {
|
|
22370
|
-
var
|
|
22371
|
-
rt(this, m, y, T,
|
|
22370
|
+
var L = Math.pow(2, 8 * T - 1);
|
|
22371
|
+
rt(this, m, y, T, L - 1, -L);
|
|
22372
22372
|
}
|
|
22373
22373
|
var B = 0, $ = 1, Y = 0;
|
|
22374
22374
|
for (this[y] = m & 255; ++B < T && ($ *= 256); )
|
|
@@ -22376,8 +22376,8 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22376
22376
|
return y + T;
|
|
22377
22377
|
}, o.prototype.writeIntBE = function(m, y, T, k) {
|
|
22378
22378
|
if (m = +m, y = y >>> 0, !k) {
|
|
22379
|
-
var
|
|
22380
|
-
rt(this, m, y, T,
|
|
22379
|
+
var L = Math.pow(2, 8 * T - 1);
|
|
22380
|
+
rt(this, m, y, T, L - 1, -L);
|
|
22381
22381
|
}
|
|
22382
22382
|
var B = T - 1, $ = 1, Y = 0;
|
|
22383
22383
|
for (this[y + B] = m & 255; --B >= 0 && ($ *= 256); )
|
|
@@ -22394,17 +22394,17 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22394
22394
|
}, o.prototype.writeInt32BE = function(m, y, T) {
|
|
22395
22395
|
return m = +m, y = y >>> 0, T || rt(this, m, y, 4, 2147483647, -2147483648), m < 0 && (m = 4294967295 + m + 1), this[y] = m >>> 24, this[y + 1] = m >>> 16, this[y + 2] = m >>> 8, this[y + 3] = m & 255, y + 4;
|
|
22396
22396
|
};
|
|
22397
|
-
function bt(C, m, y, T, k,
|
|
22397
|
+
function bt(C, m, y, T, k, L) {
|
|
22398
22398
|
if (y + T > C.length) throw new RangeError("Index out of range");
|
|
22399
22399
|
if (y < 0) throw new RangeError("Index out of range");
|
|
22400
22400
|
}
|
|
22401
|
-
function
|
|
22401
|
+
function kt(C, m, y, T, k) {
|
|
22402
22402
|
return m = +m, y = y >>> 0, k || bt(C, m, y, 4), e.write(C, m, y, T, 23, 4), y + 4;
|
|
22403
22403
|
}
|
|
22404
22404
|
o.prototype.writeFloatLE = function(m, y, T) {
|
|
22405
|
-
return
|
|
22405
|
+
return kt(this, m, y, !0, T);
|
|
22406
22406
|
}, o.prototype.writeFloatBE = function(m, y, T) {
|
|
22407
|
-
return
|
|
22407
|
+
return kt(this, m, y, !1, T);
|
|
22408
22408
|
};
|
|
22409
22409
|
function St(C, m, y, T, k) {
|
|
22410
22410
|
return m = +m, y = y >>> 0, k || bt(C, m, y, 8), e.write(C, m, y, T, 52, 8), y + 8;
|
|
@@ -22421,12 +22421,12 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22421
22421
|
if (T < 0 || T >= this.length) throw new RangeError("Index out of range");
|
|
22422
22422
|
if (k < 0) throw new RangeError("sourceEnd out of bounds");
|
|
22423
22423
|
k > this.length && (k = this.length), m.length - y < k - T && (k = m.length - y + T);
|
|
22424
|
-
var
|
|
22424
|
+
var L = k - T;
|
|
22425
22425
|
return this === m && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(y, T, k) : Uint8Array.prototype.set.call(
|
|
22426
22426
|
m,
|
|
22427
22427
|
this.subarray(T, k),
|
|
22428
22428
|
y
|
|
22429
|
-
),
|
|
22429
|
+
), L;
|
|
22430
22430
|
}, o.prototype.fill = function(m, y, T, k) {
|
|
22431
22431
|
if (typeof m == "string") {
|
|
22432
22432
|
if (typeof y == "string" ? (k = y, y = 0, T = this.length) : typeof T == "string" && (k = T, T = this.length), k !== void 0 && typeof k != "string")
|
|
@@ -22434,8 +22434,8 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22434
22434
|
if (typeof k == "string" && !o.isEncoding(k))
|
|
22435
22435
|
throw new TypeError("Unknown encoding: " + k);
|
|
22436
22436
|
if (m.length === 1) {
|
|
22437
|
-
var
|
|
22438
|
-
(k === "utf8" &&
|
|
22437
|
+
var L = m.charCodeAt(0);
|
|
22438
|
+
(k === "utf8" && L < 128 || k === "latin1") && (m = L);
|
|
22439
22439
|
}
|
|
22440
22440
|
} else typeof m == "number" ? m = m & 255 : typeof m == "boolean" && (m = Number(m));
|
|
22441
22441
|
if (y < 0 || this.length < y || this.length < T)
|
|
@@ -22465,44 +22465,44 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22465
22465
|
}
|
|
22466
22466
|
function tt(C, m) {
|
|
22467
22467
|
m = m || 1 / 0;
|
|
22468
|
-
for (var y, T = C.length, k = null,
|
|
22468
|
+
for (var y, T = C.length, k = null, L = [], B = 0; B < T; ++B) {
|
|
22469
22469
|
if (y = C.charCodeAt(B), y > 55295 && y < 57344) {
|
|
22470
22470
|
if (!k) {
|
|
22471
22471
|
if (y > 56319) {
|
|
22472
|
-
(m -= 3) > -1 &&
|
|
22472
|
+
(m -= 3) > -1 && L.push(239, 191, 189);
|
|
22473
22473
|
continue;
|
|
22474
22474
|
} else if (B + 1 === T) {
|
|
22475
|
-
(m -= 3) > -1 &&
|
|
22475
|
+
(m -= 3) > -1 && L.push(239, 191, 189);
|
|
22476
22476
|
continue;
|
|
22477
22477
|
}
|
|
22478
22478
|
k = y;
|
|
22479
22479
|
continue;
|
|
22480
22480
|
}
|
|
22481
22481
|
if (y < 56320) {
|
|
22482
|
-
(m -= 3) > -1 &&
|
|
22482
|
+
(m -= 3) > -1 && L.push(239, 191, 189), k = y;
|
|
22483
22483
|
continue;
|
|
22484
22484
|
}
|
|
22485
22485
|
y = (k - 55296 << 10 | y - 56320) + 65536;
|
|
22486
|
-
} else k && (m -= 3) > -1 &&
|
|
22486
|
+
} else k && (m -= 3) > -1 && L.push(239, 191, 189);
|
|
22487
22487
|
if (k = null, y < 128) {
|
|
22488
22488
|
if ((m -= 1) < 0) break;
|
|
22489
|
-
|
|
22489
|
+
L.push(y);
|
|
22490
22490
|
} else if (y < 2048) {
|
|
22491
22491
|
if ((m -= 2) < 0) break;
|
|
22492
|
-
|
|
22492
|
+
L.push(
|
|
22493
22493
|
y >> 6 | 192,
|
|
22494
22494
|
y & 63 | 128
|
|
22495
22495
|
);
|
|
22496
22496
|
} else if (y < 65536) {
|
|
22497
22497
|
if ((m -= 3) < 0) break;
|
|
22498
|
-
|
|
22498
|
+
L.push(
|
|
22499
22499
|
y >> 12 | 224,
|
|
22500
22500
|
y >> 6 & 63 | 128,
|
|
22501
22501
|
y & 63 | 128
|
|
22502
22502
|
);
|
|
22503
22503
|
} else if (y < 1114112) {
|
|
22504
22504
|
if ((m -= 4) < 0) break;
|
|
22505
|
-
|
|
22505
|
+
L.push(
|
|
22506
22506
|
y >> 18 | 240,
|
|
22507
22507
|
y >> 12 & 63 | 128,
|
|
22508
22508
|
y >> 6 & 63 | 128,
|
|
@@ -22511,22 +22511,22 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22511
22511
|
} else
|
|
22512
22512
|
throw new Error("Invalid code point");
|
|
22513
22513
|
}
|
|
22514
|
-
return
|
|
22514
|
+
return L;
|
|
22515
22515
|
}
|
|
22516
|
-
function
|
|
22516
|
+
function Et(C) {
|
|
22517
22517
|
for (var m = [], y = 0; y < C.length; ++y)
|
|
22518
22518
|
m.push(C.charCodeAt(y) & 255);
|
|
22519
22519
|
return m;
|
|
22520
22520
|
}
|
|
22521
|
-
function
|
|
22522
|
-
for (var y, T, k,
|
|
22523
|
-
y = C.charCodeAt(B), T = y >> 8, k = y % 256,
|
|
22524
|
-
return
|
|
22521
|
+
function Nt(C, m) {
|
|
22522
|
+
for (var y, T, k, L = [], B = 0; B < C.length && !((m -= 2) < 0); ++B)
|
|
22523
|
+
y = C.charCodeAt(B), T = y >> 8, k = y % 256, L.push(k), L.push(T);
|
|
22524
|
+
return L;
|
|
22525
22525
|
}
|
|
22526
|
-
function
|
|
22526
|
+
function zt(C) {
|
|
22527
22527
|
return t.toByteArray(ht(C));
|
|
22528
22528
|
}
|
|
22529
|
-
function
|
|
22529
|
+
function Ht(C, m, y, T) {
|
|
22530
22530
|
for (var k = 0; k < T && !(k + y >= m.length || k >= C.length); ++k)
|
|
22531
22531
|
m[k + y] = C[k];
|
|
22532
22532
|
return k;
|
|
@@ -22534,7 +22534,7 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22534
22534
|
function Vt(C, m) {
|
|
22535
22535
|
return C instanceof m || C != null && C.constructor != null && C.constructor.name != null && C.constructor.name === m.name;
|
|
22536
22536
|
}
|
|
22537
|
-
function
|
|
22537
|
+
function Mt(C) {
|
|
22538
22538
|
return C !== C;
|
|
22539
22539
|
}
|
|
22540
22540
|
var Ce = function() {
|
|
@@ -22574,18 +22574,18 @@ if (!Kt.kStringMaxLength)
|
|
|
22574
22574
|
Kt.constants || (Kt.constants = {
|
|
22575
22575
|
MAX_LENGTH: Kt.kMaxLength
|
|
22576
22576
|
}, Kt.kStringMaxLength && (Kt.constants.MAX_STRING_LENGTH = Kt.kStringMaxLength));
|
|
22577
|
-
var en = Kt,
|
|
22578
|
-
|
|
22579
|
-
function
|
|
22577
|
+
var en = Kt, La = {}, ql = "\uFEFF";
|
|
22578
|
+
La.PrependBOM = _a;
|
|
22579
|
+
function _a(n, t) {
|
|
22580
22580
|
this.encoder = n, this.addBOM = !0;
|
|
22581
22581
|
}
|
|
22582
|
-
|
|
22582
|
+
_a.prototype.write = function(n) {
|
|
22583
22583
|
return this.addBOM && (n = ql + n, this.addBOM = !1), this.encoder.write(n);
|
|
22584
22584
|
};
|
|
22585
|
-
|
|
22585
|
+
_a.prototype.end = function() {
|
|
22586
22586
|
return this.encoder.end();
|
|
22587
22587
|
};
|
|
22588
|
-
|
|
22588
|
+
La.StripBOM = Ia;
|
|
22589
22589
|
function Ia(n, t) {
|
|
22590
22590
|
this.decoder = n, this.pass = !1, this.options = t || {};
|
|
22591
22591
|
}
|
|
@@ -22601,11 +22601,11 @@ function My(n, t) {
|
|
|
22601
22601
|
for (var e in t)
|
|
22602
22602
|
Ey(t, e) && (n[e] = t[e]);
|
|
22603
22603
|
}
|
|
22604
|
-
var jl = My,
|
|
22604
|
+
var jl = My, Lr = {}, _r = {}, ii = { exports: {} };
|
|
22605
22605
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
22606
|
-
var
|
|
22606
|
+
var Lc;
|
|
22607
22607
|
function Oy() {
|
|
22608
|
-
return
|
|
22608
|
+
return Lc || (Lc = 1, function(n, t) {
|
|
22609
22609
|
var e = Ma, s = e.Buffer;
|
|
22610
22610
|
function i(a, o) {
|
|
22611
22611
|
for (var c in a)
|
|
@@ -22635,10 +22635,10 @@ function Oy() {
|
|
|
22635
22635
|
};
|
|
22636
22636
|
}(ii, ii.exports)), ii.exports;
|
|
22637
22637
|
}
|
|
22638
|
-
var
|
|
22639
|
-
function
|
|
22640
|
-
if (
|
|
22641
|
-
|
|
22638
|
+
var _c;
|
|
22639
|
+
function Ly() {
|
|
22640
|
+
if (_c) return _r;
|
|
22641
|
+
_c = 1;
|
|
22642
22642
|
var n = Oy().Buffer, t = n.isEncoding || function(b) {
|
|
22643
22643
|
switch (b = "" + b, b && b.toLowerCase()) {
|
|
22644
22644
|
case "hex":
|
|
@@ -22686,7 +22686,7 @@ function _y() {
|
|
|
22686
22686
|
if (typeof S != "string" && (n.isEncoding === t || !t(b))) throw new Error("Unknown encoding: " + b);
|
|
22687
22687
|
return S || b;
|
|
22688
22688
|
}
|
|
22689
|
-
|
|
22689
|
+
_r.StringDecoder = i;
|
|
22690
22690
|
function i(b) {
|
|
22691
22691
|
this.encoding = s(b);
|
|
22692
22692
|
var S;
|
|
@@ -22791,10 +22791,10 @@ function _y() {
|
|
|
22791
22791
|
function x(b) {
|
|
22792
22792
|
return b && b.length ? this.write(b) : "";
|
|
22793
22793
|
}
|
|
22794
|
-
return
|
|
22794
|
+
return _r;
|
|
22795
22795
|
}
|
|
22796
22796
|
var Ir, Ic;
|
|
22797
|
-
function
|
|
22797
|
+
function _y() {
|
|
22798
22798
|
if (Ic) return Ir;
|
|
22799
22799
|
Ic = 1;
|
|
22800
22800
|
var n = en.Buffer;
|
|
@@ -22815,7 +22815,7 @@ function Ly() {
|
|
|
22815
22815
|
this.enc = h.encodingName, this.bomAware = h.bomAware, this.enc === "base64" ? this.encoder = r : this.enc === "utf8" ? this.encoder = c : this.enc === "cesu8" && (this.enc = "utf8", this.encoder = a, n.from("eda0bdedb2a9", "hex").toString() !== "💩" && (this.decoder = o, this.defaultCharUnicode = l.defaultCharUnicode));
|
|
22816
22816
|
}
|
|
22817
22817
|
t.prototype.encoder = i, t.prototype.decoder = s;
|
|
22818
|
-
var e =
|
|
22818
|
+
var e = Ly().StringDecoder;
|
|
22819
22819
|
function s(h, l) {
|
|
22820
22820
|
this.decoder = new e(l.enc);
|
|
22821
22821
|
}
|
|
@@ -22999,10 +22999,10 @@ function Iy() {
|
|
|
22999
22999
|
}
|
|
23000
23000
|
return Oe;
|
|
23001
23001
|
}
|
|
23002
|
-
var ri = {},
|
|
23002
|
+
var ri = {}, Rc;
|
|
23003
23003
|
function By() {
|
|
23004
|
-
if (
|
|
23005
|
-
|
|
23004
|
+
if (Rc) return ri;
|
|
23005
|
+
Rc = 1;
|
|
23006
23006
|
var n = en.Buffer;
|
|
23007
23007
|
ri.utf16be = t;
|
|
23008
23008
|
function t() {
|
|
@@ -23085,10 +23085,10 @@ function By() {
|
|
|
23085
23085
|
}
|
|
23086
23086
|
return ri;
|
|
23087
23087
|
}
|
|
23088
|
-
var is = {},
|
|
23089
|
-
function
|
|
23090
|
-
if (
|
|
23091
|
-
|
|
23088
|
+
var is = {}, Dc;
|
|
23089
|
+
function Ry() {
|
|
23090
|
+
if (Dc) return is;
|
|
23091
|
+
Dc = 1;
|
|
23092
23092
|
var n = en.Buffer;
|
|
23093
23093
|
is.utf7 = t, is.unicode11utf7 = "utf7";
|
|
23094
23094
|
function t(g, x) {
|
|
@@ -23182,7 +23182,7 @@ function Dy() {
|
|
|
23182
23182
|
}, is;
|
|
23183
23183
|
}
|
|
23184
23184
|
var Br = {}, Uc;
|
|
23185
|
-
function
|
|
23185
|
+
function Dy() {
|
|
23186
23186
|
if (Uc) return Br;
|
|
23187
23187
|
Uc = 1;
|
|
23188
23188
|
var n = en.Buffer;
|
|
@@ -23222,9 +23222,9 @@ function Ry() {
|
|
|
23222
23222
|
}, s.prototype.end = function() {
|
|
23223
23223
|
}, Br;
|
|
23224
23224
|
}
|
|
23225
|
-
var
|
|
23225
|
+
var Rr, Pc;
|
|
23226
23226
|
function Uy() {
|
|
23227
|
-
return Pc || (Pc = 1,
|
|
23227
|
+
return Pc || (Pc = 1, Rr = {
|
|
23228
23228
|
// Not supported by iconv, not sure why.
|
|
23229
23229
|
10029: "maccenteuro",
|
|
23230
23230
|
maccenteuro: {
|
|
@@ -23369,11 +23369,11 @@ function Uy() {
|
|
|
23369
23369
|
ibm1051: "hproman8",
|
|
23370
23370
|
mac: "macintosh",
|
|
23371
23371
|
csmacintosh: "macintosh"
|
|
23372
|
-
}),
|
|
23372
|
+
}), Rr;
|
|
23373
23373
|
}
|
|
23374
|
-
var
|
|
23374
|
+
var Dr, Nc;
|
|
23375
23375
|
function Py() {
|
|
23376
|
-
return Nc || (Nc = 1,
|
|
23376
|
+
return Nc || (Nc = 1, Dr = {
|
|
23377
23377
|
437: "cp437",
|
|
23378
23378
|
737: "cp737",
|
|
23379
23379
|
775: "cp775",
|
|
@@ -23825,7 +23825,7 @@ function Py() {
|
|
|
23825
23825
|
type: "_sbcs",
|
|
23826
23826
|
chars: "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
|
|
23827
23827
|
}
|
|
23828
|
-
}),
|
|
23828
|
+
}), Dr;
|
|
23829
23829
|
}
|
|
23830
23830
|
var Ur = {}, zc;
|
|
23831
23831
|
function Ny() {
|
|
@@ -23874,11 +23874,11 @@ function Ny() {
|
|
|
23874
23874
|
var H = {};
|
|
23875
23875
|
if (f.encodeSkipVals)
|
|
23876
23876
|
for (var g = 0; g < f.encodeSkipVals.length; g++) {
|
|
23877
|
-
var
|
|
23878
|
-
if (typeof
|
|
23879
|
-
H[
|
|
23877
|
+
var R = f.encodeSkipVals[g];
|
|
23878
|
+
if (typeof R == "number")
|
|
23879
|
+
H[R] = !0;
|
|
23880
23880
|
else
|
|
23881
|
-
for (var w =
|
|
23881
|
+
for (var w = R.from; w <= R.to; w++)
|
|
23882
23882
|
H[w] = !0;
|
|
23883
23883
|
}
|
|
23884
23884
|
if (this._fillEncodeTable(0, 0, H), f.encodeAdd)
|
|
@@ -24043,8 +24043,8 @@ function Ny() {
|
|
|
24043
24043
|
throw new Error("iconv-lite internal error: invalid decoding table value " + S + " at " + d + "/" + F);
|
|
24044
24044
|
if (S >= 65536) {
|
|
24045
24045
|
S -= 65536;
|
|
24046
|
-
var
|
|
24047
|
-
p[w++] =
|
|
24046
|
+
var R = 55296 | S >> 10;
|
|
24047
|
+
p[w++] = R & 255, p[w++] = R >> 8, S = 56320 | S & 1023;
|
|
24048
24048
|
}
|
|
24049
24049
|
p[w++] = S & 255, p[w++] = S >> 8, d = 0, b = v + 1;
|
|
24050
24050
|
}
|
|
@@ -32584,11 +32584,11 @@ var Wc;
|
|
|
32584
32584
|
function Yy() {
|
|
32585
32585
|
return Wc || (Wc = 1, function(n) {
|
|
32586
32586
|
for (var t = jl, e = [
|
|
32587
|
-
|
|
32587
|
+
_y(),
|
|
32588
32588
|
Iy(),
|
|
32589
32589
|
By(),
|
|
32590
|
-
Dy(),
|
|
32591
32590
|
Ry(),
|
|
32591
|
+
Dy(),
|
|
32592
32592
|
Uy(),
|
|
32593
32593
|
Py(),
|
|
32594
32594
|
Ny(),
|
|
@@ -32597,7 +32597,7 @@ function Yy() {
|
|
|
32597
32597
|
var i = e[s];
|
|
32598
32598
|
t(n, i);
|
|
32599
32599
|
}
|
|
32600
|
-
}(
|
|
32600
|
+
}(Lr)), Lr;
|
|
32601
32601
|
}
|
|
32602
32602
|
var zr, qc;
|
|
32603
32603
|
function $y() {
|
|
@@ -32674,7 +32674,7 @@ const Zy = {}, Jy = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
32674
32674
|
default: Zy
|
|
32675
32675
|
}, Symbol.toStringTag, { value: "Module" })), Ky = /* @__PURE__ */ by(Jy);
|
|
32676
32676
|
(function(n) {
|
|
32677
|
-
var t = en.Buffer, e =
|
|
32677
|
+
var t = en.Buffer, e = La, s = jl, i = n.exports;
|
|
32678
32678
|
i.encodings = null, i.defaultCharUnicode = "�", i.defaultCharSingleByte = "?", i.encode = function(o, c, h) {
|
|
32679
32679
|
o = "" + (o || "");
|
|
32680
32680
|
var l = i.getEncoder(c, h), u = l.write(o), f = l.end();
|
|
@@ -33071,7 +33071,7 @@ class he {
|
|
|
33071
33071
|
this.fontMapping = t;
|
|
33072
33072
|
}
|
|
33073
33073
|
setDefaultFonts(t) {
|
|
33074
|
-
if (typeof t == "string" &&
|
|
33074
|
+
if (typeof t == "string" && Do(t)) {
|
|
33075
33075
|
this.defaultFonts = new Set(Qr[t]), this.symbolFonts = new Set(br[t]);
|
|
33076
33076
|
return;
|
|
33077
33077
|
}
|
|
@@ -33079,7 +33079,7 @@ class he {
|
|
|
33079
33079
|
this.defaultFonts = new Set(e);
|
|
33080
33080
|
}
|
|
33081
33081
|
setSymbolFonts(t) {
|
|
33082
|
-
if (typeof t == "string" &&
|
|
33082
|
+
if (typeof t == "string" && Do(t)) {
|
|
33083
33083
|
this.symbolFonts = new Set(br[t]);
|
|
33084
33084
|
return;
|
|
33085
33085
|
}
|
|
@@ -33328,28 +33328,34 @@ class he {
|
|
|
33328
33328
|
}
|
|
33329
33329
|
/**
|
|
33330
33330
|
* Tries to find the specified font. If not found, uses a replacement font and returns its name.
|
|
33331
|
+
*
|
|
33332
|
+
* When the requested face is not loaded, the original name is recorded in
|
|
33333
|
+
* {@link missedFonts} and {@link events.fontNotFound} is dispatched (once per
|
|
33334
|
+
* miss cycle) so hosts can surface missing-font UI. Lazy loading still
|
|
33335
|
+
* schedules {@link requestFont} for the face that will be fetched.
|
|
33336
|
+
*
|
|
33331
33337
|
* @param fontName - The font name to find
|
|
33332
33338
|
* @returns The original font name if found, or the replacement font name if not found
|
|
33333
33339
|
*/
|
|
33334
33340
|
findAndReplaceFont(t) {
|
|
33335
|
-
const e = t == null ? "" : String(t);
|
|
33336
|
-
let
|
|
33337
|
-
if (s == null) {
|
|
33338
|
-
const
|
|
33339
|
-
if (
|
|
33340
|
-
return
|
|
33341
|
+
const e = t == null ? "" : String(t), s = this.stripFontFileExtension(e);
|
|
33342
|
+
let i = this.loadedFontMap.get(e.toLowerCase());
|
|
33343
|
+
if (i == null && s && s !== e && (i = this.loadedFontMap.get(s.toLowerCase())), i == null) {
|
|
33344
|
+
const c = this.fontMapping[e];
|
|
33345
|
+
if (c)
|
|
33346
|
+
return i = this.loadedFontMap.get(c.toLowerCase()), !i && this.lazyFontLoading && this.requestFont(c), this.recordMissedFonts(s, !1), c;
|
|
33341
33347
|
}
|
|
33342
|
-
if (s)
|
|
33343
|
-
return e;
|
|
33344
|
-
this.lazyFontLoading && e && this.requestFont(e);
|
|
33345
|
-
const i = this.pickLoadedDefaultFont(!0);
|
|
33346
33348
|
if (i)
|
|
33347
|
-
return
|
|
33348
|
-
|
|
33349
|
+
return e;
|
|
33350
|
+
this.recordMissedFonts(s, !0);
|
|
33351
|
+
const r = this.pickLoadedDefaultFont(!0);
|
|
33349
33352
|
if (r)
|
|
33350
33353
|
return r;
|
|
33351
|
-
const a =
|
|
33352
|
-
|
|
33354
|
+
const a = this.pickLoadedDefaultFont(!1);
|
|
33355
|
+
if (a)
|
|
33356
|
+
return a;
|
|
33357
|
+
const o = [...this.defaultFonts][0] ?? "";
|
|
33358
|
+
return o && this.lazyFontLoading && this.requestFont(o), o;
|
|
33353
33359
|
}
|
|
33354
33360
|
/**
|
|
33355
33361
|
* Returns the first loaded font from {@link defaultFonts}.
|
|
@@ -33496,15 +33502,72 @@ class he {
|
|
|
33496
33502
|
isFontLoaded(t) {
|
|
33497
33503
|
return this.loadedFontMap.has(t.toLowerCase());
|
|
33498
33504
|
}
|
|
33505
|
+
/**
|
|
33506
|
+
* Applies a missed-font report from another isolate (e.g. a web worker).
|
|
33507
|
+
* Updates {@link missedFonts} and dispatches {@link events.fontNotFound} on
|
|
33508
|
+
* first sighting. Does not call {@link requestFont} — the remote isolate owns loading.
|
|
33509
|
+
*/
|
|
33510
|
+
applyRemoteFontNotFound(t, e = 1) {
|
|
33511
|
+
if (!t)
|
|
33512
|
+
return;
|
|
33513
|
+
const s = this.missedFonts[t] ?? 0;
|
|
33514
|
+
this.missedFonts[t] = Math.max(s, e), s === 0 && this.events.fontNotFound.dispatch({
|
|
33515
|
+
fontName: t,
|
|
33516
|
+
count: this.missedFonts[t]
|
|
33517
|
+
});
|
|
33518
|
+
}
|
|
33519
|
+
/**
|
|
33520
|
+
* Clears a missed-font entry after a remote isolate reports the font loaded.
|
|
33521
|
+
* Call before dispatching {@link events.fontLoaded} on the main thread.
|
|
33522
|
+
*/
|
|
33523
|
+
applyRemoteFontLoaded(t) {
|
|
33524
|
+
t && (this.clearMissedFontEntry(t), this.fontRequestFailed.delete(t.toLowerCase()));
|
|
33525
|
+
}
|
|
33526
|
+
/**
|
|
33527
|
+
* Replaces session-scoped missed-font bookkeeping without dispatching events.
|
|
33528
|
+
* Entries for faces that are already loaded are dropped.
|
|
33529
|
+
*/
|
|
33530
|
+
replaceMissedFonts(t) {
|
|
33531
|
+
const e = {};
|
|
33532
|
+
for (const [s, i] of Object.entries(t ?? {}))
|
|
33533
|
+
!s || this.isFontLoaded(s) || (e[s] = i);
|
|
33534
|
+
this.missedFonts = e;
|
|
33535
|
+
}
|
|
33536
|
+
/**
|
|
33537
|
+
* Clears {@link missedFonts}. Does not unload faces or cancel in-flight loads.
|
|
33538
|
+
*/
|
|
33539
|
+
clearMissedFonts() {
|
|
33540
|
+
this.missedFonts = {};
|
|
33541
|
+
}
|
|
33542
|
+
/**
|
|
33543
|
+
* Strips a trailing `.ttf` / `.otf` / `.woff` / `.shx` extension when present.
|
|
33544
|
+
* Matches the normalization used by {@link getFontByName}.
|
|
33545
|
+
*/
|
|
33546
|
+
stripFontFileExtension(t) {
|
|
33547
|
+
if (!t)
|
|
33548
|
+
return t;
|
|
33549
|
+
const e = t.lastIndexOf(".");
|
|
33550
|
+
return e > 0 && e == t.length - 4 || e == t.length - 5 ? t.substring(0, e) : t;
|
|
33551
|
+
}
|
|
33552
|
+
/**
|
|
33553
|
+
* Removes {@link missedFonts} entries whose name matches `fontName`
|
|
33554
|
+
* case-insensitively (CAD style names and loaded face names often differ in case).
|
|
33555
|
+
*/
|
|
33556
|
+
clearMissedFontEntry(t) {
|
|
33557
|
+
const e = t.toLowerCase();
|
|
33558
|
+
for (const s of Object.keys(this.missedFonts))
|
|
33559
|
+
s.toLowerCase() === e && delete this.missedFonts[s];
|
|
33560
|
+
}
|
|
33499
33561
|
/**
|
|
33500
33562
|
* Records a font that was requested but not found
|
|
33501
33563
|
* @param fontName - The name of the font that was not found
|
|
33564
|
+
* @param scheduleLoad - When true (default), also {@link requestFont} on first miss if lazy loading is on
|
|
33502
33565
|
*/
|
|
33503
|
-
recordMissedFonts(t) {
|
|
33566
|
+
recordMissedFonts(t, e = !0) {
|
|
33504
33567
|
t && (this.missedFonts[t] || (this.missedFonts[t] = 0), this.missedFonts[t]++, this.missedFonts[t] === 1 && (this.events.fontNotFound.dispatch({
|
|
33505
33568
|
fontName: t,
|
|
33506
33569
|
count: this.missedFonts[t]
|
|
33507
|
-
}), this.lazyFontLoading && this.requestFont(t)));
|
|
33570
|
+
}), e && this.lazyFontLoading && this.requestFont(t)));
|
|
33508
33571
|
}
|
|
33509
33572
|
/**
|
|
33510
33573
|
* Loads a single font
|
|
@@ -33530,7 +33593,7 @@ class he {
|
|
|
33530
33593
|
const c = xe.instance.createFont(s);
|
|
33531
33594
|
c && (t.name.forEach((h) => c.names.add(h)), this.registerFontInMap(i, c), this.enableFontCache && await qe.instance.set(i, s));
|
|
33532
33595
|
}
|
|
33533
|
-
r !== this.loadEpoch || !this.isFontLoaded(i) || (
|
|
33596
|
+
r !== this.loadEpoch || !this.isFontLoaded(i) || (this.clearMissedFontEntry(i), this.fontRequestFailed.delete(i.toLowerCase()), this.events.fontLoaded.dispatch({
|
|
33534
33597
|
fontName: i
|
|
33535
33598
|
}));
|
|
33536
33599
|
}
|
|
@@ -33643,7 +33706,7 @@ class he {
|
|
|
33643
33706
|
const e = /* @__PURE__ */ new Set();
|
|
33644
33707
|
for (const a of this.loadedFontMap.values())
|
|
33645
33708
|
e.add(a);
|
|
33646
|
-
const s = Array.from(e).map((a) => a.estimateMemoryUsage()), i = (t == null ? void 0 : t.materials) ??
|
|
33709
|
+
const s = Array.from(e).map((a) => a.estimateMemoryUsage()), i = (t == null ? void 0 : t.materials) ?? Dh(), r = s.reduce((a, o) => a + o.estimatedBytes, 0);
|
|
33647
33710
|
return {
|
|
33648
33711
|
id: (t == null ? void 0 : t.id) ?? "main",
|
|
33649
33712
|
inFlightRequests: t == null ? void 0 : t.inFlightRequests,
|
|
@@ -33799,7 +33862,7 @@ class tx {
|
|
|
33799
33862
|
}
|
|
33800
33863
|
}
|
|
33801
33864
|
function ex(n) {
|
|
33802
|
-
return n && "getMaterialStats" in n && typeof n.getMaterialStats == "function" ? n.getMaterialStats() :
|
|
33865
|
+
return n && "getMaterialStats" in n && typeof n.getMaterialStats == "function" ? n.getMaterialStats() : Dh();
|
|
33803
33866
|
}
|
|
33804
33867
|
function nx(n, t) {
|
|
33805
33868
|
const e = t.materials ?? ex(t.styleManager);
|
|
@@ -33885,7 +33948,7 @@ function Yc(n, t, e) {
|
|
|
33885
33948
|
const s = [];
|
|
33886
33949
|
if (n.filter((f) => f.char !== di).forEach((f) => {
|
|
33887
33950
|
const p = rx(
|
|
33888
|
-
new
|
|
33951
|
+
new At().copy(f.box).applyMatrix4(t)
|
|
33889
33952
|
);
|
|
33890
33953
|
p && s.push({
|
|
33891
33954
|
type: dt.CHAR,
|
|
@@ -33905,7 +33968,7 @@ function Yc(n, t, e) {
|
|
|
33905
33968
|
}
|
|
33906
33969
|
const c = s.slice(0, a).filter(i), h = s.slice(o + 1).filter(i), l = s.slice(a, o + 1).filter(r);
|
|
33907
33970
|
if (l.length === 0) return [...c, ...h];
|
|
33908
|
-
const u = new
|
|
33971
|
+
const u = new At().copy(l[0].box);
|
|
33909
33972
|
return l.slice(1).forEach((f) => u.union(f.box)), [
|
|
33910
33973
|
...c,
|
|
33911
33974
|
{
|
|
@@ -34052,8 +34115,8 @@ function px(n) {
|
|
|
34052
34115
|
return n;
|
|
34053
34116
|
}
|
|
34054
34117
|
}
|
|
34055
|
-
const dx = /* @__PURE__ */ new E(), Kc = /* @__PURE__ */ new mt(), Qc = /* @__PURE__ */ new mt(), Hr = /* @__PURE__ */ new mt(), Gr = /* @__PURE__ */ new mt(), th = /* @__PURE__ */ new mt(), eh = /* @__PURE__ */ new
|
|
34056
|
-
class
|
|
34118
|
+
const dx = /* @__PURE__ */ new E(), Kc = /* @__PURE__ */ new mt(), Qc = /* @__PURE__ */ new mt(), Hr = /* @__PURE__ */ new mt(), Gr = /* @__PURE__ */ new mt(), th = /* @__PURE__ */ new mt(), eh = /* @__PURE__ */ new At();
|
|
34119
|
+
class Ra extends vs {
|
|
34057
34120
|
/**
|
|
34058
34121
|
* Creates a new RenderContext instance with optional initial values.
|
|
34059
34122
|
* @param init - Partial object containing initial values for context properties
|
|
@@ -34067,7 +34130,7 @@ class Da extends vs {
|
|
|
34067
34130
|
* @returns A new RenderContext instance with identical property values
|
|
34068
34131
|
*/
|
|
34069
34132
|
clone() {
|
|
34070
|
-
const t = new
|
|
34133
|
+
const t = new Ra();
|
|
34071
34134
|
return t.continueStroke = this.continueStroke, t.color = this.color.copy(), t.align = this.align, t.fontFace = { ...this.fontFace }, t.capHeight = { ...this.capHeight }, t.widthFactor = { ...this.widthFactor }, t.charTrackingFactor = { ...this.charTrackingFactor }, t.oblique = this.oblique, t.paragraph = { ...this.paragraph }, t.fontScaleFactor = this.fontScaleFactor, t.fontSize = this.fontSize, t.fontSizeScaleFactor = this.fontSizeScaleFactor, t.blankWidth = this.blankWidth, t;
|
|
34072
34135
|
}
|
|
34073
34136
|
/**
|
|
@@ -34098,7 +34161,7 @@ class nh {
|
|
|
34098
34161
|
constructor(t, e, s, i, r) {
|
|
34099
34162
|
this._contextStack = [], this._maxFontSize = 0, this._lineBatchEntries = [], this._currentIndent = 0, this._currentLeftMargin = 0, this._currentRightMargin = 0, this._style = t, this._colorSettings = e, this._styleManager = s, this._fontManager = i, this._options = r, this._totalHeight = 0, this._hOffset = 0, this._maxLineAdvance = 0, this._vOffset = 0, this._lineCount = 1, this._currentLineObjects = [];
|
|
34100
34163
|
const a = this.fontManager.findAndReplaceFont(this.textStyle.font).toLowerCase();
|
|
34101
|
-
this._currentContext = new
|
|
34164
|
+
this._currentContext = new Ra({
|
|
34102
34165
|
fontScaleFactor: this.fontManager.getFontScaleFactor(a),
|
|
34103
34166
|
fontSize: r.fontSize,
|
|
34104
34167
|
fontSizeScaleFactor: 1,
|
|
@@ -34607,7 +34670,7 @@ class nh {
|
|
|
34607
34670
|
const c = s.clone();
|
|
34608
34671
|
c.applyMatrix4(i), r.push(c), this._options.collectCharBoxes !== !1 && (c.userData.char = e, c.boundingBox || c.computeBoundingBox(), a.push({
|
|
34609
34672
|
type: dt.CHAR,
|
|
34610
|
-
box: new
|
|
34673
|
+
box: new At().copy(c.boundingBox),
|
|
34611
34674
|
char: e,
|
|
34612
34675
|
children: []
|
|
34613
34676
|
}), this._lastCharBoxTarget = "mesh");
|
|
@@ -34615,7 +34678,7 @@ class nh {
|
|
|
34615
34678
|
}
|
|
34616
34679
|
this._lineBatchEntries.push({ geometry: s, matrix: i }), this._options.collectCharBoxes !== !1 && (s.boundingBox || s.computeBoundingBox(), eh.copy(s.boundingBox).applyMatrix4(i), o.push({
|
|
34617
34680
|
type: dt.CHAR,
|
|
34618
|
-
box: new
|
|
34681
|
+
box: new At().copy(eh),
|
|
34619
34682
|
char: e,
|
|
34620
34683
|
children: []
|
|
34621
34684
|
}), this._lastCharBoxTarget = "line");
|
|
@@ -34856,28 +34919,28 @@ class nh {
|
|
|
34856
34919
|
} else if (a && o) {
|
|
34857
34920
|
const v = this._currentContext.fontScaleFactor || 1, w = (this._maxFontSize || this.currentFontSize) / v, F = Math.abs(this.currentLayoutFontSize - w) < 1e-6;
|
|
34858
34921
|
F && (this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams());
|
|
34859
|
-
const M = Math.max(d, g), O = 0, I = 0, H = this.currentLayoutFontSize,
|
|
34922
|
+
const M = Math.max(d, g), O = 0, I = 0, H = this.currentLayoutFontSize, R = l - w + H, W = R + this.currentFontSize, J = [], D = [], U = [], P = [];
|
|
34860
34923
|
this._hOffset = h + O, this._vOffset = W;
|
|
34861
34924
|
for (const ut of a)
|
|
34862
34925
|
this.processChar(
|
|
34863
34926
|
ut,
|
|
34864
34927
|
J,
|
|
34865
|
-
|
|
34928
|
+
D,
|
|
34866
34929
|
U,
|
|
34867
34930
|
P
|
|
34868
34931
|
);
|
|
34869
|
-
e.push(...J), s.push(...
|
|
34870
|
-
const Q = [], yt = [],
|
|
34871
|
-
this._hOffset = h + I, this._vOffset =
|
|
34932
|
+
e.push(...J), s.push(...D), i.push(...U), r.push(...P);
|
|
34933
|
+
const Q = [], yt = [], Pt = [], Ct = [];
|
|
34934
|
+
this._hOffset = h + I, this._vOffset = R;
|
|
34872
34935
|
for (const ut of o)
|
|
34873
34936
|
this.processChar(
|
|
34874
34937
|
ut,
|
|
34875
34938
|
Q,
|
|
34876
34939
|
yt,
|
|
34877
|
-
|
|
34940
|
+
Pt,
|
|
34878
34941
|
Ct
|
|
34879
34942
|
);
|
|
34880
|
-
e.push(...Q), s.push(...yt), i.push(...
|
|
34943
|
+
e.push(...Q), s.push(...yt), i.push(...Pt), r.push(...Ct), this._hOffset = h + M, F && (this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams());
|
|
34881
34944
|
}
|
|
34882
34945
|
} else {
|
|
34883
34946
|
const v = [], w = [], F = [], M = [];
|
|
@@ -34900,7 +34963,7 @@ class nh {
|
|
|
34900
34963
|
i,
|
|
34901
34964
|
r
|
|
34902
34965
|
);
|
|
34903
|
-
const O = [], I = [], H = [],
|
|
34966
|
+
const O = [], I = [], H = [], R = [];
|
|
34904
34967
|
this._hOffset = h + S, this._vOffset = this.convertTopAlignedVOffset(
|
|
34905
34968
|
l - this.currentFontSize * 0.6,
|
|
34906
34969
|
this.currentFontSize
|
|
@@ -34911,9 +34974,9 @@ class nh {
|
|
|
34911
34974
|
O,
|
|
34912
34975
|
I,
|
|
34913
34976
|
H,
|
|
34914
|
-
|
|
34977
|
+
R
|
|
34915
34978
|
);
|
|
34916
|
-
if (e.push(...O), s.push(...I), i.push(...H), r.push(...
|
|
34979
|
+
if (e.push(...O), s.push(...I), i.push(...H), r.push(...R), c === "/" || c === "#") {
|
|
34917
34980
|
const W = new Dt(), J = new Float32Array([
|
|
34918
34981
|
h,
|
|
34919
34982
|
l - this.currentFontSize * 0.8 + this.defaultFontSize * oi,
|
|
@@ -34945,7 +35008,7 @@ class nh {
|
|
|
34945
35008
|
*/
|
|
34946
35009
|
recordStackDivider(t, e, s, i, r) {
|
|
34947
35010
|
if (this._options.collectCharBoxes === !1) return;
|
|
34948
|
-
const a = e - this.currentFontSize * 0.8 + this.defaultFontSize * oi, o = new
|
|
35011
|
+
const a = e - this.currentFontSize * 0.8 + this.defaultFontSize * oi, o = new At(
|
|
34949
35012
|
new E(t, a, 0),
|
|
34950
35013
|
new E(t + s, a, 0)
|
|
34951
35014
|
);
|
|
@@ -34980,7 +35043,7 @@ class nh {
|
|
|
34980
35043
|
*/
|
|
34981
35044
|
processBlank(t, e) {
|
|
34982
35045
|
if (this._options.collectCharBoxes !== !1) {
|
|
34983
|
-
const s = this._hOffset, i = this.flowDirection == oe.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.currentLayoutFontSize, r = new
|
|
35046
|
+
const s = this._hOffset, i = this.flowDirection == oe.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.currentLayoutFontSize, r = new At(
|
|
34984
35047
|
new E(s, i, 0),
|
|
34985
35048
|
new E(
|
|
34986
35049
|
s + this.currentBlankAdvance,
|
|
@@ -35508,8 +35571,8 @@ function bx(n) {
|
|
|
35508
35571
|
return String.fromCharCode(s);
|
|
35509
35572
|
});
|
|
35510
35573
|
}
|
|
35511
|
-
const as = /* @__PURE__ */ new E(),
|
|
35512
|
-
class
|
|
35574
|
+
const as = /* @__PURE__ */ new E(), Le = /* @__PURE__ */ new E(), _e = /* @__PURE__ */ new E(), sh = /* @__PURE__ */ new E(1, 0, 0);
|
|
35575
|
+
class Da extends Xt {
|
|
35513
35576
|
/**
|
|
35514
35577
|
* Extracts all unique font names used in an MText string.
|
|
35515
35578
|
* This function searches for font commands in the format \f{fontname}| or \f{fontname}; and returns a set of unique font names.
|
|
@@ -35542,7 +35605,7 @@ class Ra extends Xt {
|
|
|
35542
35605
|
byBlockColor: r.byBlockColor,
|
|
35543
35606
|
layer: r.layer,
|
|
35544
35607
|
color: r.color.copy()
|
|
35545
|
-
}, this._box = new
|
|
35608
|
+
}, this._box = new At(), this._layoutData = void 0, this._mtextData = t, this._fontsInStyleLoaded = !1;
|
|
35546
35609
|
}
|
|
35547
35610
|
/**
|
|
35548
35611
|
* Gets the font manager instance associated with this MText object.
|
|
@@ -35568,7 +35631,7 @@ class Ra extends Xt {
|
|
|
35568
35631
|
* {@link FontManager.awaitFontsBeforeDraw} to wait for referenced fonts first.
|
|
35569
35632
|
*/
|
|
35570
35633
|
async asyncDraw(t) {
|
|
35571
|
-
const e = Array.from(
|
|
35634
|
+
const e = Array.from(Da.getFonts(this._mtextData.text || "", !0));
|
|
35572
35635
|
if (!this._fontsInStyleLoaded) {
|
|
35573
35636
|
if (this._style.font) {
|
|
35574
35637
|
const r = this.getFontName(this._style.font);
|
|
@@ -35710,7 +35773,7 @@ class Ra extends Xt {
|
|
|
35710
35773
|
var p;
|
|
35711
35774
|
let r = Jc(e);
|
|
35712
35775
|
t.updateWorldMatrix(!0, !0);
|
|
35713
|
-
const a = new
|
|
35776
|
+
const a = new At().setFromObject(t);
|
|
35714
35777
|
if (!Number.isFinite(r)) {
|
|
35715
35778
|
const d = (p = t.userData) == null ? void 0 : p.logicalAdvanceWidth, g = typeof d == "number" && d > 0 ? d : a.max.x - a.min.x;
|
|
35716
35779
|
r = Number.isFinite(g) && g > 0 ? g : 0;
|
|
@@ -35995,9 +36058,9 @@ class Ra extends Xt {
|
|
|
35995
36058
|
t.updateWorldMatrix(!1, !1);
|
|
35996
36059
|
const i = (c = (o = t.userData) == null ? void 0 : o.layout) == null ? void 0 : c.chars, r = (h = t.userData) == null ? void 0 : h.lineLayouts;
|
|
35997
36060
|
if (r && r.length > 0 && r.forEach((f) => {
|
|
35998
|
-
as.set(0, f.y, 0).applyMatrix4(t.matrixWorld),
|
|
36061
|
+
as.set(0, f.y, 0).applyMatrix4(t.matrixWorld), Le.set(0, f.y - f.height / 2, 0).applyMatrix4(t.matrixWorld), _e.set(0, f.y + f.height / 2, 0).applyMatrix4(t.matrixWorld), s.push({
|
|
35999
36062
|
y: as.y,
|
|
36000
|
-
height: Math.abs(
|
|
36063
|
+
height: Math.abs(_e.y - Le.y),
|
|
36001
36064
|
breakIndex: f.breakIndex
|
|
36002
36065
|
});
|
|
36003
36066
|
}), i && i.length > 0) {
|
|
@@ -36013,7 +36076,7 @@ class Ra extends Xt {
|
|
|
36013
36076
|
const f = t.geometry;
|
|
36014
36077
|
if (!((u = f.userData) != null && u.isDecoration)) {
|
|
36015
36078
|
f.boundingBox === null && f.computeBoundingBox();
|
|
36016
|
-
const p = new
|
|
36079
|
+
const p = new At().copy(f.boundingBox);
|
|
36017
36080
|
p.applyMatrix4(t.matrixWorld), e.push({
|
|
36018
36081
|
type: dt.CHAR,
|
|
36019
36082
|
box: p,
|
|
@@ -36054,7 +36117,7 @@ class Ra extends Xt {
|
|
|
36054
36117
|
const s = (o = t.userData) == null ? void 0 : o.logicalBounds;
|
|
36055
36118
|
if (s) {
|
|
36056
36119
|
e.hasLogicalBounds = !0;
|
|
36057
|
-
const p = new
|
|
36120
|
+
const p = new At(
|
|
36058
36121
|
new E(s.minX, s.minY, 0),
|
|
36059
36122
|
new E(s.maxX, s.maxY, 0)
|
|
36060
36123
|
);
|
|
@@ -36062,7 +36125,7 @@ class Ra extends Xt {
|
|
|
36062
36125
|
}
|
|
36063
36126
|
const i = (c = t.userData) == null ? void 0 : c.lineLayouts;
|
|
36064
36127
|
i && i.length > 0 && i.forEach((p) => {
|
|
36065
|
-
|
|
36128
|
+
Le.set(0, p.y - p.height / 2, 0).applyMatrix4(t.matrixWorld), _e.set(0, p.y + p.height / 2, 0).applyMatrix4(t.matrixWorld), e.hasLine = !0, e.minX = Math.min(e.minX, Le.x, _e.x), e.maxX = Math.max(e.maxX, Le.x, _e.x), e.minY = Math.min(e.minY, Le.y, _e.y), e.maxY = Math.max(e.maxY, Le.y, _e.y), e.minZ = Math.min(e.minZ, Le.z, _e.z), e.maxZ = Math.max(e.maxZ, Le.z, _e.z);
|
|
36066
36129
|
});
|
|
36067
36130
|
const r = (l = (h = t.userData) == null ? void 0 : h.layout) == null ? void 0 : l.chars;
|
|
36068
36131
|
if (r && r.length > 0) {
|
|
@@ -36080,7 +36143,7 @@ class Ra extends Xt {
|
|
|
36080
36143
|
const p = t.geometry;
|
|
36081
36144
|
if (!((f = p.userData) != null && f.isDecoration)) {
|
|
36082
36145
|
p.boundingBox === null && p.computeBoundingBox();
|
|
36083
|
-
const d = new
|
|
36146
|
+
const d = new At().copy(p.boundingBox);
|
|
36084
36147
|
d.applyMatrix4(t.matrixWorld), this.box.union(d);
|
|
36085
36148
|
}
|
|
36086
36149
|
}
|
|
@@ -36126,8 +36189,8 @@ class Ra extends Xt {
|
|
|
36126
36189
|
}
|
|
36127
36190
|
}
|
|
36128
36191
|
}
|
|
36129
|
-
const
|
|
36130
|
-
|
|
36192
|
+
const Ft = he.instance, ih = new sx();
|
|
36193
|
+
Ft.events.fontLoaded.addEventListener((n) => {
|
|
36131
36194
|
self.postMessage({
|
|
36132
36195
|
type: "fontLoaded",
|
|
36133
36196
|
id: "",
|
|
@@ -36135,6 +36198,14 @@ Gt.events.fontLoaded.addEventListener((n) => {
|
|
|
36135
36198
|
data: { fontName: n == null ? void 0 : n.fontName }
|
|
36136
36199
|
});
|
|
36137
36200
|
});
|
|
36201
|
+
Ft.events.fontNotFound.addEventListener((n) => {
|
|
36202
|
+
self.postMessage({
|
|
36203
|
+
type: "fontNotFound",
|
|
36204
|
+
id: "",
|
|
36205
|
+
success: !0,
|
|
36206
|
+
data: { fontName: n == null ? void 0 : n.fontName, count: n == null ? void 0 : n.count }
|
|
36207
|
+
});
|
|
36208
|
+
});
|
|
36138
36209
|
self.addEventListener("message", async (n) => {
|
|
36139
36210
|
const { type: t, id: e, data: s } = n.data;
|
|
36140
36211
|
try {
|
|
@@ -36142,11 +36213,11 @@ self.addEventListener("message", async (n) => {
|
|
|
36142
36213
|
case "render": {
|
|
36143
36214
|
if (!s) throw new Error("Missing data for render message");
|
|
36144
36215
|
const { mtextContent: i, textStyle: r, colorSettings: a } = s, o = vx(a);
|
|
36145
|
-
let c = new
|
|
36216
|
+
let c = new Da(
|
|
36146
36217
|
i,
|
|
36147
36218
|
r,
|
|
36148
36219
|
ih,
|
|
36149
|
-
|
|
36220
|
+
Ft,
|
|
36150
36221
|
o
|
|
36151
36222
|
);
|
|
36152
36223
|
await c.asyncDraw(), c.updateMatrixWorld(!0);
|
|
@@ -36165,8 +36236,8 @@ self.addEventListener("message", async (n) => {
|
|
|
36165
36236
|
case "loadFonts": {
|
|
36166
36237
|
if (!s) throw new Error("Missing data for loadFonts message");
|
|
36167
36238
|
const { fonts: i } = s;
|
|
36168
|
-
await
|
|
36169
|
-
const r = i.filter((a) =>
|
|
36239
|
+
await Ft.loadFontsByNames(i);
|
|
36240
|
+
const r = i.filter((a) => Ft.isFontLoaded(a));
|
|
36170
36241
|
self.postMessage({
|
|
36171
36242
|
type: "loadFonts",
|
|
36172
36243
|
id: e,
|
|
@@ -36178,13 +36249,13 @@ self.addEventListener("message", async (n) => {
|
|
|
36178
36249
|
case "setDefaultFonts": {
|
|
36179
36250
|
if (!s) throw new Error("Missing data for setDefaultFonts message");
|
|
36180
36251
|
const { fonts: i, symbolFonts: r } = s;
|
|
36181
|
-
|
|
36252
|
+
Ft.setDefaultFonts(i), Ft.setSymbolFonts(r), self.postMessage({
|
|
36182
36253
|
type: "setDefaultFonts",
|
|
36183
36254
|
id: e,
|
|
36184
36255
|
success: !0,
|
|
36185
36256
|
data: {
|
|
36186
|
-
fonts: [...
|
|
36187
|
-
symbolFonts: [...
|
|
36257
|
+
fonts: [...Ft.defaultFonts],
|
|
36258
|
+
symbolFonts: [...Ft.symbolFonts]
|
|
36188
36259
|
}
|
|
36189
36260
|
});
|
|
36190
36261
|
break;
|
|
@@ -36192,11 +36263,11 @@ self.addEventListener("message", async (n) => {
|
|
|
36192
36263
|
case "setLazyFontLoading": {
|
|
36193
36264
|
if (!s) throw new Error("Missing data for setLazyFontLoading message");
|
|
36194
36265
|
const { enabled: i } = s;
|
|
36195
|
-
|
|
36266
|
+
Ft.lazyFontLoading = i, self.postMessage({
|
|
36196
36267
|
type: "setLazyFontLoading",
|
|
36197
36268
|
id: e,
|
|
36198
36269
|
success: !0,
|
|
36199
|
-
data: { enabled:
|
|
36270
|
+
data: { enabled: Ft.lazyFontLoading }
|
|
36200
36271
|
});
|
|
36201
36272
|
break;
|
|
36202
36273
|
}
|
|
@@ -36204,18 +36275,18 @@ self.addEventListener("message", async (n) => {
|
|
|
36204
36275
|
if (!s)
|
|
36205
36276
|
throw new Error("Missing data for setAwaitFontsBeforeDraw message");
|
|
36206
36277
|
const { enabled: i } = s;
|
|
36207
|
-
|
|
36278
|
+
Ft.awaitFontsBeforeDraw = i, self.postMessage({
|
|
36208
36279
|
type: "setAwaitFontsBeforeDraw",
|
|
36209
36280
|
id: e,
|
|
36210
36281
|
success: !0,
|
|
36211
|
-
data: { enabled:
|
|
36282
|
+
data: { enabled: Ft.awaitFontsBeforeDraw }
|
|
36212
36283
|
});
|
|
36213
36284
|
break;
|
|
36214
36285
|
}
|
|
36215
36286
|
case "setFontUrl": {
|
|
36216
36287
|
if (!s) throw new Error("Missing data for setFontUrl message");
|
|
36217
36288
|
const { url: i } = s;
|
|
36218
|
-
|
|
36289
|
+
Ft.baseUrl = i, self.postMessage({
|
|
36219
36290
|
type: "setFontUrl",
|
|
36220
36291
|
id: e,
|
|
36221
36292
|
success: !0,
|
|
@@ -36223,6 +36294,16 @@ self.addEventListener("message", async (n) => {
|
|
|
36223
36294
|
});
|
|
36224
36295
|
break;
|
|
36225
36296
|
}
|
|
36297
|
+
case "setMissedFonts": {
|
|
36298
|
+
const { missedFonts: i } = s ?? {};
|
|
36299
|
+
Ft.replaceMissedFonts(i ?? {}), self.postMessage({
|
|
36300
|
+
type: "setMissedFonts",
|
|
36301
|
+
id: e,
|
|
36302
|
+
success: !0,
|
|
36303
|
+
data: { missedFonts: { ...Ft.missedFonts } }
|
|
36304
|
+
});
|
|
36305
|
+
break;
|
|
36306
|
+
}
|
|
36226
36307
|
case "getAvailableFonts": {
|
|
36227
36308
|
const i = await he.instance.getAvailableFonts();
|
|
36228
36309
|
self.postMessage({
|
|
@@ -36235,7 +36316,7 @@ self.addEventListener("message", async (n) => {
|
|
|
36235
36316
|
}
|
|
36236
36317
|
case "getMemoryStats": {
|
|
36237
36318
|
const i = nx(
|
|
36238
|
-
|
|
36319
|
+
Ft,
|
|
36239
36320
|
{
|
|
36240
36321
|
id: "worker",
|
|
36241
36322
|
styleManager: ih
|