@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
|
@@ -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;
|
|
@@ -9009,7 +9009,7 @@ function hp(n) {
|
|
|
9009
9009
|
var t = n.tag & 1;
|
|
9010
9010
|
return n.tag >>>= 1, t;
|
|
9011
9011
|
}
|
|
9012
|
-
function
|
|
9012
|
+
function ye(n, t, e) {
|
|
9013
9013
|
if (!t)
|
|
9014
9014
|
return e;
|
|
9015
9015
|
for (; n.bitcount < 24; )
|
|
@@ -9028,9 +9028,9 @@ function ta(n, t) {
|
|
|
9028
9028
|
}
|
|
9029
9029
|
function lp(n, t, e) {
|
|
9030
9030
|
var s, i, r, a, o, c;
|
|
9031
|
-
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;
|
|
9032
9032
|
for (a = 0; a < r; ++a) {
|
|
9033
|
-
var h =
|
|
9033
|
+
var h = ye(n, 3, 0);
|
|
9034
9034
|
de[op[a]] = h;
|
|
9035
9035
|
}
|
|
9036
9036
|
for (vr(Uo, de, 0, 19), o = 0; o < s + i; ) {
|
|
@@ -9038,15 +9038,15 @@ function lp(n, t, e) {
|
|
|
9038
9038
|
switch (l) {
|
|
9039
9039
|
case 16:
|
|
9040
9040
|
var u = de[o - 1];
|
|
9041
|
-
for (c =
|
|
9041
|
+
for (c = ye(n, 2, 3); c; --c)
|
|
9042
9042
|
de[o++] = u;
|
|
9043
9043
|
break;
|
|
9044
9044
|
case 17:
|
|
9045
|
-
for (c =
|
|
9045
|
+
for (c = ye(n, 3, 3); c; --c)
|
|
9046
9046
|
de[o++] = 0;
|
|
9047
9047
|
break;
|
|
9048
9048
|
case 18:
|
|
9049
|
-
for (c =
|
|
9049
|
+
for (c = ye(n, 7, 11); c; --c)
|
|
9050
9050
|
de[o++] = 0;
|
|
9051
9051
|
break;
|
|
9052
9052
|
default:
|
|
@@ -9065,7 +9065,7 @@ function No(n, t, e) {
|
|
|
9065
9065
|
n.dest[n.destLen++] = s;
|
|
9066
9066
|
else {
|
|
9067
9067
|
var i, r, a, o;
|
|
9068
|
-
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)
|
|
9069
9069
|
n.dest[n.destLen++] = n.dest[o];
|
|
9070
9070
|
}
|
|
9071
9071
|
}
|
|
@@ -9082,7 +9082,7 @@ function up(n) {
|
|
|
9082
9082
|
function Wh(n, t) {
|
|
9083
9083
|
var e = new ap(n, t), s, i, r;
|
|
9084
9084
|
do {
|
|
9085
|
-
switch (s = hp(e), i =
|
|
9085
|
+
switch (s = hp(e), i = ye(e, 2, 0), i) {
|
|
9086
9086
|
case 0:
|
|
9087
9087
|
r = up(e);
|
|
9088
9088
|
break;
|
|
@@ -13865,7 +13865,7 @@ function rd(n, t, e, s, i) {
|
|
|
13865
13865
|
}, r;
|
|
13866
13866
|
};
|
|
13867
13867
|
}
|
|
13868
|
-
var
|
|
13868
|
+
var we = { GlyphSet: Pi, glyphLoader: sd, ttfGlyphLoader: id, cffGlyphLoader: rd };
|
|
13869
13869
|
function cl(n, t) {
|
|
13870
13870
|
if (n === t)
|
|
13871
13871
|
return !0;
|
|
@@ -13884,7 +13884,7 @@ function Oi(n) {
|
|
|
13884
13884
|
let t;
|
|
13885
13885
|
return n.length < 1240 ? t = 107 : n.length < 33900 ? t = 1131 : t = 32768, t;
|
|
13886
13886
|
}
|
|
13887
|
-
function
|
|
13887
|
+
function me(n, t, e, s) {
|
|
13888
13888
|
const i = [], r = [], a = s > 1 ? z.getULong(n, t) : z.getCard16(n, t), o = s > 1 ? 4 : 2;
|
|
13889
13889
|
let c, h;
|
|
13890
13890
|
if (a !== 0) {
|
|
@@ -14097,7 +14097,7 @@ function yd(n, t, e) {
|
|
|
14097
14097
|
if (o !== 0 && c !== 0) {
|
|
14098
14098
|
const h = Ta(n, c + t, o, [], 2);
|
|
14099
14099
|
if (h.subrs) {
|
|
14100
|
-
const l = c + h.subrs, u =
|
|
14100
|
+
const l = c + h.subrs, u = me(n, l + t, void 0, 2);
|
|
14101
14101
|
a._subrs = u.objects, a._subrsBias = Oi(a._subrs);
|
|
14102
14102
|
}
|
|
14103
14103
|
a._privateDict = h;
|
|
@@ -14115,7 +14115,7 @@ function Sr(n, t, e, s, i) {
|
|
|
14115
14115
|
if (h !== 0 && l !== 0) {
|
|
14116
14116
|
const u = Ta(n, l + t, h, s, i);
|
|
14117
14117
|
if (c._defaultWidthX = u.defaultWidthX, c._nominalWidthX = u.nominalWidthX, u.subrs !== 0) {
|
|
14118
|
-
const f = l + u.subrs, p =
|
|
14118
|
+
const f = l + u.subrs, p = me(n, f + t, void 0, i);
|
|
14119
14119
|
c._subrs = p.objects, c._subrsBias = Oi(c._subrs);
|
|
14120
14120
|
}
|
|
14121
14121
|
c._privateDict = u;
|
|
@@ -14266,10 +14266,10 @@ function ra(n, t, e, s, i) {
|
|
|
14266
14266
|
break;
|
|
14267
14267
|
}
|
|
14268
14268
|
if (l.length >= 4) {
|
|
14269
|
-
const
|
|
14270
|
-
if (
|
|
14269
|
+
const Te = ia[l.pop()], C = ia[l.pop()], m = l.pop(), y = l.pop();
|
|
14270
|
+
if (Te && C) {
|
|
14271
14271
|
t.isComposite = !0, t.components = [];
|
|
14272
|
-
const T = n.cffEncoding.charset.indexOf(
|
|
14272
|
+
const T = n.cffEncoding.charset.indexOf(Te), k = n.cffEncoding.charset.indexOf(C);
|
|
14273
14273
|
t.components.push({
|
|
14274
14274
|
glyphIndex: k,
|
|
14275
14275
|
dx: 0,
|
|
@@ -14304,11 +14304,11 @@ function ra(n, t, e, s, i) {
|
|
|
14304
14304
|
M || (M = n.variation && i && n.variation.process.getBlendVector(F, w, i));
|
|
14305
14305
|
var tt = l.pop(), Et = M ? M.length : F.itemVariationSubtables[w].regionIndexes.length, Nt = tt * Et, zt = l.length - Nt, Ht = zt - tt;
|
|
14306
14306
|
if (M)
|
|
14307
|
-
for (let
|
|
14308
|
-
var Vt = l[Ht +
|
|
14307
|
+
for (let Te = 0; Te < tt; Te++) {
|
|
14308
|
+
var Vt = l[Ht + Te];
|
|
14309
14309
|
for (let C = 0; C < Et; C++)
|
|
14310
14310
|
Vt += M[C] * l[zt++];
|
|
14311
|
-
l[Ht +
|
|
14311
|
+
l[Ht + Te] = Vt;
|
|
14312
14312
|
}
|
|
14313
14313
|
for (; Nt--; )
|
|
14314
14314
|
l.pop();
|
|
@@ -14416,7 +14416,7 @@ function Sd(n, t, e, s) {
|
|
|
14416
14416
|
let i;
|
|
14417
14417
|
const r = ud(n, t);
|
|
14418
14418
|
r.formatMajor === 2 ? i = e.tables.cff2 = {} : i = e.tables.cff = {};
|
|
14419
|
-
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);
|
|
14420
14420
|
e.gsubrs = h.objects, e.gsubrsBias = Oi(e.gsubrs);
|
|
14421
14421
|
let l;
|
|
14422
14422
|
if (r.formatMajor > 1) {
|
|
@@ -14432,38 +14432,38 @@ function Sd(n, t, e, s) {
|
|
|
14432
14432
|
let f = l.fdArray, p = l.fdSelect;
|
|
14433
14433
|
if (!f)
|
|
14434
14434
|
throw new Error("This is a CFF2 font, but FDArray information is missing");
|
|
14435
|
-
const d =
|
|
14435
|
+
const d = me(n, t + f, null, r.formatMajor), g = yd(n, t, d.objects);
|
|
14436
14436
|
l._fdArray = g, p && (l._fdSelect = Yo(n, t + p, e.numGlyphs, g.length, r.formatMajor));
|
|
14437
14437
|
} else if (e.isCIDFont) {
|
|
14438
14438
|
let f = l.fdArray, p = l.fdSelect;
|
|
14439
14439
|
if (f === 0 || p === 0)
|
|
14440
14440
|
throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
|
|
14441
14441
|
f += t;
|
|
14442
|
-
const d =
|
|
14442
|
+
const d = me(n, f), g = Sr(n, t, d.objects, c.objects, r.formatMajor);
|
|
14443
14443
|
l._fdArray = g, p += t, l._fdSelect = Yo(n, p, e.numGlyphs, g.length, r.formatMajor);
|
|
14444
14444
|
}
|
|
14445
14445
|
if (r.formatMajor < 2) {
|
|
14446
14446
|
const f = t + l.private[1], p = Ta(n, f, l.private[0], c.objects, r.formatMajor);
|
|
14447
14447
|
if (e.defaultWidthX = p.defaultWidthX, e.nominalWidthX = p.nominalWidthX, p.subrs !== 0) {
|
|
14448
|
-
const d = f + p.subrs, g =
|
|
14448
|
+
const d = f + p.subrs, g = me(n, d);
|
|
14449
14449
|
e.subrs = g.objects, e.subrsBias = Oi(e.subrs);
|
|
14450
14450
|
} else
|
|
14451
14451
|
e.subrs = [], e.subrsBias = 0;
|
|
14452
14452
|
}
|
|
14453
14453
|
let u;
|
|
14454
|
-
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) {
|
|
14455
14455
|
let f = [], p = [];
|
|
14456
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;
|
|
14457
14457
|
}
|
|
14458
|
-
if (e.glyphs = new
|
|
14458
|
+
if (e.glyphs = new we.GlyphSet(e), s.lowMemory)
|
|
14459
14459
|
e._push = function(f) {
|
|
14460
14460
|
const p = od(f, u.offsets, n, t + l.charStrings, void 0, r.formatMajor);
|
|
14461
|
-
e.glyphs.push(f,
|
|
14461
|
+
e.glyphs.push(f, we.cffGlyphLoader(e, f, ra, p, r.formatMajor));
|
|
14462
14462
|
};
|
|
14463
14463
|
else
|
|
14464
14464
|
for (let f = 0; f < e.nGlyphs; f += 1) {
|
|
14465
14465
|
const p = u.objects[f];
|
|
14466
|
-
e.glyphs.push(f,
|
|
14466
|
+
e.glyphs.push(f, we.cffGlyphLoader(e, f, ra, p, r.formatMajor));
|
|
14467
14467
|
}
|
|
14468
14468
|
if (l.vstore) {
|
|
14469
14469
|
const f = new z.Parser(n, t + l.vstore);
|
|
@@ -17235,18 +17235,18 @@ function Rl(n, t) {
|
|
|
17235
17235
|
return ka(t.points);
|
|
17236
17236
|
}
|
|
17237
17237
|
function q0(n, t, e, s) {
|
|
17238
|
-
const i = new
|
|
17238
|
+
const i = new we.GlyphSet(s);
|
|
17239
17239
|
for (let r = 0; r < e.length - 1; r += 1) {
|
|
17240
17240
|
const a = e[r], o = e[r + 1];
|
|
17241
|
-
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));
|
|
17242
17242
|
}
|
|
17243
17243
|
return i;
|
|
17244
17244
|
}
|
|
17245
17245
|
function j0(n, t, e, s) {
|
|
17246
|
-
const i = new
|
|
17246
|
+
const i = new we.GlyphSet(s);
|
|
17247
17247
|
return s._push = function(r) {
|
|
17248
17248
|
const a = e[r], o = e[r + 1];
|
|
17249
|
-
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));
|
|
17250
17250
|
}, i;
|
|
17251
17251
|
}
|
|
17252
17252
|
function X0(n, t, e, s, i) {
|
|
@@ -17726,7 +17726,7 @@ var Hl = function(n) {
|
|
|
17726
17726
|
const s = this.srThreshold;
|
|
17727
17727
|
let i = 1;
|
|
17728
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;
|
|
17729
|
-
},
|
|
17729
|
+
}, ve = {
|
|
17730
17730
|
x: 1,
|
|
17731
17731
|
y: 0,
|
|
17732
17732
|
axis: "x",
|
|
@@ -17751,10 +17751,10 @@ var Hl = function(n) {
|
|
|
17751
17751
|
return;
|
|
17752
17752
|
}
|
|
17753
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) {
|
|
17754
|
-
|
|
17754
|
+
ve.setRelative(n, n, (c + h) / 2, s, !0);
|
|
17755
17755
|
return;
|
|
17756
17756
|
}
|
|
17757
|
-
|
|
17757
|
+
ve.setRelative(n, n, (c * o + h * a) / l, s, !0);
|
|
17758
17758
|
},
|
|
17759
17759
|
// Slope of line normal to this
|
|
17760
17760
|
normalSlope: Number.NEGATIVE_INFINITY,
|
|
@@ -17790,7 +17790,7 @@ var Hl = function(n) {
|
|
|
17790
17790
|
untouch: function(n) {
|
|
17791
17791
|
n.xTouched = !1;
|
|
17792
17792
|
}
|
|
17793
|
-
},
|
|
17793
|
+
}, Be = {
|
|
17794
17794
|
x: 0,
|
|
17795
17795
|
y: 1,
|
|
17796
17796
|
axis: "y",
|
|
@@ -17815,10 +17815,10 @@ var Hl = function(n) {
|
|
|
17815
17815
|
return;
|
|
17816
17816
|
}
|
|
17817
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) {
|
|
17818
|
-
|
|
17818
|
+
Be.setRelative(n, n, (c + h) / 2, s, !0);
|
|
17819
17819
|
return;
|
|
17820
17820
|
}
|
|
17821
|
-
|
|
17821
|
+
Be.setRelative(n, n, (c * o + h * a) / l, s, !0);
|
|
17822
17822
|
},
|
|
17823
17823
|
// Slope of line normal to this.
|
|
17824
17824
|
normalSlope: 0,
|
|
@@ -17855,13 +17855,13 @@ var Hl = function(n) {
|
|
|
17855
17855
|
n.yTouched = !1;
|
|
17856
17856
|
}
|
|
17857
17857
|
};
|
|
17858
|
-
Object.freeze(
|
|
17859
|
-
Object.freeze(
|
|
17858
|
+
Object.freeze(ve);
|
|
17859
|
+
Object.freeze(Be);
|
|
17860
17860
|
function As(n, t) {
|
|
17861
17861
|
this.x = n, this.y = t, this.axis = void 0, this.slope = t / n, this.normalSlope = -n / t, Object.freeze(this);
|
|
17862
17862
|
}
|
|
17863
17863
|
As.prototype.distance = function(n, t, e, s) {
|
|
17864
|
-
return this.x *
|
|
17864
|
+
return this.x * ve.distance(n, t, e, s) + this.y * Be.distance(n, t, e, s);
|
|
17865
17865
|
};
|
|
17866
17866
|
As.prototype.interpolate = function(n, t, e, s) {
|
|
17867
17867
|
let i, r, a, o, c, h, l;
|
|
@@ -17881,22 +17881,22 @@ As.prototype.touch = function(n) {
|
|
|
17881
17881
|
};
|
|
17882
17882
|
function ks(n, t) {
|
|
17883
17883
|
const e = Math.sqrt(n * n + t * t);
|
|
17884
|
-
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);
|
|
17885
17885
|
}
|
|
17886
|
-
function
|
|
17886
|
+
function De(n, t, e, s) {
|
|
17887
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);
|
|
17888
17888
|
}
|
|
17889
|
-
|
|
17889
|
+
De.prototype.nextTouched = function(n) {
|
|
17890
17890
|
let t = this.nextPointOnContour;
|
|
17891
17891
|
for (; !n.touched(t) && t !== this; ) t = t.nextPointOnContour;
|
|
17892
17892
|
return t;
|
|
17893
17893
|
};
|
|
17894
|
-
|
|
17894
|
+
De.prototype.prevTouched = function(n) {
|
|
17895
17895
|
let t = this.prevPointOnContour;
|
|
17896
17896
|
for (; !n.touched(t) && t !== this; ) t = t.prevPointOnContour;
|
|
17897
17897
|
return t;
|
|
17898
17898
|
};
|
|
17899
|
-
var bs = Object.freeze(new
|
|
17899
|
+
var bs = Object.freeze(new De(0, 0)), e1 = {
|
|
17900
17900
|
cvCutIn: 17 / 16,
|
|
17901
17901
|
// control value cut in
|
|
17902
17902
|
deltaBase: 9,
|
|
@@ -17912,7 +17912,7 @@ function $e(n, t) {
|
|
|
17912
17912
|
case "glyf":
|
|
17913
17913
|
this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
|
|
17914
17914
|
case "prep":
|
|
17915
|
-
this.fv = this.pv = this.dpv =
|
|
17915
|
+
this.fv = this.pv = this.dpv = ve, this.round = zl;
|
|
17916
17916
|
}
|
|
17917
17917
|
}
|
|
17918
17918
|
Nl.prototype.exec = function(n, t) {
|
|
@@ -17976,8 +17976,8 @@ Pl = function(n, t) {
|
|
|
17976
17976
|
r.push(g[b] + x);
|
|
17977
17977
|
}
|
|
17978
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(
|
|
17979
|
-
new
|
|
17980
|
-
new
|
|
17979
|
+
new De(0, 0),
|
|
17980
|
+
new De(Math.round(n.advanceWidth * e), 0)
|
|
17981
17981
|
), dn(o), a.length -= 2);
|
|
17982
17982
|
}
|
|
17983
17983
|
return a;
|
|
@@ -17986,7 +17986,7 @@ ha = function(n, t, e, s) {
|
|
|
17986
17986
|
const i = n.points || [], r = i.length, a = t.gZone = t.z0 = t.z1 = t.z2 = [], o = t.contours = [];
|
|
17987
17987
|
let c;
|
|
17988
17988
|
for (let u = 0; u < r; u++)
|
|
17989
|
-
c = i[u], a[u] = new
|
|
17989
|
+
c = i[u], a[u] = new De(
|
|
17990
17990
|
c.x * e,
|
|
17991
17991
|
c.y * s,
|
|
17992
17992
|
c.lastPointOfContour,
|
|
@@ -17996,8 +17996,8 @@ ha = function(n, t, e, s) {
|
|
|
17996
17996
|
for (let u = 0; u < r; u++)
|
|
17997
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);
|
|
17998
17998
|
t.inhibitGridFit || (a.push(
|
|
17999
|
-
new
|
|
18000
|
-
new
|
|
17999
|
+
new De(0, 0),
|
|
18000
|
+
new De(Math.round(n.advanceWidth * e), 0)
|
|
18001
18001
|
), dn(t), a.length -= 2);
|
|
18002
18002
|
};
|
|
18003
18003
|
dn = function(n) {
|
|
@@ -18020,7 +18020,7 @@ dn = function(n) {
|
|
|
18020
18020
|
function zi(n) {
|
|
18021
18021
|
const t = n.tZone = new Array(n.gZone.length);
|
|
18022
18022
|
for (let e = 0; e < t.length; e++)
|
|
18023
|
-
t[e] = new
|
|
18023
|
+
t[e] = new De(0, 0);
|
|
18024
18024
|
}
|
|
18025
18025
|
function Gl(n, t) {
|
|
18026
18026
|
const e = n.prog;
|
|
@@ -18601,13 +18601,13 @@ function Tg(n) {
|
|
|
18601
18601
|
throw new Error("invalid INSTCTRL[] selector");
|
|
18602
18602
|
}
|
|
18603
18603
|
}
|
|
18604
|
-
function
|
|
18604
|
+
function Ge(n, t) {
|
|
18605
18605
|
const e = t.stack, s = t.prog;
|
|
18606
18606
|
let i = t.ip;
|
|
18607
18607
|
for (let r = 0; r < n; r++) e.push(s[++i]);
|
|
18608
18608
|
t.ip = i;
|
|
18609
18609
|
}
|
|
18610
|
-
function
|
|
18610
|
+
function Ve(n, t) {
|
|
18611
18611
|
let e = t.ip;
|
|
18612
18612
|
const s = t.prog, i = t.stack;
|
|
18613
18613
|
for (let r = 0; r < n; r++) {
|
|
@@ -18623,17 +18623,17 @@ function G(n, t, e, s, i, r) {
|
|
|
18623
18623
|
}
|
|
18624
18624
|
Ul = [
|
|
18625
18625
|
/* 0x00 */
|
|
18626
|
-
rc.bind(void 0,
|
|
18626
|
+
rc.bind(void 0, Be),
|
|
18627
18627
|
/* 0x01 */
|
|
18628
|
-
rc.bind(void 0,
|
|
18628
|
+
rc.bind(void 0, ve),
|
|
18629
18629
|
/* 0x02 */
|
|
18630
|
-
ac.bind(void 0,
|
|
18630
|
+
ac.bind(void 0, Be),
|
|
18631
18631
|
/* 0x03 */
|
|
18632
|
-
ac.bind(void 0,
|
|
18632
|
+
ac.bind(void 0, ve),
|
|
18633
18633
|
/* 0x04 */
|
|
18634
|
-
oc.bind(void 0,
|
|
18634
|
+
oc.bind(void 0, Be),
|
|
18635
18635
|
/* 0x05 */
|
|
18636
|
-
oc.bind(void 0,
|
|
18636
|
+
oc.bind(void 0, ve),
|
|
18637
18637
|
/* 0x06 */
|
|
18638
18638
|
cc.bind(void 0, 0),
|
|
18639
18639
|
/* 0x07 */
|
|
@@ -18724,9 +18724,9 @@ Ul = [
|
|
|
18724
18724
|
/* 0x2F */
|
|
18725
18725
|
lc.bind(void 0, 1),
|
|
18726
18726
|
/* 0x30 */
|
|
18727
|
-
uc.bind(void 0,
|
|
18727
|
+
uc.bind(void 0, Be),
|
|
18728
18728
|
/* 0x31 */
|
|
18729
|
-
uc.bind(void 0,
|
|
18729
|
+
uc.bind(void 0, ve),
|
|
18730
18730
|
/* 0x32 */
|
|
18731
18731
|
fc.bind(void 0, 0),
|
|
18732
18732
|
/* 0x33 */
|
|
@@ -18996,37 +18996,37 @@ Ul = [
|
|
|
18996
18996
|
/* 0xAF */
|
|
18997
18997
|
void 0,
|
|
18998
18998
|
/* 0xB0 */
|
|
18999
|
-
|
|
18999
|
+
Ge.bind(void 0, 1),
|
|
19000
19000
|
/* 0xB1 */
|
|
19001
|
-
|
|
19001
|
+
Ge.bind(void 0, 2),
|
|
19002
19002
|
/* 0xB2 */
|
|
19003
|
-
|
|
19003
|
+
Ge.bind(void 0, 3),
|
|
19004
19004
|
/* 0xB3 */
|
|
19005
|
-
|
|
19005
|
+
Ge.bind(void 0, 4),
|
|
19006
19006
|
/* 0xB4 */
|
|
19007
|
-
|
|
19007
|
+
Ge.bind(void 0, 5),
|
|
19008
19008
|
/* 0xB5 */
|
|
19009
|
-
|
|
19009
|
+
Ge.bind(void 0, 6),
|
|
19010
19010
|
/* 0xB6 */
|
|
19011
|
-
|
|
19011
|
+
Ge.bind(void 0, 7),
|
|
19012
19012
|
/* 0xB7 */
|
|
19013
|
-
|
|
19013
|
+
Ge.bind(void 0, 8),
|
|
19014
19014
|
/* 0xB8 */
|
|
19015
|
-
|
|
19015
|
+
Ve.bind(void 0, 1),
|
|
19016
19016
|
/* 0xB9 */
|
|
19017
|
-
|
|
19017
|
+
Ve.bind(void 0, 2),
|
|
19018
19018
|
/* 0xBA */
|
|
19019
|
-
|
|
19019
|
+
Ve.bind(void 0, 3),
|
|
19020
19020
|
/* 0xBB */
|
|
19021
|
-
|
|
19021
|
+
Ve.bind(void 0, 4),
|
|
19022
19022
|
/* 0xBC */
|
|
19023
|
-
|
|
19023
|
+
Ve.bind(void 0, 5),
|
|
19024
19024
|
/* 0xBD */
|
|
19025
|
-
|
|
19025
|
+
Ve.bind(void 0, 6),
|
|
19026
19026
|
/* 0xBE */
|
|
19027
|
-
|
|
19027
|
+
Ve.bind(void 0, 7),
|
|
19028
19028
|
/* 0xBF */
|
|
19029
|
-
|
|
19029
|
+
Ve.bind(void 0, 8),
|
|
19030
19030
|
/* 0xC0 */
|
|
19031
19031
|
G.bind(void 0, 0, 0, 0, 0, 0),
|
|
19032
19032
|
/* 0xC1 */
|
|
@@ -20332,7 +20332,7 @@ function it(n) {
|
|
|
20332
20332
|
}, n.tables.os2)
|
|
20333
20333
|
});
|
|
20334
20334
|
}
|
|
20335
|
-
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, {
|
|
20336
20336
|
set: (t, e, s) => (t[e] = s, t.fvar && (t.gvar || t.cff2) && !this.variation && (this.variation = new $0(this)), !0)
|
|
20337
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", {
|
|
20338
20338
|
get: function() {
|
|
@@ -21730,9 +21730,9 @@ var Wl = { exports: {} }, Ma = {}, Gi = {};
|
|
|
21730
21730
|
Gi.byteLength = ky;
|
|
21731
21731
|
Gi.toByteArray = My;
|
|
21732
21732
|
Gi.fromByteArray = Ly;
|
|
21733
|
-
var
|
|
21733
|
+
var xe = [], Jt = [], Fy = typeof Uint8Array < "u" ? Uint8Array : Array, Or = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
21734
21734
|
for (var In = 0, Ay = Or.length; In < Ay; ++In)
|
|
21735
|
-
|
|
21735
|
+
xe[In] = Or[In], Jt[Or.charCodeAt(In)] = In;
|
|
21736
21736
|
Jt[45] = 62;
|
|
21737
21737
|
Jt[95] = 63;
|
|
21738
21738
|
function ql(n) {
|
|
@@ -21758,7 +21758,7 @@ function My(n) {
|
|
|
21758
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;
|
|
21759
21759
|
}
|
|
21760
21760
|
function Oy(n) {
|
|
21761
|
-
return
|
|
21761
|
+
return xe[n >> 18 & 63] + xe[n >> 12 & 63] + xe[n >> 6 & 63] + xe[n & 63];
|
|
21762
21762
|
}
|
|
21763
21763
|
function _y(n, t, e) {
|
|
21764
21764
|
for (var s, i = [], r = t; r < e; r += 3)
|
|
@@ -21769,9 +21769,9 @@ function Ly(n) {
|
|
|
21769
21769
|
for (var t, e = n.length, s = e % 3, i = [], r = 16383, a = 0, o = e - s; a < o; a += r)
|
|
21770
21770
|
i.push(_y(n, a, a + r > o ? o : a + r));
|
|
21771
21771
|
return s === 1 ? (t = n[e - 1], i.push(
|
|
21772
|
-
|
|
21772
|
+
xe[t >> 2] + xe[t << 4 & 63] + "=="
|
|
21773
21773
|
)) : s === 2 && (t = (n[e - 2] << 8) + n[e - 1], i.push(
|
|
21774
|
-
|
|
21774
|
+
xe[t >> 10] + xe[t >> 4 & 63] + xe[t << 2 & 63] + "="
|
|
21775
21775
|
)), i.join("");
|
|
21776
21776
|
}
|
|
21777
21777
|
var Oa = {};
|
|
@@ -22301,7 +22301,7 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22301
22301
|
var T = C.length;
|
|
22302
22302
|
(!m || m < 0) && (m = 0), (!y || y < 0 || y > T) && (y = T);
|
|
22303
22303
|
for (var k = "", _ = m; _ < y; ++_)
|
|
22304
|
-
k +=
|
|
22304
|
+
k += Te[C[_]];
|
|
22305
22305
|
return k;
|
|
22306
22306
|
}
|
|
22307
22307
|
function ut(C, m, y) {
|
|
@@ -22577,7 +22577,7 @@ Oa.write = function(n, t, e, s, i, r) {
|
|
|
22577
22577
|
function Mt(C) {
|
|
22578
22578
|
return C !== C;
|
|
22579
22579
|
}
|
|
22580
|
-
var
|
|
22580
|
+
var Te = function() {
|
|
22581
22581
|
for (var C = "0123456789abcdef", m = new Array(256), y = 0; y < 16; ++y)
|
|
22582
22582
|
for (var T = y * 16, k = 0; k < 16; ++k)
|
|
22583
22583
|
m[T + k] = C[y] + C[k];
|
|
@@ -22920,16 +22920,16 @@ function Uy() {
|
|
|
22920
22920
|
}
|
|
22921
22921
|
}, Ir;
|
|
22922
22922
|
}
|
|
22923
|
-
var
|
|
22923
|
+
var _e = {}, Rc;
|
|
22924
22924
|
function Py() {
|
|
22925
|
-
if (Rc) return
|
|
22925
|
+
if (Rc) return _e;
|
|
22926
22926
|
Rc = 1;
|
|
22927
22927
|
var n = en.Buffer;
|
|
22928
|
-
|
|
22928
|
+
_e._utf32 = t;
|
|
22929
22929
|
function t(h, l) {
|
|
22930
22930
|
this.iconv = l, this.bomAware = !0, this.isLE = h.isLE;
|
|
22931
22931
|
}
|
|
22932
|
-
|
|
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;
|
|
22933
22933
|
function e(h, l) {
|
|
22934
22934
|
this.isLE = l.isLE, this.highSurrogate = 0;
|
|
22935
22935
|
}
|
|
@@ -22982,7 +22982,7 @@ function Py() {
|
|
|
22982
22982
|
}
|
|
22983
22983
|
s.prototype.end = function() {
|
|
22984
22984
|
this.overflow.length = 0;
|
|
22985
|
-
},
|
|
22985
|
+
}, _e.utf32 = r, _e.ucs4 = "utf32";
|
|
22986
22986
|
function r(h, l) {
|
|
22987
22987
|
this.iconv = l;
|
|
22988
22988
|
}
|
|
@@ -23037,7 +23037,7 @@ function Py() {
|
|
|
23037
23037
|
}
|
|
23038
23038
|
return x - d > g - p ? "utf-32be" : x - d < g - p ? "utf-32le" : l || "utf-32le";
|
|
23039
23039
|
}
|
|
23040
|
-
return
|
|
23040
|
+
return _e;
|
|
23041
23041
|
}
|
|
23042
23042
|
var ri = {}, Dc;
|
|
23043
23043
|
function Ny() {
|
|
@@ -33052,7 +33052,7 @@ const Xe = class Xe extends Ah {
|
|
|
33052
33052
|
};
|
|
33053
33053
|
Xe.NOT_ENCODABLE = -1;
|
|
33054
33054
|
let ua = Xe;
|
|
33055
|
-
class
|
|
33055
|
+
class be {
|
|
33056
33056
|
constructor() {
|
|
33057
33057
|
}
|
|
33058
33058
|
/**
|
|
@@ -33060,7 +33060,7 @@ class xe {
|
|
|
33060
33060
|
* @returns The FontFactory instance
|
|
33061
33061
|
*/
|
|
33062
33062
|
static get instance() {
|
|
33063
|
-
return
|
|
33063
|
+
return be._instance || (be._instance = new be()), be._instance;
|
|
33064
33064
|
}
|
|
33065
33065
|
/**
|
|
33066
33066
|
* Creates a font instance based on the provided font data.
|
|
@@ -33166,10 +33166,10 @@ class he {
|
|
|
33166
33166
|
return t.map((i) => ({ ...i, source: "remote" }));
|
|
33167
33167
|
const e = /* @__PURE__ */ new Map();
|
|
33168
33168
|
for (const i of t) {
|
|
33169
|
-
const r =
|
|
33169
|
+
const r = qe(i.file).toLowerCase();
|
|
33170
33170
|
e.set(r, { ...i, source: "remote" });
|
|
33171
33171
|
}
|
|
33172
|
-
const s = await
|
|
33172
|
+
const s = await ge.instance.getAll();
|
|
33173
33173
|
for (const i of s) {
|
|
33174
33174
|
const r = i.name.toLowerCase();
|
|
33175
33175
|
e.has(r) || e.set(r, this.cachedFontDataToFontInfo(i));
|
|
@@ -33272,7 +33272,7 @@ class he {
|
|
|
33272
33272
|
let r, a;
|
|
33273
33273
|
if (typeof File < "u" && t instanceof File ? (r = await t.arrayBuffer(), a = e ?? t.name) : (r = t, a = e ?? ""), !a)
|
|
33274
33274
|
throw new Error("fileName is required when caching an ArrayBuffer");
|
|
33275
|
-
const o =
|
|
33275
|
+
const o = qe(a).toLowerCase();
|
|
33276
33276
|
if (!o)
|
|
33277
33277
|
return {
|
|
33278
33278
|
fontName: "",
|
|
@@ -33304,8 +33304,8 @@ class he {
|
|
|
33304
33304
|
data: r
|
|
33305
33305
|
};
|
|
33306
33306
|
try {
|
|
33307
|
-
const u =
|
|
33308
|
-
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 }), {
|
|
33309
33309
|
fontName: o,
|
|
33310
33310
|
url: "",
|
|
33311
33311
|
status: "Success"
|
|
@@ -33329,14 +33329,14 @@ class he {
|
|
|
33329
33329
|
var i;
|
|
33330
33330
|
if (!this.enableFontCache || !t)
|
|
33331
33331
|
return !1;
|
|
33332
|
-
const e =
|
|
33332
|
+
const e = qe(t).toLowerCase();
|
|
33333
33333
|
if (this.isFontLoaded(e))
|
|
33334
33334
|
return !0;
|
|
33335
|
-
const s = await
|
|
33335
|
+
const s = await ge.instance.find(t);
|
|
33336
33336
|
if (!s)
|
|
33337
33337
|
return !1;
|
|
33338
33338
|
try {
|
|
33339
|
-
const r =
|
|
33339
|
+
const r = be.instance.createFont(s);
|
|
33340
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;
|
|
33341
33341
|
} catch {
|
|
33342
33342
|
return !1;
|
|
@@ -33355,7 +33355,7 @@ class he {
|
|
|
33355
33355
|
const s = [];
|
|
33356
33356
|
return await Promise.allSettled(e).then((i) => {
|
|
33357
33357
|
i.forEach((r, a) => {
|
|
33358
|
-
const o = t[a].url, c =
|
|
33358
|
+
const o = t[a].url, c = qe(
|
|
33359
33359
|
t[a].file || o
|
|
33360
33360
|
).toLowerCase(), h = r.status === "fulfilled" && this.isFontLoaded(c);
|
|
33361
33361
|
s.push({
|
|
@@ -33609,6 +33609,51 @@ class he {
|
|
|
33609
33609
|
count: this.missedFonts[t]
|
|
33610
33610
|
}), e && this.lazyFontLoading && this.requestFont(t)));
|
|
33611
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
|
+
}
|
|
33612
33657
|
/**
|
|
33613
33658
|
* Loads a single font
|
|
33614
33659
|
* @param fontInfo - The matadata of the font to be loaded
|
|
@@ -33616,30 +33661,40 @@ class he {
|
|
|
33616
33661
|
async loadFont(t) {
|
|
33617
33662
|
if (!Eh(t.file))
|
|
33618
33663
|
throw new Error(`Invalid font file name: ${t.file}`);
|
|
33619
|
-
const s = this.fontInfoToFontData(t), i = s.name;
|
|
33620
|
-
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);
|
|
33621
33667
|
return;
|
|
33622
|
-
|
|
33623
|
-
|
|
33624
|
-
|
|
33625
|
-
|
|
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);
|
|
33626
33676
|
return;
|
|
33627
|
-
|
|
33628
|
-
|
|
33677
|
+
}
|
|
33678
|
+
const c = be.instance.createFont(o);
|
|
33679
|
+
c && (this.applyCatalogNames(c, r), this.registerFontInMap(i, c), await this.persistCatalogAliases(i, r));
|
|
33629
33680
|
} else {
|
|
33630
|
-
const
|
|
33631
|
-
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);
|
|
33632
33686
|
return;
|
|
33633
|
-
|
|
33634
|
-
|
|
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));
|
|
33635
33690
|
}
|
|
33636
|
-
|
|
33691
|
+
a !== this.loadEpoch || !this.isFontLoaded(i) || (this.clearRequestStateForNames([i, ...r]), this.events.fontLoaded.dispatch({
|
|
33637
33692
|
fontName: i
|
|
33638
33693
|
}));
|
|
33639
33694
|
}
|
|
33640
33695
|
}
|
|
33641
33696
|
fontInfoToFontData(t) {
|
|
33642
|
-
const e =
|
|
33697
|
+
const e = qe(t.file).toLowerCase(), s = ["ttf", "otf", "woff"].includes(t.type) ? "mesh" : t.type;
|
|
33643
33698
|
return {
|
|
33644
33699
|
name: e,
|
|
33645
33700
|
alias: t.name,
|
|
@@ -33653,12 +33708,12 @@ class he {
|
|
|
33653
33708
|
async getAllFontsFromCache() {
|
|
33654
33709
|
if (this.loadedFontMap.size !== 0)
|
|
33655
33710
|
return;
|
|
33656
|
-
const t = await
|
|
33711
|
+
const t = await ge.instance.getAll();
|
|
33657
33712
|
for (const e of t) {
|
|
33658
33713
|
const { name: s } = e;
|
|
33659
33714
|
if (this.fileNames && !this.fileNames.includes(s))
|
|
33660
33715
|
continue;
|
|
33661
|
-
const i =
|
|
33716
|
+
const i = be.instance.createFont(e);
|
|
33662
33717
|
this.registerFontInMap(s, i);
|
|
33663
33718
|
}
|
|
33664
33719
|
}
|
|
@@ -33682,7 +33737,7 @@ class he {
|
|
|
33682
33737
|
}
|
|
33683
33738
|
buildUploadedFontAliases(t, e, s) {
|
|
33684
33739
|
const i = /* @__PURE__ */ new Set();
|
|
33685
|
-
return i.add(t), i.add(
|
|
33740
|
+
return i.add(t), i.add(qe(e)), s == null || s.forEach((r) => {
|
|
33686
33741
|
r && i.add(r);
|
|
33687
33742
|
}), [...i];
|
|
33688
33743
|
}
|
|
@@ -33844,7 +33899,7 @@ class rx {
|
|
|
33844
33899
|
});
|
|
33845
33900
|
continue;
|
|
33846
33901
|
}
|
|
33847
|
-
const f =
|
|
33902
|
+
const f = qe(
|
|
33848
33903
|
u.file
|
|
33849
33904
|
).toLowerCase(), p = a[f];
|
|
33850
33905
|
if (p) {
|
|
@@ -33971,7 +34026,7 @@ const di = "", hx = () => ({
|
|
|
33971
34026
|
byLayerColor: 16777215,
|
|
33972
34027
|
byBlockColor: 16777215,
|
|
33973
34028
|
layer: "0",
|
|
33974
|
-
color: new
|
|
34029
|
+
color: new Se()
|
|
33975
34030
|
});
|
|
33976
34031
|
function lx(n) {
|
|
33977
34032
|
if (!(!n || [
|
|
@@ -35611,7 +35666,7 @@ function Tx(n) {
|
|
|
35611
35666
|
return String.fromCharCode(s);
|
|
35612
35667
|
});
|
|
35613
35668
|
}
|
|
35614
|
-
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);
|
|
35615
35670
|
class Da extends Xt {
|
|
35616
35671
|
/**
|
|
35617
35672
|
* Extracts all unique font names used in an MText string.
|
|
@@ -36098,9 +36153,9 @@ class Da extends Xt {
|
|
|
36098
36153
|
t.updateWorldMatrix(!1, !1);
|
|
36099
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;
|
|
36100
36155
|
if (r && r.length > 0 && r.forEach((f) => {
|
|
36101
|
-
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({
|
|
36102
36157
|
y: as.y,
|
|
36103
|
-
height: Math.abs(
|
|
36158
|
+
height: Math.abs(Ie.y - Le.y),
|
|
36104
36159
|
breakIndex: f.breakIndex
|
|
36105
36160
|
});
|
|
36106
36161
|
}), i && i.length > 0) {
|
|
@@ -36165,7 +36220,7 @@ class Da extends Xt {
|
|
|
36165
36220
|
}
|
|
36166
36221
|
const i = (c = t.userData) == null ? void 0 : c.lineLayouts;
|
|
36167
36222
|
i && i.length > 0 && i.forEach((p) => {
|
|
36168
|
-
|
|
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);
|
|
36169
36224
|
});
|
|
36170
36225
|
const r = (l = (h = t.userData) == null ? void 0 : h.layout) == null ? void 0 : l.chars;
|
|
36171
36226
|
if (r && r.length > 0) {
|
|
@@ -36387,11 +36442,11 @@ function Fx(n) {
|
|
|
36387
36442
|
byLayerColor: 16777215,
|
|
36388
36443
|
byBlockColor: 16777215,
|
|
36389
36444
|
layer: "0",
|
|
36390
|
-
color: new
|
|
36445
|
+
color: new Se()
|
|
36391
36446
|
}, e = n ?? t, s = e.color;
|
|
36392
|
-
if (s instanceof
|
|
36447
|
+
if (s instanceof Se)
|
|
36393
36448
|
return e;
|
|
36394
|
-
const i = new
|
|
36449
|
+
const i = new Se();
|
|
36395
36450
|
if (s && typeof s == "object") {
|
|
36396
36451
|
const r = s;
|
|
36397
36452
|
typeof r._aci == "number" && (i.aci = r._aci), typeof r._rgbValue == "number" && (i.rgbValue = r._rgbValue);
|
|
@@ -36491,10 +36546,10 @@ function kx(n) {
|
|
|
36491
36546
|
transparent: l.transparent,
|
|
36492
36547
|
opacity: l.opacity
|
|
36493
36548
|
}, b = (i = s.userData) == null ? void 0 : i.mtextColor;
|
|
36494
|
-
if (b instanceof
|
|
36549
|
+
if (b instanceof Se)
|
|
36495
36550
|
x.mtextColor = Yc(b);
|
|
36496
36551
|
else if (b && typeof b == "object") {
|
|
36497
|
-
const v = b, w = new
|
|
36552
|
+
const v = b, w = new Se();
|
|
36498
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);
|
|
36499
36554
|
}
|
|
36500
36555
|
"side" in l && typeof l.side == "number" && (x.side = l.side), "linewidth" in l && typeof l.linewidth == "number" && (x.linewidth = l.linewidth);
|