@mlightcad/mtext-renderer 0.12.2 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -34,14 +34,14 @@ class gs {
34
34
  r.call(null, e, ...n);
35
35
  }
36
36
  }
37
- const Ro = (t) => t.substring(t.lastIndexOf(".") + 1), ta = (t) => t.split("/").pop(), lt = (t) => {
37
+ const Bo = (t) => t.substring(t.lastIndexOf(".") + 1), ta = (t) => t.split("/").pop(), lt = (t) => {
38
38
  const e = ta(t);
39
39
  if (e) {
40
40
  const n = e.lastIndexOf(".");
41
41
  return n === -1 ? e : e.substring(0, n);
42
42
  }
43
43
  return t;
44
- }, Bo = [
44
+ }, Ro = [
45
45
  0,
46
46
  16711680,
47
47
  16776960,
@@ -299,7 +299,7 @@ const Ro = (t) => t.substring(t.lastIndexOf(".") + 1), ta = (t) => t.split("/").
299
299
  14079702,
300
300
  16777215,
301
301
  0
302
- ], na = (t) => Bo[t];
302
+ ], na = (t) => Ro[t];
303
303
  function ra(t) {
304
304
  var r, s, i;
305
305
  if (!t || Do(t))
@@ -701,7 +701,7 @@ const St = {
701
701
  }
702
702
  ]
703
703
  }
704
- ], Be = class Be {
704
+ ], Re = class Re {
705
705
  constructor() {
706
706
  this.isClosing = !1, typeof window < "u" && window.addEventListener("unload", () => {
707
707
  this.close();
@@ -711,7 +711,7 @@ const St = {
711
711
  * Returns the singleton instance of the FontCacheManager
712
712
  */
713
713
  static get instance() {
714
- return Be._instance || (Be._instance = new Be()), Be._instance;
714
+ return Re._instance || (Re._instance = new Re()), Re._instance;
715
715
  }
716
716
  /**
717
717
  * Sets a font in the cache
@@ -809,15 +809,15 @@ const St = {
809
809
  * Use with caution as this operation cannot be undone.
810
810
  */
811
811
  async destroy() {
812
- this.close(), await indexedDB.deleteDatabase(Be.DATABASE_NAME), Be._instance = void 0;
812
+ this.close(), await indexedDB.deleteDatabase(Re.DATABASE_NAME), Re._instance = void 0;
813
813
  }
814
814
  // Private methods for database management
815
815
  async getDatabase() {
816
816
  if (this.isClosing)
817
817
  throw new Error("Cannot perform operation while database is closing");
818
818
  return this.db ? this.db : (this.db = await Vo(
819
- Be.DATABASE_NAME,
820
- Be.DATABASE_VERSION,
819
+ Re.DATABASE_NAME,
820
+ Re.DATABASE_VERSION,
821
821
  {
822
822
  upgrade: (e, n, r) => this.handleUpgrade(e, n, r),
823
823
  blocked() {
@@ -826,7 +826,7 @@ const St = {
826
826
  );
827
827
  },
828
828
  blocking() {
829
- console.warn("Database blocking newer version - closing connection"), Be.instance.close();
829
+ console.warn("Database blocking newer version - closing connection"), Re.instance.close();
830
830
  }
831
831
  }
832
832
  ), this.db);
@@ -854,8 +854,8 @@ const St = {
854
854
  e.objectStoreNames.contains(r.name) || e.createObjectStore(r.name, { keyPath: r.keyPath });
855
855
  }
856
856
  };
857
- Be.DATABASE_NAME = "mlightcad", Be.DATABASE_VERSION = Kn[Kn.length - 1].version;
858
- let st = Be;
857
+ Re.DATABASE_NAME = "mlightcad", Re.DATABASE_VERSION = Kn[Kn.length - 1].version;
858
+ let st = Re;
859
859
  const Ko = 512;
860
860
  function Zo(t, e) {
861
861
  return (t + e) * Ko;
@@ -1382,21 +1382,21 @@ function va(t) {
1382
1382
  function ks(t, e) {
1383
1383
  t || va(e);
1384
1384
  }
1385
- var H = { fail: va, argument: ks, assert: ks }, Fs = 32768, Es = 2147483648, cc = -32768, lc = 32767 + 1 / 65536, Pt = {}, B = {}, z = {};
1385
+ var H = { fail: va, argument: ks, assert: ks }, Fs = 32768, Es = 2147483648, cc = -32768, lc = 32767 + 1 / 65536, Pt = {}, R = {}, z = {};
1386
1386
  function qe(t) {
1387
1387
  return function() {
1388
1388
  return t;
1389
1389
  };
1390
1390
  }
1391
- B.BYTE = function(t) {
1391
+ R.BYTE = function(t) {
1392
1392
  return H.argument(t >= 0 && t <= 255, "Byte value should be between 0 and 255."), [t];
1393
1393
  };
1394
1394
  z.BYTE = qe(1);
1395
- B.CHAR = function(t) {
1395
+ R.CHAR = function(t) {
1396
1396
  return [t.charCodeAt(0)];
1397
1397
  };
1398
1398
  z.CHAR = qe(1);
1399
- B.CHARARRAY = function(t) {
1399
+ R.CHARARRAY = function(t) {
1400
1400
  (t === null || typeof t > "u") && (t = "", console.warn("CHARARRAY with undefined or null value encountered and treated as an empty string. This is probably caused by a missing glyph name."));
1401
1401
  const e = [];
1402
1402
  for (let n = 0; n < t.length; n += 1)
@@ -1406,48 +1406,48 @@ B.CHARARRAY = function(t) {
1406
1406
  z.CHARARRAY = function(t) {
1407
1407
  return typeof t > "u" ? 0 : t.length;
1408
1408
  };
1409
- B.USHORT = function(t) {
1409
+ R.USHORT = function(t) {
1410
1410
  return [t >> 8 & 255, t & 255];
1411
1411
  };
1412
1412
  z.USHORT = qe(2);
1413
- B.SHORT = function(t) {
1413
+ R.SHORT = function(t) {
1414
1414
  return t >= Fs && (t = -(2 * Fs - t)), [t >> 8 & 255, t & 255];
1415
1415
  };
1416
1416
  z.SHORT = qe(2);
1417
- B.UINT24 = function(t) {
1417
+ R.UINT24 = function(t) {
1418
1418
  return [t >> 16 & 255, t >> 8 & 255, t & 255];
1419
1419
  };
1420
1420
  z.UINT24 = qe(3);
1421
- B.ULONG = function(t) {
1421
+ R.ULONG = function(t) {
1422
1422
  return [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
1423
1423
  };
1424
1424
  z.ULONG = qe(4);
1425
- B.LONG = function(t) {
1425
+ R.LONG = function(t) {
1426
1426
  return t >= Es && (t = -(2 * Es - t)), [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
1427
1427
  };
1428
1428
  z.LONG = qe(4);
1429
- B.FLOAT = function(t) {
1429
+ R.FLOAT = function(t) {
1430
1430
  if (t > lc || t < cc)
1431
1431
  throw new Error(`Value ${t} is outside the range of representable values in 16.16 format`);
1432
1432
  const e = Math.round(t * 65536) << 0;
1433
- return B.ULONG(e);
1433
+ return R.ULONG(e);
1434
1434
  };
1435
1435
  z.FLOAT = z.ULONG;
1436
- B.FIXED = B.ULONG;
1436
+ R.FIXED = R.ULONG;
1437
1437
  z.FIXED = z.ULONG;
1438
- B.FWORD = B.SHORT;
1438
+ R.FWORD = R.SHORT;
1439
1439
  z.FWORD = z.SHORT;
1440
- B.UFWORD = B.USHORT;
1440
+ R.UFWORD = R.USHORT;
1441
1441
  z.UFWORD = z.USHORT;
1442
- B.F2DOT14 = function(t) {
1443
- return B.USHORT(t * 16384);
1442
+ R.F2DOT14 = function(t) {
1443
+ return R.USHORT(t * 16384);
1444
1444
  };
1445
1445
  z.F2DOT14 = z.USHORT;
1446
- B.LONGDATETIME = function(t) {
1446
+ R.LONGDATETIME = function(t) {
1447
1447
  return [0, 0, 0, 0, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
1448
1448
  };
1449
1449
  z.LONGDATETIME = qe(8);
1450
- B.TAG = function(t) {
1450
+ R.TAG = function(t) {
1451
1451
  return H.argument(t.length === 4, "Tag should be exactly 4 ASCII characters."), [
1452
1452
  t.charCodeAt(0),
1453
1453
  t.charCodeAt(1),
@@ -1456,29 +1456,29 @@ B.TAG = function(t) {
1456
1456
  ];
1457
1457
  };
1458
1458
  z.TAG = qe(4);
1459
- B.Card8 = B.BYTE;
1459
+ R.Card8 = R.BYTE;
1460
1460
  z.Card8 = z.BYTE;
1461
- B.Card16 = B.USHORT;
1461
+ R.Card16 = R.USHORT;
1462
1462
  z.Card16 = z.USHORT;
1463
- B.OffSize = B.BYTE;
1463
+ R.OffSize = R.BYTE;
1464
1464
  z.OffSize = z.BYTE;
1465
- B.SID = B.USHORT;
1465
+ R.SID = R.USHORT;
1466
1466
  z.SID = z.USHORT;
1467
- B.NUMBER = function(t) {
1468
- return t >= -107 && t <= 107 ? [t + 139] : t >= 108 && t <= 1131 ? (t = t - 108, [(t >> 8) + 247, t & 255]) : t >= -1131 && t <= -108 ? (t = -t - 108, [(t >> 8) + 251, t & 255]) : t >= -32768 && t <= 32767 ? B.NUMBER16(t) : B.NUMBER32(t);
1467
+ R.NUMBER = function(t) {
1468
+ return t >= -107 && t <= 107 ? [t + 139] : t >= 108 && t <= 1131 ? (t = t - 108, [(t >> 8) + 247, t & 255]) : t >= -1131 && t <= -108 ? (t = -t - 108, [(t >> 8) + 251, t & 255]) : t >= -32768 && t <= 32767 ? R.NUMBER16(t) : R.NUMBER32(t);
1469
1469
  };
1470
1470
  z.NUMBER = function(t) {
1471
- return B.NUMBER(t).length;
1471
+ return R.NUMBER(t).length;
1472
1472
  };
1473
- B.NUMBER16 = function(t) {
1473
+ R.NUMBER16 = function(t) {
1474
1474
  return [28, t >> 8 & 255, t & 255];
1475
1475
  };
1476
1476
  z.NUMBER16 = qe(3);
1477
- B.NUMBER32 = function(t) {
1477
+ R.NUMBER32 = function(t) {
1478
1478
  return [29, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
1479
1479
  };
1480
1480
  z.NUMBER32 = qe(5);
1481
- B.REAL = function(t) {
1481
+ R.REAL = function(t) {
1482
1482
  let e = t.toString();
1483
1483
  const n = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);
1484
1484
  if (n) {
@@ -1497,11 +1497,11 @@ B.REAL = function(t) {
1497
1497
  return s;
1498
1498
  };
1499
1499
  z.REAL = function(t) {
1500
- return B.REAL(t).length;
1500
+ return R.REAL(t).length;
1501
1501
  };
1502
- B.NAME = B.CHARARRAY;
1502
+ R.NAME = R.CHARARRAY;
1503
1503
  z.NAME = z.CHARARRAY;
1504
- B.STRING = B.CHARARRAY;
1504
+ R.STRING = R.CHARARRAY;
1505
1505
  z.STRING = z.CHARARRAY;
1506
1506
  Pt.UTF8 = function(t, e, n) {
1507
1507
  const r = [], s = n;
@@ -1515,7 +1515,7 @@ Pt.UTF16 = function(t, e, n) {
1515
1515
  r[i] = t.getUint16(e);
1516
1516
  return String.fromCharCode.apply(null, r);
1517
1517
  };
1518
- B.UTF16 = function(t) {
1518
+ R.UTF16 = function(t) {
1519
1519
  const e = [];
1520
1520
  for (let n = 0; n < t.length; n += 1) {
1521
1521
  const r = t.charCodeAt(n);
@@ -1601,7 +1601,7 @@ var hn = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), fn, uc =
1601
1601
  r[n.charCodeAt(s)] = s + 128;
1602
1602
  return hn && hn.set(e, r), r;
1603
1603
  };
1604
- B.MACSTRING = function(t, e) {
1604
+ R.MACSTRING = function(t, e) {
1605
1605
  const n = uc(e);
1606
1606
  if (n === void 0)
1607
1607
  return;
@@ -1615,7 +1615,7 @@ B.MACSTRING = function(t, e) {
1615
1615
  return r;
1616
1616
  };
1617
1617
  z.MACSTRING = function(t, e) {
1618
- const n = B.MACSTRING(t, e);
1618
+ const n = R.MACSTRING(t, e);
1619
1619
  return n !== void 0 ? n.length : 0;
1620
1620
  };
1621
1621
  function Lr(t) {
@@ -1660,7 +1660,7 @@ function pc(t, e, n) {
1660
1660
  }
1661
1661
  return i;
1662
1662
  }
1663
- B.VARDELTAS = function(t) {
1663
+ R.VARDELTAS = function(t) {
1664
1664
  let e = 0;
1665
1665
  const n = [];
1666
1666
  for (; e < t.length; ) {
@@ -1669,35 +1669,35 @@ B.VARDELTAS = function(t) {
1669
1669
  }
1670
1670
  return n;
1671
1671
  };
1672
- B.INDEX = function(t) {
1672
+ R.INDEX = function(t) {
1673
1673
  let e = 1;
1674
1674
  const n = [e], r = [];
1675
1675
  for (let o = 0; o < t.length; o += 1) {
1676
- const c = B.OBJECT(t[o]);
1676
+ const c = R.OBJECT(t[o]);
1677
1677
  Array.prototype.push.apply(r, c), e += c.length, n.push(e);
1678
1678
  }
1679
1679
  if (r.length === 0)
1680
1680
  return [0, 0];
1681
- const s = [], i = 1 + Math.floor(Math.log(e) / Math.log(2)) / 8 | 0, a = [void 0, B.BYTE, B.USHORT, B.UINT24, B.ULONG][i];
1681
+ const s = [], i = 1 + Math.floor(Math.log(e) / Math.log(2)) / 8 | 0, a = [void 0, R.BYTE, R.USHORT, R.UINT24, R.ULONG][i];
1682
1682
  for (let o = 0; o < n.length; o += 1) {
1683
1683
  const c = a(n[o]);
1684
1684
  Array.prototype.push.apply(s, c);
1685
1685
  }
1686
1686
  return Array.prototype.concat(
1687
- B.Card16(t.length),
1688
- B.OffSize(i),
1687
+ R.Card16(t.length),
1688
+ R.OffSize(i),
1689
1689
  s,
1690
1690
  r
1691
1691
  );
1692
1692
  };
1693
1693
  z.INDEX = function(t) {
1694
- return B.INDEX(t).length;
1694
+ return R.INDEX(t).length;
1695
1695
  };
1696
- B.DICT = function(t) {
1696
+ R.DICT = function(t) {
1697
1697
  let e = [];
1698
1698
  const n = Object.keys(t), r = n.length;
1699
1699
  for (let s = 0; s < r; s += 1) {
1700
- const i = parseInt(n[s], 0), a = t[i], o = B.OPERAND(a.value, a.type), c = B.OPERATOR(i);
1700
+ const i = parseInt(n[s], 0), a = t[i], o = R.OPERAND(a.value, a.type), c = R.OPERATOR(i);
1701
1701
  for (let l = 0; l < o.length; l++)
1702
1702
  e.push(o[l]);
1703
1703
  for (let l = 0; l < c.length; l++)
@@ -1706,44 +1706,44 @@ B.DICT = function(t) {
1706
1706
  return e;
1707
1707
  };
1708
1708
  z.DICT = function(t) {
1709
- return B.DICT(t).length;
1709
+ return R.DICT(t).length;
1710
1710
  };
1711
- B.OPERATOR = function(t) {
1711
+ R.OPERATOR = function(t) {
1712
1712
  return t < 1200 ? [t] : [12, t - 1200];
1713
1713
  };
1714
- B.OPERAND = function(t, e) {
1714
+ R.OPERAND = function(t, e) {
1715
1715
  let n = [];
1716
1716
  if (Array.isArray(e))
1717
1717
  for (let r = 0; r < e.length; r += 1) {
1718
1718
  H.argument(t.length === e.length, "Not enough arguments given for type" + e);
1719
- const s = B.OPERAND(t[r], e[r]);
1719
+ const s = R.OPERAND(t[r], e[r]);
1720
1720
  for (let i = 0; i < s.length; i++)
1721
1721
  n.push(s[i]);
1722
1722
  }
1723
1723
  else if (e === "SID") {
1724
- const r = B.NUMBER(t);
1724
+ const r = R.NUMBER(t);
1725
1725
  for (let s = 0; s < r.length; s++)
1726
1726
  n.push(r[s]);
1727
1727
  } else if (e === "offset") {
1728
- const r = B.NUMBER32(t);
1728
+ const r = R.NUMBER32(t);
1729
1729
  for (let s = 0; s < r.length; s++)
1730
1730
  n.push(r[s]);
1731
1731
  } else if (e === "number") {
1732
- const r = B.NUMBER(t);
1732
+ const r = R.NUMBER(t);
1733
1733
  for (let s = 0; s < r.length; s++)
1734
1734
  n.push(r[s]);
1735
1735
  } else if (e === "real") {
1736
- const r = B.REAL(t);
1736
+ const r = R.REAL(t);
1737
1737
  for (let s = 0; s < r.length; s++)
1738
1738
  n.push(r[s]);
1739
1739
  } else
1740
1740
  throw new Error("Unknown operand type " + e);
1741
1741
  return n;
1742
1742
  };
1743
- B.OP = B.BYTE;
1743
+ R.OP = R.BYTE;
1744
1744
  z.OP = z.BYTE;
1745
1745
  var pn = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap();
1746
- B.CHARSTRING = function(t) {
1746
+ R.CHARSTRING = function(t) {
1747
1747
  if (pn) {
1748
1748
  const r = pn.get(t);
1749
1749
  if (r !== void 0)
@@ -1752,28 +1752,28 @@ B.CHARSTRING = function(t) {
1752
1752
  let e = [];
1753
1753
  const n = t.length;
1754
1754
  for (let r = 0; r < n; r += 1) {
1755
- const s = t[r], i = B[s.type](s.value);
1755
+ const s = t[r], i = R[s.type](s.value);
1756
1756
  for (let a = 0; a < i.length; a++)
1757
1757
  e.push(i[a]);
1758
1758
  }
1759
1759
  return pn && pn.set(t, e), e;
1760
1760
  };
1761
1761
  z.CHARSTRING = function(t) {
1762
- return B.CHARSTRING(t).length;
1762
+ return R.CHARSTRING(t).length;
1763
1763
  };
1764
- B.OBJECT = function(t) {
1765
- const e = B[t.type];
1764
+ R.OBJECT = function(t) {
1765
+ const e = R[t.type];
1766
1766
  return H.argument(e !== void 0, "No encoding function for type " + t.type), e(t.value);
1767
1767
  };
1768
1768
  z.OBJECT = function(t) {
1769
1769
  const e = z[t.type];
1770
1770
  return H.argument(e !== void 0, "No sizeOf function for type " + t.type), e(t.value);
1771
1771
  };
1772
- B.TABLE = function(t) {
1772
+ R.TABLE = function(t) {
1773
1773
  let e = [];
1774
1774
  const n = (t.fields || []).length, r = [], s = [];
1775
1775
  for (let i = 0; i < n; i += 1) {
1776
- const a = t.fields[i], o = B[a.type];
1776
+ const a = t.fields[i], o = R[a.type];
1777
1777
  H.argument(o !== void 0, "No encoding function for field type " + a.type + " (" + a.name + ")");
1778
1778
  let c = t[a.name];
1779
1779
  c === void 0 && (c = a.value);
@@ -1803,9 +1803,9 @@ z.TABLE = function(t) {
1803
1803
  }
1804
1804
  return e;
1805
1805
  };
1806
- B.RECORD = B.TABLE;
1806
+ R.RECORD = R.TABLE;
1807
1807
  z.RECORD = z.TABLE;
1808
- B.LITERAL = function(t) {
1808
+ R.LITERAL = function(t) {
1809
1809
  return t;
1810
1810
  };
1811
1811
  z.LITERAL = function(t) {
@@ -1826,7 +1826,7 @@ function pe(t, e, n) {
1826
1826
  }
1827
1827
  }
1828
1828
  pe.prototype.encode = function() {
1829
- return B.TABLE(this);
1829
+ return R.TABLE(this);
1830
1830
  };
1831
1831
  pe.prototype.sizeOf = function() {
1832
1832
  return z.TABLE(this);
@@ -2486,7 +2486,7 @@ k.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
2486
2486
  g.privatePoints = [], this.relativeOffset = h, n === "cvar" && !g.peakTuple && console.warn("An embedded peak tuple is required in TupleVariationHeaders for the cvar table."), g.flags.privatePointNumbers && (g.privatePoints = this.parsePackedPointNumbers()), delete g.flags;
2487
2487
  const b = this.offset, v = this.relativeOffset, w = (C) => {
2488
2488
  let T, E;
2489
- const R = () => {
2489
+ const B = () => {
2490
2490
  let U = 0;
2491
2491
  if (n === "gvar") {
2492
2492
  if (U = g.privatePoints.length || f.length, !U) {
@@ -2499,10 +2499,10 @@ k.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
2499
2499
  return {
2500
2500
  configurable: !0,
2501
2501
  get: function() {
2502
- return T === void 0 && R(), C === "deltasY" ? E : T;
2502
+ return T === void 0 && B(), C === "deltasY" ? E : T;
2503
2503
  },
2504
2504
  set: function(U) {
2505
- T === void 0 && R(), C === "deltasY" ? E = U : T = U;
2505
+ T === void 0 && B(), C === "deltasY" ? E = U : T = U;
2506
2506
  }
2507
2507
  };
2508
2508
  };
@@ -2569,7 +2569,7 @@ var M = {
2569
2569
  getBytes: bc,
2570
2570
  bytesToString: xc,
2571
2571
  Parser: k
2572
- }, Rn = [
2572
+ }, Bn = [
2573
2573
  "copyright",
2574
2574
  // 0
2575
2575
  "fontFamily",
@@ -3203,7 +3203,7 @@ function wc(t, e, n) {
3203
3203
  return Ta[e];
3204
3204
  }
3205
3205
  }
3206
- var Rr = "utf-16", Cc = {
3206
+ var Br = "utf-16", Cc = {
3207
3207
  0: "macintosh",
3208
3208
  // smRoman
3209
3209
  1: "x-mac-japanese",
@@ -3297,12 +3297,12 @@ var Rr = "utf-16", Cc = {
3297
3297
  function $r(t, e, n) {
3298
3298
  switch (t) {
3299
3299
  case 0:
3300
- return Rr;
3300
+ return Br;
3301
3301
  case 1:
3302
3302
  return Tc[n] || Cc[e];
3303
3303
  case 3:
3304
3304
  if (e === 1 || e === 10)
3305
- return Rr;
3305
+ return Br;
3306
3306
  break;
3307
3307
  }
3308
3308
  }
@@ -3318,10 +3318,10 @@ function kc(t) {
3318
3318
  function Fc(t, e, n) {
3319
3319
  const r = {}, s = new M.Parser(t, e), i = s.parseUShort(), a = s.parseUShort(), o = s.offset + s.parseUShort();
3320
3320
  for (let c = 0; c < a; c++) {
3321
- const l = s.parseUShort(), u = s.parseUShort(), f = s.parseUShort(), h = s.parseUShort(), p = Rn[h] || h, y = s.parseUShort(), g = s.parseUShort(), b = wc(l, f, n), v = $r(l, u, f), w = kc(l);
3321
+ const l = s.parseUShort(), u = s.parseUShort(), f = s.parseUShort(), h = s.parseUShort(), p = Bn[h] || h, y = s.parseUShort(), g = s.parseUShort(), b = wc(l, f, n), v = $r(l, u, f), w = kc(l);
3322
3322
  if (v !== void 0 && b !== void 0 && w !== void 0) {
3323
3323
  let C;
3324
- if (v === Rr ? C = Pt.UTF16(t, o + g, y) : C = Pt.MACSTRING(t, o + g, y, v), C) {
3324
+ if (v === Br ? C = Pt.UTF16(t, o + g, y) : C = Pt.MACSTRING(t, o + g, y, v), C) {
3325
3325
  let T = r[w];
3326
3326
  T === void 0 && (T = r[w] = {});
3327
3327
  let E = T[p];
@@ -3374,7 +3374,7 @@ function Ac(t, e) {
3374
3374
  const n = dn(ka), r = dn(Ca), s = dn(Ta), i = [], a = [];
3375
3375
  for (let c in t) {
3376
3376
  let l;
3377
- const u = [], f = {}, h = dn(Rn), p = n[c];
3377
+ const u = [], f = {}, h = dn(Bn), p = n[c];
3378
3378
  for (let y in t[c]) {
3379
3379
  let g = h[y];
3380
3380
  if (g === void 0 && (g = y), l = parseInt(g), isNaN(l))
@@ -3389,23 +3389,23 @@ function Ac(t, e) {
3389
3389
  if (p === 1 || p === 0) {
3390
3390
  let w = r[b], C = Sc[w];
3391
3391
  const T = $r(p, C, w);
3392
- let E = B.MACSTRING(v, T);
3393
- if (p === 0 && (w = e.indexOf(b), w < 0 && (w = e.length, e.push(b)), C = 4, E = B.UTF16(v)), E !== void 0) {
3394
- const R = Is(E, a);
3392
+ let E = R.MACSTRING(v, T);
3393
+ if (p === 0 && (w = e.indexOf(b), w < 0 && (w = e.length, e.push(b)), C = 4, E = R.UTF16(v)), E !== void 0) {
3394
+ const B = Is(E, a);
3395
3395
  i.push(Ls(
3396
3396
  p,
3397
3397
  C,
3398
3398
  w,
3399
3399
  l,
3400
3400
  E.length,
3401
- R
3401
+ B
3402
3402
  ));
3403
3403
  }
3404
3404
  }
3405
3405
  if (p === 3) {
3406
3406
  const w = s[b];
3407
3407
  if (w !== void 0) {
3408
- const C = B.UTF16(v), T = Is(C, a);
3408
+ const C = R.UTF16(v), T = Is(C, a);
3409
3409
  i.push(Ls(
3410
3410
  3,
3411
3411
  1,
@@ -3431,18 +3431,18 @@ function Ac(t, e) {
3431
3431
  o.fields.push({ name: "record_" + c, type: "RECORD", value: i[c] });
3432
3432
  return o.fields.push({ name: "strings", type: "LITERAL", value: a }), o;
3433
3433
  }
3434
- function Bn(t, e, n = []) {
3435
- if (e < 256 && e in Rn) {
3434
+ function Rn(t, e, n = []) {
3435
+ if (e < 256 && e in Bn) {
3436
3436
  if (n.length && !n.includes(parseInt(e)))
3437
3437
  return;
3438
- e = Rn[e];
3438
+ e = Bn[e];
3439
3439
  }
3440
3440
  for (let r in t)
3441
3441
  for (let s in t[r])
3442
3442
  if (s === e || parseInt(s) === e)
3443
3443
  return t[r][s];
3444
3444
  }
3445
- var Fa = { parse: Fc, make: Ac, getNameByID: Bn };
3445
+ var Fa = { parse: Fc, make: Ac, getNameByID: Rn };
3446
3446
  function Oc(t, e, n, r) {
3447
3447
  t.length = e.parseUShort(), t.language = e.parseUShort() - 1;
3448
3448
  const s = e.parseByteList(t.length), i = Object.assign({}, s), a = $r(n, r, t.language), o = kn[a];
@@ -3474,7 +3474,7 @@ function Ic(t, e, n, r, s) {
3474
3474
  b !== 0 ? (u = l.offset + l.relativeOffset - 2, u += b, u += (v - y) * 2, h = M.getUShort(n, u), h !== 0 && (h = h + g & 65535)) : h = v + g & 65535, t.glyphIndexMap[v] = h;
3475
3475
  }
3476
3476
  }
3477
- function Rc(t, e) {
3477
+ function Bc(t, e) {
3478
3478
  const n = {};
3479
3479
  e.skip("uLong");
3480
3480
  const r = e.parseULong();
@@ -3503,7 +3503,7 @@ function Rc(t, e) {
3503
3503
  }
3504
3504
  t.varSelectorList = n;
3505
3505
  }
3506
- function Bc(t, e) {
3506
+ function Rc(t, e) {
3507
3507
  const n = {};
3508
3508
  n.version = M.getUShort(t, e), H.argument(n.version === 0, "cmap table version should be 0."), n.numTables = M.getUShort(t, e + 2);
3509
3509
  let r = null, s = -1, i = -1, a = null, o = null;
@@ -3532,7 +3532,7 @@ function Bc(t, e) {
3532
3532
  throw new Error(
3533
3533
  "Only format 0 (platformId 1, encodingId 0), 4, 12 and 14 cmap tables are supported (found format " + n.format + ", platformId " + a + ", encodingId " + o + ")."
3534
3534
  );
3535
- return r && Rc(n, r), n;
3535
+ return r && Bc(n, r), n;
3536
3536
  }
3537
3537
  function Dc(t, e, n) {
3538
3538
  t.segments.push({
@@ -3629,7 +3629,7 @@ function Uc(t) {
3629
3629
  }
3630
3630
  return s;
3631
3631
  }
3632
- var Ea = { parse: Bc, make: Uc }, xn = [
3632
+ var Ea = { parse: Rc, make: Uc }, xn = [
3633
3633
  ".notdef",
3634
3634
  "space",
3635
3635
  "exclam",
@@ -4506,7 +4506,7 @@ var Ea = { parse: Bc, make: Uc }, xn = [
4506
4506
  "dollarinferior",
4507
4507
  "periodinferior",
4508
4508
  "commainferior"
4509
- ], Br = [
4509
+ ], Rr = [
4510
4510
  "",
4511
4511
  "",
4512
4512
  "",
@@ -5443,7 +5443,7 @@ function Xc(t) {
5443
5443
  a: s
5444
5444
  };
5445
5445
  }
5446
- function Ra(t) {
5446
+ function Ba(t) {
5447
5447
  return parseInt(`0x${ze(t.b)}${ze(t.g)}${ze(t.r)}${ze(t.a * 255)}`, 16);
5448
5448
  }
5449
5449
  function Dn(t, e = "hexa") {
@@ -5455,7 +5455,7 @@ function Dn(t, e = "hexa") {
5455
5455
  if (e == "bgra")
5456
5456
  return t;
5457
5457
  if (n)
5458
- return Ra(t);
5458
+ return Ba(t);
5459
5459
  } else if (!r && /^#([a-f0-9]{3}|[a-f0-9]{4}|[a-f0-9]{6}|[a-f0-9]{8})$/i.test(t.trim())) {
5460
5460
  switch (t = t.trim().substring(1), t.length) {
5461
5461
  case 3:
@@ -5556,12 +5556,12 @@ function Ht(t, e = "hexa") {
5556
5556
  return t;
5557
5557
  case "raw":
5558
5558
  case "cpal":
5559
- return Ra(t);
5559
+ return Ba(t);
5560
5560
  default:
5561
5561
  throw new Error("Unknown color format: " + e);
5562
5562
  }
5563
5563
  }
5564
- var Ba = { parse: jc, make: $c, getPaletteColor: Xr, parseColor: Dn, formatColor: Ht };
5564
+ var Ra = { parse: jc, make: $c, getPaletteColor: Xr, parseColor: Dn, formatColor: Ht };
5565
5565
  function Kc(t, e) {
5566
5566
  let n = e || new Ut();
5567
5567
  return {
@@ -5814,7 +5814,7 @@ function Da(t, e) {
5814
5814
  } else
5815
5815
  return !1;
5816
5816
  }
5817
- var Rs = 10;
5817
+ var Bs = 10;
5818
5818
  function Mn(t) {
5819
5819
  let e;
5820
5820
  return t.length < 1240 ? e = 107 : t.length < 33900 ? e = 1131 : e = 32768, e;
@@ -6114,7 +6114,7 @@ function Ua(t, e) {
6114
6114
  function Dr(t, e, n, r, s) {
6115
6115
  let i, a, o, c;
6116
6116
  const l = new Ut(), u = [];
6117
- let f = 0, h = !1, p = !1, y = 0, g = 0, b, v, w, C, T = 0, E = [], R, U = 0;
6117
+ let f = 0, h = !1, p = !1, y = 0, g = 0, b, v, w, C, T = 0, E = [], B, U = 0;
6118
6118
  const W = t.tables.cff2 || t.tables.cff;
6119
6119
  if (w = W.topDict._defaultWidthX, C = W.topDict._nominalWidthX, s = s || t.variation && t.variation.get(), e.getBlendPath || (e.getBlendPath = function(D) {
6120
6120
  return Dr(t, e, n, r, D);
@@ -6133,7 +6133,7 @@ function Dr(t, e, n, r, s) {
6133
6133
  D = (u.length & 1) !== 0, D && !h && (N = u.shift() + C), f += u.length >> 1, u.length = 0, h = !0;
6134
6134
  }
6135
6135
  function P(D) {
6136
- let _, re, Te, Qe, _e, fe, Y, te, de, be, me, ye, ce = 0;
6136
+ let _, re, Te, Qe, _e, fe, Y, ne, de, be, me, ye, ce = 0;
6137
6137
  for (; ce < D.length; ) {
6138
6138
  let ve = D[ce];
6139
6139
  switch (ce += 1, ve) {
@@ -6164,7 +6164,7 @@ function Dr(t, e, n, r, s) {
6164
6164
  break;
6165
6165
  case 10:
6166
6166
  if (_e = u.pop() + v, fe = b[_e], fe) {
6167
- if (U >= Rs) {
6167
+ if (U >= Bs) {
6168
6168
  console.warn("CFF charstring subroutine call depth exceeded, skipping callsubr");
6169
6169
  break;
6170
6170
  }
@@ -6180,16 +6180,16 @@ function Dr(t, e, n, r, s) {
6180
6180
  case 12:
6181
6181
  switch (ve = D[ce], ce += 1, ve) {
6182
6182
  case 35:
6183
- i = y + u.shift(), a = g + u.shift(), o = i + u.shift(), c = a + u.shift(), Y = o + u.shift(), te = c + u.shift(), de = Y + u.shift(), be = te + u.shift(), me = de + u.shift(), ye = be + u.shift(), y = me + u.shift(), g = ye + u.shift(), u.shift(), l.curveTo(i, a, o, c, Y, te), l.curveTo(de, be, me, ye, y, g);
6183
+ i = y + u.shift(), a = g + u.shift(), o = i + u.shift(), c = a + u.shift(), Y = o + u.shift(), ne = c + u.shift(), de = Y + u.shift(), be = ne + u.shift(), me = de + u.shift(), ye = be + u.shift(), y = me + u.shift(), g = ye + u.shift(), u.shift(), l.curveTo(i, a, o, c, Y, ne), l.curveTo(de, be, me, ye, y, g);
6184
6184
  break;
6185
6185
  case 34:
6186
- i = y + u.shift(), a = g, o = i + u.shift(), c = a + u.shift(), Y = o + u.shift(), te = c, de = Y + u.shift(), be = c, me = de + u.shift(), ye = g, y = me + u.shift(), l.curveTo(i, a, o, c, Y, te), l.curveTo(de, be, me, ye, y, g);
6186
+ i = y + u.shift(), a = g, o = i + u.shift(), c = a + u.shift(), Y = o + u.shift(), ne = c, de = Y + u.shift(), be = c, me = de + u.shift(), ye = g, y = me + u.shift(), l.curveTo(i, a, o, c, Y, ne), l.curveTo(de, be, me, ye, y, g);
6187
6187
  break;
6188
6188
  case 36:
6189
- i = y + u.shift(), a = g + u.shift(), o = i + u.shift(), c = a + u.shift(), Y = o + u.shift(), te = c, de = Y + u.shift(), be = c, me = de + u.shift(), ye = be + u.shift(), y = me + u.shift(), l.curveTo(i, a, o, c, Y, te), l.curveTo(de, be, me, ye, y, g);
6189
+ i = y + u.shift(), a = g + u.shift(), o = i + u.shift(), c = a + u.shift(), Y = o + u.shift(), ne = c, de = Y + u.shift(), be = c, me = de + u.shift(), ye = be + u.shift(), y = me + u.shift(), l.curveTo(i, a, o, c, Y, ne), l.curveTo(de, be, me, ye, y, g);
6190
6190
  break;
6191
6191
  case 37:
6192
- i = y + u.shift(), a = g + u.shift(), o = i + u.shift(), c = a + u.shift(), Y = o + u.shift(), te = c + u.shift(), de = Y + u.shift(), be = te + u.shift(), me = de + u.shift(), ye = be + u.shift(), Math.abs(me - y) > Math.abs(ye - g) ? y = me + u.shift() : g = ye + u.shift(), l.curveTo(i, a, o, c, Y, te), l.curveTo(de, be, me, ye, y, g);
6192
+ i = y + u.shift(), a = g + u.shift(), o = i + u.shift(), c = a + u.shift(), Y = o + u.shift(), ne = c + u.shift(), de = Y + u.shift(), be = ne + u.shift(), me = de + u.shift(), ye = be + u.shift(), Math.abs(me - y) > Math.abs(ye - g) ? y = me + u.shift() : g = ye + u.shift(), l.curveTo(i, a, o, c, Y, ne), l.curveTo(de, be, me, ye, y, g);
6193
6193
  break;
6194
6194
  default:
6195
6195
  console.log("Glyph " + e.index + ": unknown operator 1200" + ve), u.length = 0;
@@ -6201,7 +6201,7 @@ function Dr(t, e, n, r, s) {
6201
6201
  break;
6202
6202
  }
6203
6203
  if (u.length >= 4) {
6204
- const et = Br[u.pop()], x = Br[u.pop()], d = u.pop(), m = u.pop();
6204
+ const et = Rr[u.pop()], x = Rr[u.pop()], d = u.pop(), m = u.pop();
6205
6205
  if (et && x) {
6206
6206
  e.isComposite = !0, e.components = [];
6207
6207
  const S = t.cffEncoding.charset.indexOf(et), F = t.cffEncoding.charset.indexOf(x);
@@ -6236,14 +6236,14 @@ function Dr(t, e, n, r, s) {
6236
6236
  console.error("CFF2 CharString operator blend (16) is not supported in CFF");
6237
6237
  break;
6238
6238
  }
6239
- R || (R = t.variation && s && t.variation.process.getBlendVector(E, T, s));
6240
- var X = u.pop(), xe = R ? R.length : E.itemVariationSubtables[T].regionIndexes.length, Ee = X * xe, Ae = u.length - Ee, Oe = Ae - X;
6241
- if (R)
6239
+ B || (B = t.variation && s && t.variation.process.getBlendVector(E, T, s));
6240
+ var X = u.pop(), xe = B ? B.length : E.itemVariationSubtables[T].regionIndexes.length, Ee = X * xe, Ae = u.length - Ee, Oe = Ae - X;
6241
+ if (B)
6242
6242
  for (let et = 0; et < X; et++) {
6243
- var Re = u[Oe + et];
6243
+ var Be = u[Oe + et];
6244
6244
  for (let x = 0; x < xe; x++)
6245
- Re += R[x] * u[Ae++];
6246
- u[Oe + et] = Re;
6245
+ Be += B[x] * u[Ae++];
6246
+ u[Oe + et] = Be;
6247
6247
  }
6248
6248
  for (; Ee--; )
6249
6249
  u.pop();
@@ -6287,7 +6287,7 @@ function Dr(t, e, n, r, s) {
6287
6287
  break;
6288
6288
  case 29:
6289
6289
  if (_e = u.pop() + t.gsubrsBias, fe = t.gsubrs[_e], fe) {
6290
- if (U >= Rs) {
6290
+ if (U >= Bs) {
6291
6291
  console.warn("CFF charstring subroutine call depth exceeded, skipping callgsubr");
6292
6292
  break;
6293
6293
  }
@@ -6316,7 +6316,7 @@ function Dr(t, e, n, r, s) {
6316
6316
  return D;
6317
6317
  })), h && (e.advanceWidth = N), l;
6318
6318
  }
6319
- function Bs(t, e, n, r, s) {
6319
+ function Rs(t, e, n, r, s) {
6320
6320
  const i = [];
6321
6321
  let a;
6322
6322
  const o = new M.Parser(t, e), c = o.parseCard8();
@@ -6368,14 +6368,14 @@ function gl(t, e, n, r) {
6368
6368
  if (!h)
6369
6369
  throw new Error("This is a CFF2 font, but FDArray information is missing");
6370
6370
  const y = $e(t, e + h, null, i.formatMajor), g = hl(t, e, y.objects);
6371
- u._fdArray = g, p && (u._fdSelect = Bs(t, e + p, n.numGlyphs, g.length, i.formatMajor));
6371
+ u._fdArray = g, p && (u._fdSelect = Rs(t, e + p, n.numGlyphs, g.length, i.formatMajor));
6372
6372
  } else if (n.isCIDFont) {
6373
6373
  let h = u.fdArray, p = u.fdSelect;
6374
6374
  if (h === 0 || p === 0)
6375
6375
  throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
6376
6376
  h += e;
6377
6377
  const y = $e(t, h), g = Qn(t, e, y.objects, c.objects, i.formatMajor);
6378
- u._fdArray = g, p += e, u._fdSelect = Bs(t, p, n.numGlyphs, g.length, i.formatMajor);
6378
+ u._fdArray = g, p += e, u._fdSelect = Rs(t, p, n.numGlyphs, g.length, i.formatMajor);
6379
6379
  }
6380
6380
  if (i.formatMajor < 2) {
6381
6381
  const h = e + u.private[1], p = Jr(t, h, u.private[0], c.objects, i.formatMajor);
@@ -6388,7 +6388,7 @@ function gl(t, e, n, r) {
6388
6388
  let f;
6389
6389
  if (r.lowMemory ? (f = el(t, e + u.charStrings, i.formatMajor), n.nGlyphs = f.offsets.length - (i.formatMajor > 1 ? 1 : 0)) : (f = $e(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) {
6390
6390
  let h = [], p = [];
6391
- u.charset === 0 ? h = Pc : u.charset === 1 ? h = Nc : u.charset === 2 ? h = Gc : h = fl(t, e + u.charset, n.nGlyphs, c.objects, n.isCIDFont), u.encoding === 0 ? p = Br : u.encoding === 1 ? p = Hc : p = pl(t, e + u.encoding), n.cffEncoding = new La(p, h), n.encoding = n.encoding || n.cffEncoding;
6391
+ u.charset === 0 ? h = Pc : u.charset === 1 ? h = Nc : u.charset === 2 ? h = Gc : h = fl(t, e + u.charset, n.nGlyphs, c.objects, n.isCIDFont), u.encoding === 0 ? p = Rr : u.encoding === 1 ? p = Hc : p = pl(t, e + u.encoding), n.cffEncoding = new La(p, h), n.encoding = n.encoding || n.cffEncoding;
6392
6392
  }
6393
6393
  if (n.glyphs = new Je.GlyphSet(n), r.lowMemory)
6394
6394
  n._push = function(h) {
@@ -6627,7 +6627,7 @@ function Ll(t, e, n, r, s) {
6627
6627
  function Il(t, e, n, r, s, i, a) {
6628
6628
  a.lowMemory ? Ll(t, e, n, r, s) : Ol(e, n, r, s, i);
6629
6629
  }
6630
- function Rl(t) {
6630
+ function Bl(t) {
6631
6631
  const e = new O.Table("hmtx", []);
6632
6632
  for (let n = 0; n < t.length; n += 1) {
6633
6633
  const r = t.get(n), s = r.advanceWidth || 0, i = r.leftSideBearing || 0;
@@ -6635,8 +6635,8 @@ function Rl(t) {
6635
6635
  }
6636
6636
  return e;
6637
6637
  }
6638
- var za = { parse: Il, make: Rl };
6639
- function Bl(t) {
6638
+ var za = { parse: Il, make: Bl };
6639
+ function Rl(t) {
6640
6640
  const e = new O.Table("ltag", [
6641
6641
  { name: "version", type: "ULONG", value: 1 },
6642
6642
  { name: "flags", type: "ULONG", value: 0 },
@@ -6663,7 +6663,7 @@ function Dl(t, e) {
6663
6663
  }
6664
6664
  return i;
6665
6665
  }
6666
- var Wa = { make: Bl, parse: Dl };
6666
+ var Wa = { make: Rl, parse: Dl };
6667
6667
  function Ml(t, e) {
6668
6668
  const n = {}, r = new M.Parser(t, e);
6669
6669
  return n.version = r.parseVersion(), n.numGlyphs = r.parseUShort(), n.version === 1 && (n.maxPoints = r.parseUShort(), n.maxContours = r.parseUShort(), n.maxCompositePoints = r.parseUShort(), n.maxCompositeContours = r.parseUShort(), n.maxZones = r.parseUShort(), n.maxTwilightPoints = r.parseUShort(), n.maxStorage = r.parseUShort(), n.maxFunctionDefs = r.parseUShort(), n.maxInstructionDefs = r.parseUShort(), n.maxStackElements = r.parseUShort(), n.maxSizeOfInstructions = r.parseUShort(), n.maxComponentElements = r.parseUShort(), n.maxComponentDepth = r.parseUShort()), n;
@@ -7082,7 +7082,7 @@ We[4] = function() {
7082
7082
  })
7083
7083
  };
7084
7084
  };
7085
- var Bt = {
7085
+ var Rt = {
7086
7086
  sequenceIndex: k.uShort,
7087
7087
  lookupListIndex: k.uShort
7088
7088
  };
@@ -7096,7 +7096,7 @@ We[5] = function() {
7096
7096
  const r = this.parseUShort(), s = this.parseUShort();
7097
7097
  return {
7098
7098
  input: this.parseUShortList(r - 1),
7099
- lookupRecords: this.parseRecordList(s, Bt)
7099
+ lookupRecords: this.parseRecordList(s, Rt)
7100
7100
  };
7101
7101
  })
7102
7102
  };
@@ -7109,7 +7109,7 @@ We[5] = function() {
7109
7109
  const r = this.parseUShort(), s = this.parseUShort();
7110
7110
  return {
7111
7111
  classes: this.parseUShortList(r - 1),
7112
- lookupRecords: this.parseRecordList(s, Bt)
7112
+ lookupRecords: this.parseRecordList(s, Rt)
7113
7113
  };
7114
7114
  })
7115
7115
  };
@@ -7118,7 +7118,7 @@ We[5] = function() {
7118
7118
  return {
7119
7119
  substFormat: n,
7120
7120
  coverages: this.parseList(r, k.pointer(k.coverage)),
7121
- lookupRecords: this.parseRecordList(s, Bt)
7121
+ lookupRecords: this.parseRecordList(s, Rt)
7122
7122
  };
7123
7123
  }
7124
7124
  H.assert(!1, "0x" + e.toString(16) + ": lookup type 5 format must be 1, 2 or 3.");
@@ -7134,7 +7134,7 @@ We[6] = function() {
7134
7134
  backtrack: this.parseUShortList(),
7135
7135
  input: this.parseUShortList(this.parseShort() - 1),
7136
7136
  lookahead: this.parseUShortList(),
7137
- lookupRecords: this.parseRecordList(Bt)
7137
+ lookupRecords: this.parseRecordList(Rt)
7138
7138
  };
7139
7139
  })
7140
7140
  };
@@ -7150,7 +7150,7 @@ We[6] = function() {
7150
7150
  backtrack: this.parseUShortList(),
7151
7151
  input: this.parseUShortList(this.parseShort() - 1),
7152
7152
  lookahead: this.parseUShortList(),
7153
- lookupRecords: this.parseRecordList(Bt)
7153
+ lookupRecords: this.parseRecordList(Rt)
7154
7154
  };
7155
7155
  })
7156
7156
  };
@@ -7160,7 +7160,7 @@ We[6] = function() {
7160
7160
  backtrackCoverage: this.parseList(k.pointer(k.coverage)),
7161
7161
  inputCoverage: this.parseList(k.pointer(k.coverage)),
7162
7162
  lookaheadCoverage: this.parseList(k.pointer(k.coverage)),
7163
- lookupRecords: this.parseRecordList(Bt)
7163
+ lookupRecords: this.parseRecordList(Rt)
7164
7164
  };
7165
7165
  H.assert(!1, "0x" + e.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
7166
7166
  };
@@ -7431,7 +7431,7 @@ function Xl(t, e, n) {
7431
7431
  const r = {}, s = new M.Parser(t, e);
7432
7432
  r.tag = s.parseTag(), r.minValue = s.parseFixed(), r.defaultValue = s.parseFixed(), r.maxValue = s.parseFixed(), s.skip("uShort", 1);
7433
7433
  const i = s.parseUShort();
7434
- return r.axisNameID = i, r.name = Bn(n, i), r;
7434
+ return r.axisNameID = i, r.name = Rn(n, i), r;
7435
7435
  }
7436
7436
  function Kl(t, e, n, r = {}) {
7437
7437
  const s = [
@@ -7454,13 +7454,13 @@ function Kl(t, e, n, r = {}) {
7454
7454
  }
7455
7455
  function Zl(t, e, n, r, s) {
7456
7456
  const i = {}, a = new M.Parser(t, e), o = a.parseUShort();
7457
- i.subfamilyNameID = o, i.name = Bn(r, o, [2, 17]), a.skip("uShort", 1), i.coordinates = {};
7457
+ i.subfamilyNameID = o, i.name = Rn(r, o, [2, 17]), a.skip("uShort", 1), i.coordinates = {};
7458
7458
  for (let l = 0; l < n.length; ++l)
7459
7459
  i.coordinates[n[l].tag] = a.parseFixed();
7460
7460
  if (a.relativeOffset === s)
7461
7461
  return i.postScriptNameID = void 0, i.postScriptName = void 0, i;
7462
7462
  const c = a.parseUShort();
7463
- return i.postScriptNameID = c == 65535 ? void 0 : c, i.postScriptName = i.postScriptNameID !== void 0 ? Bn(r, c, [6]) : "", i;
7463
+ return i.postScriptNameID = c == 65535 ? void 0 : c, i.postScriptName = i.postScriptNameID !== void 0 ? Rn(r, c, [6]) : "", i;
7464
7464
  }
7465
7465
  function Jl(t, e) {
7466
7466
  const n = new O.Table("fvar", [
@@ -7957,9 +7957,9 @@ function xu(t) {
7957
7957
  // Use space as the default character, if available.
7958
7958
  usBreakChar: t.hasChar(" ") ? 32 : 0
7959
7959
  // Use space as the break character, if available.
7960
- }, t.tables.os2)), T = za.make(t.glyphs), E = Ea.make(t.glyphs), R = t.getEnglishName("fontFamily"), U = t.getEnglishName("fontSubfamily"), W = R + " " + U;
7960
+ }, t.tables.os2)), T = za.make(t.glyphs), E = Ea.make(t.glyphs), B = t.getEnglishName("fontFamily"), U = t.getEnglishName("fontSubfamily"), W = B + " " + U;
7961
7961
  let j = t.getEnglishName("postScriptName");
7962
- j || (j = R.replace(/\s/g, "") + "-" + U);
7962
+ j || (j = B.replace(/\s/g, "") + "-" + U);
7963
7963
  const N = {};
7964
7964
  for (let X in t.names)
7965
7965
  N[X] = t.names[X];
@@ -7976,7 +7976,7 @@ function xu(t) {
7976
7976
  const D = [], _ = Fa.make(N, D), re = D.length > 0 ? Wa.make(D) : void 0, Te = qa.make(t), Qe = Mr.make(t.glyphs, {
7977
7977
  version: t.getEnglishName("version"),
7978
7978
  fullName: W,
7979
- familyName: R,
7979
+ familyName: B,
7980
7980
  weightName: U,
7981
7981
  postScriptName: j,
7982
7982
  unitsPerEm: t.unitsPerEm,
@@ -7986,7 +7986,7 @@ function xu(t) {
7986
7986
  re && fe.push(re);
7987
7987
  const Y = {
7988
7988
  gsub: ja,
7989
- cpal: Ba,
7989
+ cpal: Ra,
7990
7990
  colr: Ya,
7991
7991
  stat: Ka,
7992
7992
  avar: Za,
@@ -7995,14 +7995,14 @@ function xu(t) {
7995
7995
  gvar: Qa,
7996
7996
  gasp: eo,
7997
7997
  svg: to
7998
- }, te = {
7998
+ }, ne = {
7999
7999
  avar: [t.tables.fvar],
8000
8000
  fvar: [t.names]
8001
8001
  };
8002
8002
  for (let X in Y) {
8003
8003
  const xe = t.tables[X];
8004
8004
  if (xe) {
8005
- const Ee = Y[X].make.call(t, xe, ...te[X] || []);
8005
+ const Ee = Y[X].make.call(t, xe, ...ne[X] || []);
8006
8006
  Ee && fe.push(Ee);
8007
8007
  }
8008
8008
  }
@@ -8944,7 +8944,7 @@ var Au = De, io = class {
8944
8944
  let r = this.cache.get(n);
8945
8945
  r === void 0 && (r = Iu(n), this.cache.set(n, r));
8946
8946
  let s = r.images.get(t);
8947
- return s === void 0 && (s = Ru(this.font, r.template, t), s.promise.then((i) => {
8947
+ return s === void 0 && (s = Bu(this.font, r.template, t), s.promise.then((i) => {
8948
8948
  if (s.image = i, typeof this.font.onGlyphUpdated == "function")
8949
8949
  try {
8950
8950
  this.font.onGlyphUpdated(t);
@@ -8956,11 +8956,11 @@ var Au = De, io = class {
8956
8956
  };
8957
8957
  function Iu(t) {
8958
8958
  return {
8959
- template: Bu(t).then(_u),
8959
+ template: Ru(t).then(_u),
8960
8960
  images: /* @__PURE__ */ new Map()
8961
8961
  };
8962
8962
  }
8963
- function Ru(t, e, n) {
8963
+ function Bu(t, e, n) {
8964
8964
  return {
8965
8965
  promise: e.then((r) => {
8966
8966
  let s;
@@ -8971,7 +8971,7 @@ function Ru(t, e, n) {
8971
8971
  image: void 0
8972
8972
  };
8973
8973
  }
8974
- var Bu = typeof DecompressionStream == "function" ? Mu : Du;
8974
+ var Ru = typeof DecompressionStream == "function" ? Mu : Du;
8975
8975
  function Du(t) {
8976
8976
  try {
8977
8977
  return Promise.resolve(new TextDecoder().decode(so(t) ? Fu(t) : t));
@@ -10017,8 +10017,8 @@ function eh(t) {
10017
10017
  t.fv = t.pv;
10018
10018
  }
10019
10019
  function th(t) {
10020
- const e = t.stack, n = e.pop(), r = e.pop(), s = e.pop(), i = e.pop(), a = e.pop(), o = t.z0, c = t.z1, l = o[n], u = o[r], f = c[s], h = c[i], p = t.z2[a], y = l.x, g = l.y, b = u.x, v = u.y, w = f.x, C = f.y, T = h.x, E = h.y, R = (y - b) * (C - E) - (g - v) * (w - T), U = y * v - g * b, W = w * E - C * T;
10021
- p.x = (U * (w - T) - W * (y - b)) / R, p.y = (U * (C - E) - W * (g - v)) / R;
10020
+ const e = t.stack, n = e.pop(), r = e.pop(), s = e.pop(), i = e.pop(), a = e.pop(), o = t.z0, c = t.z1, l = o[n], u = o[r], f = c[s], h = c[i], p = t.z2[a], y = l.x, g = l.y, b = u.x, v = u.y, w = f.x, C = f.y, T = h.x, E = h.y, B = (y - b) * (C - E) - (g - v) * (w - T), U = y * v - g * b, W = w * E - C * T;
10021
+ p.x = (U * (w - T) - W * (y - b)) / B, p.y = (U * (C - E) - W * (g - v)) / B;
10022
10022
  }
10023
10023
  function nh(t) {
10024
10024
  t.rp0 = t.stack.pop();
@@ -10269,11 +10269,11 @@ function Ih(t) {
10269
10269
  const r = e.pop(), s = e.pop();
10270
10270
  n[s] = r;
10271
10271
  }
10272
- function Rh(t) {
10272
+ function Bh(t) {
10273
10273
  const e = t.stack, n = t.store, r = e.pop(), s = n && n[r] || 0;
10274
10274
  e.push(s);
10275
10275
  }
10276
- function Bh(t) {
10276
+ function Rh(t) {
10277
10277
  const e = t.stack, n = e.pop(), r = e.pop();
10278
10278
  t.cvt[r] = n / 64;
10279
10279
  }
@@ -10697,9 +10697,9 @@ lo = [
10697
10697
  /* 0x42 */
10698
10698
  Ih,
10699
10699
  /* 0x43 */
10700
- Rh,
10701
- /* 0x44 */
10702
10700
  Bh,
10701
+ /* 0x44 */
10702
+ Rh,
10703
10703
  /* 0x45 */
10704
10704
  Dh,
10705
10705
  /* 0x46 */
@@ -11431,11 +11431,11 @@ function Ef(t, e) {
11431
11431
  for (let v = 0; v < b.subtables.length; v++) {
11432
11432
  let w = b.subtables[v], C, T = this.getSubstitutionType(b, w);
11433
11433
  if (T === "71" ? (T = this.getSubstitutionType(w, w.extension), C = this.getLookupMethod(w, w.extension), w = w.extension) : C = this.getLookupMethod(b, w), T === "12") {
11434
- const E = t.get(y.sequenceIndex), R = C(E);
11435
- R && h.push(R);
11434
+ const E = t.get(y.sequenceIndex), B = C(E);
11435
+ B && h.push(B);
11436
11436
  } else if (T === "21") {
11437
- const E = t.get(y.sequenceIndex), R = C(E);
11438
- R && h.push(R);
11437
+ const E = t.get(y.sequenceIndex), B = C(E);
11438
+ B && h.push(B);
11439
11439
  } else
11440
11440
  throw new Error(`Substitution type ${T} is not supported in chaining substitution`);
11441
11441
  }
@@ -11696,8 +11696,8 @@ Me.prototype.getFeature = function(e) {
11696
11696
  const n = this.features[e.script];
11697
11697
  return n ? n.tags[e.tag] ? this.features[e.script].tags[e.tag] : null : { FAIL: `No feature for script ${e.script}` };
11698
11698
  };
11699
- var Rf = Me;
11700
- function Bf(t) {
11699
+ var Bf = Me;
11700
+ function Rf(t) {
11701
11701
  const e = t.current, n = t.get(-1);
11702
11702
  return (
11703
11703
  // ? arabic first char
@@ -11714,7 +11714,7 @@ function Df(t) {
11714
11714
  );
11715
11715
  }
11716
11716
  var Mf = {
11717
- startCheck: Bf,
11717
+ startCheck: Rf,
11718
11718
  endCheck: Df
11719
11719
  };
11720
11720
  function _f(t) {
@@ -12129,7 +12129,7 @@ He.prototype.applyFeatures = function(t, e) {
12129
12129
  if (!t) throw new Error(
12130
12130
  "No valid font was provided to apply features"
12131
12131
  );
12132
- this.query || (this.query = new Rf(t));
12132
+ this.query || (this.query = new Bf(t));
12133
12133
  for (let n = 0; n < e.length; n++) {
12134
12134
  const r = e[n];
12135
12135
  this.query.supports({ script: r.script }) && this.registerFeatures(r.script, r.tags);
@@ -12240,7 +12240,7 @@ function or(t) {
12240
12240
  trademark: { en: t.trademark || " " }
12241
12241
  };
12242
12242
  }
12243
- function ee(t) {
12243
+ function te(t) {
12244
12244
  if (t = t || {}, t.tables = t.tables || {}, !t.empty) {
12245
12245
  if (!t.familyName) throw new Error("When creating a new Font object, familyName is required.");
12246
12246
  if (!t.styleName) throw new Error("When creating a new Font object, styleName is required.");
@@ -12275,30 +12275,30 @@ function ee(t) {
12275
12275
  }
12276
12276
  });
12277
12277
  }
12278
- ee.prototype.hasChar = function(t) {
12278
+ te.prototype.hasChar = function(t) {
12279
12279
  return this.encoding.charToGlyphIndex(t) > 0;
12280
12280
  };
12281
- ee.prototype.charToGlyphIndex = function(t) {
12281
+ te.prototype.charToGlyphIndex = function(t) {
12282
12282
  return this.encoding.charToGlyphIndex(t);
12283
12283
  };
12284
- ee.prototype.charToGlyph = function(t) {
12284
+ te.prototype.charToGlyph = function(t) {
12285
12285
  const e = this.charToGlyphIndex(t);
12286
12286
  let n = this.glyphs.get(e);
12287
12287
  return n || (n = this.glyphs.get(0)), n;
12288
12288
  };
12289
- ee.prototype.updateFeatures = function(t) {
12289
+ te.prototype.updateFeatures = function(t) {
12290
12290
  return this.defaultRenderOptions.features.map((e) => e.script === "latn" ? {
12291
12291
  script: "latn",
12292
12292
  tags: e.tags.filter((n) => t[n])
12293
12293
  } : e);
12294
12294
  };
12295
- ee.prototype.stringToGlyphIndexes = function(t, e) {
12295
+ te.prototype.stringToGlyphIndexes = function(t, e) {
12296
12296
  const n = new Ep(), r = (i) => this.charToGlyphIndex(i.char);
12297
12297
  n.registerModifier("glyphIndex", null, r);
12298
12298
  let s = e ? this.updateFeatures(e.features) : this.defaultRenderOptions.features;
12299
12299
  return n.applyFeatures(this, s), n.getTextGlyphs(t);
12300
12300
  };
12301
- ee.prototype.stringToGlyphs = function(t, e) {
12301
+ te.prototype.stringToGlyphs = function(t, e) {
12302
12302
  const n = this.stringToGlyphIndexes(t, e);
12303
12303
  let r = n.length;
12304
12304
  const s = new Array(r), i = this.glyphs.get(0);
@@ -12306,23 +12306,23 @@ ee.prototype.stringToGlyphs = function(t, e) {
12306
12306
  s[a] = this.glyphs.get(n[a]) || i;
12307
12307
  return s;
12308
12308
  };
12309
- ee.prototype.nameToGlyphIndex = function(t) {
12309
+ te.prototype.nameToGlyphIndex = function(t) {
12310
12310
  return this.glyphNames.nameToGlyphIndex(t);
12311
12311
  };
12312
- ee.prototype.nameToGlyph = function(t) {
12312
+ te.prototype.nameToGlyph = function(t) {
12313
12313
  const e = this.nameToGlyphIndex(t);
12314
12314
  let n = this.glyphs.get(e);
12315
12315
  return n || (n = this.glyphs.get(0)), n;
12316
12316
  };
12317
- ee.prototype.glyphIndexToName = function(t) {
12317
+ te.prototype.glyphIndexToName = function(t) {
12318
12318
  return this.glyphNames.glyphIndexToName ? this.glyphNames.glyphIndexToName(t) : "";
12319
12319
  };
12320
- ee.prototype.getKerningValue = function(t, e) {
12320
+ te.prototype.getKerningValue = function(t, e) {
12321
12321
  t = t.index || t, e = e.index || e;
12322
12322
  const n = this.position.defaultKerningTables;
12323
12323
  return n ? this.position.getKerningValue(n, t, e) : this.kerningPairs[t + "," + e] || 0;
12324
12324
  };
12325
- ee.prototype.defaultRenderOptions = {
12325
+ te.prototype.defaultRenderOptions = {
12326
12326
  kerning: !0,
12327
12327
  features: [
12328
12328
  /**
@@ -12338,7 +12338,7 @@ ee.prototype.defaultRenderOptions = {
12338
12338
  drawLayers: !0,
12339
12339
  drawSVG: !0
12340
12340
  };
12341
- ee.prototype.forEachGlyph = function(t, e, n, r, s, i) {
12341
+ te.prototype.forEachGlyph = function(t, e, n, r, s, i) {
12342
12342
  e = e !== void 0 ? e : 0, n = n !== void 0 ? n : 0, r = r !== void 0 ? r : 72, s = Object.assign({}, this.defaultRenderOptions, s);
12343
12343
  const a = 1 / this.unitsPerEm * r, o = this.stringToGlyphs(t, s);
12344
12344
  let c;
@@ -12356,7 +12356,7 @@ ee.prototype.forEachGlyph = function(t, e, n, r, s, i) {
12356
12356
  }
12357
12357
  return e;
12358
12358
  };
12359
- ee.prototype.getPath = function(t, e, n, r, s) {
12359
+ te.prototype.getPath = function(t, e, n, r, s) {
12360
12360
  s = Object.assign({}, this.defaultRenderOptions, s);
12361
12361
  const i = new Ut();
12362
12362
  if (i._layers = [], Ua(this, i), i.stroke) {
@@ -12378,7 +12378,7 @@ ee.prototype.getPath = function(t, e, n, r, s) {
12378
12378
  i.extend(u);
12379
12379
  }), i;
12380
12380
  };
12381
- ee.prototype.getPaths = function(t, e, n, r, s) {
12381
+ te.prototype.getPaths = function(t, e, n, r, s) {
12382
12382
  s = Object.assign({}, this.defaultRenderOptions, s);
12383
12383
  const i = [];
12384
12384
  return this.forEachGlyph(t, e, n, r, s, function(a, o, c, l) {
@@ -12386,29 +12386,29 @@ ee.prototype.getPaths = function(t, e, n, r, s) {
12386
12386
  i.push(u);
12387
12387
  }), i;
12388
12388
  };
12389
- ee.prototype.getAdvanceWidth = function(t, e, n) {
12389
+ te.prototype.getAdvanceWidth = function(t, e, n) {
12390
12390
  return n = Object.assign({}, this.defaultRenderOptions, n), this.forEachGlyph(t, 0, 0, e, n, function() {
12391
12391
  });
12392
12392
  };
12393
- ee.prototype.draw = function(t, e, n, r, s, i) {
12393
+ te.prototype.draw = function(t, e, n, r, s, i) {
12394
12394
  this.getPath(e, n, r, s, i).draw(t);
12395
12395
  };
12396
- ee.prototype.drawPoints = function(t, e, n, r, s, i) {
12396
+ te.prototype.drawPoints = function(t, e, n, r, s, i) {
12397
12397
  i = Object.assign({}, this.defaultRenderOptions, i), this.forEachGlyph(e, n, r, s, i, function(a, o, c, l) {
12398
12398
  a.drawPoints(t, o, c, l, i, this);
12399
12399
  });
12400
12400
  };
12401
- ee.prototype.drawMetrics = function(t, e, n, r, s, i) {
12401
+ te.prototype.drawMetrics = function(t, e, n, r, s, i) {
12402
12402
  i = Object.assign({}, this.defaultRenderOptions, i), this.forEachGlyph(e, n, r, s, i, function(a, o, c, l) {
12403
12403
  a.drawMetrics(t, o, c, l);
12404
12404
  });
12405
12405
  };
12406
- ee.prototype.getEnglishName = function(t) {
12406
+ te.prototype.getEnglishName = function(t) {
12407
12407
  const e = (this.names.unicode || this.names.macintosh || this.names.windows)[t];
12408
12408
  if (e)
12409
12409
  return e.en;
12410
12410
  };
12411
- ee.prototype.validate = function() {
12411
+ te.prototype.validate = function() {
12412
12412
  const t = [], e = this;
12413
12413
  function n(s, i) {
12414
12414
  s || (console.warn(`[opentype.js] ${i}`), t.push(i));
@@ -12432,22 +12432,22 @@ ee.prototype.validate = function() {
12432
12432
  }
12433
12433
  return t;
12434
12434
  };
12435
- ee.prototype.toTables = function() {
12435
+ te.prototype.toTables = function() {
12436
12436
  return vu.fontToTable(this);
12437
12437
  };
12438
- ee.prototype.toBuffer = function() {
12438
+ te.prototype.toBuffer = function() {
12439
12439
  return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."), this.toArrayBuffer();
12440
12440
  };
12441
- ee.prototype.toArrayBuffer = function() {
12441
+ te.prototype.toArrayBuffer = function() {
12442
12442
  const e = this.toTables().encode(), n = new ArrayBuffer(e.length), r = new Uint8Array(n);
12443
12443
  for (let s = 0; s < e.length; s++)
12444
12444
  r[s] = e[s];
12445
12445
  return n;
12446
12446
  };
12447
- ee.prototype.download = function() {
12447
+ te.prototype.download = function() {
12448
12448
  console.error("DEPRECATED: platform-specific actions are to be implemented on user-side");
12449
12449
  };
12450
- ee.prototype.fsSelectionValues = {
12450
+ te.prototype.fsSelectionValues = {
12451
12451
  ITALIC: 1,
12452
12452
  //1
12453
12453
  UNDERSCORE: 2,
@@ -12469,7 +12469,7 @@ ee.prototype.fsSelectionValues = {
12469
12469
  OBLIQUE: 512
12470
12470
  //512
12471
12471
  };
12472
- ee.prototype.macStyleValues = {
12472
+ te.prototype.macStyleValues = {
12473
12473
  BOLD: 1,
12474
12474
  //1
12475
12475
  ITALIC: 2,
@@ -12485,7 +12485,7 @@ ee.prototype.macStyleValues = {
12485
12485
  EXTENDED: 64
12486
12486
  //64
12487
12487
  };
12488
- ee.prototype.usWidthClasses = {
12488
+ te.prototype.usWidthClasses = {
12489
12489
  ULTRA_CONDENSED: 1,
12490
12490
  EXTRA_CONDENSED: 2,
12491
12491
  CONDENSED: 3,
@@ -12496,7 +12496,7 @@ ee.prototype.usWidthClasses = {
12496
12496
  EXTRA_EXPANDED: 8,
12497
12497
  ULTRA_EXPANDED: 9
12498
12498
  };
12499
- ee.prototype.usWeightClasses = {
12499
+ te.prototype.usWeightClasses = {
12500
12500
  THIN: 100,
12501
12501
  EXTRA_LIGHT: 200,
12502
12502
  LIGHT: 300,
@@ -12507,7 +12507,7 @@ ee.prototype.usWeightClasses = {
12507
12507
  EXTRA_BOLD: 800,
12508
12508
  BLACK: 900
12509
12509
  };
12510
- var Ap = ee;
12510
+ var Ap = te;
12511
12511
  function Op(t, e) {
12512
12512
  const n = new M.Parser(t, e), r = n.parseUShort(), s = n.parseUShort();
12513
12513
  r !== 1 && console.warn(`Unsupported hvar table version ${r}.${s}`);
@@ -12534,12 +12534,12 @@ function Op(t, e) {
12534
12534
  function Lp() {
12535
12535
  console.warn("Writing of hvar tables is not yet supported.");
12536
12536
  }
12537
- var Ip = { make: Lp, parse: Op }, Rp = function() {
12537
+ var Ip = { make: Lp, parse: Op }, Bp = function() {
12538
12538
  return {
12539
12539
  coverage: this.parsePointer(k.coverage),
12540
12540
  attachPoints: this.parseList(k.pointer(k.uShortList))
12541
12541
  };
12542
- }, Bp = function() {
12542
+ }, Rp = function() {
12543
12543
  var t = this.parseUShort();
12544
12544
  if (H.argument(
12545
12545
  t === 1 || t === 2 || t === 3,
@@ -12551,7 +12551,7 @@ var Ip = { make: Lp, parse: Op }, Rp = function() {
12551
12551
  if (t === 3)
12552
12552
  return { coordinate: this.parseShort() };
12553
12553
  }, Dp = function() {
12554
- return this.parseList(k.pointer(Bp));
12554
+ return this.parseList(k.pointer(Rp));
12555
12555
  }, Mp = function() {
12556
12556
  return {
12557
12557
  coverage: this.parsePointer(k.coverage),
@@ -12570,7 +12570,7 @@ function Up(t, e) {
12570
12570
  var s = {
12571
12571
  version: r,
12572
12572
  classDef: n.parsePointer(k.classDef),
12573
- attachList: n.parsePointer(Rp),
12573
+ attachList: n.parsePointer(Bp),
12574
12574
  ligCaretList: n.parsePointer(Mp),
12575
12575
  markAttachClassDef: n.parsePointer(k.classDef)
12576
12576
  };
@@ -12784,7 +12784,7 @@ function Kp(t, e = {}) {
12784
12784
  throw new Error("WOFF2 require an external decompressor library, see examples at: " + P);
12785
12785
  } else
12786
12786
  throw new Error("Unsupported OpenType signature " + c);
12787
- let l, u, f, h, p, y, g, b, v, w, C, T, E, R, U, W, j, N;
12787
+ let l, u, f, h, p, y, g, b, v, w, C, T, E, B, U, W, j, N;
12788
12788
  for (let P = 0; P < a; P += 1) {
12789
12789
  const D = o[P];
12790
12790
  let _;
@@ -12832,7 +12832,7 @@ function Kp(t, e = {}) {
12832
12832
  _ = K(i, D), s.tables.colr = Ya.parse(_.data, _.offset);
12833
12833
  break;
12834
12834
  case "CPAL":
12835
- _ = K(i, D), s.tables.cpal = Ba.parse(_.data, _.offset);
12835
+ _ = K(i, D), s.tables.cpal = Ra.parse(_.data, _.offset);
12836
12836
  break;
12837
12837
  case "maxp":
12838
12838
  _ = K(i, D), s.tables.maxp = Va.parse(_.data, _.offset), s.numGlyphs = s.tables.maxp.numGlyphs;
@@ -12862,7 +12862,7 @@ function Kp(t, e = {}) {
12862
12862
  u = D;
12863
12863
  break;
12864
12864
  case "kern":
12865
- R = D;
12865
+ B = D;
12866
12866
  break;
12867
12867
  case "GDEF":
12868
12868
  v = D;
@@ -12901,8 +12901,8 @@ function Kp(t, e = {}) {
12901
12901
  } else
12902
12902
  throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");
12903
12903
  const ie = K(i, T);
12904
- if (za.parse(s, ie.data, ie.offset, s.numberOfHMetrics, s.numGlyphs, s.glyphs, e), Vc(s, e), R) {
12905
- const P = K(i, R);
12904
+ if (za.parse(s, ie.data, ie.offset, s.numberOfHMetrics, s.numGlyphs, s.glyphs, e), Vc(s, e), B) {
12905
+ const P = K(i, B);
12906
12906
  s.kerningPairs = jp.parse(P.data, P.offset);
12907
12907
  } else
12908
12908
  s.kerningPairs = {};
@@ -13061,8 +13061,8 @@ function Jp(t, e = 1e-4) {
13061
13061
  E.itemSize,
13062
13062
  E.normalized
13063
13063
  );
13064
- const R = t.morphAttributes[T];
13065
- R && (l[T] || (l[T] = []), R.forEach((U, W) => {
13064
+ const B = t.morphAttributes[T];
13065
+ B && (l[T] || (l[T] = []), B.forEach((U, W) => {
13066
13066
  const j = new U.array.constructor(U.count * U.itemSize);
13067
13067
  l[T][W] = new U.constructor(j, U.itemSize, U.normalized);
13068
13068
  }));
@@ -13071,7 +13071,7 @@ function Jp(t, e = 1e-4) {
13071
13071
  for (let w = 0; w < i; w++) {
13072
13072
  const C = r ? r.getX(w) : w;
13073
13073
  let T = "";
13074
- for (let E = 0, R = o.length; E < R; E++) {
13074
+ for (let E = 0, B = o.length; E < B; E++) {
13075
13075
  const U = o[E], W = t.getAttribute(U), j = W.itemSize;
13076
13076
  for (let N = 0; N < j; N++)
13077
13077
  T += `${~~(W[f[N]](C) * g + b)},`;
@@ -13079,7 +13079,7 @@ function Jp(t, e = 1e-4) {
13079
13079
  if (T in n)
13080
13080
  u.push(n[T]);
13081
13081
  else {
13082
- for (let E = 0, R = o.length; E < R; E++) {
13082
+ for (let E = 0, B = o.length; E < B; E++) {
13083
13083
  const U = o[E], W = t.getAttribute(U), j = t.morphAttributes[U], N = W.itemSize, $ = c[U], ie = l[U];
13084
13084
  for (let P = 0; P < N; P++) {
13085
13085
  const D = f[P], _ = h[P];
@@ -14365,13 +14365,13 @@ class Dt {
14365
14365
  } = i, y = vo(i), g = this.bbox;
14366
14366
  let b = y;
14367
14367
  u && vd(g) && !Sd(y, g) && (b = wd(y, g));
14368
- const v = b.maxX - b.minX, w = b.maxY - b.minY, C = v * l, T = w * l, E = b.minX - C, R = b.maxX + C, U = b.minY - T, W = b.maxY + T;
14368
+ const v = b.maxX - b.minX, w = b.maxY - b.minY, C = v * l, T = w * l, E = b.minX - C, B = b.maxX + C, U = b.minY - T, W = b.maxY + T;
14369
14369
  o = c((N) => ({
14370
14370
  x: N.x,
14371
14371
  y: -N.y
14372
14372
  }));
14373
14373
  const j = f ? kd(i, h, p) : "";
14374
- return a = `${E} ${-W} ${R - E} ${W - U}`, `<svg width="100%" height="100%" viewBox="${a}" preserveAspectRatio="xMidYMid meet">${j}${o}</svg>`;
14374
+ return a = `${E} ${-W} ${B - E} ${W - U}`, `<svg width="100%" height="100%" viewBox="${a}" preserveAspectRatio="xMidYMid meet">${j}${o}</svg>`;
14375
14375
  } else if (s) {
14376
14376
  const l = this.bbox, u = 0.2, f = l.maxX - l.minX, h = l.maxY - l.minY, p = f === 0 ? h : f, y = h === 0 ? f : h, g = l.minX - p * u, b = l.maxX + p * u, v = l.minY - y * u, w = l.maxY + y * u;
14377
14377
  o = c((C) => ({
@@ -14521,7 +14521,7 @@ function Id(t, e, n, r = Vn, s = !1, i = 0) {
14521
14521
  l
14522
14522
  );
14523
14523
  }
14524
- function Rd(t, e, n, r = Vn, s = !1, i = 0) {
14524
+ function Bd(t, e, n, r = Vn, s = !1, i = 0) {
14525
14525
  const a = qn(e.content, n);
14526
14526
  return Id(
14527
14527
  t,
@@ -14616,7 +14616,7 @@ class en {
14616
14616
  ), n;
14617
14617
  }
14618
14618
  }
14619
- const Bd = Math.PI / 18, Dd = 1e-6;
14619
+ const Rd = Math.PI / 18, Dd = 1e-6;
14620
14620
  class Md {
14621
14621
  constructor(e) {
14622
14622
  this.shapeCache = /* @__PURE__ */ new Map(), this.subshapeCache = /* @__PURE__ */ new Map(), this.shapeData = /* @__PURE__ */ new Map(), this.fontData = e;
@@ -14996,7 +14996,7 @@ class Md {
14996
14996
  let h = u & 7;
14997
14997
  h === 0 && (h = 8), a !== 0 && h--;
14998
14998
  const p = Math.PI / 4;
14999
- let y = p * h, g = Bd, b = 1;
14999
+ let y = p * h, g = Rd, b = 1;
15000
15000
  u < 0 && (g = -g, y = -y, b = -1);
15001
15001
  let v = p * f, w = v + y;
15002
15002
  v += p * i / 256 * b, w += p * a / 256 * b;
@@ -15243,7 +15243,7 @@ class _d {
15243
15243
  getLayoutCharShape(e, n, r = Vn) {
15244
15244
  const s = this.getCharShape(e, n);
15245
15245
  if (s)
15246
- return Rd(
15246
+ return Bd(
15247
15247
  s,
15248
15248
  this.fontData,
15249
15249
  n,
@@ -15348,8 +15348,8 @@ jn.byteLength = zd;
15348
15348
  jn.toByteArray = Vd;
15349
15349
  jn.fromByteArray = $d;
15350
15350
  var Xe = [], Ue = [], Gd = typeof Uint8Array < "u" ? Uint8Array : Array, cr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
15351
- for (var Rt = 0, Hd = cr.length; Rt < Hd; ++Rt)
15352
- Xe[Rt] = cr[Rt], Ue[cr.charCodeAt(Rt)] = Rt;
15351
+ for (var Bt = 0, Hd = cr.length; Bt < Hd; ++Bt)
15352
+ Xe[Bt] = cr[Bt], Ue[cr.charCodeAt(Bt)] = Bt;
15353
15353
  Ue[45] = 62;
15354
15354
  Ue[95] = 63;
15355
15355
  function Co(t) {
@@ -15478,7 +15478,7 @@ ss.write = function(t, e, n, r, s, i) {
15478
15478
  throw new TypeError(
15479
15479
  "The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof x
15480
15480
  );
15481
- if (Re(x, ArrayBuffer) || x && Re(x.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (Re(x, SharedArrayBuffer) || x && Re(x.buffer, SharedArrayBuffer)))
15481
+ if (Be(x, ArrayBuffer) || x && Be(x.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (Be(x, SharedArrayBuffer) || x && Be(x.buffer, SharedArrayBuffer)))
15482
15482
  return g(x, d, m);
15483
15483
  if (typeof x == "number")
15484
15484
  throw new TypeError(
@@ -15534,7 +15534,7 @@ ss.write = function(t, e, n, r, s, i) {
15534
15534
  return m;
15535
15535
  }
15536
15536
  function y(x) {
15537
- if (Re(x, Uint8Array)) {
15537
+ if (Be(x, Uint8Array)) {
15538
15538
  var d = new Uint8Array(x);
15539
15539
  return g(d.buffer, d.byteOffset, d.byteLength);
15540
15540
  }
@@ -15569,7 +15569,7 @@ ss.write = function(t, e, n, r, s, i) {
15569
15569
  o.isBuffer = function(d) {
15570
15570
  return d != null && d._isBuffer === !0 && d !== o.prototype;
15571
15571
  }, o.compare = function(d, m) {
15572
- if (Re(d, Uint8Array) && (d = o.from(d, d.offset, d.byteLength)), Re(m, Uint8Array) && (m = o.from(m, m.offset, m.byteLength)), !o.isBuffer(d) || !o.isBuffer(m))
15572
+ if (Be(d, Uint8Array) && (d = o.from(d, d.offset, d.byteLength)), Be(m, Uint8Array) && (m = o.from(m, m.offset, m.byteLength)), !o.isBuffer(d) || !o.isBuffer(m))
15573
15573
  throw new TypeError(
15574
15574
  'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
15575
15575
  );
@@ -15609,7 +15609,7 @@ ss.write = function(t, e, n, r, s, i) {
15609
15609
  var F = o.allocUnsafe(m), A = 0;
15610
15610
  for (S = 0; S < d.length; ++S) {
15611
15611
  var L = d[S];
15612
- if (Re(L, Uint8Array))
15612
+ if (Be(L, Uint8Array))
15613
15613
  A + L.length > F.length ? o.from(L).copy(F, A) : Uint8Array.prototype.set.call(
15614
15614
  F,
15615
15615
  L,
@@ -15626,7 +15626,7 @@ ss.write = function(t, e, n, r, s, i) {
15626
15626
  function C(x, d) {
15627
15627
  if (o.isBuffer(x))
15628
15628
  return x.length;
15629
- if (ArrayBuffer.isView(x) || Re(x, ArrayBuffer))
15629
+ if (ArrayBuffer.isView(x) || Be(x, ArrayBuffer))
15630
15630
  return x.byteLength;
15631
15631
  if (typeof x != "string")
15632
15632
  throw new TypeError(
@@ -15723,7 +15723,7 @@ ss.write = function(t, e, n, r, s, i) {
15723
15723
  var d = "", m = t.INSPECT_MAX_BYTES;
15724
15724
  return d = this.toString("hex", 0, m).replace(/(.{2})/g, "$1 ").trim(), this.length > m && (d += " ... "), "<Buffer " + d + ">";
15725
15725
  }, r && (o.prototype[r] = o.prototype.inspect), o.prototype.compare = function(d, m, S, F, A) {
15726
- if (Re(d, Uint8Array) && (d = o.from(d, d.offset, d.byteLength)), !o.isBuffer(d))
15726
+ if (Be(d, Uint8Array) && (d = o.from(d, d.offset, d.byteLength)), !o.isBuffer(d))
15727
15727
  throw new TypeError(
15728
15728
  'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof d
15729
15729
  );
@@ -15743,7 +15743,7 @@ ss.write = function(t, e, n, r, s, i) {
15743
15743
  }
15744
15744
  return L < q ? -1 : q < L ? 1 : 0;
15745
15745
  };
15746
- function R(x, d, m, S, F) {
15746
+ function B(x, d, m, S, F) {
15747
15747
  if (x.length === 0) return -1;
15748
15748
  if (typeof m == "string" ? (S = m, m = 0) : m > 2147483647 ? m = 2147483647 : m < -2147483648 && (m = -2147483648), m = +m, ve(m) && (m = F ? 0 : x.length - 1), m < 0 && (m = x.length + m), m >= x.length) {
15749
15749
  if (F) return -1;
@@ -15789,9 +15789,9 @@ ss.write = function(t, e, n, r, s, i) {
15789
15789
  o.prototype.includes = function(d, m, S) {
15790
15790
  return this.indexOf(d, m, S) !== -1;
15791
15791
  }, o.prototype.indexOf = function(d, m, S) {
15792
- return R(this, d, m, S, !0);
15792
+ return B(this, d, m, S, !0);
15793
15793
  }, o.prototype.lastIndexOf = function(d, m, S) {
15794
- return R(this, d, m, S, !1);
15794
+ return B(this, d, m, S, !1);
15795
15795
  };
15796
15796
  function W(x, d, m, S) {
15797
15797
  m = Number(m) || 0;
@@ -15989,7 +15989,7 @@ ss.write = function(t, e, n, r, s, i) {
15989
15989
  }, o.prototype.readDoubleBE = function(d, m) {
15990
15990
  return d = d >>> 0, m || Y(d, 8, this.length), n.read(this, d, !1, 52, 8);
15991
15991
  };
15992
- function te(x, d, m, S, F, A) {
15992
+ function ne(x, d, m, S, F, A) {
15993
15993
  if (!o.isBuffer(x)) throw new TypeError('"buffer" argument must be a Buffer instance');
15994
15994
  if (d > F || d < A) throw new RangeError('"value" argument is out of bounds');
15995
15995
  if (m + S > x.length) throw new RangeError("Index out of range");
@@ -15997,7 +15997,7 @@ ss.write = function(t, e, n, r, s, i) {
15997
15997
  o.prototype.writeUintLE = o.prototype.writeUIntLE = function(d, m, S, F) {
15998
15998
  if (d = +d, m = m >>> 0, S = S >>> 0, !F) {
15999
15999
  var A = Math.pow(2, 8 * S) - 1;
16000
- te(this, d, m, S, A, 0);
16000
+ ne(this, d, m, S, A, 0);
16001
16001
  }
16002
16002
  var L = 1, q = 0;
16003
16003
  for (this[m] = d & 255; ++q < S && (L *= 256); )
@@ -16006,26 +16006,26 @@ ss.write = function(t, e, n, r, s, i) {
16006
16006
  }, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(d, m, S, F) {
16007
16007
  if (d = +d, m = m >>> 0, S = S >>> 0, !F) {
16008
16008
  var A = Math.pow(2, 8 * S) - 1;
16009
- te(this, d, m, S, A, 0);
16009
+ ne(this, d, m, S, A, 0);
16010
16010
  }
16011
16011
  var L = S - 1, q = 1;
16012
16012
  for (this[m + L] = d & 255; --L >= 0 && (q *= 256); )
16013
16013
  this[m + L] = d / q & 255;
16014
16014
  return m + S;
16015
16015
  }, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(d, m, S) {
16016
- return d = +d, m = m >>> 0, S || te(this, d, m, 1, 255, 0), this[m] = d & 255, m + 1;
16016
+ return d = +d, m = m >>> 0, S || ne(this, d, m, 1, 255, 0), this[m] = d & 255, m + 1;
16017
16017
  }, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function(d, m, S) {
16018
- return d = +d, m = m >>> 0, S || te(this, d, m, 2, 65535, 0), this[m] = d & 255, this[m + 1] = d >>> 8, m + 2;
16018
+ return d = +d, m = m >>> 0, S || ne(this, d, m, 2, 65535, 0), this[m] = d & 255, this[m + 1] = d >>> 8, m + 2;
16019
16019
  }, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function(d, m, S) {
16020
- return d = +d, m = m >>> 0, S || te(this, d, m, 2, 65535, 0), this[m] = d >>> 8, this[m + 1] = d & 255, m + 2;
16020
+ return d = +d, m = m >>> 0, S || ne(this, d, m, 2, 65535, 0), this[m] = d >>> 8, this[m + 1] = d & 255, m + 2;
16021
16021
  }, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function(d, m, S) {
16022
- return d = +d, m = m >>> 0, S || te(this, d, m, 4, 4294967295, 0), this[m + 3] = d >>> 24, this[m + 2] = d >>> 16, this[m + 1] = d >>> 8, this[m] = d & 255, m + 4;
16022
+ return d = +d, m = m >>> 0, S || ne(this, d, m, 4, 4294967295, 0), this[m + 3] = d >>> 24, this[m + 2] = d >>> 16, this[m + 1] = d >>> 8, this[m] = d & 255, m + 4;
16023
16023
  }, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(d, m, S) {
16024
- return d = +d, m = m >>> 0, S || te(this, d, m, 4, 4294967295, 0), this[m] = d >>> 24, this[m + 1] = d >>> 16, this[m + 2] = d >>> 8, this[m + 3] = d & 255, m + 4;
16024
+ return d = +d, m = m >>> 0, S || ne(this, d, m, 4, 4294967295, 0), this[m] = d >>> 24, this[m + 1] = d >>> 16, this[m + 2] = d >>> 8, this[m + 3] = d & 255, m + 4;
16025
16025
  }, o.prototype.writeIntLE = function(d, m, S, F) {
16026
16026
  if (d = +d, m = m >>> 0, !F) {
16027
16027
  var A = Math.pow(2, 8 * S - 1);
16028
- te(this, d, m, S, A - 1, -A);
16028
+ ne(this, d, m, S, A - 1, -A);
16029
16029
  }
16030
16030
  var L = 0, q = 1, V = 0;
16031
16031
  for (this[m] = d & 255; ++L < S && (q *= 256); )
@@ -16034,22 +16034,22 @@ ss.write = function(t, e, n, r, s, i) {
16034
16034
  }, o.prototype.writeIntBE = function(d, m, S, F) {
16035
16035
  if (d = +d, m = m >>> 0, !F) {
16036
16036
  var A = Math.pow(2, 8 * S - 1);
16037
- te(this, d, m, S, A - 1, -A);
16037
+ ne(this, d, m, S, A - 1, -A);
16038
16038
  }
16039
16039
  var L = S - 1, q = 1, V = 0;
16040
16040
  for (this[m + L] = d & 255; --L >= 0 && (q *= 256); )
16041
16041
  d < 0 && V === 0 && this[m + L + 1] !== 0 && (V = 1), this[m + L] = (d / q >> 0) - V & 255;
16042
16042
  return m + S;
16043
16043
  }, o.prototype.writeInt8 = function(d, m, S) {
16044
- return d = +d, m = m >>> 0, S || te(this, d, m, 1, 127, -128), d < 0 && (d = 255 + d + 1), this[m] = d & 255, m + 1;
16044
+ return d = +d, m = m >>> 0, S || ne(this, d, m, 1, 127, -128), d < 0 && (d = 255 + d + 1), this[m] = d & 255, m + 1;
16045
16045
  }, o.prototype.writeInt16LE = function(d, m, S) {
16046
- return d = +d, m = m >>> 0, S || te(this, d, m, 2, 32767, -32768), this[m] = d & 255, this[m + 1] = d >>> 8, m + 2;
16046
+ return d = +d, m = m >>> 0, S || ne(this, d, m, 2, 32767, -32768), this[m] = d & 255, this[m + 1] = d >>> 8, m + 2;
16047
16047
  }, o.prototype.writeInt16BE = function(d, m, S) {
16048
- return d = +d, m = m >>> 0, S || te(this, d, m, 2, 32767, -32768), this[m] = d >>> 8, this[m + 1] = d & 255, m + 2;
16048
+ return d = +d, m = m >>> 0, S || ne(this, d, m, 2, 32767, -32768), this[m] = d >>> 8, this[m + 1] = d & 255, m + 2;
16049
16049
  }, o.prototype.writeInt32LE = function(d, m, S) {
16050
- return d = +d, m = m >>> 0, S || te(this, d, m, 4, 2147483647, -2147483648), this[m] = d & 255, this[m + 1] = d >>> 8, this[m + 2] = d >>> 16, this[m + 3] = d >>> 24, m + 4;
16050
+ return d = +d, m = m >>> 0, S || ne(this, d, m, 4, 2147483647, -2147483648), this[m] = d & 255, this[m + 1] = d >>> 8, this[m + 2] = d >>> 16, this[m + 3] = d >>> 24, m + 4;
16051
16051
  }, o.prototype.writeInt32BE = function(d, m, S) {
16052
- return d = +d, m = m >>> 0, S || te(this, d, m, 4, 2147483647, -2147483648), d < 0 && (d = 4294967295 + d + 1), this[m] = d >>> 24, this[m + 1] = d >>> 16, this[m + 2] = d >>> 8, this[m + 3] = d & 255, m + 4;
16052
+ return d = +d, m = m >>> 0, S || ne(this, d, m, 4, 2147483647, -2147483648), d < 0 && (d = 4294967295 + d + 1), this[m] = d >>> 24, this[m + 1] = d >>> 16, this[m + 2] = d >>> 8, this[m + 3] = d & 255, m + 4;
16053
16053
  };
16054
16054
  function de(x, d, m, S, F, A) {
16055
16055
  if (m + S > x.length) throw new RangeError("Index out of range");
@@ -16188,7 +16188,7 @@ ss.write = function(t, e, n, r, s, i) {
16188
16188
  d[F + m] = x[F];
16189
16189
  return F;
16190
16190
  }
16191
- function Re(x, d) {
16191
+ function Be(x, d) {
16192
16192
  return x instanceof d || x != null && x.constructor != null && x.constructor.name != null && x.constructor.name === d.name;
16193
16193
  }
16194
16194
  function ve(x) {
@@ -16784,8 +16784,8 @@ function t0() {
16784
16784
  if (!w)
16785
16785
  b += this.iconv.decode(g.slice(v), "ascii");
16786
16786
  else {
16787
- var E = C + this.iconv.decode(g.slice(v), "ascii"), R = E.length - E.length % 8;
16788
- C = E.slice(R), E = E.slice(0, R), b += this.iconv.decode(t.from(E, "base64"), "utf16-be");
16787
+ var E = C + this.iconv.decode(g.slice(v), "ascii"), B = E.length - E.length % 8;
16788
+ C = E.slice(B), E = E.slice(0, B), b += this.iconv.decode(t.from(E, "base64"), "utf16-be");
16789
16789
  }
16790
16790
  return this.inBase64 = w, this.base64Accum = C, b;
16791
16791
  }, s.prototype.end = function() {
@@ -16801,8 +16801,8 @@ function t0() {
16801
16801
  }
16802
16802
  h.prototype.write = function(g) {
16803
16803
  for (var b = this.inBase64, v = this.base64Accum, w = this.base64AccumIdx, C = t.alloc(g.length * 5 + 10), T = 0, E = 0; E < g.length; E++) {
16804
- var R = g.charCodeAt(E);
16805
- R >= 32 && R <= 126 ? (b && (w > 0 && (T += C.write(v.slice(0, w).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), T), w = 0), C[T++] = l, b = !1), b || (C[T++] = R, R === u && (C[T++] = l))) : (b || (C[T++] = u, b = !0), b && (v[w++] = R >> 8, v[w++] = R & 255, w == v.length && (T += C.write(v.toString("base64").replace(/\//g, ","), T), w = 0)));
16804
+ var B = g.charCodeAt(E);
16805
+ B >= 32 && B <= 126 ? (b && (w > 0 && (T += C.write(v.slice(0, w).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), T), w = 0), C[T++] = l, b = !1), b || (C[T++] = B, B === u && (C[T++] = l))) : (b || (C[T++] = u, b = !0), b && (v[w++] = B >> 8, v[w++] = B & 255, w == v.length && (T += C.write(v.toString("base64").replace(/\//g, ","), T), w = 0)));
16806
16806
  }
16807
16807
  return this.inBase64 = b, this.base64AccumIdx = w, C.slice(0, T);
16808
16808
  }, h.prototype.end = function() {
@@ -16829,8 +16829,8 @@ function t0() {
16829
16829
  if (!w)
16830
16830
  b += this.iconv.decode(g.slice(v), "ascii");
16831
16831
  else {
16832
- var E = C + this.iconv.decode(g.slice(v), "ascii").replace(/,/g, "/"), R = E.length - E.length % 8;
16833
- C = E.slice(R), E = E.slice(0, R), b += this.iconv.decode(t.from(E, "base64"), "utf16-be");
16832
+ var E = C + this.iconv.decode(g.slice(v), "ascii").replace(/,/g, "/"), B = E.length - E.length % 8;
16833
+ C = E.slice(B), E = E.slice(0, B), b += this.iconv.decode(t.from(E, "base64"), "utf16-be");
16834
16834
  }
16835
16835
  return this.inBase64 = w, this.base64Accum = C, b;
16836
16836
  }, p.prototype.end = function() {
@@ -17513,16 +17513,16 @@ function i0() {
17513
17513
  C[T] = s - b;
17514
17514
  else if (C[T] > s)
17515
17515
  throw new Error("gb18030 decode tables conflict at byte 2");
17516
- for (var E = this.decodeTables[s - C[T]], R = 129; R <= 254; R++) {
17517
- if (E[R] === e)
17518
- E[R] = s - v;
17516
+ for (var E = this.decodeTables[s - C[T]], B = 129; B <= 254; B++) {
17517
+ if (E[B] === e)
17518
+ E[B] = s - v;
17519
17519
  else {
17520
- if (E[R] === s - v)
17520
+ if (E[B] === s - v)
17521
17521
  continue;
17522
- if (E[R] > s)
17522
+ if (E[B] > s)
17523
17523
  throw new Error("gb18030 decode tables conflict at byte 3");
17524
17524
  }
17525
- for (var U = this.decodeTables[s - E[R]], W = 48; W <= 57; W++)
17525
+ for (var U = this.decodeTables[s - E[B]], W = 48; W <= 57; W++)
17526
17526
  U[W] === e && (U[W] = n);
17527
17527
  }
17528
17528
  }
@@ -17572,7 +17572,7 @@ function i0() {
17572
17572
  else
17573
17573
  throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + h[0]);
17574
17574
  } else if (w > 4080 && w <= 4095) {
17575
- for (var T = 4095 - w + 2, E = [], R = 0; R < T; R++)
17575
+ for (var T = 4095 - w + 2, E = [], B = 0; B < T; B++)
17576
17576
  E.push(b.charCodeAt(v++));
17577
17577
  y[p++] = r - this.decodeTableSeq.length, this.decodeTableSeq.push(E);
17578
17578
  } else
@@ -17609,8 +17609,8 @@ function i0() {
17609
17609
  else if (C <= s) {
17610
17610
  var E = s - C;
17611
17611
  if (!v[E]) {
17612
- var R = T << 8 >>> 0;
17613
- this._fillEncodeTable(E, R, y) ? b = !0 : v[E] = !0;
17612
+ var B = T << 8 >>> 0;
17613
+ this._fillEncodeTable(E, B, y) ? b = !0 : v[E] = !0;
17614
17614
  }
17615
17615
  } else C <= r && (this._setEncodeSequence(this.decodeTableSeq[r - C], T), b = !0);
17616
17616
  }
@@ -17647,8 +17647,8 @@ function i0() {
17647
17647
  } else typeof E == "number" ? T = E : E == null && (E = g[a], E !== void 0 && (T = E, b = C));
17648
17648
  g = void 0;
17649
17649
  } else if (C >= 0) {
17650
- var R = this.encodeTable[C >> 8];
17651
- if (R !== void 0 && (T = R[C & 255]), T <= r) {
17650
+ var B = this.encodeTable[C >> 8];
17651
+ if (B !== void 0 && (T = B[C & 255]), T <= r) {
17652
17652
  g = this.encodeTableSeq[r - T];
17653
17653
  continue;
17654
17654
  }
@@ -17684,11 +17684,11 @@ function i0() {
17684
17684
  w = this.defaultCharUnicode.charCodeAt(0), C = v;
17685
17685
  else if (w === n) {
17686
17686
  if (C >= 3)
17687
- var R = (h[C - 3] - 129) * 12600 + (h[C - 2] - 48) * 1260 + (h[C - 1] - 129) * 10 + (E - 48);
17687
+ var B = (h[C - 3] - 129) * 12600 + (h[C - 2] - 48) * 1260 + (h[C - 1] - 129) * 10 + (E - 48);
17688
17688
  else
17689
- var R = (g[C - 3 + b] - 129) * 12600 + ((C - 2 >= 0 ? h[C - 2] : g[C - 2 + b]) - 48) * 1260 + ((C - 1 >= 0 ? h[C - 1] : g[C - 1 + b]) - 129) * 10 + (E - 48);
17690
- var U = f(this.gb18030.gbChars, R);
17691
- w = this.gb18030.uChars[U] + R - this.gb18030.gbChars[U];
17689
+ var B = (g[C - 3 + b] - 129) * 12600 + ((C - 2 >= 0 ? h[C - 2] : g[C - 2 + b]) - 48) * 1260 + ((C - 1 >= 0 ? h[C - 1] : g[C - 1 + b]) - 129) * 10 + (E - 48);
17690
+ var U = f(this.gb18030.gbChars, B);
17691
+ w = this.gb18030.uChars[U] + B - this.gb18030.gbChars[U];
17692
17692
  } else if (w <= s) {
17693
17693
  y = s - w;
17694
17694
  continue;
@@ -21707,7 +21707,7 @@ const a0 = [
21707
21707
  "fe40",
21708
21708
  "兀嗀﨎﨏﨑﨓﨔礼﨟蘒﨡﨣﨤﨧﨨﨩"
21709
21709
  ]
21710
- ], Ri = [
21710
+ ], Bi = [
21711
21711
  [
21712
21712
  "a140",
21713
21713
  "",
@@ -24764,7 +24764,7 @@ const a0 = [
24764
24764
  "fda1",
24765
24765
  "爻肴酵驍侯候厚后吼喉嗅帿後朽煦珝逅勛勳塤壎焄熏燻薰訓暈薨喧暄煊萱卉喙毁彙徽揮暉煇諱輝麾休携烋畦虧恤譎鷸兇凶匈洶胸黑昕欣炘痕吃屹紇訖欠欽歆吸恰洽翕興僖凞喜噫囍姬嬉希憙憘戱晞曦熙熹熺犧禧稀羲詰"
24766
24766
  ]
24767
- ], Bi = [
24767
+ ], Ri = [
24768
24768
  [
24769
24769
  "0",
24770
24770
  "\0",
@@ -26079,7 +26079,7 @@ function p0() {
26079
26079
  gbk: {
26080
26080
  type: "_dbcs",
26081
26081
  table: function() {
26082
- return mr.concat(Ri);
26082
+ return mr.concat(Bi);
26083
26083
  }
26084
26084
  },
26085
26085
  xgbk: "gbk",
@@ -26092,7 +26092,7 @@ function p0() {
26092
26092
  gb18030: {
26093
26093
  type: "_dbcs",
26094
26094
  table: function() {
26095
- return mr.concat(Ri);
26095
+ return mr.concat(Bi);
26096
26096
  },
26097
26097
  gb18030: function() {
26098
26098
  return u0;
@@ -26148,7 +26148,7 @@ function p0() {
26148
26148
  cp950: {
26149
26149
  type: "_dbcs",
26150
26150
  table: function() {
26151
- return Bi;
26151
+ return Ri;
26152
26152
  }
26153
26153
  },
26154
26154
  // Big5 has many variations and is an extension of cp950. We use Encoding Standard's as a consensus.
@@ -26156,7 +26156,7 @@ function p0() {
26156
26156
  big5hkscs: {
26157
26157
  type: "_dbcs",
26158
26158
  table: function() {
26159
- return Bi.concat(f0);
26159
+ return Ri.concat(f0);
26160
26160
  },
26161
26161
  encodeSkipVals: [
26162
26162
  // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of
@@ -26696,9 +26696,9 @@ class Ke {
26696
26696
  throw new Error("Unsupported font data type");
26697
26697
  }
26698
26698
  }
26699
- class ne {
26699
+ class ee {
26700
26700
  constructor() {
26701
- this.fontMapping = {}, this.loadedFontMap = /* @__PURE__ */ new Map(), this.unsupportedChars = {}, this.missedFonts = {}, this.enableFontCache = !0, this.lazyFontLoading = !0, this.defaultFonts = /* @__PURE__ */ new Set(["simsun"]), this.symbolFonts = /* @__PURE__ */ new Set(["simplex", "amgdt"]), this.events = {
26701
+ this.fontMapping = {}, this.loadedFontMap = /* @__PURE__ */ new Map(), this.unsupportedChars = {}, this.missedFonts = {}, this.enableFontCache = !0, this.lazyFontLoading = !0, this.awaitFontsBeforeDraw = !1, this.defaultFonts = /* @__PURE__ */ new Set(["simsun"]), this.symbolFonts = /* @__PURE__ */ new Set(["simplex", "amgdt"]), this.events = {
26702
26702
  /** Event triggered when a font cannot be found */
26703
26703
  fontNotFound: new gs(),
26704
26704
  /** Event triggered when a font is successfully loaded */
@@ -26710,7 +26710,7 @@ class ne {
26710
26710
  * @returns The FontManager instance
26711
26711
  */
26712
26712
  static get instance() {
26713
- return ne._instance || (ne._instance = new ne()), ne._instance;
26713
+ return ee._instance || (ee._instance = new ee()), ee._instance;
26714
26714
  }
26715
26715
  /**
26716
26716
  * Base URL to load fonts
@@ -26858,11 +26858,14 @@ class ne {
26858
26858
  return this.fontRequestInFlight.set(n, i), i;
26859
26859
  }
26860
26860
  /**
26861
- * Fire-and-forget {@link requestFont} for each name (deduped per name).
26861
+ * Requests each font name via {@link requestFont} (deduped per name).
26862
+ * Callers may ignore the returned promise for fire-and-forget loads, or
26863
+ * await it when they need fonts before drawing.
26862
26864
  */
26863
26865
  requestFonts(e) {
26864
- for (const n of e)
26865
- this.requestFont(n);
26866
+ return Promise.all(e.map((n) => this.requestFont(n))).then(
26867
+ (n) => n.flat()
26868
+ );
26866
26869
  }
26867
26870
  normalizeFontName(e) {
26868
26871
  if (e == null)
@@ -27209,7 +27212,7 @@ class ne {
27209
27212
  };
27210
27213
  }
27211
27214
  resolveUploadedFontType(e) {
27212
- const n = Ro(e).toLowerCase();
27215
+ const n = Bo(e).toLowerCase();
27213
27216
  if (n === "shx")
27214
27217
  return "shx";
27215
27218
  if (["ttf", "otf", "woff"].includes(n))
@@ -27357,13 +27360,13 @@ class v0 {
27357
27360
  const n = [], r = [], s = /* @__PURE__ */ new Map();
27358
27361
  e.forEach((c) => {
27359
27362
  const l = c.toLowerCase(), u = this._avaiableFontMap.get(l);
27360
- u && (s.set(l, u), ne.instance.isFontLoaded(l) && n.push({
27363
+ u && (s.set(l, u), ee.instance.isFontLoaded(l) && n.push({
27361
27364
  fontName: l,
27362
27365
  url: u.url,
27363
27366
  status: "Success"
27364
27367
  }), r.push(u));
27365
27368
  });
27366
- const i = await ne.instance.loadFonts(r), a = {};
27369
+ const i = await ee.instance.loadFonts(r), a = {};
27367
27370
  [...n, ...i].forEach((c) => {
27368
27371
  a[c.fontName] = c;
27369
27372
  });
@@ -27376,7 +27379,7 @@ class v0 {
27376
27379
  }
27377
27380
  const f = s.get(l);
27378
27381
  if (f) {
27379
- if (ne.instance.isFontLoaded(l)) {
27382
+ if (ee.instance.isFontLoaded(l)) {
27380
27383
  o.push({
27381
27384
  fontName: l,
27382
27385
  url: f.url,
@@ -27396,7 +27399,7 @@ class v0 {
27396
27399
  continue;
27397
27400
  }
27398
27401
  }
27399
- if (await ne.instance.loadFontFromCache(c)) {
27402
+ if (await ee.instance.loadFontFromCache(c)) {
27400
27403
  o.push({
27401
27404
  fontName: l,
27402
27405
  url: "",
@@ -28681,7 +28684,7 @@ function Kt(t) {
28681
28684
  function e1(t) {
28682
28685
  return t.isRgb && t.rgbValue != null ? { rgbValue: t.rgbValue } : t.aci != null ? { aci: t.aci } : { aci: 256 };
28683
28686
  }
28684
- function R0(t) {
28687
+ function B0(t) {
28685
28688
  if (!t)
28686
28689
  return;
28687
28690
  const e = new bt();
@@ -28690,8 +28693,8 @@ function R0(t) {
28690
28693
  if (typeof t.aci == "number")
28691
28694
  return e.aci = t.aci, e;
28692
28695
  }
28693
- function B0(t, e, n, r) {
28694
- const s = R0(r), i = Kt(t);
28696
+ function R0(t, e, n, r) {
28697
+ const s = B0(r), i = Kt(t);
28695
28698
  if (s && s.isRgb && typeof s.rgbValue == "number" && s.rgbValue === i && !t.color.isRgb && typeof t.color.aci == "number") {
28696
28699
  const o = new bt();
28697
28700
  return o.aci = t.color.aci, {
@@ -29673,7 +29676,7 @@ class $i {
29673
29676
  if (c === "^") {
29674
29677
  if (a && !o) {
29675
29678
  this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams();
29676
- const C = [], T = [], E = [], R = [];
29679
+ const C = [], T = [], E = [], B = [];
29677
29680
  this._hOffset = l, this._vOffset = this.convertTopAlignedVOffset(
29678
29681
  u + h * 0.1,
29679
29682
  this.currentFontSize
@@ -29684,12 +29687,12 @@ class $i {
29684
29687
  C,
29685
29688
  T,
29686
29689
  E,
29687
- R
29690
+ B
29688
29691
  );
29689
- n.push(...C), r.push(...T), s.push(...E), i.push(...R), this._hOffset = l + y, this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams();
29692
+ n.push(...C), r.push(...T), s.push(...E), i.push(...B), this._hOffset = l + y, this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams();
29690
29693
  } else if (!a && o) {
29691
29694
  this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams();
29692
- const C = [], T = [], E = [], R = [];
29695
+ const C = [], T = [], E = [], B = [];
29693
29696
  this._hOffset = l, this._vOffset = this.convertTopAlignedVOffset(
29694
29697
  u - h * 0.6,
29695
29698
  this.currentFontSize
@@ -29700,13 +29703,13 @@ class $i {
29700
29703
  C,
29701
29704
  T,
29702
29705
  E,
29703
- R
29706
+ B
29704
29707
  );
29705
- n.push(...C), r.push(...T), s.push(...E), i.push(...R), this._hOffset = l + g, this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams();
29708
+ n.push(...C), r.push(...T), s.push(...E), i.push(...B), this._hOffset = l + g, this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams();
29706
29709
  } else if (a && o) {
29707
29710
  const C = this._currentContext.fontScaleFactor || 1, T = (this._maxFontSize || this.currentFontSize) / C, E = Math.abs(this.currentLayoutFontSize - T) < 1e-6;
29708
29711
  E && (this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams());
29709
- const R = Math.max(y, g), U = 0, W = 0, j = this.currentLayoutFontSize, N = u - T + j, $ = N + this.currentFontSize, ie = [], P = [], D = [], _ = [];
29712
+ const B = Math.max(y, g), U = 0, W = 0, j = this.currentLayoutFontSize, N = u - T + j, $ = N + this.currentFontSize, ie = [], P = [], D = [], _ = [];
29710
29713
  this._hOffset = l + U, this._vOffset = $;
29711
29714
  for (let fe = 0; fe < a.length; fe++)
29712
29715
  this.processChar(
@@ -29727,10 +29730,10 @@ class $i {
29727
29730
  Qe,
29728
29731
  _e
29729
29732
  );
29730
- n.push(...re), r.push(...Te), s.push(...Qe), i.push(..._e), this._hOffset = l + R, E && (this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams());
29733
+ n.push(...re), r.push(...Te), s.push(...Qe), i.push(..._e), this._hOffset = l + B, E && (this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams());
29731
29734
  }
29732
29735
  } else {
29733
- const C = [], T = [], E = [], R = [];
29736
+ const C = [], T = [], E = [], B = [];
29734
29737
  this._hOffset = l + v, this._vOffset = this.convertTopAlignedVOffset(
29735
29738
  u + this.currentFontSize * 0.3,
29736
29739
  this.currentFontSize
@@ -29741,9 +29744,9 @@ class $i {
29741
29744
  C,
29742
29745
  T,
29743
29746
  E,
29744
- R
29747
+ B
29745
29748
  );
29746
- n.push(...C), r.push(...T), s.push(...E), i.push(...R), (c === "/" || c === "#") && this.recordStackDivider(
29749
+ n.push(...C), r.push(...T), s.push(...E), i.push(...B), (c === "/" || c === "#") && this.recordStackDivider(
29747
29750
  l,
29748
29751
  u,
29749
29752
  b,
@@ -30402,29 +30405,35 @@ class tn extends I.Object3D {
30402
30405
  this.disposeThreeObject(this);
30403
30406
  }
30404
30407
  /**
30405
- * Draw the MText object. Schedules required fonts for background load and
30406
- * builds the object graph immediately with current fallbacks.
30408
+ * Draw the MText object.
30407
30409
  *
30408
- * Does not await downloads callers that need glyphs from newly loaded fonts
30409
- * should redraw after {@link FontManager.events.fontLoaded}.
30410
- */
30411
- async asyncDraw() {
30412
- const e = Array.from(tn.getFonts(this._mtextData.text || "", !0));
30410
+ * With {@link FontManager.lazyFontLoading} and without awaiting fonts, this
30411
+ * schedules downloads in the background and builds geometry immediately with
30412
+ * current fallbacks — redraw after {@link FontManager.events.fontLoaded} if
30413
+ * you need the final faces. Pass `{ awaitFonts: true }` or set
30414
+ * {@link FontManager.awaitFontsBeforeDraw} to wait for referenced fonts first.
30415
+ */
30416
+ async asyncDraw(e) {
30417
+ const n = Array.from(tn.getFonts(this._mtextData.text || "", !0));
30413
30418
  if (!this._fontsInStyleLoaded) {
30414
30419
  if (this._style.font) {
30415
- const n = this.getFontName(this._style.font);
30416
- n && e.push(n);
30420
+ const r = this.getFontName(this._style.font);
30421
+ r && n.push(r);
30417
30422
  }
30418
30423
  if (this._style.bigFont) {
30419
- const n = this.getFontName(this._style.bigFont);
30420
- n && e.push(n);
30424
+ const r = this.getFontName(this._style.bigFont);
30425
+ r && n.push(r);
30421
30426
  }
30422
30427
  if (this._style.extendedFont) {
30423
- const n = this.getFontName(this._style.extendedFont);
30424
- n && e.push(n);
30428
+ const r = this.getFontName(this._style.extendedFont);
30429
+ r && n.push(r);
30425
30430
  }
30426
30431
  }
30427
- e.length > 0 && (this._fontManager.lazyFontLoading ? this._fontManager.requestFonts(e) : await this._fontManager.loadFontsByNames(e), this._fontsInStyleLoaded = !0), this.syncDraw();
30432
+ if (n.length > 0) {
30433
+ const r = (e == null ? void 0 : e.awaitFonts) ?? (!this._fontManager.lazyFontLoading || this._fontManager.awaitFontsBeforeDraw);
30434
+ this._fontManager.lazyFontLoading ? r ? await this._fontManager.requestFonts(n) : this._fontManager.requestFonts(n) : await this._fontManager.loadFontsByNames(n), this._fontsInStyleLoaded = !0;
30435
+ }
30436
+ this.syncDraw();
30428
30437
  }
30429
30438
  /**
30430
30439
  * Draw the MText object. This method assumes that fonts needed are loaded. If font needed
@@ -30983,14 +30992,18 @@ class Xi extends I.Object3D {
30983
30992
  createLayoutData() {
30984
30993
  return { lines: [], chars: [] };
30985
30994
  }
30986
- async asyncDraw() {
30987
- const e = [];
30995
+ async asyncDraw(e) {
30996
+ const n = [];
30988
30997
  if (!this._fontsInStyleLoaded)
30989
- for (const n of ["font", "bigFont", "extendedFont"]) {
30990
- const r = this.getFontName(this._style[n]);
30991
- r && e.push(r);
30998
+ for (const r of ["font", "bigFont", "extendedFont"]) {
30999
+ const s = this.getFontName(this._style[r]);
31000
+ s && n.push(s);
30992
31001
  }
30993
- e.length > 0 && (this._fontManager.lazyFontLoading ? this._fontManager.requestFonts(e) : await this._fontManager.loadFontsByNames(e), this._fontsInStyleLoaded = !0), this.syncDraw();
31002
+ if (n.length > 0) {
31003
+ const r = (e == null ? void 0 : e.awaitFonts) ?? (!this._fontManager.lazyFontLoading || this._fontManager.awaitFontsBeforeDraw);
31004
+ this._fontManager.lazyFontLoading ? r ? await this._fontManager.requestFonts(n) : this._fontManager.requestFonts(n) : await this._fontManager.loadFontsByNames(n), this._fontsInStyleLoaded = !0;
31005
+ }
31006
+ this.syncDraw();
30994
31007
  }
30995
31008
  syncDraw() {
30996
31009
  const n = new tn(
@@ -31097,7 +31110,7 @@ class $0 {
31097
31110
  this.defaultStyleManager = e;
31098
31111
  }
31099
31112
  async ensureInitialized() {
31100
- this.isInitialized || (ne.instance.lazyFontLoading || await this.loadFonts(ne.instance.getFontsToLoad()), this.isInitialized = !0);
31113
+ this.isInitialized || (ee.instance.lazyFontLoading || await this.loadFonts(ee.instance.getFontsToLoad()), this.isInitialized = !0);
31101
31114
  }
31102
31115
  /**
31103
31116
  * Handles messages coming from any worker.
@@ -31107,7 +31120,7 @@ class $0 {
31107
31120
  if (e.type === "fontLoaded") {
31108
31121
  const l = (c = e.data) == null ? void 0 : c.fontName;
31109
31122
  l && this.syncFontToWorkerPool(l).then((u) => {
31110
- u && ne.instance.events.fontLoaded.dispatch({ fontName: l });
31123
+ u && ee.instance.events.fontLoaded.dispatch({ fontName: l });
31111
31124
  }).catch((u) => {
31112
31125
  console.warn(
31113
31126
  `Failed to sync lazy-loaded font "${l}" across worker pool:`,
@@ -31227,7 +31240,7 @@ class $0 {
31227
31240
  * Syncs the default font fallback chain to all workers.
31228
31241
  */
31229
31242
  async setDefaultFonts(e, n) {
31230
- ne.instance.setDefaultFonts(e), ne.instance.setSymbolFonts(n), await this.sendMessageToAllWorkers({
31243
+ ee.instance.setDefaultFonts(e), ee.instance.setSymbolFonts(n), await this.sendMessageToAllWorkers({
31231
31244
  type: "setDefaultFonts",
31232
31245
  data: {
31233
31246
  fonts: [...e],
@@ -31239,11 +31252,20 @@ class $0 {
31239
31252
  * Mirrors {@link FontManager.lazyFontLoading} into every worker isolate.
31240
31253
  */
31241
31254
  async setLazyFontLoading(e) {
31242
- ne.instance.lazyFontLoading = e, await this.sendMessageToAllWorkers({
31255
+ ee.instance.lazyFontLoading = e, await this.sendMessageToAllWorkers({
31243
31256
  type: "setLazyFontLoading",
31244
31257
  data: { enabled: e }
31245
31258
  });
31246
31259
  }
31260
+ /**
31261
+ * Mirrors {@link FontManager.awaitFontsBeforeDraw} into every worker isolate.
31262
+ */
31263
+ async setAwaitFontsBeforeDraw(e) {
31264
+ ee.instance.awaitFontsBeforeDraw = e, await this.sendMessageToAllWorkers({
31265
+ type: "setAwaitFontsBeforeDraw",
31266
+ data: { enabled: e }
31267
+ });
31268
+ }
31247
31269
  /**
31248
31270
  * Render MText in one worker and return serialized data asynchronously.
31249
31271
  */
@@ -31364,7 +31386,7 @@ class $0 {
31364
31386
  );
31365
31387
  o.setIndex(new I.Uint16BufferAttribute(h, 1));
31366
31388
  }
31367
- const c = B0(
31389
+ const c = R0(
31368
31390
  n,
31369
31391
  a.material.color,
31370
31392
  r,
@@ -31479,7 +31501,7 @@ class $0 {
31479
31501
  }
31480
31502
  class Y0 {
31481
31503
  constructor() {
31482
- this.fontManager = ne.instance, this.defaultStyleManager = new Ao(), this.isInitialized = !1;
31504
+ this.fontManager = ee.instance, this.defaultStyleManager = new Ao(), this.isInitialized = !1;
31483
31505
  }
31484
31506
  /**
31485
31507
  * Used to manage materials used by texts
@@ -31500,7 +31522,9 @@ class Y0 {
31500
31522
  /**
31501
31523
  * Render MText directly in the main thread asynchronously. Fonts referenced by
31502
31524
  * the text/style are scheduled via {@link FontManager.requestFonts} when
31503
- * {@link FontManager.lazyFontLoading} is enabled; otherwise they are awaited.
31525
+ * {@link FontManager.lazyFontLoading} is enabled (unless
31526
+ * {@link FontManager.awaitFontsBeforeDraw} waits for them first); otherwise
31527
+ * they are awaited.
31504
31528
  */
31505
31529
  async asyncRenderMText(e, n, r = Ie()) {
31506
31530
  await this.ensureInitialized();
@@ -31586,7 +31610,7 @@ class t1 {
31586
31610
  * when render mode is 'worker'.
31587
31611
  */
31588
31612
  constructor(e = "main", n = {}) {
31589
- this.webWorkerRenderer = null, this.webWorkerConfigured = !1, this.workerLazyFontLoading = null, this.defaultMode = e, this.workerConfig = n, this.mainThreadRenderer = new Y0(), this.renderer = this.mainThreadRenderer, e === "worker" && (this.renderer = this.ensureWebWorkerRenderer());
31613
+ this.webWorkerRenderer = null, this.webWorkerConfigured = !1, this.workerLazyFontLoading = null, this.workerAwaitFontsBeforeDraw = null, this.defaultMode = e, this.workerConfig = n, this.mainThreadRenderer = new Y0(), this.renderer = this.mainThreadRenderer, e === "worker" && (this.renderer = this.ensureWebWorkerRenderer());
31590
31614
  }
31591
31615
  ensureWebWorkerRenderer() {
31592
31616
  return this.webWorkerRenderer || (this.webWorkerRenderer = new $0(this.workerConfig), this.webWorkerRenderer.styleManager = this.mainThreadRenderer.styleManager, this.webWorkerConfigured = !1), this.webWorkerRenderer;
@@ -31594,11 +31618,13 @@ class t1 {
31594
31618
  async activateWebWorkerRenderer() {
31595
31619
  const e = this.ensureWebWorkerRenderer();
31596
31620
  this.webWorkerConfigured || (await e.setDefaultFonts(
31597
- [...ne.instance.defaultFonts],
31598
- [...ne.instance.symbolFonts]
31621
+ [...ee.instance.defaultFonts],
31622
+ [...ee.instance.symbolFonts]
31599
31623
  ), this.webWorkerConfigured = !0);
31600
- const n = ne.instance.lazyFontLoading;
31601
- return this.workerLazyFontLoading !== n && (await e.setLazyFontLoading(n), this.workerLazyFontLoading = n), e;
31624
+ const n = ee.instance.lazyFontLoading;
31625
+ this.workerLazyFontLoading !== n && (await e.setLazyFontLoading(n), this.workerLazyFontLoading = n);
31626
+ const r = ee.instance.awaitFontsBeforeDraw;
31627
+ return this.workerAwaitFontsBeforeDraw !== r && (await e.setAwaitFontsBeforeDraw(r), this.workerAwaitFontsBeforeDraw = r), e;
31602
31628
  }
31603
31629
  /**
31604
31630
  * Sets one new style manager to override the default style manager.
@@ -31675,9 +31701,9 @@ class t1 {
31675
31701
  * Sets the default font fallback chain on the active renderer and workers.
31676
31702
  */
31677
31703
  async setDefaultFonts(e) {
31678
- ne.instance.setDefaultFonts(e), this.webWorkerRenderer && (await this.webWorkerRenderer.setDefaultFonts(
31679
- [...ne.instance.defaultFonts],
31680
- [...ne.instance.symbolFonts]
31704
+ ee.instance.setDefaultFonts(e), this.webWorkerRenderer && (await this.webWorkerRenderer.setDefaultFonts(
31705
+ [...ee.instance.defaultFonts],
31706
+ [...ee.instance.symbolFonts]
31681
31707
  ), this.webWorkerConfigured = !0);
31682
31708
  }
31683
31709
  /**
@@ -31685,19 +31711,26 @@ class t1 {
31685
31711
  * existing worker pool.
31686
31712
  */
31687
31713
  async setLazyFontLoading(e) {
31688
- ne.instance.lazyFontLoading = e, this.webWorkerRenderer && (await this.webWorkerRenderer.setLazyFontLoading(e), this.workerLazyFontLoading = e);
31714
+ ee.instance.lazyFontLoading = e, this.webWorkerRenderer && (await this.webWorkerRenderer.setLazyFontLoading(e), this.workerLazyFontLoading = e);
31715
+ }
31716
+ /**
31717
+ * Mirrors {@link FontManager.awaitFontsBeforeDraw} onto the main thread and
31718
+ * any existing worker pool.
31719
+ */
31720
+ async setAwaitFontsBeforeDraw(e) {
31721
+ ee.instance.awaitFontsBeforeDraw = e, this.webWorkerRenderer && (await this.webWorkerRenderer.setAwaitFontsBeforeDraw(e), this.workerAwaitFontsBeforeDraw = e);
31689
31722
  }
31690
31723
  /**
31691
31724
  * Returns font names for a predefined default-font preset.
31692
31725
  */
31693
31726
  getDefaultFontsPreset(e) {
31694
- return ne.instance.getDefaultFontsPreset(e);
31727
+ return ee.instance.getDefaultFontsPreset(e);
31695
31728
  }
31696
31729
  /**
31697
31730
  * Returns symbol-font names for a predefined preset.
31698
31731
  */
31699
31732
  getSymbolFontsPreset(e) {
31700
- return ne.instance.getSymbolFontsPreset(e);
31733
+ return ee.instance.getSymbolFontsPreset(e);
31701
31734
  }
31702
31735
  /**
31703
31736
  * Load fonts using the current mode
@@ -31724,7 +31757,7 @@ class t1 {
31724
31757
  * the JS heap.
31725
31758
  */
31726
31759
  async estimateMemoryUsage() {
31727
- const e = Fo(ne.instance, {
31760
+ const e = Fo(ee.instance, {
31728
31761
  id: "main",
31729
31762
  styleManager: this.mainThreadRenderer.styleManager
31730
31763
  }), n = this.webWorkerRenderer ? await this.webWorkerRenderer.estimateMemoryUsage() : [];
@@ -31753,7 +31786,7 @@ class t1 {
31753
31786
  * with the web worker renderer.
31754
31787
  */
31755
31788
  async cacheFont(e, n, r, s) {
31756
- return ne.instance.cacheFont(e, n, r, s);
31789
+ return ee.instance.cacheFont(e, n, r, s);
31757
31790
  }
31758
31791
  /**
31759
31792
  * Terminate web workers and release their memory.
@@ -31783,7 +31816,7 @@ export {
31783
31816
  v0 as DefaultFontLoader,
31784
31817
  gs as EventManager,
31785
31818
  Ke as FontFactory,
31786
- ne as FontManager,
31819
+ ee as FontManager,
31787
31820
  D0 as LINE_SPACING_SCALE_FACTOR,
31788
31821
  Ko as MATERIAL_ESTIMATED_BYTES,
31789
31822
  N0 as MAX_REASONABLE_MTEXT_WIDTH_CONTENT_EXCESS,
@@ -31811,10 +31844,10 @@ export {
31811
31844
  Q as TokenType,
31812
31845
  t1 as UnifiedRenderer,
31813
31846
  $0 as WebWorkerRenderer,
31814
- B0 as buildWorkerMaterialColorSettings,
31847
+ R0 as buildWorkerMaterialColorSettings,
31815
31848
  Fo as collectIsolateMemoryStats,
31816
31849
  Ie as createDefaultColorSettings,
31817
- R0 as deserializeMTextColor,
31850
+ B0 as deserializeMTextColor,
31818
31851
  la as emptyMaterialStats,
31819
31852
  J0 as escapeDxfLineEndings,
31820
31853
  ra as estimateGeometryBytes,