@mlightcad/mtext-renderer 0.13.7 → 0.13.8

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 CHANGED
@@ -334,7 +334,7 @@ function Be(t) {
334
334
  const s = Number.isInteger(n) || n >= 10 ? 0 : 1;
335
335
  return `${n.toFixed(s)} ${e[r]}`;
336
336
  }
337
- class jr {
337
+ class $r {
338
338
  /**
339
339
  * Creates an LRU cache with the given capacity and optional eviction handler.
340
340
  *
@@ -418,10 +418,10 @@ class jr {
418
418
  this.map.clear();
419
419
  }
420
420
  }
421
- const $o = 4096;
422
- class jo {
423
- constructor(e = $o) {
424
- this.maxSize = e, this.cache = new jr(e, (n, r) => {
421
+ const jo = 4096;
422
+ class $o {
423
+ constructor(e = jo) {
424
+ this.maxSize = e, this.cache = new $r(e, (n, r) => {
425
425
  r.dispose();
426
426
  });
427
427
  }
@@ -489,7 +489,7 @@ class jo {
489
489
  }
490
490
  class ha {
491
491
  constructor(e) {
492
- this.names = /* @__PURE__ */ new Set(), this.unsupportedChars = {}, this.encoding = e.encoding, e.alias.forEach((n) => this.names.add(n)), this.sourceByteLength = ua(e.data), this.cache = new jo();
492
+ this.names = /* @__PURE__ */ new Set(), this.unsupportedChars = {}, this.encoding = e.encoding, e.alias.forEach((n) => this.names.add(n)), this.sourceByteLength = ua(e.data), this.cache = new $o();
493
493
  }
494
494
  /**
495
495
  * Releases cache resources held by this font so they are eligible for GC
@@ -1055,7 +1055,7 @@ class en extends Yr {
1055
1055
  return !0;
1056
1056
  }
1057
1057
  }
1058
- const qn = new en();
1058
+ const jn = new en();
1059
1059
  class se {
1060
1060
  /**
1061
1061
  * Creates a new Point instance.
@@ -1427,7 +1427,7 @@ function uc(t, e, n) {
1427
1427
  }
1428
1428
  return !1;
1429
1429
  }
1430
- function hc(t, e, n, r = qn, s = !1, i = 0) {
1430
+ function hc(t, e, n, r = jn, s = !1, i = 0) {
1431
1431
  var a;
1432
1432
  let o = t;
1433
1433
  if (e.header.fontType === K.BIGFONT && i > 0) {
@@ -1445,7 +1445,7 @@ function hc(t, e, n, r = qn, s = !1, i = 0) {
1445
1445
  l
1446
1446
  );
1447
1447
  }
1448
- function fc(t, e, n, r = qn, s = !1, i = 0) {
1448
+ function fc(t, e, n, r = jn, s = !1, i = 0) {
1449
1449
  const a = $n(e.content, n);
1450
1450
  return hc(
1451
1451
  t,
@@ -2164,7 +2164,7 @@ class mc {
2164
2164
  * @param code - The character code to get the shape for
2165
2165
  * @param size - The desired font size
2166
2166
  */
2167
- getLayoutCharShape(e, n, r = qn) {
2167
+ getLayoutCharShape(e, n, r = jn) {
2168
2168
  const s = this.getCharShape(e, n);
2169
2169
  if (s)
2170
2170
  return fc(
@@ -2241,11 +2241,11 @@ class mc {
2241
2241
  this.shapeParser.release();
2242
2242
  }
2243
2243
  }
2244
- function yc(t, e, n, r = qn) {
2244
+ function yc(t, e, n, r = jn) {
2245
2245
  const s = $n(e.content, n);
2246
2246
  return r.resolve(t, s.cellWidth);
2247
2247
  }
2248
- const Lr = (t, e) => e.some((n) => t instanceof n);
2248
+ const Ar = (t, e) => e.some((n) => t instanceof n);
2249
2249
  let Fs, Ts;
2250
2250
  function bc() {
2251
2251
  return Fs || (Fs = [
@@ -2263,7 +2263,7 @@ function xc() {
2263
2263
  IDBCursor.prototype.continuePrimaryKey
2264
2264
  ]);
2265
2265
  }
2266
- const Ar = /* @__PURE__ */ new WeakMap(), Jn = /* @__PURE__ */ new WeakMap(), jn = /* @__PURE__ */ new WeakMap();
2266
+ const Mr = /* @__PURE__ */ new WeakMap(), er = /* @__PURE__ */ new WeakMap(), Yn = /* @__PURE__ */ new WeakMap();
2267
2267
  function vc(t) {
2268
2268
  const e = new Promise((n, r) => {
2269
2269
  const s = () => {
@@ -2275,10 +2275,10 @@ function vc(t) {
2275
2275
  };
2276
2276
  t.addEventListener("success", i), t.addEventListener("error", a);
2277
2277
  });
2278
- return jn.set(e, t), e;
2278
+ return Yn.set(e, t), e;
2279
2279
  }
2280
2280
  function Sc(t) {
2281
- if (Ar.has(t))
2281
+ if (Mr.has(t))
2282
2282
  return;
2283
2283
  const e = new Promise((n, r) => {
2284
2284
  const s = () => {
@@ -2290,13 +2290,13 @@ function Sc(t) {
2290
2290
  };
2291
2291
  t.addEventListener("complete", i), t.addEventListener("error", a), t.addEventListener("abort", a);
2292
2292
  });
2293
- Ar.set(t, e);
2293
+ Mr.set(t, e);
2294
2294
  }
2295
- let Mr = {
2295
+ let Or = {
2296
2296
  get(t, e, n) {
2297
2297
  if (t instanceof IDBTransaction) {
2298
2298
  if (e === "done")
2299
- return Ar.get(t);
2299
+ return Mr.get(t);
2300
2300
  if (e === "store")
2301
2301
  return n.objectStoreNames[1] ? void 0 : n.objectStore(n.objectStoreNames[0]);
2302
2302
  }
@@ -2310,27 +2310,27 @@ let Mr = {
2310
2310
  }
2311
2311
  };
2312
2312
  function ba(t) {
2313
- Mr = t(Mr);
2313
+ Or = t(Or);
2314
2314
  }
2315
2315
  function wc(t) {
2316
2316
  return xc().includes(t) ? function(...e) {
2317
- return t.apply(Or(this), e), Ct(this.request);
2317
+ return t.apply(Br(this), e), Ct(this.request);
2318
2318
  } : function(...e) {
2319
- return Ct(t.apply(Or(this), e));
2319
+ return Ct(t.apply(Br(this), e));
2320
2320
  };
2321
2321
  }
2322
2322
  function Cc(t) {
2323
- return typeof t == "function" ? wc(t) : (t instanceof IDBTransaction && Sc(t), Lr(t, bc()) ? new Proxy(t, Mr) : t);
2323
+ return typeof t == "function" ? wc(t) : (t instanceof IDBTransaction && Sc(t), Ar(t, bc()) ? new Proxy(t, Or) : t);
2324
2324
  }
2325
2325
  function Ct(t) {
2326
2326
  if (t instanceof IDBRequest)
2327
2327
  return vc(t);
2328
- if (Jn.has(t))
2329
- return Jn.get(t);
2328
+ if (er.has(t))
2329
+ return er.get(t);
2330
2330
  const e = Cc(t);
2331
- return e !== t && (Jn.set(t, e), jn.set(e, t)), e;
2331
+ return e !== t && (er.set(t, e), Yn.set(e, t)), e;
2332
2332
  }
2333
- const Or = (t) => jn.get(t);
2333
+ const Br = (t) => Yn.get(t);
2334
2334
  function Fc(t, e, { blocked: n, upgrade: r, blocking: s, terminated: i } = {}) {
2335
2335
  const a = indexedDB.open(t, e), o = Ct(a);
2336
2336
  return r && a.addEventListener("upgradeneeded", (c) => {
@@ -2345,12 +2345,12 @@ function Fc(t, e, { blocked: n, upgrade: r, blocking: s, terminated: i } = {}) {
2345
2345
  }).catch(() => {
2346
2346
  }), o;
2347
2347
  }
2348
- const Tc = ["get", "getKey", "getAll", "getAllKeys", "count"], kc = ["put", "add", "delete", "clear"], er = /* @__PURE__ */ new Map();
2348
+ const Tc = ["get", "getKey", "getAll", "getAllKeys", "count"], kc = ["put", "add", "delete", "clear"], tr = /* @__PURE__ */ new Map();
2349
2349
  function ks(t, e) {
2350
2350
  if (!(t instanceof IDBDatabase && !(e in t) && typeof e == "string"))
2351
2351
  return;
2352
- if (er.get(e))
2353
- return er.get(e);
2352
+ if (tr.get(e))
2353
+ return tr.get(e);
2354
2354
  const n = e.replace(/FromIndex$/, ""), r = e !== n, s = kc.includes(n);
2355
2355
  if (
2356
2356
  // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
@@ -2365,20 +2365,20 @@ function ks(t, e) {
2365
2365
  s && c.done
2366
2366
  ]))[0];
2367
2367
  };
2368
- return er.set(e, i), i;
2368
+ return tr.set(e, i), i;
2369
2369
  }
2370
2370
  ba((t) => ({
2371
2371
  ...t,
2372
2372
  get: (e, n, r) => ks(e, n) || t.get(e, n, r),
2373
2373
  has: (e, n) => !!ks(e, n) || t.has(e, n)
2374
2374
  }));
2375
- const Ec = ["continue", "continuePrimaryKey", "advance"], Es = {}, Br = /* @__PURE__ */ new WeakMap(), xa = /* @__PURE__ */ new WeakMap(), Lc = {
2375
+ const Ec = ["continue", "continuePrimaryKey", "advance"], Es = {}, Ir = /* @__PURE__ */ new WeakMap(), xa = /* @__PURE__ */ new WeakMap(), Lc = {
2376
2376
  get(t, e) {
2377
2377
  if (!Ec.includes(e))
2378
2378
  return t[e];
2379
2379
  let n = Es[e];
2380
2380
  return n || (n = Es[e] = function(...r) {
2381
- Br.set(this, xa.get(this)[e](...r));
2381
+ Ir.set(this, xa.get(this)[e](...r));
2382
2382
  }), n;
2383
2383
  }
2384
2384
  };
@@ -2388,11 +2388,11 @@ async function* Ac(...t) {
2388
2388
  return;
2389
2389
  e = e;
2390
2390
  const n = new Proxy(e, Lc);
2391
- for (xa.set(n, e), jn.set(n, Or(e)); e; )
2392
- yield n, e = await (Br.get(n) || e.continue()), Br.delete(n);
2391
+ for (xa.set(n, e), Yn.set(n, Br(e)); e; )
2392
+ yield n, e = await (Ir.get(n) || e.continue()), Ir.delete(n);
2393
2393
  }
2394
2394
  function Ls(t, e) {
2395
- return e === Symbol.asyncIterator && Lr(t, [IDBIndex, IDBObjectStore, IDBCursor]) || e === "iterate" && Lr(t, [IDBIndex, IDBObjectStore]);
2395
+ return e === Symbol.asyncIterator && Ar(t, [IDBIndex, IDBObjectStore, IDBCursor]) || e === "iterate" && Ar(t, [IDBIndex, IDBObjectStore]);
2396
2396
  }
2397
2397
  ba((t) => ({
2398
2398
  ...t,
@@ -2405,7 +2405,7 @@ ba((t) => ({
2405
2405
  }));
2406
2406
  const vt = {
2407
2407
  fonts: "fonts"
2408
- }, tr = [
2408
+ }, nr = [
2409
2409
  {
2410
2410
  version: 1,
2411
2411
  stores: [
@@ -2561,7 +2561,7 @@ const vt = {
2561
2561
  * @param newVersion The new version of the database
2562
2562
  */
2563
2563
  handleUpgrade(e, n, r) {
2564
- const s = tr.filter(
2564
+ const s = nr.filter(
2565
2565
  (i) => i.version > n && (!r || i.version <= r)
2566
2566
  );
2567
2567
  for (const i of s)
@@ -2577,7 +2577,7 @@ const vt = {
2577
2577
  e.objectStoreNames.contains(r.name) || e.createObjectStore(r.name, { keyPath: r.keyPath });
2578
2578
  }
2579
2579
  };
2580
- _e.DATABASE_NAME = "mlightcad", _e.DATABASE_VERSION = tr[tr.length - 1].version;
2580
+ _e.DATABASE_NAME = "mlightcad", _e.DATABASE_VERSION = nr[nr.length - 1].version;
2581
2581
  let Me = _e;
2582
2582
  const Mc = 512;
2583
2583
  function Oc(t, e) {
@@ -2591,7 +2591,7 @@ function va() {
2591
2591
  estimatedBytes: 0
2592
2592
  };
2593
2593
  }
2594
- const Ir = {
2594
+ const Rr = {
2595
2595
  minimal: ["txt", "simsun"],
2596
2596
  r12r14: ["txt", "simplex", "romans", "gbcbig", "simsun"],
2597
2597
  // Mesh/TTF first so missing style fonts (e.g. "标准") get correct Latin metrics.
@@ -2616,7 +2616,7 @@ const Ir = {
2616
2616
  chinese: ["simsun", "gbcbig", "hztxt"],
2617
2617
  korean: ["malgun", "whgtxt", "whgdtxt"],
2618
2618
  japanese: ["msgothic", "extfont2", "extfont"]
2619
- }, nr = {
2619
+ }, rr = {
2620
2620
  minimal: ["simplex", "amgdt"],
2621
2621
  r12r14: ["simplex", "amgdt"],
2622
2622
  modern: ["simplex", "amgdt"],
@@ -2627,7 +2627,7 @@ const Ir = {
2627
2627
  japanese: ["simplex", "amgdt"]
2628
2628
  };
2629
2629
  function As(t) {
2630
- return Object.prototype.hasOwnProperty.call(Ir, t);
2630
+ return Object.prototype.hasOwnProperty.call(Rr, t);
2631
2631
  }
2632
2632
  var Xr = 0, Sa = -3;
2633
2633
  function nn() {
@@ -2675,7 +2675,7 @@ function _c(t, e) {
2675
2675
  for (e.table[5] = 32, n = 0; n < 32; ++n) e.trans[n] = n;
2676
2676
  }
2677
2677
  var Os = new Uint16Array(16);
2678
- function rr(t, e, n, r) {
2678
+ function sr(t, e, n, r) {
2679
2679
  var s, i;
2680
2680
  for (s = 0; s < 16; ++s) t.table[s] = 0;
2681
2681
  for (s = 0; s < r; ++s) t.table[e[n + s]]++;
@@ -2697,7 +2697,7 @@ function Ke(t, e, n) {
2697
2697
  var r = t.tag & 65535 >>> 16 - e;
2698
2698
  return t.tag >>>= e, t.bitcount -= e, r + n;
2699
2699
  }
2700
- function Rr(t, e) {
2700
+ function Dr(t, e) {
2701
2701
  for (; t.bitcount < 24; )
2702
2702
  t.tag |= t.source[t.sourceIndex++] << t.bitcount, t.bitcount += 8;
2703
2703
  var n = 0, r = 0, s = 0, i = t.tag;
@@ -2713,8 +2713,8 @@ function Pc(t, e, n) {
2713
2713
  var l = Ke(t, 3, 0);
2714
2714
  Xe[Dc[a]] = l;
2715
2715
  }
2716
- for (rr(Ms, Xe, 0, 19), o = 0; o < r + s; ) {
2717
- var u = Rr(t, Ms);
2716
+ for (sr(Ms, Xe, 0, 19), o = 0; o < r + s; ) {
2717
+ var u = Dr(t, Ms);
2718
2718
  switch (u) {
2719
2719
  case 16:
2720
2720
  var f = Xe[o - 1];
@@ -2734,18 +2734,18 @@ function Pc(t, e, n) {
2734
2734
  break;
2735
2735
  }
2736
2736
  }
2737
- rr(e, Xe, 0, r), rr(n, Xe, r, s);
2737
+ sr(e, Xe, 0, r), sr(n, Xe, r, s);
2738
2738
  }
2739
2739
  function Bs(t, e, n) {
2740
2740
  for (; ; ) {
2741
- var r = Rr(t, e);
2741
+ var r = Dr(t, e);
2742
2742
  if (r === 256)
2743
2743
  return Xr;
2744
2744
  if (r < 256)
2745
2745
  t.dest[t.destLen++] = r;
2746
2746
  else {
2747
2747
  var s, i, a, o;
2748
- for (r -= 257, s = Ke(t, Zr[r], Kr[r]), i = Rr(t, n), a = t.destLen - Ke(t, Fa[i], Ta[i]), o = a; o < a + s; ++o)
2748
+ for (r -= 257, s = Ke(t, Zr[r], Kr[r]), i = Dr(t, n), a = t.destLen - Ke(t, Fa[i], Ta[i]), o = a; o < a + s; ++o)
2749
2749
  t.dest[t.destLen++] = t.dest[o];
2750
2750
  }
2751
2751
  }
@@ -3363,7 +3363,7 @@ W.MACSTRING = function(t, e) {
3363
3363
  const n = I.MACSTRING(t, e);
3364
3364
  return n !== void 0 ? n.length : 0;
3365
3365
  };
3366
- function Dr(t) {
3366
+ function _r(t) {
3367
3367
  return t >= -128 && t <= 127;
3368
3368
  }
3369
3369
  function qc(t, e, n) {
@@ -3373,13 +3373,13 @@ function qc(t, e, n) {
3373
3373
  ++e, ++r;
3374
3374
  return n.push(128 | r - 1), e;
3375
3375
  }
3376
- function $c(t, e, n) {
3376
+ function jc(t, e, n) {
3377
3377
  let r = 0;
3378
3378
  const s = t.length;
3379
3379
  let i = e;
3380
3380
  for (; i < s && r < 64; ) {
3381
3381
  const a = t[i];
3382
- if (!Dr(a) || a === 0 && i + 1 < s && t[i + 1] === 0)
3382
+ if (!_r(a) || a === 0 && i + 1 < s && t[i + 1] === 0)
3383
3383
  break;
3384
3384
  ++i, ++r;
3385
3385
  }
@@ -3388,13 +3388,13 @@ function $c(t, e, n) {
3388
3388
  n.push(t[a] + 256 & 255);
3389
3389
  return i;
3390
3390
  }
3391
- function jc(t, e, n) {
3391
+ function $c(t, e, n) {
3392
3392
  let r = 0;
3393
3393
  const s = t.length;
3394
3394
  let i = e;
3395
3395
  for (; i < s && r < 64; ) {
3396
3396
  const a = t[i];
3397
- if (a === 0 || Dr(a) && i + 1 < s && Dr(t[i + 1]))
3397
+ if (a === 0 || _r(a) && i + 1 < s && _r(t[i + 1]))
3398
3398
  break;
3399
3399
  ++i, ++r;
3400
3400
  }
@@ -3410,7 +3410,7 @@ I.VARDELTAS = function(t) {
3410
3410
  const n = [];
3411
3411
  for (; e < t.length; ) {
3412
3412
  const r = t[e];
3413
- r === 0 ? e = qc(t, e, n) : r >= -128 && r <= 127 ? e = $c(t, e, n) : e = jc(t, e, n);
3413
+ r === 0 ? e = qc(t, e, n) : r >= -128 && r <= 127 ? e = jc(t, e, n) : e = $c(t, e, n);
3414
3414
  }
3415
3415
  return n;
3416
3416
  };
@@ -3584,7 +3584,7 @@ function Gt(t, e, n) {
3584
3584
  r[s + 1] = { name: t + s, type: "USHORT", value: e[s] };
3585
3585
  return r;
3586
3586
  }
3587
- function _r(t, e, n) {
3587
+ function Ur(t, e, n) {
3588
3588
  const r = e.length, s = new Array(r + 1);
3589
3589
  s[0] = { name: t + "Count", type: "USHORT", value: r };
3590
3590
  for (let i = 0; i < r; i++)
@@ -3666,12 +3666,12 @@ function Dn(t) {
3666
3666
  Dn.prototype = Object.create(fe.prototype);
3667
3667
  Dn.prototype.constructor = Dn;
3668
3668
  function _n(t, e) {
3669
- fe.call(this, "lookupListTable", _r("lookup", t, function(n) {
3669
+ fe.call(this, "lookupListTable", Ur("lookup", t, function(n) {
3670
3670
  let r = e[n.lookupType];
3671
3671
  return H.assert(!!r, "Unable to write GSUB lookup type " + n.lookupType + " tables."), new fe("lookupTable", [
3672
3672
  { name: "lookupType", type: "USHORT", value: n.lookupType },
3673
3673
  { name: "lookupFlag", type: "USHORT", value: n.lookupFlag }
3674
- ].concat(_r("subtable", n.subtables, r)));
3674
+ ].concat(Ur("subtable", n.subtables, r)));
3675
3675
  }));
3676
3676
  }
3677
3677
  _n.prototype = Object.create(fe.prototype);
@@ -3707,7 +3707,7 @@ var A = {
3707
3707
  FeatureList: Dn,
3708
3708
  LookupList: _n,
3709
3709
  ushortList: Gt,
3710
- tableList: _r,
3710
+ tableList: Ur,
3711
3711
  recordList: Ht
3712
3712
  };
3713
3713
  function _s(t, e) {
@@ -4948,7 +4948,7 @@ function nl(t, e, n) {
4948
4948
  return Da[e];
4949
4949
  }
4950
4950
  }
4951
- var Ur = "utf-16", rl = {
4951
+ var Pr = "utf-16", rl = {
4952
4952
  0: "macintosh",
4953
4953
  // smRoman
4954
4954
  1: "x-mac-japanese",
@@ -5042,12 +5042,12 @@ var Ur = "utf-16", rl = {
5042
5042
  function Jr(t, e, n) {
5043
5043
  switch (t) {
5044
5044
  case 0:
5045
- return Ur;
5045
+ return Pr;
5046
5046
  case 1:
5047
5047
  return sl[n] || rl[e];
5048
5048
  case 3:
5049
5049
  if (e === 1 || e === 10)
5050
- return Ur;
5050
+ return Pr;
5051
5051
  break;
5052
5052
  }
5053
5053
  }
@@ -5066,7 +5066,7 @@ function al(t, e, n) {
5066
5066
  const l = s.parseUShort(), u = s.parseUShort(), f = s.parseUShort(), h = s.parseUShort(), p = Nn[h] || h, m = s.parseUShort(), g = s.parseUShort(), b = nl(l, f, n), v = Jr(l, u, f), w = il(l);
5067
5067
  if (v !== void 0 && b !== void 0 && w !== void 0) {
5068
5068
  let C;
5069
- if (v === Ur ? C = Nt.UTF16(t, o + g, m) : C = Nt.MACSTRING(t, o + g, m, v), C) {
5069
+ if (v === Pr ? C = Nt.UTF16(t, o + g, m) : C = Nt.MACSTRING(t, o + g, m, v), C) {
5070
5070
  let F = r[w];
5071
5071
  F === void 0 && (F = r[w] = {});
5072
5072
  let E = F[p];
@@ -6251,7 +6251,7 @@ var Pa = { parse: pl, make: yl }, Fn = [
6251
6251
  "dollarinferior",
6252
6252
  "periodinferior",
6253
6253
  "commainferior"
6254
- ], Pr = [
6254
+ ], Nr = [
6255
6255
  "",
6256
6256
  "",
6257
6257
  "",
@@ -7490,7 +7490,7 @@ function Mt(t, e, n) {
7490
7490
  configurable: !0
7491
7491
  });
7492
7492
  }
7493
- function Yn(t, e) {
7493
+ function Xn(t, e) {
7494
7494
  if (this.font = t, this.glyphs = {}, Array.isArray(e))
7495
7495
  for (let n = 0; n < e.length; n++) {
7496
7496
  const r = e[n];
@@ -7498,7 +7498,7 @@ function Yn(t, e) {
7498
7498
  }
7499
7499
  this.length = e && e.length || 0;
7500
7500
  }
7501
- typeof Symbol < "u" && Symbol.iterator && (Yn.prototype[Symbol.iterator] = function() {
7501
+ typeof Symbol < "u" && Symbol.iterator && (Xn.prototype[Symbol.iterator] = function() {
7502
7502
  let t = -1;
7503
7503
  return {
7504
7504
  next: (function() {
@@ -7508,7 +7508,7 @@ typeof Symbol < "u" && Symbol.iterator && (Yn.prototype[Symbol.iterator] = funct
7508
7508
  }).bind(this)
7509
7509
  };
7510
7510
  });
7511
- Yn.prototype.get = function(t) {
7511
+ Xn.prototype.get = function(t) {
7512
7512
  if (this.font._push && this.glyphs[t] === void 0) {
7513
7513
  this.font._push(t), typeof this.glyphs[t] == "function" && (this.glyphs[t] = this.glyphs[t]());
7514
7514
  let e = this.glyphs[t], n = this.font._IndexToUnicodeMap[t];
@@ -7520,7 +7520,7 @@ Yn.prototype.get = function(t) {
7520
7520
  typeof this.glyphs[t] == "function" && (this.glyphs[t] = this.glyphs[t]());
7521
7521
  return this.glyphs[t];
7522
7522
  };
7523
- Yn.prototype.push = function(t, e) {
7523
+ Xn.prototype.push = function(t, e) {
7524
7524
  this.glyphs[t] = e, this.length++;
7525
7525
  };
7526
7526
  function Ol(t, e) {
@@ -7545,7 +7545,7 @@ function Il(t, e, n, r, s) {
7545
7545
  }, i;
7546
7546
  };
7547
7547
  }
7548
- var tt = { GlyphSet: Yn, glyphLoader: Ol, ttfGlyphLoader: Bl, cffGlyphLoader: Il };
7548
+ var tt = { GlyphSet: Xn, glyphLoader: Ol, ttfGlyphLoader: Bl, cffGlyphLoader: Il };
7549
7549
  function qa(t, e) {
7550
7550
  if (t === e)
7551
7551
  return !0;
@@ -7687,7 +7687,7 @@ function Nl(t, e) {
7687
7687
  throw new Error(`Unsupported CFF table version ${n.formatMajor}.${n.formatMinor}`);
7688
7688
  return n.size = _.getCard8(t, e + 2), n.formatMajor < 2 ? (n.offsetSize = _.getCard8(t, e + 3), n.startOffset = e, n.endOffset = e + 4) : (n.topDictLength = _.getCard16(t, e + 3), n.endOffset = e + 8), n;
7689
7689
  }
7690
- var $a = [
7690
+ var ja = [
7691
7691
  { name: "version", op: 0, type: "SID" },
7692
7692
  { name: "notice", op: 1, type: "SID" },
7693
7693
  { name: "copyright", op: 1200, type: "SID" },
@@ -7734,7 +7734,7 @@ var $a = [
7734
7734
  { name: "fdArray", op: 1236, type: "offset" },
7735
7735
  { name: "fdSelect", op: 1237, type: "offset" },
7736
7736
  { name: "vstore", op: 24, type: "offset" }
7737
- ], ja = [
7737
+ ], $a = [
7738
7738
  { name: "subrs", op: 19, type: "offset", value: 0 },
7739
7739
  { name: "defaultWidthX", op: 20, type: "number", value: 0 },
7740
7740
  { name: "nominalWidthX", op: 21, type: "number", value: 0 }
@@ -7760,11 +7760,11 @@ var $a = [
7760
7760
  ];
7761
7761
  function Wl(t, e, n, r) {
7762
7762
  const s = ns(t, e, t.byteLength, r);
7763
- return rs(s, r > 1 ? Gl : $a, n);
7763
+ return rs(s, r > 1 ? Gl : ja, n);
7764
7764
  }
7765
7765
  function ss(t, e, n, r, s) {
7766
7766
  const i = ns(t, e, n, s);
7767
- return rs(i, s > 1 ? Hl : ja, r);
7767
+ return rs(i, s > 1 ? Hl : $a, r);
7768
7768
  }
7769
7769
  function Vl(t, e, n) {
7770
7770
  const r = ns(t, e, void 0, n);
@@ -7786,7 +7786,7 @@ function ql(t, e, n) {
7786
7786
  }
7787
7787
  return r;
7788
7788
  }
7789
- function sr(t, e, n, r, s) {
7789
+ function ir(t, e, n, r, s) {
7790
7790
  const i = [];
7791
7791
  for (let a = 0; a < n.length; a += 1) {
7792
7792
  const o = new DataView(new Uint8Array(n[a]).buffer), c = Wl(o, 0, r, s);
@@ -7804,7 +7804,7 @@ function sr(t, e, n, r, s) {
7804
7804
  }
7805
7805
  return i;
7806
7806
  }
7807
- function $l(t, e, n, r, s) {
7807
+ function jl(t, e, n, r, s) {
7808
7808
  let i, a;
7809
7809
  const o = new _.Parser(t, e);
7810
7810
  n -= 1;
@@ -7828,7 +7828,7 @@ function $l(t, e, n, r, s) {
7828
7828
  throw new Error("Unknown charset format " + l);
7829
7829
  return c;
7830
7830
  }
7831
- function jl(t, e) {
7831
+ function $l(t, e) {
7832
7832
  let n;
7833
7833
  const r = {}, s = new _.Parser(t, e), i = s.parseCard8();
7834
7834
  if (i === 0) {
@@ -7856,13 +7856,13 @@ function Ya(t, e) {
7856
7856
  const n = t.tables.cff && t.tables.cff.topDict && t.tables.cff.topDict.paintType || 0;
7857
7857
  return n === 2 && (e.fill = null, e.stroke = "black", e.strokeWidth = t.tables.cff.topDict.strokeWidth || 0), n;
7858
7858
  }
7859
- function Nr(t, e, n, r, s) {
7859
+ function Gr(t, e, n, r, s) {
7860
7860
  let i, a, o, c;
7861
7861
  const l = new Pt(), u = [];
7862
7862
  let f = 0, h = !1, p = !1, m = 0, g = 0, b, v, w, C, F = 0, E = [], B, N = 0;
7863
7863
  const z = t.tables.cff2 || t.tables.cff;
7864
7864
  if (w = z.topDict._defaultWidthX, C = z.topDict._nominalWidthX, s = s || t.variation && t.variation.get(), e.getBlendPath || (e.getBlendPath = function(R) {
7865
- return Nr(t, e, n, r, R);
7865
+ return Gr(t, e, n, r, R);
7866
7866
  }), t.isCIDFont || r > 1) {
7867
7867
  const R = z.topDict._fdSelect ? z.topDict._fdSelect[e.index] : 0, D = z.topDict._fdArray[R];
7868
7868
  b = D._subrs, v = D._subrsBias, r > 1 ? (E = z.topDict._vstore.itemVariationStore, F = D._privateDict.vsindex) : (w = D._defaultWidthX, C = D._nominalWidthX);
@@ -7878,7 +7878,7 @@ function Nr(t, e, n, r, s) {
7878
7878
  R = (u.length & 1) !== 0, R && !h && (U = u.shift() + C), f += u.length >> 1, u.length = 0, h = !0;
7879
7879
  }
7880
7880
  function P(R) {
7881
- let D, re, ye, Re, ge, oe, $, Q, pe, xe, me, be, ce = 0;
7881
+ let D, re, ye, Re, ge, oe, j, Q, pe, xe, me, be, ce = 0;
7882
7882
  for (; ce < R.length; ) {
7883
7883
  let Se = R[ce];
7884
7884
  switch (ce += 1, Se) {
@@ -7925,16 +7925,16 @@ function Nr(t, e, n, r, s) {
7925
7925
  case 12:
7926
7926
  switch (Se = R[ce], ce += 1, Se) {
7927
7927
  case 35:
7928
- i = m + u.shift(), a = g + u.shift(), o = i + u.shift(), c = a + u.shift(), $ = o + u.shift(), Q = c + u.shift(), pe = $ + u.shift(), xe = Q + u.shift(), me = pe + u.shift(), be = xe + u.shift(), m = me + u.shift(), g = be + u.shift(), u.shift(), l.curveTo(i, a, o, c, $, Q), l.curveTo(pe, xe, me, be, m, g);
7928
+ i = m + u.shift(), a = g + u.shift(), o = i + u.shift(), c = a + u.shift(), j = o + u.shift(), Q = c + u.shift(), pe = j + u.shift(), xe = Q + u.shift(), me = pe + u.shift(), be = xe + u.shift(), m = me + u.shift(), g = be + u.shift(), u.shift(), l.curveTo(i, a, o, c, j, Q), l.curveTo(pe, xe, me, be, m, g);
7929
7929
  break;
7930
7930
  case 34:
7931
- i = m + u.shift(), a = g, o = i + u.shift(), c = a + u.shift(), $ = o + u.shift(), Q = c, pe = $ + u.shift(), xe = c, me = pe + u.shift(), be = g, m = me + u.shift(), l.curveTo(i, a, o, c, $, Q), l.curveTo(pe, xe, me, be, m, g);
7931
+ i = m + u.shift(), a = g, o = i + u.shift(), c = a + u.shift(), j = o + u.shift(), Q = c, pe = j + u.shift(), xe = c, me = pe + u.shift(), be = g, m = me + u.shift(), l.curveTo(i, a, o, c, j, Q), l.curveTo(pe, xe, me, be, m, g);
7932
7932
  break;
7933
7933
  case 36:
7934
- i = m + u.shift(), a = g + u.shift(), o = i + u.shift(), c = a + u.shift(), $ = o + u.shift(), Q = c, pe = $ + u.shift(), xe = c, me = pe + u.shift(), be = xe + u.shift(), m = me + u.shift(), l.curveTo(i, a, o, c, $, Q), l.curveTo(pe, xe, me, be, m, g);
7934
+ i = m + u.shift(), a = g + u.shift(), o = i + u.shift(), c = a + u.shift(), j = o + u.shift(), Q = c, pe = j + u.shift(), xe = c, me = pe + u.shift(), be = xe + u.shift(), m = me + u.shift(), l.curveTo(i, a, o, c, j, Q), l.curveTo(pe, xe, me, be, m, g);
7935
7935
  break;
7936
7936
  case 37:
7937
- i = m + u.shift(), a = g + u.shift(), o = i + u.shift(), c = a + u.shift(), $ = o + u.shift(), Q = c + u.shift(), pe = $ + u.shift(), xe = Q + u.shift(), me = pe + u.shift(), be = xe + u.shift(), Math.abs(me - m) > Math.abs(be - g) ? m = me + u.shift() : g = be + u.shift(), l.curveTo(i, a, o, c, $, Q), l.curveTo(pe, xe, me, be, m, g);
7937
+ i = m + u.shift(), a = g + u.shift(), o = i + u.shift(), c = a + u.shift(), j = o + u.shift(), Q = c + u.shift(), pe = j + u.shift(), xe = Q + u.shift(), me = pe + u.shift(), be = xe + u.shift(), Math.abs(me - m) > Math.abs(be - g) ? m = me + u.shift() : g = be + u.shift(), l.curveTo(i, a, o, c, j, Q), l.curveTo(pe, xe, me, be, m, g);
7938
7938
  break;
7939
7939
  default:
7940
7940
  console.log("Glyph " + e.index + ": unknown operator 1200" + Se), u.length = 0;
@@ -7946,7 +7946,7 @@ function Nr(t, e, n, r, s) {
7946
7946
  break;
7947
7947
  }
7948
7948
  if (u.length >= 4) {
7949
- const nt = Pr[u.pop()], x = Pr[u.pop()], d = u.pop(), y = u.pop();
7949
+ const nt = Nr[u.pop()], x = Nr[u.pop()], d = u.pop(), y = u.pop();
7950
7950
  if (nt && x) {
7951
7951
  e.isComposite = !0, e.components = [];
7952
7952
  const S = t.cffEncoding.charset.indexOf(nt), k = t.cffEncoding.charset.indexOf(x);
@@ -7961,8 +7961,8 @@ function Nr(t, e, n, r, s) {
7961
7961
  }), l.extend(t.glyphs.get(k).path);
7962
7962
  const L = t.glyphs.get(S), O = JSON.parse(JSON.stringify(L.path.commands));
7963
7963
  for (let Y = 0; Y < O.length; Y += 1) {
7964
- const j = O[Y];
7965
- j.type !== "Z" && (j.x += y, j.y += d), (j.type === "Q" || j.type === "C") && (j.x1 += y, j.y1 += d), j.type === "C" && (j.x2 += y, j.y2 += d);
7964
+ const $ = O[Y];
7965
+ $.type !== "Z" && ($.x += y, $.y += d), ($.type === "Q" || $.type === "C") && ($.x1 += y, $.y1 += d), $.type === "C" && ($.x2 += y, $.y2 += d);
7966
7966
  }
7967
7967
  l.extend(O);
7968
7968
  }
@@ -8101,9 +8101,9 @@ function Xl(t, e, n, r) {
8101
8101
  let u;
8102
8102
  if (i.formatMajor > 1) {
8103
8103
  const h = e + i.size, p = _.getBytes(t, h, h + i.topDictLength);
8104
- u = sr(t, 0, [p], void 0, i.formatMajor)[0];
8104
+ u = ir(t, 0, [p], void 0, i.formatMajor)[0];
8105
8105
  } else {
8106
- const h = sr(t, e, o.objects, c.objects, i.formatMajor);
8106
+ const h = ir(t, e, o.objects, c.objects, i.formatMajor);
8107
8107
  if (h.length !== 1)
8108
8108
  throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " + h.length);
8109
8109
  u = h[0];
@@ -8119,7 +8119,7 @@ function Xl(t, e, n, r) {
8119
8119
  if (h === 0 || p === 0)
8120
8120
  throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
8121
8121
  h += e;
8122
- const m = Ze(t, h), g = sr(t, e, m.objects, c.objects, i.formatMajor);
8122
+ const m = Ze(t, h), g = ir(t, e, m.objects, c.objects, i.formatMajor);
8123
8123
  u._fdArray = g, p += e, u._fdSelect = Hs(t, p, n.numGlyphs, g.length, i.formatMajor);
8124
8124
  }
8125
8125
  if (i.formatMajor < 2) {
@@ -8133,17 +8133,17 @@ function Xl(t, e, n, r) {
8133
8133
  let f;
8134
8134
  if (r.lowMemory ? (f = Rl(t, e + u.charStrings, i.formatMajor), n.nGlyphs = f.offsets.length - (i.formatMajor > 1 ? 1 : 0)) : (f = Ze(t, e + u.charStrings, null, i.formatMajor), n.nGlyphs = f.objects.length), i.formatMajor > 1 && n.tables.maxp && n.nGlyphs !== n.tables.maxp.numGlyphs && console.error(`Glyph count in the CFF2 table (${n.nGlyphs}) must correspond to the glyph count in the maxp table (${n.tables.maxp.numGlyphs})`), i.formatMajor < 2) {
8135
8135
  let h = [], p = [];
8136
- u.charset === 0 ? h = bl : u.charset === 1 ? h = xl : u.charset === 2 ? h = vl : h = $l(t, e + u.charset, n.nGlyphs, c.objects, n.isCIDFont), u.encoding === 0 ? p = Pr : u.encoding === 1 ? p = Sl : p = jl(t, e + u.encoding), n.cffEncoding = new Ha(p, h), n.encoding = n.encoding || n.cffEncoding;
8136
+ u.charset === 0 ? h = bl : u.charset === 1 ? h = xl : u.charset === 2 ? h = vl : h = jl(t, e + u.charset, n.nGlyphs, c.objects, n.isCIDFont), u.encoding === 0 ? p = Nr : u.encoding === 1 ? p = Sl : p = $l(t, e + u.encoding), n.cffEncoding = new Ha(p, h), n.encoding = n.encoding || n.cffEncoding;
8137
8137
  }
8138
8138
  if (n.glyphs = new tt.GlyphSet(n), r.lowMemory)
8139
8139
  n._push = function(h) {
8140
8140
  const p = Dl(h, f.offsets, t, e + u.charStrings, void 0, i.formatMajor);
8141
- n.glyphs.push(h, tt.cffGlyphLoader(n, h, Nr, p, i.formatMajor));
8141
+ n.glyphs.push(h, tt.cffGlyphLoader(n, h, Gr, p, i.formatMajor));
8142
8142
  };
8143
8143
  else
8144
8144
  for (let h = 0; h < n.nGlyphs; h += 1) {
8145
8145
  const p = f.objects[h];
8146
- n.glyphs.push(h, tt.cffGlyphLoader(n, h, Nr, p, i.formatMajor));
8146
+ n.glyphs.push(h, tt.cffGlyphLoader(n, h, Gr, p, i.formatMajor));
8147
8147
  }
8148
8148
  if (u.vstore) {
8149
8149
  const h = new _.Parser(t, e + u.vstore);
@@ -8184,7 +8184,7 @@ function zs(t, e, n) {
8184
8184
  const r = new A.Record("Top DICT", [
8185
8185
  { name: "dict", type: "DICT", value: {} }
8186
8186
  ]);
8187
- return r.dict = Za($a, t, e), r;
8187
+ return r.dict = Za(ja, t, e), r;
8188
8188
  }
8189
8189
  function Ws(t) {
8190
8190
  const e = new A.Record("Top DICT INDEX", [
@@ -8259,7 +8259,7 @@ function ru(t, e, n) {
8259
8259
  const r = new A.Record("Private DICT", [
8260
8260
  { name: "dict", type: "DICT", value: {} }
8261
8261
  ]);
8262
- return r.dict = Za(ja, t, e), r;
8262
+ return r.dict = Za($a, t, e), r;
8263
8263
  }
8264
8264
  function su(t, e) {
8265
8265
  const n = new A.Table("CFF ", [
@@ -8295,7 +8295,7 @@ function su(t, e) {
8295
8295
  const f = n.header.sizeOf() + n.nameIndex.sizeOf() + n.topDictIndex.sizeOf() + n.stringIndex.sizeOf() + n.globalSubrIndex.sizeOf();
8296
8296
  return s.charset = f, s.encoding = 0, s.charStrings = s.charset + n.charsets.sizeOf(), s.private[1] = s.charStrings + n.charStringsIndex.sizeOf(), u = zs(s, l), n.topDictIndex = Ws(u), n;
8297
8297
  }
8298
- var Gr = { parse: Xl, make: su };
8298
+ var Hr = { parse: Xl, make: su };
8299
8299
  function iu(t, e) {
8300
8300
  const n = {}, r = new _.Parser(t, e);
8301
8301
  return n.version = r.parseVersion(), n.fontRevision = Math.round(r.parseFixed() * 1e3) / 1e3, n.checkSumAdjustment = r.parseULong(), n.magicNumber = r.parseULong(), H.argument(n.magicNumber === 1594834165, "Font header has wrong magic number."), n.flags = r.parseUShort(), n.unitsPerEm = r.parseUShort(), n.created = r.parseLongDateTime(), n.modified = r.parseLongDateTime(), n.xMin = r.parseShort(), n.yMin = r.parseShort(), n.xMax = r.parseShort(), n.yMax = r.parseShort(), n.macStyle = r.parseUShort(), n.lowestRecPPEM = r.parseUShort(), n.fontDirectionHint = r.parseShort(), n.indexToLocFormat = r.parseShort(), n.glyphDataFormat = r.parseShort(), n;
@@ -8419,7 +8419,7 @@ function mu(t) {
8419
8419
  { name: "numGlyphs", type: "USHORT", value: t }
8420
8420
  ]);
8421
8421
  }
8422
- var to = { parse: gu, make: mu }, Hr = [
8422
+ var to = { parse: gu, make: mu }, zr = [
8423
8423
  { begin: 0, end: 127 },
8424
8424
  // Basic Latin
8425
8425
  { begin: 128, end: 255 },
@@ -8668,8 +8668,8 @@ var to = { parse: gu, make: mu }, Hr = [
8668
8668
  // Domino Tiles
8669
8669
  ];
8670
8670
  function yu(t) {
8671
- for (let e = 0; e < Hr.length; e += 1) {
8672
- const n = Hr[e];
8671
+ for (let e = 0; e < zr.length; e += 1) {
8672
+ const n = zr[e];
8673
8673
  if (t >= n.begin && t < n.end)
8674
8674
  return e;
8675
8675
  }
@@ -8732,7 +8732,7 @@ function xu(t) {
8732
8732
  { name: "usMaxContext", type: "USHORT", value: 0 }
8733
8733
  ], t);
8734
8734
  }
8735
- var zr = { parse: bu, make: xu, unicodeRanges: Hr, getUnicodeRange: yu };
8735
+ var Wr = { parse: bu, make: xu, unicodeRanges: zr, getUnicodeRange: yu };
8736
8736
  function vu(t, e) {
8737
8737
  const n = {}, r = new _.Parser(t, e);
8738
8738
  switch (n.version = r.parseVersion(), n.italicAngle = r.parseFixed(), n.underlinePosition = r.parseShort(), n.underlineThickness = r.parseShort(), n.isFixedPitch = r.parseULong(), n.minMemType42 = r.parseULong(), n.maxMemType42 = r.parseULong(), n.minMemType1 = r.parseULong(), n.maxMemType1 = r.parseULong(), n.version) {
@@ -8781,8 +8781,8 @@ function Su(t) {
8781
8781
  { name: "maxMemType1", type: "ULONG", value: c }
8782
8782
  ]);
8783
8783
  }
8784
- var no = { parse: vu, make: Su }, $e = new Array(9);
8785
- $e[1] = function() {
8784
+ var no = { parse: vu, make: Su }, je = new Array(9);
8785
+ je[1] = function() {
8786
8786
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
8787
8787
  if (n === 1)
8788
8788
  return {
@@ -8798,7 +8798,7 @@ $e[1] = function() {
8798
8798
  };
8799
8799
  H.assert(!1, "0x" + e.toString(16) + ": lookup type 1 format must be 1 or 2.");
8800
8800
  };
8801
- $e[2] = function() {
8801
+ je[2] = function() {
8802
8802
  const e = this.parseUShort();
8803
8803
  return H.argument(e === 1, "GSUB Multiple Substitution Subtable identifier-format must be 1"), {
8804
8804
  substFormat: e,
@@ -8806,7 +8806,7 @@ $e[2] = function() {
8806
8806
  sequences: this.parseListOfLists()
8807
8807
  };
8808
8808
  };
8809
- $e[3] = function() {
8809
+ je[3] = function() {
8810
8810
  const e = this.parseUShort();
8811
8811
  return H.argument(e === 1, "GSUB Alternate Substitution Subtable identifier-format must be 1"), {
8812
8812
  substFormat: e,
@@ -8814,7 +8814,7 @@ $e[3] = function() {
8814
8814
  alternateSets: this.parseListOfLists()
8815
8815
  };
8816
8816
  };
8817
- $e[4] = function() {
8817
+ je[4] = function() {
8818
8818
  const e = this.parseUShort();
8819
8819
  return H.argument(e === 1, "GSUB ligature table identifier-format must be 1"), {
8820
8820
  substFormat: e,
@@ -8831,7 +8831,7 @@ var Rt = {
8831
8831
  sequenceIndex: T.uShort,
8832
8832
  lookupListIndex: T.uShort
8833
8833
  };
8834
- $e[5] = function() {
8834
+ je[5] = function() {
8835
8835
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
8836
8836
  if (n === 1)
8837
8837
  return {
@@ -8868,7 +8868,7 @@ $e[5] = function() {
8868
8868
  }
8869
8869
  H.assert(!1, "0x" + e.toString(16) + ": lookup type 5 format must be 1, 2 or 3.");
8870
8870
  };
8871
- $e[6] = function() {
8871
+ je[6] = function() {
8872
8872
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
8873
8873
  if (n === 1)
8874
8874
  return {
@@ -8909,17 +8909,17 @@ $e[6] = function() {
8909
8909
  };
8910
8910
  H.assert(!1, "0x" + e.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
8911
8911
  };
8912
- $e[7] = function() {
8912
+ je[7] = function() {
8913
8913
  const e = this.parseUShort();
8914
8914
  H.argument(e === 1, "GSUB Extension Substitution subtable identifier-format must be 1");
8915
8915
  const n = this.parseUShort(), r = new T(this.data, this.offset + this.parseULong());
8916
8916
  return {
8917
8917
  substFormat: 1,
8918
8918
  lookupType: n,
8919
- extension: $e[n].call(r)
8919
+ extension: je[n].call(r)
8920
8920
  };
8921
8921
  };
8922
- $e[8] = function() {
8922
+ je[8] = function() {
8923
8923
  const e = this.parseUShort();
8924
8924
  return H.argument(e === 1, "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"), {
8925
8925
  substFormat: e,
@@ -8936,12 +8936,12 @@ function wu(t, e) {
8936
8936
  version: r,
8937
8937
  scripts: n.parseScriptList(),
8938
8938
  features: n.parseFeatureList(),
8939
- lookups: n.parseLookupList($e)
8939
+ lookups: n.parseLookupList(je)
8940
8940
  } : {
8941
8941
  version: r,
8942
8942
  scripts: n.parseScriptList(),
8943
8943
  features: n.parseFeatureList(),
8944
- lookups: n.parseLookupList($e),
8944
+ lookups: n.parseLookupList(je),
8945
8945
  variations: n.parseFeatureVariationsList()
8946
8946
  };
8947
8947
  }
@@ -9482,7 +9482,7 @@ function qu() {
9482
9482
  console.warn("Writing of cvar tables is not yet supported.");
9483
9483
  }
9484
9484
  var lo = { make: qu, parse: Vu };
9485
- function $u(t, e, n, r) {
9485
+ function ju(t, e, n, r) {
9486
9486
  const s = new _.Parser(t, e), i = s.parseUShort(), a = s.parseUShort();
9487
9487
  i !== 1 && console.warn(`Unsupported gvar table version ${i}.${a}`);
9488
9488
  const o = s.parseUShort();
@@ -9496,10 +9496,10 @@ function $u(t, e, n, r) {
9496
9496
  glyphVariations: u
9497
9497
  };
9498
9498
  }
9499
- function ju() {
9499
+ function $u() {
9500
9500
  console.warn("Writing of gvar tables is not yet supported.");
9501
9501
  }
9502
- var uo = { make: ju, parse: $u };
9502
+ var uo = { make: $u, parse: ju };
9503
9503
  function Yu(t, e) {
9504
9504
  const n = {}, r = new _.Parser(t, e);
9505
9505
  n.version = r.parseUShort(), H.argument(n.version <= 1, "Unsupported gasp table version."), n.numRanges = r.parseUShort(), n.gaspRanges = [];
@@ -9607,7 +9607,7 @@ function po(t) {
9607
9607
  return a.value.tag > o.value.tag ? 1 : -1;
9608
9608
  }), e.fields = e.fields.concat(r), e.fields = e.fields.concat(s), e;
9609
9609
  }
9610
- function $s(t, e, n) {
9610
+ function js(t, e, n) {
9611
9611
  for (let r = 0; r < e.length; r += 1) {
9612
9612
  const s = t.charToGlyphIndex(e[r]);
9613
9613
  if (s > 0)
@@ -9629,7 +9629,7 @@ function Ju(t) {
9629
9629
  if (isNaN(ve.advanceWidth))
9630
9630
  throw new Error("Glyph " + ve.name + " (" + J + "): advanceWidth is not a number.");
9631
9631
  (c > Ee || c === void 0) && Ee > 0 && (c = Ee), l < Ee && (l = Ee);
9632
- const Le = zr.getUnicodeRange(Ee);
9632
+ const Le = Wr.getUnicodeRange(Ee);
9633
9633
  if (Le < 32)
9634
9634
  u |= 1 << Le;
9635
9635
  else if (Le < 64)
@@ -9677,7 +9677,7 @@ function Ju(t) {
9677
9677
  minRightSideBearing: m.minRightSideBearing,
9678
9678
  xMaxExtent: m.maxLeftSideBearing + (m.xMax - m.xMin),
9679
9679
  numberOfHMetrics: t.glyphs.length
9680
- }), w = to.make(t.glyphs.length), C = zr.make(Object.assign({
9680
+ }), w = to.make(t.glyphs.length), C = Wr.make(Object.assign({
9681
9681
  xAvgCharWidth: Math.round(m.advanceWidthAvg),
9682
9682
  usFirstCharIndex: c,
9683
9683
  usLastCharIndex: l,
@@ -9696,8 +9696,8 @@ function Ju(t) {
9696
9696
  usWinDescent: Math.abs(m.yMin),
9697
9697
  ulCodePageRange1: 1,
9698
9698
  // FIXME: hard-code Latin 1 support for now
9699
- sxHeight: $s(t, "xyvw", { yMax: Math.round(m.ascender / 2) }).yMax,
9700
- sCapHeight: $s(t, "HIKLEFJMNTZBDPRAGOQSUVWXY", m).yMax,
9699
+ sxHeight: js(t, "xyvw", { yMax: Math.round(m.ascender / 2) }).yMax,
9700
+ sCapHeight: js(t, "HIKLEFJMNTZBDPRAGOQSUVWXY", m).yMax,
9701
9701
  usDefaultChar: t.hasChar(" ") ? 32 : 0,
9702
9702
  // Use space as the default character, if available.
9703
9703
  usBreakChar: t.hasChar(" ") ? 32 : 0
@@ -9718,7 +9718,7 @@ function Ju(t) {
9718
9718
  U[J].postScriptName || (U[J].postScriptName = { en: q });
9719
9719
  }
9720
9720
  U.unicode.preferredFamily || (U.unicode.preferredFamily = Z.fontFamily || ie.fontFamily || P.fontFamily), U.macintosh.preferredFamily || (U.macintosh.preferredFamily = ie.fontFamily || Z.fontFamily || P.fontFamily), U.windows.preferredFamily || (U.windows.preferredFamily = P.fontFamily || Z.fontFamily || ie.fontFamily), U.unicode.preferredSubfamily || (U.unicode.preferredSubfamily = Z.fontSubfamily || ie.fontSubfamily || P.fontSubfamily), U.macintosh.preferredSubfamily || (U.macintosh.preferredSubfamily = ie.fontSubfamily || Z.fontSubfamily || P.fontSubfamily), U.windows.preferredSubfamily || (U.windows.preferredSubfamily = P.fontSubfamily || Z.fontSubfamily || ie.fontSubfamily);
9721
- const R = [], D = Ua.make(U, R), re = R.length > 0 ? eo.make(R) : void 0, ye = no.make(t), Re = Gr.make(t.glyphs, {
9721
+ const R = [], D = Ua.make(U, R), re = R.length > 0 ? eo.make(R) : void 0, ye = no.make(t), Re = Hr.make(t.glyphs, {
9722
9722
  version: t.getEnglishName("version"),
9723
9723
  fullName: z,
9724
9724
  familyName: B,
@@ -9729,7 +9729,7 @@ function Ju(t) {
9729
9729
  topDict: t.tables.cff && t.tables.cff.topDict || {}
9730
9730
  }), ge = t.metas && Object.keys(t.metas).length > 0 ? so.make(t.metas) : void 0, oe = [b, v, w, C, D, E, ye, Re, F];
9731
9731
  re && oe.push(re);
9732
- const $ = {
9732
+ const j = {
9733
9733
  gsub: ro,
9734
9734
  cpal: Va,
9735
9735
  colr: io,
@@ -9744,10 +9744,10 @@ function Ju(t) {
9744
9744
  avar: [t.tables.fvar],
9745
9745
  fvar: [t.names]
9746
9746
  };
9747
- for (let J in $) {
9747
+ for (let J in j) {
9748
9748
  const ve = t.tables[J];
9749
9749
  if (ve) {
9750
- const Ee = $[J].make.call(t, ve, ...Q[J] || []);
9750
+ const Ee = j[J].make.call(t, ve, ...Q[J] || []);
9751
9751
  Ee && oe.push(Ee);
9752
9752
  }
9753
9753
  }
@@ -9764,7 +9764,7 @@ function Ju(t) {
9764
9764
  return pe;
9765
9765
  }
9766
9766
  var eh = { make: po, fontToTable: Ju, computeCheckSum: is };
9767
- function ir(t, e) {
9767
+ function ar(t, e) {
9768
9768
  let n = 0, r = t.length - 1;
9769
9769
  for (; n <= r; ) {
9770
9770
  const s = n + r >>> 1, i = t[s].tag;
@@ -9774,7 +9774,7 @@ function ir(t, e) {
9774
9774
  }
9775
9775
  return -n - 1;
9776
9776
  }
9777
- function js(t, e) {
9777
+ function $s(t, e) {
9778
9778
  let n = 0, r = t.length - 1;
9779
9779
  for (; n <= r; ) {
9780
9780
  const s = n + r >>> 1, i = t[s];
@@ -9810,7 +9810,7 @@ go.prototype = {
9810
9810
  * @param {string} tag
9811
9811
  * @return {number}
9812
9812
  */
9813
- searchTag: ir,
9813
+ searchTag: ar,
9814
9814
  /**
9815
9815
  * Binary search in a list of numbers
9816
9816
  * @instance
@@ -9820,7 +9820,7 @@ go.prototype = {
9820
9820
  * @param {number} value
9821
9821
  * @return {number}
9822
9822
  */
9823
- binSearch: js,
9823
+ binSearch: $s,
9824
9824
  /**
9825
9825
  * Get or create the Layout table (GSUB, GPOS etc).
9826
9826
  * @param {boolean} create - Whether to create a new one.
@@ -9870,7 +9870,7 @@ go.prototype = {
9870
9870
  const n = this.getTable(e);
9871
9871
  if (n) {
9872
9872
  t = t || "DFLT";
9873
- const r = n.scripts, s = ir(n.scripts, t);
9873
+ const r = n.scripts, s = ar(n.scripts, t);
9874
9874
  if (s >= 0)
9875
9875
  return r[s].script;
9876
9876
  if (e) {
@@ -9898,7 +9898,7 @@ go.prototype = {
9898
9898
  if (r) {
9899
9899
  if (!e || e === "dflt" || e === "DFLT")
9900
9900
  return r.defaultLangSys;
9901
- const s = ir(r.langSysRecords, e);
9901
+ const s = ar(r.langSysRecords, e);
9902
9902
  if (s >= 0)
9903
9903
  return r.langSysRecords[s].langSys;
9904
9904
  if (n) {
@@ -9993,7 +9993,7 @@ go.prototype = {
9993
9993
  getCoverageIndex: function(t, e) {
9994
9994
  switch (t.format) {
9995
9995
  case 1: {
9996
- const n = js(t.glyphs, e);
9996
+ const n = $s(t.glyphs, e);
9997
9997
  return n >= 0 ? n : -1;
9998
9998
  }
9999
9999
  case 2: {
@@ -10024,11 +10024,11 @@ go.prototype = {
10024
10024
  }
10025
10025
  }
10026
10026
  };
10027
- var Xn = go;
10027
+ var Zn = go;
10028
10028
  function ln(t) {
10029
- Xn.call(this, t, "gpos");
10029
+ Zn.call(this, t, "gpos");
10030
10030
  }
10031
- ln.prototype = Xn.prototype;
10031
+ ln.prototype = Zn.prototype;
10032
10032
  ln.prototype.init = function() {
10033
10033
  const t = this.getDefaultScriptName();
10034
10034
  this.defaultKerningTables = this.getKerningTables(t);
@@ -10144,7 +10144,7 @@ function oh(t) {
10144
10144
  };
10145
10145
  }
10146
10146
  function Ue(t) {
10147
- Xn.call(this, t, "gsub");
10147
+ Zn.call(this, t, "gsub");
10148
10148
  }
10149
10149
  function as(t, e, n) {
10150
10150
  const r = t.subtables;
@@ -10156,7 +10156,7 @@ function as(t, e, n) {
10156
10156
  if (n)
10157
10157
  return r.push(n), n;
10158
10158
  }
10159
- Ue.prototype = Xn.prototype;
10159
+ Ue.prototype = Zn.prototype;
10160
10160
  Ue.prototype.createDefaultTable = function() {
10161
10161
  return {
10162
10162
  version: 1,
@@ -10761,7 +10761,7 @@ function yh(t, e) {
10761
10761
  const g = new Image(p, m);
10762
10762
  return g.src = "data:image/svg+xml;charset=utf-8," + encodeURIComponent(r.outerHTML), { leftSideBearing: f, baseline: h, image: g };
10763
10763
  }
10764
- var ar = /* @__PURE__ */ new WeakMap();
10764
+ var or = /* @__PURE__ */ new WeakMap();
10765
10765
  function Zs(t, e, n, r, s) {
10766
10766
  let i;
10767
10767
  return (e & r) > 0 ? (i = t.parseByte(), e & s || (i = -i), i = n + i) : (e & s) > 0 ? i = n : i = n + t.parseShort(), i;
@@ -10877,8 +10877,8 @@ function os(t) {
10877
10877
  }
10878
10878
  function xo(t, e) {
10879
10879
  if (e.isComposite) {
10880
- ar.has(t) || ar.set(t, /* @__PURE__ */ new Set());
10881
- const n = ar.get(t);
10880
+ or.has(t) || or.set(t, /* @__PURE__ */ new Set());
10881
+ const n = or.get(t);
10882
10882
  n.add(e.index);
10883
10883
  try {
10884
10884
  for (let r = 0; r < e.components.length; r += 1) {
@@ -11376,7 +11376,7 @@ var vo = { getPath: os, parse: Sh }, wh = class {
11376
11376
  hvar() {
11377
11377
  return this.font.tables.hvar;
11378
11378
  }
11379
- }, Ks = 1e6, Wn = 64, Vn = 1e4, So, Ft, wo, Wr;
11379
+ }, Ks = 1e6, Wn = 64, Vn = 1e4, So, Ft, wo, Vr;
11380
11380
  function Co(t) {
11381
11381
  this.font = t, this.getCommands = function(e) {
11382
11382
  return vo.getPath(e).commands;
@@ -11638,13 +11638,13 @@ wo = function(t, e) {
11638
11638
  const n = e.ppem / e.font.unitsPerEm, r = n;
11639
11639
  let s = t.components, i, a, o;
11640
11640
  if (pt.prototype = e, !s)
11641
- o = new pt("glyf", t.instructions), o.instructionCount = 0, o.callDepth = 0, Wr(t, o, n, r), a = o.gZone;
11641
+ o = new pt("glyf", t.instructions), o.instructionCount = 0, o.callDepth = 0, Vr(t, o, n, r), a = o.gZone;
11642
11642
  else {
11643
11643
  const c = e.font;
11644
11644
  a = [], i = [];
11645
11645
  for (let l = 0; l < s.length; l++) {
11646
11646
  const u = s[l], f = c.glyphs.get(u.glyphIndex);
11647
- o = new pt("glyf", f.instructions), o.instructionCount = 0, o.callDepth = 0, Wr(f, o, n, r);
11647
+ o = new pt("glyf", f.instructions), o.instructionCount = 0, o.callDepth = 0, Vr(f, o, n, r);
11648
11648
  const h = Math.round(u.dx * n), p = Math.round(u.dy * r), m = o.gZone, g = o.contours;
11649
11649
  for (let v = 0; v < m.length; v++) {
11650
11650
  const w = m[v];
@@ -11662,7 +11662,7 @@ wo = function(t, e) {
11662
11662
  }
11663
11663
  return a;
11664
11664
  };
11665
- Wr = function(t, e, n, r) {
11665
+ Vr = function(t, e, n, r) {
11666
11666
  const s = t.points || [], i = s.length, a = e.gZone = e.z0 = e.z1 = e.z2 = [], o = e.contours = [];
11667
11667
  let c;
11668
11668
  for (let f = 0; f < i; f++)
@@ -11697,7 +11697,7 @@ Ft = function(t) {
11697
11697
  r(t);
11698
11698
  }
11699
11699
  };
11700
- function Zn(t) {
11700
+ function Kn(t) {
11701
11701
  const e = t.tZone = new Array(t.gZone.length);
11702
11702
  for (let n = 0; n < e.length; n++)
11703
11703
  e[n] = new lt(0, 0);
@@ -11778,7 +11778,7 @@ function Nh(t) {
11778
11778
  const e = t.stack.pop();
11779
11779
  switch (t.zp0 = e, e) {
11780
11780
  case 0:
11781
- t.tZone || Zn(t), t.z0 = t.tZone;
11781
+ t.tZone || Kn(t), t.z0 = t.tZone;
11782
11782
  break;
11783
11783
  case 1:
11784
11784
  t.z0 = t.gZone;
@@ -11791,7 +11791,7 @@ function Gh(t) {
11791
11791
  const e = t.stack.pop();
11792
11792
  switch (t.zp1 = e, e) {
11793
11793
  case 0:
11794
- t.tZone || Zn(t), t.z1 = t.tZone;
11794
+ t.tZone || Kn(t), t.z1 = t.tZone;
11795
11795
  break;
11796
11796
  case 1:
11797
11797
  t.z1 = t.gZone;
@@ -11804,7 +11804,7 @@ function Hh(t) {
11804
11804
  const e = t.stack.pop();
11805
11805
  switch (t.zp2 = e, e) {
11806
11806
  case 0:
11807
- t.tZone || Zn(t), t.z2 = t.tZone;
11807
+ t.tZone || Kn(t), t.z2 = t.tZone;
11808
11808
  break;
11809
11809
  case 1:
11810
11810
  t.z2 = t.gZone;
@@ -11817,7 +11817,7 @@ function zh(t) {
11817
11817
  const e = t.stack.pop();
11818
11818
  switch (t.zp0 = t.zp1 = t.zp2 = e, e) {
11819
11819
  case 0:
11820
- t.tZone || Zn(t), t.z0 = t.z1 = t.z2 = t.tZone;
11820
+ t.tZone || Kn(t), t.z0 = t.z1 = t.z2 = t.tZone;
11821
11821
  break;
11822
11822
  case 1:
11823
11823
  t.z0 = t.z1 = t.z2 = t.gZone;
@@ -11835,11 +11835,11 @@ function Vh(t) {
11835
11835
  function qh(t) {
11836
11836
  t.round = kh;
11837
11837
  }
11838
- function $h(t) {
11838
+ function jh(t) {
11839
11839
  const e = t.stack.pop();
11840
11840
  t.minDis = e / 64;
11841
11841
  }
11842
- function jh(t) {
11842
+ function $h(t) {
11843
11843
  ko(t, !1);
11844
11844
  }
11845
11845
  function Yh(t) {
@@ -11854,7 +11854,7 @@ function Zh(t) {
11854
11854
  const e = t.stack;
11855
11855
  e.push(e[e.length - 1]);
11856
11856
  }
11857
- function or(t) {
11857
+ function cr(t) {
11858
11858
  t.stack.pop();
11859
11859
  }
11860
11860
  function Kh(t) {
@@ -12089,7 +12089,7 @@ function Mf(t) {
12089
12089
  const e = t.stack, n = e.pop();
12090
12090
  e.push(n ? 0 : 1);
12091
12091
  }
12092
- function cr(t, e) {
12092
+ function lr(t, e) {
12093
12093
  const n = e.stack, r = n.pop(), s = e.fv, i = e.pv, a = e.ppem, o = e.deltaBase + (t - 1) * 16, c = e.deltaShift, l = e.z0;
12094
12094
  for (let u = 0; u < r; u++) {
12095
12095
  const f = n.pop(), h = n.pop();
@@ -12149,7 +12149,7 @@ function Hf(t) {
12149
12149
  const e = t.stack, n = e.pop(), r = e.pop();
12150
12150
  t.cvt[r] = n * t.ppem / t.font.unitsPerEm;
12151
12151
  }
12152
- function lr(t, e) {
12152
+ function ur(t, e) {
12153
12153
  const n = e.stack, r = n.pop(), s = e.ppem, i = e.deltaBase + (t - 1) * 16, a = e.deltaShift;
12154
12154
  for (let o = 0; o < r; o++) {
12155
12155
  const c = n.pop(), l = n.pop();
@@ -12236,10 +12236,10 @@ function Vf(t) {
12236
12236
  function qf(t) {
12237
12237
  t.round = Eh;
12238
12238
  }
12239
- function $f(t) {
12239
+ function jf(t) {
12240
12240
  t.round = Lh;
12241
12241
  }
12242
- function jf(t) {
12242
+ function $f(t) {
12243
12243
  t.stack.pop();
12244
12244
  }
12245
12245
  function fi(t, e) {
@@ -12355,9 +12355,9 @@ So = [
12355
12355
  /* 0x19 */
12356
12356
  qh,
12357
12357
  /* 0x1A */
12358
- $h,
12359
- /* 0x1B */
12360
12358
  jh,
12359
+ /* 0x1B */
12360
+ $h,
12361
12361
  /* 0x1C */
12362
12362
  Yh,
12363
12363
  /* 0x1D */
@@ -12371,7 +12371,7 @@ So = [
12371
12371
  /* 0x20 */
12372
12372
  Zh,
12373
12373
  /* 0x21 */
12374
- or,
12374
+ cr,
12375
12375
  /* 0x22 */
12376
12376
  Kh,
12377
12377
  /* 0x23 */
@@ -12498,7 +12498,7 @@ So = [
12498
12498
  /* 0x5C */
12499
12499
  Mf,
12500
12500
  /* 0x5D */
12501
- cr.bind(void 0, 1),
12501
+ lr.bind(void 0, 1),
12502
12502
  /* 0x5E */
12503
12503
  Of,
12504
12504
  /* 0x5F */
@@ -12542,15 +12542,15 @@ So = [
12542
12542
  /* 0x70 */
12543
12543
  Hf,
12544
12544
  /* 0x71 */
12545
- cr.bind(void 0, 2),
12545
+ lr.bind(void 0, 2),
12546
12546
  /* 0x72 */
12547
- cr.bind(void 0, 3),
12547
+ lr.bind(void 0, 3),
12548
12548
  /* 0x73 */
12549
- lr.bind(void 0, 1),
12549
+ ur.bind(void 0, 1),
12550
12550
  /* 0x74 */
12551
- lr.bind(void 0, 2),
12551
+ ur.bind(void 0, 2),
12552
12552
  /* 0x75 */
12553
- lr.bind(void 0, 3),
12553
+ ur.bind(void 0, 3),
12554
12554
  /* 0x76 */
12555
12555
  zf,
12556
12556
  /* 0x77 */
@@ -12568,12 +12568,12 @@ So = [
12568
12568
  /* 0x7C */
12569
12569
  qf,
12570
12570
  /* 0x7D */
12571
- $f,
12571
+ jf,
12572
12572
  /* 0x7E */
12573
- or,
12573
+ cr,
12574
12574
  // actually SANGW, supposed to do only a pop though
12575
12575
  /* 0x7F */
12576
- or,
12576
+ cr,
12577
12577
  // actually AA, supposed to do only a pop though
12578
12578
  /* 0x80 */
12579
12579
  void 0,
@@ -12589,7 +12589,7 @@ So = [
12589
12589
  /* 0x84 */
12590
12590
  void 0,
12591
12591
  /* 0x85 */
12592
- jf,
12592
+ $f,
12593
12593
  /* 0x86 */
12594
12594
  fi.bind(void 0, 0),
12595
12595
  /* 0x87 */
@@ -12849,7 +12849,7 @@ function tp(t, e, n) {
12849
12849
  function ke(t, e) {
12850
12850
  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);
12851
12851
  }
12852
- function Kn(t) {
12852
+ function Qn(t) {
12853
12853
  this.eventId = t, this.subscribers = [];
12854
12854
  }
12855
12855
  function np(t) {
@@ -12871,7 +12871,7 @@ function np(t) {
12871
12871
  for (let r = 0; r < e.length; r++) {
12872
12872
  const s = e[r];
12873
12873
  Object.defineProperty(this.events, s, {
12874
- value: new Kn(s)
12874
+ value: new Qn(s)
12875
12875
  });
12876
12876
  }
12877
12877
  if (t)
@@ -12963,10 +12963,10 @@ he.prototype.registerModifier = function(t, e, n) {
12963
12963
  }
12964
12964
  }), this.registeredModifiers.push(t);
12965
12965
  };
12966
- Kn.prototype.subscribe = function(t) {
12966
+ Qn.prototype.subscribe = function(t) {
12967
12967
  return typeof t == "function" ? this.subscribers.push(t) - 1 : { FAIL: `invalid '${this.eventId}' event handler` };
12968
12968
  };
12969
- Kn.prototype.unsubscribe = function(t) {
12969
+ Qn.prototype.unsubscribe = function(t) {
12970
12970
  this.subscribers.splice(t, 1);
12971
12971
  };
12972
12972
  ke.prototype.setCurrentIndex = function(t) {
@@ -13001,7 +13001,7 @@ he.prototype.on = function(t, e) {
13001
13001
  };
13002
13002
  he.prototype.dispatch = function(t, e) {
13003
13003
  const n = this.events[t];
13004
- if (n instanceof Kn)
13004
+ if (n instanceof Qn)
13005
13005
  for (let r = 0; r < n.subscribers.length; r++)
13006
13006
  n.subscribers[r].apply(this, e || []);
13007
13007
  };
@@ -13131,7 +13131,7 @@ function ap(t, e) {
13131
13131
  let n = mt(t, e.coverage);
13132
13132
  return n === -1 ? null : e.substitute[n];
13133
13133
  }
13134
- function ur(t, e) {
13134
+ function hr(t, e) {
13135
13135
  let n = [];
13136
13136
  for (let r = 0; r < t.length; r++) {
13137
13137
  const s = t[r];
@@ -13145,7 +13145,7 @@ function ur(t, e) {
13145
13145
  function op(t, e) {
13146
13146
  const n = e.inputCoverage.length + e.lookaheadCoverage.length + e.backtrackCoverage.length;
13147
13147
  if (t.context.length < n) return [];
13148
- let r = ur(
13148
+ let r = hr(
13149
13149
  e.inputCoverage,
13150
13150
  t
13151
13151
  );
@@ -13156,7 +13156,7 @@ function op(t, e) {
13156
13156
  for (; i.length && gt(i[0].char); )
13157
13157
  i.shift();
13158
13158
  const a = new ke(i, 0);
13159
- let o = ur(
13159
+ let o = hr(
13160
13160
  e.lookaheadCoverage,
13161
13161
  a
13162
13162
  ), c = [].concat(t.backtrack);
@@ -13164,7 +13164,7 @@ function op(t, e) {
13164
13164
  c.shift();
13165
13165
  if (c.length < e.backtrackCoverage.length) return [];
13166
13166
  const l = new ke(c, 0);
13167
- let u = ur(
13167
+ let u = hr(
13168
13168
  e.backtrackCoverage,
13169
13169
  l
13170
13170
  );
@@ -13499,7 +13499,7 @@ function xp(t, e, n) {
13499
13499
  function vp(t, e, n) {
13500
13500
  e[n].setState(t.tag, t.substitution);
13501
13501
  }
13502
- function hr(t, e, n) {
13502
+ function fr(t, e, n) {
13503
13503
  for (let r = 0; r < t.substitution.length; r++) {
13504
13504
  const s = t.substitution[r], i = e[n + r];
13505
13505
  if (Array.isArray(s)) {
@@ -13519,10 +13519,10 @@ function Sp(t, e, n) {
13519
13519
  var pi = {
13520
13520
  11: xp,
13521
13521
  12: vp,
13522
- 63: hr,
13522
+ 63: fr,
13523
13523
  41: Sp,
13524
- 51: hr,
13525
- 53: hr
13524
+ 51: fr,
13525
+ 53: fr
13526
13526
  };
13527
13527
  function wp(t, e, n) {
13528
13528
  t instanceof ft && pi[t.id] && pi[t.id](t, e, n);
@@ -13771,7 +13771,7 @@ function xi(t, e) {
13771
13771
  const n = t.map((r) => r.activeState.value);
13772
13772
  return new ke(n, e || 0);
13773
13773
  }
13774
- function $p(t) {
13774
+ function jp(t) {
13775
13775
  const e = "thai";
13776
13776
  let n = this.tokenizer.getRangeTokens(t), r = xi(n, 0);
13777
13777
  for (let s = 0; s < r.context.length; s++) {
@@ -13790,8 +13790,8 @@ function $p(t) {
13790
13790
  }
13791
13791
  }
13792
13792
  }
13793
- var jp = $p;
13794
- function Vr(t) {
13793
+ var $p = jp;
13794
+ function qr(t) {
13795
13795
  if (t === null) return !1;
13796
13796
  const e = t.codePointAt(0);
13797
13797
  return (
@@ -13803,11 +13803,11 @@ function Vr(t) {
13803
13803
  }
13804
13804
  function Yp(t) {
13805
13805
  const e = t.current, n = t.get(1);
13806
- return n === null && Vr(e) || Vr(n);
13806
+ return n === null && qr(e) || qr(n);
13807
13807
  }
13808
13808
  function Xp(t) {
13809
13809
  const e = t.get(1);
13810
- return e === null || !Vr(e);
13810
+ return e === null || !qr(e);
13811
13811
  }
13812
13812
  var Zp = {
13813
13813
  startCheck: Yp,
@@ -13936,7 +13936,7 @@ function ad() {
13936
13936
  const t = this.tokenizer.getContextRanges("thaiWord");
13937
13937
  for (let e = 0; e < t.length; e++) {
13938
13938
  const n = t[e];
13939
- this.hasFeatureEnabled("thai", "liga") && qp.call(this, n), this.hasFeatureEnabled("thai", "rlig") && jp.call(this, n), this.hasFeatureEnabled("thai", "ccmp") && Wp.call(this, n);
13939
+ this.hasFeatureEnabled("thai", "liga") && qp.call(this, n), this.hasFeatureEnabled("thai", "rlig") && $p.call(this, n), this.hasFeatureEnabled("thai", "ccmp") && Wp.call(this, n);
13940
13940
  }
13941
13941
  }
13942
13942
  We.prototype.checkContextReady = function(t) {
@@ -13966,7 +13966,7 @@ We.prototype.getTextGlyphs = function(t) {
13966
13966
  return e;
13967
13967
  };
13968
13968
  var od = We;
13969
- function fr(t) {
13969
+ function pr(t) {
13970
13970
  return {
13971
13971
  fontFamily: { en: t.familyName || " " },
13972
13972
  fontSubfamily: { en: t.styleName || " " },
@@ -13992,7 +13992,7 @@ function ne(t) {
13992
13992
  if (!t.unitsPerEm) throw new Error("When creating a new Font object, unitsPerEm is required.");
13993
13993
  if (!t.ascender) throw new Error("When creating a new Font object, ascender is required.");
13994
13994
  if (t.descender > 0) throw new Error("When creating a new Font object, negative descender value is required.");
13995
- this.names = {}, this.names.unicode = fr(t), this.names.macintosh = fr(t), this.names.windows = fr(t), this.unitsPerEm = t.unitsPerEm || 1e3, this.ascender = t.ascender, this.descender = t.descender, this.createdTimestamp = t.createdTimestamp, this.italicAngle = t.italicAngle || 0, this.weightClass = t.weightClass || 0;
13995
+ this.names = {}, this.names.unicode = pr(t), this.names.macintosh = pr(t), this.names.windows = pr(t), this.unitsPerEm = t.unitsPerEm || 1e3, this.ascender = t.ascender, this.descender = t.descender, this.createdTimestamp = t.createdTimestamp, this.italicAngle = t.italicAngle || 0, this.weightClass = t.weightClass || 0;
13996
13996
  let e = 0;
13997
13997
  t.fsSelection ? e = t.fsSelection : (this.italicAngle < 0 ? e |= this.fsSelectionValues.ITALIC : this.italicAngle > 0 && (e |= this.fsSelectionValues.OBLIQUE), this.weightClass >= 600 && (e |= this.fsSelectionValues.BOLD), e === 0 && (e = this.fsSelectionValues.REGULAR)), (!t.panose || !Array.isArray(t.panose)) && (t.panose = [0, 0, 0, 0, 0, 0, 0, 0, 0]), this.tables = Object.assign(t.tables, {
13998
13998
  os2: Object.assign({
@@ -14321,8 +14321,8 @@ function yd(t, e) {
14321
14321
  };
14322
14322
  return r >= 1.2 && (s.markGlyphSets = n.parsePointer(md)), s;
14323
14323
  }
14324
- var bd = { parse: yd }, je = new Array(10);
14325
- je[1] = function() {
14324
+ var bd = { parse: yd }, $e = new Array(10);
14325
+ $e[1] = function() {
14326
14326
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
14327
14327
  if (n === 1)
14328
14328
  return {
@@ -14338,7 +14338,7 @@ je[1] = function() {
14338
14338
  };
14339
14339
  H.assert(!1, "0x" + e.toString(16) + ": GPOS lookup type 1 format must be 1 or 2.");
14340
14340
  };
14341
- je[2] = function() {
14341
+ $e[2] = function() {
14342
14342
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
14343
14343
  H.assert(n === 1 || n === 2, "0x" + e.toString(16) + ": GPOS lookup type 2 format must be 1 or 2.");
14344
14344
  const r = this.parsePointer(T.coverage), s = this.parseUShort(), i = this.parseUShort();
@@ -14378,25 +14378,25 @@ je[2] = function() {
14378
14378
  };
14379
14379
  }
14380
14380
  };
14381
- je[3] = function() {
14381
+ $e[3] = function() {
14382
14382
  return { error: "GPOS Lookup 3 not supported" };
14383
14383
  };
14384
- je[4] = function() {
14384
+ $e[4] = function() {
14385
14385
  return { error: "GPOS Lookup 4 not supported" };
14386
14386
  };
14387
- je[5] = function() {
14387
+ $e[5] = function() {
14388
14388
  return { error: "GPOS Lookup 5 not supported" };
14389
14389
  };
14390
- je[6] = function() {
14390
+ $e[6] = function() {
14391
14391
  return { error: "GPOS Lookup 6 not supported" };
14392
14392
  };
14393
- je[7] = function() {
14393
+ $e[7] = function() {
14394
14394
  return { error: "GPOS Lookup 7 not supported" };
14395
14395
  };
14396
- je[8] = function() {
14396
+ $e[8] = function() {
14397
14397
  return { error: "GPOS Lookup 8 not supported" };
14398
14398
  };
14399
- je[9] = function() {
14399
+ $e[9] = function() {
14400
14400
  return { error: "GPOS Lookup 9 not supported" };
14401
14401
  };
14402
14402
  function xd(t, e) {
@@ -14406,12 +14406,12 @@ function xd(t, e) {
14406
14406
  version: r,
14407
14407
  scripts: n.parseScriptList(),
14408
14408
  features: n.parseFeatureList(),
14409
- lookups: n.parseLookupList(je)
14409
+ lookups: n.parseLookupList($e)
14410
14410
  } : {
14411
14411
  version: r,
14412
14412
  scripts: n.parseScriptList(),
14413
14413
  features: n.parseFeatureList(),
14414
- lookups: n.parseLookupList(je),
14414
+ lookups: n.parseLookupList($e),
14415
14415
  variations: n.parseFeatureVariationsList()
14416
14416
  };
14417
14417
  }
@@ -14586,7 +14586,7 @@ function Md(t, e = {}) {
14586
14586
  z = R;
14587
14587
  break;
14588
14588
  case "OS/2":
14589
- D = ee(i, R), s.tables.os2 = zr.parse(D.data, D.offset);
14589
+ D = ee(i, R), s.tables.os2 = Wr.parse(D.data, D.offset);
14590
14590
  break;
14591
14591
  case "post":
14592
14592
  D = ee(i, R), s.tables.post = no.parse(D.data, D.offset), s.glyphNames = new es(s.tables.post);
@@ -14639,10 +14639,10 @@ function Md(t, e = {}) {
14639
14639
  s.glyphs = vo.parse(re.data, re.offset, D, s, e);
14640
14640
  } else if (l) {
14641
14641
  const P = ee(i, l);
14642
- Gr.parse(P.data, P.offset, s, e);
14642
+ Hr.parse(P.data, P.offset, s, e);
14643
14643
  } else if (u) {
14644
14644
  const P = ee(i, u);
14645
- Gr.parse(P.data, P.offset, s, e);
14645
+ Hr.parse(P.data, P.offset, s, e);
14646
14646
  } else
14647
14647
  throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");
14648
14648
  const ie = ee(i, F);
@@ -15169,7 +15169,7 @@ class Wd extends ha {
15169
15169
  * @param fontData - Either a MeshFontData object containing font information or an ArrayBuffer containing raw font data
15170
15170
  */
15171
15171
  constructor(e) {
15172
- super(e), this.type = "mesh", this.glyphCache = new jr(
15172
+ super(e), this.type = "mesh", this.glyphCache = new $r(
15173
15173
  512,
15174
15174
  (r, s) => {
15175
15175
  this.data.glyphs[r] === s && delete this.data.glyphs[r];
@@ -15417,13 +15417,13 @@ function qd(t) {
15417
15417
  });
15418
15418
  }), n;
15419
15419
  }
15420
- var Oo = { exports: {} }, ls = {}, Qn = {};
15421
- Qn.byteLength = Yd;
15422
- Qn.toByteArray = Zd;
15423
- Qn.fromByteArray = Jd;
15424
- var Qe = [], Ne = [], $d = typeof Uint8Array < "u" ? Uint8Array : Array, pr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
15425
- for (var Bt = 0, jd = pr.length; Bt < jd; ++Bt)
15426
- Qe[Bt] = pr[Bt], Ne[pr.charCodeAt(Bt)] = Bt;
15420
+ var Oo = { exports: {} }, ls = {}, Jn = {};
15421
+ Jn.byteLength = Yd;
15422
+ Jn.toByteArray = Zd;
15423
+ Jn.fromByteArray = Jd;
15424
+ var Qe = [], Ne = [], jd = typeof Uint8Array < "u" ? Uint8Array : Array, dr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
15425
+ for (var Bt = 0, $d = dr.length; Bt < $d; ++Bt)
15426
+ Qe[Bt] = dr[Bt], Ne[dr.charCodeAt(Bt)] = Bt;
15427
15427
  Ne[45] = 62;
15428
15428
  Ne[95] = 63;
15429
15429
  function Bo(t) {
@@ -15443,7 +15443,7 @@ function Xd(t, e, n) {
15443
15443
  return (e + n) * 3 / 4 - n;
15444
15444
  }
15445
15445
  function Zd(t) {
15446
- var e, n = Bo(t), r = n[0], s = n[1], i = new $d(Xd(t, r, s)), a = 0, o = s > 0 ? r - 4 : r, c;
15446
+ var e, n = Bo(t), r = n[0], s = n[1], i = new jd(Xd(t, r, s)), a = 0, o = s > 0 ? r - 4 : r, c;
15447
15447
  for (c = 0; c < o; c += 4)
15448
15448
  e = Ne[t.charCodeAt(c)] << 18 | Ne[t.charCodeAt(c + 1)] << 12 | Ne[t.charCodeAt(c + 2)] << 6 | Ne[t.charCodeAt(c + 3)], i[a++] = e >> 16 & 255, i[a++] = e >> 8 & 255, i[a++] = e & 255;
15449
15449
  return s === 2 && (e = Ne[t.charCodeAt(c)] << 2 | Ne[t.charCodeAt(c + 1)] >> 4, i[a++] = e & 255), s === 1 && (e = Ne[t.charCodeAt(c)] << 10 | Ne[t.charCodeAt(c + 1)] << 4 | Ne[t.charCodeAt(c + 2)] >> 2, i[a++] = e >> 8 & 255, i[a++] = e & 255), i;
@@ -15497,7 +15497,7 @@ us.write = function(t, e, n, r, s, i) {
15497
15497
  * @license MIT
15498
15498
  */
15499
15499
  (function(t) {
15500
- var e = Qn, n = us, r = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
15500
+ var e = Jn, n = us, r = typeof Symbol == "function" && typeof Symbol.for == "function" ? Symbol.for("nodejs.util.inspect.custom") : null;
15501
15501
  t.Buffer = o, t.SlowBuffer = w, t.INSPECT_MAX_BYTES = 50;
15502
15502
  var s = 2147483647;
15503
15503
  t.kMaxLength = s, o.TYPED_ARRAY_SUPPORT = i(), !o.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error(
@@ -15810,7 +15810,7 @@ us.write = function(t, e, n, r, s, i) {
15810
15810
  if (y >= S)
15811
15811
  return 1;
15812
15812
  if (y >>>= 0, S >>>= 0, k >>>= 0, L >>>= 0, this === d) return 0;
15813
- for (var O = L - k, Y = S - y, j = Math.min(O, Y), ae = this.slice(k, L), we = d.slice(y, S), le = 0; le < j; ++le)
15813
+ for (var O = L - k, Y = S - y, $ = Math.min(O, Y), ae = this.slice(k, L), we = d.slice(y, S), le = 0; le < $; ++le)
15814
15814
  if (ae[le] !== we[le]) {
15815
15815
  O = ae[le], Y = we[le];
15816
15816
  break;
@@ -15838,21 +15838,21 @@ us.write = function(t, e, n, r, s, i) {
15838
15838
  return -1;
15839
15839
  L = 2, O /= 2, Y /= 2, y /= 2;
15840
15840
  }
15841
- function j(ms, ys) {
15841
+ function $(ms, ys) {
15842
15842
  return L === 1 ? ms[ys] : ms.readUInt16BE(ys * L);
15843
15843
  }
15844
15844
  var ae;
15845
15845
  if (k) {
15846
15846
  var we = -1;
15847
15847
  for (ae = y; ae < O; ae++)
15848
- if (j(x, ae) === j(d, we === -1 ? 0 : ae - we)) {
15848
+ if ($(x, ae) === $(d, we === -1 ? 0 : ae - we)) {
15849
15849
  if (we === -1 && (we = ae), ae - we + 1 === Y) return we * L;
15850
15850
  } else
15851
15851
  we !== -1 && (ae -= ae - we), we = -1;
15852
15852
  } else
15853
15853
  for (y + Y > O && (y = O - Y), ae = y; ae >= 0; ae--) {
15854
15854
  for (var le = !0, pn = 0; pn < Y; pn++)
15855
- if (j(x, ae + pn) !== j(d, pn)) {
15855
+ if ($(x, ae + pn) !== $(d, pn)) {
15856
15856
  le = !1;
15857
15857
  break;
15858
15858
  }
@@ -15943,19 +15943,19 @@ us.write = function(t, e, n, r, s, i) {
15943
15943
  for (var S = [], k = d; k < y; ) {
15944
15944
  var L = x[k], O = null, Y = L > 239 ? 4 : L > 223 ? 3 : L > 191 ? 2 : 1;
15945
15945
  if (k + Y <= y) {
15946
- var j, ae, we, le;
15946
+ var $, ae, we, le;
15947
15947
  switch (Y) {
15948
15948
  case 1:
15949
15949
  L < 128 && (O = L);
15950
15950
  break;
15951
15951
  case 2:
15952
- j = x[k + 1], (j & 192) === 128 && (le = (L & 31) << 6 | j & 63, le > 127 && (O = le));
15952
+ $ = x[k + 1], ($ & 192) === 128 && (le = (L & 31) << 6 | $ & 63, le > 127 && (O = le));
15953
15953
  break;
15954
15954
  case 3:
15955
- j = x[k + 1], ae = x[k + 2], (j & 192) === 128 && (ae & 192) === 128 && (le = (L & 15) << 12 | (j & 63) << 6 | ae & 63, le > 2047 && (le < 55296 || le > 57343) && (O = le));
15955
+ $ = x[k + 1], ae = x[k + 2], ($ & 192) === 128 && (ae & 192) === 128 && (le = (L & 15) << 12 | ($ & 63) << 6 | ae & 63, le > 2047 && (le < 55296 || le > 57343) && (O = le));
15956
15956
  break;
15957
15957
  case 4:
15958
- j = x[k + 1], ae = x[k + 2], we = x[k + 3], (j & 192) === 128 && (ae & 192) === 128 && (we & 192) === 128 && (le = (L & 15) << 18 | (j & 63) << 12 | (ae & 63) << 6 | we & 63, le > 65535 && le < 1114112 && (O = le));
15958
+ $ = x[k + 1], ae = x[k + 2], we = x[k + 3], ($ & 192) === 128 && (ae & 192) === 128 && (we & 192) === 128 && (le = (L & 15) << 18 | ($ & 63) << 12 | (ae & 63) << 6 | we & 63, le > 65535 && le < 1114112 && (O = le));
15959
15959
  }
15960
15960
  }
15961
15961
  O === null ? (O = 65533, Y = 1) : O > 65535 && (O -= 65536, S.push(O >>> 10 & 1023 | 55296), O = 56320 | O & 1023), S.push(O), k += Y;
@@ -16006,62 +16006,62 @@ us.write = function(t, e, n, r, s, i) {
16006
16006
  var k = this.subarray(d, y);
16007
16007
  return Object.setPrototypeOf(k, o.prototype), k;
16008
16008
  };
16009
- function $(x, d, y) {
16009
+ function j(x, d, y) {
16010
16010
  if (x % 1 !== 0 || x < 0) throw new RangeError("offset is not uint");
16011
16011
  if (x + d > y) throw new RangeError("Trying to access beyond buffer length");
16012
16012
  }
16013
16013
  o.prototype.readUintLE = o.prototype.readUIntLE = function(d, y, S) {
16014
- d = d >>> 0, y = y >>> 0, S || $(d, y, this.length);
16014
+ d = d >>> 0, y = y >>> 0, S || j(d, y, this.length);
16015
16015
  for (var k = this[d], L = 1, O = 0; ++O < y && (L *= 256); )
16016
16016
  k += this[d + O] * L;
16017
16017
  return k;
16018
16018
  }, o.prototype.readUintBE = o.prototype.readUIntBE = function(d, y, S) {
16019
- d = d >>> 0, y = y >>> 0, S || $(d, y, this.length);
16019
+ d = d >>> 0, y = y >>> 0, S || j(d, y, this.length);
16020
16020
  for (var k = this[d + --y], L = 1; y > 0 && (L *= 256); )
16021
16021
  k += this[d + --y] * L;
16022
16022
  return k;
16023
16023
  }, o.prototype.readUint8 = o.prototype.readUInt8 = function(d, y) {
16024
- return d = d >>> 0, y || $(d, 1, this.length), this[d];
16024
+ return d = d >>> 0, y || j(d, 1, this.length), this[d];
16025
16025
  }, o.prototype.readUint16LE = o.prototype.readUInt16LE = function(d, y) {
16026
- return d = d >>> 0, y || $(d, 2, this.length), this[d] | this[d + 1] << 8;
16026
+ return d = d >>> 0, y || j(d, 2, this.length), this[d] | this[d + 1] << 8;
16027
16027
  }, o.prototype.readUint16BE = o.prototype.readUInt16BE = function(d, y) {
16028
- return d = d >>> 0, y || $(d, 2, this.length), this[d] << 8 | this[d + 1];
16028
+ return d = d >>> 0, y || j(d, 2, this.length), this[d] << 8 | this[d + 1];
16029
16029
  }, o.prototype.readUint32LE = o.prototype.readUInt32LE = function(d, y) {
16030
- return d = d >>> 0, y || $(d, 4, this.length), (this[d] | this[d + 1] << 8 | this[d + 2] << 16) + this[d + 3] * 16777216;
16030
+ return d = d >>> 0, y || j(d, 4, this.length), (this[d] | this[d + 1] << 8 | this[d + 2] << 16) + this[d + 3] * 16777216;
16031
16031
  }, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(d, y) {
16032
- return d = d >>> 0, y || $(d, 4, this.length), this[d] * 16777216 + (this[d + 1] << 16 | this[d + 2] << 8 | this[d + 3]);
16032
+ return d = d >>> 0, y || j(d, 4, this.length), this[d] * 16777216 + (this[d + 1] << 16 | this[d + 2] << 8 | this[d + 3]);
16033
16033
  }, o.prototype.readIntLE = function(d, y, S) {
16034
- d = d >>> 0, y = y >>> 0, S || $(d, y, this.length);
16034
+ d = d >>> 0, y = y >>> 0, S || j(d, y, this.length);
16035
16035
  for (var k = this[d], L = 1, O = 0; ++O < y && (L *= 256); )
16036
16036
  k += this[d + O] * L;
16037
16037
  return L *= 128, k >= L && (k -= Math.pow(2, 8 * y)), k;
16038
16038
  }, o.prototype.readIntBE = function(d, y, S) {
16039
- d = d >>> 0, y = y >>> 0, S || $(d, y, this.length);
16039
+ d = d >>> 0, y = y >>> 0, S || j(d, y, this.length);
16040
16040
  for (var k = y, L = 1, O = this[d + --k]; k > 0 && (L *= 256); )
16041
16041
  O += this[d + --k] * L;
16042
16042
  return L *= 128, O >= L && (O -= Math.pow(2, 8 * y)), O;
16043
16043
  }, o.prototype.readInt8 = function(d, y) {
16044
- return d = d >>> 0, y || $(d, 1, this.length), this[d] & 128 ? (255 - this[d] + 1) * -1 : this[d];
16044
+ return d = d >>> 0, y || j(d, 1, this.length), this[d] & 128 ? (255 - this[d] + 1) * -1 : this[d];
16045
16045
  }, o.prototype.readInt16LE = function(d, y) {
16046
- d = d >>> 0, y || $(d, 2, this.length);
16046
+ d = d >>> 0, y || j(d, 2, this.length);
16047
16047
  var S = this[d] | this[d + 1] << 8;
16048
16048
  return S & 32768 ? S | 4294901760 : S;
16049
16049
  }, o.prototype.readInt16BE = function(d, y) {
16050
- d = d >>> 0, y || $(d, 2, this.length);
16050
+ d = d >>> 0, y || j(d, 2, this.length);
16051
16051
  var S = this[d + 1] | this[d] << 8;
16052
16052
  return S & 32768 ? S | 4294901760 : S;
16053
16053
  }, o.prototype.readInt32LE = function(d, y) {
16054
- return d = d >>> 0, y || $(d, 4, this.length), this[d] | this[d + 1] << 8 | this[d + 2] << 16 | this[d + 3] << 24;
16054
+ return d = d >>> 0, y || j(d, 4, this.length), this[d] | this[d + 1] << 8 | this[d + 2] << 16 | this[d + 3] << 24;
16055
16055
  }, o.prototype.readInt32BE = function(d, y) {
16056
- return d = d >>> 0, y || $(d, 4, this.length), this[d] << 24 | this[d + 1] << 16 | this[d + 2] << 8 | this[d + 3];
16056
+ return d = d >>> 0, y || j(d, 4, this.length), this[d] << 24 | this[d + 1] << 16 | this[d + 2] << 8 | this[d + 3];
16057
16057
  }, o.prototype.readFloatLE = function(d, y) {
16058
- return d = d >>> 0, y || $(d, 4, this.length), n.read(this, d, !0, 23, 4);
16058
+ return d = d >>> 0, y || j(d, 4, this.length), n.read(this, d, !0, 23, 4);
16059
16059
  }, o.prototype.readFloatBE = function(d, y) {
16060
- return d = d >>> 0, y || $(d, 4, this.length), n.read(this, d, !1, 23, 4);
16060
+ return d = d >>> 0, y || j(d, 4, this.length), n.read(this, d, !1, 23, 4);
16061
16061
  }, o.prototype.readDoubleLE = function(d, y) {
16062
- return d = d >>> 0, y || $(d, 8, this.length), n.read(this, d, !0, 52, 8);
16062
+ return d = d >>> 0, y || j(d, 8, this.length), n.read(this, d, !0, 52, 8);
16063
16063
  }, o.prototype.readDoubleBE = function(d, y) {
16064
- return d = d >>> 0, y || $(d, 8, this.length), n.read(this, d, !1, 52, 8);
16064
+ return d = d >>> 0, y || j(d, 8, this.length), n.read(this, d, !1, 52, 8);
16065
16065
  };
16066
16066
  function Q(x, d, y, S, k, L) {
16067
16067
  if (!o.isBuffer(x)) throw new TypeError('"buffer" argument must be a Buffer instance');
@@ -16101,18 +16101,18 @@ us.write = function(t, e, n, r, s, i) {
16101
16101
  var L = Math.pow(2, 8 * S - 1);
16102
16102
  Q(this, d, y, S, L - 1, -L);
16103
16103
  }
16104
- var O = 0, Y = 1, j = 0;
16104
+ var O = 0, Y = 1, $ = 0;
16105
16105
  for (this[y] = d & 255; ++O < S && (Y *= 256); )
16106
- d < 0 && j === 0 && this[y + O - 1] !== 0 && (j = 1), this[y + O] = (d / Y >> 0) - j & 255;
16106
+ d < 0 && $ === 0 && this[y + O - 1] !== 0 && ($ = 1), this[y + O] = (d / Y >> 0) - $ & 255;
16107
16107
  return y + S;
16108
16108
  }, o.prototype.writeIntBE = function(d, y, S, k) {
16109
16109
  if (d = +d, y = y >>> 0, !k) {
16110
16110
  var L = Math.pow(2, 8 * S - 1);
16111
16111
  Q(this, d, y, S, L - 1, -L);
16112
16112
  }
16113
- var O = S - 1, Y = 1, j = 0;
16113
+ var O = S - 1, Y = 1, $ = 0;
16114
16114
  for (this[y + O] = d & 255; --O >= 0 && (Y *= 256); )
16115
- d < 0 && j === 0 && this[y + O + 1] !== 0 && (j = 1), this[y + O] = (d / Y >> 0) - j & 255;
16115
+ d < 0 && $ === 0 && this[y + O + 1] !== 0 && ($ = 1), this[y + O] = (d / Y >> 0) - $ & 255;
16116
16116
  return y + S;
16117
16117
  }, o.prototype.writeInt8 = function(d, y, S) {
16118
16118
  return d = +d, y = y >>> 0, S || Q(this, d, y, 1, 127, -128), d < 0 && (d = 255 + d + 1), this[y] = d & 255, y + 1;
@@ -16179,11 +16179,11 @@ us.write = function(t, e, n, r, s, i) {
16179
16179
  for (O = y; O < S; ++O)
16180
16180
  this[O] = d;
16181
16181
  else {
16182
- var Y = o.isBuffer(d) ? d : o.from(d, k), j = Y.length;
16183
- if (j === 0)
16182
+ var Y = o.isBuffer(d) ? d : o.from(d, k), $ = Y.length;
16183
+ if ($ === 0)
16184
16184
  throw new TypeError('The value "' + d + '" is invalid for argument "value"');
16185
16185
  for (O = 0; O < S - y; ++O)
16186
- this[O + y] = Y[O % j];
16186
+ this[O + y] = Y[O % $];
16187
16187
  }
16188
16188
  return this;
16189
16189
  };
@@ -16332,7 +16332,7 @@ function t0(t, e) {
16332
16332
  for (var n in e)
16333
16333
  e0(e, n) && (t[n] = e[n]);
16334
16334
  }
16335
- var Ro = t0, dr = {}, gr = {}, vn = { exports: {} };
16335
+ var Ro = t0, gr = {}, mr = {}, vn = { exports: {} };
16336
16336
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
16337
16337
  var ki;
16338
16338
  function n0() {
@@ -16368,7 +16368,7 @@ function n0() {
16368
16368
  }
16369
16369
  var Ei;
16370
16370
  function r0() {
16371
- if (Ei) return gr;
16371
+ if (Ei) return mr;
16372
16372
  Ei = 1;
16373
16373
  var t = n0().Buffer, e = t.isEncoding || function(v) {
16374
16374
  switch (v = "" + v, v && v.toLowerCase()) {
@@ -16417,7 +16417,7 @@ function r0() {
16417
16417
  if (typeof w != "string" && (t.isEncoding === e || !e(v))) throw new Error("Unknown encoding: " + v);
16418
16418
  return w || v;
16419
16419
  }
16420
- gr.StringDecoder = s;
16420
+ mr.StringDecoder = s;
16421
16421
  function s(v) {
16422
16422
  this.encoding = r(v);
16423
16423
  var w;
@@ -16522,14 +16522,14 @@ function r0() {
16522
16522
  function b(v) {
16523
16523
  return v && v.length ? this.write(v) : "";
16524
16524
  }
16525
- return gr;
16525
+ return mr;
16526
16526
  }
16527
- var mr, Li;
16527
+ var yr, Li;
16528
16528
  function s0() {
16529
- if (Li) return mr;
16529
+ if (Li) return yr;
16530
16530
  Li = 1;
16531
16531
  var t = yt.Buffer;
16532
- mr = {
16532
+ yr = {
16533
16533
  // Encodings
16534
16534
  utf8: { type: "_internal", bomAware: !0 },
16535
16535
  cesu8: { type: "_internal", bomAware: !0 },
@@ -16609,7 +16609,7 @@ function s0() {
16609
16609
  var l = this.highSurrogate;
16610
16610
  return this.highSurrogate = "", t.from(l, this.enc);
16611
16611
  }
16612
- }, mr;
16612
+ }, yr;
16613
16613
  }
16614
16614
  var rt = {}, Ai;
16615
16615
  function i0() {
@@ -16912,12 +16912,12 @@ function o0() {
16912
16912
  return this.inBase64 && this.base64Accum.length > 0 && (g = this.iconv.decode(t.from(this.base64Accum, "base64"), "utf16-be")), this.inBase64 = !1, this.base64Accum = "", g;
16913
16913
  }, qt;
16914
16914
  }
16915
- var yr = {}, Bi;
16915
+ var br = {}, Bi;
16916
16916
  function c0() {
16917
- if (Bi) return yr;
16917
+ if (Bi) return br;
16918
16918
  Bi = 1;
16919
16919
  var t = yt.Buffer;
16920
- yr._sbcs = e;
16920
+ br._sbcs = e;
16921
16921
  function e(s, i) {
16922
16922
  if (!s)
16923
16923
  throw new Error("SBCS codec is called without the data.");
@@ -16951,11 +16951,11 @@ function c0() {
16951
16951
  o = s[l] * 2, c = l * 2, a[c] = i[o], a[c + 1] = i[o + 1];
16952
16952
  return a.toString("ucs2");
16953
16953
  }, r.prototype.end = function() {
16954
- }, yr;
16954
+ }, br;
16955
16955
  }
16956
- var br, Ii;
16956
+ var xr, Ii;
16957
16957
  function l0() {
16958
- return Ii || (Ii = 1, br = {
16958
+ return Ii || (Ii = 1, xr = {
16959
16959
  // Not supported by iconv, not sure why.
16960
16960
  10029: "maccenteuro",
16961
16961
  maccenteuro: {
@@ -17100,11 +17100,11 @@ function l0() {
17100
17100
  ibm1051: "hproman8",
17101
17101
  mac: "macintosh",
17102
17102
  csmacintosh: "macintosh"
17103
- }), br;
17103
+ }), xr;
17104
17104
  }
17105
- var xr, Ri;
17105
+ var vr, Ri;
17106
17106
  function u0() {
17107
- return Ri || (Ri = 1, xr = {
17107
+ return Ri || (Ri = 1, vr = {
17108
17108
  437: "cp437",
17109
17109
  737: "cp737",
17110
17110
  775: "cp775",
@@ -17556,14 +17556,14 @@ function u0() {
17556
17556
  type: "_sbcs",
17557
17557
  chars: "���������������������������������กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู����฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛����"
17558
17558
  }
17559
- }), xr;
17559
+ }), vr;
17560
17560
  }
17561
- var vr = {}, Di;
17561
+ var Sr = {}, Di;
17562
17562
  function h0() {
17563
- if (Di) return vr;
17563
+ if (Di) return Sr;
17564
17564
  Di = 1;
17565
17565
  var t = yt.Buffer;
17566
- vr._dbcs = c;
17566
+ Sr._dbcs = c;
17567
17567
  for (var e = -1, n = -2, r = -10, s = -1e3, i = new Array(256), a = -1, o = 0; o < 256; o++)
17568
17568
  i[o] = e;
17569
17569
  function c(h, p) {
@@ -17797,7 +17797,7 @@ function h0() {
17797
17797
  }
17798
17798
  return m;
17799
17799
  }
17800
- return vr;
17800
+ return Sr;
17801
17801
  }
17802
17802
  const f0 = [
17803
17803
  [
@@ -19163,7 +19163,7 @@ const f0 = [
19163
19163
  4,
19164
19164
  "齳齵齺齽龏龐龑龒龔龖龗龞龡龢龣龥"
19165
19165
  ]
19166
- ], Sr = [
19166
+ ], wr = [
19167
19167
  [
19168
19168
  "0",
19169
19169
  "\0",
@@ -26068,9 +26068,9 @@ const f0 = [
26068
26068
  "𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"
26069
26069
  ]
26070
26070
  ];
26071
- var wr, Pi;
26071
+ var Cr, Pi;
26072
26072
  function x0() {
26073
- return Pi || (Pi = 1, wr = {
26073
+ return Pi || (Pi = 1, Cr = {
26074
26074
  // == Japanese/ShiftJIS ====================================================
26075
26075
  // All japanese encodings are based on JIS X set of standards:
26076
26076
  // JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.
@@ -26146,14 +26146,14 @@ function x0() {
26146
26146
  cp936: {
26147
26147
  type: "_dbcs",
26148
26148
  table: function() {
26149
- return Sr;
26149
+ return wr;
26150
26150
  }
26151
26151
  },
26152
26152
  // GBK (~22000 chars) is an extension of CP936 that added user-mapped chars and some other.
26153
26153
  gbk: {
26154
26154
  type: "_dbcs",
26155
26155
  table: function() {
26156
- return Sr.concat(_i);
26156
+ return wr.concat(_i);
26157
26157
  }
26158
26158
  },
26159
26159
  xgbk: "gbk",
@@ -26166,7 +26166,7 @@ function x0() {
26166
26166
  gb18030: {
26167
26167
  type: "_dbcs",
26168
26168
  table: function() {
26169
- return Sr.concat(_i);
26169
+ return wr.concat(_i);
26170
26170
  },
26171
26171
  gb18030: function() {
26172
26172
  return m0;
@@ -26309,7 +26309,7 @@ function x0() {
26309
26309
  cnbig5: "big5hkscs",
26310
26310
  csbig5: "big5hkscs",
26311
26311
  xxbig5: "big5hkscs"
26312
- }), wr;
26312
+ }), Cr;
26313
26313
  }
26314
26314
  var Ni;
26315
26315
  function v0() {
@@ -26328,14 +26328,14 @@ function v0() {
26328
26328
  var s = n[r];
26329
26329
  e(t, s);
26330
26330
  }
26331
- }(dr)), dr;
26331
+ }(gr)), gr;
26332
26332
  }
26333
- var Cr, Gi;
26333
+ var Fr, Gi;
26334
26334
  function S0() {
26335
- if (Gi) return Cr;
26335
+ if (Gi) return Fr;
26336
26336
  Gi = 1;
26337
26337
  var t = yt.Buffer;
26338
- return Cr = function(e) {
26338
+ return Fr = function(e) {
26339
26339
  var n = e.Transform;
26340
26340
  function r(i, a) {
26341
26341
  this.conv = i, a = a || {}, a.decodeStrings = !1, n.call(this, a);
@@ -26398,7 +26398,7 @@ function S0() {
26398
26398
  IconvLiteEncoderStream: r,
26399
26399
  IconvLiteDecoderStream: s
26400
26400
  };
26401
- }, Cr;
26401
+ }, Fr;
26402
26402
  }
26403
26403
  const w0 = {}, C0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
26404
26404
  __proto__: null,
@@ -26570,7 +26570,7 @@ const ot = class ot extends ha {
26570
26570
  * @param fontData - Font metadata and binary SHX data used to initialize the font.
26571
26571
  */
26572
26572
  constructor(e) {
26573
- super(e), this.type = "shx", this.layoutShapeCache = new jr(
26573
+ super(e), this.type = "shx", this.layoutShapeCache = new $r(
26574
26574
  4096,
26575
26575
  (n, r) => {
26576
26576
  r.dispose();
@@ -26795,7 +26795,7 @@ const ot = class ot extends ha {
26795
26795
  }
26796
26796
  };
26797
26797
  ot.NOT_ENCODABLE = -1;
26798
- let qr = ot;
26798
+ let qn = ot;
26799
26799
  class Je {
26800
26800
  constructor() {
26801
26801
  }
@@ -26816,7 +26816,7 @@ class Je {
26816
26816
  */
26817
26817
  createFont(e) {
26818
26818
  if (e.type === "shx")
26819
- return new qr(e);
26819
+ return new qn(e);
26820
26820
  if (e.type === "mesh")
26821
26821
  return new Wd(e);
26822
26822
  throw new Error("Unsupported font data type");
@@ -26856,7 +26856,7 @@ class X {
26856
26856
  }
26857
26857
  setDefaultFonts(e) {
26858
26858
  if (typeof e == "string" && As(e)) {
26859
- this.defaultFonts = new Set(Ir[e]), this.symbolFonts = new Set(nr[e]);
26859
+ this.defaultFonts = new Set(Rr[e]), this.symbolFonts = new Set(rr[e]);
26860
26860
  return;
26861
26861
  }
26862
26862
  const n = typeof e == "string" ? [e] : [...e];
@@ -26864,7 +26864,7 @@ class X {
26864
26864
  }
26865
26865
  setSymbolFonts(e) {
26866
26866
  if (typeof e == "string" && As(e)) {
26867
- this.symbolFonts = new Set(nr[e]);
26867
+ this.symbolFonts = new Set(rr[e]);
26868
26868
  return;
26869
26869
  }
26870
26870
  const n = typeof e == "string" ? [e] : [...e];
@@ -26875,14 +26875,14 @@ class X {
26875
26875
  * @param preset - The preset to look up
26876
26876
  */
26877
26877
  getDefaultFontsPreset(e) {
26878
- return Ir[e];
26878
+ return Rr[e];
26879
26879
  }
26880
26880
  /**
26881
26881
  * Returns the symbol-font names for a predefined preset.
26882
26882
  * @param preset - The preset to look up
26883
26883
  */
26884
26884
  getSymbolFontsPreset(e) {
26885
- return nr[e];
26885
+ return rr[e];
26886
26886
  }
26887
26887
  /**
26888
26888
  * Font names that should be loaded for the active default and symbol chains.
@@ -27298,6 +27298,59 @@ class X {
27298
27298
  return i;
27299
27299
  }
27300
27300
  }
27301
+ /**
27302
+ * Looks up `char` in every loaded SHX BIGFONT face (and BIGFONT names listed
27303
+ * in {@link defaultFonts}), using each face's own scale factor.
27304
+ *
27305
+ * AutoCAD text styles bind one Big Font file, but when that face's code page
27306
+ * cannot represent a glyph (e.g. simplified Chinese on Japanese `bigfont.shx`)
27307
+ * viewers still find the character in another available Big Font such as
27308
+ * `gbcbig.shx`. A hand-maintained simplified→Japanese character map cannot
27309
+ * cover the repertoire; searching loaded BIGFONT faces does.
27310
+ *
27311
+ * @param char - Character to resolve.
27312
+ * @param layoutSize - MTEXT layout height (cap-height), before per-font scale.
27313
+ * @param excludeFontName - Optional style Big Font already tried.
27314
+ * @returns Shape plus the font that supplied it, or `undefined`.
27315
+ */
27316
+ getCharShapeFromLoadedBigfonts(e, n, r) {
27317
+ const s = r == null ? void 0 : r.trim().toLowerCase(), i = /* @__PURE__ */ new Set(), a = (o, c) => {
27318
+ var h;
27319
+ const l = c.toLowerCase();
27320
+ if (i.has(l) || s && l === s || (i.add(l), o.type !== "shx") || ((h = o.data.header) == null ? void 0 : h.fontType) !== K.BIGFONT || !o.hasChar(e))
27321
+ return;
27322
+ const u = n * (o.getScaleFactor() || 1), f = o.getCharShape(e, u);
27323
+ if (f)
27324
+ return { shape: f, fontName: c };
27325
+ };
27326
+ for (const o of this.defaultFonts) {
27327
+ const c = this.loadedFontMap.get(o.toLowerCase());
27328
+ if (!c) {
27329
+ this.lazyFontLoading && this.requestFont(o);
27330
+ continue;
27331
+ }
27332
+ const l = a(c, o);
27333
+ if (l)
27334
+ return l;
27335
+ }
27336
+ for (const [o, c] of this.loadedFontMap) {
27337
+ const l = a(c, o);
27338
+ if (l)
27339
+ return l;
27340
+ }
27341
+ }
27342
+ /**
27343
+ * Horizontal BIGFONT cell width at `layoutSize` for the named face, or
27344
+ * `undefined` when the face is missing / not a BIGFONT.
27345
+ */
27346
+ getBigfontCellWidth(e, n) {
27347
+ var i;
27348
+ const r = this.getFontByName(e, !1);
27349
+ if (!r || r.type !== "shx" || !(r instanceof qn) || ((i = r.data.header) == null ? void 0 : i.fontType) !== K.BIGFONT)
27350
+ return;
27351
+ const s = n * (r.getScaleFactor() || 1);
27352
+ return r.getFontMetrics(s).cellWidth;
27353
+ }
27301
27354
  /**
27302
27355
  * Gets the text shape from configured GDT / symbol fonts (e.g. `amgdt.shx`)
27303
27356
  * by font-internal character code.
@@ -27975,7 +28028,7 @@ function R0(t) {
27975
28028
  ].some((n) => !Number.isFinite(n))))
27976
28029
  return t;
27977
28030
  }
27978
- function $r(t, e, n) {
28031
+ function jr(t, e, n) {
27979
28032
  const r = [];
27980
28033
  if (t.filter((h) => h.char !== Mn).forEach((h) => {
27981
28034
  const p = R0(
@@ -28012,24 +28065,24 @@ function $r(t, e, n) {
28012
28065
  ];
28013
28066
  }
28014
28067
  const D0 = 1.5, _0 = 0.8, U0 = 1e6, P0 = 1e4;
28015
- function $i(t, e) {
28068
+ function ji(t, e) {
28016
28069
  return Math.max(
28017
28070
  1,
28018
28071
  ...String(t ?? "").replace(/\\P/g, `
28019
28072
  `).replace(/[{}]/g, "").split(/\r?\n/).map((r) => r.length)
28020
28073
  ) * e * _0;
28021
28074
  }
28022
- function ji(t) {
28075
+ function $i(t) {
28023
28076
  const e = t.width, n = t.height;
28024
28077
  if (!Number.isFinite(e) || !Number.isFinite(n) || n <= 0 || e <= 0)
28025
28078
  return e;
28026
28079
  const r = n * D0;
28027
28080
  if (e < r)
28028
- return $i(t.text, n);
28029
- const s = $i(t.text, n), i = e / n, a = e / Math.max(s, Number.EPSILON);
28081
+ return ji(t.text, n);
28082
+ const s = ji(t.text, n), i = e / n, a = e / Math.max(s, Number.EPSILON);
28030
28083
  return i > U0 || a > P0 ? s : e;
28031
28084
  }
28032
- const $t = /* @__PURE__ */ new M.Vector3();
28085
+ const jt = /* @__PURE__ */ new M.Vector3();
28033
28086
  class Ve {
28034
28087
  /**
28035
28088
  * Merges indexed or non-indexed line geometries into one non-indexed {@link THREE.BufferGeometry}
@@ -28116,7 +28169,7 @@ class Ve {
28116
28169
  const a = e.getIndex();
28117
28170
  let o = s;
28118
28171
  const c = (l) => {
28119
- $t.fromBufferAttribute(i, l), $t.applyMatrix4(n), r[o++] = $t.x, r[o++] = $t.y, r[o++] = $t.z;
28172
+ jt.fromBufferAttribute(i, l), jt.applyMatrix4(n), r[o++] = jt.x, r[o++] = jt.y, r[o++] = jt.z;
28120
28173
  };
28121
28174
  if (a) {
28122
28175
  for (let l = 0; l < a.count; l += 2)
@@ -28220,8 +28273,8 @@ class Ve {
28220
28273
  if (u && l) {
28221
28274
  const v = e.array, w = a[0], C = a[1], F = a[2], E = a[4], B = a[5], N = a[6], z = a[8], q = a[9], U = a[10], Z = a[12], ie = a[13], P = a[14];
28222
28275
  for (let R = 0; R < o; R++) {
28223
- const D = R * 3, re = v[D], ye = v[D + 1], Re = v[D + 2], ge = w * re + E * ye + z * Re + Z, oe = C * re + B * ye + q * Re + ie, $ = F * re + N * ye + U * Re + P, Q = c + D;
28224
- r[Q] = ge, r[Q + 1] = oe, r[Q + 2] = $, ge < f && (f = ge), oe < h && (h = oe), $ < p && (p = $), ge > m && (m = ge), oe > g && (g = oe), $ > b && (b = $);
28276
+ const D = R * 3, re = v[D], ye = v[D + 1], Re = v[D + 2], ge = w * re + E * ye + z * Re + Z, oe = C * re + B * ye + q * Re + ie, j = F * re + N * ye + U * Re + P, Q = c + D;
28277
+ r[Q] = ge, r[Q + 1] = oe, r[Q + 2] = j, ge < f && (f = ge), oe < h && (h = oe), j < p && (p = j), ge > m && (m = ge), oe > g && (g = oe), j > b && (b = j);
28225
28278
  }
28226
28279
  return i.minX = f, i.minY = h, i.minZ = p, i.maxX = m, i.maxY = g, i.maxZ = b, o;
28227
28280
  }
@@ -28296,7 +28349,7 @@ function W0(t) {
28296
28349
  if (e)
28297
28350
  return { kind: "named", code: e, char: t };
28298
28351
  }
28299
- const V0 = /* @__PURE__ */ new M.Vector3(), Yi = /* @__PURE__ */ new M.Matrix4(), jt = /* @__PURE__ */ new M.Matrix4(), Xi = /* @__PURE__ */ new M.Matrix4(), Fr = /* @__PURE__ */ new M.Box3(), Zi = /* @__PURE__ */ new M.Matrix4(), Tr = /* @__PURE__ */ new M.Matrix4(), kr = /* @__PURE__ */ new M.Matrix4(), Ki = /* @__PURE__ */ new M.Matrix4(), Cn = /* @__PURE__ */ new M.Box3();
28352
+ const V0 = /* @__PURE__ */ new M.Vector3(), Yi = /* @__PURE__ */ new M.Matrix4(), $t = /* @__PURE__ */ new M.Matrix4(), Xi = /* @__PURE__ */ new M.Matrix4(), Tr = /* @__PURE__ */ new M.Box3(), Zi = /* @__PURE__ */ new M.Matrix4(), kr = /* @__PURE__ */ new M.Matrix4(), Er = /* @__PURE__ */ new M.Matrix4(), Ki = /* @__PURE__ */ new M.Matrix4(), Cn = /* @__PURE__ */ new M.Box3();
28300
28353
  function q0(t) {
28301
28354
  const e = t ?? "", n = e.indexOf(",");
28302
28355
  return n < 0 ? { primary: e.trim() } : {
@@ -28863,7 +28916,7 @@ class Qi {
28863
28916
  let c = 0;
28864
28917
  if (o) {
28865
28918
  const f = o * Math.PI / 180;
28866
- Tr.set(
28919
+ kr.set(
28867
28920
  1,
28868
28921
  Math.tan(f),
28869
28922
  0,
@@ -28882,11 +28935,11 @@ class Qi {
28882
28935
  1
28883
28936
  ), c = Math.tan(f) * r;
28884
28937
  } else
28885
- Tr.identity();
28938
+ kr.identity();
28886
28939
  const l = this.fontManager.getFontType(this.currentFont);
28887
- this._currentContext.bold && l === "mesh" ? kr.makeScale(1.06, 1.06, 1) : kr.identity(), Ki.makeTranslation(e, n, 0);
28940
+ this._currentContext.bold && l === "mesh" ? Er.makeScale(1.06, 1.06, 1) : Er.identity(), Ki.makeTranslation(e, n, 0);
28888
28941
  const u = new M.Matrix4();
28889
- return u.copy(Ki).multiply(kr).multiply(Tr).multiply(Zi), { matrix: u, obliqueExtraAdvance: c };
28942
+ return u.copy(Ki).multiply(Er).multiply(kr).multiply(Zi), { matrix: u, obliqueExtraAdvance: c };
28890
28943
  }
28891
28944
  /**
28892
28945
  * Appends one glyph's geometry to the active batch buffers and optional char boxes.
@@ -29095,7 +29148,8 @@ class Qi {
29095
29148
  * Lays out and renders one parser word token, breaking to a new visual line when needed.
29096
29149
  *
29097
29150
  * - CJK / non-Latin: no whole-word wrap — {@link processChar} breaks between
29098
- * characters when the next glyph would not fit in the defined width.
29151
+ * characters when the pen has already reached the defined width (a glyph
29152
+ * that starts inside may slightly overshoot).
29099
29153
  * - Latin/ASCII: wrap only at word boundaries (spaces). AutoCAD/GstarCAD do
29100
29154
  * not hyphenate: a token wider than the column stays on one visual line and
29101
29155
  * overflows the box (e.g. part numbers like `1157*25*1.5`). A short run that
@@ -29393,10 +29447,14 @@ class Qi {
29393
29447
  * Renders one character glyph, including decorations and line-break handling.
29394
29448
  *
29395
29449
  * Missing glyphs are treated as spaces. Soft wrap is decided before placement:
29396
- * if the glyph's advance would not fit in the remaining defined width, break
29397
- * first (CJK may break between any two characters). Latin/ASCII word tokens
29398
- * suppress this so they overflow instead of hyphenating. The first glyph on an
29399
- * empty line is always placed even when wider than the box.
29450
+ * break when the pen has already reached the defined width so the next glyph
29451
+ * cannot *start* inside the column (CJK may break between any two characters).
29452
+ * A glyph that starts inside the column is kept even if its advance slightly
29453
+ * overshoots — AutoCAD title-block cells are often sized to N capital-A CJK
29454
+ * advances within a fraction of a percent, and wrapping on end-past-width
29455
+ * falsely pushes the last ideograph onto the next line. Latin/ASCII word
29456
+ * tokens suppress this so they overflow instead of hyphenating. The first
29457
+ * glyph on an empty line is always placed even when wider than the box.
29400
29458
  *
29401
29459
  * @param char Character to render.
29402
29460
  * @param geometries Mesh geometry accumulator.
@@ -29412,12 +29470,12 @@ class Qi {
29412
29470
  return;
29413
29471
  }
29414
29472
  this._lineHasRenderableChar || this.applyPendingEmptyLineYAdjust();
29415
- const l = this.maxLineWidth || 1 / 0, u = this.currentHorizontalAlignment == Oe.DISTRIBUTED, f = u ? c.width * this.currentWidthFactor : this.penAdvance(c.width);
29416
- !this._suppressSoftWrap && Number.isFinite(l) && this.hOffset > 0 && this.hOffset + f > l && (this.recordVisualLineBreak(s, i), this.advanceToNextLine(!1));
29417
- const h = this.hOffset, p = this.flowDirection == ze.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.currentLayoutFontSize, m = this.currentLayoutFontSize, g = c.width * this.currentWidthFactor, { matrix: b, obliqueExtraAdvance: v } = this.buildCharTransformMatrix(
29473
+ const l = this.maxLineWidth || 1 / 0;
29474
+ !this._suppressSoftWrap && Number.isFinite(l) && this.hOffset > 0 && this.hOffset >= l && (this.recordVisualLineBreak(s, i), this.advanceToNextLine(!1));
29475
+ const u = this.currentHorizontalAlignment == Oe.DISTRIBUTED, f = this.hOffset, h = this.flowDirection == ze.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.currentLayoutFontSize, p = this.currentLayoutFontSize, m = (o == null ? void 0 : o.layoutAdvance) ?? c.width, g = m * this.currentWidthFactor, { matrix: b, obliqueExtraAdvance: v } = this.buildCharTransformMatrix(
29476
+ f,
29418
29477
  h,
29419
29478
  p,
29420
- m,
29421
29479
  c.geometryScale
29422
29480
  ), w = this.getGlyphGeometry(c);
29423
29481
  this.appendCharGeometry(
@@ -29428,37 +29486,37 @@ class Qi {
29428
29486
  n,
29429
29487
  s,
29430
29488
  i
29431
- ), u ? this._hOffset += c.width * this.currentWidthFactor + v * this.currentWidthFactor : this._hOffset += this.penAdvance(c.width, v), this._lineHasRenderableChar = !0;
29432
- const C = m * 0.05, F = 1e-3;
29489
+ ), u ? this._hOffset += m * this.currentWidthFactor + v * this.currentWidthFactor : this._hOffset += this.penAdvance(m, v), this._lineHasRenderableChar = !0;
29490
+ const C = p * 0.05, F = 1e-3;
29433
29491
  if (this._currentContext.underline) {
29434
- const E = p - C;
29492
+ const E = h - C;
29435
29493
  this.pushDecorationLine(r, [
29436
- h,
29494
+ f,
29437
29495
  E,
29438
29496
  F,
29439
- h + g,
29497
+ f + g,
29440
29498
  E,
29441
29499
  F
29442
29500
  ]);
29443
29501
  }
29444
29502
  if (this._currentContext.overline) {
29445
- const E = p + m + C;
29503
+ const E = h + p + C;
29446
29504
  this.pushDecorationLine(r, [
29447
- h,
29505
+ f,
29448
29506
  E,
29449
29507
  F,
29450
- h + g,
29508
+ f + g,
29451
29509
  E,
29452
29510
  F
29453
29511
  ]);
29454
29512
  }
29455
29513
  if (this._currentContext.strikeThrough) {
29456
- const E = p + m / 2 - m * 0.2;
29514
+ const E = h + p / 2 - p * 0.2;
29457
29515
  this.pushDecorationLine(r, [
29458
- h,
29516
+ f,
29459
29517
  E,
29460
29518
  F,
29461
- h + g,
29519
+ f + g,
29462
29520
  E,
29463
29521
  F
29464
29522
  ]);
@@ -29538,50 +29596,68 @@ class Qi {
29538
29596
  return this.trySymbolFontPercentShape(e) ?? this.getCharShape(e.char);
29539
29597
  }
29540
29598
  /**
29541
- * Resolves the text shape for one character using primary font, big font, defaults, and symbol fonts.
29542
- *
29543
- * Updates {@link _maxFontSize} when the active font size exceeds the current line maximum.
29544
- * Falls back to the not-found glyph when no renderable geometry is available.
29599
+ * Drawing-space glyph size for a specific face.
29545
29600
  *
29546
- * @param char Character to resolve.
29547
- * @returns Renderable text shape and the font that supplied it.
29601
+ * {@link currentFontSize} is inflated by the *primary* style font's scale
29602
+ * factor (SHX cap-height or TrueType capital-A). BIGFONT / fallback faces
29603
+ * have their own scale — fetching them at the primary size stretches CJK
29604
+ * cells and shifts mixed runs.
29548
29605
  */
29606
+ shapeSizeForFont(e) {
29607
+ const n = this.fontManager.getFontScaleFactor(e) || 1;
29608
+ return this.currentLayoutFontSize * n;
29609
+ }
29549
29610
  resolveCharShape(e) {
29550
- var a;
29551
- const n = this.currentFont, r = (a = this._currentContext.bigFont !== void 0 ? this._currentContext.bigFont : this.textStyle.bigFont) == null ? void 0 : a.trim();
29552
- let s, i = n;
29553
- if (this.canProbeFontOwnership() ? this.fontHasChar(n, e) && (s = this.fontManager.getCharShape(
29554
- e,
29555
- n,
29556
- this.currentFontSize
29557
- )) : s = this.fontManager.getCharShape(
29558
- e,
29559
- n,
29560
- this.currentFontSize
29561
- ), !s && r && (s = this.fontManager.getCharShape(
29562
- e,
29563
- r,
29564
- this.currentFontSize
29565
- ), s && (i = r)), !s) {
29566
- const o = W0(e);
29567
- o && (s = this.trySymbolFontPercentShape(o));
29611
+ var l;
29612
+ const n = this.currentFont, r = this.shapeSizeForFont(n), s = (l = this._currentContext.bigFont !== void 0 ? this._currentContext.bigFont : this.textStyle.bigFont) == null ? void 0 : l.trim();
29613
+ let i, a = n, o = r, c;
29614
+ if (this.canProbeFontOwnership() ? this.fontHasChar(n, e) && (i = this.fontManager.getCharShape(e, n, r)) : i = this.fontManager.getCharShape(e, n, r), !i && s) {
29615
+ const u = this.shapeSizeForFont(s);
29616
+ i = this.fontManager.getCharShape(e, s, u), i && (a = s, o = u);
29617
+ }
29618
+ if (!i && s && typeof this.fontManager.getCharShapeFromLoadedBigfonts == "function") {
29619
+ const u = this.fontManager.getCharShapeFromLoadedBigfonts(
29620
+ e,
29621
+ this.currentLayoutFontSize,
29622
+ s
29623
+ );
29624
+ u && (i = u.shape, a = u.fontName, o = this.shapeSizeForFont(u.fontName));
29568
29625
  }
29569
- if (s || (s = this.fontManager.getCharShapeFromDefaults(
29570
- e,
29571
- this.currentFontSize
29572
- ), s && (i = n)), !s) {
29573
- const o = e.codePointAt(0);
29574
- o != null && (s = this.fontManager.getCodeShapeFromSymbolFonts(
29575
- o,
29626
+ if (!i) {
29627
+ const u = W0(e);
29628
+ u && (i = this.trySymbolFontPercentShape(u), i && (o = this.currentFontSize));
29629
+ }
29630
+ if (!i && (i = this.fontManager.getCharShapeFromDefaults(e, r), i && (a = n, o = r, s && this.isCjkIdeograph(e) && typeof this.fontManager.getBigfontCellWidth == "function"))) {
29631
+ const u = this.fontManager.getBigfontCellWidth(
29632
+ s,
29633
+ this.currentLayoutFontSize
29634
+ );
29635
+ u != null && u > 0 && (c = u);
29636
+ }
29637
+ if (!i) {
29638
+ const u = e.codePointAt(0);
29639
+ u != null && (i = this.fontManager.getCodeShapeFromSymbolFonts(
29640
+ u,
29576
29641
  this.currentFontSize
29577
- ), s && (i = n));
29642
+ ), i && (a = n, o = this.currentFontSize));
29578
29643
  }
29579
- if (!s || !this.shapeHasStrokeGeometry(s, e)) {
29580
- if (s = this.fontManager.getNotFoundTextShape(this.currentFontSize), !s)
29644
+ if (!i || !this.shapeHasStrokeGeometry(i, e)) {
29645
+ if (i = this.fontManager.getNotFoundTextShape(r), !i)
29581
29646
  return;
29582
- i = n;
29647
+ if (a = n, o = r, s && this.isCjkIdeograph(e) && typeof this.fontManager.getBigfontCellWidth == "function") {
29648
+ const u = this.fontManager.getBigfontCellWidth(
29649
+ s,
29650
+ this.currentLayoutFontSize
29651
+ );
29652
+ u != null && u > 0 && (c = u);
29653
+ }
29583
29654
  }
29584
- return this.currentFontSize > this._maxFontSize && (this._maxFontSize = this.currentFontSize), this.currentLayoutFontSize > this._maxLayoutFontSize && (this._maxLayoutFontSize = this.currentLayoutFontSize), { shape: s, sourceFont: i };
29655
+ return o > this._maxFontSize && (this._maxFontSize = o), this.currentLayoutFontSize > this._maxLayoutFontSize && (this._maxLayoutFontSize = this.currentLayoutFontSize), { shape: i, sourceFont: a, layoutAdvance: c };
29656
+ }
29657
+ /** CJK Unified Ideographs and common compatibility blocks used in CAD text. */
29658
+ isCjkIdeograph(e) {
29659
+ const n = e.codePointAt(0);
29660
+ return n == null ? !1 : n >= 13312 && n <= 19903 || n >= 19968 && n <= 40959 || n >= 63744 && n <= 64255 || n >= 131072 && n <= 183983;
29585
29661
  }
29586
29662
  canProbeFontOwnership() {
29587
29663
  return typeof this.fontManager.getFontByName == "function";
@@ -29767,14 +29843,14 @@ class Qi {
29767
29843
  /** Unions axis-aligned bounds of unit glyphs transformed by placement matrices. */
29768
29844
  unionBoxFromPlacements(e, n) {
29769
29845
  for (const r of n)
29770
- r.geometry.boundingBox || r.geometry.computeBoundingBox(), r.geometry.boundingBox && (Fr.copy(r.geometry.boundingBox), jt.fromArray(r.matrixElements), Fr.applyMatrix4(jt), e.union(Fr));
29846
+ r.geometry.boundingBox || r.geometry.computeBoundingBox(), r.geometry.boundingBox && (Tr.copy(r.geometry.boundingBox), $t.fromArray(r.matrixElements), Tr.applyMatrix4($t), e.union(Tr));
29771
29847
  }
29772
29848
  /** Left-multiplies each placement by a translation (same as `geometry.translate`). */
29773
29849
  translateMeshGlyphPlacements(e, n, r) {
29774
29850
  if (!(!Number.isFinite(n) || !Number.isFinite(r) || n === 0 && r === 0)) {
29775
29851
  Xi.makeTranslation(n, r, 0);
29776
29852
  for (const s of e)
29777
- jt.fromArray(s.matrixElements), jt.premultiply(Xi), s.matrixElements.set(jt.elements);
29853
+ $t.fromArray(s.matrixElements), $t.premultiply(Xi), s.matrixElements.set($t.elements);
29778
29854
  }
29779
29855
  }
29780
29856
  /**
@@ -29878,20 +29954,20 @@ class Qi {
29878
29954
  };
29879
29955
  }
29880
29956
  }
29881
- const $0 = [
29957
+ const j0 = [
29882
29958
  [/%%koff/gi, "\\k"],
29883
29959
  [/%%kon/gi, "\\K"],
29884
29960
  [/%%ooff/gi, "\\o"],
29885
29961
  [/%%oon/gi, "\\O"],
29886
29962
  [/%%uoff/gi, "\\l"],
29887
29963
  [/%%uon/gi, "\\L"]
29888
- ], j0 = /%%([kou])/gi;
29964
+ ], $0 = /%%([kou])/gi;
29889
29965
  function Y0(t) {
29890
29966
  let e = t;
29891
- for (const [i, a] of $0)
29967
+ for (const [i, a] of j0)
29892
29968
  e = e.replace(i, a);
29893
29969
  let n = !1, r = !1, s = !1;
29894
- return e.replace(j0, (i, a) => {
29970
+ return e.replace($0, (i, a) => {
29895
29971
  switch (a.toLowerCase()) {
29896
29972
  case "k":
29897
29973
  return n = !n, n ? "\\K" : "\\k";
@@ -29911,7 +29987,7 @@ function Z0(t) {
29911
29987
  return String.fromCharCode(r);
29912
29988
  });
29913
29989
  }
29914
- const Er = /* @__PURE__ */ new M.Matrix4(), Ji = /* @__PURE__ */ new M.Matrix4(), Yt = /* @__PURE__ */ new M.Vector3(), st = /* @__PURE__ */ new M.Vector3(), it = /* @__PURE__ */ new M.Vector3(), ea = /* @__PURE__ */ new M.Vector3(1, 0, 0);
29990
+ const Lr = /* @__PURE__ */ new M.Matrix4(), Ji = /* @__PURE__ */ new M.Matrix4(), Yt = /* @__PURE__ */ new M.Vector3(), st = /* @__PURE__ */ new M.Vector3(), it = /* @__PURE__ */ new M.Vector3(), ea = /* @__PURE__ */ new M.Vector3(1, 0, 0);
29915
29991
  class an extends M.Object3D {
29916
29992
  /**
29917
29993
  * Extracts all unique font names used in an MText string.
@@ -30141,7 +30217,7 @@ class an extends M.Object3D {
30141
30217
  */
30142
30218
  finalizePlacement(e, n, r, s) {
30143
30219
  var p;
30144
- let i = ji(n);
30220
+ let i = $i(n);
30145
30221
  e.updateWorldMatrix(!0, !0);
30146
30222
  const a = new M.Box3().setFromObject(e);
30147
30223
  if (!Number.isFinite(i)) {
@@ -30191,7 +30267,7 @@ class an extends M.Object3D {
30191
30267
  0
30192
30268
  );
30193
30269
  for (const F of g)
30194
- Er.fromArray(F.matrixElements), Er.premultiply(Ji), F.matrixElements.set(Er.elements);
30270
+ Lr.fromArray(F.matrixElements), Lr.premultiply(Ji), F.matrixElements.set(Lr.elements);
30195
30271
  }
30196
30272
  l(
30197
30273
  (w = (v = m.userData) == null ? void 0 : v.layout) == null ? void 0 : w.chars
@@ -30246,7 +30322,7 @@ class an extends M.Object3D {
30246
30322
  const C = `${n.font}_${n.name}`;
30247
30323
  this.styleManager.unsupportedTextStyles[C] || (this.styleManager.unsupportedTextStyles[C] = 0), this.styleManager.unsupportedTextStyles[C]++;
30248
30324
  }
30249
- const r = ji(e) || 0;
30325
+ const r = $i(e) || 0;
30250
30326
  let s = Oe.LEFT;
30251
30327
  e.attachmentPoint && ([
30252
30328
  te.TopLeft,
@@ -30454,7 +30530,7 @@ class an extends M.Object3D {
30454
30530
  breakIndex: h.breakIndex
30455
30531
  });
30456
30532
  }), s && s.length > 0) {
30457
- const h = (u = e.userData) == null ? void 0 : u.charBoxType, p = $r(
30533
+ const h = (u = e.userData) == null ? void 0 : u.charBoxType, p = jr(
30458
30534
  s,
30459
30535
  e.matrixWorld,
30460
30536
  h
@@ -30520,7 +30596,7 @@ class an extends M.Object3D {
30520
30596
  const i = (u = (l = e.userData) == null ? void 0 : l.layout) == null ? void 0 : u.chars;
30521
30597
  if (i && i.length > 0) {
30522
30598
  const p = (f = e.userData) == null ? void 0 : f.charBoxType;
30523
- $r(
30599
+ jr(
30524
30600
  i,
30525
30601
  e.matrixWorld,
30526
30602
  p
@@ -31146,7 +31222,7 @@ class K0 {
31146
31222
  breakIndex: h.breakIndex
31147
31223
  });
31148
31224
  }), s && s.length > 0) {
31149
- const h = (u = e.userData) == null ? void 0 : u.charBoxType, p = $r(
31225
+ const h = (u = e.userData) == null ? void 0 : u.charBoxType, p = jr(
31150
31226
  s,
31151
31227
  e.matrixWorld,
31152
31228
  h
@@ -31543,7 +31619,7 @@ export {
31543
31619
  fa as BaseTextShape,
31544
31620
  _0 as CJK_MTEXT_CHAR_WIDTH_HEIGHT_RATIO,
31545
31621
  ue as CharBoxType,
31546
- Ir as DEFAULT_FONTS_PRESETS,
31622
+ Rr as DEFAULT_FONTS_PRESETS,
31547
31623
  Vi as DEFAULT_LINE_SPACE_FACTOR,
31548
31624
  qi as DEFAULT_LINE_SPACE_STYLE,
31549
31625
  A0 as DefaultFontLoader,
@@ -31569,7 +31645,7 @@ export {
31569
31645
  Ic as SHX_PARSED_FONT_OVERHEAD,
31570
31646
  Mn as STACK_DIVIDER_CHAR,
31571
31647
  wn as STACK_VERTICAL_SHIFT_FACTOR,
31572
- nr as SYMBOL_FONTS_PRESETS,
31648
+ rr as SYMBOL_FONTS_PRESETS,
31573
31649
  ta as Shape,
31574
31650
  mc as ShxParserFont,
31575
31651
  V as TextRenderProfiler,
@@ -31581,7 +31657,7 @@ export {
31581
31657
  B0 as deserializeMTextColor,
31582
31658
  va as emptyMaterialStats,
31583
31659
  la as estimateGeometryBytes,
31584
- $i as estimateMTextWrapWidth,
31660
+ ji as estimateMTextWrapWidth,
31585
31661
  Oc as estimateMaterialBytes,
31586
31662
  qo as estimateStringBytes,
31587
31663
  Be as formatBytes,
@@ -31594,6 +31670,6 @@ export {
31594
31670
  Mo as markMeshGlyphGeometry,
31595
31671
  O0 as readJsHeapStats,
31596
31672
  Qt as resolveMTextColor,
31597
- ji as resolveMTextWrapWidth,
31673
+ $i as resolveMTextWrapWidth,
31598
31674
  n1 as serializeMTextColor
31599
31675
  };