@mlightcad/mtext-renderer 0.12.9 → 0.12.10
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 +197 -142
- package/dist/index.umd.cjs +9 -9
- package/dist/mtext-renderer-worker.js +269 -214
- package/lib/font/fontManager.d.ts +22 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2560,7 +2560,7 @@ const St = {
|
|
|
2560
2560
|
}
|
|
2561
2561
|
};
|
|
2562
2562
|
Be.DATABASE_NAME = "mlightcad", Be.DATABASE_VERSION = Kn[Kn.length - 1].version;
|
|
2563
|
-
let
|
|
2563
|
+
let ze = Be;
|
|
2564
2564
|
const Sc = 512;
|
|
2565
2565
|
function wc(t, e) {
|
|
2566
2566
|
return (t + e) * Sc;
|
|
@@ -2636,7 +2636,7 @@ var ma = new Jt(), ya = new Jt(), Vr = new Uint8Array(30), qr = new Uint16Array(
|
|
|
2636
2636
|
14,
|
|
2637
2637
|
1,
|
|
2638
2638
|
15
|
|
2639
|
-
]), Es = new Jt(),
|
|
2639
|
+
]), Es = new Jt(), $e = new Uint8Array(320);
|
|
2640
2640
|
function va(t, e, n, r) {
|
|
2641
2641
|
var s, i;
|
|
2642
2642
|
for (s = 0; s < n; ++s) t[s] = 0;
|
|
@@ -2669,7 +2669,7 @@ function Ac(t) {
|
|
|
2669
2669
|
var e = t.tag & 1;
|
|
2670
2670
|
return t.tag >>>= 1, e;
|
|
2671
2671
|
}
|
|
2672
|
-
function
|
|
2672
|
+
function Xe(t, e, n) {
|
|
2673
2673
|
if (!e)
|
|
2674
2674
|
return n;
|
|
2675
2675
|
for (; t.bitcount < 24; )
|
|
@@ -2688,33 +2688,33 @@ function Or(t, e) {
|
|
|
2688
2688
|
}
|
|
2689
2689
|
function Oc(t, e, n) {
|
|
2690
2690
|
var r, s, i, a, o, c;
|
|
2691
|
-
for (r =
|
|
2691
|
+
for (r = Xe(t, 5, 257), s = Xe(t, 5, 1), i = Xe(t, 4, 4), a = 0; a < 19; ++a) $e[a] = 0;
|
|
2692
2692
|
for (a = 0; a < i; ++a) {
|
|
2693
|
-
var l =
|
|
2694
|
-
|
|
2693
|
+
var l = Xe(t, 3, 0);
|
|
2694
|
+
$e[kc[a]] = l;
|
|
2695
2695
|
}
|
|
2696
|
-
for (Jn(Es,
|
|
2696
|
+
for (Jn(Es, $e, 0, 19), o = 0; o < r + s; ) {
|
|
2697
2697
|
var u = Or(t, Es);
|
|
2698
2698
|
switch (u) {
|
|
2699
2699
|
case 16:
|
|
2700
|
-
var f =
|
|
2701
|
-
for (c =
|
|
2702
|
-
|
|
2700
|
+
var f = $e[o - 1];
|
|
2701
|
+
for (c = Xe(t, 2, 3); c; --c)
|
|
2702
|
+
$e[o++] = f;
|
|
2703
2703
|
break;
|
|
2704
2704
|
case 17:
|
|
2705
|
-
for (c =
|
|
2706
|
-
|
|
2705
|
+
for (c = Xe(t, 3, 3); c; --c)
|
|
2706
|
+
$e[o++] = 0;
|
|
2707
2707
|
break;
|
|
2708
2708
|
case 18:
|
|
2709
|
-
for (c =
|
|
2710
|
-
|
|
2709
|
+
for (c = Xe(t, 7, 11); c; --c)
|
|
2710
|
+
$e[o++] = 0;
|
|
2711
2711
|
break;
|
|
2712
2712
|
default:
|
|
2713
|
-
|
|
2713
|
+
$e[o++] = u;
|
|
2714
2714
|
break;
|
|
2715
2715
|
}
|
|
2716
2716
|
}
|
|
2717
|
-
Jn(e,
|
|
2717
|
+
Jn(e, $e, 0, r), Jn(n, $e, r, s);
|
|
2718
2718
|
}
|
|
2719
2719
|
function Os(t, e, n) {
|
|
2720
2720
|
for (; ; ) {
|
|
@@ -2725,7 +2725,7 @@ function Os(t, e, n) {
|
|
|
2725
2725
|
t.dest[t.destLen++] = r;
|
|
2726
2726
|
else {
|
|
2727
2727
|
var s, i, a, o;
|
|
2728
|
-
for (r -= 257, s =
|
|
2728
|
+
for (r -= 257, s = Xe(t, Vr[r], qr[r]), i = Or(t, n), a = t.destLen - Xe(t, ba[i], xa[i]), o = a; o < a + s; ++o)
|
|
2729
2729
|
t.dest[t.destLen++] = t.dest[o];
|
|
2730
2730
|
}
|
|
2731
2731
|
}
|
|
@@ -2742,7 +2742,7 @@ function Lc(t) {
|
|
|
2742
2742
|
function Sa(t, e) {
|
|
2743
2743
|
var n = new Fc(t, e), r, s, i;
|
|
2744
2744
|
do {
|
|
2745
|
-
switch (r = Ac(n), s =
|
|
2745
|
+
switch (r = Ac(n), s = Xe(n, 2, 0), s) {
|
|
2746
2746
|
case 0:
|
|
2747
2747
|
i = Lc(n);
|
|
2748
2748
|
break;
|
|
@@ -3108,7 +3108,7 @@ function Ls(t, e) {
|
|
|
3108
3108
|
t || Fa(e);
|
|
3109
3109
|
}
|
|
3110
3110
|
var H = { fail: Fa, argument: Ls, assert: Ls }, Is = 32768, Rs = 2147483648, Bc = -32768, Mc = 32767 + 1 / 65536, Nt = {}, B = {}, z = {};
|
|
3111
|
-
function
|
|
3111
|
+
function je(t) {
|
|
3112
3112
|
return function() {
|
|
3113
3113
|
return t;
|
|
3114
3114
|
};
|
|
@@ -3116,11 +3116,11 @@ function qe(t) {
|
|
|
3116
3116
|
B.BYTE = function(t) {
|
|
3117
3117
|
return H.argument(t >= 0 && t <= 255, "Byte value should be between 0 and 255."), [t];
|
|
3118
3118
|
};
|
|
3119
|
-
z.BYTE =
|
|
3119
|
+
z.BYTE = je(1);
|
|
3120
3120
|
B.CHAR = function(t) {
|
|
3121
3121
|
return [t.charCodeAt(0)];
|
|
3122
3122
|
};
|
|
3123
|
-
z.CHAR =
|
|
3123
|
+
z.CHAR = je(1);
|
|
3124
3124
|
B.CHARARRAY = function(t) {
|
|
3125
3125
|
(t === null || typeof t > "u") && (t = "", console.warn("CHARARRAY with undefined or null value encountered and treated as an empty string. This is probably caused by a missing glyph name."));
|
|
3126
3126
|
const e = [];
|
|
@@ -3134,23 +3134,23 @@ z.CHARARRAY = function(t) {
|
|
|
3134
3134
|
B.USHORT = function(t) {
|
|
3135
3135
|
return [t >> 8 & 255, t & 255];
|
|
3136
3136
|
};
|
|
3137
|
-
z.USHORT =
|
|
3137
|
+
z.USHORT = je(2);
|
|
3138
3138
|
B.SHORT = function(t) {
|
|
3139
3139
|
return t >= Is && (t = -(2 * Is - t)), [t >> 8 & 255, t & 255];
|
|
3140
3140
|
};
|
|
3141
|
-
z.SHORT =
|
|
3141
|
+
z.SHORT = je(2);
|
|
3142
3142
|
B.UINT24 = function(t) {
|
|
3143
3143
|
return [t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
3144
3144
|
};
|
|
3145
|
-
z.UINT24 =
|
|
3145
|
+
z.UINT24 = je(3);
|
|
3146
3146
|
B.ULONG = function(t) {
|
|
3147
3147
|
return [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
3148
3148
|
};
|
|
3149
|
-
z.ULONG =
|
|
3149
|
+
z.ULONG = je(4);
|
|
3150
3150
|
B.LONG = function(t) {
|
|
3151
3151
|
return t >= Rs && (t = -(2 * Rs - t)), [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
3152
3152
|
};
|
|
3153
|
-
z.LONG =
|
|
3153
|
+
z.LONG = je(4);
|
|
3154
3154
|
B.FLOAT = function(t) {
|
|
3155
3155
|
if (t > Mc || t < Bc)
|
|
3156
3156
|
throw new Error(`Value ${t} is outside the range of representable values in 16.16 format`);
|
|
@@ -3171,7 +3171,7 @@ z.F2DOT14 = z.USHORT;
|
|
|
3171
3171
|
B.LONGDATETIME = function(t) {
|
|
3172
3172
|
return [0, 0, 0, 0, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
3173
3173
|
};
|
|
3174
|
-
z.LONGDATETIME =
|
|
3174
|
+
z.LONGDATETIME = je(8);
|
|
3175
3175
|
B.TAG = function(t) {
|
|
3176
3176
|
return H.argument(t.length === 4, "Tag should be exactly 4 ASCII characters."), [
|
|
3177
3177
|
t.charCodeAt(0),
|
|
@@ -3180,7 +3180,7 @@ B.TAG = function(t) {
|
|
|
3180
3180
|
t.charCodeAt(3)
|
|
3181
3181
|
];
|
|
3182
3182
|
};
|
|
3183
|
-
z.TAG =
|
|
3183
|
+
z.TAG = je(4);
|
|
3184
3184
|
B.Card8 = B.BYTE;
|
|
3185
3185
|
z.Card8 = z.BYTE;
|
|
3186
3186
|
B.Card16 = B.USHORT;
|
|
@@ -3198,11 +3198,11 @@ z.NUMBER = function(t) {
|
|
|
3198
3198
|
B.NUMBER16 = function(t) {
|
|
3199
3199
|
return [28, t >> 8 & 255, t & 255];
|
|
3200
3200
|
};
|
|
3201
|
-
z.NUMBER16 =
|
|
3201
|
+
z.NUMBER16 = je(3);
|
|
3202
3202
|
B.NUMBER32 = function(t) {
|
|
3203
3203
|
return [29, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
3204
3204
|
};
|
|
3205
|
-
z.NUMBER32 =
|
|
3205
|
+
z.NUMBER32 = je(5);
|
|
3206
3206
|
B.REAL = function(t) {
|
|
3207
3207
|
let e = t.toString();
|
|
3208
3208
|
const n = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);
|
|
@@ -7127,7 +7127,7 @@ function Xr(t, e, n = 0, r = "hexa") {
|
|
|
7127
7127
|
const a = _a(s.colorRecords[i]);
|
|
7128
7128
|
return r === "bgra" ? a : zt(a, r);
|
|
7129
7129
|
}
|
|
7130
|
-
function
|
|
7130
|
+
function We(t) {
|
|
7131
7131
|
return ("0" + parseInt(t).toString(16)).slice(-2);
|
|
7132
7132
|
}
|
|
7133
7133
|
function xl(t) {
|
|
@@ -7169,7 +7169,7 @@ function vl(t) {
|
|
|
7169
7169
|
};
|
|
7170
7170
|
}
|
|
7171
7171
|
function Ua(t) {
|
|
7172
|
-
return parseInt(`0x${
|
|
7172
|
+
return parseInt(`0x${We(t.b)}${We(t.g)}${We(t.r)}${We(t.a * 255)}`, 16);
|
|
7173
7173
|
}
|
|
7174
7174
|
function Dn(t, e = "hexa") {
|
|
7175
7175
|
const n = e == "raw" || e == "cpal", r = Number.isInteger(t);
|
|
@@ -7268,11 +7268,11 @@ function zt(t, e = "hexa") {
|
|
|
7268
7268
|
case "hex":
|
|
7269
7269
|
case "hex6":
|
|
7270
7270
|
case "hex-6":
|
|
7271
|
-
return `#${
|
|
7271
|
+
return `#${We(t.r)}${We(t.g)}${We(t.b)}`;
|
|
7272
7272
|
case "hexa":
|
|
7273
7273
|
case "hex8":
|
|
7274
7274
|
case "hex-8":
|
|
7275
|
-
return `#${
|
|
7275
|
+
return `#${We(t.r)}${We(t.g)}${We(t.b)}${We(t.a * 255)}`;
|
|
7276
7276
|
case "hsl":
|
|
7277
7277
|
return `hsl(${n.h.toFixed(2)}, ${n.s.toFixed(2)}%, ${n.l.toFixed(2)}%)`;
|
|
7278
7278
|
case "hsla":
|
|
@@ -7525,7 +7525,7 @@ function Tl(t, e, n, r, s) {
|
|
|
7525
7525
|
}, i;
|
|
7526
7526
|
};
|
|
7527
7527
|
}
|
|
7528
|
-
var
|
|
7528
|
+
var Qe = { GlyphSet: zn, glyphLoader: wl, ttfGlyphLoader: Cl, cffGlyphLoader: Tl };
|
|
7529
7529
|
function Na(t, e) {
|
|
7530
7530
|
if (t === e)
|
|
7531
7531
|
return !0;
|
|
@@ -7544,7 +7544,7 @@ function _n(t) {
|
|
|
7544
7544
|
let e;
|
|
7545
7545
|
return t.length < 1240 ? e = 107 : t.length < 33900 ? e = 1131 : e = 32768, e;
|
|
7546
7546
|
}
|
|
7547
|
-
function
|
|
7547
|
+
function Ye(t, e, n, r) {
|
|
7548
7548
|
const s = [], i = [], a = r > 1 ? D.getULong(t, e) : D.getCard16(t, e), o = r > 1 ? 4 : 2;
|
|
7549
7549
|
let c, l;
|
|
7550
7550
|
if (a !== 0) {
|
|
@@ -7757,7 +7757,7 @@ function _l(t, e, n) {
|
|
|
7757
7757
|
if (o !== 0 && c !== 0) {
|
|
7758
7758
|
const l = Jr(t, c + e, o, [], 2);
|
|
7759
7759
|
if (l.subrs) {
|
|
7760
|
-
const u = c + l.subrs, f =
|
|
7760
|
+
const u = c + l.subrs, f = Ye(t, u + e, void 0, 2);
|
|
7761
7761
|
a._subrs = f.objects, a._subrsBias = _n(a._subrs);
|
|
7762
7762
|
}
|
|
7763
7763
|
a._privateDict = l;
|
|
@@ -7775,7 +7775,7 @@ function Qn(t, e, n, r, s) {
|
|
|
7775
7775
|
if (l !== 0 && u !== 0) {
|
|
7776
7776
|
const f = Jr(t, u + e, l, r, s);
|
|
7777
7777
|
if (c._defaultWidthX = f.defaultWidthX, c._nominalWidthX = f.nominalWidthX, f.subrs !== 0) {
|
|
7778
|
-
const h = u + f.subrs, p =
|
|
7778
|
+
const h = u + f.subrs, p = Ye(t, h + e, void 0, s);
|
|
7779
7779
|
c._subrs = p.objects, c._subrsBias = _n(c._subrs);
|
|
7780
7780
|
}
|
|
7781
7781
|
c._privateDict = f;
|
|
@@ -7858,7 +7858,7 @@ function Mr(t, e, n, r, s) {
|
|
|
7858
7858
|
M = (u.length & 1) !== 0, M && !h && (N = u.shift() + C), f += u.length >> 1, u.length = 0, h = !0;
|
|
7859
7859
|
}
|
|
7860
7860
|
function U(M) {
|
|
7861
|
-
let _, re, Te,
|
|
7861
|
+
let _, re, Te, et, _e, me, Y, ne, pe, be, ge, ye, ce = 0;
|
|
7862
7862
|
for (; ce < M.length; ) {
|
|
7863
7863
|
let ve = M[ce];
|
|
7864
7864
|
switch (ce += 1, ve) {
|
|
@@ -7926,10 +7926,10 @@ function Mr(t, e, n, r, s) {
|
|
|
7926
7926
|
break;
|
|
7927
7927
|
}
|
|
7928
7928
|
if (u.length >= 4) {
|
|
7929
|
-
const
|
|
7930
|
-
if (
|
|
7929
|
+
const tt = Br[u.pop()], x = Br[u.pop()], d = u.pop(), g = u.pop();
|
|
7930
|
+
if (tt && x) {
|
|
7931
7931
|
e.isComposite = !0, e.components = [];
|
|
7932
|
-
const S = t.cffEncoding.charset.indexOf(
|
|
7932
|
+
const S = t.cffEncoding.charset.indexOf(tt), k = t.cffEncoding.charset.indexOf(x);
|
|
7933
7933
|
e.components.push({
|
|
7934
7934
|
glyphIndex: k,
|
|
7935
7935
|
dx: 0,
|
|
@@ -7964,11 +7964,11 @@ function Mr(t, e, n, r, s) {
|
|
|
7964
7964
|
R || (R = t.variation && s && t.variation.process.getBlendVector(E, T, s));
|
|
7965
7965
|
var Z = u.pop(), xe = R ? R.length : E.itemVariationSubtables[T].regionIndexes.length, Ee = Z * xe, Ae = u.length - Ee, Oe = Ae - Z;
|
|
7966
7966
|
if (R)
|
|
7967
|
-
for (let
|
|
7968
|
-
var Re = u[Oe +
|
|
7967
|
+
for (let tt = 0; tt < Z; tt++) {
|
|
7968
|
+
var Re = u[Oe + tt];
|
|
7969
7969
|
for (let x = 0; x < xe; x++)
|
|
7970
7970
|
Re += R[x] * u[Ae++];
|
|
7971
|
-
u[Oe +
|
|
7971
|
+
u[Oe + tt] = Re;
|
|
7972
7972
|
}
|
|
7973
7973
|
for (; Ee--; )
|
|
7974
7974
|
u.pop();
|
|
@@ -8028,7 +8028,7 @@ function Mr(t, e, n, r, s) {
|
|
|
8028
8028
|
i = y, a = m + u.shift(), o = i + u.shift(), c = a + u.shift(), y = o + u.shift(), m = c + (u.length === 1 ? u.shift() : 0), l.curveTo(i, a, o, c, y, m);
|
|
8029
8029
|
break;
|
|
8030
8030
|
default:
|
|
8031
|
-
ve < 32 ? console.log("Glyph " + e.index + ": unknown operator " + ve) : ve < 247 ? u.push(ve - 139) : ve < 251 ? (_ = M[ce], ce += 1, u.push((ve - 247) * 256 + _ + 108)) : ve < 255 ? (_ = M[ce], ce += 1, u.push(-(ve - 251) * 256 - _ - 108)) : (_ = M[ce], re = M[ce + 1], Te = M[ce + 2],
|
|
8031
|
+
ve < 32 ? console.log("Glyph " + e.index + ": unknown operator " + ve) : ve < 247 ? u.push(ve - 139) : ve < 251 ? (_ = M[ce], ce += 1, u.push((ve - 247) * 256 + _ + 108)) : ve < 255 ? (_ = M[ce], ce += 1, u.push(-(ve - 251) * 256 - _ - 108)) : (_ = M[ce], re = M[ce + 1], Te = M[ce + 2], et = M[ce + 3], ce += 4, u.push((_ << 24 | re << 16 | Te << 8 | et) / 65536));
|
|
8032
8032
|
}
|
|
8033
8033
|
}
|
|
8034
8034
|
}
|
|
@@ -8076,7 +8076,7 @@ function Gl(t, e, n, r) {
|
|
|
8076
8076
|
let s;
|
|
8077
8077
|
const i = Ll(t, e);
|
|
8078
8078
|
i.formatMajor === 2 ? s = n.tables.cff2 = {} : s = n.tables.cff = {};
|
|
8079
|
-
const a = i.formatMajor > 1 ? null :
|
|
8079
|
+
const a = i.formatMajor > 1 ? null : Ye(t, i.endOffset, D.bytesToString), o = i.formatMajor > 1 ? null : Ye(t, a.endOffset), c = i.formatMajor > 1 ? null : Ye(t, o.endOffset, D.bytesToString), l = Ye(t, i.formatMajor > 1 ? e + i.size + i.topDictLength : c.endOffset, void 0, i.formatMajor);
|
|
8080
8080
|
n.gsubrs = l.objects, n.gsubrsBias = _n(n.gsubrs);
|
|
8081
8081
|
let u;
|
|
8082
8082
|
if (i.formatMajor > 1) {
|
|
@@ -8092,38 +8092,38 @@ function Gl(t, e, n, r) {
|
|
|
8092
8092
|
let h = u.fdArray, p = u.fdSelect;
|
|
8093
8093
|
if (!h)
|
|
8094
8094
|
throw new Error("This is a CFF2 font, but FDArray information is missing");
|
|
8095
|
-
const y =
|
|
8095
|
+
const y = Ye(t, e + h, null, i.formatMajor), m = _l(t, e, y.objects);
|
|
8096
8096
|
u._fdArray = m, p && (u._fdSelect = Ps(t, e + p, n.numGlyphs, m.length, i.formatMajor));
|
|
8097
8097
|
} else if (n.isCIDFont) {
|
|
8098
8098
|
let h = u.fdArray, p = u.fdSelect;
|
|
8099
8099
|
if (h === 0 || p === 0)
|
|
8100
8100
|
throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
|
|
8101
8101
|
h += e;
|
|
8102
|
-
const y =
|
|
8102
|
+
const y = Ye(t, h), m = Qn(t, e, y.objects, c.objects, i.formatMajor);
|
|
8103
8103
|
u._fdArray = m, p += e, u._fdSelect = Ps(t, p, n.numGlyphs, m.length, i.formatMajor);
|
|
8104
8104
|
}
|
|
8105
8105
|
if (i.formatMajor < 2) {
|
|
8106
8106
|
const h = e + u.private[1], p = Jr(t, h, u.private[0], c.objects, i.formatMajor);
|
|
8107
8107
|
if (n.defaultWidthX = p.defaultWidthX, n.nominalWidthX = p.nominalWidthX, p.subrs !== 0) {
|
|
8108
|
-
const y = h + p.subrs, m =
|
|
8108
|
+
const y = h + p.subrs, m = Ye(t, y);
|
|
8109
8109
|
n.subrs = m.objects, n.subrsBias = _n(n.subrs);
|
|
8110
8110
|
} else
|
|
8111
8111
|
n.subrs = [], n.subrsBias = 0;
|
|
8112
8112
|
}
|
|
8113
8113
|
let f;
|
|
8114
|
-
if (r.lowMemory ? (f = Fl(t, e + u.charStrings, i.formatMajor), n.nGlyphs = f.offsets.length - (i.formatMajor > 1 ? 1 : 0)) : (f =
|
|
8114
|
+
if (r.lowMemory ? (f = Fl(t, e + u.charStrings, i.formatMajor), n.nGlyphs = f.offsets.length - (i.formatMajor > 1 ? 1 : 0)) : (f = Ye(t, e + u.charStrings, null, i.formatMajor), n.nGlyphs = f.objects.length), i.formatMajor > 1 && n.tables.maxp && n.nGlyphs !== n.tables.maxp.numGlyphs && console.error(`Glyph count in the CFF2 table (${n.nGlyphs}) must correspond to the glyph count in the maxp table (${n.tables.maxp.numGlyphs})`), i.formatMajor < 2) {
|
|
8115
8115
|
let h = [], p = [];
|
|
8116
8116
|
u.charset === 0 ? h = ll : u.charset === 1 ? h = ul : u.charset === 2 ? h = hl : h = Ul(t, e + u.charset, n.nGlyphs, c.objects, n.isCIDFont), u.encoding === 0 ? p = Br : u.encoding === 1 ? p = fl : p = Pl(t, e + u.encoding), n.cffEncoding = new Da(p, h), n.encoding = n.encoding || n.cffEncoding;
|
|
8117
8117
|
}
|
|
8118
|
-
if (n.glyphs = new
|
|
8118
|
+
if (n.glyphs = new Qe.GlyphSet(n), r.lowMemory)
|
|
8119
8119
|
n._push = function(h) {
|
|
8120
8120
|
const p = kl(h, f.offsets, t, e + u.charStrings, void 0, i.formatMajor);
|
|
8121
|
-
n.glyphs.push(h,
|
|
8121
|
+
n.glyphs.push(h, Qe.cffGlyphLoader(n, h, Mr, p, i.formatMajor));
|
|
8122
8122
|
};
|
|
8123
8123
|
else
|
|
8124
8124
|
for (let h = 0; h < n.nGlyphs; h += 1) {
|
|
8125
8125
|
const p = f.objects[h];
|
|
8126
|
-
n.glyphs.push(h,
|
|
8126
|
+
n.glyphs.push(h, Qe.cffGlyphLoader(n, h, Mr, p, i.formatMajor));
|
|
8127
8127
|
}
|
|
8128
8128
|
if (u.vstore) {
|
|
8129
8129
|
const h = new D.Parser(t, e + u.vstore);
|
|
@@ -8761,8 +8761,8 @@ function fu(t) {
|
|
|
8761
8761
|
{ name: "maxMemType1", type: "ULONG", value: c }
|
|
8762
8762
|
]);
|
|
8763
8763
|
}
|
|
8764
|
-
var Ka = { parse: hu, make: fu },
|
|
8765
|
-
|
|
8764
|
+
var Ka = { parse: hu, make: fu }, Ve = new Array(9);
|
|
8765
|
+
Ve[1] = function() {
|
|
8766
8766
|
const e = this.offset + this.relativeOffset, n = this.parseUShort();
|
|
8767
8767
|
if (n === 1)
|
|
8768
8768
|
return {
|
|
@@ -8778,7 +8778,7 @@ We[1] = function() {
|
|
|
8778
8778
|
};
|
|
8779
8779
|
H.assert(!1, "0x" + e.toString(16) + ": lookup type 1 format must be 1 or 2.");
|
|
8780
8780
|
};
|
|
8781
|
-
|
|
8781
|
+
Ve[2] = function() {
|
|
8782
8782
|
const e = this.parseUShort();
|
|
8783
8783
|
return H.argument(e === 1, "GSUB Multiple Substitution Subtable identifier-format must be 1"), {
|
|
8784
8784
|
substFormat: e,
|
|
@@ -8786,7 +8786,7 @@ We[2] = function() {
|
|
|
8786
8786
|
sequences: this.parseListOfLists()
|
|
8787
8787
|
};
|
|
8788
8788
|
};
|
|
8789
|
-
|
|
8789
|
+
Ve[3] = function() {
|
|
8790
8790
|
const e = this.parseUShort();
|
|
8791
8791
|
return H.argument(e === 1, "GSUB Alternate Substitution Subtable identifier-format must be 1"), {
|
|
8792
8792
|
substFormat: e,
|
|
@@ -8794,7 +8794,7 @@ We[3] = function() {
|
|
|
8794
8794
|
alternateSets: this.parseListOfLists()
|
|
8795
8795
|
};
|
|
8796
8796
|
};
|
|
8797
|
-
|
|
8797
|
+
Ve[4] = function() {
|
|
8798
8798
|
const e = this.parseUShort();
|
|
8799
8799
|
return H.argument(e === 1, "GSUB ligature table identifier-format must be 1"), {
|
|
8800
8800
|
substFormat: e,
|
|
@@ -8811,7 +8811,7 @@ var Mt = {
|
|
|
8811
8811
|
sequenceIndex: F.uShort,
|
|
8812
8812
|
lookupListIndex: F.uShort
|
|
8813
8813
|
};
|
|
8814
|
-
|
|
8814
|
+
Ve[5] = function() {
|
|
8815
8815
|
const e = this.offset + this.relativeOffset, n = this.parseUShort();
|
|
8816
8816
|
if (n === 1)
|
|
8817
8817
|
return {
|
|
@@ -8848,7 +8848,7 @@ We[5] = function() {
|
|
|
8848
8848
|
}
|
|
8849
8849
|
H.assert(!1, "0x" + e.toString(16) + ": lookup type 5 format must be 1, 2 or 3.");
|
|
8850
8850
|
};
|
|
8851
|
-
|
|
8851
|
+
Ve[6] = function() {
|
|
8852
8852
|
const e = this.offset + this.relativeOffset, n = this.parseUShort();
|
|
8853
8853
|
if (n === 1)
|
|
8854
8854
|
return {
|
|
@@ -8889,17 +8889,17 @@ We[6] = function() {
|
|
|
8889
8889
|
};
|
|
8890
8890
|
H.assert(!1, "0x" + e.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
|
|
8891
8891
|
};
|
|
8892
|
-
|
|
8892
|
+
Ve[7] = function() {
|
|
8893
8893
|
const e = this.parseUShort();
|
|
8894
8894
|
H.argument(e === 1, "GSUB Extension Substitution subtable identifier-format must be 1");
|
|
8895
8895
|
const n = this.parseUShort(), r = new F(this.data, this.offset + this.parseULong());
|
|
8896
8896
|
return {
|
|
8897
8897
|
substFormat: 1,
|
|
8898
8898
|
lookupType: n,
|
|
8899
|
-
extension:
|
|
8899
|
+
extension: Ve[n].call(r)
|
|
8900
8900
|
};
|
|
8901
8901
|
};
|
|
8902
|
-
|
|
8902
|
+
Ve[8] = function() {
|
|
8903
8903
|
const e = this.parseUShort();
|
|
8904
8904
|
return H.argument(e === 1, "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"), {
|
|
8905
8905
|
substFormat: e,
|
|
@@ -8916,12 +8916,12 @@ function pu(t, e) {
|
|
|
8916
8916
|
version: r,
|
|
8917
8917
|
scripts: n.parseScriptList(),
|
|
8918
8918
|
features: n.parseFeatureList(),
|
|
8919
|
-
lookups: n.parseLookupList(
|
|
8919
|
+
lookups: n.parseLookupList(Ve)
|
|
8920
8920
|
} : {
|
|
8921
8921
|
version: r,
|
|
8922
8922
|
scripts: n.parseScriptList(),
|
|
8923
8923
|
features: n.parseFeatureList(),
|
|
8924
|
-
lookups: n.parseLookupList(
|
|
8924
|
+
lookups: n.parseLookupList(Ve),
|
|
8925
8925
|
variations: n.parseFeatureVariationsList()
|
|
8926
8926
|
};
|
|
8927
8927
|
}
|
|
@@ -9698,7 +9698,7 @@ function Vu(t) {
|
|
|
9698
9698
|
N[Z].postScriptName || (N[Z].postScriptName = { en: j });
|
|
9699
9699
|
}
|
|
9700
9700
|
N.unicode.preferredFamily || (N.unicode.preferredFamily = X.fontFamily || ie.fontFamily || U.fontFamily), N.macintosh.preferredFamily || (N.macintosh.preferredFamily = ie.fontFamily || X.fontFamily || U.fontFamily), N.windows.preferredFamily || (N.windows.preferredFamily = U.fontFamily || X.fontFamily || ie.fontFamily), N.unicode.preferredSubfamily || (N.unicode.preferredSubfamily = X.fontSubfamily || ie.fontSubfamily || U.fontSubfamily), N.macintosh.preferredSubfamily || (N.macintosh.preferredSubfamily = ie.fontSubfamily || X.fontSubfamily || U.fontSubfamily), N.windows.preferredSubfamily || (N.windows.preferredSubfamily = U.fontSubfamily || X.fontSubfamily || ie.fontSubfamily);
|
|
9701
|
-
const M = [], _ = Ia.make(N, M), re = M.length > 0 ? Ya.make(M) : void 0, Te = Ka.make(t),
|
|
9701
|
+
const M = [], _ = Ia.make(N, M), re = M.length > 0 ? Ya.make(M) : void 0, Te = Ka.make(t), et = Dr.make(t.glyphs, {
|
|
9702
9702
|
version: t.getEnglishName("version"),
|
|
9703
9703
|
fullName: W,
|
|
9704
9704
|
familyName: R,
|
|
@@ -9707,7 +9707,7 @@ function Vu(t) {
|
|
|
9707
9707
|
unitsPerEm: t.unitsPerEm,
|
|
9708
9708
|
fontBBox: [0, y.yMin, y.ascender, y.advanceWidthMax],
|
|
9709
9709
|
topDict: t.tables.cff && t.tables.cff.topDict || {}
|
|
9710
|
-
}), _e = t.metas && Object.keys(t.metas).length > 0 ? Ja.make(t.metas) : void 0, me = [b, v, w, C, _, E, Te,
|
|
9710
|
+
}), _e = t.metas && Object.keys(t.metas).length > 0 ? Ja.make(t.metas) : void 0, me = [b, v, w, C, _, E, Te, et, T];
|
|
9711
9711
|
re && me.push(re);
|
|
9712
9712
|
const Y = {
|
|
9713
9713
|
gsub: Za,
|
|
@@ -10895,18 +10895,18 @@ function fo(t, e) {
|
|
|
10895
10895
|
return ts(e.points);
|
|
10896
10896
|
}
|
|
10897
10897
|
function uh(t, e, n, r) {
|
|
10898
|
-
const s = new
|
|
10898
|
+
const s = new Qe.GlyphSet(r);
|
|
10899
10899
|
for (let i = 0; i < n.length - 1; i += 1) {
|
|
10900
10900
|
const a = n[i], o = n[i + 1];
|
|
10901
|
-
a !== o ? s.push(i,
|
|
10901
|
+
a !== o ? s.push(i, Qe.ttfGlyphLoader(r, i, ho, t, e + a, fo)) : s.push(i, Qe.glyphLoader(r, i));
|
|
10902
10902
|
}
|
|
10903
10903
|
return s;
|
|
10904
10904
|
}
|
|
10905
10905
|
function hh(t, e, n, r) {
|
|
10906
|
-
const s = new
|
|
10906
|
+
const s = new Qe.GlyphSet(r);
|
|
10907
10907
|
return r._push = function(i) {
|
|
10908
10908
|
const a = n[i], o = n[i + 1];
|
|
10909
|
-
a !== o ? s.push(i,
|
|
10909
|
+
a !== o ? s.push(i, Qe.ttfGlyphLoader(r, i, ho, t, e + a, fo)) : s.push(i, Qe.glyphLoader(r, i));
|
|
10910
10910
|
}, s;
|
|
10911
10911
|
}
|
|
10912
10912
|
function fh(t, e, n, r, s) {
|
|
@@ -11386,7 +11386,7 @@ var xo = function(t) {
|
|
|
11386
11386
|
const r = this.srThreshold;
|
|
11387
11387
|
let s = 1;
|
|
11388
11388
|
return t < 0 && (t = -t, s = -1), t += r - n, t = Math.trunc(t / e) * e, t += n, t < 0 ? n * s : t * s;
|
|
11389
|
-
},
|
|
11389
|
+
}, Je = {
|
|
11390
11390
|
x: 1,
|
|
11391
11391
|
y: 0,
|
|
11392
11392
|
axis: "x",
|
|
@@ -11411,10 +11411,10 @@ var xo = function(t) {
|
|
|
11411
11411
|
return;
|
|
11412
11412
|
}
|
|
11413
11413
|
if (s = r.distance(t, e, !0, !0), i = r.distance(t, n, !0, !0), c = r.distance(e, e, !1, !0), l = r.distance(n, n, !1, !0), a = Math.abs(s), o = Math.abs(i), u = a + o, u === 0) {
|
|
11414
|
-
|
|
11414
|
+
Je.setRelative(t, t, (c + l) / 2, r, !0);
|
|
11415
11415
|
return;
|
|
11416
11416
|
}
|
|
11417
|
-
|
|
11417
|
+
Je.setRelative(t, t, (c * o + l * a) / u, r, !0);
|
|
11418
11418
|
},
|
|
11419
11419
|
// Slope of line normal to this
|
|
11420
11420
|
normalSlope: Number.NEGATIVE_INFINITY,
|
|
@@ -11515,13 +11515,13 @@ var xo = function(t) {
|
|
|
11515
11515
|
t.yTouched = !1;
|
|
11516
11516
|
}
|
|
11517
11517
|
};
|
|
11518
|
-
Object.freeze(
|
|
11518
|
+
Object.freeze(Je);
|
|
11519
11519
|
Object.freeze(it);
|
|
11520
11520
|
function an(t, e) {
|
|
11521
11521
|
this.x = t, this.y = e, this.axis = void 0, this.slope = e / t, this.normalSlope = -t / e, Object.freeze(this);
|
|
11522
11522
|
}
|
|
11523
11523
|
an.prototype.distance = function(t, e, n, r) {
|
|
11524
|
-
return this.x *
|
|
11524
|
+
return this.x * Je.distance(t, e, n, r) + this.y * it.distance(t, e, n, r);
|
|
11525
11525
|
};
|
|
11526
11526
|
an.prototype.interpolate = function(t, e, n, r) {
|
|
11527
11527
|
let s, i, a, o, c, l, u;
|
|
@@ -11541,7 +11541,7 @@ an.prototype.touch = function(t) {
|
|
|
11541
11541
|
};
|
|
11542
11542
|
function on(t, e) {
|
|
11543
11543
|
const n = Math.sqrt(t * t + e * e);
|
|
11544
|
-
return t /= n, e /= n, t === 1 && e === 0 ?
|
|
11544
|
+
return t /= n, e /= n, t === 1 && e === 0 ? Je : t === 0 && e === 1 ? it : new an(t, e);
|
|
11545
11545
|
}
|
|
11546
11546
|
function at(t, e, n, r) {
|
|
11547
11547
|
this.x = this.xo = Math.round(t * 64) / 64, this.y = this.yo = Math.round(e * 64) / 64, this.lastPointOfContour = n, this.onCurve = r, this.prevPointOnContour = void 0, this.nextPointOnContour = void 0, this.xTouched = !1, this.yTouched = !1, Object.preventExtensions(this);
|
|
@@ -11572,7 +11572,7 @@ function pt(t, e) {
|
|
|
11572
11572
|
case "glyf":
|
|
11573
11573
|
this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
|
|
11574
11574
|
case "prep":
|
|
11575
|
-
this.fv = this.pv = this.dpv =
|
|
11575
|
+
this.fv = this.pv = this.dpv = Je, this.round = bo;
|
|
11576
11576
|
}
|
|
11577
11577
|
}
|
|
11578
11578
|
yo.prototype.exec = function(t, e) {
|
|
@@ -12285,15 +12285,15 @@ go = [
|
|
|
12285
12285
|
/* 0x00 */
|
|
12286
12286
|
Xs.bind(void 0, it),
|
|
12287
12287
|
/* 0x01 */
|
|
12288
|
-
Xs.bind(void 0,
|
|
12288
|
+
Xs.bind(void 0, Je),
|
|
12289
12289
|
/* 0x02 */
|
|
12290
12290
|
Ks.bind(void 0, it),
|
|
12291
12291
|
/* 0x03 */
|
|
12292
|
-
Ks.bind(void 0,
|
|
12292
|
+
Ks.bind(void 0, Je),
|
|
12293
12293
|
/* 0x04 */
|
|
12294
12294
|
Zs.bind(void 0, it),
|
|
12295
12295
|
/* 0x05 */
|
|
12296
|
-
Zs.bind(void 0,
|
|
12296
|
+
Zs.bind(void 0, Je),
|
|
12297
12297
|
/* 0x06 */
|
|
12298
12298
|
Js.bind(void 0, 0),
|
|
12299
12299
|
/* 0x07 */
|
|
@@ -12386,7 +12386,7 @@ go = [
|
|
|
12386
12386
|
/* 0x30 */
|
|
12387
12387
|
ti.bind(void 0, it),
|
|
12388
12388
|
/* 0x31 */
|
|
12389
|
-
ti.bind(void 0,
|
|
12389
|
+
ti.bind(void 0, Je),
|
|
12390
12390
|
/* 0x32 */
|
|
12391
12391
|
ni.bind(void 0, 0),
|
|
12392
12392
|
/* 0x33 */
|
|
@@ -13992,7 +13992,7 @@ function te(t) {
|
|
|
13992
13992
|
}, t.tables.os2)
|
|
13993
13993
|
});
|
|
13994
13994
|
}
|
|
13995
|
-
this.supported = !0, this.glyphs = new
|
|
13995
|
+
this.supported = !0, this.glyphs = new Qe.GlyphSet(this, t.glyphs || []), this.encoding = new Ba(this), this.position = new ju(this), this.substitution = new Qu(this), this.tables = this.tables || {}, this.tables = new Proxy(this.tables, {
|
|
13996
13996
|
set: (e, n, r) => (e[n] = r, e.fvar && (e.gvar || e.cff2) && !this.variation && (this.variation = new dh(this)), !0)
|
|
13997
13997
|
}), this.palettes = new uo(this), this.layers = new eh(this), this.svgImages = new th(this), this._push = null, this._hmtxTableData = {}, Object.defineProperty(this, "hinting", {
|
|
13998
13998
|
get: function() {
|
|
@@ -14301,8 +14301,8 @@ function cd(t, e) {
|
|
|
14301
14301
|
};
|
|
14302
14302
|
return r >= 1.2 && (s.markGlyphSets = n.parsePointer(od)), s;
|
|
14303
14303
|
}
|
|
14304
|
-
var ld = { parse: cd },
|
|
14305
|
-
|
|
14304
|
+
var ld = { parse: cd }, qe = new Array(10);
|
|
14305
|
+
qe[1] = function() {
|
|
14306
14306
|
const e = this.offset + this.relativeOffset, n = this.parseUShort();
|
|
14307
14307
|
if (n === 1)
|
|
14308
14308
|
return {
|
|
@@ -14318,7 +14318,7 @@ Ve[1] = function() {
|
|
|
14318
14318
|
};
|
|
14319
14319
|
H.assert(!1, "0x" + e.toString(16) + ": GPOS lookup type 1 format must be 1 or 2.");
|
|
14320
14320
|
};
|
|
14321
|
-
|
|
14321
|
+
qe[2] = function() {
|
|
14322
14322
|
const e = this.offset + this.relativeOffset, n = this.parseUShort();
|
|
14323
14323
|
H.assert(n === 1 || n === 2, "0x" + e.toString(16) + ": GPOS lookup type 2 format must be 1 or 2.");
|
|
14324
14324
|
const r = this.parsePointer(F.coverage), s = this.parseUShort(), i = this.parseUShort();
|
|
@@ -14358,25 +14358,25 @@ Ve[2] = function() {
|
|
|
14358
14358
|
};
|
|
14359
14359
|
}
|
|
14360
14360
|
};
|
|
14361
|
-
|
|
14361
|
+
qe[3] = function() {
|
|
14362
14362
|
return { error: "GPOS Lookup 3 not supported" };
|
|
14363
14363
|
};
|
|
14364
|
-
|
|
14364
|
+
qe[4] = function() {
|
|
14365
14365
|
return { error: "GPOS Lookup 4 not supported" };
|
|
14366
14366
|
};
|
|
14367
|
-
|
|
14367
|
+
qe[5] = function() {
|
|
14368
14368
|
return { error: "GPOS Lookup 5 not supported" };
|
|
14369
14369
|
};
|
|
14370
|
-
|
|
14370
|
+
qe[6] = function() {
|
|
14371
14371
|
return { error: "GPOS Lookup 6 not supported" };
|
|
14372
14372
|
};
|
|
14373
|
-
|
|
14373
|
+
qe[7] = function() {
|
|
14374
14374
|
return { error: "GPOS Lookup 7 not supported" };
|
|
14375
14375
|
};
|
|
14376
|
-
|
|
14376
|
+
qe[8] = function() {
|
|
14377
14377
|
return { error: "GPOS Lookup 8 not supported" };
|
|
14378
14378
|
};
|
|
14379
|
-
|
|
14379
|
+
qe[9] = function() {
|
|
14380
14380
|
return { error: "GPOS Lookup 9 not supported" };
|
|
14381
14381
|
};
|
|
14382
14382
|
function ud(t, e) {
|
|
@@ -14386,12 +14386,12 @@ function ud(t, e) {
|
|
|
14386
14386
|
version: r,
|
|
14387
14387
|
scripts: n.parseScriptList(),
|
|
14388
14388
|
features: n.parseFeatureList(),
|
|
14389
|
-
lookups: n.parseLookupList(
|
|
14389
|
+
lookups: n.parseLookupList(qe)
|
|
14390
14390
|
} : {
|
|
14391
14391
|
version: r,
|
|
14392
14392
|
scripts: n.parseScriptList(),
|
|
14393
14393
|
features: n.parseFeatureList(),
|
|
14394
|
-
lookups: n.parseLookupList(
|
|
14394
|
+
lookups: n.parseLookupList(qe),
|
|
14395
14395
|
variations: n.parseFeatureVariationsList()
|
|
14396
14396
|
};
|
|
14397
14397
|
}
|
|
@@ -15390,9 +15390,9 @@ var wo = { exports: {} }, rs = {}, jn = {};
|
|
|
15390
15390
|
jn.byteLength = $d;
|
|
15391
15391
|
jn.toByteArray = Xd;
|
|
15392
15392
|
jn.fromByteArray = Jd;
|
|
15393
|
-
var
|
|
15393
|
+
var Ke = [], Ue = [], qd = typeof Uint8Array < "u" ? Uint8Array : Array, cr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
15394
15394
|
for (var Rt = 0, jd = cr.length; Rt < jd; ++Rt)
|
|
15395
|
-
|
|
15395
|
+
Ke[Rt] = cr[Rt], Ue[cr.charCodeAt(Rt)] = Rt;
|
|
15396
15396
|
Ue[45] = 62;
|
|
15397
15397
|
Ue[95] = 63;
|
|
15398
15398
|
function Co(t) {
|
|
@@ -15418,7 +15418,7 @@ function Xd(t) {
|
|
|
15418
15418
|
return s === 2 && (e = Ue[t.charCodeAt(c)] << 2 | Ue[t.charCodeAt(c + 1)] >> 4, i[a++] = e & 255), s === 1 && (e = Ue[t.charCodeAt(c)] << 10 | Ue[t.charCodeAt(c + 1)] << 4 | Ue[t.charCodeAt(c + 2)] >> 2, i[a++] = e >> 8 & 255, i[a++] = e & 255), i;
|
|
15419
15419
|
}
|
|
15420
15420
|
function Kd(t) {
|
|
15421
|
-
return
|
|
15421
|
+
return Ke[t >> 18 & 63] + Ke[t >> 12 & 63] + Ke[t >> 6 & 63] + Ke[t & 63];
|
|
15422
15422
|
}
|
|
15423
15423
|
function Zd(t, e, n) {
|
|
15424
15424
|
for (var r, s = [], i = e; i < n; i += 3)
|
|
@@ -15429,9 +15429,9 @@ function Jd(t) {
|
|
|
15429
15429
|
for (var e, n = t.length, r = n % 3, s = [], i = 16383, a = 0, o = n - r; a < o; a += i)
|
|
15430
15430
|
s.push(Zd(t, a, a + i > o ? o : a + i));
|
|
15431
15431
|
return r === 1 ? (e = t[n - 1], s.push(
|
|
15432
|
-
|
|
15432
|
+
Ke[e >> 2] + Ke[e << 4 & 63] + "=="
|
|
15433
15433
|
)) : r === 2 && (e = (t[n - 2] << 8) + t[n - 1], s.push(
|
|
15434
|
-
|
|
15434
|
+
Ke[e >> 10] + Ke[e >> 4 & 63] + Ke[e << 2 & 63] + "="
|
|
15435
15435
|
)), s.join("");
|
|
15436
15436
|
}
|
|
15437
15437
|
var ss = {};
|
|
@@ -15717,7 +15717,7 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15717
15717
|
return Te(this, d, g);
|
|
15718
15718
|
case "latin1":
|
|
15719
15719
|
case "binary":
|
|
15720
|
-
return
|
|
15720
|
+
return et(this, d, g);
|
|
15721
15721
|
case "base64":
|
|
15722
15722
|
return U(this, d, g);
|
|
15723
15723
|
case "ucs2":
|
|
@@ -15950,7 +15950,7 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15950
15950
|
S += String.fromCharCode(x[k] & 127);
|
|
15951
15951
|
return S;
|
|
15952
15952
|
}
|
|
15953
|
-
function
|
|
15953
|
+
function et(x, d, g) {
|
|
15954
15954
|
var S = "";
|
|
15955
15955
|
g = Math.min(x.length, g);
|
|
15956
15956
|
for (var k = d; k < g; ++k)
|
|
@@ -15961,7 +15961,7 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15961
15961
|
var S = x.length;
|
|
15962
15962
|
(!d || d < 0) && (d = 0), (!g || g < 0 || g > S) && (g = S);
|
|
15963
15963
|
for (var k = "", A = d; A < g; ++A)
|
|
15964
|
-
k +=
|
|
15964
|
+
k += tt[x[A]];
|
|
15965
15965
|
return k;
|
|
15966
15966
|
}
|
|
15967
15967
|
function me(x, d, g) {
|
|
@@ -16237,7 +16237,7 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
16237
16237
|
function ve(x) {
|
|
16238
16238
|
return x !== x;
|
|
16239
16239
|
}
|
|
16240
|
-
var
|
|
16240
|
+
var tt = function() {
|
|
16241
16241
|
for (var x = "0123456789abcdef", d = new Array(256), g = 0; g < 16; ++g)
|
|
16242
16242
|
for (var S = g * 16, k = 0; k < 16; ++k)
|
|
16243
16243
|
d[S + k] = x[g] + x[k];
|
|
@@ -16580,16 +16580,16 @@ function r0() {
|
|
|
16580
16580
|
}
|
|
16581
16581
|
}, hr;
|
|
16582
16582
|
}
|
|
16583
|
-
var
|
|
16583
|
+
var nt = {}, Fi;
|
|
16584
16584
|
function s0() {
|
|
16585
|
-
if (Fi) return
|
|
16585
|
+
if (Fi) return nt;
|
|
16586
16586
|
Fi = 1;
|
|
16587
16587
|
var t = xt.Buffer;
|
|
16588
|
-
|
|
16588
|
+
nt._utf32 = e;
|
|
16589
16589
|
function e(l, u) {
|
|
16590
16590
|
this.iconv = u, this.bomAware = !0, this.isLE = l.isLE;
|
|
16591
16591
|
}
|
|
16592
|
-
|
|
16592
|
+
nt.utf32le = { type: "_utf32", isLE: !0 }, nt.utf32be = { type: "_utf32", isLE: !1 }, nt.ucs4le = "utf32le", nt.ucs4be = "utf32be", e.prototype.encoder = n, e.prototype.decoder = r;
|
|
16593
16593
|
function n(l, u) {
|
|
16594
16594
|
this.isLE = u.isLE, this.highSurrogate = 0;
|
|
16595
16595
|
}
|
|
@@ -16642,7 +16642,7 @@ function s0() {
|
|
|
16642
16642
|
}
|
|
16643
16643
|
r.prototype.end = function() {
|
|
16644
16644
|
this.overflow.length = 0;
|
|
16645
|
-
},
|
|
16645
|
+
}, nt.utf32 = i, nt.ucs4 = "utf32";
|
|
16646
16646
|
function i(l, u) {
|
|
16647
16647
|
this.iconv = u;
|
|
16648
16648
|
}
|
|
@@ -16697,7 +16697,7 @@ function s0() {
|
|
|
16697
16697
|
}
|
|
16698
16698
|
return b - y > m - p ? "utf-32be" : b - y < m - p ? "utf-32le" : u || "utf-32le";
|
|
16699
16699
|
}
|
|
16700
|
-
return
|
|
16700
|
+
return nt;
|
|
16701
16701
|
}
|
|
16702
16702
|
var yn = {}, ki;
|
|
16703
16703
|
function i0() {
|
|
@@ -26712,7 +26712,7 @@ const ft = class ft extends ia {
|
|
|
26712
26712
|
};
|
|
26713
26713
|
ft.NOT_ENCODABLE = -1;
|
|
26714
26714
|
let Gr = ft;
|
|
26715
|
-
class
|
|
26715
|
+
class Ze {
|
|
26716
26716
|
constructor() {
|
|
26717
26717
|
}
|
|
26718
26718
|
/**
|
|
@@ -26720,7 +26720,7 @@ class Ke {
|
|
|
26720
26720
|
* @returns The FontFactory instance
|
|
26721
26721
|
*/
|
|
26722
26722
|
static get instance() {
|
|
26723
|
-
return
|
|
26723
|
+
return Ze._instance || (Ze._instance = new Ze()), Ze._instance;
|
|
26724
26724
|
}
|
|
26725
26725
|
/**
|
|
26726
26726
|
* Creates a font instance based on the provided font data.
|
|
@@ -26829,7 +26829,7 @@ class $ {
|
|
|
26829
26829
|
const i = lt(s.file).toLowerCase();
|
|
26830
26830
|
n.set(i, { ...s, source: "remote" });
|
|
26831
26831
|
}
|
|
26832
|
-
const r = await
|
|
26832
|
+
const r = await ze.instance.getAll();
|
|
26833
26833
|
for (const s of r) {
|
|
26834
26834
|
const i = s.name.toLowerCase();
|
|
26835
26835
|
n.has(i) || n.set(i, this.cachedFontDataToFontInfo(s));
|
|
@@ -26964,8 +26964,8 @@ class $ {
|
|
|
26964
26964
|
data: i
|
|
26965
26965
|
};
|
|
26966
26966
|
try {
|
|
26967
|
-
const f =
|
|
26968
|
-
return l.forEach((h) => f.names.add(h)), this.registerFontInMap(o, f), this.enableFontCache && await
|
|
26967
|
+
const f = Ze.instance.createFont(u);
|
|
26968
|
+
return l.forEach((h) => f.names.add(h)), this.registerFontInMap(o, f), this.enableFontCache && await ze.instance.set(o, u), this.events.fontLoaded.dispatch({ fontName: o }), {
|
|
26969
26969
|
fontName: o,
|
|
26970
26970
|
url: "",
|
|
26971
26971
|
status: "Success"
|
|
@@ -26992,11 +26992,11 @@ class $ {
|
|
|
26992
26992
|
const n = lt(e).toLowerCase();
|
|
26993
26993
|
if (this.isFontLoaded(n))
|
|
26994
26994
|
return !0;
|
|
26995
|
-
const r = await
|
|
26995
|
+
const r = await ze.instance.find(e);
|
|
26996
26996
|
if (!r)
|
|
26997
26997
|
return !1;
|
|
26998
26998
|
try {
|
|
26999
|
-
const i =
|
|
26999
|
+
const i = Ze.instance.createFont(r);
|
|
27000
27000
|
return (s = r.alias) == null || s.forEach((a) => i.names.add(a)), this.registerFontInMap(r.name, i), this.events.fontLoaded.dispatch({ fontName: r.name }), !0;
|
|
27001
27001
|
} catch {
|
|
27002
27002
|
return !1;
|
|
@@ -27269,6 +27269,51 @@ class $ {
|
|
|
27269
27269
|
count: this.missedFonts[e]
|
|
27270
27270
|
}), n && this.lazyFontLoading && this.requestFont(e)));
|
|
27271
27271
|
}
|
|
27272
|
+
/**
|
|
27273
|
+
* Adds catalog / `fonts.json` names onto a font instance.
|
|
27274
|
+
*/
|
|
27275
|
+
applyCatalogNames(e, n) {
|
|
27276
|
+
n.forEach((r) => {
|
|
27277
|
+
r && e.names.add(r);
|
|
27278
|
+
});
|
|
27279
|
+
}
|
|
27280
|
+
/**
|
|
27281
|
+
* Ensures an already-loaded primary face is also addressable under the
|
|
27282
|
+
* current catalog names. Needed when IndexedDB still has an older alias
|
|
27283
|
+
* list (e.g. `noto-sans-kr` cached before `malgun` was added) or when the
|
|
27284
|
+
* binary was loaded under the file basename first.
|
|
27285
|
+
*/
|
|
27286
|
+
ensureCatalogAliases(e, n) {
|
|
27287
|
+
const r = this.loadedFontMap.get(e.toLowerCase()) ?? n.map((s) => this.loadedFontMap.get(s.toLowerCase())).find((s) => s != null);
|
|
27288
|
+
r && (this.applyCatalogNames(r, n), this.registerFontInMap(e, r));
|
|
27289
|
+
}
|
|
27290
|
+
/**
|
|
27291
|
+
* Merges catalog / primary names into an existing IndexedDB alias list so
|
|
27292
|
+
* cold starts after `getAllFontsFromCache` pick up newly added style names.
|
|
27293
|
+
*/
|
|
27294
|
+
async persistCatalogAliases(e, n) {
|
|
27295
|
+
if (!this.enableFontCache)
|
|
27296
|
+
return;
|
|
27297
|
+
const r = await ze.instance.get(e);
|
|
27298
|
+
if (!r)
|
|
27299
|
+
return;
|
|
27300
|
+
const s = [
|
|
27301
|
+
.../* @__PURE__ */ new Set([...r.alias ?? [], ...n, e])
|
|
27302
|
+
], i = r.alias ?? [];
|
|
27303
|
+
s.length === i.length && s.every((a) => i.includes(a)) || await ze.instance.set(e, {
|
|
27304
|
+
...r,
|
|
27305
|
+
alias: s
|
|
27306
|
+
});
|
|
27307
|
+
}
|
|
27308
|
+
/**
|
|
27309
|
+
* Clears miss / failed-request bookkeeping for a primary name and aliases
|
|
27310
|
+
* so a later alias request is not permanently blocked after the binary
|
|
27311
|
+
* loaded under a different key.
|
|
27312
|
+
*/
|
|
27313
|
+
clearRequestStateForNames(e) {
|
|
27314
|
+
for (const n of e)
|
|
27315
|
+
n && (this.clearMissedFontEntry(n), this.fontRequestFailed.delete(n.toLowerCase()));
|
|
27316
|
+
}
|
|
27272
27317
|
/**
|
|
27273
27318
|
* Loads a single font
|
|
27274
27319
|
* @param fontInfo - The matadata of the font to be loaded
|
|
@@ -27276,24 +27321,34 @@ class $ {
|
|
|
27276
27321
|
async loadFont(e) {
|
|
27277
27322
|
if (!ta(e.file))
|
|
27278
27323
|
throw new Error(`Invalid font file name: ${e.file}`);
|
|
27279
|
-
const r = this.fontInfoToFontData(e), s = r.name;
|
|
27280
|
-
if (this.isFontLoaded(r.name))
|
|
27324
|
+
const r = this.fontInfoToFontData(e), s = r.name, i = e.name ?? [];
|
|
27325
|
+
if (this.isFontLoaded(r.name)) {
|
|
27326
|
+
this.ensureCatalogAliases(s, i), this.clearRequestStateForNames([s, ...i]), await this.persistCatalogAliases(s, i);
|
|
27281
27327
|
return;
|
|
27282
|
-
|
|
27283
|
-
|
|
27284
|
-
|
|
27285
|
-
|
|
27328
|
+
}
|
|
27329
|
+
const a = this.loadEpoch, o = await ze.instance.get(s);
|
|
27330
|
+
if (a === this.loadEpoch) {
|
|
27331
|
+
if (o) {
|
|
27332
|
+
if (await new Promise((l) => setTimeout(l, 0)), a !== this.loadEpoch)
|
|
27333
|
+
return;
|
|
27334
|
+
if (this.isFontLoaded(s)) {
|
|
27335
|
+
this.ensureCatalogAliases(s, i), this.clearRequestStateForNames([s, ...i]), await this.persistCatalogAliases(s, i);
|
|
27286
27336
|
return;
|
|
27287
|
-
|
|
27288
|
-
|
|
27337
|
+
}
|
|
27338
|
+
const c = Ze.instance.createFont(o);
|
|
27339
|
+
c && (this.applyCatalogNames(c, i), this.registerFontInMap(s, c), await this.persistCatalogAliases(s, i));
|
|
27289
27340
|
} else {
|
|
27290
|
-
const
|
|
27291
|
-
if (
|
|
27341
|
+
const c = await this.loader.loadAsync(e.url);
|
|
27342
|
+
if (a !== this.loadEpoch || (r.data = c, await new Promise((u) => setTimeout(u, 0)), a !== this.loadEpoch))
|
|
27292
27343
|
return;
|
|
27293
|
-
|
|
27294
|
-
|
|
27344
|
+
if (this.isFontLoaded(s)) {
|
|
27345
|
+
this.ensureCatalogAliases(s, i), this.clearRequestStateForNames([s, ...i]), await this.persistCatalogAliases(s, i);
|
|
27346
|
+
return;
|
|
27347
|
+
}
|
|
27348
|
+
const l = Ze.instance.createFont(r);
|
|
27349
|
+
l && (this.applyCatalogNames(l, i), this.registerFontInMap(s, l), this.enableFontCache && await ze.instance.set(s, r));
|
|
27295
27350
|
}
|
|
27296
|
-
|
|
27351
|
+
a !== this.loadEpoch || !this.isFontLoaded(s) || (this.clearRequestStateForNames([s, ...i]), this.events.fontLoaded.dispatch({
|
|
27297
27352
|
fontName: s
|
|
27298
27353
|
}));
|
|
27299
27354
|
}
|
|
@@ -27313,12 +27368,12 @@ class $ {
|
|
|
27313
27368
|
async getAllFontsFromCache() {
|
|
27314
27369
|
if (this.loadedFontMap.size !== 0)
|
|
27315
27370
|
return;
|
|
27316
|
-
const e = await
|
|
27371
|
+
const e = await ze.instance.getAll();
|
|
27317
27372
|
for (const n of e) {
|
|
27318
27373
|
const { name: r } = n;
|
|
27319
27374
|
if (this.fileNames && !this.fileNames.includes(r))
|
|
27320
27375
|
continue;
|
|
27321
|
-
const s =
|
|
27376
|
+
const s = Ze.instance.createFont(n);
|
|
27322
27377
|
this.registerFontInMap(r, s);
|
|
27323
27378
|
}
|
|
27324
27379
|
}
|
|
@@ -29880,17 +29935,17 @@ class $i {
|
|
|
29880
29935
|
_
|
|
29881
29936
|
);
|
|
29882
29937
|
n.push(...ie), r.push(...U), s.push(...M), i.push(..._);
|
|
29883
|
-
const re = [], Te = [],
|
|
29938
|
+
const re = [], Te = [], et = [], _e = [];
|
|
29884
29939
|
this._hOffset = l + W, this._vOffset = N;
|
|
29885
29940
|
for (const me of o)
|
|
29886
29941
|
this.processChar(
|
|
29887
29942
|
me,
|
|
29888
29943
|
re,
|
|
29889
29944
|
Te,
|
|
29890
|
-
|
|
29945
|
+
et,
|
|
29891
29946
|
_e
|
|
29892
29947
|
);
|
|
29893
|
-
n.push(...re), r.push(...Te), s.push(...
|
|
29948
|
+
n.push(...re), r.push(...Te), s.push(...et), i.push(..._e), this._hOffset = l + R, E && (this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams());
|
|
29894
29949
|
}
|
|
29895
29950
|
} else {
|
|
29896
29951
|
const C = [], T = [], E = [], R = [];
|
|
@@ -30521,7 +30576,7 @@ function Q0(t) {
|
|
|
30521
30576
|
return String.fromCharCode(r);
|
|
30522
30577
|
});
|
|
30523
30578
|
}
|
|
30524
|
-
const $t = /* @__PURE__ */ new I.Vector3(),
|
|
30579
|
+
const $t = /* @__PURE__ */ new I.Vector3(), rt = /* @__PURE__ */ new I.Vector3(), st = /* @__PURE__ */ new I.Vector3(), Yi = /* @__PURE__ */ new I.Vector3(1, 0, 0);
|
|
30525
30580
|
class tn extends I.Object3D {
|
|
30526
30581
|
/**
|
|
30527
30582
|
* Extracts all unique font names used in an MText string.
|
|
@@ -31008,9 +31063,9 @@ class tn extends I.Object3D {
|
|
|
31008
31063
|
e.updateWorldMatrix(!1, !1);
|
|
31009
31064
|
const s = (c = (o = e.userData) == null ? void 0 : o.layout) == null ? void 0 : c.chars, i = (l = e.userData) == null ? void 0 : l.lineLayouts;
|
|
31010
31065
|
if (i && i.length > 0 && i.forEach((h) => {
|
|
31011
|
-
$t.set(0, h.y, 0).applyMatrix4(e.matrixWorld),
|
|
31066
|
+
$t.set(0, h.y, 0).applyMatrix4(e.matrixWorld), rt.set(0, h.y - h.height / 2, 0).applyMatrix4(e.matrixWorld), st.set(0, h.y + h.height / 2, 0).applyMatrix4(e.matrixWorld), r.push({
|
|
31012
31067
|
y: $t.y,
|
|
31013
|
-
height: Math.abs(
|
|
31068
|
+
height: Math.abs(st.y - rt.y),
|
|
31014
31069
|
breakIndex: h.breakIndex
|
|
31015
31070
|
});
|
|
31016
31071
|
}), s && s.length > 0) {
|
|
@@ -31075,7 +31130,7 @@ class tn extends I.Object3D {
|
|
|
31075
31130
|
}
|
|
31076
31131
|
const s = (c = e.userData) == null ? void 0 : c.lineLayouts;
|
|
31077
31132
|
s && s.length > 0 && s.forEach((p) => {
|
|
31078
|
-
|
|
31133
|
+
rt.set(0, p.y - p.height / 2, 0).applyMatrix4(e.matrixWorld), st.set(0, p.y + p.height / 2, 0).applyMatrix4(e.matrixWorld), n.hasLine = !0, n.minX = Math.min(n.minX, rt.x, st.x), n.maxX = Math.max(n.maxX, rt.x, st.x), n.minY = Math.min(n.minY, rt.y, st.y), n.maxY = Math.max(n.maxY, rt.y, st.y), n.minZ = Math.min(n.minZ, rt.z, st.z), n.maxZ = Math.max(n.maxZ, rt.z, st.z);
|
|
31079
31134
|
});
|
|
31080
31135
|
const i = (u = (l = e.userData) == null ? void 0 : l.layout) == null ? void 0 : u.chars;
|
|
31081
31136
|
if (i && i.length > 0) {
|
|
@@ -31991,7 +32046,7 @@ class c1 {
|
|
|
31991
32046
|
fonts: []
|
|
31992
32047
|
};
|
|
31993
32048
|
try {
|
|
31994
|
-
r = await
|
|
32049
|
+
r = await ze.instance.getStorageStats();
|
|
31995
32050
|
} catch {
|
|
31996
32051
|
}
|
|
31997
32052
|
const s = e.totalEstimatedBytes + n.reduce((i, a) => i + a.totalEstimatedBytes, 0);
|
|
@@ -32039,7 +32094,7 @@ export {
|
|
|
32039
32094
|
Gi as DEFAULT_LINE_SPACE_FACTOR,
|
|
32040
32095
|
F0 as DefaultFontLoader,
|
|
32041
32096
|
gs as EventManager,
|
|
32042
|
-
|
|
32097
|
+
Ze as FontFactory,
|
|
32043
32098
|
$ as FontManager,
|
|
32044
32099
|
N0 as LINE_SPACING_SCALE_FACTOR,
|
|
32045
32100
|
Sc as MATERIAL_ESTIMATED_BYTES,
|