@mlightcad/mtext-renderer 0.3.6 → 0.4.0
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 +170 -124
- package/dist/index.umd.cjs +3 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -73,7 +73,7 @@ function Sa() {
|
|
|
73
73
|
IDBCursor.prototype.continuePrimaryKey
|
|
74
74
|
]);
|
|
75
75
|
}
|
|
76
|
-
const _t = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakMap(),
|
|
76
|
+
const _t = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap();
|
|
77
77
|
function ka(t) {
|
|
78
78
|
const e = new Promise((r, n) => {
|
|
79
79
|
const a = () => {
|
|
@@ -85,7 +85,7 @@ function ka(t) {
|
|
|
85
85
|
};
|
|
86
86
|
t.addEventListener("success", s), t.addEventListener("error", i);
|
|
87
87
|
});
|
|
88
|
-
return
|
|
88
|
+
return vt.set(e, t), e;
|
|
89
89
|
}
|
|
90
90
|
function Ta(t) {
|
|
91
91
|
if (_t.has(t))
|
|
@@ -138,9 +138,9 @@ function Le(t) {
|
|
|
138
138
|
if (bt.has(t))
|
|
139
139
|
return bt.get(t);
|
|
140
140
|
const e = Ca(t);
|
|
141
|
-
return e !== t && (bt.set(t, e),
|
|
141
|
+
return e !== t && (bt.set(t, e), vt.set(e, t)), e;
|
|
142
142
|
}
|
|
143
|
-
const zt = (t) =>
|
|
143
|
+
const zt = (t) => vt.get(t);
|
|
144
144
|
function wa(t, e, { blocked: r, upgrade: n, blocking: a, terminated: s } = {}) {
|
|
145
145
|
const i = indexedDB.open(t, e), o = Le(i);
|
|
146
146
|
return n && i.addEventListener("upgradeneeded", (u) => {
|
|
@@ -198,7 +198,7 @@ async function* Ra(...t) {
|
|
|
198
198
|
return;
|
|
199
199
|
e = e;
|
|
200
200
|
const r = new Proxy(e, La);
|
|
201
|
-
for (xn.set(r, e),
|
|
201
|
+
for (xn.set(r, e), vt.set(r, zt(e)); e; )
|
|
202
202
|
yield r, e = await (Wt.get(r) || e.continue()), Wt.delete(r);
|
|
203
203
|
}
|
|
204
204
|
function xr(t, e) {
|
|
@@ -1241,16 +1241,16 @@ Pe.MACSTRING = function(t, e, r, n) {
|
|
|
1241
1241
|
return s;
|
|
1242
1242
|
}
|
|
1243
1243
|
};
|
|
1244
|
-
var
|
|
1245
|
-
if (!
|
|
1246
|
-
|
|
1244
|
+
var rt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), nt, Ya = function(t) {
|
|
1245
|
+
if (!nt) {
|
|
1246
|
+
nt = {};
|
|
1247
1247
|
for (var e in qt)
|
|
1248
|
-
|
|
1248
|
+
nt[e] = new String(e);
|
|
1249
1249
|
}
|
|
1250
|
-
var r =
|
|
1250
|
+
var r = nt[t];
|
|
1251
1251
|
if (r !== void 0) {
|
|
1252
|
-
if (
|
|
1253
|
-
var n =
|
|
1252
|
+
if (rt) {
|
|
1253
|
+
var n = rt.get(r);
|
|
1254
1254
|
if (n !== void 0)
|
|
1255
1255
|
return n;
|
|
1256
1256
|
}
|
|
@@ -1258,7 +1258,7 @@ var tt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), rt, Ya =
|
|
|
1258
1258
|
if (a !== void 0) {
|
|
1259
1259
|
for (var s = {}, i = 0; i < a.length; i++)
|
|
1260
1260
|
s[a.charCodeAt(i)] = i + 128;
|
|
1261
|
-
return
|
|
1261
|
+
return rt && rt.set(r, s), s;
|
|
1262
1262
|
}
|
|
1263
1263
|
}
|
|
1264
1264
|
};
|
|
@@ -1372,10 +1372,10 @@ b.OPERAND = function(t, e) {
|
|
|
1372
1372
|
};
|
|
1373
1373
|
b.OP = b.BYTE;
|
|
1374
1374
|
U.OP = U.BYTE;
|
|
1375
|
-
var
|
|
1375
|
+
var at = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap();
|
|
1376
1376
|
b.CHARSTRING = function(t) {
|
|
1377
|
-
if (
|
|
1378
|
-
var e =
|
|
1377
|
+
if (at) {
|
|
1378
|
+
var e = at.get(t);
|
|
1379
1379
|
if (e !== void 0)
|
|
1380
1380
|
return e;
|
|
1381
1381
|
}
|
|
@@ -1383,7 +1383,7 @@ b.CHARSTRING = function(t) {
|
|
|
1383
1383
|
var s = t[a];
|
|
1384
1384
|
r = r.concat(b[s.type](s.value));
|
|
1385
1385
|
}
|
|
1386
|
-
return
|
|
1386
|
+
return at && at.set(t, r), r;
|
|
1387
1387
|
};
|
|
1388
1388
|
U.CHARSTRING = function(t) {
|
|
1389
1389
|
return b.CHARSTRING(t).length;
|
|
@@ -1468,7 +1468,7 @@ function qe(t, e, r) {
|
|
|
1468
1468
|
a = a.concat(r(e[s], s));
|
|
1469
1469
|
return a;
|
|
1470
1470
|
}
|
|
1471
|
-
function
|
|
1471
|
+
function lt(t) {
|
|
1472
1472
|
t.format === 1 ? W.call(
|
|
1473
1473
|
this,
|
|
1474
1474
|
"coverageTable",
|
|
@@ -1485,9 +1485,9 @@ function ut(t) {
|
|
|
1485
1485
|
}))
|
|
1486
1486
|
) : E.assert(!1, "Coverage format must be 1 or 2.");
|
|
1487
1487
|
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
function
|
|
1488
|
+
lt.prototype = Object.create(W.prototype);
|
|
1489
|
+
lt.prototype.constructor = lt;
|
|
1490
|
+
function ct(t) {
|
|
1491
1491
|
W.call(
|
|
1492
1492
|
this,
|
|
1493
1493
|
"scriptListTable",
|
|
@@ -1514,9 +1514,9 @@ function lt(t) {
|
|
|
1514
1514
|
})
|
|
1515
1515
|
);
|
|
1516
1516
|
}
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
function
|
|
1517
|
+
ct.prototype = Object.create(W.prototype);
|
|
1518
|
+
ct.prototype.constructor = ct;
|
|
1519
|
+
function ht(t) {
|
|
1520
1520
|
W.call(
|
|
1521
1521
|
this,
|
|
1522
1522
|
"featureListTable",
|
|
@@ -1531,9 +1531,9 @@ function ct(t) {
|
|
|
1531
1531
|
})
|
|
1532
1532
|
);
|
|
1533
1533
|
}
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
function
|
|
1534
|
+
ht.prototype = Object.create(W.prototype);
|
|
1535
|
+
ht.prototype.constructor = ht;
|
|
1536
|
+
function ft(t, e) {
|
|
1537
1537
|
W.call(this, "lookupListTable", Yt("lookup", t, function(r) {
|
|
1538
1538
|
var n = e[r.lookupType];
|
|
1539
1539
|
return E.assert(!!n, "Unable to write GSUB lookup type " + r.lookupType + " tables."), new W("lookupTable", [
|
|
@@ -1542,15 +1542,15 @@ function ht(t, e) {
|
|
|
1542
1542
|
].concat(Yt("subtable", r.subtables, n)));
|
|
1543
1543
|
}));
|
|
1544
1544
|
}
|
|
1545
|
-
|
|
1546
|
-
|
|
1545
|
+
ft.prototype = Object.create(W.prototype);
|
|
1546
|
+
ft.prototype.constructor = ft;
|
|
1547
1547
|
var k = {
|
|
1548
1548
|
Table: W,
|
|
1549
1549
|
Record: W,
|
|
1550
|
-
Coverage:
|
|
1551
|
-
ScriptList:
|
|
1552
|
-
FeatureList:
|
|
1553
|
-
LookupList:
|
|
1550
|
+
Coverage: lt,
|
|
1551
|
+
ScriptList: ct,
|
|
1552
|
+
FeatureList: ht,
|
|
1553
|
+
LookupList: ft,
|
|
1554
1554
|
ushortList: Ve,
|
|
1555
1555
|
tableList: Yt,
|
|
1556
1556
|
recordList: qe
|
|
@@ -1558,7 +1558,7 @@ var k = {
|
|
|
1558
1558
|
function Or(t, e) {
|
|
1559
1559
|
return t.getUint8(e);
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
1561
|
+
function pt(t, e) {
|
|
1562
1562
|
return t.getUint16(e, !1);
|
|
1563
1563
|
}
|
|
1564
1564
|
function Qa(t, e) {
|
|
@@ -1651,7 +1651,7 @@ v.prototype.parseLongDateTime = function() {
|
|
|
1651
1651
|
return t -= 2082844800, this.relativeOffset += 8, t;
|
|
1652
1652
|
};
|
|
1653
1653
|
v.prototype.parseVersion = function(t) {
|
|
1654
|
-
var e =
|
|
1654
|
+
var e = pt(this.data, this.offset + this.relativeOffset), r = pt(this.data, this.offset + this.relativeOffset + 2);
|
|
1655
1655
|
return this.relativeOffset += 4, t === void 0 && (t = 4096), e + r / t / 10;
|
|
1656
1656
|
};
|
|
1657
1657
|
v.prototype.skip = function(t, e) {
|
|
@@ -1891,8 +1891,8 @@ v.prototype.parseFeatureVariationsList = function() {
|
|
|
1891
1891
|
var F = {
|
|
1892
1892
|
getByte: Or,
|
|
1893
1893
|
getCard8: Or,
|
|
1894
|
-
getUShort:
|
|
1895
|
-
getCard16:
|
|
1894
|
+
getUShort: pt,
|
|
1895
|
+
getCard16: pt,
|
|
1896
1896
|
getShort: Qa,
|
|
1897
1897
|
getULong: rr,
|
|
1898
1898
|
getFixed: On,
|
|
@@ -2018,7 +2018,7 @@ function us(t) {
|
|
|
2018
2018
|
}
|
|
2019
2019
|
return s;
|
|
2020
2020
|
}
|
|
2021
|
-
var Un = { parse: ss, make: us },
|
|
2021
|
+
var Un = { parse: ss, make: us }, ot = [
|
|
2022
2022
|
".notdef",
|
|
2023
2023
|
"space",
|
|
2024
2024
|
"exclam",
|
|
@@ -3198,10 +3198,10 @@ function Rn(t) {
|
|
|
3198
3198
|
Rn.prototype.charToGlyphIndex = function(t) {
|
|
3199
3199
|
return this.cmap.glyphIndexMap[t.codePointAt(0)] || 0;
|
|
3200
3200
|
};
|
|
3201
|
-
function
|
|
3201
|
+
function dt(t, e) {
|
|
3202
3202
|
this.encoding = t, this.charset = e;
|
|
3203
3203
|
}
|
|
3204
|
-
|
|
3204
|
+
dt.prototype.charToGlyphIndex = function(t) {
|
|
3205
3205
|
var e = t.codePointAt(0), r = this.encoding[e];
|
|
3206
3206
|
return this.charset.indexOf(r);
|
|
3207
3207
|
};
|
|
@@ -3358,7 +3358,7 @@ ae.prototype.drawMetrics = function(t, e, r, n) {
|
|
|
3358
3358
|
var s = this.xMin || 0, i = this.yMin || 0, o = this.xMax || 0, u = this.yMax || 0, l = this.advanceWidth || 0;
|
|
3359
3359
|
t.strokeStyle = "blue", Ce.line(t, e + s * a, -1e4, e + s * a, 1e4), Ce.line(t, e + o * a, -1e4, e + o * a, 1e4), Ce.line(t, -1e4, r + -i * a, 1e4, r + -i * a), Ce.line(t, -1e4, r + -u * a, 1e4, r + -u * a), t.strokeStyle = "green", Ce.line(t, e + l * a, -1e4, e + l * a, 1e4);
|
|
3360
3360
|
};
|
|
3361
|
-
function
|
|
3361
|
+
function st(t, e, r) {
|
|
3362
3362
|
Object.defineProperty(t, e, {
|
|
3363
3363
|
get: function() {
|
|
3364
3364
|
return t.path, t[r];
|
|
@@ -3403,7 +3403,7 @@ function ys(t, e, r, n, a, s) {
|
|
|
3403
3403
|
r(i, n, a);
|
|
3404
3404
|
var o = s(t.glyphs, i);
|
|
3405
3405
|
return o.unitsPerEm = t.unitsPerEm, o;
|
|
3406
|
-
},
|
|
3406
|
+
}, st(i, "xMin", "_xMin"), st(i, "xMax", "_xMax"), st(i, "yMin", "_yMin"), st(i, "yMax", "_yMax"), i;
|
|
3407
3407
|
};
|
|
3408
3408
|
}
|
|
3409
3409
|
function ms(t, e, r, n) {
|
|
@@ -3514,7 +3514,7 @@ function Mn(t, e, r) {
|
|
|
3514
3514
|
return Ts(a);
|
|
3515
3515
|
}
|
|
3516
3516
|
function ze(t, e) {
|
|
3517
|
-
return e <= 390 ? e =
|
|
3517
|
+
return e <= 390 ? e = ot[e] : e = t[e - 391], e;
|
|
3518
3518
|
}
|
|
3519
3519
|
function Dn(t, e, r) {
|
|
3520
3520
|
for (var n = {}, a, s = 0; s < e.length; s += 1) {
|
|
@@ -3636,7 +3636,7 @@ function Es(t, e, r) {
|
|
|
3636
3636
|
a[p] = n, n += 1;
|
|
3637
3637
|
} else
|
|
3638
3638
|
throw new Error("Unknown encoding format " + i);
|
|
3639
|
-
return new
|
|
3639
|
+
return new dt(a, r);
|
|
3640
3640
|
}
|
|
3641
3641
|
function Rr(t, e, r) {
|
|
3642
3642
|
var n, a, s, i, o = new _(), u = [], l = 0, c = !1, f = !1, h = 0, p = 0, d, g, y, m;
|
|
@@ -3815,7 +3815,7 @@ function Us(t, e, r, n) {
|
|
|
3815
3815
|
var x;
|
|
3816
3816
|
n.lowMemory ? (x = xs(t, e + c.charStrings), r.nGlyphs = x.offsets.length) : (x = xe(t, e + c.charStrings), r.nGlyphs = x.objects.length);
|
|
3817
3817
|
var O = ws(t, e + c.charset, r.nGlyphs, o.objects);
|
|
3818
|
-
if (c.encoding === 0 ? r.cffEncoding = new
|
|
3818
|
+
if (c.encoding === 0 ? r.cffEncoding = new dt(ls, O) : c.encoding === 1 ? r.cffEncoding = new dt(cs, O) : r.cffEncoding = Es(t, e + c.encoding, O), r.encoding = r.encoding || r.cffEncoding, r.glyphs = new de.GlyphSet(r), n.lowMemory)
|
|
3819
3819
|
r._push = function(L) {
|
|
3820
3820
|
var w = bs(L, x.offsets, t, e + c.charStrings);
|
|
3821
3821
|
r.glyphs.push(L, de.cffGlyphLoader(r, L, Rr, w));
|
|
@@ -3827,8 +3827,8 @@ function Us(t, e, r, n) {
|
|
|
3827
3827
|
}
|
|
3828
3828
|
}
|
|
3829
3829
|
function Gn(t, e) {
|
|
3830
|
-
var r, n =
|
|
3831
|
-
return n >= 0 && (r = n), n = e.indexOf(t), n >= 0 ? r = n +
|
|
3830
|
+
var r, n = ot.indexOf(t);
|
|
3831
|
+
return n >= 0 && (r = n), n = e.indexOf(t), n >= 0 ? r = n + ot.length : (r = ot.length + e.length, e.push(t)), r;
|
|
3832
3832
|
}
|
|
3833
3833
|
function Ls() {
|
|
3834
3834
|
return new k.Record("Header", [
|
|
@@ -5681,9 +5681,9 @@ function di(t) {
|
|
|
5681
5681
|
fontBBox: [0, x.yMin, x.ascender, x.advanceWidthMax]
|
|
5682
5682
|
}), D = t.metas && Object.keys(t.metas).length > 0 ? $n.make(t.metas) : void 0, Y = [O, C, M, L, q, N, z, Z, w];
|
|
5683
5683
|
X && Y.push(X), t.tables.gsub && Y.push(Jn.make(t.tables.gsub)), D && Y.push(D);
|
|
5684
|
-
for (var mt = ea(Y), da = mt.encode(), va = sr(da), xt = mt.fields, pr = !1,
|
|
5685
|
-
if (xt[
|
|
5686
|
-
xt[
|
|
5684
|
+
for (var mt = ea(Y), da = mt.encode(), va = sr(da), xt = mt.fields, pr = !1, tt = 0; tt < xt.length; tt += 1)
|
|
5685
|
+
if (xt[tt].name === "head table") {
|
|
5686
|
+
xt[tt].value.checkSumAdjustment = 2981146554 - va, pr = !0;
|
|
5687
5687
|
break;
|
|
5688
5688
|
}
|
|
5689
5689
|
if (!pr)
|
|
@@ -6616,7 +6616,7 @@ Re = function(t) {
|
|
|
6616
6616
|
}
|
|
6617
6617
|
}
|
|
6618
6618
|
};
|
|
6619
|
-
function
|
|
6619
|
+
function gt(t) {
|
|
6620
6620
|
for (var e = t.tZone = new Array(t.gZone.length), r = 0; r < e.length; r++)
|
|
6621
6621
|
e[r] = new ge(0, 0);
|
|
6622
6622
|
}
|
|
@@ -6699,7 +6699,7 @@ function Gi(t) {
|
|
|
6699
6699
|
var e = t.stack.pop();
|
|
6700
6700
|
switch (exports.DEBUG && console.log(t.step, "SZP0[]", e), t.zp0 = e, e) {
|
|
6701
6701
|
case 0:
|
|
6702
|
-
t.tZone ||
|
|
6702
|
+
t.tZone || gt(t), t.z0 = t.tZone;
|
|
6703
6703
|
break;
|
|
6704
6704
|
case 1:
|
|
6705
6705
|
t.z0 = t.gZone;
|
|
@@ -6712,7 +6712,7 @@ function Ni(t) {
|
|
|
6712
6712
|
var e = t.stack.pop();
|
|
6713
6713
|
switch (exports.DEBUG && console.log(t.step, "SZP1[]", e), t.zp1 = e, e) {
|
|
6714
6714
|
case 0:
|
|
6715
|
-
t.tZone ||
|
|
6715
|
+
t.tZone || gt(t), t.z1 = t.tZone;
|
|
6716
6716
|
break;
|
|
6717
6717
|
case 1:
|
|
6718
6718
|
t.z1 = t.gZone;
|
|
@@ -6725,7 +6725,7 @@ function _i(t) {
|
|
|
6725
6725
|
var e = t.stack.pop();
|
|
6726
6726
|
switch (exports.DEBUG && console.log(t.step, "SZP2[]", e), t.zp2 = e, e) {
|
|
6727
6727
|
case 0:
|
|
6728
|
-
t.tZone ||
|
|
6728
|
+
t.tZone || gt(t), t.z2 = t.tZone;
|
|
6729
6729
|
break;
|
|
6730
6730
|
case 1:
|
|
6731
6731
|
t.z2 = t.gZone;
|
|
@@ -6738,7 +6738,7 @@ function Hi(t) {
|
|
|
6738
6738
|
var e = t.stack.pop();
|
|
6739
6739
|
switch (exports.DEBUG && console.log(t.step, "SZPS[]", e), t.zp0 = t.zp1 = t.zp2 = e, e) {
|
|
6740
6740
|
case 0:
|
|
6741
|
-
t.tZone ||
|
|
6741
|
+
t.tZone || gt(t), t.z0 = t.z1 = t.z2 = t.tZone;
|
|
6742
6742
|
break;
|
|
6743
6743
|
case 1:
|
|
6744
6744
|
t.z0 = t.z1 = t.z2 = t.gZone;
|
|
@@ -7084,7 +7084,7 @@ function No(t) {
|
|
|
7084
7084
|
var e = t.stack, r = e.pop();
|
|
7085
7085
|
exports.DEBUG && console.log(t.step, "CEILING[]", r), e.push(Math.ceil(r / 64) * 64);
|
|
7086
7086
|
}
|
|
7087
|
-
function
|
|
7087
|
+
function it(t, e) {
|
|
7088
7088
|
var r = e.stack, n = r.pop();
|
|
7089
7089
|
exports.DEBUG && console.log(e.step, "ROUND[]"), r.push(e.round(n / 64) * 64);
|
|
7090
7090
|
}
|
|
@@ -7476,13 +7476,13 @@ sa = [
|
|
|
7476
7476
|
/* 0x67 */
|
|
7477
7477
|
No,
|
|
7478
7478
|
/* 0x68 */
|
|
7479
|
-
|
|
7479
|
+
it.bind(void 0, 0),
|
|
7480
7480
|
/* 0x69 */
|
|
7481
|
-
|
|
7481
|
+
it.bind(void 0, 1),
|
|
7482
7482
|
/* 0x6A */
|
|
7483
|
-
|
|
7483
|
+
it.bind(void 0, 2),
|
|
7484
7484
|
/* 0x6B */
|
|
7485
|
-
|
|
7485
|
+
it.bind(void 0, 3),
|
|
7486
7486
|
/* 0x6C */
|
|
7487
7487
|
void 0,
|
|
7488
7488
|
// TODO NROUND[ab]
|
|
@@ -7804,7 +7804,7 @@ function $o(t, e, r) {
|
|
|
7804
7804
|
function oe(t, e) {
|
|
7805
7805
|
this.context = t, this.index = e, this.length = t.length, this.current = t[e], this.backtrack = t.slice(0, e), this.lookahead = t.slice(e + 1);
|
|
7806
7806
|
}
|
|
7807
|
-
function
|
|
7807
|
+
function yt(t) {
|
|
7808
7808
|
this.eventId = t, this.subscribers = [];
|
|
7809
7809
|
}
|
|
7810
7810
|
function eu(t) {
|
|
@@ -7825,7 +7825,7 @@ function eu(t) {
|
|
|
7825
7825
|
];
|
|
7826
7826
|
r.forEach(function(a) {
|
|
7827
7827
|
Object.defineProperty(e.events, a, {
|
|
7828
|
-
value: new
|
|
7828
|
+
value: new yt(a)
|
|
7829
7829
|
});
|
|
7830
7830
|
}), t && r.forEach(function(a) {
|
|
7831
7831
|
var s = t[a];
|
|
@@ -7925,10 +7925,10 @@ B.prototype.registerModifier = function(t, e, r) {
|
|
|
7925
7925
|
}
|
|
7926
7926
|
}), this.registeredModifiers.push(t);
|
|
7927
7927
|
};
|
|
7928
|
-
|
|
7928
|
+
yt.prototype.subscribe = function(t) {
|
|
7929
7929
|
return typeof t == "function" ? this.subscribers.push(t) - 1 : { FAIL: "invalid '" + this.eventId + "' event handler" };
|
|
7930
7930
|
};
|
|
7931
|
-
|
|
7931
|
+
yt.prototype.unsubscribe = function(t) {
|
|
7932
7932
|
this.subscribers.splice(t, 1);
|
|
7933
7933
|
};
|
|
7934
7934
|
oe.prototype.setCurrentIndex = function(t) {
|
|
@@ -7967,7 +7967,7 @@ B.prototype.on = function(t, e) {
|
|
|
7967
7967
|
};
|
|
7968
7968
|
B.prototype.dispatch = function(t, e) {
|
|
7969
7969
|
var r = this, n = this.events[t];
|
|
7970
|
-
n instanceof
|
|
7970
|
+
n instanceof yt && n.subscribers.forEach(function(a) {
|
|
7971
7971
|
a.apply(r, e || []);
|
|
7972
7972
|
});
|
|
7973
7973
|
};
|
|
@@ -8054,7 +8054,7 @@ function ha(t) {
|
|
|
8054
8054
|
function Te(t) {
|
|
8055
8055
|
return /[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(t);
|
|
8056
8056
|
}
|
|
8057
|
-
function
|
|
8057
|
+
function ut(t) {
|
|
8058
8058
|
return /[A-z]/.test(t);
|
|
8059
8059
|
}
|
|
8060
8060
|
function tu(t) {
|
|
@@ -8519,8 +8519,8 @@ function Su(t) {
|
|
|
8519
8519
|
var e = t.current, r = t.get(-1);
|
|
8520
8520
|
return (
|
|
8521
8521
|
// ? latin first char
|
|
8522
|
-
r === null &&
|
|
8523
|
-
!
|
|
8522
|
+
r === null && ut(e) || // ? latin char preceded with a non latin char
|
|
8523
|
+
!ut(r) && ut(e)
|
|
8524
8524
|
);
|
|
8525
8525
|
}
|
|
8526
8526
|
function ku(t) {
|
|
@@ -8528,7 +8528,7 @@ function ku(t) {
|
|
|
8528
8528
|
return (
|
|
8529
8529
|
// ? last latin char
|
|
8530
8530
|
e === null || // ? next char is not latin
|
|
8531
|
-
!
|
|
8531
|
+
!ut(e)
|
|
8532
8532
|
);
|
|
8533
8533
|
}
|
|
8534
8534
|
var Tu = {
|
|
@@ -9565,7 +9565,7 @@ let Q = class {
|
|
|
9565
9565
|
}
|
|
9566
9566
|
};
|
|
9567
9567
|
var $ = /* @__PURE__ */ ((t) => (t.SHAPES = "shapes", t.BIGFONT = "bigfont", t.UNIFONT = "unifont", t))($ || {});
|
|
9568
|
-
|
|
9568
|
+
let nl = class {
|
|
9569
9569
|
parse(e) {
|
|
9570
9570
|
const r = this.parseHeader(e).split(" "), n = r[1].toLocaleLowerCase();
|
|
9571
9571
|
if (!Object.values($).includes(n))
|
|
@@ -9591,7 +9591,7 @@ class nl {
|
|
|
9591
9591
|
}
|
|
9592
9592
|
return r.trim();
|
|
9593
9593
|
}
|
|
9594
|
-
}
|
|
9594
|
+
};
|
|
9595
9595
|
class al {
|
|
9596
9596
|
parse(e) {
|
|
9597
9597
|
try {
|
|
@@ -10769,7 +10769,7 @@ class Ue {
|
|
|
10769
10769
|
this.fontMap.clear();
|
|
10770
10770
|
}
|
|
10771
10771
|
}
|
|
10772
|
-
class
|
|
10772
|
+
class Cl {
|
|
10773
10773
|
/**
|
|
10774
10774
|
* Creates a new instance of DefaultFontLoader
|
|
10775
10775
|
*/
|
|
@@ -10923,7 +10923,7 @@ class gl {
|
|
|
10923
10923
|
*/
|
|
10924
10924
|
constructor(e, r, n = {}) {
|
|
10925
10925
|
this.continueStroke = !1, this.inStackContext = !1, this.scanner = new Mt(e);
|
|
10926
|
-
const a = r ?? new
|
|
10926
|
+
const a = r ?? new et();
|
|
10927
10927
|
this.ctxStack = new vl(a), this.yieldPropertyCommands = n.yieldPropertyCommands ?? !1, this.resetParagraphParameters = n.resetParagraphParameters ?? !1;
|
|
10928
10928
|
}
|
|
10929
10929
|
/**
|
|
@@ -11067,7 +11067,7 @@ class gl {
|
|
|
11067
11067
|
const n = {};
|
|
11068
11068
|
if (e.underline !== r.underline && (n.underline = r.underline), e.overline !== r.overline && (n.overline = r.overline), e.strikeThrough !== r.strikeThrough && (n.strikeThrough = r.strikeThrough), e.color.aci !== r.color.aci && (n.aci = r.color.aci), e.color.rgbValue !== r.color.rgbValue && (n.rgb = r.color.rgb), e.align !== r.align && (n.align = r.align), JSON.stringify(e.fontFace) !== JSON.stringify(r.fontFace) && (n.fontFace = r.fontFace), (e.capHeight.value !== r.capHeight.value || e.capHeight.isRelative !== r.capHeight.isRelative) && (n.capHeight = r.capHeight), (e.widthFactor.value !== r.widthFactor.value || e.widthFactor.isRelative !== r.widthFactor.isRelative) && (n.widthFactor = r.widthFactor), (e.charTrackingFactor.value !== r.charTrackingFactor.value || e.charTrackingFactor.isRelative !== r.charTrackingFactor.isRelative) && (n.charTrackingFactor = r.charTrackingFactor), e.oblique !== r.oblique && (n.oblique = r.oblique), JSON.stringify(e.paragraph) !== JSON.stringify(r.paragraph)) {
|
|
11069
11069
|
const a = {};
|
|
11070
|
-
e.paragraph.indent !== r.paragraph.indent && (a.indent = r.paragraph.indent), e.paragraph.align !== r.paragraph.align && (a.align = r.paragraph.align), e.paragraph.left !== r.paragraph.left && (a.left = r.paragraph.left), e.paragraph.right !== r.paragraph.right && (a.right = r.paragraph.right), JSON.stringify(e.paragraph.
|
|
11070
|
+
e.paragraph.indent !== r.paragraph.indent && (a.indent = r.paragraph.indent), e.paragraph.align !== r.paragraph.align && (a.align = r.paragraph.align), e.paragraph.left !== r.paragraph.left && (a.left = r.paragraph.left), e.paragraph.right !== r.paragraph.right && (a.right = r.paragraph.right), JSON.stringify(e.paragraph.tabs) !== JSON.stringify(r.paragraph.tabs) && (a.tabs = r.paragraph.tabs), Object.keys(a).length > 0 && (n.paragraph = a);
|
|
11071
11071
|
}
|
|
11072
11072
|
return n;
|
|
11073
11073
|
}
|
|
@@ -11302,7 +11302,7 @@ class gl {
|
|
|
11302
11302
|
left: a,
|
|
11303
11303
|
right: s,
|
|
11304
11304
|
align: i,
|
|
11305
|
-
|
|
11305
|
+
tabs: o
|
|
11306
11306
|
};
|
|
11307
11307
|
}
|
|
11308
11308
|
/**
|
|
@@ -11324,10 +11324,10 @@ class gl {
|
|
|
11324
11324
|
left: 0,
|
|
11325
11325
|
right: 0,
|
|
11326
11326
|
align: 0,
|
|
11327
|
-
|
|
11327
|
+
tabs: []
|
|
11328
11328
|
};
|
|
11329
11329
|
const i = {};
|
|
11330
|
-
return s.indent !== 0 && (i.indent = 0), s.left !== 0 && (i.left = 0), s.right !== 0 && (i.right = 0), s.align !== 0 && (i.align = 0), JSON.stringify(s.
|
|
11330
|
+
return s.indent !== 0 && (i.indent = 0), s.left !== 0 && (i.left = 0), s.right !== 0 && (i.right = 0), s.align !== 0 && (i.align = 0), JSON.stringify(s.tabs) !== JSON.stringify([]) && (i.tabs = []), i;
|
|
11331
11331
|
}
|
|
11332
11332
|
const n = () => {
|
|
11333
11333
|
var a;
|
|
@@ -11458,15 +11458,11 @@ class gl {
|
|
|
11458
11458
|
if (a) {
|
|
11459
11459
|
if (yield new Dt(a, this.ctxStack.current.copy(), s), a === 6 && this.resetParagraphParameters) {
|
|
11460
11460
|
const i = this.ctxStack.current, o = r(i);
|
|
11461
|
-
this.yieldPropertyCommands && Object.keys(o).length > 0 && (yield new Dt(
|
|
11462
|
-
|
|
11463
|
-
|
|
11464
|
-
|
|
11465
|
-
|
|
11466
|
-
changes: { paragraph: o },
|
|
11467
|
-
depth: this.ctxStack.depth
|
|
11468
|
-
}
|
|
11469
|
-
));
|
|
11461
|
+
this.yieldPropertyCommands && Object.keys(o).length > 0 && (yield new Dt(9, i.copy(), {
|
|
11462
|
+
command: void 0,
|
|
11463
|
+
changes: { paragraph: o },
|
|
11464
|
+
depth: this.ctxStack.depth
|
|
11465
|
+
}));
|
|
11470
11466
|
}
|
|
11471
11467
|
e && (yield new Dt(e, this.ctxStack.current.copy(), null), e = null);
|
|
11472
11468
|
} else
|
|
@@ -11669,14 +11665,14 @@ class hr {
|
|
|
11669
11665
|
return this._aci === e._aci && this._rgbValue === e._rgbValue;
|
|
11670
11666
|
}
|
|
11671
11667
|
}
|
|
11672
|
-
class
|
|
11668
|
+
class et {
|
|
11673
11669
|
constructor() {
|
|
11674
11670
|
this._stroke = 0, this.continueStroke = !1, this.color = new hr(), this.align = 0, 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 = {
|
|
11675
11671
|
indent: 0,
|
|
11676
11672
|
left: 0,
|
|
11677
11673
|
right: 0,
|
|
11678
11674
|
align: 0,
|
|
11679
|
-
|
|
11675
|
+
tabs: []
|
|
11680
11676
|
};
|
|
11681
11677
|
}
|
|
11682
11678
|
/**
|
|
@@ -11753,6 +11749,36 @@ class yt {
|
|
|
11753
11749
|
set rgb(e) {
|
|
11754
11750
|
this.color.rgb = e;
|
|
11755
11751
|
}
|
|
11752
|
+
/**
|
|
11753
|
+
* Gets whether the current text should be rendered in italic style.
|
|
11754
|
+
* @returns {boolean} True if the font style is 'Italic', otherwise false.
|
|
11755
|
+
*/
|
|
11756
|
+
get italic() {
|
|
11757
|
+
return this.fontFace.style === "Italic";
|
|
11758
|
+
}
|
|
11759
|
+
/**
|
|
11760
|
+
* Sets whether the current text should be rendered in italic style.
|
|
11761
|
+
* @param value - If true, sets the font style to 'Italic'; if false, sets it to 'Regular'.
|
|
11762
|
+
*/
|
|
11763
|
+
set italic(e) {
|
|
11764
|
+
this.fontFace.style = e ? "Italic" : "Regular";
|
|
11765
|
+
}
|
|
11766
|
+
/**
|
|
11767
|
+
* Gets whether the current text should be rendered in bold style.
|
|
11768
|
+
* This is primarily used for mesh fonts and affects font selection.
|
|
11769
|
+
* @returns {boolean} True if the font weight is 700 or higher, otherwise false.
|
|
11770
|
+
*/
|
|
11771
|
+
get bold() {
|
|
11772
|
+
return (this.fontFace.weight || 400) >= 700;
|
|
11773
|
+
}
|
|
11774
|
+
/**
|
|
11775
|
+
* Sets whether the current text should be rendered in bold style.
|
|
11776
|
+
* This is primarily used for mesh fonts and affects font selection.
|
|
11777
|
+
* @param value - If true, sets the font weight to 700; if false, sets it to 400.
|
|
11778
|
+
*/
|
|
11779
|
+
set bold(e) {
|
|
11780
|
+
this.fontFace.weight = e ? 700 : 400;
|
|
11781
|
+
}
|
|
11756
11782
|
/**
|
|
11757
11783
|
* Get whether text is underlined
|
|
11758
11784
|
*/
|
|
@@ -11811,7 +11837,7 @@ class yt {
|
|
|
11811
11837
|
* @returns A new context with the same properties
|
|
11812
11838
|
*/
|
|
11813
11839
|
copy() {
|
|
11814
|
-
const e = new
|
|
11840
|
+
const e = new et();
|
|
11815
11841
|
return e._stroke = this._stroke, e.continueStroke = this.continueStroke, e.color = this.color.copy(), e.align = this.align, e.fontFace = { ...this.fontFace }, e._capHeight = { ...this._capHeight }, e._widthFactor = { ...this._widthFactor }, e._charTrackingFactor = { ...this._charTrackingFactor }, e.oblique = this.oblique, e.paragraph = { ...this.paragraph }, e;
|
|
11816
11842
|
}
|
|
11817
11843
|
}
|
|
@@ -11924,21 +11950,37 @@ function pn(t) {
|
|
|
11924
11950
|
return a !== void 0 && (o.gpuType = a), o;
|
|
11925
11951
|
}
|
|
11926
11952
|
const yl = /* @__PURE__ */ new R.Vector3(), ml = 1.666666;
|
|
11927
|
-
class fr {
|
|
11953
|
+
class fr extends et {
|
|
11928
11954
|
/**
|
|
11929
|
-
* Creates a new
|
|
11955
|
+
* Creates a new RenderContext instance with optional initial values.
|
|
11930
11956
|
* @param init - Partial object containing initial values for context properties
|
|
11931
11957
|
*/
|
|
11932
11958
|
constructor(e) {
|
|
11933
|
-
|
|
11959
|
+
super(), this.fontScaleFactor = 1, this.fontSize = 1, this.fontSizeScaleFactor = 1, this.blankWidth = 0, e && Object.assign(this, e);
|
|
11934
11960
|
}
|
|
11935
11961
|
/**
|
|
11936
11962
|
* Creates a deep copy of the current context.
|
|
11937
11963
|
* This is useful for saving state before applying formatting changes.
|
|
11938
|
-
* @returns A new
|
|
11964
|
+
* @returns A new RenderContext instance with identical property values
|
|
11939
11965
|
*/
|
|
11940
11966
|
clone() {
|
|
11941
|
-
|
|
11967
|
+
const e = new fr();
|
|
11968
|
+
return e.continueStroke = this.continueStroke, e.color = this.color.copy(), e.align = this.align, e.fontFace = { ...this.fontFace }, e.capHeight = { ...this.capHeight }, e.widthFactor = { ...this.widthFactor }, e.charTrackingFactor = { ...this.charTrackingFactor }, e.oblique = this.oblique, e.paragraph = { ...this.paragraph }, e.fontScaleFactor = this.fontScaleFactor, e.fontSize = this.fontSize, e.fontSizeScaleFactor = this.fontSizeScaleFactor, e.blankWidth = this.blankWidth, e;
|
|
11969
|
+
}
|
|
11970
|
+
/**
|
|
11971
|
+
* Get the current text color as a hexadecimal value for rendering.
|
|
11972
|
+
* @returns The color as a hex number (0xRRGGBB)
|
|
11973
|
+
*/
|
|
11974
|
+
getColorAsHex() {
|
|
11975
|
+
return this.color.isRgb && this.color.rgbValue !== null ? this.color.rgbValue : this.color.isAci && this.color.aci !== null ? Da(this.color.aci) : 16777215;
|
|
11976
|
+
}
|
|
11977
|
+
/**
|
|
11978
|
+
* Set the color using a hex value for rendering purposes.
|
|
11979
|
+
* @param hexColor - The color as a hex number (0xRRGGBB)
|
|
11980
|
+
*/
|
|
11981
|
+
setColorFromHex(e) {
|
|
11982
|
+
const r = e >> 16 & 255, n = e >> 8 & 255, a = e & 255;
|
|
11983
|
+
this.color.rgb = [r, n, a];
|
|
11942
11984
|
}
|
|
11943
11985
|
}
|
|
11944
11986
|
class xl {
|
|
@@ -11951,24 +11993,16 @@ class xl {
|
|
|
11951
11993
|
*/
|
|
11952
11994
|
constructor(e, r, n, a) {
|
|
11953
11995
|
this._contextStack = [], this._maxFontSize = 0, this._currentIndent = 0, this._currentLeftMargin = 0, this._currentRightMargin = 0, this._style = e, this._styleManager = r, this._fontManager = n, this._options = a, this._totalHeight = 0, this._hOffset = 0, this._vOffset = 0, this._lineCount = 1, this._currentLineObjects = [], this._currentContext = new fr({
|
|
11954
|
-
font: this.textStyle.font.toLowerCase(),
|
|
11955
11996
|
fontScaleFactor: this.fontManager.getFontScaleFactor(this.textStyle.font.toLowerCase()),
|
|
11956
11997
|
fontSize: a.fontSize,
|
|
11957
11998
|
fontSizeScaleFactor: 1,
|
|
11958
|
-
color: a.byLayerColor,
|
|
11959
|
-
underline: !1,
|
|
11960
|
-
overline: !1,
|
|
11961
|
-
strikeThrough: !1,
|
|
11962
|
-
obliqueAngle: e.obliqueAngle || 0,
|
|
11963
11999
|
italic: !1,
|
|
11964
12000
|
bold: !1,
|
|
11965
|
-
widthFactor: a.widthFactor,
|
|
11966
|
-
wordSpace: 1,
|
|
11967
12001
|
blankWidth: this.calculateBlankWidthForFont(
|
|
11968
12002
|
this.textStyle.font.toLowerCase(),
|
|
11969
12003
|
a.fontSize
|
|
11970
12004
|
)
|
|
11971
|
-
}), this._maxFontSize = 0, this._currentHorizontalAlignment = a.horizontalAlignment, this._currentIndent = 0, this._currentLeftMargin = 0, this._currentRightMargin = 0, this.initLineParams();
|
|
12005
|
+
}), this._currentContext.setColorFromHex(e.color), this._currentContext.fontFace.family = this.textStyle.font.toLowerCase(), this._currentContext.widthFactor = { value: a.widthFactor, isRelative: !0 }, this._currentContext.oblique = e.obliqueAngle || 0, this._maxFontSize = 0, this._currentHorizontalAlignment = a.horizontalAlignment, this._currentIndent = 0, this._currentLeftMargin = 0, this._currentRightMargin = 0, this.initLineParams();
|
|
11972
12006
|
}
|
|
11973
12007
|
get fontManager() {
|
|
11974
12008
|
return this._fontManager;
|
|
@@ -12025,7 +12059,7 @@ class xl {
|
|
|
12025
12059
|
* Font name of current character
|
|
12026
12060
|
*/
|
|
12027
12061
|
get currentFont() {
|
|
12028
|
-
return this._currentContext.
|
|
12062
|
+
return this._currentContext.fontFace.family;
|
|
12029
12063
|
}
|
|
12030
12064
|
/**
|
|
12031
12065
|
* The current horizontal alignment of one text line
|
|
@@ -12060,13 +12094,13 @@ class xl {
|
|
|
12060
12094
|
* - 0.8: decreases spacing by 20% of the text height
|
|
12061
12095
|
*/
|
|
12062
12096
|
get currentWordSpace() {
|
|
12063
|
-
return this._currentContext.
|
|
12097
|
+
return this._currentContext.charTrackingFactor.value;
|
|
12064
12098
|
}
|
|
12065
12099
|
/**
|
|
12066
12100
|
* The current scale factor of character width
|
|
12067
12101
|
*/
|
|
12068
12102
|
get currentWidthFactor() {
|
|
12069
|
-
return this._currentContext.widthFactor;
|
|
12103
|
+
return this._currentContext.widthFactor.value;
|
|
12070
12104
|
}
|
|
12071
12105
|
/**
|
|
12072
12106
|
* All of THREE.js objects in current line. It contains objects in all of sections of this line.
|
|
@@ -12113,21 +12147,33 @@ class xl {
|
|
|
12113
12147
|
case "f":
|
|
12114
12148
|
case "F":
|
|
12115
12149
|
if (e.changes.fontFace) {
|
|
12116
|
-
this.changeFont(e.changes.fontFace.family), this.fontManager.getFontType(this._currentContext.
|
|
12150
|
+
this.changeFont(e.changes.fontFace.family), this.fontManager.getFontType(this._currentContext.fontFace.family) === "mesh" ? (this._currentContext.italic = e.changes.fontFace.style === "Italic", this._currentContext.bold = (e.changes.fontFace.weight || 400) >= 700, this._currentContext.oblique = this.textStyle.obliqueAngle || 0) : (this._currentContext.italic = !1, this._currentContext.bold = !1, e.changes.fontFace.style === "Italic" ? this._currentContext.oblique = 15 : this._currentContext.oblique = this.textStyle.obliqueAngle || 0);
|
|
12117
12151
|
break;
|
|
12118
12152
|
}
|
|
12119
12153
|
case "c":
|
|
12120
12154
|
case "C":
|
|
12121
|
-
e.changes.aci ? e.changes.aci === 0 ? this._currentContext.
|
|
12155
|
+
e.changes.aci ? e.changes.aci === 0 ? this._currentContext.setColorFromHex(this._options.byBlockColor) : e.changes.aci === 256 ? this._currentContext.setColorFromHex(this._options.byLayerColor) : this._currentContext.color.aci = e.changes.aci : e.changes.rgb && (this._currentContext.color.rgb = e.changes.rgb);
|
|
12122
12156
|
break;
|
|
12123
12157
|
case "W":
|
|
12124
|
-
e.changes.widthFactor && (e.changes.widthFactor.isRelative ? this._currentContext.widthFactor =
|
|
12158
|
+
e.changes.widthFactor && (e.changes.widthFactor.isRelative ? this._currentContext.widthFactor = {
|
|
12159
|
+
value: e.changes.widthFactor.value * this.maxWidth,
|
|
12160
|
+
isRelative: !1
|
|
12161
|
+
} : this._currentContext.widthFactor = {
|
|
12162
|
+
value: e.changes.widthFactor.value * 0.93,
|
|
12163
|
+
isRelative: !1
|
|
12164
|
+
});
|
|
12125
12165
|
break;
|
|
12126
12166
|
case "H":
|
|
12127
12167
|
e.changes.capHeight && (e.changes.capHeight.isRelative ? this.changeFontSizeScaleFactor(e.changes.capHeight.value) : this.changeFontHeight(e.changes.capHeight.value));
|
|
12128
12168
|
break;
|
|
12129
12169
|
case "T":
|
|
12130
|
-
e.changes.charTrackingFactor && (e.changes.charTrackingFactor.isRelative ? this._currentContext.
|
|
12170
|
+
e.changes.charTrackingFactor && (e.changes.charTrackingFactor.isRelative ? this._currentContext.charTrackingFactor = {
|
|
12171
|
+
value: e.changes.charTrackingFactor.value + 1,
|
|
12172
|
+
isRelative: !1
|
|
12173
|
+
} : this._currentContext.charTrackingFactor = {
|
|
12174
|
+
value: e.changes.charTrackingFactor.value,
|
|
12175
|
+
isRelative: !1
|
|
12176
|
+
});
|
|
12131
12177
|
break;
|
|
12132
12178
|
case "p":
|
|
12133
12179
|
e.changes.paragraph && (e.changes.paragraph.align && (this._currentHorizontalAlignment = e.changes.paragraph.align), typeof e.changes.paragraph.indent == "number" && (this._currentIndent = e.changes.paragraph.indent * this.defaultFontSize, this._hOffset += this._currentIndent), typeof e.changes.paragraph.left == "number" && (this._currentLeftMargin = e.changes.paragraph.left * this.defaultFontSize), typeof e.changes.paragraph.right == "number" && (this._currentRightMargin = e.changes.paragraph.right * this.defaultFontSize));
|
|
@@ -12151,7 +12197,7 @@ class xl {
|
|
|
12151
12197
|
this._currentContext.strikeThrough = !1;
|
|
12152
12198
|
break;
|
|
12153
12199
|
case "Q":
|
|
12154
|
-
e.changes.oblique !== void 0 && (this._currentContext.
|
|
12200
|
+
e.changes.oblique !== void 0 && (this._currentContext.oblique = e.changes.oblique);
|
|
12155
12201
|
break;
|
|
12156
12202
|
}
|
|
12157
12203
|
}
|
|
@@ -12209,8 +12255,8 @@ class xl {
|
|
|
12209
12255
|
this.processChar(e[s], r, n);
|
|
12210
12256
|
}
|
|
12211
12257
|
processStack(e, r, n) {
|
|
12212
|
-
const [a, s, i] = e, o = this._hOffset, u = this._vOffset, l = this._currentContext.
|
|
12213
|
-
this._hOffset = o, this._currentContext.
|
|
12258
|
+
const [a, s, i] = e, o = this._hOffset, u = this._vOffset, l = this._currentContext.charTrackingFactor.value, c = this._currentContext.fontSize, f = this._currentContext.fontSizeScaleFactor;
|
|
12259
|
+
this._hOffset = o, this._currentContext.charTrackingFactor = { value: 1, isRelative: !1 };
|
|
12214
12260
|
let h = 0;
|
|
12215
12261
|
for (let m = 0; m < a.length; m++) {
|
|
12216
12262
|
const S = this.getCharShape(a[m]);
|
|
@@ -12261,7 +12307,7 @@ class xl {
|
|
|
12261
12307
|
}
|
|
12262
12308
|
this._hOffset = o + d;
|
|
12263
12309
|
}
|
|
12264
|
-
this._vOffset = u, this._currentContext.
|
|
12310
|
+
this._vOffset = u, this._currentContext.charTrackingFactor = { value: l, isRelative: !1 };
|
|
12265
12311
|
}
|
|
12266
12312
|
processBlank() {
|
|
12267
12313
|
this._hOffset += this._currentContext.blankWidth;
|
|
@@ -12274,7 +12320,7 @@ class xl {
|
|
|
12274
12320
|
}
|
|
12275
12321
|
let s = a.toGeometry();
|
|
12276
12322
|
s.scale(this.currentWidthFactor, 1, 1);
|
|
12277
|
-
let i = this._currentContext.
|
|
12323
|
+
let i = this._currentContext.oblique;
|
|
12278
12324
|
if (this._currentContext.italic && (i += 15), i) {
|
|
12279
12325
|
const d = i * Math.PI / 180, g = new R.Matrix4();
|
|
12280
12326
|
g.set(1, Math.tan(d), 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), s.applyMatrix4(g);
|
|
@@ -12323,8 +12369,8 @@ class xl {
|
|
|
12323
12369
|
}
|
|
12324
12370
|
changeFont(e) {
|
|
12325
12371
|
let r = e;
|
|
12326
|
-
this._options.removeFontExtension && (r = e.replace(/\.(ttf|otf|woff|shx)$/, "")), this._currentContext.
|
|
12327
|
-
this._currentContext.
|
|
12372
|
+
this._options.removeFontExtension && (r = e.replace(/\.(ttf|otf|woff|shx)$/, "")), this._currentContext.fontFace.family = this.fontManager.findAndReplaceFont(r), this._currentContext.blankWidth = this.calculateBlankWidthForFont(
|
|
12373
|
+
this._currentContext.fontFace.family,
|
|
12328
12374
|
this._currentContext.fontSize
|
|
12329
12375
|
), this.calcuateLineParams();
|
|
12330
12376
|
}
|
|
@@ -12411,7 +12457,7 @@ class xl {
|
|
|
12411
12457
|
* @returns Return three.js object created from the specified text shape geometries
|
|
12412
12458
|
*/
|
|
12413
12459
|
toThreeObject(e, r) {
|
|
12414
|
-
const n = new R.Group(), a = this._currentContext.
|
|
12460
|
+
const n = new R.Group(), a = this._currentContext.getColorAsHex(), s = e.filter((o) => o instanceof R.ExtrudeGeometry);
|
|
12415
12461
|
if (s.length > 0) {
|
|
12416
12462
|
const o = new R.Mesh();
|
|
12417
12463
|
o.geometry = fn(s), o.material = this.styleManager.getMeshBasicMaterial(a), o.userData.bboxIntersectionCheck = !0, n.add(o);
|
|
@@ -12434,7 +12480,7 @@ class xl {
|
|
|
12434
12480
|
}
|
|
12435
12481
|
}
|
|
12436
12482
|
const Bt = /* @__PURE__ */ new R.Vector3(), we = /* @__PURE__ */ new R.Vector3(), Pt = /* @__PURE__ */ new R.Vector3(), It = /* @__PURE__ */ new R.Quaternion(), Gt = /* @__PURE__ */ new R.Matrix4(), dn = /* @__PURE__ */ new R.Matrix4(), vn = /* @__PURE__ */ new R.Vector3(1, 0, 0);
|
|
12437
|
-
class
|
|
12483
|
+
class wl extends R.Object3D {
|
|
12438
12484
|
/**
|
|
12439
12485
|
* Extracts all unique font names used in an MText string.
|
|
12440
12486
|
* This function searches for font commands in the format \f{fontname}| or \f{fontname}; and returns a set of unique font names.
|
|
@@ -12577,7 +12623,7 @@ class Cl extends R.Object3D {
|
|
|
12577
12623
|
byBlockColor: this._colorSettings.byBlockColor,
|
|
12578
12624
|
byLayerColor: this._colorSettings.byLayerColor,
|
|
12579
12625
|
removeFontExtension: !0
|
|
12580
|
-
}, c = new
|
|
12626
|
+
}, c = new et();
|
|
12581
12627
|
c.fontFace.family = r.font, c.capHeight = { value: e.height || 1, isRelative: !0 }, c.widthFactor = { value: e.widthFactor ?? 1, isRelative: !0 }, c.align = s, c.paragraph.align = a;
|
|
12582
12628
|
const f = new xl(
|
|
12583
12629
|
r,
|
|
@@ -12652,7 +12698,7 @@ class Cl extends R.Object3D {
|
|
|
12652
12698
|
this.getBoxes(n[a], r);
|
|
12653
12699
|
}
|
|
12654
12700
|
}
|
|
12655
|
-
class
|
|
12701
|
+
class El {
|
|
12656
12702
|
constructor() {
|
|
12657
12703
|
this.lineBasicMaterials = {}, this.meshBasicMaterials = {}, this.unsupportedTextStyles = {};
|
|
12658
12704
|
}
|
|
@@ -12670,12 +12716,12 @@ class wl {
|
|
|
12670
12716
|
export {
|
|
12671
12717
|
gn as BaseFont,
|
|
12672
12718
|
yn as BaseTextShape,
|
|
12673
|
-
|
|
12719
|
+
Cl as DefaultFontLoader,
|
|
12674
12720
|
dr as EventManager,
|
|
12675
12721
|
Se as FontFactory,
|
|
12676
12722
|
Ue as FontManager,
|
|
12677
|
-
|
|
12723
|
+
wl as MText,
|
|
12678
12724
|
hl as MTextAttachmentPoint,
|
|
12679
12725
|
Ze as MTextFlowDirection,
|
|
12680
|
-
|
|
12726
|
+
El as StyleManager
|
|
12681
12727
|
};
|