@mlightcad/mtext-renderer 0.12.8 → 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 +217 -144
- package/dist/index.umd.cjs +9 -9
- package/dist/mtext-renderer-worker.js +289 -216
- package/lib/font/defaultFontsPresets.d.ts +11 -2
- package/lib/font/fontManager.d.ts +22 -0
- package/package.json +1 -1
|
@@ -10,10 +10,10 @@ var ct;
|
|
|
10
10
|
(function(n) {
|
|
11
11
|
n[n.DEFAULT = 0] = "DEFAULT", n[n.LEFT = 1] = "LEFT", n[n.RIGHT = 2] = "RIGHT", n[n.CENTER = 3] = "CENTER", n[n.JUSTIFIED = 4] = "JUSTIFIED", n[n.DISTRIBUTED = 5] = "DISTRIBUTED";
|
|
12
12
|
})(ct || (ct = {}));
|
|
13
|
-
var
|
|
13
|
+
var We;
|
|
14
14
|
(function(n) {
|
|
15
15
|
n[n.NONE = 0] = "NONE", n[n.UNDERLINE = 1] = "UNDERLINE", n[n.OVERLINE = 2] = "OVERLINE", n[n.STRIKE_THROUGH = 4] = "STRIKE_THROUGH";
|
|
16
|
-
})(
|
|
16
|
+
})(We || (We = {}));
|
|
17
17
|
const $l = {
|
|
18
18
|
c: "Ø",
|
|
19
19
|
d: "°",
|
|
@@ -890,7 +890,7 @@ class Vi {
|
|
|
890
890
|
return t;
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
|
-
class
|
|
893
|
+
class Se {
|
|
894
894
|
/**
|
|
895
895
|
* Create a new MTextColor instance.
|
|
896
896
|
* @param color The initial color: number for ACI, [r,g,b] for RGB, or null/undefined for default (ACI=256).
|
|
@@ -966,7 +966,7 @@ class ve {
|
|
|
966
966
|
* @returns A new MTextColor instance with the same color state.
|
|
967
967
|
*/
|
|
968
968
|
copy() {
|
|
969
|
-
const t = new
|
|
969
|
+
const t = new Se();
|
|
970
970
|
return t._aci = this._aci, t._rgbValue = this._rgbValue, t;
|
|
971
971
|
}
|
|
972
972
|
/**
|
|
@@ -991,7 +991,7 @@ class ve {
|
|
|
991
991
|
const e = tu(t);
|
|
992
992
|
if (e === null)
|
|
993
993
|
return null;
|
|
994
|
-
const s = new
|
|
994
|
+
const s = new Se();
|
|
995
995
|
return s.rgbValue = e, s;
|
|
996
996
|
}
|
|
997
997
|
/**
|
|
@@ -1005,7 +1005,7 @@ class ve {
|
|
|
1005
1005
|
}
|
|
1006
1006
|
class vs {
|
|
1007
1007
|
constructor() {
|
|
1008
|
-
this._stroke = 0, this.continueStroke = !1, this.color = new
|
|
1008
|
+
this._stroke = 0, this.continueStroke = !1, this.color = new Se(), this.align = Ye.BOTTOM, this.fontFace = { family: "", style: "Regular", weight: 400 }, this._capHeight = { value: 1, isRelative: !1 }, this._widthFactor = { value: 1, isRelative: !1 }, this._charTrackingFactor = { value: 1, isRelative: !1 }, this.oblique = 0, this.paragraph = {
|
|
1009
1009
|
indent: 0,
|
|
1010
1010
|
left: 0,
|
|
1011
1011
|
right: 0,
|
|
@@ -1121,40 +1121,40 @@ class vs {
|
|
|
1121
1121
|
* Get whether text is underlined
|
|
1122
1122
|
*/
|
|
1123
1123
|
get underline() {
|
|
1124
|
-
return !!(this._stroke &
|
|
1124
|
+
return !!(this._stroke & We.UNDERLINE);
|
|
1125
1125
|
}
|
|
1126
1126
|
/**
|
|
1127
1127
|
* Set whether text is underlined
|
|
1128
1128
|
* @param value - Whether to underline
|
|
1129
1129
|
*/
|
|
1130
1130
|
set underline(t) {
|
|
1131
|
-
this._setStrokeState(
|
|
1131
|
+
this._setStrokeState(We.UNDERLINE, t);
|
|
1132
1132
|
}
|
|
1133
1133
|
/**
|
|
1134
1134
|
* Get whether text has strike-through
|
|
1135
1135
|
*/
|
|
1136
1136
|
get strikeThrough() {
|
|
1137
|
-
return !!(this._stroke &
|
|
1137
|
+
return !!(this._stroke & We.STRIKE_THROUGH);
|
|
1138
1138
|
}
|
|
1139
1139
|
/**
|
|
1140
1140
|
* Set whether text has strike-through
|
|
1141
1141
|
* @param value - Whether to strike through
|
|
1142
1142
|
*/
|
|
1143
1143
|
set strikeThrough(t) {
|
|
1144
|
-
this._setStrokeState(
|
|
1144
|
+
this._setStrokeState(We.STRIKE_THROUGH, t);
|
|
1145
1145
|
}
|
|
1146
1146
|
/**
|
|
1147
1147
|
* Get whether text has overline
|
|
1148
1148
|
*/
|
|
1149
1149
|
get overline() {
|
|
1150
|
-
return !!(this._stroke &
|
|
1150
|
+
return !!(this._stroke & We.OVERLINE);
|
|
1151
1151
|
}
|
|
1152
1152
|
/**
|
|
1153
1153
|
* Set whether text has overline
|
|
1154
1154
|
* @param value - Whether to overline
|
|
1155
1155
|
*/
|
|
1156
1156
|
set overline(t) {
|
|
1157
|
-
this._setStrokeState(
|
|
1157
|
+
this._setStrokeState(We.OVERLINE, t);
|
|
1158
1158
|
}
|
|
1159
1159
|
/**
|
|
1160
1160
|
* Check if any stroke formatting is active
|
|
@@ -1712,7 +1712,7 @@ function pu() {
|
|
|
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 =
|
|
1715
|
+
return this.enabled === !1 || r === a || !r || !a || (this.spaces[r].transfer === qi && (i.r = Re(i.r), i.g = Re(i.g), i.b = Re(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);
|
|
@@ -1766,7 +1766,7 @@ function pu() {
|
|
|
1766
1766
|
}), n;
|
|
1767
1767
|
}
|
|
1768
1768
|
const ee = /* @__PURE__ */ pu();
|
|
1769
|
-
function
|
|
1769
|
+
function Re(n) {
|
|
1770
1770
|
return n < 0.04045 ? n * 0.0773993808 : Math.pow(n * 0.9478672986 + 0.0521327014, 2.4);
|
|
1771
1771
|
}
|
|
1772
1772
|
function Rn(n) {
|
|
@@ -1795,12 +1795,12 @@ class du {
|
|
|
1795
1795
|
s.drawImage(t, 0, 0, t.width, t.height);
|
|
1796
1796
|
const i = s.getImageData(0, 0, t.width, t.height), r = i.data;
|
|
1797
1797
|
for (let a = 0; a < r.length; a++)
|
|
1798
|
-
r[a] =
|
|
1798
|
+
r[a] = Re(r[a] / 255) * 255;
|
|
1799
1799
|
return s.putImageData(i, 0, 0), e;
|
|
1800
1800
|
} else if (t.data) {
|
|
1801
1801
|
const e = t.data.slice(0);
|
|
1802
1802
|
for (let s = 0; s < e.length; s++)
|
|
1803
|
-
e instanceof Uint8Array || e instanceof Uint8ClampedArray ? e[s] = Math.floor(
|
|
1803
|
+
e instanceof Uint8Array || e instanceof Uint8ClampedArray ? e[s] = Math.floor(Re(e[s] / 255) * 255) : e[s] = Re(e[s]);
|
|
1804
1804
|
return {
|
|
1805
1805
|
data: e,
|
|
1806
1806
|
width: t.width,
|
|
@@ -2727,37 +2727,37 @@ class At {
|
|
|
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), Ue.subVectors(wn, Sn), Pe.subVectors(Cn, wn), nn.subVectors(Sn, Cn);
|
|
2731
2731
|
let e = [
|
|
2732
|
-
0,
|
|
2733
|
-
-De.z,
|
|
2734
|
-
De.y,
|
|
2735
2732
|
0,
|
|
2736
2733
|
-Ue.z,
|
|
2737
2734
|
Ue.y,
|
|
2738
2735
|
0,
|
|
2736
|
+
-Pe.z,
|
|
2737
|
+
Pe.y,
|
|
2738
|
+
0,
|
|
2739
2739
|
-nn.z,
|
|
2740
2740
|
nn.y,
|
|
2741
|
-
De.z,
|
|
2742
|
-
0,
|
|
2743
|
-
-De.x,
|
|
2744
2741
|
Ue.z,
|
|
2745
2742
|
0,
|
|
2746
2743
|
-Ue.x,
|
|
2744
|
+
Pe.z,
|
|
2745
|
+
0,
|
|
2746
|
+
-Pe.x,
|
|
2747
2747
|
nn.z,
|
|
2748
2748
|
0,
|
|
2749
2749
|
-nn.x,
|
|
2750
|
-
-De.y,
|
|
2751
|
-
De.x,
|
|
2752
|
-
0,
|
|
2753
2750
|
-Ue.y,
|
|
2754
2751
|
Ue.x,
|
|
2755
2752
|
0,
|
|
2753
|
+
-Pe.y,
|
|
2754
|
+
Pe.x,
|
|
2755
|
+
0,
|
|
2756
2756
|
-nn.y,
|
|
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(Ue, Pe), 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);
|
|
@@ -2775,7 +2775,7 @@ class At {
|
|
|
2775
2775
|
return this.min.min(t.min), this.max.max(t.max), this;
|
|
2776
2776
|
}
|
|
2777
2777
|
applyMatrix4(t) {
|
|
2778
|
-
return this.isEmpty() ? this : (
|
|
2778
|
+
return this.isEmpty() ? this : (Fe[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t), Fe[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t), Fe[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t), Fe[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t), Fe[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t), Fe[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t), Fe[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t), Fe[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t), this.setFromPoints(Fe), this);
|
|
2779
2779
|
}
|
|
2780
2780
|
translate(t) {
|
|
2781
2781
|
return this.min.add(t), this.max.add(t), this;
|
|
@@ -2784,7 +2784,7 @@ class At {
|
|
|
2784
2784
|
return t.min.equals(this.min) && t.max.equals(this.max);
|
|
2785
2785
|
}
|
|
2786
2786
|
}
|
|
2787
|
-
const
|
|
2787
|
+
const Fe = [
|
|
2788
2788
|
/* @__PURE__ */ new E(),
|
|
2789
2789
|
/* @__PURE__ */ new E(),
|
|
2790
2790
|
/* @__PURE__ */ new E(),
|
|
@@ -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(), Ls = /* @__PURE__ */ new At(), Sn = /* @__PURE__ */ new E(), wn = /* @__PURE__ */ new E(), Cn = /* @__PURE__ */ new E(),
|
|
2796
|
+
], ne = /* @__PURE__ */ new E(), Ls = /* @__PURE__ */ new At(), Sn = /* @__PURE__ */ new E(), wn = /* @__PURE__ */ new E(), Cn = /* @__PURE__ */ new E(), Ue = /* @__PURE__ */ new E(), Pe = /* @__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);
|
|
@@ -2878,7 +2878,7 @@ class fa {
|
|
|
2878
2878
|
return new this.constructor().copy(this);
|
|
2879
2879
|
}
|
|
2880
2880
|
}
|
|
2881
|
-
const
|
|
2881
|
+
const Ae = /* @__PURE__ */ new E(), Ki = /* @__PURE__ */ new E(), Rs = /* @__PURE__ */ new E(), Ne = /* @__PURE__ */ new E(), Qi = /* @__PURE__ */ new E(), Ds = /* @__PURE__ */ new E(), tr = /* @__PURE__ */ new E();
|
|
2882
2882
|
class fh {
|
|
2883
2883
|
constructor(t = new E(), e = new E(0, 0, -1)) {
|
|
2884
2884
|
this.origin = t, this.direction = e;
|
|
@@ -2896,7 +2896,7 @@ class fh {
|
|
|
2896
2896
|
return this.direction.copy(t).sub(this.origin).normalize(), this;
|
|
2897
2897
|
}
|
|
2898
2898
|
recast(t) {
|
|
2899
|
-
return this.origin.copy(this.at(t,
|
|
2899
|
+
return this.origin.copy(this.at(t, Ae)), this;
|
|
2900
2900
|
}
|
|
2901
2901
|
closestPointToPoint(t, e) {
|
|
2902
2902
|
e.subVectors(t, this.origin);
|
|
@@ -2907,12 +2907,12 @@ class fh {
|
|
|
2907
2907
|
return Math.sqrt(this.distanceSqToPoint(t));
|
|
2908
2908
|
}
|
|
2909
2909
|
distanceSqToPoint(t) {
|
|
2910
|
-
const e =
|
|
2911
|
-
return e < 0 ? this.origin.distanceToSquared(t) : (
|
|
2910
|
+
const e = Ae.subVectors(t, this.origin).dot(this.direction);
|
|
2911
|
+
return e < 0 ? this.origin.distanceToSquared(t) : (Ae.copy(this.origin).addScaledVector(this.direction, e), Ae.distanceToSquared(t));
|
|
2912
2912
|
}
|
|
2913
2913
|
distanceSqToSegment(t, e, s, i) {
|
|
2914
|
-
Ki.copy(t).add(e).multiplyScalar(0.5), Rs.copy(e).sub(t).normalize(),
|
|
2915
|
-
const r = t.distanceTo(e) * 0.5, a = -this.direction.dot(Rs), o =
|
|
2914
|
+
Ki.copy(t).add(e).multiplyScalar(0.5), Rs.copy(e).sub(t).normalize(), Ne.copy(this.origin).sub(Ki);
|
|
2915
|
+
const r = t.distanceTo(e) * 0.5, a = -this.direction.dot(Rs), o = Ne.dot(this.direction), c = -Ne.dot(Rs), h = Ne.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)
|
|
@@ -2931,8 +2931,8 @@ class fh {
|
|
|
2931
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
|
-
|
|
2935
|
-
const s =
|
|
2934
|
+
Ae.subVectors(t.center, this.origin);
|
|
2935
|
+
const s = Ae.dot(this.direction), i = Ae.dot(Ae) - s * s, r = t.radius * t.radius;
|
|
2936
2936
|
if (i > r) return null;
|
|
2937
2937
|
const a = Math.sqrt(r - i), o = s - a, c = s + a;
|
|
2938
2938
|
return c < 0 ? null : o < 0 ? this.at(c, e) : this.at(o, e);
|
|
@@ -2961,7 +2961,7 @@ class fh {
|
|
|
2961
2961
|
return h >= 0 ? (s = (t.min.x - f.x) * h, i = (t.max.x - f.x) * h) : (s = (t.max.x - f.x) * h, i = (t.min.x - f.x) * h), l >= 0 ? (r = (t.min.y - f.y) * l, a = (t.max.y - f.y) * l) : (r = (t.max.y - f.y) * l, a = (t.min.y - f.y) * l), s > a || r > i || ((r > s || isNaN(s)) && (s = r), (a < i || isNaN(i)) && (i = a), u >= 0 ? (o = (t.min.z - f.z) * u, c = (t.max.z - f.z) * u) : (o = (t.max.z - f.z) * u, c = (t.min.z - f.z) * u), s > c || o > i) || ((o > s || s !== s) && (s = o), (c < i || i !== i) && (i = c), i < 0) ? null : this.at(s >= 0 ? s : i, e);
|
|
2962
2962
|
}
|
|
2963
2963
|
intersectsBox(t) {
|
|
2964
|
-
return this.intersectBox(t,
|
|
2964
|
+
return this.intersectBox(t, Ae) !== null;
|
|
2965
2965
|
}
|
|
2966
2966
|
intersectTriangle(t, e, s, i, r) {
|
|
2967
2967
|
Qi.subVectors(e, t), Ds.subVectors(s, t), tr.crossVectors(Qi, Ds);
|
|
@@ -2973,14 +2973,14 @@ class fh {
|
|
|
2973
2973
|
o = -1, a = -a;
|
|
2974
2974
|
else
|
|
2975
2975
|
return null;
|
|
2976
|
-
|
|
2977
|
-
const c = o * this.direction.dot(Ds.crossVectors(
|
|
2976
|
+
Ne.subVectors(this.origin, t);
|
|
2977
|
+
const c = o * this.direction.dot(Ds.crossVectors(Ne, Ds));
|
|
2978
2978
|
if (c < 0)
|
|
2979
2979
|
return null;
|
|
2980
|
-
const h = o * this.direction.dot(Qi.cross(
|
|
2980
|
+
const h = o * this.direction.dot(Qi.cross(Ne));
|
|
2981
2981
|
if (h < 0 || c + h > a)
|
|
2982
2982
|
return null;
|
|
2983
|
-
const l = -o *
|
|
2983
|
+
const l = -o * Ne.dot(tr);
|
|
2984
2984
|
return l < 0 ? null : this.at(l / a, r);
|
|
2985
2985
|
}
|
|
2986
2986
|
applyMatrix4(t) {
|
|
@@ -3125,7 +3125,7 @@ class mt {
|
|
|
3125
3125
|
}
|
|
3126
3126
|
lookAt(t, e, s) {
|
|
3127
3127
|
const i = this.elements;
|
|
3128
|
-
return Wt.subVectors(t, e), Wt.lengthSq() === 0 && (Wt.z = 1), Wt.normalize(),
|
|
3128
|
+
return Wt.subVectors(t, e), Wt.lengthSq() === 0 && (Wt.z = 1), Wt.normalize(), ze.crossVectors(s, Wt), ze.lengthSq() === 0 && (Math.abs(s.z) === 1 ? Wt.x += 1e-4 : Wt.z += 1e-4, Wt.normalize(), ze.crossVectors(s, Wt)), ze.normalize(), Us.crossVectors(Wt, ze), i[0] = ze.x, i[4] = Us.x, i[8] = Wt.x, i[1] = ze.y, i[5] = Us.y, i[9] = Wt.y, i[2] = ze.z, i[6] = Us.z, i[10] = Wt.z, this;
|
|
3129
3129
|
}
|
|
3130
3130
|
multiply(t) {
|
|
3131
3131
|
return this.multiplyMatrices(this, t);
|
|
@@ -3379,7 +3379,7 @@ class mt {
|
|
|
3379
3379
|
return t[e] = s[0], t[e + 1] = s[1], t[e + 2] = s[2], t[e + 3] = s[3], t[e + 4] = s[4], t[e + 5] = s[5], t[e + 6] = s[6], t[e + 7] = s[7], t[e + 8] = s[8], t[e + 9] = s[9], t[e + 10] = s[10], t[e + 11] = s[11], t[e + 12] = s[12], t[e + 13] = s[13], t[e + 14] = s[14], t[e + 15] = s[15], t;
|
|
3380
3380
|
}
|
|
3381
3381
|
}
|
|
3382
|
-
const Tn = /* @__PURE__ */ new E(), se = /* @__PURE__ */ new mt(), bu = /* @__PURE__ */ new E(0, 0, 0), vu = /* @__PURE__ */ new E(1, 1, 1),
|
|
3382
|
+
const Tn = /* @__PURE__ */ new E(), se = /* @__PURE__ */ new mt(), bu = /* @__PURE__ */ new E(0, 0, 0), vu = /* @__PURE__ */ new E(1, 1, 1), ze = /* @__PURE__ */ new E(), Us = /* @__PURE__ */ new E(), Wt = /* @__PURE__ */ new E(), no = /* @__PURE__ */ new mt(), so = /* @__PURE__ */ new gn();
|
|
3383
3383
|
class ws {
|
|
3384
3384
|
constructor(t = 0, e = 0, s = 0, i = ws.DEFAULT_ORDER) {
|
|
3385
3385
|
this.isEuler = !0, this._x = t, this._y = e, this._z = s, this._order = i;
|
|
@@ -3501,7 +3501,7 @@ class Su {
|
|
|
3501
3501
|
}
|
|
3502
3502
|
}
|
|
3503
3503
|
let wu = 0;
|
|
3504
|
-
const io = /* @__PURE__ */ new E(), Fn = /* @__PURE__ */ new gn(),
|
|
3504
|
+
const io = /* @__PURE__ */ new E(), Fn = /* @__PURE__ */ new gn(), ke = /* @__PURE__ */ new mt(), Ps = /* @__PURE__ */ new E(), ts = /* @__PURE__ */ new E(), Cu = /* @__PURE__ */ new E(), Tu = /* @__PURE__ */ new gn(), ro = /* @__PURE__ */ new E(1, 0, 0), ao = /* @__PURE__ */ new E(0, 1, 0), oo = /* @__PURE__ */ new E(0, 0, 1), co = { type: "added" }, Fu = { type: "removed" }, An = { type: "childadded", child: null }, er = { type: "childremoved", child: null };
|
|
3505
3505
|
class Xt extends Ii {
|
|
3506
3506
|
constructor() {
|
|
3507
3507
|
super(), this.isObject3D = !0, Object.defineProperty(this, "id", { value: wu++ }), this.uuid = Yn(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = Xt.DEFAULT_UP.clone();
|
|
@@ -3598,12 +3598,12 @@ class Xt extends Ii {
|
|
|
3598
3598
|
return this.updateWorldMatrix(!0, !1), t.applyMatrix4(this.matrixWorld);
|
|
3599
3599
|
}
|
|
3600
3600
|
worldToLocal(t) {
|
|
3601
|
-
return this.updateWorldMatrix(!0, !1), t.applyMatrix4(
|
|
3601
|
+
return this.updateWorldMatrix(!0, !1), t.applyMatrix4(ke.copy(this.matrixWorld).invert());
|
|
3602
3602
|
}
|
|
3603
3603
|
lookAt(t, e, s) {
|
|
3604
3604
|
t.isVector3 ? Ps.copy(t) : Ps.set(t, e, s);
|
|
3605
3605
|
const i = this.parent;
|
|
3606
|
-
this.updateWorldMatrix(!0, !1), ts.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ?
|
|
3606
|
+
this.updateWorldMatrix(!0, !1), ts.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? ke.lookAt(ts, Ps, this.up) : ke.lookAt(Ps, ts, this.up), this.quaternion.setFromRotationMatrix(ke), i && (ke.extractRotation(i.matrixWorld), Fn.setFromRotationMatrix(ke), this.quaternion.premultiply(Fn.invert()));
|
|
3607
3607
|
}
|
|
3608
3608
|
add(t) {
|
|
3609
3609
|
if (arguments.length > 1) {
|
|
@@ -3630,7 +3630,7 @@ class Xt extends Ii {
|
|
|
3630
3630
|
return this.remove(...this.children);
|
|
3631
3631
|
}
|
|
3632
3632
|
attach(t) {
|
|
3633
|
-
return this.updateWorldMatrix(!0, !1),
|
|
3633
|
+
return this.updateWorldMatrix(!0, !1), ke.copy(this.matrixWorld).invert(), t.parent !== null && (t.parent.updateWorldMatrix(!0, !1), ke.multiply(t.parent.matrixWorld)), t.applyMatrix4(ke), t.removeFromParent(), t.parent = this, this.children.push(t), t.updateWorldMatrix(!1, !0), t.dispatchEvent(co), An.child = t, this.dispatchEvent(An), An.child = null, this;
|
|
3634
3634
|
}
|
|
3635
3635
|
getObjectById(t) {
|
|
3636
3636
|
return this.getObjectByProperty("id", t);
|
|
@@ -3802,7 +3802,7 @@ class Xt extends Ii {
|
|
|
3802
3802
|
Xt.DEFAULT_UP = /* @__PURE__ */ new E(0, 1, 0);
|
|
3803
3803
|
Xt.DEFAULT_MATRIX_AUTO_UPDATE = !0;
|
|
3804
3804
|
Xt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0;
|
|
3805
|
-
const ie = /* @__PURE__ */ new E(),
|
|
3805
|
+
const ie = /* @__PURE__ */ new E(), Ee = /* @__PURE__ */ new E(), nr = /* @__PURE__ */ new E(), Me = /* @__PURE__ */ new E(), kn = /* @__PURE__ */ new E(), En = /* @__PURE__ */ new E(), ho = /* @__PURE__ */ new E(), sr = /* @__PURE__ */ new E(), ir = /* @__PURE__ */ new E(), rr = /* @__PURE__ */ new E(), ar = /* @__PURE__ */ new Ss(), or = /* @__PURE__ */ new Ss(), cr = /* @__PURE__ */ new Ss();
|
|
3806
3806
|
class ce {
|
|
3807
3807
|
constructor(t = new E(), e = new E(), s = new E()) {
|
|
3808
3808
|
this.a = t, this.b = e, this.c = s;
|
|
@@ -3815,24 +3815,24 @@ class ce {
|
|
|
3815
3815
|
// static/instance method to calculate barycentric coordinates
|
|
3816
3816
|
// based on: http://www.blackpawn.com/texts/pointinpoly/default.html
|
|
3817
3817
|
static getBarycoord(t, e, s, i, r) {
|
|
3818
|
-
ie.subVectors(i, e),
|
|
3819
|
-
const a = ie.dot(ie), o = ie.dot(
|
|
3818
|
+
ie.subVectors(i, e), Ee.subVectors(s, e), nr.subVectors(t, e);
|
|
3819
|
+
const a = ie.dot(ie), o = ie.dot(Ee), c = ie.dot(nr), h = Ee.dot(Ee), l = Ee.dot(nr), u = a * h - o * o;
|
|
3820
3820
|
if (u === 0)
|
|
3821
3821
|
return r.set(0, 0, 0), null;
|
|
3822
3822
|
const f = 1 / u, p = (h * c - o * l) * f, d = (a * l - o * c) * f;
|
|
3823
3823
|
return r.set(1 - p - d, d, p);
|
|
3824
3824
|
}
|
|
3825
3825
|
static containsPoint(t, e, s, i) {
|
|
3826
|
-
return this.getBarycoord(t, e, s, i,
|
|
3826
|
+
return this.getBarycoord(t, e, s, i, Me) === null ? !1 : Me.x >= 0 && Me.y >= 0 && Me.x + Me.y <= 1;
|
|
3827
3827
|
}
|
|
3828
3828
|
static getInterpolation(t, e, s, i, r, a, o, c) {
|
|
3829
|
-
return this.getBarycoord(t, e, s, i,
|
|
3829
|
+
return this.getBarycoord(t, e, s, i, Me) === null ? (c.x = 0, c.y = 0, "z" in c && (c.z = 0), "w" in c && (c.w = 0), null) : (c.setScalar(0), c.addScaledVector(r, Me.x), c.addScaledVector(a, Me.y), c.addScaledVector(o, Me.z), c);
|
|
3830
3830
|
}
|
|
3831
3831
|
static getInterpolatedAttribute(t, e, s, i, r, a) {
|
|
3832
3832
|
return ar.setScalar(0), or.setScalar(0), cr.setScalar(0), ar.fromBufferAttribute(t, e), or.fromBufferAttribute(t, s), cr.fromBufferAttribute(t, i), a.setScalar(0), a.addScaledVector(ar, r.x), a.addScaledVector(or, r.y), a.addScaledVector(cr, r.z), a;
|
|
3833
3833
|
}
|
|
3834
3834
|
static isFrontFacing(t, e, s, i) {
|
|
3835
|
-
return ie.subVectors(s, e),
|
|
3835
|
+
return ie.subVectors(s, e), Ee.subVectors(t, e), ie.cross(Ee).dot(i) < 0;
|
|
3836
3836
|
}
|
|
3837
3837
|
set(t, e, s) {
|
|
3838
3838
|
return this.a.copy(t), this.b.copy(e), this.c.copy(s), this;
|
|
@@ -3850,7 +3850,7 @@ class ce {
|
|
|
3850
3850
|
return this.a.copy(t.a), this.b.copy(t.b), this.c.copy(t.c), this;
|
|
3851
3851
|
}
|
|
3852
3852
|
getArea() {
|
|
3853
|
-
return ie.subVectors(this.c, this.b),
|
|
3853
|
+
return ie.subVectors(this.c, this.b), Ee.subVectors(this.a, this.b), ie.cross(Ee).length() * 0.5;
|
|
3854
3854
|
}
|
|
3855
3855
|
getMidpoint(t) {
|
|
3856
3856
|
return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);
|
|
@@ -4056,7 +4056,7 @@ const ph = {
|
|
|
4056
4056
|
whitesmoke: 16119285,
|
|
4057
4057
|
yellow: 16776960,
|
|
4058
4058
|
yellowgreen: 10145074
|
|
4059
|
-
},
|
|
4059
|
+
}, He = { h: 0, s: 0, l: 0 }, Ns = { h: 0, s: 0, l: 0 };
|
|
4060
4060
|
function hr(n, t, e) {
|
|
4061
4061
|
return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? n + (t - n) * 6 * e : e < 1 / 2 ? t : e < 2 / 3 ? n + (t - n) * 6 * (2 / 3 - e) : n;
|
|
4062
4062
|
}
|
|
@@ -4156,7 +4156,7 @@ class $n {
|
|
|
4156
4156
|
return this.r = t.r, this.g = t.g, this.b = t.b, this;
|
|
4157
4157
|
}
|
|
4158
4158
|
copySRGBToLinear(t) {
|
|
4159
|
-
return this.r =
|
|
4159
|
+
return this.r = Re(t.r), this.g = Re(t.g), this.b = Re(t.b), this;
|
|
4160
4160
|
}
|
|
4161
4161
|
copyLinearToSRGB(t) {
|
|
4162
4162
|
return this.r = Rn(t.r), this.g = Rn(t.g), this.b = Rn(t.b), this;
|
|
@@ -4206,7 +4206,7 @@ class $n {
|
|
|
4206
4206
|
return t !== re ? `color(${t} ${e.toFixed(3)} ${s.toFixed(3)} ${i.toFixed(3)})` : `rgb(${Math.round(e * 255)},${Math.round(s * 255)},${Math.round(i * 255)})`;
|
|
4207
4207
|
}
|
|
4208
4208
|
offsetHSL(t, e, s) {
|
|
4209
|
-
return this.getHSL(
|
|
4209
|
+
return this.getHSL(He), this.setHSL(He.h + t, He.s + e, He.l + s);
|
|
4210
4210
|
}
|
|
4211
4211
|
add(t) {
|
|
4212
4212
|
return this.r += t.r, this.g += t.g, this.b += t.b, this;
|
|
@@ -4233,8 +4233,8 @@ class $n {
|
|
|
4233
4233
|
return this.r = t.r + (e.r - t.r) * s, this.g = t.g + (e.g - t.g) * s, this.b = t.b + (e.b - t.b) * s, this;
|
|
4234
4234
|
}
|
|
4235
4235
|
lerpHSL(t, e) {
|
|
4236
|
-
this.getHSL(
|
|
4237
|
-
const s = ji(
|
|
4236
|
+
this.getHSL(He), t.getHSL(Ns);
|
|
4237
|
+
const s = ji(He.h, Ns.h, e), i = ji(He.s, Ns.s, e), r = ji(He.l, Ns.l, e);
|
|
4238
4238
|
return this.setHSL(s, i, r), this;
|
|
4239
4239
|
}
|
|
4240
4240
|
setFromVector3(t) {
|
|
@@ -5038,7 +5038,7 @@ class xo extends Xt {
|
|
|
5038
5038
|
super(), this.isGroup = !0, this.type = "Group";
|
|
5039
5039
|
}
|
|
5040
5040
|
}
|
|
5041
|
-
class
|
|
5041
|
+
class Ce {
|
|
5042
5042
|
constructor() {
|
|
5043
5043
|
this.type = "Curve", this.arcLengthDivisions = 200;
|
|
5044
5044
|
}
|
|
@@ -5173,7 +5173,7 @@ class we {
|
|
|
5173
5173
|
return this.arcLengthDivisions = t.arcLengthDivisions, this;
|
|
5174
5174
|
}
|
|
5175
5175
|
}
|
|
5176
|
-
class fs extends
|
|
5176
|
+
class fs extends Ce {
|
|
5177
5177
|
constructor(t = 0, e = 0, s = 1, i = 1, r = 0, a = Math.PI * 2, o = !1, c = 0) {
|
|
5178
5178
|
super(), this.isEllipseCurve = !0, this.type = "EllipseCurve", this.aX = t, this.aY = e, this.xRadius = s, this.yRadius = i, this.aStartAngle = r, this.aEndAngle = a, this.aClockwise = o, this.aRotation = c;
|
|
5179
5179
|
}
|
|
@@ -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 Lu extends
|
|
5231
|
+
class Lu extends Ce {
|
|
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
|
}
|
|
@@ -5310,7 +5310,7 @@ function Nu(n, t) {
|
|
|
5310
5310
|
function cs(n, t, e, s, i) {
|
|
5311
5311
|
return Du(n, t) + Uu(n, e) + Pu(n, s) + Nu(n, i);
|
|
5312
5312
|
}
|
|
5313
|
-
class yi extends
|
|
5313
|
+
class yi extends Ce {
|
|
5314
5314
|
constructor(t = new X(), e = new X(), s = new X(), i = new X()) {
|
|
5315
5315
|
super(), this.isCubicBezierCurve = !0, this.type = "CubicBezierCurve", this.v0 = t, this.v1 = e, this.v2 = s, this.v3 = i;
|
|
5316
5316
|
}
|
|
@@ -5332,7 +5332,7 @@ class yi extends we {
|
|
|
5332
5332
|
return super.fromJSON(t), this.v0.fromArray(t.v0), this.v1.fromArray(t.v1), this.v2.fromArray(t.v2), this.v3.fromArray(t.v3), this;
|
|
5333
5333
|
}
|
|
5334
5334
|
}
|
|
5335
|
-
class zu extends
|
|
5335
|
+
class zu extends Ce {
|
|
5336
5336
|
constructor(t = new E(), e = new E(), s = new E(), i = new E()) {
|
|
5337
5337
|
super(), this.isCubicBezierCurve3 = !0, this.type = "CubicBezierCurve3", this.v0 = t, this.v1 = e, this.v2 = s, this.v3 = i;
|
|
5338
5338
|
}
|
|
@@ -5355,7 +5355,7 @@ class zu extends we {
|
|
|
5355
5355
|
return super.fromJSON(t), this.v0.fromArray(t.v0), this.v1.fromArray(t.v1), this.v2.fromArray(t.v2), this.v3.fromArray(t.v3), this;
|
|
5356
5356
|
}
|
|
5357
5357
|
}
|
|
5358
|
-
class hs extends
|
|
5358
|
+
class hs extends Ce {
|
|
5359
5359
|
constructor(t = new X(), e = new X()) {
|
|
5360
5360
|
super(), this.isLineCurve = !0, this.type = "LineCurve", this.v1 = t, this.v2 = e;
|
|
5361
5361
|
}
|
|
@@ -5384,7 +5384,7 @@ class hs extends we {
|
|
|
5384
5384
|
return super.fromJSON(t), this.v1.fromArray(t.v1), this.v2.fromArray(t.v2), this;
|
|
5385
5385
|
}
|
|
5386
5386
|
}
|
|
5387
|
-
class Hu extends
|
|
5387
|
+
class Hu extends Ce {
|
|
5388
5388
|
constructor(t = new E(), e = new E()) {
|
|
5389
5389
|
super(), this.isLineCurve3 = !0, this.type = "LineCurve3", this.v1 = t, this.v2 = e;
|
|
5390
5390
|
}
|
|
@@ -5413,7 +5413,7 @@ class Hu extends we {
|
|
|
5413
5413
|
return super.fromJSON(t), this.v1.fromArray(t.v1), this.v2.fromArray(t.v2), this;
|
|
5414
5414
|
}
|
|
5415
5415
|
}
|
|
5416
|
-
class xi extends
|
|
5416
|
+
class xi extends Ce {
|
|
5417
5417
|
constructor(t = new X(), e = new X(), s = new X()) {
|
|
5418
5418
|
super(), this.isQuadraticBezierCurve = !0, this.type = "QuadraticBezierCurve", this.v0 = t, this.v1 = e, this.v2 = s;
|
|
5419
5419
|
}
|
|
@@ -5435,7 +5435,7 @@ class xi extends we {
|
|
|
5435
5435
|
return super.fromJSON(t), this.v0.fromArray(t.v0), this.v1.fromArray(t.v1), this.v2.fromArray(t.v2), this;
|
|
5436
5436
|
}
|
|
5437
5437
|
}
|
|
5438
|
-
class Gu extends
|
|
5438
|
+
class Gu extends Ce {
|
|
5439
5439
|
constructor(t = new E(), e = new E(), s = new E()) {
|
|
5440
5440
|
super(), this.isQuadraticBezierCurve3 = !0, this.type = "QuadraticBezierCurve3", this.v0 = t, this.v1 = e, this.v2 = s;
|
|
5441
5441
|
}
|
|
@@ -5458,7 +5458,7 @@ class Gu extends we {
|
|
|
5458
5458
|
return super.fromJSON(t), this.v0.fromArray(t.v0), this.v1.fromArray(t.v1), this.v2.fromArray(t.v2), this;
|
|
5459
5459
|
}
|
|
5460
5460
|
}
|
|
5461
|
-
class xh extends
|
|
5461
|
+
class xh extends Ce {
|
|
5462
5462
|
constructor(t = []) {
|
|
5463
5463
|
super(), this.isSplineCurve = !0, this.type = "SplineCurve", this.points = t;
|
|
5464
5464
|
}
|
|
@@ -5508,7 +5508,7 @@ var vo = /* @__PURE__ */ Object.freeze({
|
|
|
5508
5508
|
QuadraticBezierCurve3: Gu,
|
|
5509
5509
|
SplineCurve: xh
|
|
5510
5510
|
});
|
|
5511
|
-
class Vu extends
|
|
5511
|
+
class Vu extends Ce {
|
|
5512
5512
|
constructor() {
|
|
5513
5513
|
super(), this.type = "CurvePath", this.curves = [], this.autoClose = !1;
|
|
5514
5514
|
}
|
|
@@ -6146,7 +6146,7 @@ class wh {
|
|
|
6146
6146
|
}
|
|
6147
6147
|
}
|
|
6148
6148
|
wh.DEFAULT_MATERIAL_NAME = "__DEFAULT";
|
|
6149
|
-
const
|
|
6149
|
+
const Oe = {};
|
|
6150
6150
|
class uf extends Error {
|
|
6151
6151
|
constructor(t, e) {
|
|
6152
6152
|
super(t), this.response = e;
|
|
@@ -6163,15 +6163,15 @@ class ff extends wh {
|
|
|
6163
6163
|
return this.manager.itemStart(t), setTimeout(() => {
|
|
6164
6164
|
e && e(r), this.manager.itemEnd(t);
|
|
6165
6165
|
}, 0), r;
|
|
6166
|
-
if (
|
|
6167
|
-
|
|
6166
|
+
if (Oe[t] !== void 0) {
|
|
6167
|
+
Oe[t].push({
|
|
6168
6168
|
onLoad: e,
|
|
6169
6169
|
onProgress: s,
|
|
6170
6170
|
onError: i
|
|
6171
6171
|
});
|
|
6172
6172
|
return;
|
|
6173
6173
|
}
|
|
6174
|
-
|
|
6174
|
+
Oe[t] = [], Oe[t].push({
|
|
6175
6175
|
onLoad: e,
|
|
6176
6176
|
onProgress: s,
|
|
6177
6177
|
onError: i
|
|
@@ -6185,7 +6185,7 @@ class ff extends wh {
|
|
|
6185
6185
|
if (h.status === 200 || h.status === 0) {
|
|
6186
6186
|
if (h.status === 0 && console.warn("THREE.FileLoader: HTTP Status 0 received."), typeof ReadableStream > "u" || h.body === void 0 || h.body.getReader === void 0)
|
|
6187
6187
|
return h;
|
|
6188
|
-
const l =
|
|
6188
|
+
const l = Oe[t], u = h.body.getReader(), f = h.headers.get("X-File-Size") || h.headers.get("Content-Length"), p = f ? parseInt(f) : 0, d = p !== 0;
|
|
6189
6189
|
let g = 0;
|
|
6190
6190
|
const x = new ReadableStream({
|
|
6191
6191
|
start(b) {
|
|
@@ -6232,17 +6232,17 @@ class ff extends wh {
|
|
|
6232
6232
|
}
|
|
6233
6233
|
}).then((h) => {
|
|
6234
6234
|
To.add(t, h);
|
|
6235
|
-
const l =
|
|
6236
|
-
delete
|
|
6235
|
+
const l = Oe[t];
|
|
6236
|
+
delete Oe[t];
|
|
6237
6237
|
for (let u = 0, f = l.length; u < f; u++) {
|
|
6238
6238
|
const p = l[u];
|
|
6239
6239
|
p.onLoad && p.onLoad(h);
|
|
6240
6240
|
}
|
|
6241
6241
|
}).catch((h) => {
|
|
6242
|
-
const l =
|
|
6242
|
+
const l = Oe[t];
|
|
6243
6243
|
if (l === void 0)
|
|
6244
6244
|
throw this.manager.itemError(t), h;
|
|
6245
|
-
delete
|
|
6245
|
+
delete Oe[t];
|
|
6246
6246
|
for (let u = 0, f = l.length; u < f; u++) {
|
|
6247
6247
|
const p = l[u];
|
|
6248
6248
|
p.onError && p.onError(h);
|
|
@@ -6596,7 +6596,7 @@ class Fo {
|
|
|
6596
6596
|
s.call(null, t, ...e);
|
|
6597
6597
|
}
|
|
6598
6598
|
}
|
|
6599
|
-
const yf = (n) => n.substring(n.lastIndexOf(".") + 1), Eh = (n) => n.split("/").pop(),
|
|
6599
|
+
const yf = (n) => n.substring(n.lastIndexOf(".") + 1), Eh = (n) => n.split("/").pop(), qe = (n) => {
|
|
6600
6600
|
const t = Eh(n);
|
|
6601
6601
|
if (t) {
|
|
6602
6602
|
const e = t.lastIndexOf(".");
|
|
@@ -8781,7 +8781,7 @@ const on = {
|
|
|
8781
8781
|
* @returns The font data if found, undefined otherwise
|
|
8782
8782
|
*/
|
|
8783
8783
|
async find(t) {
|
|
8784
|
-
const e =
|
|
8784
|
+
const e = qe(t).toLowerCase(), s = await this.get(e);
|
|
8785
8785
|
return s || (await this.getAll()).find(
|
|
8786
8786
|
(r) => {
|
|
8787
8787
|
var a;
|
|
@@ -8900,7 +8900,7 @@ const on = {
|
|
|
8900
8900
|
}
|
|
8901
8901
|
};
|
|
8902
8902
|
jt.DATABASE_NAME = "mlightcad", jt.DATABASE_VERSION = xr[xr.length - 1].version;
|
|
8903
|
-
let
|
|
8903
|
+
let ge = jt;
|
|
8904
8904
|
const np = 512;
|
|
8905
8905
|
function sp(n, t) {
|
|
8906
8906
|
return (n + t) * np;
|
|
@@ -8920,13 +8920,31 @@ const Qr = {
|
|
|
8920
8920
|
// BIGFONT SHX stays available via glyph fallback for CJK coverage.
|
|
8921
8921
|
modern: ["simsun", "hztxt"],
|
|
8922
8922
|
international: ["txt", "simplex", "romans", "simsun"],
|
|
8923
|
-
|
|
8923
|
+
// Full CJK: mesh faces for CN/KR/JP, then matching SHX big fonts.
|
|
8924
|
+
// `malgun` → Noto Sans KR; `msgothic` → MS Gothic in the font repository.
|
|
8925
|
+
cjk: [
|
|
8926
|
+
"simsun",
|
|
8927
|
+
"malgun",
|
|
8928
|
+
"msgothic",
|
|
8929
|
+
"gbcbig",
|
|
8930
|
+
"hztxt",
|
|
8931
|
+
"extfont2",
|
|
8932
|
+
"extfont",
|
|
8933
|
+
"whgtxt",
|
|
8934
|
+
"whgdtxt"
|
|
8935
|
+
],
|
|
8936
|
+
chinese: ["simsun", "gbcbig", "hztxt"],
|
|
8937
|
+
korean: ["malgun", "whgtxt", "whgdtxt"],
|
|
8938
|
+
japanese: ["msgothic", "extfont2", "extfont"]
|
|
8924
8939
|
}, br = {
|
|
8925
8940
|
minimal: ["simplex", "amgdt"],
|
|
8926
8941
|
r12r14: ["simplex", "amgdt"],
|
|
8927
8942
|
modern: ["simplex", "amgdt"],
|
|
8928
8943
|
international: ["simplex", "amgdt"],
|
|
8929
|
-
cjk: ["simplex", "amgdt"]
|
|
8944
|
+
cjk: ["simplex", "amgdt"],
|
|
8945
|
+
chinese: ["simplex", "amgdt"],
|
|
8946
|
+
korean: ["simplex", "amgdt"],
|
|
8947
|
+
japanese: ["simplex", "amgdt"]
|
|
8930
8948
|
};
|
|
8931
8949
|
function Do(n) {
|
|
8932
8950
|
return Object.prototype.hasOwnProperty.call(Qr, n);
|
|
@@ -8991,7 +9009,7 @@ function hp(n) {
|
|
|
8991
9009
|
var t = n.tag & 1;
|
|
8992
9010
|
return n.tag >>>= 1, t;
|
|
8993
9011
|
}
|
|
8994
|
-
function
|
|
9012
|
+
function ye(n, t, e) {
|
|
8995
9013
|
if (!t)
|
|
8996
9014
|
return e;
|
|
8997
9015
|
for (; n.bitcount < 24; )
|
|
@@ -9010,9 +9028,9 @@ function ta(n, t) {
|
|
|
9010
9028
|
}
|
|
9011
9029
|
function lp(n, t, e) {
|
|
9012
9030
|
var s, i, r, a, o, c;
|
|
9013
|
-
for (s =
|
|
9031
|
+
for (s = ye(n, 5, 257), i = ye(n, 5, 1), r = ye(n, 4, 4), a = 0; a < 19; ++a) de[a] = 0;
|
|
9014
9032
|
for (a = 0; a < r; ++a) {
|
|
9015
|
-
var h =
|
|
9033
|
+
var h = ye(n, 3, 0);
|
|
9016
9034
|
de[op[a]] = h;
|
|
9017
9035
|
}
|
|
9018
9036
|
for (vr(Uo, de, 0, 19), o = 0; o < s + i; ) {
|
|
@@ -9020,15 +9038,15 @@ function lp(n, t, e) {
|
|
|
9020
9038
|
switch (l) {
|
|
9021
9039
|
case 16:
|
|
9022
9040
|
var u = de[o - 1];
|
|
9023
|
-
for (c =
|
|
9041
|
+
for (c = ye(n, 2, 3); c; --c)
|
|
9024
9042
|
de[o++] = u;
|
|
9025
9043
|
break;
|
|
9026
9044
|
case 17:
|
|
9027
|
-
for (c =
|
|
9045
|
+
for (c = ye(n, 3, 3); c; --c)
|
|
9028
9046
|
de[o++] = 0;
|
|
9029
9047
|
break;
|
|
9030
9048
|
case 18:
|
|
9031
|
-
for (c =
|
|
9049
|
+
for (c = ye(n, 7, 11); c; --c)
|
|
9032
9050
|
de[o++] = 0;
|
|
9033
9051
|
break;
|
|
9034
9052
|
default:
|
|
@@ -9047,7 +9065,7 @@ function No(n, t, e) {
|
|
|
9047
9065
|
n.dest[n.destLen++] = s;
|
|
9048
9066
|
else {
|
|
9049
9067
|
var i, r, a, o;
|
|
9050
|
-
for (s -= 257, i =
|
|
9068
|
+
for (s -= 257, i = ye(n, ma[s], ya[s]), r = ta(n, e), a = n.destLen - ye(n, Hh[r], Gh[r]), o = a; o < a + i; ++o)
|
|
9051
9069
|
n.dest[n.destLen++] = n.dest[o];
|
|
9052
9070
|
}
|
|
9053
9071
|
}
|
|
@@ -9064,7 +9082,7 @@ function up(n) {
|
|
|
9064
9082
|
function Wh(n, t) {
|
|
9065
9083
|
var e = new ap(n, t), s, i, r;
|
|
9066
9084
|
do {
|
|
9067
|
-
switch (s = hp(e), i =
|
|
9085
|
+
switch (s = hp(e), i = ye(e, 2, 0), i) {
|
|
9068
9086
|
case 0:
|
|
9069
9087
|
r = up(e);
|
|
9070
9088
|
break;
|
|
@@ -13847,7 +13865,7 @@ function rd(n, t, e, s, i) {
|
|
|
13847
13865
|
}, r;
|
|
13848
13866
|
};
|
|
13849
13867
|
}
|
|
13850
|
-
var
|
|
13868
|
+
var we = { GlyphSet: Pi, glyphLoader: sd, ttfGlyphLoader: id, cffGlyphLoader: rd };
|
|
13851
13869
|
function cl(n, t) {
|
|
13852
13870
|
if (n === t)
|
|
13853
13871
|
return !0;
|
|
@@ -13866,7 +13884,7 @@ function Oi(n) {
|
|
|
13866
13884
|
let t;
|
|
13867
13885
|
return n.length < 1240 ? t = 107 : n.length < 33900 ? t = 1131 : t = 32768, t;
|
|
13868
13886
|
}
|
|
13869
|
-
function
|
|
13887
|
+
function me(n, t, e, s) {
|
|
13870
13888
|
const i = [], r = [], a = s > 1 ? z.getULong(n, t) : z.getCard16(n, t), o = s > 1 ? 4 : 2;
|
|
13871
13889
|
let c, h;
|
|
13872
13890
|
if (a !== 0) {
|
|
@@ -14079,7 +14097,7 @@ function yd(n, t, e) {
|
|
|
14079
14097
|
if (o !== 0 && c !== 0) {
|
|
14080
14098
|
const h = Ta(n, c + t, o, [], 2);
|
|
14081
14099
|
if (h.subrs) {
|
|
14082
|
-
const l = c + h.subrs, u =
|
|
14100
|
+
const l = c + h.subrs, u = me(n, l + t, void 0, 2);
|
|
14083
14101
|
a._subrs = u.objects, a._subrsBias = Oi(a._subrs);
|
|
14084
14102
|
}
|
|
14085
14103
|
a._privateDict = h;
|
|
@@ -14097,7 +14115,7 @@ function Sr(n, t, e, s, i) {
|
|
|
14097
14115
|
if (h !== 0 && l !== 0) {
|
|
14098
14116
|
const u = Ta(n, l + t, h, s, i);
|
|
14099
14117
|
if (c._defaultWidthX = u.defaultWidthX, c._nominalWidthX = u.nominalWidthX, u.subrs !== 0) {
|
|
14100
|
-
const f = l + u.subrs, p =
|
|
14118
|
+
const f = l + u.subrs, p = me(n, f + t, void 0, i);
|
|
14101
14119
|
c._subrs = p.objects, c._subrsBias = Oi(c._subrs);
|
|
14102
14120
|
}
|
|
14103
14121
|
c._privateDict = u;
|
|
@@ -14248,10 +14266,10 @@ function ra(n, t, e, s, i) {
|
|
|
14248
14266
|
break;
|
|
14249
14267
|
}
|
|
14250
14268
|
if (l.length >= 4) {
|
|
14251
|
-
const
|
|
14252
|
-
if (
|
|
14269
|
+
const Te = ia[l.pop()], C = ia[l.pop()], m = l.pop(), y = l.pop();
|
|
14270
|
+
if (Te && C) {
|
|
14253
14271
|
t.isComposite = !0, t.components = [];
|
|
14254
|
-
const T = n.cffEncoding.charset.indexOf(
|
|
14272
|
+
const T = n.cffEncoding.charset.indexOf(Te), k = n.cffEncoding.charset.indexOf(C);
|
|
14255
14273
|
t.components.push({
|
|
14256
14274
|
glyphIndex: k,
|
|
14257
14275
|
dx: 0,
|
|
@@ -14286,11 +14304,11 @@ function ra(n, t, e, s, i) {
|
|
|
14286
14304
|
M || (M = n.variation && i && n.variation.process.getBlendVector(F, w, i));
|
|
14287
14305
|
var tt = l.pop(), Et = M ? M.length : F.itemVariationSubtables[w].regionIndexes.length, Nt = tt * Et, zt = l.length - Nt, Ht = zt - tt;
|
|
14288
14306
|
if (M)
|
|
14289
|
-
for (let
|
|
14290
|
-
var Vt = l[Ht +
|
|
14307
|
+
for (let Te = 0; Te < tt; Te++) {
|
|
14308
|
+
var Vt = l[Ht + Te];
|
|
14291
14309
|
for (let C = 0; C < Et; C++)
|
|
14292
14310
|
Vt += M[C] * l[zt++];
|
|
14293
|
-
l[Ht +
|
|
14311
|
+
l[Ht + Te] = Vt;
|
|
14294
14312
|
}
|
|
14295
14313
|
for (; Nt--; )
|
|
14296
14314
|
l.pop();
|
|
@@ -14398,7 +14416,7 @@ function Sd(n, t, e, s) {
|
|
|
14398
14416
|
let i;
|
|
14399
14417
|
const r = ud(n, t);
|
|
14400
14418
|
r.formatMajor === 2 ? i = e.tables.cff2 = {} : i = e.tables.cff = {};
|
|
14401
|
-
const a = r.formatMajor > 1 ? null :
|
|
14419
|
+
const a = r.formatMajor > 1 ? null : me(n, r.endOffset, z.bytesToString), o = r.formatMajor > 1 ? null : me(n, a.endOffset), c = r.formatMajor > 1 ? null : me(n, o.endOffset, z.bytesToString), h = me(n, r.formatMajor > 1 ? t + r.size + r.topDictLength : c.endOffset, void 0, r.formatMajor);
|
|
14402
14420
|
e.gsubrs = h.objects, e.gsubrsBias = Oi(e.gsubrs);
|
|
14403
14421
|
let l;
|
|
14404
14422
|
if (r.formatMajor > 1) {
|
|
@@ -14414,38 +14432,38 @@ function Sd(n, t, e, s) {
|
|
|
14414
14432
|
let f = l.fdArray, p = l.fdSelect;
|
|
14415
14433
|
if (!f)
|
|
14416
14434
|
throw new Error("This is a CFF2 font, but FDArray information is missing");
|
|
14417
|
-
const d =
|
|
14435
|
+
const d = me(n, t + f, null, r.formatMajor), g = yd(n, t, d.objects);
|
|
14418
14436
|
l._fdArray = g, p && (l._fdSelect = Yo(n, t + p, e.numGlyphs, g.length, r.formatMajor));
|
|
14419
14437
|
} else if (e.isCIDFont) {
|
|
14420
14438
|
let f = l.fdArray, p = l.fdSelect;
|
|
14421
14439
|
if (f === 0 || p === 0)
|
|
14422
14440
|
throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
|
|
14423
14441
|
f += t;
|
|
14424
|
-
const d =
|
|
14442
|
+
const d = me(n, f), g = Sr(n, t, d.objects, c.objects, r.formatMajor);
|
|
14425
14443
|
l._fdArray = g, p += t, l._fdSelect = Yo(n, p, e.numGlyphs, g.length, r.formatMajor);
|
|
14426
14444
|
}
|
|
14427
14445
|
if (r.formatMajor < 2) {
|
|
14428
14446
|
const f = t + l.private[1], p = Ta(n, f, l.private[0], c.objects, r.formatMajor);
|
|
14429
14447
|
if (e.defaultWidthX = p.defaultWidthX, e.nominalWidthX = p.nominalWidthX, p.subrs !== 0) {
|
|
14430
|
-
const d = f + p.subrs, g =
|
|
14448
|
+
const d = f + p.subrs, g = me(n, d);
|
|
14431
14449
|
e.subrs = g.objects, e.subrsBias = Oi(e.subrs);
|
|
14432
14450
|
} else
|
|
14433
14451
|
e.subrs = [], e.subrsBias = 0;
|
|
14434
14452
|
}
|
|
14435
14453
|
let u;
|
|
14436
|
-
if (s.lowMemory ? (u = ad(n, t + l.charStrings, r.formatMajor), e.nGlyphs = u.offsets.length - (r.formatMajor > 1 ? 1 : 0)) : (u =
|
|
14454
|
+
if (s.lowMemory ? (u = ad(n, t + l.charStrings, r.formatMajor), e.nGlyphs = u.offsets.length - (r.formatMajor > 1 ? 1 : 0)) : (u = me(n, t + l.charStrings, null, r.formatMajor), e.nGlyphs = u.objects.length), r.formatMajor > 1 && e.tables.maxp && e.nGlyphs !== e.tables.maxp.numGlyphs && console.error(`Glyph count in the CFF2 table (${e.nGlyphs}) must correspond to the glyph count in the maxp table (${e.tables.maxp.numGlyphs})`), r.formatMajor < 2) {
|
|
14437
14455
|
let f = [], p = [];
|
|
14438
14456
|
l.charset === 0 ? f = Wp : l.charset === 1 ? f = qp : l.charset === 2 ? f = jp : f = xd(n, t + l.charset, e.nGlyphs, c.objects, e.isCIDFont), l.encoding === 0 ? p = ia : l.encoding === 1 ? p = Xp : p = bd(n, t + l.encoding), e.cffEncoding = new il(p, f), e.encoding = e.encoding || e.cffEncoding;
|
|
14439
14457
|
}
|
|
14440
|
-
if (e.glyphs = new
|
|
14458
|
+
if (e.glyphs = new we.GlyphSet(e), s.lowMemory)
|
|
14441
14459
|
e._push = function(f) {
|
|
14442
14460
|
const p = od(f, u.offsets, n, t + l.charStrings, void 0, r.formatMajor);
|
|
14443
|
-
e.glyphs.push(f,
|
|
14461
|
+
e.glyphs.push(f, we.cffGlyphLoader(e, f, ra, p, r.formatMajor));
|
|
14444
14462
|
};
|
|
14445
14463
|
else
|
|
14446
14464
|
for (let f = 0; f < e.nGlyphs; f += 1) {
|
|
14447
14465
|
const p = u.objects[f];
|
|
14448
|
-
e.glyphs.push(f,
|
|
14466
|
+
e.glyphs.push(f, we.cffGlyphLoader(e, f, ra, p, r.formatMajor));
|
|
14449
14467
|
}
|
|
14450
14468
|
if (l.vstore) {
|
|
14451
14469
|
const f = new z.Parser(n, t + l.vstore);
|
|
@@ -17217,18 +17235,18 @@ function Rl(n, t) {
|
|
|
17217
17235
|
return ka(t.points);
|
|
17218
17236
|
}
|
|
17219
17237
|
function q0(n, t, e, s) {
|
|
17220
|
-
const i = new
|
|
17238
|
+
const i = new we.GlyphSet(s);
|
|
17221
17239
|
for (let r = 0; r < e.length - 1; r += 1) {
|
|
17222
17240
|
const a = e[r], o = e[r + 1];
|
|
17223
|
-
a !== o ? i.push(r,
|
|
17241
|
+
a !== o ? i.push(r, we.ttfGlyphLoader(s, r, Bl, n, t + a, Rl)) : i.push(r, we.glyphLoader(s, r));
|
|
17224
17242
|
}
|
|
17225
17243
|
return i;
|
|
17226
17244
|
}
|
|
17227
17245
|
function j0(n, t, e, s) {
|
|
17228
|
-
const i = new
|
|
17246
|
+
const i = new we.GlyphSet(s);
|
|
17229
17247
|
return s._push = function(r) {
|
|
17230
17248
|
const a = e[r], o = e[r + 1];
|
|
17231
|
-
a !== o ? i.push(r,
|
|
17249
|
+
a !== o ? i.push(r, we.ttfGlyphLoader(s, r, Bl, n, t + a, Rl)) : i.push(r, we.glyphLoader(s, r));
|
|
17232
17250
|
}, i;
|
|
17233
17251
|
}
|
|
17234
17252
|
function X0(n, t, e, s, i) {
|
|
@@ -17708,7 +17726,7 @@ var Hl = function(n) {
|
|
|
17708
17726
|
const s = this.srThreshold;
|
|
17709
17727
|
let i = 1;
|
|
17710
17728
|
return n < 0 && (n = -n, i = -1), n += s - e, n = Math.trunc(n / t) * t, n += e, n < 0 ? e * i : n * i;
|
|
17711
|
-
},
|
|
17729
|
+
}, ve = {
|
|
17712
17730
|
x: 1,
|
|
17713
17731
|
y: 0,
|
|
17714
17732
|
axis: "x",
|
|
@@ -17733,10 +17751,10 @@ var Hl = function(n) {
|
|
|
17733
17751
|
return;
|
|
17734
17752
|
}
|
|
17735
17753
|
if (i = s.distance(n, t, !0, !0), r = s.distance(n, e, !0, !0), c = s.distance(t, t, !1, !0), h = s.distance(e, e, !1, !0), a = Math.abs(i), o = Math.abs(r), l = a + o, l === 0) {
|
|
17736
|
-
|
|
17754
|
+
ve.setRelative(n, n, (c + h) / 2, s, !0);
|
|
17737
17755
|
return;
|
|
17738
17756
|
}
|
|
17739
|
-
|
|
17757
|
+
ve.setRelative(n, n, (c * o + h * a) / l, s, !0);
|
|
17740
17758
|
},
|
|
17741
17759
|
// Slope of line normal to this
|
|
17742
17760
|
normalSlope: Number.NEGATIVE_INFINITY,
|
|
@@ -17772,7 +17790,7 @@ var Hl = function(n) {
|
|
|
17772
17790
|
untouch: function(n) {
|
|
17773
17791
|
n.xTouched = !1;
|
|
17774
17792
|
}
|
|
17775
|
-
},
|
|
17793
|
+
}, Be = {
|
|
17776
17794
|
x: 0,
|
|
17777
17795
|
y: 1,
|
|
17778
17796
|
axis: "y",
|
|
@@ -17797,10 +17815,10 @@ var Hl = function(n) {
|
|
|
17797
17815
|
return;
|
|
17798
17816
|
}
|
|
17799
17817
|
if (i = s.distance(n, t, !0, !0), r = s.distance(n, e, !0, !0), c = s.distance(t, t, !1, !0), h = s.distance(e, e, !1, !0), a = Math.abs(i), o = Math.abs(r), l = a + o, l === 0) {
|
|
17800
|
-
|
|
17818
|
+
Be.setRelative(n, n, (c + h) / 2, s, !0);
|
|
17801
17819
|
return;
|
|
17802
17820
|
}
|
|
17803
|
-
|
|
17821
|
+
Be.setRelative(n, n, (c * o + h * a) / l, s, !0);
|
|
17804
17822
|
},
|
|
17805
17823
|
// Slope of line normal to this.
|
|
17806
17824
|
normalSlope: 0,
|
|
@@ -17837,13 +17855,13 @@ var Hl = function(n) {
|
|
|
17837
17855
|
n.yTouched = !1;
|
|
17838
17856
|
}
|
|
17839
17857
|
};
|
|
17840
|
-
Object.freeze(
|
|
17841
|
-
Object.freeze(
|
|
17858
|
+
Object.freeze(ve);
|
|
17859
|
+
Object.freeze(Be);
|
|
17842
17860
|
function As(n, t) {
|
|
17843
17861
|
this.x = n, this.y = t, this.axis = void 0, this.slope = t / n, this.normalSlope = -n / t, Object.freeze(this);
|
|
17844
17862
|
}
|
|
17845
17863
|
As.prototype.distance = function(n, t, e, s) {
|
|
17846
|
-
return this.x *
|
|
17864
|
+
return this.x * ve.distance(n, t, e, s) + this.y * Be.distance(n, t, e, s);
|
|
17847
17865
|
};
|
|
17848
17866
|
As.prototype.interpolate = function(n, t, e, s) {
|
|
17849
17867
|
let i, r, a, o, c, h, l;
|
|
@@ -17863,22 +17881,22 @@ As.prototype.touch = function(n) {
|
|
|
17863
17881
|
};
|
|
17864
17882
|
function ks(n, t) {
|
|
17865
17883
|
const e = Math.sqrt(n * n + t * t);
|
|
17866
|
-
return n /= e, t /= e, n === 1 && t === 0 ?
|
|
17884
|
+
return n /= e, t /= e, n === 1 && t === 0 ? ve : n === 0 && t === 1 ? Be : new As(n, t);
|
|
17867
17885
|
}
|
|
17868
|
-
function
|
|
17886
|
+
function De(n, t, e, s) {
|
|
17869
17887
|
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
17888
|
}
|
|
17871
|
-
|
|
17889
|
+
De.prototype.nextTouched = function(n) {
|
|
17872
17890
|
let t = this.nextPointOnContour;
|
|
17873
17891
|
for (; !n.touched(t) && t !== this; ) t = t.nextPointOnContour;
|
|
17874
17892
|
return t;
|
|
17875
17893
|
};
|
|
17876
|
-
|
|
17894
|
+
De.prototype.prevTouched = function(n) {
|
|
17877
17895
|
let t = this.prevPointOnContour;
|
|
17878
17896
|
for (; !n.touched(t) && t !== this; ) t = t.prevPointOnContour;
|
|
17879
17897
|
return t;
|
|
17880
17898
|
};
|
|
17881
|
-
var bs = Object.freeze(new
|
|
17899
|
+
var bs = Object.freeze(new De(0, 0)), e1 = {
|
|
17882
17900
|
cvCutIn: 17 / 16,
|
|
17883
17901
|
// control value cut in
|
|
17884
17902
|
deltaBase: 9,
|
|
@@ -17894,7 +17912,7 @@ function $e(n, t) {
|
|
|
17894
17912
|
case "glyf":
|
|
17895
17913
|
this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
|
|
17896
17914
|
case "prep":
|
|
17897
|
-
this.fv = this.pv = this.dpv =
|
|
17915
|
+
this.fv = this.pv = this.dpv = ve, this.round = zl;
|
|
17898
17916
|
}
|
|
17899
17917
|
}
|
|
17900
17918
|
Nl.prototype.exec = function(n, t) {
|
|
@@ -17958,8 +17976,8 @@ Pl = function(n, t) {
|
|
|
17958
17976
|
r.push(g[b] + x);
|
|
17959
17977
|
}
|
|
17960
17978
|
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
|
|
17979
|
+
new De(0, 0),
|
|
17980
|
+
new De(Math.round(n.advanceWidth * e), 0)
|
|
17963
17981
|
), dn(o), a.length -= 2);
|
|
17964
17982
|
}
|
|
17965
17983
|
return a;
|
|
@@ -17968,7 +17986,7 @@ ha = function(n, t, e, s) {
|
|
|
17968
17986
|
const i = n.points || [], r = i.length, a = t.gZone = t.z0 = t.z1 = t.z2 = [], o = t.contours = [];
|
|
17969
17987
|
let c;
|
|
17970
17988
|
for (let u = 0; u < r; u++)
|
|
17971
|
-
c = i[u], a[u] = new
|
|
17989
|
+
c = i[u], a[u] = new De(
|
|
17972
17990
|
c.x * e,
|
|
17973
17991
|
c.y * s,
|
|
17974
17992
|
c.lastPointOfContour,
|
|
@@ -17978,8 +17996,8 @@ ha = function(n, t, e, s) {
|
|
|
17978
17996
|
for (let u = 0; u < r; u++)
|
|
17979
17997
|
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
17998
|
t.inhibitGridFit || (a.push(
|
|
17981
|
-
new
|
|
17982
|
-
new
|
|
17999
|
+
new De(0, 0),
|
|
18000
|
+
new De(Math.round(n.advanceWidth * e), 0)
|
|
17983
18001
|
), dn(t), a.length -= 2);
|
|
17984
18002
|
};
|
|
17985
18003
|
dn = function(n) {
|
|
@@ -18002,7 +18020,7 @@ dn = function(n) {
|
|
|
18002
18020
|
function zi(n) {
|
|
18003
18021
|
const t = n.tZone = new Array(n.gZone.length);
|
|
18004
18022
|
for (let e = 0; e < t.length; e++)
|
|
18005
|
-
t[e] = new
|
|
18023
|
+
t[e] = new De(0, 0);
|
|
18006
18024
|
}
|
|
18007
18025
|
function Gl(n, t) {
|
|
18008
18026
|
const e = n.prog;
|
|
@@ -18583,13 +18601,13 @@ function Tg(n) {
|
|
|
18583
18601
|
throw new Error("invalid INSTCTRL[] selector");
|
|
18584
18602
|
}
|
|
18585
18603
|
}
|
|
18586
|
-
function
|
|
18604
|
+
function Ge(n, t) {
|
|
18587
18605
|
const e = t.stack, s = t.prog;
|
|
18588
18606
|
let i = t.ip;
|
|
18589
18607
|
for (let r = 0; r < n; r++) e.push(s[++i]);
|
|
18590
18608
|
t.ip = i;
|
|
18591
18609
|
}
|
|
18592
|
-
function
|
|
18610
|
+
function Ve(n, t) {
|
|
18593
18611
|
let e = t.ip;
|
|
18594
18612
|
const s = t.prog, i = t.stack;
|
|
18595
18613
|
for (let r = 0; r < n; r++) {
|
|
@@ -18605,17 +18623,17 @@ function G(n, t, e, s, i, r) {
|
|
|
18605
18623
|
}
|
|
18606
18624
|
Ul = [
|
|
18607
18625
|
/* 0x00 */
|
|
18608
|
-
rc.bind(void 0,
|
|
18626
|
+
rc.bind(void 0, Be),
|
|
18609
18627
|
/* 0x01 */
|
|
18610
|
-
rc.bind(void 0,
|
|
18628
|
+
rc.bind(void 0, ve),
|
|
18611
18629
|
/* 0x02 */
|
|
18612
|
-
ac.bind(void 0,
|
|
18630
|
+
ac.bind(void 0, Be),
|
|
18613
18631
|
/* 0x03 */
|
|
18614
|
-
ac.bind(void 0,
|
|
18632
|
+
ac.bind(void 0, ve),
|
|
18615
18633
|
/* 0x04 */
|
|
18616
|
-
oc.bind(void 0,
|
|
18634
|
+
oc.bind(void 0, Be),
|
|
18617
18635
|
/* 0x05 */
|
|
18618
|
-
oc.bind(void 0,
|
|
18636
|
+
oc.bind(void 0, ve),
|
|
18619
18637
|
/* 0x06 */
|
|
18620
18638
|
cc.bind(void 0, 0),
|
|
18621
18639
|
/* 0x07 */
|
|
@@ -18706,9 +18724,9 @@ Ul = [
|
|
|
18706
18724
|
/* 0x2F */
|
|
18707
18725
|
lc.bind(void 0, 1),
|
|
18708
18726
|
/* 0x30 */
|
|
18709
|
-
uc.bind(void 0,
|
|
18727
|
+
uc.bind(void 0, Be),
|
|
18710
18728
|
/* 0x31 */
|
|
18711
|
-
uc.bind(void 0,
|
|
18729
|
+
uc.bind(void 0, ve),
|
|
18712
18730
|
/* 0x32 */
|
|
18713
18731
|
fc.bind(void 0, 0),
|
|
18714
18732
|
/* 0x33 */
|
|
@@ -18978,37 +18996,37 @@ Ul = [
|
|
|
18978
18996
|
/* 0xAF */
|
|
18979
18997
|
void 0,
|
|
18980
18998
|
/* 0xB0 */
|
|
18981
|
-
|
|
18999
|
+
Ge.bind(void 0, 1),
|
|
18982
19000
|
/* 0xB1 */
|
|
18983
|
-
|
|
19001
|
+
Ge.bind(void 0, 2),
|
|
18984
19002
|
/* 0xB2 */
|
|
18985
|
-
|
|
19003
|
+
Ge.bind(void 0, 3),
|
|
18986
19004
|
/* 0xB3 */
|
|
18987
|
-
|
|
19005
|
+
Ge.bind(void 0, 4),
|
|
18988
19006
|
/* 0xB4 */
|
|
18989
|
-
|
|
19007
|
+
Ge.bind(void 0, 5),
|
|
18990
19008
|
/* 0xB5 */
|
|
18991
|
-
|
|
19009
|
+
Ge.bind(void 0, 6),
|
|
18992
19010
|
/* 0xB6 */
|
|
18993
|
-
|
|
19011
|
+
Ge.bind(void 0, 7),
|
|
18994
19012
|
/* 0xB7 */
|
|
18995
|
-
|
|
19013
|
+
Ge.bind(void 0, 8),
|
|
18996
19014
|
/* 0xB8 */
|
|
18997
|
-
|
|
19015
|
+
Ve.bind(void 0, 1),
|
|
18998
19016
|
/* 0xB9 */
|
|
18999
|
-
|
|
19017
|
+
Ve.bind(void 0, 2),
|
|
19000
19018
|
/* 0xBA */
|
|
19001
|
-
|
|
19019
|
+
Ve.bind(void 0, 3),
|
|
19002
19020
|
/* 0xBB */
|
|
19003
|
-
|
|
19021
|
+
Ve.bind(void 0, 4),
|
|
19004
19022
|
/* 0xBC */
|
|
19005
|
-
|
|
19023
|
+
Ve.bind(void 0, 5),
|
|
19006
19024
|
/* 0xBD */
|
|
19007
|
-
|
|
19025
|
+
Ve.bind(void 0, 6),
|
|
19008
19026
|
/* 0xBE */
|
|
19009
|
-
|
|
19027
|
+
Ve.bind(void 0, 7),
|
|
19010
19028
|
/* 0xBF */
|
|
19011
|
-
|
|
19029
|
+
Ve.bind(void 0, 8),
|
|
19012
19030
|
/* 0xC0 */
|
|
19013
19031
|
G.bind(void 0, 0, 0, 0, 0, 0),
|
|
19014
19032
|
/* 0xC1 */
|
|
@@ -20314,7 +20332,7 @@ function it(n) {
|
|
|
20314
20332
|
}, n.tables.os2)
|
|
20315
20333
|
});
|
|
20316
20334
|
}
|
|
20317
|
-
this.supported = !0, this.glyphs = new
|
|
20335
|
+
this.supported = !0, this.glyphs = new we.GlyphSet(this, n.glyphs || []), this.encoding = new nl(this), this.position = new k0(this), this.substitution = new B0(this), this.tables = this.tables || {}, this.tables = new Proxy(this.tables, {
|
|
20318
20336
|
set: (t, e, s) => (t[e] = s, t.fvar && (t.gvar || t.cff2) && !this.variation && (this.variation = new $0(this)), !0)
|
|
20319
20337
|
}), this.palettes = new Il(this), this.layers = new R0(this), this.svgImages = new D0(this), this._push = null, this._hmtxTableData = {}, Object.defineProperty(this, "hinting", {
|
|
20320
20338
|
get: function() {
|
|
@@ -21712,9 +21730,9 @@ var Wl = { exports: {} }, Ma = {}, Gi = {};
|
|
|
21712
21730
|
Gi.byteLength = ky;
|
|
21713
21731
|
Gi.toByteArray = My;
|
|
21714
21732
|
Gi.fromByteArray = Ly;
|
|
21715
|
-
var
|
|
21733
|
+
var xe = [], Jt = [], Fy = typeof Uint8Array < "u" ? Uint8Array : Array, Or = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
21716
21734
|
for (var In = 0, Ay = Or.length; In < Ay; ++In)
|
|
21717
|
-
|
|
21735
|
+
xe[In] = Or[In], Jt[Or.charCodeAt(In)] = In;
|
|
21718
21736
|
Jt[45] = 62;
|
|
21719
21737
|
Jt[95] = 63;
|
|
21720
21738
|
function ql(n) {
|
|
@@ -21740,7 +21758,7 @@ function My(n) {
|
|
|
21740
21758
|
return i === 2 && (t = Jt[n.charCodeAt(c)] << 2 | Jt[n.charCodeAt(c + 1)] >> 4, r[a++] = t & 255), i === 1 && (t = Jt[n.charCodeAt(c)] << 10 | Jt[n.charCodeAt(c + 1)] << 4 | Jt[n.charCodeAt(c + 2)] >> 2, r[a++] = t >> 8 & 255, r[a++] = t & 255), r;
|
|
21741
21759
|
}
|
|
21742
21760
|
function Oy(n) {
|
|
21743
|
-
return
|
|
21761
|
+
return xe[n >> 18 & 63] + xe[n >> 12 & 63] + xe[n >> 6 & 63] + xe[n & 63];
|
|
21744
21762
|
}
|
|
21745
21763
|
function _y(n, t, e) {
|
|
21746
21764
|
for (var s, i = [], r = t; r < e; r += 3)
|
|
@@ -21751,9 +21769,9 @@ function Ly(n) {
|
|
|
21751
21769
|
for (var t, e = n.length, s = e % 3, i = [], r = 16383, a = 0, o = e - s; a < o; a += r)
|
|
21752
21770
|
i.push(_y(n, a, a + r > o ? o : a + r));
|
|
21753
21771
|
return s === 1 ? (t = n[e - 1], i.push(
|
|
21754
|
-
|
|
21772
|
+
xe[t >> 2] + xe[t << 4 & 63] + "=="
|
|
21755
21773
|
)) : s === 2 && (t = (n[e - 2] << 8) + n[e - 1], i.push(
|
|
21756
|
-
|
|
21774
|
+
xe[t >> 10] + xe[t >> 4 & 63] + xe[t << 2 & 63] + "="
|
|
21757
21775
|
)), i.join("");
|
|
21758
21776
|
}
|
|
21759
21777
|
var Oa = {};
|
|
@@ -22283,7 +22301,7 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22283
22301
|
var T = C.length;
|
|
22284
22302
|
(!m || m < 0) && (m = 0), (!y || y < 0 || y > T) && (y = T);
|
|
22285
22303
|
for (var k = "", _ = m; _ < y; ++_)
|
|
22286
|
-
k +=
|
|
22304
|
+
k += Te[C[_]];
|
|
22287
22305
|
return k;
|
|
22288
22306
|
}
|
|
22289
22307
|
function ut(C, m, y) {
|
|
@@ -22559,7 +22577,7 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22559
22577
|
function Mt(C) {
|
|
22560
22578
|
return C !== C;
|
|
22561
22579
|
}
|
|
22562
|
-
var
|
|
22580
|
+
var Te = function() {
|
|
22563
22581
|
for (var C = "0123456789abcdef", m = new Array(256), y = 0; y < 16; ++y)
|
|
22564
22582
|
for (var T = y * 16, k = 0; k < 16; ++k)
|
|
22565
22583
|
m[T + k] = C[y] + C[k];
|
|
@@ -22902,16 +22920,16 @@ function Uy() {
|
|
|
22902
22920
|
}
|
|
22903
22921
|
}, Ir;
|
|
22904
22922
|
}
|
|
22905
|
-
var
|
|
22923
|
+
var _e = {}, Rc;
|
|
22906
22924
|
function Py() {
|
|
22907
|
-
if (Rc) return
|
|
22925
|
+
if (Rc) return _e;
|
|
22908
22926
|
Rc = 1;
|
|
22909
22927
|
var n = en.Buffer;
|
|
22910
|
-
|
|
22928
|
+
_e._utf32 = t;
|
|
22911
22929
|
function t(h, l) {
|
|
22912
22930
|
this.iconv = l, this.bomAware = !0, this.isLE = h.isLE;
|
|
22913
22931
|
}
|
|
22914
|
-
|
|
22932
|
+
_e.utf32le = { type: "_utf32", isLE: !0 }, _e.utf32be = { type: "_utf32", isLE: !1 }, _e.ucs4le = "utf32le", _e.ucs4be = "utf32be", t.prototype.encoder = e, t.prototype.decoder = s;
|
|
22915
22933
|
function e(h, l) {
|
|
22916
22934
|
this.isLE = l.isLE, this.highSurrogate = 0;
|
|
22917
22935
|
}
|
|
@@ -22964,7 +22982,7 @@ function Py() {
|
|
|
22964
22982
|
}
|
|
22965
22983
|
s.prototype.end = function() {
|
|
22966
22984
|
this.overflow.length = 0;
|
|
22967
|
-
},
|
|
22985
|
+
}, _e.utf32 = r, _e.ucs4 = "utf32";
|
|
22968
22986
|
function r(h, l) {
|
|
22969
22987
|
this.iconv = l;
|
|
22970
22988
|
}
|
|
@@ -23019,7 +23037,7 @@ function Py() {
|
|
|
23019
23037
|
}
|
|
23020
23038
|
return x - d > g - p ? "utf-32be" : x - d < g - p ? "utf-32le" : l || "utf-32le";
|
|
23021
23039
|
}
|
|
23022
|
-
return
|
|
23040
|
+
return _e;
|
|
23023
23041
|
}
|
|
23024
23042
|
var ri = {}, Dc;
|
|
23025
23043
|
function Ny() {
|
|
@@ -33034,7 +33052,7 @@ const Xe = class Xe extends Ah {
|
|
|
33034
33052
|
};
|
|
33035
33053
|
Xe.NOT_ENCODABLE = -1;
|
|
33036
33054
|
let ua = Xe;
|
|
33037
|
-
class
|
|
33055
|
+
class be {
|
|
33038
33056
|
constructor() {
|
|
33039
33057
|
}
|
|
33040
33058
|
/**
|
|
@@ -33042,7 +33060,7 @@ class xe {
|
|
|
33042
33060
|
* @returns The FontFactory instance
|
|
33043
33061
|
*/
|
|
33044
33062
|
static get instance() {
|
|
33045
|
-
return
|
|
33063
|
+
return be._instance || (be._instance = new be()), be._instance;
|
|
33046
33064
|
}
|
|
33047
33065
|
/**
|
|
33048
33066
|
* Creates a font instance based on the provided font data.
|
|
@@ -33148,10 +33166,10 @@ class he {
|
|
|
33148
33166
|
return t.map((i) => ({ ...i, source: "remote" }));
|
|
33149
33167
|
const e = /* @__PURE__ */ new Map();
|
|
33150
33168
|
for (const i of t) {
|
|
33151
|
-
const r =
|
|
33169
|
+
const r = qe(i.file).toLowerCase();
|
|
33152
33170
|
e.set(r, { ...i, source: "remote" });
|
|
33153
33171
|
}
|
|
33154
|
-
const s = await
|
|
33172
|
+
const s = await ge.instance.getAll();
|
|
33155
33173
|
for (const i of s) {
|
|
33156
33174
|
const r = i.name.toLowerCase();
|
|
33157
33175
|
e.has(r) || e.set(r, this.cachedFontDataToFontInfo(i));
|
|
@@ -33254,7 +33272,7 @@ class he {
|
|
|
33254
33272
|
let r, a;
|
|
33255
33273
|
if (typeof File < "u" && t instanceof File ? (r = await t.arrayBuffer(), a = e ?? t.name) : (r = t, a = e ?? ""), !a)
|
|
33256
33274
|
throw new Error("fileName is required when caching an ArrayBuffer");
|
|
33257
|
-
const o =
|
|
33275
|
+
const o = qe(a).toLowerCase();
|
|
33258
33276
|
if (!o)
|
|
33259
33277
|
return {
|
|
33260
33278
|
fontName: "",
|
|
@@ -33286,8 +33304,8 @@ class he {
|
|
|
33286
33304
|
data: r
|
|
33287
33305
|
};
|
|
33288
33306
|
try {
|
|
33289
|
-
const u =
|
|
33290
|
-
return h.forEach((f) => u.names.add(f)), this.registerFontInMap(o, u), this.enableFontCache && await
|
|
33307
|
+
const u = be.instance.createFont(l);
|
|
33308
|
+
return h.forEach((f) => u.names.add(f)), this.registerFontInMap(o, u), this.enableFontCache && await ge.instance.set(o, l), this.events.fontLoaded.dispatch({ fontName: o }), {
|
|
33291
33309
|
fontName: o,
|
|
33292
33310
|
url: "",
|
|
33293
33311
|
status: "Success"
|
|
@@ -33311,14 +33329,14 @@ class he {
|
|
|
33311
33329
|
var i;
|
|
33312
33330
|
if (!this.enableFontCache || !t)
|
|
33313
33331
|
return !1;
|
|
33314
|
-
const e =
|
|
33332
|
+
const e = qe(t).toLowerCase();
|
|
33315
33333
|
if (this.isFontLoaded(e))
|
|
33316
33334
|
return !0;
|
|
33317
|
-
const s = await
|
|
33335
|
+
const s = await ge.instance.find(t);
|
|
33318
33336
|
if (!s)
|
|
33319
33337
|
return !1;
|
|
33320
33338
|
try {
|
|
33321
|
-
const r =
|
|
33339
|
+
const r = be.instance.createFont(s);
|
|
33322
33340
|
return (i = s.alias) == null || i.forEach((a) => r.names.add(a)), this.registerFontInMap(s.name, r), this.events.fontLoaded.dispatch({ fontName: s.name }), !0;
|
|
33323
33341
|
} catch {
|
|
33324
33342
|
return !1;
|
|
@@ -33337,7 +33355,7 @@ class he {
|
|
|
33337
33355
|
const s = [];
|
|
33338
33356
|
return await Promise.allSettled(e).then((i) => {
|
|
33339
33357
|
i.forEach((r, a) => {
|
|
33340
|
-
const o = t[a].url, c =
|
|
33358
|
+
const o = t[a].url, c = qe(
|
|
33341
33359
|
t[a].file || o
|
|
33342
33360
|
).toLowerCase(), h = r.status === "fulfilled" && this.isFontLoaded(c);
|
|
33343
33361
|
s.push({
|
|
@@ -33591,6 +33609,51 @@ class he {
|
|
|
33591
33609
|
count: this.missedFonts[t]
|
|
33592
33610
|
}), e && this.lazyFontLoading && this.requestFont(t)));
|
|
33593
33611
|
}
|
|
33612
|
+
/**
|
|
33613
|
+
* Adds catalog / `fonts.json` names onto a font instance.
|
|
33614
|
+
*/
|
|
33615
|
+
applyCatalogNames(t, e) {
|
|
33616
|
+
e.forEach((s) => {
|
|
33617
|
+
s && t.names.add(s);
|
|
33618
|
+
});
|
|
33619
|
+
}
|
|
33620
|
+
/**
|
|
33621
|
+
* Ensures an already-loaded primary face is also addressable under the
|
|
33622
|
+
* current catalog names. Needed when IndexedDB still has an older alias
|
|
33623
|
+
* list (e.g. `noto-sans-kr` cached before `malgun` was added) or when the
|
|
33624
|
+
* binary was loaded under the file basename first.
|
|
33625
|
+
*/
|
|
33626
|
+
ensureCatalogAliases(t, e) {
|
|
33627
|
+
const s = this.loadedFontMap.get(t.toLowerCase()) ?? e.map((i) => this.loadedFontMap.get(i.toLowerCase())).find((i) => i != null);
|
|
33628
|
+
s && (this.applyCatalogNames(s, e), this.registerFontInMap(t, s));
|
|
33629
|
+
}
|
|
33630
|
+
/**
|
|
33631
|
+
* Merges catalog / primary names into an existing IndexedDB alias list so
|
|
33632
|
+
* cold starts after `getAllFontsFromCache` pick up newly added style names.
|
|
33633
|
+
*/
|
|
33634
|
+
async persistCatalogAliases(t, e) {
|
|
33635
|
+
if (!this.enableFontCache)
|
|
33636
|
+
return;
|
|
33637
|
+
const s = await ge.instance.get(t);
|
|
33638
|
+
if (!s)
|
|
33639
|
+
return;
|
|
33640
|
+
const i = [
|
|
33641
|
+
.../* @__PURE__ */ new Set([...s.alias ?? [], ...e, t])
|
|
33642
|
+
], r = s.alias ?? [];
|
|
33643
|
+
i.length === r.length && i.every((a) => r.includes(a)) || await ge.instance.set(t, {
|
|
33644
|
+
...s,
|
|
33645
|
+
alias: i
|
|
33646
|
+
});
|
|
33647
|
+
}
|
|
33648
|
+
/**
|
|
33649
|
+
* Clears miss / failed-request bookkeeping for a primary name and aliases
|
|
33650
|
+
* so a later alias request is not permanently blocked after the binary
|
|
33651
|
+
* loaded under a different key.
|
|
33652
|
+
*/
|
|
33653
|
+
clearRequestStateForNames(t) {
|
|
33654
|
+
for (const e of t)
|
|
33655
|
+
e && (this.clearMissedFontEntry(e), this.fontRequestFailed.delete(e.toLowerCase()));
|
|
33656
|
+
}
|
|
33594
33657
|
/**
|
|
33595
33658
|
* Loads a single font
|
|
33596
33659
|
* @param fontInfo - The matadata of the font to be loaded
|
|
@@ -33598,30 +33661,40 @@ class he {
|
|
|
33598
33661
|
async loadFont(t) {
|
|
33599
33662
|
if (!Eh(t.file))
|
|
33600
33663
|
throw new Error(`Invalid font file name: ${t.file}`);
|
|
33601
|
-
const s = this.fontInfoToFontData(t), i = s.name;
|
|
33602
|
-
if (this.isFontLoaded(s.name))
|
|
33664
|
+
const s = this.fontInfoToFontData(t), i = s.name, r = t.name ?? [];
|
|
33665
|
+
if (this.isFontLoaded(s.name)) {
|
|
33666
|
+
this.ensureCatalogAliases(i, r), this.clearRequestStateForNames([i, ...r]), await this.persistCatalogAliases(i, r);
|
|
33603
33667
|
return;
|
|
33604
|
-
|
|
33605
|
-
|
|
33606
|
-
|
|
33607
|
-
|
|
33668
|
+
}
|
|
33669
|
+
const a = this.loadEpoch, o = await ge.instance.get(i);
|
|
33670
|
+
if (a === this.loadEpoch) {
|
|
33671
|
+
if (o) {
|
|
33672
|
+
if (await new Promise((h) => setTimeout(h, 0)), a !== this.loadEpoch)
|
|
33673
|
+
return;
|
|
33674
|
+
if (this.isFontLoaded(i)) {
|
|
33675
|
+
this.ensureCatalogAliases(i, r), this.clearRequestStateForNames([i, ...r]), await this.persistCatalogAliases(i, r);
|
|
33608
33676
|
return;
|
|
33609
|
-
|
|
33610
|
-
|
|
33677
|
+
}
|
|
33678
|
+
const c = be.instance.createFont(o);
|
|
33679
|
+
c && (this.applyCatalogNames(c, r), this.registerFontInMap(i, c), await this.persistCatalogAliases(i, r));
|
|
33611
33680
|
} else {
|
|
33612
|
-
const
|
|
33613
|
-
if (
|
|
33681
|
+
const c = await this.loader.loadAsync(t.url);
|
|
33682
|
+
if (a !== this.loadEpoch || (s.data = c, await new Promise((l) => setTimeout(l, 0)), a !== this.loadEpoch))
|
|
33683
|
+
return;
|
|
33684
|
+
if (this.isFontLoaded(i)) {
|
|
33685
|
+
this.ensureCatalogAliases(i, r), this.clearRequestStateForNames([i, ...r]), await this.persistCatalogAliases(i, r);
|
|
33614
33686
|
return;
|
|
33615
|
-
|
|
33616
|
-
|
|
33687
|
+
}
|
|
33688
|
+
const h = be.instance.createFont(s);
|
|
33689
|
+
h && (this.applyCatalogNames(h, r), this.registerFontInMap(i, h), this.enableFontCache && await ge.instance.set(i, s));
|
|
33617
33690
|
}
|
|
33618
|
-
|
|
33691
|
+
a !== this.loadEpoch || !this.isFontLoaded(i) || (this.clearRequestStateForNames([i, ...r]), this.events.fontLoaded.dispatch({
|
|
33619
33692
|
fontName: i
|
|
33620
33693
|
}));
|
|
33621
33694
|
}
|
|
33622
33695
|
}
|
|
33623
33696
|
fontInfoToFontData(t) {
|
|
33624
|
-
const e =
|
|
33697
|
+
const e = qe(t.file).toLowerCase(), s = ["ttf", "otf", "woff"].includes(t.type) ? "mesh" : t.type;
|
|
33625
33698
|
return {
|
|
33626
33699
|
name: e,
|
|
33627
33700
|
alias: t.name,
|
|
@@ -33635,12 +33708,12 @@ class he {
|
|
|
33635
33708
|
async getAllFontsFromCache() {
|
|
33636
33709
|
if (this.loadedFontMap.size !== 0)
|
|
33637
33710
|
return;
|
|
33638
|
-
const t = await
|
|
33711
|
+
const t = await ge.instance.getAll();
|
|
33639
33712
|
for (const e of t) {
|
|
33640
33713
|
const { name: s } = e;
|
|
33641
33714
|
if (this.fileNames && !this.fileNames.includes(s))
|
|
33642
33715
|
continue;
|
|
33643
|
-
const i =
|
|
33716
|
+
const i = be.instance.createFont(e);
|
|
33644
33717
|
this.registerFontInMap(s, i);
|
|
33645
33718
|
}
|
|
33646
33719
|
}
|
|
@@ -33664,7 +33737,7 @@ class he {
|
|
|
33664
33737
|
}
|
|
33665
33738
|
buildUploadedFontAliases(t, e, s) {
|
|
33666
33739
|
const i = /* @__PURE__ */ new Set();
|
|
33667
|
-
return i.add(t), i.add(
|
|
33740
|
+
return i.add(t), i.add(qe(e)), s == null || s.forEach((r) => {
|
|
33668
33741
|
r && i.add(r);
|
|
33669
33742
|
}), [...i];
|
|
33670
33743
|
}
|
|
@@ -33826,7 +33899,7 @@ class rx {
|
|
|
33826
33899
|
});
|
|
33827
33900
|
continue;
|
|
33828
33901
|
}
|
|
33829
|
-
const f =
|
|
33902
|
+
const f = qe(
|
|
33830
33903
|
u.file
|
|
33831
33904
|
).toLowerCase(), p = a[f];
|
|
33832
33905
|
if (p) {
|
|
@@ -33953,7 +34026,7 @@ const di = "", hx = () => ({
|
|
|
33953
34026
|
byLayerColor: 16777215,
|
|
33954
34027
|
byBlockColor: 16777215,
|
|
33955
34028
|
layer: "0",
|
|
33956
|
-
color: new
|
|
34029
|
+
color: new Se()
|
|
33957
34030
|
});
|
|
33958
34031
|
function lx(n) {
|
|
33959
34032
|
if (!(!n || [
|
|
@@ -35593,7 +35666,7 @@ function Tx(n) {
|
|
|
35593
35666
|
return String.fromCharCode(s);
|
|
35594
35667
|
});
|
|
35595
35668
|
}
|
|
35596
|
-
const as = /* @__PURE__ */ new E(),
|
|
35669
|
+
const as = /* @__PURE__ */ new E(), Le = /* @__PURE__ */ new E(), Ie = /* @__PURE__ */ new E(), ih = /* @__PURE__ */ new E(1, 0, 0);
|
|
35597
35670
|
class Da extends Xt {
|
|
35598
35671
|
/**
|
|
35599
35672
|
* Extracts all unique font names used in an MText string.
|
|
@@ -36080,9 +36153,9 @@ class Da extends Xt {
|
|
|
36080
36153
|
t.updateWorldMatrix(!1, !1);
|
|
36081
36154
|
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;
|
|
36082
36155
|
if (r && r.length > 0 && r.forEach((f) => {
|
|
36083
|
-
as.set(0, f.y, 0).applyMatrix4(t.matrixWorld),
|
|
36156
|
+
as.set(0, f.y, 0).applyMatrix4(t.matrixWorld), Le.set(0, f.y - f.height / 2, 0).applyMatrix4(t.matrixWorld), Ie.set(0, f.y + f.height / 2, 0).applyMatrix4(t.matrixWorld), s.push({
|
|
36084
36157
|
y: as.y,
|
|
36085
|
-
height: Math.abs(
|
|
36158
|
+
height: Math.abs(Ie.y - Le.y),
|
|
36086
36159
|
breakIndex: f.breakIndex
|
|
36087
36160
|
});
|
|
36088
36161
|
}), i && i.length > 0) {
|
|
@@ -36147,7 +36220,7 @@ class Da extends Xt {
|
|
|
36147
36220
|
}
|
|
36148
36221
|
const i = (c = t.userData) == null ? void 0 : c.lineLayouts;
|
|
36149
36222
|
i && i.length > 0 && i.forEach((p) => {
|
|
36150
|
-
|
|
36223
|
+
Le.set(0, p.y - p.height / 2, 0).applyMatrix4(t.matrixWorld), Ie.set(0, p.y + p.height / 2, 0).applyMatrix4(t.matrixWorld), e.hasLine = !0, e.minX = Math.min(e.minX, Le.x, Ie.x), e.maxX = Math.max(e.maxX, Le.x, Ie.x), e.minY = Math.min(e.minY, Le.y, Ie.y), e.maxY = Math.max(e.maxY, Le.y, Ie.y), e.minZ = Math.min(e.minZ, Le.z, Ie.z), e.maxZ = Math.max(e.maxZ, Le.z, Ie.z);
|
|
36151
36224
|
});
|
|
36152
36225
|
const r = (l = (h = t.userData) == null ? void 0 : h.layout) == null ? void 0 : l.chars;
|
|
36153
36226
|
if (r && r.length > 0) {
|
|
@@ -36369,11 +36442,11 @@ function Fx(n) {
|
|
|
36369
36442
|
byLayerColor: 16777215,
|
|
36370
36443
|
byBlockColor: 16777215,
|
|
36371
36444
|
layer: "0",
|
|
36372
|
-
color: new
|
|
36445
|
+
color: new Se()
|
|
36373
36446
|
}, e = n ?? t, s = e.color;
|
|
36374
|
-
if (s instanceof
|
|
36447
|
+
if (s instanceof Se)
|
|
36375
36448
|
return e;
|
|
36376
|
-
const i = new
|
|
36449
|
+
const i = new Se();
|
|
36377
36450
|
if (s && typeof s == "object") {
|
|
36378
36451
|
const r = s;
|
|
36379
36452
|
typeof r._aci == "number" && (i.aci = r._aci), typeof r._rgbValue == "number" && (i.rgbValue = r._rgbValue);
|
|
@@ -36473,10 +36546,10 @@ function kx(n) {
|
|
|
36473
36546
|
transparent: l.transparent,
|
|
36474
36547
|
opacity: l.opacity
|
|
36475
36548
|
}, b = (i = s.userData) == null ? void 0 : i.mtextColor;
|
|
36476
|
-
if (b instanceof
|
|
36549
|
+
if (b instanceof Se)
|
|
36477
36550
|
x.mtextColor = Yc(b);
|
|
36478
36551
|
else if (b && typeof b == "object") {
|
|
36479
|
-
const v = b, w = new
|
|
36552
|
+
const v = b, w = new Se();
|
|
36480
36553
|
typeof v.aci == "number" ? w.aci = v.aci : typeof v._aci == "number" && (w.aci = v._aci), typeof v.rgbValue == "number" ? w.rgbValue = v.rgbValue : typeof v._rgbValue == "number" && (w.rgbValue = v._rgbValue), x.mtextColor = Yc(w);
|
|
36481
36554
|
}
|
|
36482
36555
|
"side" in l && typeof l.side == "number" && (x.side = l.side), "linewidth" in l && typeof l.linewidth == "number" && (x.linewidth = l.linewidth);
|