@mlightcad/mtext-renderer 0.8.1 → 0.8.3
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 +109 -113
- package/dist/index.umd.cjs +4 -4
- package/dist/mtext-renderer-worker.js +129 -133
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -10080,8 +10080,8 @@ class Ih {
|
|
|
10080
10080
|
return r.trim();
|
|
10081
10081
|
}
|
|
10082
10082
|
}
|
|
10083
|
-
const be = 10;
|
|
10084
|
-
class
|
|
10083
|
+
const be = 10, Dh = [13, 10, 0];
|
|
10084
|
+
class _h {
|
|
10085
10085
|
parse(e) {
|
|
10086
10086
|
try {
|
|
10087
10087
|
e.readBytes(4);
|
|
@@ -10097,11 +10097,7 @@ class Dh {
|
|
|
10097
10097
|
for (const s of n)
|
|
10098
10098
|
try {
|
|
10099
10099
|
const o = e.readBytes(s.length);
|
|
10100
|
-
|
|
10101
|
-
const c = o.indexOf(0);
|
|
10102
|
-
let u = 0;
|
|
10103
|
-
c >= 0 && c < o.length && (u = c + 1), u < o.length && (a[s.code] = o.subarray(u));
|
|
10104
|
-
}
|
|
10100
|
+
o.length === s.length && (a[s.code] = o);
|
|
10105
10101
|
} catch {
|
|
10106
10102
|
console.warn(`Failed to read shape data for code ${s.code}`);
|
|
10107
10103
|
}
|
|
@@ -10119,7 +10115,7 @@ class Dh {
|
|
|
10119
10115
|
const s = a[0];
|
|
10120
10116
|
try {
|
|
10121
10117
|
const o = new TextDecoder().decode(s);
|
|
10122
|
-
let c =
|
|
10118
|
+
let c = s.findIndex((u) => Dh.includes(u));
|
|
10123
10119
|
c >= 0 && (i.info = o.substring(0, c), c + 3 < s.length && (i.baseUp = s[c + 1], i.baseDown = s[c + 2], i.height = i.baseDown + i.baseUp, i.width = i.height, i.orientation = s[c + 3] === 0 ? "horizontal" : "vertical"));
|
|
10124
10120
|
} catch {
|
|
10125
10121
|
console.warn("Failed to parse font info block");
|
|
@@ -10140,7 +10136,7 @@ class Dh {
|
|
|
10140
10136
|
}
|
|
10141
10137
|
}
|
|
10142
10138
|
}
|
|
10143
|
-
class
|
|
10139
|
+
class Ph {
|
|
10144
10140
|
parse(e) {
|
|
10145
10141
|
try {
|
|
10146
10142
|
e.readInt16();
|
|
@@ -10231,7 +10227,7 @@ class _h {
|
|
|
10231
10227
|
return { text: r, pos: n };
|
|
10232
10228
|
}
|
|
10233
10229
|
}
|
|
10234
|
-
class
|
|
10230
|
+
let Nh = class {
|
|
10235
10231
|
parse(e) {
|
|
10236
10232
|
try {
|
|
10237
10233
|
const r = e.readInt32();
|
|
@@ -10284,16 +10280,15 @@ class Ph {
|
|
|
10284
10280
|
};
|
|
10285
10281
|
}
|
|
10286
10282
|
}
|
|
10287
|
-
}
|
|
10288
|
-
let Nh = class {
|
|
10283
|
+
}, Gh = class {
|
|
10289
10284
|
static createParser(e) {
|
|
10290
10285
|
switch (e) {
|
|
10291
10286
|
case fe.SHAPES:
|
|
10292
|
-
return new Dh();
|
|
10293
|
-
case fe.BIGFONT:
|
|
10294
10287
|
return new _h();
|
|
10295
|
-
case fe.
|
|
10288
|
+
case fe.BIGFONT:
|
|
10296
10289
|
return new Ph();
|
|
10290
|
+
case fe.UNIFONT:
|
|
10291
|
+
return new Nh();
|
|
10297
10292
|
default:
|
|
10298
10293
|
throw new Error(`Unsupported font type: ${e}`);
|
|
10299
10294
|
}
|
|
@@ -10552,8 +10547,8 @@ class vt {
|
|
|
10552
10547
|
return `<svg width="100%" height="100%" viewBox="${i}" preserveAspectRatio="xMidYMid meet">${s}</svg>`;
|
|
10553
10548
|
}
|
|
10554
10549
|
}
|
|
10555
|
-
const
|
|
10556
|
-
class
|
|
10550
|
+
const Hh = Math.PI / 18;
|
|
10551
|
+
class zh {
|
|
10557
10552
|
constructor(e) {
|
|
10558
10553
|
this.shapeCache = /* @__PURE__ */ new Map(), this.shapeData = /* @__PURE__ */ new Map(), this.fontData = e;
|
|
10559
10554
|
}
|
|
@@ -10829,7 +10824,7 @@ class Hh {
|
|
|
10829
10824
|
let p = h & 7;
|
|
10830
10825
|
p === 0 && (p = 8), s !== 0 && p--;
|
|
10831
10826
|
const g = Math.PI / 4;
|
|
10832
|
-
let x = g * p, v =
|
|
10827
|
+
let x = g * p, v = Hh, F = 1;
|
|
10833
10828
|
h < 0 && (v = -v, x = -x, F = -1);
|
|
10834
10829
|
let m = g * d, S = m + x;
|
|
10835
10830
|
m += g * i / 256 * F, S += g * s / 256 * F;
|
|
@@ -10978,7 +10973,7 @@ class Hh {
|
|
|
10978
10973
|
return o.add(r), o;
|
|
10979
10974
|
}
|
|
10980
10975
|
}
|
|
10981
|
-
class
|
|
10976
|
+
let Wh = class {
|
|
10982
10977
|
/**
|
|
10983
10978
|
* Creates a new ShxFont instance.
|
|
10984
10979
|
* @param data - Either raw binary data of the SHX font file (ArrayBuffer) or pre-parsed font data (ShxFontData)
|
|
@@ -10986,14 +10981,14 @@ class zh {
|
|
|
10986
10981
|
*/
|
|
10987
10982
|
constructor(e) {
|
|
10988
10983
|
if (e instanceof ArrayBuffer) {
|
|
10989
|
-
const r = new le(e), n = new Ih().parse(r), a =
|
|
10984
|
+
const r = new le(e), n = new Ih().parse(r), a = Gh.createParser(n.fontType).parse(r);
|
|
10990
10985
|
this.fontData = {
|
|
10991
10986
|
header: n,
|
|
10992
10987
|
content: a
|
|
10993
10988
|
};
|
|
10994
10989
|
} else
|
|
10995
10990
|
this.fontData = e;
|
|
10996
|
-
this.shapeParser = new
|
|
10991
|
+
this.shapeParser = new zh(this.fontData);
|
|
10997
10992
|
}
|
|
10998
10993
|
/**
|
|
10999
10994
|
* Return true if this font contains glyph of the specified character. Otherwise, return false.
|
|
@@ -11020,11 +11015,11 @@ class zh {
|
|
|
11020
11015
|
release() {
|
|
11021
11016
|
this.shapeParser.release();
|
|
11022
11017
|
}
|
|
11023
|
-
}
|
|
11024
|
-
function
|
|
11018
|
+
};
|
|
11019
|
+
function qh(t) {
|
|
11025
11020
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
11026
11021
|
}
|
|
11027
|
-
function
|
|
11022
|
+
function Vh(t) {
|
|
11028
11023
|
if (t.__esModule) return t;
|
|
11029
11024
|
var e = t.default;
|
|
11030
11025
|
if (typeof e == "function") {
|
|
@@ -11044,11 +11039,11 @@ function qh(t) {
|
|
|
11044
11039
|
}), r;
|
|
11045
11040
|
}
|
|
11046
11041
|
var Li = { exports: {} }, nn = {}, er = {};
|
|
11047
|
-
er.byteLength =
|
|
11048
|
-
er.toByteArray =
|
|
11049
|
-
er.fromByteArray =
|
|
11050
|
-
var Be = [], ve = [],
|
|
11051
|
-
for (var rt = 0,
|
|
11042
|
+
er.byteLength = jh;
|
|
11043
|
+
er.toByteArray = $h;
|
|
11044
|
+
er.fromByteArray = Jh;
|
|
11045
|
+
var Be = [], ve = [], Xh = typeof Uint8Array < "u" ? Uint8Array : Array, gr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
11046
|
+
for (var rt = 0, Yh = gr.length; rt < Yh; ++rt)
|
|
11052
11047
|
Be[rt] = gr[rt], ve[gr.charCodeAt(rt)] = rt;
|
|
11053
11048
|
ve[45] = 62;
|
|
11054
11049
|
ve[95] = 63;
|
|
@@ -11061,30 +11056,30 @@ function Oi(t) {
|
|
|
11061
11056
|
var n = r === e ? 0 : 4 - r % 4;
|
|
11062
11057
|
return [r, n];
|
|
11063
11058
|
}
|
|
11064
|
-
function
|
|
11059
|
+
function jh(t) {
|
|
11065
11060
|
var e = Oi(t), r = e[0], n = e[1];
|
|
11066
11061
|
return (r + n) * 3 / 4 - n;
|
|
11067
11062
|
}
|
|
11068
|
-
function
|
|
11063
|
+
function Zh(t, e, r) {
|
|
11069
11064
|
return (e + r) * 3 / 4 - r;
|
|
11070
11065
|
}
|
|
11071
|
-
function
|
|
11072
|
-
var e, r = Oi(t), n = r[0], a = r[1], i = new
|
|
11066
|
+
function $h(t) {
|
|
11067
|
+
var e, r = Oi(t), n = r[0], a = r[1], i = new Xh(Zh(t, n, a)), s = 0, o = a > 0 ? n - 4 : n, c;
|
|
11073
11068
|
for (c = 0; c < o; c += 4)
|
|
11074
11069
|
e = ve[t.charCodeAt(c)] << 18 | ve[t.charCodeAt(c + 1)] << 12 | ve[t.charCodeAt(c + 2)] << 6 | ve[t.charCodeAt(c + 3)], i[s++] = e >> 16 & 255, i[s++] = e >> 8 & 255, i[s++] = e & 255;
|
|
11075
11070
|
return a === 2 && (e = ve[t.charCodeAt(c)] << 2 | ve[t.charCodeAt(c + 1)] >> 4, i[s++] = e & 255), a === 1 && (e = ve[t.charCodeAt(c)] << 10 | ve[t.charCodeAt(c + 1)] << 4 | ve[t.charCodeAt(c + 2)] >> 2, i[s++] = e >> 8 & 255, i[s++] = e & 255), i;
|
|
11076
11071
|
}
|
|
11077
|
-
function
|
|
11072
|
+
function Kh(t) {
|
|
11078
11073
|
return Be[t >> 18 & 63] + Be[t >> 12 & 63] + Be[t >> 6 & 63] + Be[t & 63];
|
|
11079
11074
|
}
|
|
11080
|
-
function
|
|
11075
|
+
function Qh(t, e, r) {
|
|
11081
11076
|
for (var n, a = [], i = e; i < r; i += 3)
|
|
11082
|
-
n = (t[i] << 16 & 16711680) + (t[i + 1] << 8 & 65280) + (t[i + 2] & 255), a.push(
|
|
11077
|
+
n = (t[i] << 16 & 16711680) + (t[i + 1] << 8 & 65280) + (t[i + 2] & 255), a.push(Kh(n));
|
|
11083
11078
|
return a.join("");
|
|
11084
11079
|
}
|
|
11085
|
-
function
|
|
11080
|
+
function Jh(t) {
|
|
11086
11081
|
for (var e, r = t.length, n = r % 3, a = [], i = 16383, s = 0, o = r - n; s < o; s += i)
|
|
11087
|
-
a.push(
|
|
11082
|
+
a.push(Qh(t, s, s + i > o ? o : s + i));
|
|
11088
11083
|
return n === 1 ? (e = t[r - 1], a.push(
|
|
11089
11084
|
Be[e >> 2] + Be[e << 4 & 63] + "=="
|
|
11090
11085
|
)) : n === 2 && (e = (t[r - 2] << 8) + t[r - 1], a.push(
|
|
@@ -11953,15 +11948,15 @@ cn.prototype.write = function(t) {
|
|
|
11953
11948
|
cn.prototype.end = function() {
|
|
11954
11949
|
return this.decoder.end();
|
|
11955
11950
|
};
|
|
11956
|
-
var
|
|
11957
|
-
function
|
|
11951
|
+
var el = typeof Object.hasOwn > "u" ? Function.call.bind(Object.prototype.hasOwnProperty) : Object.hasOwn;
|
|
11952
|
+
function tl(t, e) {
|
|
11958
11953
|
for (var r in e)
|
|
11959
|
-
|
|
11954
|
+
el(e, r) && (t[r] = e[r]);
|
|
11960
11955
|
}
|
|
11961
|
-
var Mi =
|
|
11956
|
+
var Mi = tl, vr = {}, yr = {}, Nt = { exports: {} };
|
|
11962
11957
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
11963
11958
|
var ga;
|
|
11964
|
-
function
|
|
11959
|
+
function rl() {
|
|
11965
11960
|
return ga || (ga = 1, function(t, e) {
|
|
11966
11961
|
var r = nn, n = r.Buffer;
|
|
11967
11962
|
function a(s, o) {
|
|
@@ -11993,10 +11988,10 @@ function tl() {
|
|
|
11993
11988
|
}(Nt, Nt.exports)), Nt.exports;
|
|
11994
11989
|
}
|
|
11995
11990
|
var va;
|
|
11996
|
-
function
|
|
11991
|
+
function nl() {
|
|
11997
11992
|
if (va) return yr;
|
|
11998
11993
|
va = 1;
|
|
11999
|
-
var t =
|
|
11994
|
+
var t = rl().Buffer, e = t.isEncoding || function(m) {
|
|
12000
11995
|
switch (m = "" + m, m && m.toLowerCase()) {
|
|
12001
11996
|
case "hex":
|
|
12002
11997
|
case "utf8":
|
|
@@ -12151,7 +12146,7 @@ function rl() {
|
|
|
12151
12146
|
return yr;
|
|
12152
12147
|
}
|
|
12153
12148
|
var mr, ya;
|
|
12154
|
-
function
|
|
12149
|
+
function al() {
|
|
12155
12150
|
if (ya) return mr;
|
|
12156
12151
|
ya = 1;
|
|
12157
12152
|
var t = Xe.Buffer;
|
|
@@ -12172,7 +12167,7 @@ function nl() {
|
|
|
12172
12167
|
this.enc = u.encodingName, this.bomAware = u.bomAware, this.enc === "base64" ? this.encoder = i : this.enc === "utf8" ? this.encoder = c : this.enc === "cesu8" && (this.enc = "utf8", this.encoder = s, t.from("eda0bdedb2a9", "hex").toString() !== "💩" && (this.decoder = o, this.defaultCharUnicode = h.defaultCharUnicode));
|
|
12173
12168
|
}
|
|
12174
12169
|
e.prototype.encoder = a, e.prototype.decoder = n;
|
|
12175
|
-
var r =
|
|
12170
|
+
var r = nl().StringDecoder;
|
|
12176
12171
|
function n(u, h) {
|
|
12177
12172
|
this.decoder = new r(h.enc);
|
|
12178
12173
|
}
|
|
@@ -12238,7 +12233,7 @@ function nl() {
|
|
|
12238
12233
|
}, mr;
|
|
12239
12234
|
}
|
|
12240
12235
|
var Me = {}, ma;
|
|
12241
|
-
function
|
|
12236
|
+
function il() {
|
|
12242
12237
|
if (ma) return Me;
|
|
12243
12238
|
ma = 1;
|
|
12244
12239
|
var t = Xe.Buffer;
|
|
@@ -12357,7 +12352,7 @@ function al() {
|
|
|
12357
12352
|
return Me;
|
|
12358
12353
|
}
|
|
12359
12354
|
var Gt = {}, ba;
|
|
12360
|
-
function
|
|
12355
|
+
function sl() {
|
|
12361
12356
|
if (ba) return Gt;
|
|
12362
12357
|
ba = 1;
|
|
12363
12358
|
var t = Xe.Buffer;
|
|
@@ -12443,7 +12438,7 @@ function il() {
|
|
|
12443
12438
|
return Gt;
|
|
12444
12439
|
}
|
|
12445
12440
|
var ft = {}, xa;
|
|
12446
|
-
function
|
|
12441
|
+
function ol() {
|
|
12447
12442
|
if (xa) return ft;
|
|
12448
12443
|
xa = 1;
|
|
12449
12444
|
var t = Xe.Buffer;
|
|
@@ -12539,7 +12534,7 @@ function sl() {
|
|
|
12539
12534
|
}, ft;
|
|
12540
12535
|
}
|
|
12541
12536
|
var br = {}, Sa;
|
|
12542
|
-
function
|
|
12537
|
+
function cl() {
|
|
12543
12538
|
if (Sa) return br;
|
|
12544
12539
|
Sa = 1;
|
|
12545
12540
|
var t = Xe.Buffer;
|
|
@@ -12580,7 +12575,7 @@ function ol() {
|
|
|
12580
12575
|
}, br;
|
|
12581
12576
|
}
|
|
12582
12577
|
var xr, wa;
|
|
12583
|
-
function
|
|
12578
|
+
function ul() {
|
|
12584
12579
|
return wa || (wa = 1, xr = {
|
|
12585
12580
|
// Not supported by iconv, not sure why.
|
|
12586
12581
|
10029: "maccenteuro",
|
|
@@ -12729,7 +12724,7 @@ function cl() {
|
|
|
12729
12724
|
}), xr;
|
|
12730
12725
|
}
|
|
12731
12726
|
var Sr, Fa;
|
|
12732
|
-
function
|
|
12727
|
+
function hl() {
|
|
12733
12728
|
return Fa || (Fa = 1, Sr = {
|
|
12734
12729
|
437: "cp437",
|
|
12735
12730
|
737: "cp737",
|
|
@@ -13185,7 +13180,7 @@ function ul() {
|
|
|
13185
13180
|
}), Sr;
|
|
13186
13181
|
}
|
|
13187
13182
|
var wr = {}, ka;
|
|
13188
|
-
function
|
|
13183
|
+
function ll() {
|
|
13189
13184
|
if (ka) return wr;
|
|
13190
13185
|
ka = 1;
|
|
13191
13186
|
var t = Xe.Buffer;
|
|
@@ -13425,7 +13420,7 @@ function hl() {
|
|
|
13425
13420
|
}
|
|
13426
13421
|
return wr;
|
|
13427
13422
|
}
|
|
13428
|
-
const
|
|
13423
|
+
const fl = [
|
|
13429
13424
|
[
|
|
13430
13425
|
"0",
|
|
13431
13426
|
"\0",
|
|
@@ -13970,7 +13965,7 @@ const ll = [
|
|
|
13970
13965
|
"fc40",
|
|
13971
13966
|
"髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"
|
|
13972
13967
|
]
|
|
13973
|
-
],
|
|
13968
|
+
], pl = [
|
|
13974
13969
|
[
|
|
13975
13970
|
"0",
|
|
13976
13971
|
"\0",
|
|
@@ -17668,7 +17663,7 @@ const ll = [
|
|
|
17668
17663
|
"8135f437",
|
|
17669
17664
|
""
|
|
17670
17665
|
]
|
|
17671
|
-
],
|
|
17666
|
+
], dl = [
|
|
17672
17667
|
128,
|
|
17673
17668
|
165,
|
|
17674
17669
|
169,
|
|
@@ -17876,7 +17871,7 @@ const ll = [
|
|
|
17876
17871
|
65375,
|
|
17877
17872
|
65510,
|
|
17878
17873
|
65536
|
|
17879
|
-
],
|
|
17874
|
+
], gl = [
|
|
17880
17875
|
0,
|
|
17881
17876
|
36,
|
|
17882
17877
|
38,
|
|
@@ -18084,10 +18079,10 @@ const ll = [
|
|
|
18084
18079
|
39265,
|
|
18085
18080
|
39394,
|
|
18086
18081
|
189e3
|
|
18087
|
-
],
|
|
18088
|
-
uChars:
|
|
18089
|
-
gbChars:
|
|
18090
|
-
},
|
|
18082
|
+
], vl = {
|
|
18083
|
+
uChars: dl,
|
|
18084
|
+
gbChars: gl
|
|
18085
|
+
}, yl = [
|
|
18091
18086
|
[
|
|
18092
18087
|
"0",
|
|
18093
18088
|
"\0",
|
|
@@ -21190,7 +21185,7 @@ const ll = [
|
|
|
21190
21185
|
"f9a1",
|
|
21191
21186
|
"龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"
|
|
21192
21187
|
]
|
|
21193
|
-
],
|
|
21188
|
+
], ml = [
|
|
21194
21189
|
[
|
|
21195
21190
|
"8740",
|
|
21196
21191
|
"䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"
|
|
@@ -21695,7 +21690,7 @@ const ll = [
|
|
|
21695
21690
|
]
|
|
21696
21691
|
];
|
|
21697
21692
|
var kr, Ca;
|
|
21698
|
-
function
|
|
21693
|
+
function bl() {
|
|
21699
21694
|
return Ca || (Ca = 1, kr = {
|
|
21700
21695
|
// == Japanese/ShiftJIS ====================================================
|
|
21701
21696
|
// All japanese encodings are based on JIS X set of standards:
|
|
@@ -21730,7 +21725,7 @@ function ml() {
|
|
|
21730
21725
|
shiftjis: {
|
|
21731
21726
|
type: "_dbcs",
|
|
21732
21727
|
table: function() {
|
|
21733
|
-
return
|
|
21728
|
+
return fl;
|
|
21734
21729
|
},
|
|
21735
21730
|
encodeAdd: { "¥": 92, "‾": 126 },
|
|
21736
21731
|
encodeSkipVals: [{ from: 60736, to: 63808 }]
|
|
@@ -21748,7 +21743,7 @@ function ml() {
|
|
|
21748
21743
|
eucjp: {
|
|
21749
21744
|
type: "_dbcs",
|
|
21750
21745
|
table: function() {
|
|
21751
|
-
return
|
|
21746
|
+
return pl;
|
|
21752
21747
|
},
|
|
21753
21748
|
encodeAdd: { "¥": 92, "‾": 126 }
|
|
21754
21749
|
},
|
|
@@ -21795,7 +21790,7 @@ function ml() {
|
|
|
21795
21790
|
return Fr.concat(Ta);
|
|
21796
21791
|
},
|
|
21797
21792
|
gb18030: function() {
|
|
21798
|
-
return
|
|
21793
|
+
return vl;
|
|
21799
21794
|
},
|
|
21800
21795
|
encodeSkipVals: [128],
|
|
21801
21796
|
encodeAdd: { "€": 41699 }
|
|
@@ -21809,7 +21804,7 @@ function ml() {
|
|
|
21809
21804
|
cp949: {
|
|
21810
21805
|
type: "_dbcs",
|
|
21811
21806
|
table: function() {
|
|
21812
|
-
return
|
|
21807
|
+
return yl;
|
|
21813
21808
|
}
|
|
21814
21809
|
},
|
|
21815
21810
|
cseuckr: "cp949",
|
|
@@ -21856,7 +21851,7 @@ function ml() {
|
|
|
21856
21851
|
big5hkscs: {
|
|
21857
21852
|
type: "_dbcs",
|
|
21858
21853
|
table: function() {
|
|
21859
|
-
return Ea.concat(
|
|
21854
|
+
return Ea.concat(ml);
|
|
21860
21855
|
},
|
|
21861
21856
|
encodeSkipVals: [
|
|
21862
21857
|
// Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of
|
|
@@ -21938,10 +21933,9 @@ function ml() {
|
|
|
21938
21933
|
}), kr;
|
|
21939
21934
|
}
|
|
21940
21935
|
var Ua;
|
|
21941
|
-
function
|
|
21936
|
+
function xl() {
|
|
21942
21937
|
return Ua || (Ua = 1, function(t) {
|
|
21943
21938
|
for (var e = Mi, r = [
|
|
21944
|
-
nl(),
|
|
21945
21939
|
al(),
|
|
21946
21940
|
il(),
|
|
21947
21941
|
sl(),
|
|
@@ -21949,7 +21943,8 @@ function bl() {
|
|
|
21949
21943
|
cl(),
|
|
21950
21944
|
ul(),
|
|
21951
21945
|
hl(),
|
|
21952
|
-
|
|
21946
|
+
ll(),
|
|
21947
|
+
bl()
|
|
21953
21948
|
], n = 0; n < r.length; n++) {
|
|
21954
21949
|
var a = r[n];
|
|
21955
21950
|
e(t, a);
|
|
@@ -21957,7 +21952,7 @@ function bl() {
|
|
|
21957
21952
|
}(vr)), vr;
|
|
21958
21953
|
}
|
|
21959
21954
|
var Tr, Aa;
|
|
21960
|
-
function
|
|
21955
|
+
function Sl() {
|
|
21961
21956
|
if (Aa) return Tr;
|
|
21962
21957
|
Aa = 1;
|
|
21963
21958
|
var t = Xe.Buffer;
|
|
@@ -22026,10 +22021,10 @@ function xl() {
|
|
|
22026
22021
|
};
|
|
22027
22022
|
}, Tr;
|
|
22028
22023
|
}
|
|
22029
|
-
const
|
|
22024
|
+
const wl = {}, Fl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
22030
22025
|
__proto__: null,
|
|
22031
|
-
default:
|
|
22032
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
22026
|
+
default: wl
|
|
22027
|
+
}, Symbol.toStringTag, { value: "Module" })), kl = /* @__PURE__ */ Vh(Fl);
|
|
22033
22028
|
(function(t) {
|
|
22034
22029
|
var e = Xe.Buffer, r = sn, n = Mi, a = t.exports;
|
|
22035
22030
|
a.encodings = null, a.defaultCharUnicode = "�", a.defaultCharSingleByte = "?", a.encode = function(o, c, u) {
|
|
@@ -22048,7 +22043,7 @@ const Sl = {}, wl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
22048
22043
|
}
|
|
22049
22044
|
}, a.toEncoding = a.encode, a.fromEncoding = a.decode, a._codecDataCache = { __proto__: null }, a.getCodec = function(o) {
|
|
22050
22045
|
if (!a.encodings) {
|
|
22051
|
-
var c =
|
|
22046
|
+
var c = xl();
|
|
22052
22047
|
a.encodings = { __proto__: null }, n(a.encodings, c);
|
|
22053
22048
|
}
|
|
22054
22049
|
for (var u = a._canonicalizeEncoding(o), h = {}; ; ) {
|
|
@@ -22081,7 +22076,7 @@ const Sl = {}, wl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
22081
22076
|
return u.bomAware && !(c && c.stripBOM === !1) && (h = new r.StripBOM(h, c)), h;
|
|
22082
22077
|
}, a.enableStreamingAPI = function(o) {
|
|
22083
22078
|
if (!a.supportsStreams) {
|
|
22084
|
-
var c =
|
|
22079
|
+
var c = Sl()(o);
|
|
22085
22080
|
a.IconvLiteEncoderStream = c.IconvLiteEncoderStream, a.IconvLiteDecoderStream = c.IconvLiteDecoderStream, a.encodeStream = function(h, d) {
|
|
22086
22081
|
return new a.IconvLiteEncoderStream(a.getEncoder(h, d), d);
|
|
22087
22082
|
}, a.decodeStream = function(h, d) {
|
|
@@ -22091,15 +22086,15 @@ const Sl = {}, wl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
22091
22086
|
};
|
|
22092
22087
|
var i;
|
|
22093
22088
|
try {
|
|
22094
|
-
i =
|
|
22089
|
+
i = kl;
|
|
22095
22090
|
} catch {
|
|
22096
22091
|
}
|
|
22097
22092
|
i && i.Transform ? a.enableStreamingAPI(i) : a.encodeStream = a.decodeStream = function() {
|
|
22098
22093
|
throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.");
|
|
22099
22094
|
};
|
|
22100
22095
|
})(Li);
|
|
22101
|
-
var
|
|
22102
|
-
const
|
|
22096
|
+
var Tl = Li.exports;
|
|
22097
|
+
const El = /* @__PURE__ */ qh(Tl);
|
|
22103
22098
|
class un extends Ia {
|
|
22104
22099
|
/**
|
|
22105
22100
|
* Creates a new instance of ShxTextShape
|
|
@@ -22107,7 +22102,8 @@ class un extends Ia {
|
|
|
22107
22102
|
* @param shape - The shape data for this character
|
|
22108
22103
|
*/
|
|
22109
22104
|
constructor(e, r, n, a) {
|
|
22110
|
-
|
|
22105
|
+
var i;
|
|
22106
|
+
super(), this.fontSize = r, this.shape = n, this.font = a, this.code = e, a.data.header.fontType === fe.BIGFONT ? this.width = this.calcWidth() : this.width = ((i = n.lastPoint) == null ? void 0 : i.x) ?? this.calcWidth();
|
|
22111
22107
|
}
|
|
22112
22108
|
calcWidth() {
|
|
22113
22109
|
const e = this.shape.bbox;
|
|
@@ -22146,9 +22142,9 @@ class un extends Ia {
|
|
|
22146
22142
|
return e;
|
|
22147
22143
|
}
|
|
22148
22144
|
}
|
|
22149
|
-
class
|
|
22145
|
+
class Cl extends Ma {
|
|
22150
22146
|
constructor(e) {
|
|
22151
|
-
super(e), this.type = "shx", this.font = new
|
|
22147
|
+
super(e), this.type = "shx", this.font = new Wh(e.data), this.data = this.font.fontData;
|
|
22152
22148
|
}
|
|
22153
22149
|
/**
|
|
22154
22150
|
* Return true if this font contains glyph of the specified character. Otherwise, return false.
|
|
@@ -22230,7 +22226,7 @@ class El extends Ma {
|
|
|
22230
22226
|
*/
|
|
22231
22227
|
getCode(e) {
|
|
22232
22228
|
if (this.font.fontData.header.fontType === fe.BIGFONT && this.encoding) {
|
|
22233
|
-
const n =
|
|
22229
|
+
const n = El.encode(e[0], this.encoding);
|
|
22234
22230
|
return n.length === 1 ? n[0] : n[0] << 8 | n[1];
|
|
22235
22231
|
} else
|
|
22236
22232
|
return e.charCodeAt(0);
|
|
@@ -22256,7 +22252,7 @@ class ze {
|
|
|
22256
22252
|
*/
|
|
22257
22253
|
createFont(e) {
|
|
22258
22254
|
if (e.type === "shx")
|
|
22259
|
-
return new
|
|
22255
|
+
return new Cl(e);
|
|
22260
22256
|
if (e.type === "mesh")
|
|
22261
22257
|
return new Mh(e);
|
|
22262
22258
|
throw new Error("Unsupported font data type");
|
|
@@ -22269,7 +22265,7 @@ class Oe {
|
|
|
22269
22265
|
fontNotFound: new mn(),
|
|
22270
22266
|
/** Event triggered when a font is successfully loaded */
|
|
22271
22267
|
fontLoaded: new mn()
|
|
22272
|
-
}, this.loader = new P.FileLoader(), this.loader.setResponseType("arraybuffer"), this.fileNames = [], this.fontLoader = new
|
|
22268
|
+
}, this.loader = new P.FileLoader(), this.loader.setResponseType("arraybuffer"), this.fileNames = [], this.fontLoader = new Ul();
|
|
22273
22269
|
}
|
|
22274
22270
|
/**
|
|
22275
22271
|
* Gets the singleton instance of the FontManager
|
|
@@ -22529,7 +22525,7 @@ class Oe {
|
|
|
22529
22525
|
return e == null ? (this.loadedFontMap.clear(), !0) : this.loadedFontMap.delete(e);
|
|
22530
22526
|
}
|
|
22531
22527
|
}
|
|
22532
|
-
class
|
|
22528
|
+
class Ul {
|
|
22533
22529
|
/**
|
|
22534
22530
|
* Creates a new instance of DefaultFontLoader
|
|
22535
22531
|
*/
|
|
@@ -22626,12 +22622,12 @@ class Cl {
|
|
|
22626
22622
|
}
|
|
22627
22623
|
}
|
|
22628
22624
|
var nt = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.WORD = 1] = "WORD", t[t.STACK = 2] = "STACK", t[t.SPACE = 3] = "SPACE", t[t.NBSP = 4] = "NBSP", t[t.TABULATOR = 5] = "TABULATOR", t[t.NEW_PARAGRAPH = 6] = "NEW_PARAGRAPH", t[t.NEW_COLUMN = 7] = "NEW_COLUMN", t[t.WRAP_AT_DIMLINE = 8] = "WRAP_AT_DIMLINE", t[t.PROPERTIES_CHANGED = 9] = "PROPERTIES_CHANGED", t))(nt || {}), pt = /* @__PURE__ */ ((t) => (t[t.BOTTOM = 0] = "BOTTOM", t[t.MIDDLE = 1] = "MIDDLE", t[t.TOP = 2] = "TOP", t))(pt || {}), Se = /* @__PURE__ */ ((t) => (t[t.DEFAULT = 0] = "DEFAULT", t[t.LEFT = 1] = "LEFT", t[t.RIGHT = 2] = "RIGHT", t[t.CENTER = 3] = "CENTER", t[t.JUSTIFIED = 4] = "JUSTIFIED", t[t.DISTRIBUTED = 5] = "DISTRIBUTED", t))(Se || {});
|
|
22629
|
-
const
|
|
22625
|
+
const Al = {
|
|
22630
22626
|
c: "Ø",
|
|
22631
22627
|
d: "°",
|
|
22632
22628
|
p: "±",
|
|
22633
22629
|
"%": "%"
|
|
22634
|
-
},
|
|
22630
|
+
}, Bl = {
|
|
22635
22631
|
l: 1,
|
|
22636
22632
|
r: 2,
|
|
22637
22633
|
c: 3,
|
|
@@ -22639,14 +22635,14 @@ const Ul = {
|
|
|
22639
22635
|
d: 5
|
|
22640
22636
|
/* DISTRIBUTED */
|
|
22641
22637
|
};
|
|
22642
|
-
function
|
|
22638
|
+
function Ll(t, e = !1) {
|
|
22643
22639
|
const r = /* @__PURE__ */ new Set(), n = /\\[fF](.*?)[;|]/g;
|
|
22644
22640
|
return [...t.matchAll(n)].forEach((a) => {
|
|
22645
22641
|
let i = a[1].toLowerCase();
|
|
22646
22642
|
e && (i = i.replace(/\.(ttf|otf|woff|shx)$/, "")), r.add(i);
|
|
22647
22643
|
}), r;
|
|
22648
22644
|
}
|
|
22649
|
-
class
|
|
22645
|
+
class Ol {
|
|
22650
22646
|
/**
|
|
22651
22647
|
* Creates a new ContextStack with an initial context.
|
|
22652
22648
|
* @param initial The initial MTextContext to use as the base of the stack.
|
|
@@ -22698,7 +22694,7 @@ class Ll {
|
|
|
22698
22694
|
this.stack[this.stack.length - 1] = e;
|
|
22699
22695
|
}
|
|
22700
22696
|
}
|
|
22701
|
-
class
|
|
22697
|
+
class Rl {
|
|
22702
22698
|
/**
|
|
22703
22699
|
* Creates a new MTextParser instance
|
|
22704
22700
|
* @param content - The MText content to parse
|
|
@@ -22708,7 +22704,7 @@ class Ol {
|
|
|
22708
22704
|
constructor(e, r, n = {}) {
|
|
22709
22705
|
this.continueStroke = !1, this.inStackContext = !1, this.scanner = new Er(e);
|
|
22710
22706
|
const a = r ?? new Ut();
|
|
22711
|
-
this.ctxStack = new
|
|
22707
|
+
this.ctxStack = new Ol(a), this.yieldPropertyCommands = n.yieldPropertyCommands ?? !1, this.resetParagraphParameters = n.resetParagraphParameters ?? !1, this.mifDecoder = n.mifDecoder ?? this.decodeMultiByteChar.bind(this), this.mifCodeLength = n.mifCodeLength ?? "auto";
|
|
22712
22708
|
}
|
|
22713
22709
|
/**
|
|
22714
22710
|
* Decode multi-byte character from hex code
|
|
@@ -23089,7 +23085,7 @@ class Ol {
|
|
|
23089
23085
|
break;
|
|
23090
23086
|
case "q": {
|
|
23091
23087
|
const u = r.get();
|
|
23092
|
-
for (s =
|
|
23088
|
+
for (s = Bl[u] || 0; r.peek() === ","; )
|
|
23093
23089
|
r.consume(1);
|
|
23094
23090
|
break;
|
|
23095
23091
|
}
|
|
@@ -23226,7 +23222,7 @@ class Ol {
|
|
|
23226
23222
|
continue;
|
|
23227
23223
|
}
|
|
23228
23224
|
if (s === "%" && this.scanner.peek(1) === "%") {
|
|
23229
|
-
const c = this.scanner.peek(2).toLowerCase(), u =
|
|
23225
|
+
const c = this.scanner.peek(2).toLowerCase(), u = Al[c];
|
|
23230
23226
|
if (u) {
|
|
23231
23227
|
this.scanner.consume(3), a += u;
|
|
23232
23228
|
continue;
|
|
@@ -23686,8 +23682,8 @@ class Cr {
|
|
|
23686
23682
|
this.type = e, this.ctx = r, this.data = n;
|
|
23687
23683
|
}
|
|
23688
23684
|
}
|
|
23689
|
-
var wt = /* @__PURE__ */ ((t) => (t[t.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", t[t.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", t[t.TOP_TO_BOTTOM = 3] = "TOP_TO_BOTTOM", t[t.BOTTOM_TO_TOP = 4] = "BOTTOM_TO_TOP", t[t.BY_STYLE = 5] = "BY_STYLE", t))(wt || {}),
|
|
23690
|
-
const
|
|
23685
|
+
var wt = /* @__PURE__ */ ((t) => (t[t.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", t[t.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", t[t.TOP_TO_BOTTOM = 3] = "TOP_TO_BOTTOM", t[t.BOTTOM_TO_TOP = 4] = "BOTTOM_TO_TOP", t[t.BY_STYLE = 5] = "BY_STYLE", t))(wt || {}), Ml = /* @__PURE__ */ ((t) => (t[t.TopLeft = 1] = "TopLeft", t[t.TopCenter = 2] = "TopCenter", t[t.TopRight = 3] = "TopRight", t[t.MiddleLeft = 4] = "MiddleLeft", t[t.MiddleCenter = 5] = "MiddleCenter", t[t.MiddleRight = 6] = "MiddleRight", t[t.BottomLeft = 7] = "BottomLeft", t[t.BottomCenter = 8] = "BottomCenter", t[t.BottomRight = 9] = "BottomRight", t))(Ml || {});
|
|
23686
|
+
const Il = /* @__PURE__ */ new P.Vector3(), Dl = 1.666666;
|
|
23691
23687
|
class ln extends Ut {
|
|
23692
23688
|
/**
|
|
23693
23689
|
* Creates a new RenderContext instance with optional initial values.
|
|
@@ -23721,7 +23717,7 @@ class ln extends Ut {
|
|
|
23721
23717
|
this.color.rgb = [r, n, a];
|
|
23722
23718
|
}
|
|
23723
23719
|
}
|
|
23724
|
-
class
|
|
23720
|
+
class _l {
|
|
23725
23721
|
/**
|
|
23726
23722
|
* Construct one instance of this class and initialize some properties with default values.
|
|
23727
23723
|
* @param style Input text style
|
|
@@ -23820,7 +23816,7 @@ class Dl {
|
|
|
23820
23816
|
* The height of current line of texts
|
|
23821
23817
|
*/
|
|
23822
23818
|
get currentLineHeight() {
|
|
23823
|
-
return this.defaultLineSpaceFactor * this.currentFontSize *
|
|
23819
|
+
return this.defaultLineSpaceFactor * this.currentFontSize * Dl + this.currentMaxFontSize;
|
|
23824
23820
|
}
|
|
23825
23821
|
/**
|
|
23826
23822
|
* The maximum font size in current line. Characters in one line may have different font and font
|
|
@@ -24223,7 +24219,7 @@ class Dl {
|
|
|
24223
24219
|
if (e.forEach((n, a) => {
|
|
24224
24220
|
n.boundingBox || n.computeBoundingBox(), a === 0 ? r = n.boundingBox : r.union(n.boundingBox);
|
|
24225
24221
|
}), r) {
|
|
24226
|
-
const n = r.getSize(
|
|
24222
|
+
const n = r.getSize(Il);
|
|
24227
24223
|
switch (this.currentHorizontalAlignment) {
|
|
24228
24224
|
case Se.LEFT:
|
|
24229
24225
|
e.forEach(
|
|
@@ -24328,7 +24324,7 @@ class $t extends P.Object3D {
|
|
|
24328
24324
|
* ```
|
|
24329
24325
|
*/
|
|
24330
24326
|
static getFonts(e, r = !1) {
|
|
24331
|
-
return
|
|
24327
|
+
return Ll(e, r);
|
|
24332
24328
|
}
|
|
24333
24329
|
/**
|
|
24334
24330
|
* Creates a new instance of MText.
|
|
@@ -24496,12 +24492,12 @@ class $t extends P.Object3D {
|
|
|
24496
24492
|
value: e.widthFactor ?? 1,
|
|
24497
24493
|
isRelative: !0
|
|
24498
24494
|
}, h.align = i, h.paragraph.align = a;
|
|
24499
|
-
const d = new
|
|
24495
|
+
const d = new _l(
|
|
24500
24496
|
r,
|
|
24501
24497
|
this.styleManager,
|
|
24502
24498
|
this.fontManager,
|
|
24503
24499
|
u
|
|
24504
|
-
), g = new
|
|
24500
|
+
), g = new Rl(e.text, h, {
|
|
24505
24501
|
resetParagraphParameters: !0,
|
|
24506
24502
|
yieldPropertyCommands: !0
|
|
24507
24503
|
}).parse();
|
|
@@ -24623,7 +24619,7 @@ class Ii {
|
|
|
24623
24619
|
return e.isByLayer && e.layer ? `layer_${e.layer}_${e.color}` : `entity_${e.color}`;
|
|
24624
24620
|
}
|
|
24625
24621
|
}
|
|
24626
|
-
class
|
|
24622
|
+
class Pl {
|
|
24627
24623
|
constructor(e = {}) {
|
|
24628
24624
|
this.workers = [], this.inFlightPerWorker = [], this.pendingRequests = /* @__PURE__ */ new Map(), this.requestId = 0, this.readyPromise = null, this.poolSize = e.poolSize ?? Math.max(
|
|
24629
24625
|
1,
|
|
@@ -24864,7 +24860,7 @@ class _l {
|
|
|
24864
24860
|
this.terminate();
|
|
24865
24861
|
}
|
|
24866
24862
|
}
|
|
24867
|
-
class
|
|
24863
|
+
class Nl {
|
|
24868
24864
|
constructor() {
|
|
24869
24865
|
this.fontManager = Oe.instance, this.defaultStyleManager = new Ii(), this.isInitialized = !1;
|
|
24870
24866
|
}
|
|
@@ -24937,7 +24933,7 @@ class Pl {
|
|
|
24937
24933
|
this.isInitialized || (await this.loadFonts([Oe.instance.defaultFont]), this.isInitialized = !0);
|
|
24938
24934
|
}
|
|
24939
24935
|
}
|
|
24940
|
-
class
|
|
24936
|
+
class ql {
|
|
24941
24937
|
/**
|
|
24942
24938
|
* Constructor
|
|
24943
24939
|
*
|
|
@@ -24946,7 +24942,7 @@ class Hl {
|
|
|
24946
24942
|
* when render mode is 'worker'.
|
|
24947
24943
|
*/
|
|
24948
24944
|
constructor(e = "main", r = {}) {
|
|
24949
|
-
this.defaultMode = e, this.mainThreadRenderer = new
|
|
24945
|
+
this.defaultMode = e, this.mainThreadRenderer = new Nl(), this.webWorkerRenderer = new Pl(r), this.renderer = this.mainThreadRenderer, e === "worker" && (this.renderer = this.webWorkerRenderer);
|
|
24950
24946
|
}
|
|
24951
24947
|
/**
|
|
24952
24948
|
* Sets one new style manager to override the default style manager
|
|
@@ -25025,14 +25021,14 @@ class Hl {
|
|
|
25025
25021
|
export {
|
|
25026
25022
|
Ma as BaseFont,
|
|
25027
25023
|
Ia as BaseTextShape,
|
|
25028
|
-
|
|
25024
|
+
Ul as DefaultFontLoader,
|
|
25029
25025
|
mn as EventManager,
|
|
25030
25026
|
ze as FontFactory,
|
|
25031
25027
|
Oe as FontManager,
|
|
25032
25028
|
$t as MText,
|
|
25033
|
-
|
|
25029
|
+
Ml as MTextAttachmentPoint,
|
|
25034
25030
|
wt as MTextFlowDirection,
|
|
25035
|
-
|
|
25036
|
-
|
|
25037
|
-
|
|
25031
|
+
Nl as MainThreadRenderer,
|
|
25032
|
+
ql as UnifiedRenderer,
|
|
25033
|
+
Pl as WebWorkerRenderer
|
|
25038
25034
|
};
|