@mlightcad/mtext-renderer 0.12.9 → 0.12.11

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
@@ -522,7 +522,7 @@ class aa extends I.Shape {
522
522
  return this.width > 0;
523
523
  }
524
524
  }
525
- class Fe {
525
+ class Te {
526
526
  /**
527
527
  * Converts an unsigned byte to a signed byte as used in SHX format.
528
528
  * Values > 127 are converted to their signed equivalent (-128 to -1).
@@ -1005,7 +1005,7 @@ class Vo {
1005
1005
  return !1;
1006
1006
  }
1007
1007
  }
1008
- class Fn extends Vo {
1008
+ class Tn extends Vo {
1009
1009
  constructor(e = ms) {
1010
1010
  super(), this.cellWidthFactor = e;
1011
1011
  }
@@ -1027,17 +1027,17 @@ class Fn extends Vo {
1027
1027
  if (!e.polylines.some((a) => a.length >= 2))
1028
1028
  return n * r;
1029
1029
  const s = n * r, { maxX: i } = e.bbox;
1030
- return Fn.isCenterOriginGlyph(e) ? Math.max(i, n / 2) + s : i + s;
1030
+ return Tn.isCenterOriginGlyph(e) ? Math.max(i, n / 2) + s : i + s;
1031
1031
  }
1032
1032
  resolve(e, n) {
1033
1033
  var r;
1034
- return e.hasExplicitAdvance ? ((r = e.lastPoint) == null ? void 0 : r.x) ?? 0 : Fn.computeAdvance(e, n, this.cellWidthFactor);
1034
+ return e.hasExplicitAdvance ? ((r = e.lastPoint) == null ? void 0 : r.x) ?? 0 : Tn.computeAdvance(e, n, this.cellWidthFactor);
1035
1035
  }
1036
1036
  markAlignedAdvanceExplicit(e) {
1037
1037
  return !0;
1038
1038
  }
1039
1039
  }
1040
- const Nn = new Fn();
1040
+ const Nn = new Tn();
1041
1041
  class se {
1042
1042
  /**
1043
1043
  * Creates a new Point instance.
@@ -1271,7 +1271,7 @@ class Bt {
1271
1271
  } = i, y = ua(i), m = this.bbox;
1272
1272
  let b = y;
1273
1273
  u && qo(m) && !jo(y, m) && (b = $o(y, m));
1274
- 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, P = b.minY - T, W = b.maxY + T;
1274
+ const v = b.maxX - b.minX, w = b.maxY - b.minY, C = v * l, F = w * l, E = b.minX - C, R = b.maxX + C, P = b.minY - F, W = b.maxY + F;
1275
1275
  o = c((N) => ({
1276
1276
  x: N.x,
1277
1277
  y: -N.y
@@ -1837,7 +1837,7 @@ class ac {
1837
1837
  return s;
1838
1838
  if (this.isVerticalDualBigfontMarker(e, s, "close"))
1839
1839
  return s + 1;
1840
- i = e[s], i === 0 && (s++, i = e[s++] << 8 | e[s++], l.x = Fe.byteToSByte(e[s++]) * r.scale, l.y = Fe.byteToSByte(e[s++]) * r.scale, this.fontData.content.isExtended ? (c = e[s++] * r.scale, o = e[s] * r.scale) : (o = e[s] * r.scale, c = o));
1840
+ i = e[s], i === 0 && (s++, i = e[s++] << 8 | e[s++], l.x = Te.byteToSByte(e[s++]) * r.scale, l.y = Te.byteToSByte(e[s++]) * r.scale, this.fontData.content.isExtended ? (c = e[s++] * r.scale, o = e[s] * r.scale) : (o = e[s] * r.scale, c = o));
1841
1841
  break;
1842
1842
  case K.UNIFONT:
1843
1843
  s++, i = e[s++] << 8 | e[s++], s--;
@@ -1877,13 +1877,13 @@ class ac {
1877
1877
  handleXYDisplacement(e, n, r) {
1878
1878
  let s = n;
1879
1879
  const i = new se();
1880
- return i.x = Fe.byteToSByte(e[++s]), i.y = Fe.byteToSByte(e[++s]), r.currentPoint.add(i.multiply(r.scale)), r.isPenDown ? r.currentPolyline.push(r.currentPoint.clone()) : this.notePenUpPositioning(r), s;
1880
+ return i.x = Te.byteToSByte(e[++s]), i.y = Te.byteToSByte(e[++s]), r.currentPoint.add(i.multiply(r.scale)), r.isPenDown ? r.currentPolyline.push(r.currentPoint.clone()) : this.notePenUpPositioning(r), s;
1881
1881
  }
1882
1882
  handleMultipleXYDisplacements(e, n, r) {
1883
1883
  let s = n;
1884
1884
  for (; !(s + 1 >= e.length); ) {
1885
1885
  const i = new se();
1886
- if (i.x = Fe.byteToSByte(e[++s]), i.y = Fe.byteToSByte(e[++s]), i.x === 0 && i.y === 0)
1886
+ if (i.x = Te.byteToSByte(e[++s]), i.y = Te.byteToSByte(e[++s]), i.x === 0 && i.y === 0)
1887
1887
  break;
1888
1888
  r.currentPoint.add(i.multiply(r.scale)), r.isPenDown ? r.currentPolyline.push(r.currentPoint.clone()) : this.notePenUpPositioning(r);
1889
1889
  }
@@ -1891,14 +1891,14 @@ class ac {
1891
1891
  }
1892
1892
  handleOctantArc(e, n, r) {
1893
1893
  let s = n;
1894
- const i = e[++s] * r.scale, a = Fe.byteToSByte(e[++s]), o = (a & 112) >> 4;
1894
+ const i = e[++s] * r.scale, a = Te.byteToSByte(e[++s]), o = (a & 112) >> 4;
1895
1895
  let c = a & 7;
1896
1896
  const l = a < 0, u = Math.PI / 4 * o, f = r.currentPoint.clone().subtract(new se(Math.cos(u) * i, Math.sin(u) * i)), h = Zt.fromOctant(f, i, o, c, l).tessellate();
1897
1897
  return r.isPenDown && (r.currentPolyline.pop(), r.currentPolyline.push(...h.slice())), r.currentPoint = h[h.length - 1].clone(), s;
1898
1898
  }
1899
1899
  handleFractionalArc(e, n, r) {
1900
1900
  let s = n;
1901
- const i = e[++s], a = e[++s], o = e[++s], c = e[++s], l = (o * 255 + c) * r.scale, u = Fe.byteToSByte(e[++s]), f = (u & 112) >> 4;
1901
+ const i = e[++s], a = e[++s], o = e[++s], c = e[++s], l = (o * 255 + c) * r.scale, u = Te.byteToSByte(e[++s]), f = (u & 112) >> 4;
1902
1902
  let h = u & 7;
1903
1903
  h === 0 && (h = 8), a !== 0 && h--;
1904
1904
  const p = Math.PI / 4;
@@ -1908,19 +1908,19 @@ class ac {
1908
1908
  v += p * i / 256 * b, w += p * a / 256 * b;
1909
1909
  const C = r.currentPoint.clone().subtract(new se(l * Math.cos(v), l * Math.sin(v)));
1910
1910
  if (r.currentPoint = C.clone().add(new se(l * Math.cos(w), l * Math.sin(w))), r.isPenDown) {
1911
- let T = v;
1911
+ let F = v;
1912
1912
  const E = [];
1913
1913
  if (E.push(
1914
- C.clone().add(new se(l * Math.cos(T), l * Math.sin(T)))
1914
+ C.clone().add(new se(l * Math.cos(F), l * Math.sin(F)))
1915
1915
  ), m > 0)
1916
- for (; T + m < w; )
1917
- T += m, E.push(
1918
- C.clone().add(new se(l * Math.cos(T), l * Math.sin(T)))
1916
+ for (; F + m < w; )
1917
+ F += m, E.push(
1918
+ C.clone().add(new se(l * Math.cos(F), l * Math.sin(F)))
1919
1919
  );
1920
1920
  else
1921
- for (; T + m > w; )
1922
- T += m, E.push(
1923
- C.clone().add(new se(l * Math.cos(T), l * Math.sin(T)))
1921
+ for (; F + m > w; )
1922
+ F += m, E.push(
1923
+ C.clone().add(new se(l * Math.cos(F), l * Math.sin(F)))
1924
1924
  );
1925
1925
  E.push(C.clone().add(new se(l * Math.cos(w), l * Math.sin(w)))), r.currentPolyline.push(...E);
1926
1926
  }
@@ -1929,8 +1929,8 @@ class ac {
1929
1929
  handleBulgeArc(e, n, r) {
1930
1930
  let s = n;
1931
1931
  const i = new se();
1932
- i.x = Fe.byteToSByte(e[++s]), i.y = Fe.byteToSByte(e[++s]);
1933
- const a = Fe.byteToSByte(e[++s]);
1932
+ i.x = Te.byteToSByte(e[++s]), i.y = Te.byteToSByte(e[++s]);
1933
+ const a = Te.byteToSByte(e[++s]);
1934
1934
  return r.currentPoint = this.handleArcSegment(
1935
1935
  r.currentPoint,
1936
1936
  i,
@@ -1944,9 +1944,9 @@ class ac {
1944
1944
  let s = n;
1945
1945
  for (; !(s + 1 >= e.length); ) {
1946
1946
  const i = new se();
1947
- if (i.x = Fe.byteToSByte(e[++s]), i.y = Fe.byteToSByte(e[++s]), i.x === 0 && i.y === 0 || s + 1 >= e.length)
1947
+ if (i.x = Te.byteToSByte(e[++s]), i.y = Te.byteToSByte(e[++s]), i.x === 0 && i.y === 0 || s + 1 >= e.length)
1948
1948
  break;
1949
- const a = Fe.byteToSByte(e[++s]);
1949
+ const a = Te.byteToSByte(e[++s]);
1950
1950
  r.currentPoint = this.handleArcSegment(
1951
1951
  r.currentPoint,
1952
1952
  i,
@@ -2078,7 +2078,7 @@ class oc {
2078
2078
  */
2079
2079
  constructor(e) {
2080
2080
  if (e instanceof ArrayBuffer) {
2081
- const n = new Fe(e), r = new Po().parse(n), s = Wo.createParser(r.fontType).parse(n);
2081
+ const n = new Te(e), r = new Po().parse(n), s = Wo.createParser(r.fontType).parse(n);
2082
2082
  this.fontData = {
2083
2083
  header: r,
2084
2084
  content: s
@@ -2245,13 +2245,13 @@ function uc() {
2245
2245
  IDBCursor.prototype.continuePrimaryKey
2246
2246
  ]);
2247
2247
  }
2248
- const Tr = /* @__PURE__ */ new WeakMap(), Yn = /* @__PURE__ */ new WeakMap(), Hn = /* @__PURE__ */ new WeakMap();
2248
+ const Fr = /* @__PURE__ */ new WeakMap(), Yn = /* @__PURE__ */ new WeakMap(), Hn = /* @__PURE__ */ new WeakMap();
2249
2249
  function hc(t) {
2250
2250
  const e = new Promise((n, r) => {
2251
2251
  const s = () => {
2252
2252
  t.removeEventListener("success", i), t.removeEventListener("error", a);
2253
2253
  }, i = () => {
2254
- n(Tt(t.result)), s();
2254
+ n(Ft(t.result)), s();
2255
2255
  }, a = () => {
2256
2256
  r(t.error), s();
2257
2257
  };
@@ -2260,7 +2260,7 @@ function hc(t) {
2260
2260
  return Hn.set(e, t), e;
2261
2261
  }
2262
2262
  function fc(t) {
2263
- if (Tr.has(t))
2263
+ if (Fr.has(t))
2264
2264
  return;
2265
2265
  const e = new Promise((n, r) => {
2266
2266
  const s = () => {
@@ -2272,17 +2272,17 @@ function fc(t) {
2272
2272
  };
2273
2273
  t.addEventListener("complete", i), t.addEventListener("error", a), t.addEventListener("abort", a);
2274
2274
  });
2275
- Tr.set(t, e);
2275
+ Fr.set(t, e);
2276
2276
  }
2277
- let Fr = {
2277
+ let Tr = {
2278
2278
  get(t, e, n) {
2279
2279
  if (t instanceof IDBTransaction) {
2280
2280
  if (e === "done")
2281
- return Tr.get(t);
2281
+ return Fr.get(t);
2282
2282
  if (e === "store")
2283
2283
  return n.objectStoreNames[1] ? void 0 : n.objectStore(n.objectStoreNames[0]);
2284
2284
  }
2285
- return Tt(t[e]);
2285
+ return Ft(t[e]);
2286
2286
  },
2287
2287
  set(t, e, n) {
2288
2288
  return t[e] = n, !0;
@@ -2292,19 +2292,19 @@ let Fr = {
2292
2292
  }
2293
2293
  };
2294
2294
  function fa(t) {
2295
- Fr = t(Fr);
2295
+ Tr = t(Tr);
2296
2296
  }
2297
2297
  function pc(t) {
2298
2298
  return uc().includes(t) ? function(...e) {
2299
- return t.apply(kr(this), e), Tt(this.request);
2299
+ return t.apply(kr(this), e), Ft(this.request);
2300
2300
  } : function(...e) {
2301
- return Tt(t.apply(kr(this), e));
2301
+ return Ft(t.apply(kr(this), e));
2302
2302
  };
2303
2303
  }
2304
2304
  function dc(t) {
2305
- return typeof t == "function" ? pc(t) : (t instanceof IDBTransaction && fc(t), Cr(t, lc()) ? new Proxy(t, Fr) : t);
2305
+ return typeof t == "function" ? pc(t) : (t instanceof IDBTransaction && fc(t), Cr(t, lc()) ? new Proxy(t, Tr) : t);
2306
2306
  }
2307
- function Tt(t) {
2307
+ function Ft(t) {
2308
2308
  if (t instanceof IDBRequest)
2309
2309
  return hc(t);
2310
2310
  if (Yn.has(t))
@@ -2314,9 +2314,9 @@ function Tt(t) {
2314
2314
  }
2315
2315
  const kr = (t) => Hn.get(t);
2316
2316
  function gc(t, e, { blocked: n, upgrade: r, blocking: s, terminated: i } = {}) {
2317
- const a = indexedDB.open(t, e), o = Tt(a);
2317
+ const a = indexedDB.open(t, e), o = Ft(a);
2318
2318
  return r && a.addEventListener("upgradeneeded", (c) => {
2319
- r(Tt(a.result), c.oldVersion, c.newVersion, Tt(a.transaction), c);
2319
+ r(Ft(a.result), c.oldVersion, c.newVersion, Ft(a.transaction), c);
2320
2320
  }), n && a.addEventListener("blocked", (c) => n(
2321
2321
  // Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
2322
2322
  c.oldVersion,
@@ -2354,12 +2354,12 @@ fa((t) => ({
2354
2354
  get: (e, n, r) => Cs(e, n) || t.get(e, n, r),
2355
2355
  has: (e, n) => !!Cs(e, n) || t.has(e, n)
2356
2356
  }));
2357
- const bc = ["continue", "continuePrimaryKey", "advance"], Ts = {}, Er = /* @__PURE__ */ new WeakMap(), pa = /* @__PURE__ */ new WeakMap(), xc = {
2357
+ const bc = ["continue", "continuePrimaryKey", "advance"], Fs = {}, Er = /* @__PURE__ */ new WeakMap(), pa = /* @__PURE__ */ new WeakMap(), xc = {
2358
2358
  get(t, e) {
2359
2359
  if (!bc.includes(e))
2360
2360
  return t[e];
2361
- let n = Ts[e];
2362
- return n || (n = Ts[e] = function(...r) {
2361
+ let n = Fs[e];
2362
+ return n || (n = Fs[e] = function(...r) {
2363
2363
  Er.set(this, pa.get(this)[e](...r));
2364
2364
  }), n;
2365
2365
  }
@@ -2373,16 +2373,16 @@ async function* vc(...t) {
2373
2373
  for (pa.set(n, e), Hn.set(n, kr(e)); e; )
2374
2374
  yield n, e = await (Er.get(n) || e.continue()), Er.delete(n);
2375
2375
  }
2376
- function Fs(t, e) {
2376
+ function Ts(t, e) {
2377
2377
  return e === Symbol.asyncIterator && Cr(t, [IDBIndex, IDBObjectStore, IDBCursor]) || e === "iterate" && Cr(t, [IDBIndex, IDBObjectStore]);
2378
2378
  }
2379
2379
  fa((t) => ({
2380
2380
  ...t,
2381
2381
  get(e, n, r) {
2382
- return Fs(e, n) ? vc : t.get(e, n, r);
2382
+ return Ts(e, n) ? vc : t.get(e, n, r);
2383
2383
  },
2384
2384
  has(e, n) {
2385
- return Fs(e, n) || t.has(e, n);
2385
+ return Ts(e, n) || t.has(e, n);
2386
2386
  }
2387
2387
  }));
2388
2388
  const St = {
@@ -2560,12 +2560,12 @@ const St = {
2560
2560
  }
2561
2561
  };
2562
2562
  Be.DATABASE_NAME = "mlightcad", Be.DATABASE_VERSION = Kn[Kn.length - 1].version;
2563
- let st = Be;
2563
+ let Ue = Be;
2564
2564
  const Sc = 512;
2565
2565
  function wc(t, e) {
2566
2566
  return (t + e) * Sc;
2567
2567
  }
2568
- const Cc = 2.5, Tc = 1.5;
2568
+ const Cc = 2.5, Fc = 1.5;
2569
2569
  function da() {
2570
2570
  return {
2571
2571
  meshCount: 0,
@@ -2578,6 +2578,8 @@ const Ar = {
2578
2578
  r12r14: ["txt", "simplex", "romans", "gbcbig", "simsun"],
2579
2579
  // Mesh/TTF first so missing style fonts (e.g. "标准") get correct Latin metrics.
2580
2580
  // BIGFONT SHX stays available via glyph fallback for CJK coverage.
2581
+ // Korean/Japanese faces are not in this preset — load on demand via style
2582
+ // names (e.g. `malgun`) or switch to the `korean` / `cjk` presets.
2581
2583
  modern: ["simsun", "hztxt"],
2582
2584
  international: ["txt", "simplex", "romans", "simsun"],
2583
2585
  // Full CJK: mesh faces for CN/KR/JP, then matching SHX big fonts.
@@ -2613,7 +2615,7 @@ var Wr = 0, ga = -3;
2613
2615
  function Jt() {
2614
2616
  this.table = new Uint16Array(16), this.trans = new Uint16Array(288);
2615
2617
  }
2616
- function Fc(t, e) {
2618
+ function Tc(t, e) {
2617
2619
  this.source = t, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = e, this.destLen = 0, this.ltree = new Jt(), this.dtree = new Jt();
2618
2620
  }
2619
2621
  var ma = new Jt(), ya = new Jt(), Vr = new Uint8Array(30), qr = new Uint16Array(30), ba = new Uint8Array(30), xa = new Uint16Array(30), kc = new Uint8Array([
@@ -2636,7 +2638,7 @@ var ma = new Jt(), ya = new Jt(), Vr = new Uint8Array(30), qr = new Uint16Array(
2636
2638
  14,
2637
2639
  1,
2638
2640
  15
2639
- ]), Es = new Jt(), je = new Uint8Array(320);
2641
+ ]), Es = new Jt(), $e = new Uint8Array(320);
2640
2642
  function va(t, e, n, r) {
2641
2643
  var s, i;
2642
2644
  for (s = 0; s < n; ++s) t[s] = 0;
@@ -2669,7 +2671,7 @@ function Ac(t) {
2669
2671
  var e = t.tag & 1;
2670
2672
  return t.tag >>>= 1, e;
2671
2673
  }
2672
- function Ye(t, e, n) {
2674
+ function Xe(t, e, n) {
2673
2675
  if (!e)
2674
2676
  return n;
2675
2677
  for (; t.bitcount < 24; )
@@ -2688,33 +2690,33 @@ function Or(t, e) {
2688
2690
  }
2689
2691
  function Oc(t, e, n) {
2690
2692
  var r, s, i, a, o, c;
2691
- for (r = Ye(t, 5, 257), s = Ye(t, 5, 1), i = Ye(t, 4, 4), a = 0; a < 19; ++a) je[a] = 0;
2693
+ for (r = Xe(t, 5, 257), s = Xe(t, 5, 1), i = Xe(t, 4, 4), a = 0; a < 19; ++a) $e[a] = 0;
2692
2694
  for (a = 0; a < i; ++a) {
2693
- var l = Ye(t, 3, 0);
2694
- je[kc[a]] = l;
2695
+ var l = Xe(t, 3, 0);
2696
+ $e[kc[a]] = l;
2695
2697
  }
2696
- for (Jn(Es, je, 0, 19), o = 0; o < r + s; ) {
2698
+ for (Jn(Es, $e, 0, 19), o = 0; o < r + s; ) {
2697
2699
  var u = Or(t, Es);
2698
2700
  switch (u) {
2699
2701
  case 16:
2700
- var f = je[o - 1];
2701
- for (c = Ye(t, 2, 3); c; --c)
2702
- je[o++] = f;
2702
+ var f = $e[o - 1];
2703
+ for (c = Xe(t, 2, 3); c; --c)
2704
+ $e[o++] = f;
2703
2705
  break;
2704
2706
  case 17:
2705
- for (c = Ye(t, 3, 3); c; --c)
2706
- je[o++] = 0;
2707
+ for (c = Xe(t, 3, 3); c; --c)
2708
+ $e[o++] = 0;
2707
2709
  break;
2708
2710
  case 18:
2709
- for (c = Ye(t, 7, 11); c; --c)
2710
- je[o++] = 0;
2711
+ for (c = Xe(t, 7, 11); c; --c)
2712
+ $e[o++] = 0;
2711
2713
  break;
2712
2714
  default:
2713
- je[o++] = u;
2715
+ $e[o++] = u;
2714
2716
  break;
2715
2717
  }
2716
2718
  }
2717
- Jn(e, je, 0, r), Jn(n, je, r, s);
2719
+ Jn(e, $e, 0, r), Jn(n, $e, r, s);
2718
2720
  }
2719
2721
  function Os(t, e, n) {
2720
2722
  for (; ; ) {
@@ -2725,7 +2727,7 @@ function Os(t, e, n) {
2725
2727
  t.dest[t.destLen++] = r;
2726
2728
  else {
2727
2729
  var s, i, a, o;
2728
- for (r -= 257, s = Ye(t, Vr[r], qr[r]), i = Or(t, n), a = t.destLen - Ye(t, ba[i], xa[i]), o = a; o < a + s; ++o)
2730
+ for (r -= 257, s = Xe(t, Vr[r], qr[r]), i = Or(t, n), a = t.destLen - Xe(t, ba[i], xa[i]), o = a; o < a + s; ++o)
2729
2731
  t.dest[t.destLen++] = t.dest[o];
2730
2732
  }
2731
2733
  }
@@ -2740,9 +2742,9 @@ function Lc(t) {
2740
2742
  return t.bitcount = 0, Wr;
2741
2743
  }
2742
2744
  function Sa(t, e) {
2743
- var n = new Fc(t, e), r, s, i;
2745
+ var n = new Tc(t, e), r, s, i;
2744
2746
  do {
2745
- switch (r = Ac(n), s = Ye(n, 2, 0), s) {
2747
+ switch (r = Ac(n), s = Xe(n, 2, 0), s) {
2746
2748
  case 0:
2747
2749
  i = Lc(n);
2748
2750
  break;
@@ -2820,7 +2822,7 @@ function Ca(t, e) {
2820
2822
  const s = +(Math.round(r + "e+" + e) + "e-" + e);
2821
2823
  return Vt[e][r] = s, n + s;
2822
2824
  }
2823
- function Ta(t) {
2825
+ function Fa(t) {
2824
2826
  let e = [[]], n = 0, r = 0;
2825
2827
  for (let s = 0; s < t.length; s += 1) {
2826
2828
  const i = e[e.length - 1], a = t[s], o = i[0], c = i[1], l = i[i.length - 1], u = t[s + 1];
@@ -2883,14 +2885,14 @@ de.prototype.fromSVG = function(t, e = {}) {
2883
2885
  break;
2884
2886
  case "V":
2885
2887
  for (let C = 0; C < b.length; C++) {
2886
- let T = 0;
2887
- m && (T = this.commands.length && this.commands[this.commands.length - 1].y || 0), this.lineTo(v, b[C] + T);
2888
+ let F = 0;
2889
+ m && (F = this.commands.length && this.commands[this.commands.length - 1].y || 0), this.lineTo(v, b[C] + F);
2888
2890
  }
2889
2891
  break;
2890
2892
  case "H":
2891
2893
  for (let C = 0; C < b.length; C++) {
2892
- let T = 0;
2893
- m && (T = this.commands.length && this.commands[this.commands.length - 1].x || 0), this.lineTo(b[C] + T, w);
2894
+ let F = 0;
2895
+ m && (F = this.commands.length && this.commands[this.commands.length - 1].x || 0), this.lineTo(b[C] + F, w);
2894
2896
  }
2895
2897
  break;
2896
2898
  case "C":
@@ -2929,7 +2931,7 @@ de.prototype.fromSVG = function(t, e = {}) {
2929
2931
  if (c)
2930
2932
  throw new Error("Unexpected character: " + m + " at offset " + y);
2931
2933
  }
2932
- f.apply(this), e.optimize && (this.commands = Ta(this.commands));
2934
+ f.apply(this), e.optimize && (this.commands = Fa(this.commands));
2933
2935
  const h = e.flipY;
2934
2936
  let p = e.flipYBase;
2935
2937
  if (h === !0 && e.flipYBase === void 0) {
@@ -3056,7 +3058,7 @@ de.prototype.toPathData = function(t) {
3056
3058
  return o;
3057
3059
  }
3058
3060
  let r = this.commands;
3059
- t.optimize && (r = JSON.parse(JSON.stringify(this.commands)), r = Ta(r));
3061
+ t.optimize && (r = JSON.parse(JSON.stringify(this.commands)), r = Fa(r));
3060
3062
  const s = t.flipY;
3061
3063
  let i = t.flipYBase;
3062
3064
  if (s === !0 && i === void 0) {
@@ -3101,14 +3103,14 @@ de.prototype.toDOMElement = function(t, e) {
3101
3103
  return n.setAttribute("d", e), this.fill !== void 0 && this.fill !== "black" && (this.fill === null ? n.setAttribute("fill", "none") : n.setAttribute("fill", this.fill)), this.stroke && (n.setAttribute("stroke", this.stroke), n.setAttribute("stroke-width", this.strokeWidth)), n;
3102
3104
  };
3103
3105
  var Pt = de;
3104
- function Fa(t) {
3106
+ function Ta(t) {
3105
3107
  throw new Error(t);
3106
3108
  }
3107
3109
  function Ls(t, e) {
3108
- t || Fa(e);
3110
+ t || Ta(e);
3109
3111
  }
3110
- var H = { fail: Fa, argument: Ls, assert: Ls }, Is = 32768, Rs = 2147483648, Bc = -32768, Mc = 32767 + 1 / 65536, Nt = {}, B = {}, z = {};
3111
- function qe(t) {
3112
+ var H = { fail: Ta, argument: Ls, assert: Ls }, Is = 32768, Rs = 2147483648, Bc = -32768, Mc = 32767 + 1 / 65536, Nt = {}, B = {}, z = {};
3113
+ function je(t) {
3112
3114
  return function() {
3113
3115
  return t;
3114
3116
  };
@@ -3116,11 +3118,11 @@ function qe(t) {
3116
3118
  B.BYTE = function(t) {
3117
3119
  return H.argument(t >= 0 && t <= 255, "Byte value should be between 0 and 255."), [t];
3118
3120
  };
3119
- z.BYTE = qe(1);
3121
+ z.BYTE = je(1);
3120
3122
  B.CHAR = function(t) {
3121
3123
  return [t.charCodeAt(0)];
3122
3124
  };
3123
- z.CHAR = qe(1);
3125
+ z.CHAR = je(1);
3124
3126
  B.CHARARRAY = function(t) {
3125
3127
  (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."));
3126
3128
  const e = [];
@@ -3134,23 +3136,23 @@ z.CHARARRAY = function(t) {
3134
3136
  B.USHORT = function(t) {
3135
3137
  return [t >> 8 & 255, t & 255];
3136
3138
  };
3137
- z.USHORT = qe(2);
3139
+ z.USHORT = je(2);
3138
3140
  B.SHORT = function(t) {
3139
3141
  return t >= Is && (t = -(2 * Is - t)), [t >> 8 & 255, t & 255];
3140
3142
  };
3141
- z.SHORT = qe(2);
3143
+ z.SHORT = je(2);
3142
3144
  B.UINT24 = function(t) {
3143
3145
  return [t >> 16 & 255, t >> 8 & 255, t & 255];
3144
3146
  };
3145
- z.UINT24 = qe(3);
3147
+ z.UINT24 = je(3);
3146
3148
  B.ULONG = function(t) {
3147
3149
  return [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
3148
3150
  };
3149
- z.ULONG = qe(4);
3151
+ z.ULONG = je(4);
3150
3152
  B.LONG = function(t) {
3151
3153
  return t >= Rs && (t = -(2 * Rs - t)), [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
3152
3154
  };
3153
- z.LONG = qe(4);
3155
+ z.LONG = je(4);
3154
3156
  B.FLOAT = function(t) {
3155
3157
  if (t > Mc || t < Bc)
3156
3158
  throw new Error(`Value ${t} is outside the range of representable values in 16.16 format`);
@@ -3171,7 +3173,7 @@ z.F2DOT14 = z.USHORT;
3171
3173
  B.LONGDATETIME = function(t) {
3172
3174
  return [0, 0, 0, 0, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
3173
3175
  };
3174
- z.LONGDATETIME = qe(8);
3176
+ z.LONGDATETIME = je(8);
3175
3177
  B.TAG = function(t) {
3176
3178
  return H.argument(t.length === 4, "Tag should be exactly 4 ASCII characters."), [
3177
3179
  t.charCodeAt(0),
@@ -3180,7 +3182,7 @@ B.TAG = function(t) {
3180
3182
  t.charCodeAt(3)
3181
3183
  ];
3182
3184
  };
3183
- z.TAG = qe(4);
3185
+ z.TAG = je(4);
3184
3186
  B.Card8 = B.BYTE;
3185
3187
  z.Card8 = z.BYTE;
3186
3188
  B.Card16 = B.USHORT;
@@ -3198,11 +3200,11 @@ z.NUMBER = function(t) {
3198
3200
  B.NUMBER16 = function(t) {
3199
3201
  return [28, t >> 8 & 255, t & 255];
3200
3202
  };
3201
- z.NUMBER16 = qe(3);
3203
+ z.NUMBER16 = je(3);
3202
3204
  B.NUMBER32 = function(t) {
3203
3205
  return [29, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
3204
3206
  };
3205
- z.NUMBER32 = qe(5);
3207
+ z.NUMBER32 = je(5);
3206
3208
  B.REAL = function(t) {
3207
3209
  let e = t.toString();
3208
3210
  const n = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);
@@ -3763,51 +3765,51 @@ var qc = {
3763
3765
  INNER_INDEX_BIT_COUNT_MASK: 15,
3764
3766
  MAP_ENTRY_SIZE_MASK: 48
3765
3767
  };
3766
- function F(t, e) {
3768
+ function T(t, e) {
3767
3769
  this.data = t, this.offset = e, this.relativeOffset = 0;
3768
3770
  }
3769
- F.prototype.parseByte = function() {
3771
+ T.prototype.parseByte = function() {
3770
3772
  const t = this.data.getUint8(this.offset + this.relativeOffset);
3771
3773
  return this.relativeOffset += 1, t;
3772
3774
  };
3773
- F.prototype.parseChar = function() {
3775
+ T.prototype.parseChar = function() {
3774
3776
  const t = this.data.getInt8(this.offset + this.relativeOffset);
3775
3777
  return this.relativeOffset += 1, t;
3776
3778
  };
3777
- F.prototype.parseCard8 = F.prototype.parseByte;
3778
- F.prototype.parseUShort = function() {
3779
+ T.prototype.parseCard8 = T.prototype.parseByte;
3780
+ T.prototype.parseUShort = function() {
3779
3781
  const t = this.data.getUint16(this.offset + this.relativeOffset);
3780
3782
  return this.relativeOffset += 2, t;
3781
3783
  };
3782
- F.prototype.parseCard16 = F.prototype.parseUShort;
3783
- F.prototype.parseSID = F.prototype.parseUShort;
3784
- F.prototype.parseOffset16 = F.prototype.parseUShort;
3785
- F.prototype.parseShort = function() {
3784
+ T.prototype.parseCard16 = T.prototype.parseUShort;
3785
+ T.prototype.parseSID = T.prototype.parseUShort;
3786
+ T.prototype.parseOffset16 = T.prototype.parseUShort;
3787
+ T.prototype.parseShort = function() {
3786
3788
  const t = this.data.getInt16(this.offset + this.relativeOffset);
3787
3789
  return this.relativeOffset += 2, t;
3788
3790
  };
3789
- F.prototype.parseF2Dot14 = function() {
3791
+ T.prototype.parseF2Dot14 = function() {
3790
3792
  const t = this.data.getInt16(this.offset + this.relativeOffset) / 16384;
3791
3793
  return this.relativeOffset += 2, t;
3792
3794
  };
3793
- F.prototype.parseUInt24 = function() {
3795
+ T.prototype.parseUInt24 = function() {
3794
3796
  const t = ka(this.data, this.offset + this.relativeOffset);
3795
3797
  return this.relativeOffset += 3, t;
3796
3798
  };
3797
- F.prototype.parseULong = function() {
3799
+ T.prototype.parseULong = function() {
3798
3800
  const t = jr(this.data, this.offset + this.relativeOffset);
3799
3801
  return this.relativeOffset += 4, t;
3800
3802
  };
3801
- F.prototype.parseLong = function() {
3803
+ T.prototype.parseLong = function() {
3802
3804
  const t = Gc(this.data, this.offset + this.relativeOffset);
3803
3805
  return this.relativeOffset += 4, t;
3804
3806
  };
3805
- F.prototype.parseOffset32 = F.prototype.parseULong;
3806
- F.prototype.parseFixed = function() {
3807
+ T.prototype.parseOffset32 = T.prototype.parseULong;
3808
+ T.prototype.parseFixed = function() {
3807
3809
  const t = Ea(this.data, this.offset + this.relativeOffset);
3808
3810
  return this.relativeOffset += 4, t;
3809
3811
  };
3810
- F.prototype.parseString = function(t) {
3812
+ T.prototype.parseString = function(t) {
3811
3813
  const e = this.data, n = this.offset + this.relativeOffset;
3812
3814
  let r = "";
3813
3815
  this.relativeOffset += t;
@@ -3815,21 +3817,21 @@ F.prototype.parseString = function(t) {
3815
3817
  r += String.fromCharCode(e.getUint8(n + s));
3816
3818
  return r;
3817
3819
  };
3818
- F.prototype.parseTag = function() {
3820
+ T.prototype.parseTag = function() {
3819
3821
  return this.parseString(4);
3820
3822
  };
3821
- F.prototype.parseLongDateTime = function() {
3823
+ T.prototype.parseLongDateTime = function() {
3822
3824
  let t = jr(this.data, this.offset + this.relativeOffset + 4);
3823
3825
  return t -= 2082844800, this.relativeOffset += 8, t;
3824
3826
  };
3825
- F.prototype.parseVersion = function(t) {
3827
+ T.prototype.parseVersion = function(t) {
3826
3828
  const e = Rn(this.data, this.offset + this.relativeOffset), n = Rn(this.data, this.offset + this.relativeOffset + 2);
3827
3829
  return this.relativeOffset += 4, t === void 0 && (t = 4096), e + n / t / 10;
3828
3830
  };
3829
- F.prototype.skip = function(t, e) {
3831
+ T.prototype.skip = function(t, e) {
3830
3832
  e === void 0 && (e = 1), this.relativeOffset += qc[t] * e;
3831
3833
  };
3832
- F.prototype.parseULongList = function(t) {
3834
+ T.prototype.parseULongList = function(t) {
3833
3835
  t === void 0 && (t = this.parseULong());
3834
3836
  const e = new Array(t), n = this.data;
3835
3837
  let r = this.offset + this.relativeOffset;
@@ -3837,7 +3839,7 @@ F.prototype.parseULongList = function(t) {
3837
3839
  e[s] = n.getUint32(r), r += 4;
3838
3840
  return this.relativeOffset += t * 4, e;
3839
3841
  };
3840
- F.prototype.parseOffset16List = F.prototype.parseUShortList = function(t) {
3842
+ T.prototype.parseOffset16List = T.prototype.parseUShortList = function(t) {
3841
3843
  t === void 0 && (t = this.parseUShort());
3842
3844
  const e = new Array(t), n = this.data;
3843
3845
  let r = this.offset + this.relativeOffset;
@@ -3845,35 +3847,35 @@ F.prototype.parseOffset16List = F.prototype.parseUShortList = function(t) {
3845
3847
  e[s] = n.getUint16(r), r += 2;
3846
3848
  return this.relativeOffset += t * 2, e;
3847
3849
  };
3848
- F.prototype.parseShortList = function(t) {
3850
+ T.prototype.parseShortList = function(t) {
3849
3851
  const e = new Array(t), n = this.data;
3850
3852
  let r = this.offset + this.relativeOffset;
3851
3853
  for (let s = 0; s < t; s++)
3852
3854
  e[s] = n.getInt16(r), r += 2;
3853
3855
  return this.relativeOffset += t * 2, e;
3854
3856
  };
3855
- F.prototype.parseByteList = function(t) {
3857
+ T.prototype.parseByteList = function(t) {
3856
3858
  const e = new Array(t), n = this.data;
3857
3859
  let r = this.offset + this.relativeOffset;
3858
3860
  for (let s = 0; s < t; s++)
3859
3861
  e[s] = n.getUint8(r++);
3860
3862
  return this.relativeOffset += t, e;
3861
3863
  };
3862
- F.prototype.parseList = function(t, e) {
3864
+ T.prototype.parseList = function(t, e) {
3863
3865
  e || (e = t, t = this.parseUShort());
3864
3866
  const n = new Array(t);
3865
3867
  for (let r = 0; r < t; r++)
3866
3868
  n[r] = e.call(this);
3867
3869
  return n;
3868
3870
  };
3869
- F.prototype.parseList32 = function(t, e) {
3871
+ T.prototype.parseList32 = function(t, e) {
3870
3872
  e || (e = t, t = this.parseULong());
3871
3873
  const n = new Array(t);
3872
3874
  for (let r = 0; r < t; r++)
3873
3875
  n[r] = e.call(this);
3874
3876
  return n;
3875
3877
  };
3876
- F.prototype.parseRecordList = function(t, e) {
3878
+ T.prototype.parseRecordList = function(t, e) {
3877
3879
  e || (e = t, t = this.parseUShort());
3878
3880
  const n = new Array(t), r = Object.keys(e);
3879
3881
  for (let s = 0; s < t; s++) {
@@ -3886,7 +3888,7 @@ F.prototype.parseRecordList = function(t, e) {
3886
3888
  }
3887
3889
  return n;
3888
3890
  };
3889
- F.prototype.parseRecordList32 = function(t, e) {
3891
+ T.prototype.parseRecordList32 = function(t, e) {
3890
3892
  e || (e = t, t = this.parseULong());
3891
3893
  const n = new Array(t), r = Object.keys(e);
3892
3894
  for (let s = 0; s < t; s++) {
@@ -3899,7 +3901,7 @@ F.prototype.parseRecordList32 = function(t, e) {
3899
3901
  }
3900
3902
  return n;
3901
3903
  };
3902
- F.prototype.parseTupleRecords = function(t, e) {
3904
+ T.prototype.parseTupleRecords = function(t, e) {
3903
3905
  let n = [];
3904
3906
  for (let r = 0; r < t; r++) {
3905
3907
  let s = [];
@@ -3909,7 +3911,7 @@ F.prototype.parseTupleRecords = function(t, e) {
3909
3911
  }
3910
3912
  return n;
3911
3913
  };
3912
- F.prototype.parseStruct = function(t) {
3914
+ T.prototype.parseStruct = function(t) {
3913
3915
  if (typeof t == "function")
3914
3916
  return t.call(this);
3915
3917
  {
@@ -3921,29 +3923,29 @@ F.prototype.parseStruct = function(t) {
3921
3923
  return n;
3922
3924
  }
3923
3925
  };
3924
- F.prototype.parseValueRecord = function(t) {
3926
+ T.prototype.parseValueRecord = function(t) {
3925
3927
  if (t === void 0 && (t = this.parseUShort()), t === 0)
3926
3928
  return;
3927
3929
  const e = {};
3928
3930
  return t & 1 && (e.xPlacement = this.parseShort()), t & 2 && (e.yPlacement = this.parseShort()), t & 4 && (e.xAdvance = this.parseShort()), t & 8 && (e.yAdvance = this.parseShort()), t & 16 && (e.xPlaDevice = void 0, this.parseShort()), t & 32 && (e.yPlaDevice = void 0, this.parseShort()), t & 64 && (e.xAdvDevice = void 0, this.parseShort()), t & 128 && (e.yAdvDevice = void 0, this.parseShort()), e;
3929
3931
  };
3930
- F.prototype.parseValueRecordList = function() {
3932
+ T.prototype.parseValueRecordList = function() {
3931
3933
  const t = this.parseUShort(), e = this.parseUShort(), n = new Array(e);
3932
3934
  for (let r = 0; r < e; r++)
3933
3935
  n[r] = this.parseValueRecord(t);
3934
3936
  return n;
3935
3937
  };
3936
- F.prototype.parsePointer = function(t) {
3938
+ T.prototype.parsePointer = function(t) {
3937
3939
  const e = this.parseOffset16();
3938
3940
  if (e > 0)
3939
- return new F(this.data, this.offset + e).parseStruct(t);
3941
+ return new T(this.data, this.offset + e).parseStruct(t);
3940
3942
  };
3941
- F.prototype.parsePointer32 = function(t) {
3943
+ T.prototype.parsePointer32 = function(t) {
3942
3944
  const e = this.parseOffset32();
3943
3945
  if (e > 0)
3944
- return new F(this.data, this.offset + e).parseStruct(t);
3946
+ return new T(this.data, this.offset + e).parseStruct(t);
3945
3947
  };
3946
- F.prototype.parseListOfLists = function(t) {
3948
+ T.prototype.parseListOfLists = function(t) {
3947
3949
  const e = this.parseOffset16List(), n = e.length, r = this.relativeOffset, s = new Array(n);
3948
3950
  for (let i = 0; i < n; i++) {
3949
3951
  const a = e[i];
@@ -3961,7 +3963,7 @@ F.prototype.parseListOfLists = function(t) {
3961
3963
  }
3962
3964
  return this.relativeOffset = r, s;
3963
3965
  };
3964
- F.prototype.parseCoverage = function() {
3966
+ T.prototype.parseCoverage = function() {
3965
3967
  const t = this.offset + this.relativeOffset, e = this.parseUShort(), n = this.parseUShort();
3966
3968
  if (e === 1)
3967
3969
  return {
@@ -3983,7 +3985,7 @@ F.prototype.parseCoverage = function() {
3983
3985
  }
3984
3986
  throw new Error("0x" + t.toString(16) + ": Coverage format must be 1 or 2.");
3985
3987
  };
3986
- F.prototype.parseClassDef = function() {
3988
+ T.prototype.parseClassDef = function() {
3987
3989
  const t = this.offset + this.relativeOffset, e = this.parseUShort();
3988
3990
  return e === 1 ? {
3989
3991
  format: 1,
@@ -3992,111 +3994,111 @@ F.prototype.parseClassDef = function() {
3992
3994
  } : e === 2 ? {
3993
3995
  format: 2,
3994
3996
  ranges: this.parseRecordList({
3995
- start: F.uShort,
3996
- end: F.uShort,
3997
- classId: F.uShort
3997
+ start: T.uShort,
3998
+ end: T.uShort,
3999
+ classId: T.uShort
3998
4000
  })
3999
4001
  } : (console.warn(`0x${t.toString(16)}: This font file uses an invalid ClassDef format of ${e}. It might be corrupted and should be reacquired if it doesn't display as intended.`), {
4000
4002
  format: e
4001
4003
  });
4002
4004
  };
4003
- F.list = function(t, e) {
4005
+ T.list = function(t, e) {
4004
4006
  return function() {
4005
4007
  return this.parseList(t, e);
4006
4008
  };
4007
4009
  };
4008
- F.list32 = function(t, e) {
4010
+ T.list32 = function(t, e) {
4009
4011
  return function() {
4010
4012
  return this.parseList32(t, e);
4011
4013
  };
4012
4014
  };
4013
- F.recordList = function(t, e) {
4015
+ T.recordList = function(t, e) {
4014
4016
  return function() {
4015
4017
  return this.parseRecordList(t, e);
4016
4018
  };
4017
4019
  };
4018
- F.recordList32 = function(t, e) {
4020
+ T.recordList32 = function(t, e) {
4019
4021
  return function() {
4020
4022
  return this.parseRecordList32(t, e);
4021
4023
  };
4022
4024
  };
4023
- F.pointer = function(t) {
4025
+ T.pointer = function(t) {
4024
4026
  return function() {
4025
4027
  return this.parsePointer(t);
4026
4028
  };
4027
4029
  };
4028
- F.pointer32 = function(t) {
4030
+ T.pointer32 = function(t) {
4029
4031
  return function() {
4030
4032
  return this.parsePointer32(t);
4031
4033
  };
4032
4034
  };
4033
- F.tag = F.prototype.parseTag;
4034
- F.byte = F.prototype.parseByte;
4035
- F.uShort = F.offset16 = F.prototype.parseUShort;
4036
- F.uShortList = F.prototype.parseUShortList;
4037
- F.uInt24 = F.prototype.parseUInt24;
4038
- F.uLong = F.offset32 = F.prototype.parseULong;
4039
- F.uLongList = F.prototype.parseULongList;
4040
- F.fixed = F.prototype.parseFixed;
4041
- F.f2Dot14 = F.prototype.parseF2Dot14;
4042
- F.struct = F.prototype.parseStruct;
4043
- F.coverage = F.prototype.parseCoverage;
4044
- F.classDef = F.prototype.parseClassDef;
4035
+ T.tag = T.prototype.parseTag;
4036
+ T.byte = T.prototype.parseByte;
4037
+ T.uShort = T.offset16 = T.prototype.parseUShort;
4038
+ T.uShortList = T.prototype.parseUShortList;
4039
+ T.uInt24 = T.prototype.parseUInt24;
4040
+ T.uLong = T.offset32 = T.prototype.parseULong;
4041
+ T.uLongList = T.prototype.parseULongList;
4042
+ T.fixed = T.prototype.parseFixed;
4043
+ T.f2Dot14 = T.prototype.parseF2Dot14;
4044
+ T.struct = T.prototype.parseStruct;
4045
+ T.coverage = T.prototype.parseCoverage;
4046
+ T.classDef = T.prototype.parseClassDef;
4045
4047
  var Ms = {
4046
- reserved: F.uShort,
4047
- reqFeatureIndex: F.uShort,
4048
- featureIndexes: F.uShortList
4049
- };
4050
- F.prototype.parseScriptList = function() {
4051
- return this.parsePointer(F.recordList({
4052
- tag: F.tag,
4053
- script: F.pointer({
4054
- defaultLangSys: F.pointer(Ms),
4055
- langSysRecords: F.recordList({
4056
- tag: F.tag,
4057
- langSys: F.pointer(Ms)
4048
+ reserved: T.uShort,
4049
+ reqFeatureIndex: T.uShort,
4050
+ featureIndexes: T.uShortList
4051
+ };
4052
+ T.prototype.parseScriptList = function() {
4053
+ return this.parsePointer(T.recordList({
4054
+ tag: T.tag,
4055
+ script: T.pointer({
4056
+ defaultLangSys: T.pointer(Ms),
4057
+ langSysRecords: T.recordList({
4058
+ tag: T.tag,
4059
+ langSys: T.pointer(Ms)
4058
4060
  })
4059
4061
  })
4060
4062
  })) || [];
4061
4063
  };
4062
- F.prototype.parseFeatureList = function() {
4063
- return this.parsePointer(F.recordList({
4064
- tag: F.tag,
4065
- feature: F.pointer({
4066
- featureParams: F.offset16,
4067
- lookupListIndexes: F.uShortList
4064
+ T.prototype.parseFeatureList = function() {
4065
+ return this.parsePointer(T.recordList({
4066
+ tag: T.tag,
4067
+ feature: T.pointer({
4068
+ featureParams: T.offset16,
4069
+ lookupListIndexes: T.uShortList
4068
4070
  })
4069
4071
  })) || [];
4070
4072
  };
4071
- F.prototype.parseLookupList = function(t) {
4072
- return this.parsePointer(F.list(F.pointer(function() {
4073
+ T.prototype.parseLookupList = function(t) {
4074
+ return this.parsePointer(T.list(T.pointer(function() {
4073
4075
  const e = this.parseUShort();
4074
4076
  H.argument(1 <= e && e <= 9, "GPOS/GSUB lookup type " + e + " unknown.");
4075
4077
  const n = this.parseUShort(), r = n & 16;
4076
4078
  return {
4077
4079
  lookupType: e,
4078
4080
  lookupFlag: n,
4079
- subtables: this.parseList(F.pointer(t[e])),
4081
+ subtables: this.parseList(T.pointer(t[e])),
4080
4082
  markFilteringSet: r ? this.parseUShort() : void 0
4081
4083
  };
4082
4084
  }))) || [];
4083
4085
  };
4084
- F.prototype.parseFeatureVariationsList = function() {
4086
+ T.prototype.parseFeatureVariationsList = function() {
4085
4087
  return this.parsePointer32(function() {
4086
4088
  const t = this.parseUShort(), e = this.parseUShort();
4087
4089
  return H.argument(t === 1 && e < 1, "GPOS/GSUB feature variations table unknown."), this.parseRecordList32({
4088
- conditionSetOffset: F.offset32,
4089
- featureTableSubstitutionOffset: F.offset32
4090
+ conditionSetOffset: T.offset32,
4091
+ featureTableSubstitutionOffset: T.offset32
4090
4092
  });
4091
4093
  }) || [];
4092
4094
  };
4093
- F.prototype.parseVariationStore = function() {
4095
+ T.prototype.parseVariationStore = function() {
4094
4096
  const t = this.relativeOffset, e = this.parseUShort(), n = {
4095
4097
  itemVariationStore: this.parseItemVariationStore()
4096
4098
  };
4097
4099
  return this.relativeOffset = t + e + 2, n;
4098
4100
  };
4099
- F.prototype.parseItemVariationStore = function() {
4101
+ T.prototype.parseItemVariationStore = function() {
4100
4102
  const t = this.relativeOffset, e = {
4101
4103
  format: this.parseUShort(),
4102
4104
  variationRegions: [],
@@ -4109,24 +4111,24 @@ F.prototype.parseItemVariationStore = function() {
4109
4111
  }
4110
4112
  return e;
4111
4113
  };
4112
- F.prototype.parseVariationRegionList = function() {
4114
+ T.prototype.parseVariationRegionList = function() {
4113
4115
  const t = this.parseUShort(), e = this.parseUShort();
4114
4116
  return this.parseRecordList(e, {
4115
- regionAxes: F.recordList(t, {
4116
- startCoord: F.f2Dot14,
4117
- peakCoord: F.f2Dot14,
4118
- endCoord: F.f2Dot14
4117
+ regionAxes: T.recordList(t, {
4118
+ startCoord: T.f2Dot14,
4119
+ peakCoord: T.f2Dot14,
4120
+ endCoord: T.f2Dot14
4119
4121
  })
4120
4122
  });
4121
4123
  };
4122
- F.prototype.parseItemVariationSubtable = function() {
4124
+ T.prototype.parseItemVariationSubtable = function() {
4123
4125
  const t = this.parseUShort(), e = this.parseUShort(), n = this.parseUShortList(), r = n.length;
4124
4126
  return {
4125
4127
  regionIndexes: n,
4126
4128
  deltaSets: t && r ? this.parseDeltaSets(t, e, r) : []
4127
4129
  };
4128
4130
  };
4129
- F.prototype.parseDeltaSetIndexMap = function() {
4131
+ T.prototype.parseDeltaSetIndexMap = function() {
4130
4132
  const t = this.parseByte(), e = this.parseByte(), n = [];
4131
4133
  let r = 0;
4132
4134
  switch (t) {
@@ -4165,7 +4167,7 @@ F.prototype.parseDeltaSetIndexMap = function() {
4165
4167
  map: n
4166
4168
  };
4167
4169
  };
4168
- F.prototype.parseDeltaSets = function(t, e, n) {
4170
+ T.prototype.parseDeltaSets = function(t, e, n) {
4169
4171
  const r = Array.from({ length: t }, () => []), s = e & we.LONG_WORDS, i = e & we.WORD_DELTA_COUNT_MASK;
4170
4172
  if (i > n)
4171
4173
  throw Error("wordCount must be less than or equal to regionIndexCount");
@@ -4175,7 +4177,7 @@ F.prototype.parseDeltaSets = function(t, e, n) {
4175
4177
  l < i ? r[c].push(a()) : r[c].push(o());
4176
4178
  return r;
4177
4179
  };
4178
- F.prototype.parseTupleVariationStoreList = function(t, e, n) {
4180
+ T.prototype.parseTupleVariationStoreList = function(t, e, n) {
4179
4181
  const r = this.parseUShort(), i = this.parseUShort() & 1, a = this.parseOffset32(), o = (i ? this.parseULong : this.parseUShort).bind(this), c = {};
4180
4182
  let l = o();
4181
4183
  i || (l *= 2);
@@ -4193,7 +4195,7 @@ F.prototype.parseTupleVariationStoreList = function(t, e, n) {
4193
4195
  }
4194
4196
  return c;
4195
4197
  };
4196
- F.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
4198
+ T.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
4197
4199
  const i = this.relativeOffset;
4198
4200
  this.relativeOffset = t, n === "cvar" && (this.relativeOffset += 4);
4199
4201
  const a = this.parseUShort(), o = !!(a & we.SHARED_POINT_NUMBERS), c = a & we.COUNT_MASK;
@@ -4210,7 +4212,7 @@ F.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
4210
4212
  const m = u[y];
4211
4213
  m.privatePoints = [], this.relativeOffset = h, n === "cvar" && !m.peakTuple && console.warn("An embedded peak tuple is required in TupleVariationHeaders for the cvar table."), m.flags.privatePointNumbers && (m.privatePoints = this.parsePackedPointNumbers()), delete m.flags;
4212
4214
  const b = this.offset, v = this.relativeOffset, w = (C) => {
4213
- let T, E;
4215
+ let F, E;
4214
4216
  const R = () => {
4215
4217
  let P = 0;
4216
4218
  if (n === "gvar") {
@@ -4219,15 +4221,15 @@ F.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
4219
4221
  W.path, P = W.points.length, P += 4;
4220
4222
  }
4221
4223
  } else n === "cvar" && (P = r.length);
4222
- this.offset = b, this.relativeOffset = v, T = this.parsePackedDeltas(P), n === "gvar" && (E = this.parsePackedDeltas(P));
4224
+ this.offset = b, this.relativeOffset = v, F = this.parsePackedDeltas(P), n === "gvar" && (E = this.parsePackedDeltas(P));
4223
4225
  };
4224
4226
  return {
4225
4227
  configurable: !0,
4226
4228
  get: function() {
4227
- return T === void 0 && R(), C === "deltasY" ? E : T;
4229
+ return F === void 0 && R(), C === "deltasY" ? E : F;
4228
4230
  },
4229
4231
  set: function(P) {
4230
- T === void 0 && R(), C === "deltasY" ? E = P : T = P;
4232
+ F === void 0 && R(), C === "deltasY" ? E = P : F = P;
4231
4233
  }
4232
4234
  };
4233
4235
  };
@@ -4239,7 +4241,7 @@ F.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
4239
4241
  };
4240
4242
  return p.sharedPoints = f, p;
4241
4243
  };
4242
- F.prototype.parseTupleVariationHeader = function(t, e) {
4244
+ T.prototype.parseTupleVariationHeader = function(t, e) {
4243
4245
  const n = this.parseUShort(), r = this.parseUShort(), s = !!(r & we.EMBEDDED_PEAK_TUPLE), i = !!(r & we.INTERMEDIATE_REGION), a = !!(r & we.PRIVATE_POINT_NUMBERS), o = s ? void 0 : r & we.TUPLE_INDEX_MASK, c = s ? this.parseTupleRecords(1, t)[0] : void 0, l = i ? this.parseTupleRecords(1, t)[0] : void 0, u = i ? this.parseTupleRecords(1, t)[0] : void 0, f = {
4244
4246
  variationDataSize: n,
4245
4247
  peakTuple: c,
@@ -4253,7 +4255,7 @@ F.prototype.parseTupleVariationHeader = function(t, e) {
4253
4255
  };
4254
4256
  return e === "gvar" && (f.sharedTupleRecordsIndex = o), f;
4255
4257
  };
4256
- F.prototype.parsePackedPointNumbers = function() {
4258
+ T.prototype.parsePackedPointNumbers = function() {
4257
4259
  const t = this.parseByte(), e = [];
4258
4260
  let n = t;
4259
4261
  if (t >= 128) {
@@ -4271,7 +4273,7 @@ F.prototype.parsePackedPointNumbers = function() {
4271
4273
  }
4272
4274
  return e;
4273
4275
  };
4274
- F.prototype.parsePackedDeltas = function(t) {
4276
+ T.prototype.parsePackedDeltas = function(t) {
4275
4277
  const e = [];
4276
4278
  for (; e.length < t; ) {
4277
4279
  const n = this.parseByte(), r = !!(n & we.DELTAS_ARE_ZERO), s = !!(n & we.DELTAS_ARE_WORDS), i = (n & we.DELTA_RUN_COUNT_MASK) + 1;
@@ -4293,7 +4295,7 @@ var D = {
4293
4295
  getOffset: zc,
4294
4296
  getBytes: Wc,
4295
4297
  bytesToString: Vc,
4296
- Parser: F
4298
+ Parser: T
4297
4299
  }, Bn = [
4298
4300
  "copyright",
4299
4301
  // 0
@@ -5047,10 +5049,10 @@ function Zc(t, e, n) {
5047
5049
  if (v !== void 0 && b !== void 0 && w !== void 0) {
5048
5050
  let C;
5049
5051
  if (v === Rr ? C = Nt.UTF16(t, o + m, y) : C = Nt.MACSTRING(t, o + m, y, v), C) {
5050
- let T = r[w];
5051
- T === void 0 && (T = r[w] = {});
5052
- let E = T[p];
5053
- E === void 0 && (E = T[p] = {}), E[b] = C;
5052
+ let F = r[w];
5053
+ F === void 0 && (F = r[w] = {});
5054
+ let E = F[p];
5055
+ E === void 0 && (E = F[p] = {}), E[b] = C;
5054
5056
  }
5055
5057
  }
5056
5058
  }
@@ -5113,8 +5115,8 @@ function Qc(t, e) {
5113
5115
  const v = m[b];
5114
5116
  if (p === 1 || p === 0) {
5115
5117
  let w = r[b], C = jc[w];
5116
- const T = $r(p, C, w);
5117
- let E = B.MACSTRING(v, T);
5118
+ const F = $r(p, C, w);
5119
+ let E = B.MACSTRING(v, F);
5118
5120
  if (p === 0 && (w = e.indexOf(b), w < 0 && (w = e.length, e.push(b)), C = 4, E = B.UTF16(v)), E !== void 0) {
5119
5121
  const R = _s(E, a);
5120
5122
  i.push(Ds(
@@ -5130,14 +5132,14 @@ function Qc(t, e) {
5130
5132
  if (p === 3) {
5131
5133
  const w = s[b];
5132
5134
  if (w !== void 0) {
5133
- const C = B.UTF16(v), T = _s(C, a);
5135
+ const C = B.UTF16(v), F = _s(C, a);
5134
5136
  i.push(Ds(
5135
5137
  3,
5136
5138
  1,
5137
5139
  w,
5138
5140
  l,
5139
5141
  C.length,
5140
- T
5142
+ F
5141
5143
  ));
5142
5144
  }
5143
5145
  }
@@ -7085,7 +7087,7 @@ function ml(t, e, n, r, s) {
7085
7087
  }
7086
7088
  var vt = { line: ml };
7087
7089
  function yl(t, e) {
7088
- const n = new F(t, e), r = n.parseShort();
7090
+ const n = new T(t, e), r = n.parseShort();
7089
7091
  r !== 0 && console.warn("Only CPALv0 is currently fully supported.");
7090
7092
  const s = n.parseShort(), i = n.parseShort(), a = n.parseShort(), o = n.parseOffset32(), c = n.parseUShortList(i);
7091
7093
  n.relativeOffset = o;
@@ -7127,7 +7129,7 @@ function Xr(t, e, n = 0, r = "hexa") {
7127
7129
  const a = _a(s.colorRecords[i]);
7128
7130
  return r === "bgra" ? a : zt(a, r);
7129
7131
  }
7130
- function ze(t) {
7132
+ function We(t) {
7131
7133
  return ("0" + parseInt(t).toString(16)).slice(-2);
7132
7134
  }
7133
7135
  function xl(t) {
@@ -7169,7 +7171,7 @@ function vl(t) {
7169
7171
  };
7170
7172
  }
7171
7173
  function Ua(t) {
7172
- return parseInt(`0x${ze(t.b)}${ze(t.g)}${ze(t.r)}${ze(t.a * 255)}`, 16);
7174
+ return parseInt(`0x${We(t.b)}${We(t.g)}${We(t.r)}${We(t.a * 255)}`, 16);
7173
7175
  }
7174
7176
  function Dn(t, e = "hexa") {
7175
7177
  const n = e == "raw" || e == "cpal", r = Number.isInteger(t);
@@ -7268,11 +7270,11 @@ function zt(t, e = "hexa") {
7268
7270
  case "hex":
7269
7271
  case "hex6":
7270
7272
  case "hex-6":
7271
- return `#${ze(t.r)}${ze(t.g)}${ze(t.b)}`;
7273
+ return `#${We(t.r)}${We(t.g)}${We(t.b)}`;
7272
7274
  case "hexa":
7273
7275
  case "hex8":
7274
7276
  case "hex-8":
7275
- return `#${ze(t.r)}${ze(t.g)}${ze(t.b)}${ze(t.a * 255)}`;
7277
+ return `#${We(t.r)}${We(t.g)}${We(t.b)}${We(t.a * 255)}`;
7276
7278
  case "hsl":
7277
7279
  return `hsl(${n.h.toFixed(2)}, ${n.s.toFixed(2)}%, ${n.l.toFixed(2)}%)`;
7278
7280
  case "hsla":
@@ -7516,7 +7518,7 @@ function Cl(t, e, n, r, s, i) {
7516
7518
  }, Lt(a, "numberOfContours", "_numberOfContours"), Lt(a, "xMin", "_xMin"), Lt(a, "xMax", "_xMax"), Lt(a, "yMin", "_yMin"), Lt(a, "yMax", "_yMax"), Lt(a, "points", "_points"), a;
7517
7519
  };
7518
7520
  }
7519
- function Tl(t, e, n, r, s) {
7521
+ function Fl(t, e, n, r, s) {
7520
7522
  return function() {
7521
7523
  const i = new Qt({ index: e, font: t });
7522
7524
  return i.path = function() {
@@ -7525,7 +7527,7 @@ function Tl(t, e, n, r, s) {
7525
7527
  }, i;
7526
7528
  };
7527
7529
  }
7528
- var Je = { GlyphSet: zn, glyphLoader: wl, ttfGlyphLoader: Cl, cffGlyphLoader: Tl };
7530
+ var Qe = { GlyphSet: zn, glyphLoader: wl, ttfGlyphLoader: Cl, cffGlyphLoader: Fl };
7529
7531
  function Na(t, e) {
7530
7532
  if (t === e)
7531
7533
  return !0;
@@ -7544,7 +7546,7 @@ function _n(t) {
7544
7546
  let e;
7545
7547
  return t.length < 1240 ? e = 107 : t.length < 33900 ? e = 1131 : e = 32768, e;
7546
7548
  }
7547
- function $e(t, e, n, r) {
7549
+ function Ye(t, e, n, r) {
7548
7550
  const s = [], i = [], a = r > 1 ? D.getULong(t, e) : D.getCard16(t, e), o = r > 1 ? 4 : 2;
7549
7551
  let c, l;
7550
7552
  if (a !== 0) {
@@ -7562,7 +7564,7 @@ function $e(t, e, n, r) {
7562
7564
  }
7563
7565
  return { objects: i, startOffset: e, endOffset: l };
7564
7566
  }
7565
- function Fl(t, e, n) {
7567
+ function Tl(t, e, n) {
7566
7568
  const r = [], s = n > 1 ? D.getULong(t, e) : D.getCard16(t, e), i = n > 1 ? 4 : 2;
7567
7569
  let a, o;
7568
7570
  if (s !== 0) {
@@ -7757,7 +7759,7 @@ function _l(t, e, n) {
7757
7759
  if (o !== 0 && c !== 0) {
7758
7760
  const l = Jr(t, c + e, o, [], 2);
7759
7761
  if (l.subrs) {
7760
- const u = c + l.subrs, f = $e(t, u + e, void 0, 2);
7762
+ const u = c + l.subrs, f = Ye(t, u + e, void 0, 2);
7761
7763
  a._subrs = f.objects, a._subrsBias = _n(a._subrs);
7762
7764
  }
7763
7765
  a._privateDict = l;
@@ -7775,7 +7777,7 @@ function Qn(t, e, n, r, s) {
7775
7777
  if (l !== 0 && u !== 0) {
7776
7778
  const f = Jr(t, u + e, l, r, s);
7777
7779
  if (c._defaultWidthX = f.defaultWidthX, c._nominalWidthX = f.nominalWidthX, f.subrs !== 0) {
7778
- const h = u + f.subrs, p = $e(t, h + e, void 0, s);
7780
+ const h = u + f.subrs, p = Ye(t, h + e, void 0, s);
7779
7781
  c._subrs = p.objects, c._subrsBias = _n(c._subrs);
7780
7782
  }
7781
7783
  c._privateDict = f;
@@ -7839,13 +7841,13 @@ function za(t, e) {
7839
7841
  function Mr(t, e, n, r, s) {
7840
7842
  let i, a, o, c;
7841
7843
  const l = new Pt(), u = [];
7842
- let f = 0, h = !1, p = !1, y = 0, m = 0, b, v, w, C, T = 0, E = [], R, P = 0;
7844
+ let f = 0, h = !1, p = !1, y = 0, m = 0, b, v, w, C, F = 0, E = [], R, P = 0;
7843
7845
  const W = t.tables.cff2 || t.tables.cff;
7844
7846
  if (w = W.topDict._defaultWidthX, C = W.topDict._nominalWidthX, s = s || t.variation && t.variation.get(), e.getBlendPath || (e.getBlendPath = function(M) {
7845
7847
  return Mr(t, e, n, r, M);
7846
7848
  }), t.isCIDFont || r > 1) {
7847
7849
  const M = W.topDict._fdSelect ? W.topDict._fdSelect[e.index] : 0, _ = W.topDict._fdArray[M];
7848
- b = _._subrs, v = _._subrsBias, r > 1 ? (E = W.topDict._vstore.itemVariationStore, T = _._privateDict.vsindex) : (w = _._defaultWidthX, C = _._nominalWidthX);
7850
+ b = _._subrs, v = _._subrsBias, r > 1 ? (E = W.topDict._vstore.itemVariationStore, F = _._privateDict.vsindex) : (w = _._defaultWidthX, C = _._nominalWidthX);
7849
7851
  } else
7850
7852
  b = W.topDict._subrs, v = W.topDict._subrsBias;
7851
7853
  const j = za(t, l);
@@ -7858,7 +7860,7 @@ function Mr(t, e, n, r, s) {
7858
7860
  M = (u.length & 1) !== 0, M && !h && (N = u.shift() + C), f += u.length >> 1, u.length = 0, h = !0;
7859
7861
  }
7860
7862
  function U(M) {
7861
- let _, re, Te, Qe, _e, me, Y, ne, pe, be, ge, ye, ce = 0;
7863
+ let _, re, Fe, et, _e, me, Y, ne, pe, be, ge, ye, ce = 0;
7862
7864
  for (; ce < M.length; ) {
7863
7865
  let ve = M[ce];
7864
7866
  switch (ce += 1, ve) {
@@ -7926,10 +7928,10 @@ function Mr(t, e, n, r, s) {
7926
7928
  break;
7927
7929
  }
7928
7930
  if (u.length >= 4) {
7929
- const et = Br[u.pop()], x = Br[u.pop()], d = u.pop(), g = u.pop();
7930
- if (et && x) {
7931
+ const tt = Br[u.pop()], x = Br[u.pop()], d = u.pop(), g = u.pop();
7932
+ if (tt && x) {
7931
7933
  e.isComposite = !0, e.components = [];
7932
- const S = t.cffEncoding.charset.indexOf(et), k = t.cffEncoding.charset.indexOf(x);
7934
+ const S = t.cffEncoding.charset.indexOf(tt), k = t.cffEncoding.charset.indexOf(x);
7933
7935
  e.components.push({
7934
7936
  glyphIndex: k,
7935
7937
  dx: 0,
@@ -7954,21 +7956,21 @@ function Mr(t, e, n, r, s) {
7954
7956
  console.error("CFF2 CharString operator vsindex (15) is not supported in CFF");
7955
7957
  break;
7956
7958
  }
7957
- T = u.pop();
7959
+ F = u.pop();
7958
7960
  break;
7959
7961
  case 16:
7960
7962
  if (r < 2) {
7961
7963
  console.error("CFF2 CharString operator blend (16) is not supported in CFF");
7962
7964
  break;
7963
7965
  }
7964
- R || (R = t.variation && s && t.variation.process.getBlendVector(E, T, s));
7965
- var Z = u.pop(), xe = R ? R.length : E.itemVariationSubtables[T].regionIndexes.length, Ee = Z * xe, Ae = u.length - Ee, Oe = Ae - Z;
7966
+ R || (R = t.variation && s && t.variation.process.getBlendVector(E, F, s));
7967
+ var Z = u.pop(), xe = R ? R.length : E.itemVariationSubtables[F].regionIndexes.length, Ee = Z * xe, Ae = u.length - Ee, Oe = Ae - Z;
7966
7968
  if (R)
7967
- for (let et = 0; et < Z; et++) {
7968
- var Re = u[Oe + et];
7969
+ for (let tt = 0; tt < Z; tt++) {
7970
+ var Re = u[Oe + tt];
7969
7971
  for (let x = 0; x < xe; x++)
7970
7972
  Re += R[x] * u[Ae++];
7971
- u[Oe + et] = Re;
7973
+ u[Oe + tt] = Re;
7972
7974
  }
7973
7975
  for (; Ee--; )
7974
7976
  u.pop();
@@ -8028,15 +8030,15 @@ function Mr(t, e, n, r, s) {
8028
8030
  i = y, a = m + u.shift(), o = i + u.shift(), c = a + u.shift(), y = o + u.shift(), m = c + (u.length === 1 ? u.shift() : 0), l.curveTo(i, a, o, c, y, m);
8029
8031
  break;
8030
8032
  default:
8031
- ve < 32 ? console.log("Glyph " + e.index + ": unknown operator " + ve) : ve < 247 ? u.push(ve - 139) : ve < 251 ? (_ = M[ce], ce += 1, u.push((ve - 247) * 256 + _ + 108)) : ve < 255 ? (_ = M[ce], ce += 1, u.push(-(ve - 251) * 256 - _ - 108)) : (_ = M[ce], re = M[ce + 1], Te = M[ce + 2], Qe = M[ce + 3], ce += 4, u.push((_ << 24 | re << 16 | Te << 8 | Qe) / 65536));
8033
+ ve < 32 ? console.log("Glyph " + e.index + ": unknown operator " + ve) : ve < 247 ? u.push(ve - 139) : ve < 251 ? (_ = M[ce], ce += 1, u.push((ve - 247) * 256 + _ + 108)) : ve < 255 ? (_ = M[ce], ce += 1, u.push(-(ve - 251) * 256 - _ - 108)) : (_ = M[ce], re = M[ce + 1], Fe = M[ce + 2], et = M[ce + 3], ce += 4, u.push((_ << 24 | re << 16 | Fe << 8 | et) / 65536));
8032
8034
  }
8033
8035
  }
8034
8036
  }
8035
8037
  return U(n), t.variation && s && (l.commands = l.commands.map((M) => {
8036
8038
  const _ = Object.keys(M);
8037
8039
  for (let re = 0; re < _.length; re++) {
8038
- const Te = _[re];
8039
- Te !== "type" && (M[Te] = Math.round(M[Te]));
8040
+ const Fe = _[re];
8041
+ Fe !== "type" && (M[Fe] = Math.round(M[Fe]));
8040
8042
  }
8041
8043
  return M;
8042
8044
  })), h && (e.advanceWidth = N), l;
@@ -8076,7 +8078,7 @@ function Gl(t, e, n, r) {
8076
8078
  let s;
8077
8079
  const i = Ll(t, e);
8078
8080
  i.formatMajor === 2 ? s = n.tables.cff2 = {} : s = n.tables.cff = {};
8079
- const a = i.formatMajor > 1 ? null : $e(t, i.endOffset, D.bytesToString), o = i.formatMajor > 1 ? null : $e(t, a.endOffset), c = i.formatMajor > 1 ? null : $e(t, o.endOffset, D.bytesToString), l = $e(t, i.formatMajor > 1 ? e + i.size + i.topDictLength : c.endOffset, void 0, i.formatMajor);
8081
+ const a = i.formatMajor > 1 ? null : Ye(t, i.endOffset, D.bytesToString), o = i.formatMajor > 1 ? null : Ye(t, a.endOffset), c = i.formatMajor > 1 ? null : Ye(t, o.endOffset, D.bytesToString), l = Ye(t, i.formatMajor > 1 ? e + i.size + i.topDictLength : c.endOffset, void 0, i.formatMajor);
8080
8082
  n.gsubrs = l.objects, n.gsubrsBias = _n(n.gsubrs);
8081
8083
  let u;
8082
8084
  if (i.formatMajor > 1) {
@@ -8092,38 +8094,38 @@ function Gl(t, e, n, r) {
8092
8094
  let h = u.fdArray, p = u.fdSelect;
8093
8095
  if (!h)
8094
8096
  throw new Error("This is a CFF2 font, but FDArray information is missing");
8095
- const y = $e(t, e + h, null, i.formatMajor), m = _l(t, e, y.objects);
8097
+ const y = Ye(t, e + h, null, i.formatMajor), m = _l(t, e, y.objects);
8096
8098
  u._fdArray = m, p && (u._fdSelect = Ps(t, e + p, n.numGlyphs, m.length, i.formatMajor));
8097
8099
  } else if (n.isCIDFont) {
8098
8100
  let h = u.fdArray, p = u.fdSelect;
8099
8101
  if (h === 0 || p === 0)
8100
8102
  throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
8101
8103
  h += e;
8102
- const y = $e(t, h), m = Qn(t, e, y.objects, c.objects, i.formatMajor);
8104
+ const y = Ye(t, h), m = Qn(t, e, y.objects, c.objects, i.formatMajor);
8103
8105
  u._fdArray = m, p += e, u._fdSelect = Ps(t, p, n.numGlyphs, m.length, i.formatMajor);
8104
8106
  }
8105
8107
  if (i.formatMajor < 2) {
8106
8108
  const h = e + u.private[1], p = Jr(t, h, u.private[0], c.objects, i.formatMajor);
8107
8109
  if (n.defaultWidthX = p.defaultWidthX, n.nominalWidthX = p.nominalWidthX, p.subrs !== 0) {
8108
- const y = h + p.subrs, m = $e(t, y);
8110
+ const y = h + p.subrs, m = Ye(t, y);
8109
8111
  n.subrs = m.objects, n.subrsBias = _n(n.subrs);
8110
8112
  } else
8111
8113
  n.subrs = [], n.subrsBias = 0;
8112
8114
  }
8113
8115
  let f;
8114
- if (r.lowMemory ? (f = Fl(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) {
8116
+ if (r.lowMemory ? (f = Tl(t, e + u.charStrings, i.formatMajor), n.nGlyphs = f.offsets.length - (i.formatMajor > 1 ? 1 : 0)) : (f = Ye(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) {
8115
8117
  let h = [], p = [];
8116
8118
  u.charset === 0 ? h = ll : u.charset === 1 ? h = ul : u.charset === 2 ? h = hl : h = Ul(t, e + u.charset, n.nGlyphs, c.objects, n.isCIDFont), u.encoding === 0 ? p = Br : u.encoding === 1 ? p = fl : p = Pl(t, e + u.encoding), n.cffEncoding = new Da(p, h), n.encoding = n.encoding || n.cffEncoding;
8117
8119
  }
8118
- if (n.glyphs = new Je.GlyphSet(n), r.lowMemory)
8120
+ if (n.glyphs = new Qe.GlyphSet(n), r.lowMemory)
8119
8121
  n._push = function(h) {
8120
8122
  const p = kl(h, f.offsets, t, e + u.charStrings, void 0, i.formatMajor);
8121
- n.glyphs.push(h, Je.cffGlyphLoader(n, h, Mr, p, i.formatMajor));
8123
+ n.glyphs.push(h, Qe.cffGlyphLoader(n, h, Mr, p, i.formatMajor));
8122
8124
  };
8123
8125
  else
8124
8126
  for (let h = 0; h < n.nGlyphs; h += 1) {
8125
8127
  const p = f.objects[h];
8126
- n.glyphs.push(h, Je.cffGlyphLoader(n, h, Mr, p, i.formatMajor));
8128
+ n.glyphs.push(h, Qe.cffGlyphLoader(n, h, Mr, p, i.formatMajor));
8127
8129
  }
8128
8130
  if (u.vstore) {
8129
8131
  const h = new D.Parser(t, e + u.vstore);
@@ -8761,44 +8763,44 @@ function fu(t) {
8761
8763
  { name: "maxMemType1", type: "ULONG", value: c }
8762
8764
  ]);
8763
8765
  }
8764
- var Ka = { parse: hu, make: fu }, We = new Array(9);
8765
- We[1] = function() {
8766
+ var Ka = { parse: hu, make: fu }, Ve = new Array(9);
8767
+ Ve[1] = function() {
8766
8768
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
8767
8769
  if (n === 1)
8768
8770
  return {
8769
8771
  substFormat: 1,
8770
- coverage: this.parsePointer(F.coverage),
8772
+ coverage: this.parsePointer(T.coverage),
8771
8773
  deltaGlyphId: this.parseShort()
8772
8774
  };
8773
8775
  if (n === 2)
8774
8776
  return {
8775
8777
  substFormat: 2,
8776
- coverage: this.parsePointer(F.coverage),
8778
+ coverage: this.parsePointer(T.coverage),
8777
8779
  substitute: this.parseOffset16List()
8778
8780
  };
8779
8781
  H.assert(!1, "0x" + e.toString(16) + ": lookup type 1 format must be 1 or 2.");
8780
8782
  };
8781
- We[2] = function() {
8783
+ Ve[2] = function() {
8782
8784
  const e = this.parseUShort();
8783
8785
  return H.argument(e === 1, "GSUB Multiple Substitution Subtable identifier-format must be 1"), {
8784
8786
  substFormat: e,
8785
- coverage: this.parsePointer(F.coverage),
8787
+ coverage: this.parsePointer(T.coverage),
8786
8788
  sequences: this.parseListOfLists()
8787
8789
  };
8788
8790
  };
8789
- We[3] = function() {
8791
+ Ve[3] = function() {
8790
8792
  const e = this.parseUShort();
8791
8793
  return H.argument(e === 1, "GSUB Alternate Substitution Subtable identifier-format must be 1"), {
8792
8794
  substFormat: e,
8793
- coverage: this.parsePointer(F.coverage),
8795
+ coverage: this.parsePointer(T.coverage),
8794
8796
  alternateSets: this.parseListOfLists()
8795
8797
  };
8796
8798
  };
8797
- We[4] = function() {
8799
+ Ve[4] = function() {
8798
8800
  const e = this.parseUShort();
8799
8801
  return H.argument(e === 1, "GSUB ligature table identifier-format must be 1"), {
8800
8802
  substFormat: e,
8801
- coverage: this.parsePointer(F.coverage),
8803
+ coverage: this.parsePointer(T.coverage),
8802
8804
  ligatureSets: this.parseListOfLists(function() {
8803
8805
  return {
8804
8806
  ligGlyph: this.parseUShort(),
@@ -8808,15 +8810,15 @@ We[4] = function() {
8808
8810
  };
8809
8811
  };
8810
8812
  var Mt = {
8811
- sequenceIndex: F.uShort,
8812
- lookupListIndex: F.uShort
8813
+ sequenceIndex: T.uShort,
8814
+ lookupListIndex: T.uShort
8813
8815
  };
8814
- We[5] = function() {
8816
+ Ve[5] = function() {
8815
8817
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
8816
8818
  if (n === 1)
8817
8819
  return {
8818
8820
  substFormat: n,
8819
- coverage: this.parsePointer(F.coverage),
8821
+ coverage: this.parsePointer(T.coverage),
8820
8822
  ruleSets: this.parseListOfLists(function() {
8821
8823
  const r = this.parseUShort(), s = this.parseUShort();
8822
8824
  return {
@@ -8828,8 +8830,8 @@ We[5] = function() {
8828
8830
  if (n === 2)
8829
8831
  return {
8830
8832
  substFormat: n,
8831
- coverage: this.parsePointer(F.coverage),
8832
- classDef: this.parsePointer(F.classDef),
8833
+ coverage: this.parsePointer(T.coverage),
8834
+ classDef: this.parsePointer(T.classDef),
8833
8835
  classSets: this.parseListOfLists(function() {
8834
8836
  const r = this.parseUShort(), s = this.parseUShort();
8835
8837
  return {
@@ -8842,18 +8844,18 @@ We[5] = function() {
8842
8844
  const r = this.parseUShort(), s = this.parseUShort();
8843
8845
  return {
8844
8846
  substFormat: n,
8845
- coverages: this.parseList(r, F.pointer(F.coverage)),
8847
+ coverages: this.parseList(r, T.pointer(T.coverage)),
8846
8848
  lookupRecords: this.parseRecordList(s, Mt)
8847
8849
  };
8848
8850
  }
8849
8851
  H.assert(!1, "0x" + e.toString(16) + ": lookup type 5 format must be 1, 2 or 3.");
8850
8852
  };
8851
- We[6] = function() {
8853
+ Ve[6] = function() {
8852
8854
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
8853
8855
  if (n === 1)
8854
8856
  return {
8855
8857
  substFormat: 1,
8856
- coverage: this.parsePointer(F.coverage),
8858
+ coverage: this.parsePointer(T.coverage),
8857
8859
  chainRuleSets: this.parseListOfLists(function() {
8858
8860
  return {
8859
8861
  backtrack: this.parseUShortList(),
@@ -8866,10 +8868,10 @@ We[6] = function() {
8866
8868
  if (n === 2)
8867
8869
  return {
8868
8870
  substFormat: 2,
8869
- coverage: this.parsePointer(F.coverage),
8870
- backtrackClassDef: this.parsePointer(F.classDef),
8871
- inputClassDef: this.parsePointer(F.classDef),
8872
- lookaheadClassDef: this.parsePointer(F.classDef),
8871
+ coverage: this.parsePointer(T.coverage),
8872
+ backtrackClassDef: this.parsePointer(T.classDef),
8873
+ inputClassDef: this.parsePointer(T.classDef),
8874
+ lookaheadClassDef: this.parsePointer(T.classDef),
8873
8875
  chainClassSet: this.parseListOfLists(function() {
8874
8876
  return {
8875
8877
  backtrack: this.parseUShortList(),
@@ -8882,46 +8884,46 @@ We[6] = function() {
8882
8884
  if (n === 3)
8883
8885
  return {
8884
8886
  substFormat: 3,
8885
- backtrackCoverage: this.parseList(F.pointer(F.coverage)),
8886
- inputCoverage: this.parseList(F.pointer(F.coverage)),
8887
- lookaheadCoverage: this.parseList(F.pointer(F.coverage)),
8887
+ backtrackCoverage: this.parseList(T.pointer(T.coverage)),
8888
+ inputCoverage: this.parseList(T.pointer(T.coverage)),
8889
+ lookaheadCoverage: this.parseList(T.pointer(T.coverage)),
8888
8890
  lookupRecords: this.parseRecordList(Mt)
8889
8891
  };
8890
8892
  H.assert(!1, "0x" + e.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
8891
8893
  };
8892
- We[7] = function() {
8894
+ Ve[7] = function() {
8893
8895
  const e = this.parseUShort();
8894
8896
  H.argument(e === 1, "GSUB Extension Substitution subtable identifier-format must be 1");
8895
- const n = this.parseUShort(), r = new F(this.data, this.offset + this.parseULong());
8897
+ const n = this.parseUShort(), r = new T(this.data, this.offset + this.parseULong());
8896
8898
  return {
8897
8899
  substFormat: 1,
8898
8900
  lookupType: n,
8899
- extension: We[n].call(r)
8901
+ extension: Ve[n].call(r)
8900
8902
  };
8901
8903
  };
8902
- We[8] = function() {
8904
+ Ve[8] = function() {
8903
8905
  const e = this.parseUShort();
8904
8906
  return H.argument(e === 1, "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"), {
8905
8907
  substFormat: e,
8906
- coverage: this.parsePointer(F.coverage),
8907
- backtrackCoverage: this.parseList(F.pointer(F.coverage)),
8908
- lookaheadCoverage: this.parseList(F.pointer(F.coverage)),
8908
+ coverage: this.parsePointer(T.coverage),
8909
+ backtrackCoverage: this.parseList(T.pointer(T.coverage)),
8910
+ lookaheadCoverage: this.parseList(T.pointer(T.coverage)),
8909
8911
  substitutes: this.parseUShortList()
8910
8912
  };
8911
8913
  };
8912
8914
  function pu(t, e) {
8913
8915
  e = e || 0;
8914
- const n = new F(t, e), r = n.parseVersion(1);
8916
+ const n = new T(t, e), r = n.parseVersion(1);
8915
8917
  return H.argument(r === 1 || r === 1.1, "Unsupported GSUB table version."), r === 1 ? {
8916
8918
  version: r,
8917
8919
  scripts: n.parseScriptList(),
8918
8920
  features: n.parseFeatureList(),
8919
- lookups: n.parseLookupList(We)
8921
+ lookups: n.parseLookupList(Ve)
8920
8922
  } : {
8921
8923
  version: r,
8922
8924
  scripts: n.parseScriptList(),
8923
8925
  features: n.parseFeatureList(),
8924
- lookups: n.parseLookupList(We),
8926
+ lookups: n.parseLookupList(Ve),
8925
8927
  variations: n.parseFeatureVariationsList()
8926
8928
  };
8927
8929
  }
@@ -9101,19 +9103,19 @@ function mu(t) {
9101
9103
  }
9102
9104
  var Ja = { parse: gu, make: mu };
9103
9105
  function yu(t, e) {
9104
- const n = new F(t, e), r = n.parseUShort();
9106
+ const n = new T(t, e), r = n.parseUShort();
9105
9107
  r !== 0 && console.warn("Only COLRv0 is currently fully supported. A subset of color glyphs might be available in this font if provided in the v0 format.");
9106
9108
  const s = n.parseUShort(), i = n.parseOffset32(), a = n.parseOffset32(), o = n.parseUShort();
9107
9109
  n.relativeOffset = i;
9108
9110
  const c = n.parseRecordList(s, {
9109
- glyphID: F.uShort,
9110
- firstLayerIndex: F.uShort,
9111
- numLayers: F.uShort
9111
+ glyphID: T.uShort,
9112
+ firstLayerIndex: T.uShort,
9113
+ numLayers: T.uShort
9112
9114
  });
9113
9115
  n.relativeOffset = a;
9114
9116
  const l = n.parseRecordList(o, {
9115
- glyphID: F.uShort,
9116
- paletteIndex: F.uShort
9117
+ glyphID: T.uShort,
9118
+ paletteIndex: T.uShort
9117
9119
  });
9118
9120
  return {
9119
9121
  version: r,
@@ -9215,7 +9217,7 @@ function Cu(t, e) {
9215
9217
  ));
9216
9218
  return n;
9217
9219
  }
9218
- function Tu(t, e, n) {
9220
+ function Fu(t, e, n) {
9219
9221
  const r = new D.Parser(t, e), s = r.parseULong();
9220
9222
  H.argument(s === 65536, "Unsupported fvar table version.");
9221
9223
  const i = r.parseOffset16();
@@ -9228,10 +9230,10 @@ function Tu(t, e, n) {
9228
9230
  f.push(wu(t, h + p * l, u, n, l));
9229
9231
  return { axes: u, instances: f };
9230
9232
  }
9231
- var eo = { make: Cu, parse: Tu }, Fu = {
9232
- tag: F.tag,
9233
- nameID: F.uShort,
9234
- ordering: F.uShort
9233
+ var eo = { make: Cu, parse: Fu }, Tu = {
9234
+ tag: T.tag,
9235
+ nameID: T.uShort,
9236
+ ordering: T.uShort
9235
9237
  }, nn = new Array(5);
9236
9238
  nn[1] = function() {
9237
9239
  return {
@@ -9290,7 +9292,7 @@ function Eu(t, e, n) {
9290
9292
  n !== void 0 && H.argument(c >= n.axes.length, "STAT axis count must be greater than or equal to fvar axis count"), u > 0 && H.argument(c >= 0, "STAT axis count must be greater than 0 if STAT axis value count is greater than 0");
9291
9293
  const p = [];
9292
9294
  for (let b = 0; b < c; b++)
9293
- r.offset = e + l, r.relativeOffset = b * o, p.push(r.parseStruct(Fu));
9295
+ r.offset = e + l, r.relativeOffset = b * o, p.push(r.parseStruct(Tu));
9294
9296
  r.offset = e, r.relativeOffset = f;
9295
9297
  const y = r.parseUShortList(u), m = [];
9296
9298
  for (let b = 0; b < u; b++)
@@ -9422,7 +9424,7 @@ function Bu(t, e) {
9422
9424
  }
9423
9425
  function Mu(t, e, n) {
9424
9426
  e || (e = 0);
9425
- const r = new F(t, e), s = r.parseUShort(), i = r.parseUShort();
9427
+ const r = new T(t, e), s = r.parseUShort(), i = r.parseUShort();
9426
9428
  s !== 1 && console.warn(`Unsupported avar table version ${s}.${i}`), r.skip("uShort", 1);
9427
9429
  const a = r.parseUShort();
9428
9430
  H.argument(a === n.axes.length, "avar axis count must correspond to fvar axis count");
@@ -9501,7 +9503,7 @@ function Gu(t) {
9501
9503
  }
9502
9504
  var io = { parse: Nu, make: Gu };
9503
9505
  function Hu(t, e) {
9504
- const n = /* @__PURE__ */ new Map(), r = t.buffer, s = new F(t, e);
9506
+ const n = /* @__PURE__ */ new Map(), r = t.buffer, s = new T(t, e);
9505
9507
  if (s.parseUShort() !== 0) return n;
9506
9508
  s.relativeOffset = s.parseOffset32();
9507
9509
  const a = t.byteOffset + e + s.relativeOffset, o = s.parseUShort(), c = /* @__PURE__ */ new Map();
@@ -9682,7 +9684,7 @@ function Vu(t) {
9682
9684
  // Use space as the default character, if available.
9683
9685
  usBreakChar: t.hasChar(" ") ? 32 : 0
9684
9686
  // Use space as the break character, if available.
9685
- }, t.tables.os2)), T = $a.make(t.glyphs), E = Ra.make(t.glyphs), R = t.getEnglishName("fontFamily"), P = t.getEnglishName("fontSubfamily"), W = R + " " + P;
9687
+ }, t.tables.os2)), F = $a.make(t.glyphs), E = Ra.make(t.glyphs), R = t.getEnglishName("fontFamily"), P = t.getEnglishName("fontSubfamily"), W = R + " " + P;
9686
9688
  let j = t.getEnglishName("postScriptName");
9687
9689
  j || (j = R.replace(/\s/g, "") + "-" + P);
9688
9690
  const N = {};
@@ -9698,7 +9700,7 @@ function Vu(t) {
9698
9700
  N[Z].postScriptName || (N[Z].postScriptName = { en: j });
9699
9701
  }
9700
9702
  N.unicode.preferredFamily || (N.unicode.preferredFamily = X.fontFamily || ie.fontFamily || U.fontFamily), N.macintosh.preferredFamily || (N.macintosh.preferredFamily = ie.fontFamily || X.fontFamily || U.fontFamily), N.windows.preferredFamily || (N.windows.preferredFamily = U.fontFamily || X.fontFamily || ie.fontFamily), N.unicode.preferredSubfamily || (N.unicode.preferredSubfamily = X.fontSubfamily || ie.fontSubfamily || U.fontSubfamily), N.macintosh.preferredSubfamily || (N.macintosh.preferredSubfamily = ie.fontSubfamily || X.fontSubfamily || U.fontSubfamily), N.windows.preferredSubfamily || (N.windows.preferredSubfamily = U.fontSubfamily || X.fontSubfamily || ie.fontSubfamily);
9701
- const M = [], _ = Ia.make(N, M), re = M.length > 0 ? Ya.make(M) : void 0, Te = Ka.make(t), Qe = Dr.make(t.glyphs, {
9703
+ const M = [], _ = Ia.make(N, M), re = M.length > 0 ? Ya.make(M) : void 0, Fe = Ka.make(t), et = Dr.make(t.glyphs, {
9702
9704
  version: t.getEnglishName("version"),
9703
9705
  fullName: W,
9704
9706
  familyName: R,
@@ -9707,7 +9709,7 @@ function Vu(t) {
9707
9709
  unitsPerEm: t.unitsPerEm,
9708
9710
  fontBBox: [0, y.yMin, y.ascender, y.advanceWidthMax],
9709
9711
  topDict: t.tables.cff && t.tables.cff.topDict || {}
9710
- }), _e = t.metas && Object.keys(t.metas).length > 0 ? Ja.make(t.metas) : void 0, me = [b, v, w, C, _, E, Te, Qe, T];
9712
+ }), _e = t.metas && Object.keys(t.metas).length > 0 ? Ja.make(t.metas) : void 0, me = [b, v, w, C, _, E, Fe, et, F];
9711
9713
  re && me.push(re);
9712
9714
  const Y = {
9713
9715
  gsub: Za,
@@ -10895,18 +10897,18 @@ function fo(t, e) {
10895
10897
  return ts(e.points);
10896
10898
  }
10897
10899
  function uh(t, e, n, r) {
10898
- const s = new Je.GlyphSet(r);
10900
+ const s = new Qe.GlyphSet(r);
10899
10901
  for (let i = 0; i < n.length - 1; i += 1) {
10900
10902
  const a = n[i], o = n[i + 1];
10901
- a !== o ? s.push(i, Je.ttfGlyphLoader(r, i, ho, t, e + a, fo)) : s.push(i, Je.glyphLoader(r, i));
10903
+ a !== o ? s.push(i, Qe.ttfGlyphLoader(r, i, ho, t, e + a, fo)) : s.push(i, Qe.glyphLoader(r, i));
10902
10904
  }
10903
10905
  return s;
10904
10906
  }
10905
10907
  function hh(t, e, n, r) {
10906
- const s = new Je.GlyphSet(r);
10908
+ const s = new Qe.GlyphSet(r);
10907
10909
  return r._push = function(i) {
10908
10910
  const a = n[i], o = n[i + 1];
10909
- a !== o ? s.push(i, Je.ttfGlyphLoader(r, i, ho, t, e + a, fo)) : s.push(i, Je.glyphLoader(r, i));
10911
+ a !== o ? s.push(i, Qe.ttfGlyphLoader(r, i, ho, t, e + a, fo)) : s.push(i, Qe.glyphLoader(r, i));
10910
10912
  }, s;
10911
10913
  }
10912
10914
  function fh(t, e, n, r, s) {
@@ -11356,7 +11358,7 @@ var po = { getPath: ts, parse: fh }, ph = class {
11356
11358
  hvar() {
11357
11359
  return this.font.tables.hvar;
11358
11360
  }
11359
- }, Ys = 1e6, Un = 64, Pn = 1e4, go, Ft, mo, Pr;
11361
+ }, Ys = 1e6, Un = 64, Pn = 1e4, go, Tt, mo, Pr;
11360
11362
  function yo(t) {
11361
11363
  this.font = t, this.getCommands = function(e) {
11362
11364
  return po.getPath(e).commands;
@@ -11386,7 +11388,7 @@ var xo = function(t) {
11386
11388
  const r = this.srThreshold;
11387
11389
  let s = 1;
11388
11390
  return t < 0 && (t = -t, s = -1), t += r - n, t = Math.trunc(t / e) * e, t += n, t < 0 ? n * s : t * s;
11389
- }, Ze = {
11391
+ }, Je = {
11390
11392
  x: 1,
11391
11393
  y: 0,
11392
11394
  axis: "x",
@@ -11411,10 +11413,10 @@ var xo = function(t) {
11411
11413
  return;
11412
11414
  }
11413
11415
  if (s = r.distance(t, e, !0, !0), i = r.distance(t, n, !0, !0), c = r.distance(e, e, !1, !0), l = r.distance(n, n, !1, !0), a = Math.abs(s), o = Math.abs(i), u = a + o, u === 0) {
11414
- Ze.setRelative(t, t, (c + l) / 2, r, !0);
11416
+ Je.setRelative(t, t, (c + l) / 2, r, !0);
11415
11417
  return;
11416
11418
  }
11417
- Ze.setRelative(t, t, (c * o + l * a) / u, r, !0);
11419
+ Je.setRelative(t, t, (c * o + l * a) / u, r, !0);
11418
11420
  },
11419
11421
  // Slope of line normal to this
11420
11422
  normalSlope: Number.NEGATIVE_INFINITY,
@@ -11515,13 +11517,13 @@ var xo = function(t) {
11515
11517
  t.yTouched = !1;
11516
11518
  }
11517
11519
  };
11518
- Object.freeze(Ze);
11520
+ Object.freeze(Je);
11519
11521
  Object.freeze(it);
11520
11522
  function an(t, e) {
11521
11523
  this.x = t, this.y = e, this.axis = void 0, this.slope = e / t, this.normalSlope = -t / e, Object.freeze(this);
11522
11524
  }
11523
11525
  an.prototype.distance = function(t, e, n, r) {
11524
- return this.x * Ze.distance(t, e, n, r) + this.y * it.distance(t, e, n, r);
11526
+ return this.x * Je.distance(t, e, n, r) + this.y * it.distance(t, e, n, r);
11525
11527
  };
11526
11528
  an.prototype.interpolate = function(t, e, n, r) {
11527
11529
  let s, i, a, o, c, l, u;
@@ -11541,7 +11543,7 @@ an.prototype.touch = function(t) {
11541
11543
  };
11542
11544
  function on(t, e) {
11543
11545
  const n = Math.sqrt(t * t + e * e);
11544
- return t /= n, e /= n, t === 1 && e === 0 ? Ze : t === 0 && e === 1 ? it : new an(t, e);
11546
+ return t /= n, e /= n, t === 1 && e === 0 ? Je : t === 0 && e === 1 ? it : new an(t, e);
11545
11547
  }
11546
11548
  function at(t, e, n, r) {
11547
11549
  this.x = this.xo = Math.round(t * 64) / 64, this.y = this.yo = Math.round(e * 64) / 64, this.lastPointOfContour = n, this.onCurve = r, this.prevPointOnContour = void 0, this.nextPointOnContour = void 0, this.xTouched = !1, this.yTouched = !1, Object.preventExtensions(this);
@@ -11572,7 +11574,7 @@ function pt(t, e) {
11572
11574
  case "glyf":
11573
11575
  this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
11574
11576
  case "prep":
11575
- this.fv = this.pv = this.dpv = Ze, this.round = bo;
11577
+ this.fv = this.pv = this.dpv = Je, this.round = bo;
11576
11578
  }
11577
11579
  }
11578
11580
  yo.prototype.exec = function(t, e) {
@@ -11586,7 +11588,7 @@ yo.prototype.exec = function(t, e) {
11586
11588
  if (!s) {
11587
11589
  pt.prototype = vh, s = this._fpgmState = new pt("fpgm", n.tables.fpgm), s.funcs = [], s.font = n, s.instructionCount = 0, s.callDepth = 0;
11588
11590
  try {
11589
- Ft(s);
11591
+ Tt(s);
11590
11592
  } catch (a) {
11591
11593
  console.log("Hinting error in FPGM:" + a), this._errorState = 3;
11592
11594
  return;
@@ -11601,7 +11603,7 @@ yo.prototype.exec = function(t, e) {
11601
11603
  } else
11602
11604
  r.cvt = [];
11603
11605
  try {
11604
- Ft(r);
11606
+ Tt(r);
11605
11607
  } catch (a) {
11606
11608
  this._errorState < 2 && console.log("Hinting error in PREP:" + a), this._errorState = 2;
11607
11609
  }
@@ -11638,7 +11640,7 @@ mo = function(t, e) {
11638
11640
  t.instructions && !o.inhibitGridFit && (o = new pt("glyf", t.instructions), o.gZone = o.z0 = o.z1 = o.z2 = a, o.contours = i, a.push(
11639
11641
  new at(0, 0),
11640
11642
  new at(Math.round(t.advanceWidth * n), 0)
11641
- ), Ft(o), a.length -= 2);
11643
+ ), Tt(o), a.length -= 2);
11642
11644
  }
11643
11645
  return a;
11644
11646
  };
@@ -11658,9 +11660,9 @@ Pr = function(t, e, n, r) {
11658
11660
  e.inhibitGridFit || (a.push(
11659
11661
  new at(0, 0),
11660
11662
  new at(Math.round(t.advanceWidth * n), 0)
11661
- ), Ft(e), a.length -= 2);
11663
+ ), Tt(e), a.length -= 2);
11662
11664
  };
11663
- Ft = function(t) {
11665
+ Tt = function(t) {
11664
11666
  let e = t.prog;
11665
11667
  if (!e) return;
11666
11668
  const n = e.length;
@@ -11734,16 +11736,16 @@ function Ch(t) {
11734
11736
  const e = t.stack, n = t.pv;
11735
11737
  e.push(n.x * 16384), e.push(n.y * 16384);
11736
11738
  }
11737
- function Th(t) {
11739
+ function Fh(t) {
11738
11740
  const e = t.stack, n = t.fv;
11739
11741
  e.push(n.x * 16384), e.push(n.y * 16384);
11740
11742
  }
11741
- function Fh(t) {
11743
+ function Th(t) {
11742
11744
  t.fv = t.pv;
11743
11745
  }
11744
11746
  function kh(t) {
11745
- 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, m = 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) - (m - v) * (w - T), P = y * v - m * b, W = w * E - C * T;
11746
- p.x = (P * (w - T) - W * (y - b)) / R, p.y = (P * (C - E) - W * (m - v)) / R;
11747
+ 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, m = l.y, b = u.x, v = u.y, w = f.x, C = f.y, F = h.x, E = h.y, R = (y - b) * (C - E) - (m - v) * (w - F), P = y * v - m * b, W = w * E - C * F;
11748
+ p.x = (P * (w - F) - W * (y - b)) / R, p.y = (P * (C - E) - W * (m - v)) / R;
11747
11749
  }
11748
11750
  function Eh(t) {
11749
11751
  t.rp0 = t.stack.pop();
@@ -11856,7 +11858,7 @@ function qh(t) {
11856
11858
  const s = t.ip, i = t.prog;
11857
11859
  t.prog = t.funcs[n];
11858
11860
  for (let a = 0; a < r; a++)
11859
- Ft(t);
11861
+ Tt(t);
11860
11862
  t.ip = s, t.prog = i, t.callDepth--;
11861
11863
  }
11862
11864
  function jh(t) {
@@ -11864,7 +11866,7 @@ function jh(t) {
11864
11866
  if (++t.callDepth > Un)
11865
11867
  throw new Error("Hinting call depth exceeded maximum of " + Un);
11866
11868
  const n = t.ip, r = t.prog;
11867
- t.prog = t.funcs[e], Ft(t), t.ip = n, t.prog = r, t.callDepth--;
11869
+ t.prog = t.funcs[e], Tt(t), t.ip = n, t.prog = r, t.callDepth--;
11868
11870
  }
11869
11871
  function $h(t) {
11870
11872
  const e = t.stack, n = e.pop();
@@ -12088,11 +12090,11 @@ function Cf(t) {
12088
12090
  const n = t.stack.pop();
12089
12091
  t.deltaShift = Math.pow(0.5, n);
12090
12092
  }
12091
- function Tf(t) {
12093
+ function Ff(t) {
12092
12094
  const e = t.stack, n = e.pop(), r = e.pop();
12093
12095
  e.push(r + n);
12094
12096
  }
12095
- function Ff(t) {
12097
+ function Tf(t) {
12096
12098
  const e = t.stack, n = e.pop(), r = e.pop();
12097
12099
  e.push(r - n);
12098
12100
  }
@@ -12285,15 +12287,15 @@ go = [
12285
12287
  /* 0x00 */
12286
12288
  Xs.bind(void 0, it),
12287
12289
  /* 0x01 */
12288
- Xs.bind(void 0, Ze),
12290
+ Xs.bind(void 0, Je),
12289
12291
  /* 0x02 */
12290
12292
  Ks.bind(void 0, it),
12291
12293
  /* 0x03 */
12292
- Ks.bind(void 0, Ze),
12294
+ Ks.bind(void 0, Je),
12293
12295
  /* 0x04 */
12294
12296
  Zs.bind(void 0, it),
12295
12297
  /* 0x05 */
12296
- Zs.bind(void 0, Ze),
12298
+ Zs.bind(void 0, Je),
12297
12299
  /* 0x06 */
12298
12300
  Js.bind(void 0, 0),
12299
12301
  /* 0x07 */
@@ -12309,9 +12311,9 @@ go = [
12309
12311
  /* 0x0C */
12310
12312
  Ch,
12311
12313
  /* 0x0D */
12312
- Th,
12313
- /* 0x0E */
12314
12314
  Fh,
12315
+ /* 0x0E */
12316
+ Th,
12315
12317
  /* 0x0F */
12316
12318
  kh,
12317
12319
  /* 0x10 */
@@ -12386,7 +12388,7 @@ go = [
12386
12388
  /* 0x30 */
12387
12389
  ti.bind(void 0, it),
12388
12390
  /* 0x31 */
12389
- ti.bind(void 0, Ze),
12391
+ ti.bind(void 0, Je),
12390
12392
  /* 0x32 */
12391
12393
  ni.bind(void 0, 0),
12392
12394
  /* 0x33 */
@@ -12484,9 +12486,9 @@ go = [
12484
12486
  /* 0x5F */
12485
12487
  Cf,
12486
12488
  /* 0x60 */
12487
- Tf,
12488
- /* 0x61 */
12489
12489
  Ff,
12490
+ /* 0x61 */
12491
+ Tf,
12490
12492
  /* 0x62 */
12491
12493
  kf,
12492
12494
  /* 0x63 */
@@ -13154,15 +13156,15 @@ function Jf(t, e) {
13154
13156
  for (let p = 0; p < e.lookupRecords.length; p++) {
13155
13157
  const y = e.lookupRecords[p], m = y.lookupListIndex, b = this.getLookupByIndex(m);
13156
13158
  for (let v = 0; v < b.subtables.length; v++) {
13157
- let w = b.subtables[v], C, T = this.getSubstitutionType(b, w);
13158
- 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") {
13159
+ let w = b.subtables[v], C, F = this.getSubstitutionType(b, w);
13160
+ if (F === "71" ? (F = this.getSubstitutionType(w, w.extension), C = this.getLookupMethod(w, w.extension), w = w.extension) : C = this.getLookupMethod(b, w), F === "12") {
13159
13161
  const E = t.get(y.sequenceIndex), R = C(E);
13160
13162
  R && h.push(R);
13161
- } else if (T === "21") {
13163
+ } else if (F === "21") {
13162
13164
  const E = t.get(y.sequenceIndex), R = C(E);
13163
13165
  R && h.push(R);
13164
13166
  } else
13165
- throw new Error(`Substitution type ${T} is not supported in chaining substitution`);
13167
+ throw new Error(`Substitution type ${F} is not supported in chaining substitution`);
13166
13168
  }
13167
13169
  }
13168
13170
  return h;
@@ -13634,8 +13636,8 @@ function Cp(t) {
13634
13636
  }
13635
13637
  }
13636
13638
  }
13637
- var Tp = Cp;
13638
- function Fp(t) {
13639
+ var Fp = Cp;
13640
+ function Tp(t) {
13639
13641
  const e = t.current, n = t.get(-1);
13640
13642
  return (
13641
13643
  // ? latin first char
@@ -13652,7 +13654,7 @@ function kp(t) {
13652
13654
  );
13653
13655
  }
13654
13656
  var Ep = {
13655
- startCheck: Fp,
13657
+ startCheck: Tp,
13656
13658
  endCheck: kp
13657
13659
  };
13658
13660
  function pi(t, e) {
@@ -13807,13 +13809,13 @@ function zp(t) {
13807
13809
  }
13808
13810
  }
13809
13811
  var Wp = zp;
13810
- function He(t) {
13812
+ function ze(t) {
13811
13813
  this.baseDir = t || "ltr", this.tokenizer = new Yf(), this.featuresTags = {};
13812
13814
  }
13813
- He.prototype.setText = function(t) {
13815
+ ze.prototype.setText = function(t) {
13814
13816
  this.text = t;
13815
13817
  };
13816
- He.prototype.contextChecks = {
13818
+ ze.prototype.contextChecks = {
13817
13819
  ccmpReplacementCheck: wp,
13818
13820
  latinWordCheck: Ep,
13819
13821
  arabicWordCheck: ap,
@@ -13844,13 +13846,13 @@ function qp() {
13844
13846
  );
13845
13847
  }
13846
13848
  }
13847
- He.prototype.registerFeatures = function(t, e) {
13849
+ ze.prototype.registerFeatures = function(t, e) {
13848
13850
  const n = e.filter(
13849
13851
  (r) => this.query.supports({ script: t, tag: r })
13850
13852
  );
13851
13853
  Object.prototype.hasOwnProperty.call(this.featuresTags, t) ? this.featuresTags[t] = this.featuresTags[t].concat(n) : this.featuresTags[t] = n;
13852
13854
  };
13853
- He.prototype.applyFeatures = function(t, e) {
13855
+ ze.prototype.applyFeatures = function(t, e) {
13854
13856
  if (!t) throw new Error(
13855
13857
  "No valid font was provided to apply features"
13856
13858
  );
@@ -13860,7 +13862,7 @@ He.prototype.applyFeatures = function(t, e) {
13860
13862
  this.query.supports({ script: r.script }) && this.registerFeatures(r.script, r.tags);
13861
13863
  }
13862
13864
  };
13863
- He.prototype.registerModifier = function(t, e, n) {
13865
+ ze.prototype.registerModifier = function(t, e, n) {
13864
13866
  this.tokenizer.registerModifier(t, e, n);
13865
13867
  };
13866
13868
  function cn() {
@@ -13883,7 +13885,7 @@ function $p() {
13883
13885
  const t = this.tokenizer.getContextRanges("ccmpReplacement");
13884
13886
  for (let e = 0; e < t.length; e++) {
13885
13887
  const n = t[e];
13886
- Tp.call(this, n);
13888
+ Fp.call(this, n);
13887
13889
  }
13888
13890
  }
13889
13891
  function Yp() {
@@ -13919,22 +13921,22 @@ function Zp() {
13919
13921
  this.hasFeatureEnabled("thai", "liga") && _p.call(this, n), this.hasFeatureEnabled("thai", "rlig") && Pp.call(this, n), this.hasFeatureEnabled("thai", "ccmp") && Mp.call(this, n);
13920
13922
  }
13921
13923
  }
13922
- He.prototype.checkContextReady = function(t) {
13924
+ ze.prototype.checkContextReady = function(t) {
13923
13925
  return !!this.tokenizer.getContext(t);
13924
13926
  };
13925
- He.prototype.applyFeaturesToContexts = function() {
13927
+ ze.prototype.applyFeaturesToContexts = function() {
13926
13928
  this.checkContextReady("ccmpReplacement") && $p.call(this), this.checkContextReady("arabicWord") && (jp.call(this), Yp.call(this)), this.checkContextReady("latinWord") && Xp.call(this), this.checkContextReady("arabicSentence") && qp.call(this), this.checkContextReady("thaiWord") && Zp.call(this), this.checkContextReady("unicodeVariationSequence") && Kp.call(this);
13927
13929
  };
13928
- He.prototype.hasFeatureEnabled = function(t, e) {
13930
+ ze.prototype.hasFeatureEnabled = function(t, e) {
13929
13931
  return (this.featuresTags[t] || []).indexOf(e) !== -1;
13930
13932
  };
13931
- He.prototype.processText = function(t) {
13933
+ ze.prototype.processText = function(t) {
13932
13934
  (!this.text || this.text !== t) && (this.setText(t), Vp.call(this), this.applyFeaturesToContexts());
13933
13935
  };
13934
- He.prototype.getBidiText = function(t) {
13936
+ ze.prototype.getBidiText = function(t) {
13935
13937
  return this.processText(t), this.tokenizer.getText();
13936
13938
  };
13937
- He.prototype.getTextGlyphs = function(t) {
13939
+ ze.prototype.getTextGlyphs = function(t) {
13938
13940
  this.processText(t);
13939
13941
  let e = [];
13940
13942
  for (let n = 0; n < this.tokenizer.tokens.length; n++) {
@@ -13945,7 +13947,7 @@ He.prototype.getTextGlyphs = function(t) {
13945
13947
  }
13946
13948
  return e;
13947
13949
  };
13948
- var Jp = He;
13950
+ var Jp = ze;
13949
13951
  function or(t) {
13950
13952
  return {
13951
13953
  fontFamily: { en: t.familyName || " " },
@@ -13992,7 +13994,7 @@ function te(t) {
13992
13994
  }, t.tables.os2)
13993
13995
  });
13994
13996
  }
13995
- this.supported = !0, this.glyphs = new Je.GlyphSet(this, t.glyphs || []), this.encoding = new Ba(this), this.position = new ju(this), this.substitution = new Qu(this), this.tables = this.tables || {}, this.tables = new Proxy(this.tables, {
13997
+ this.supported = !0, this.glyphs = new Qe.GlyphSet(this, t.glyphs || []), this.encoding = new Ba(this), this.position = new ju(this), this.substitution = new Qu(this), this.tables = this.tables || {}, this.tables = new Proxy(this.tables, {
13996
13998
  set: (e, n, r) => (e[n] = r, e.fvar && (e.gvar || e.cff2) && !this.variation && (this.variation = new dh(this)), !0)
13997
13999
  }), this.palettes = new uo(this), this.layers = new eh(this), this.svgImages = new th(this), this._push = null, this._hmtxTableData = {}, Object.defineProperty(this, "hinting", {
13998
14000
  get: function() {
@@ -14261,8 +14263,8 @@ function td() {
14261
14263
  }
14262
14264
  var nd = { make: td, parse: ed }, rd = function() {
14263
14265
  return {
14264
- coverage: this.parsePointer(F.coverage),
14265
- attachPoints: this.parseList(F.pointer(F.uShortList))
14266
+ coverage: this.parsePointer(T.coverage),
14267
+ attachPoints: this.parseList(T.pointer(T.uShortList))
14266
14268
  };
14267
14269
  }, sd = function() {
14268
14270
  var t = this.parseUShort();
@@ -14276,59 +14278,59 @@ var nd = { make: td, parse: ed }, rd = function() {
14276
14278
  if (t === 3)
14277
14279
  return { coordinate: this.parseShort() };
14278
14280
  }, id = function() {
14279
- return this.parseList(F.pointer(sd));
14281
+ return this.parseList(T.pointer(sd));
14280
14282
  }, ad = function() {
14281
14283
  return {
14282
- coverage: this.parsePointer(F.coverage),
14283
- ligGlyphs: this.parseList(F.pointer(id))
14284
+ coverage: this.parsePointer(T.coverage),
14285
+ ligGlyphs: this.parseList(T.pointer(id))
14284
14286
  };
14285
14287
  }, od = function() {
14286
- return this.parseUShort(), this.parseList(F.pointer(F.coverage));
14288
+ return this.parseUShort(), this.parseList(T.pointer(T.coverage));
14287
14289
  };
14288
14290
  function cd(t, e) {
14289
14291
  e = e || 0;
14290
- const n = new F(t, e), r = n.parseVersion(1);
14292
+ const n = new T(t, e), r = n.parseVersion(1);
14291
14293
  H.argument(
14292
14294
  r === 1 || r === 1.2 || r === 1.3,
14293
14295
  "Unsupported GDEF table version."
14294
14296
  );
14295
14297
  var s = {
14296
14298
  version: r,
14297
- classDef: n.parsePointer(F.classDef),
14299
+ classDef: n.parsePointer(T.classDef),
14298
14300
  attachList: n.parsePointer(rd),
14299
14301
  ligCaretList: n.parsePointer(ad),
14300
- markAttachClassDef: n.parsePointer(F.classDef)
14302
+ markAttachClassDef: n.parsePointer(T.classDef)
14301
14303
  };
14302
14304
  return r >= 1.2 && (s.markGlyphSets = n.parsePointer(od)), s;
14303
14305
  }
14304
- var ld = { parse: cd }, Ve = new Array(10);
14305
- Ve[1] = function() {
14306
+ var ld = { parse: cd }, qe = new Array(10);
14307
+ qe[1] = function() {
14306
14308
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
14307
14309
  if (n === 1)
14308
14310
  return {
14309
14311
  posFormat: 1,
14310
- coverage: this.parsePointer(F.coverage),
14312
+ coverage: this.parsePointer(T.coverage),
14311
14313
  value: this.parseValueRecord()
14312
14314
  };
14313
14315
  if (n === 2)
14314
14316
  return {
14315
14317
  posFormat: 2,
14316
- coverage: this.parsePointer(F.coverage),
14318
+ coverage: this.parsePointer(T.coverage),
14317
14319
  values: this.parseValueRecordList()
14318
14320
  };
14319
14321
  H.assert(!1, "0x" + e.toString(16) + ": GPOS lookup type 1 format must be 1 or 2.");
14320
14322
  };
14321
- Ve[2] = function() {
14323
+ qe[2] = function() {
14322
14324
  const e = this.offset + this.relativeOffset, n = this.parseUShort();
14323
14325
  H.assert(n === 1 || n === 2, "0x" + e.toString(16) + ": GPOS lookup type 2 format must be 1 or 2.");
14324
- const r = this.parsePointer(F.coverage), s = this.parseUShort(), i = this.parseUShort();
14326
+ const r = this.parsePointer(T.coverage), s = this.parseUShort(), i = this.parseUShort();
14325
14327
  if (n === 1)
14326
14328
  return {
14327
14329
  posFormat: n,
14328
14330
  coverage: r,
14329
14331
  valueFormat1: s,
14330
14332
  valueFormat2: i,
14331
- pairSets: this.parseList(F.pointer(F.list(function() {
14333
+ pairSets: this.parseList(T.pointer(T.list(function() {
14332
14334
  return {
14333
14335
  // pairValueRecord
14334
14336
  secondGlyph: this.parseUShort(),
@@ -14338,7 +14340,7 @@ Ve[2] = function() {
14338
14340
  })))
14339
14341
  };
14340
14342
  if (n === 2) {
14341
- const a = this.parsePointer(F.classDef), o = this.parsePointer(F.classDef), c = this.parseUShort(), l = this.parseUShort();
14343
+ const a = this.parsePointer(T.classDef), o = this.parsePointer(T.classDef), c = this.parseUShort(), l = this.parseUShort();
14342
14344
  return {
14343
14345
  // Class Pair Adjustment
14344
14346
  posFormat: n,
@@ -14349,7 +14351,7 @@ Ve[2] = function() {
14349
14351
  classDef2: o,
14350
14352
  class1Count: c,
14351
14353
  class2Count: l,
14352
- classRecords: this.parseList(c, F.list(l, function() {
14354
+ classRecords: this.parseList(c, T.list(l, function() {
14353
14355
  return {
14354
14356
  value1: this.parseValueRecord(s),
14355
14357
  value2: this.parseValueRecord(i)
@@ -14358,40 +14360,40 @@ Ve[2] = function() {
14358
14360
  };
14359
14361
  }
14360
14362
  };
14361
- Ve[3] = function() {
14363
+ qe[3] = function() {
14362
14364
  return { error: "GPOS Lookup 3 not supported" };
14363
14365
  };
14364
- Ve[4] = function() {
14366
+ qe[4] = function() {
14365
14367
  return { error: "GPOS Lookup 4 not supported" };
14366
14368
  };
14367
- Ve[5] = function() {
14369
+ qe[5] = function() {
14368
14370
  return { error: "GPOS Lookup 5 not supported" };
14369
14371
  };
14370
- Ve[6] = function() {
14372
+ qe[6] = function() {
14371
14373
  return { error: "GPOS Lookup 6 not supported" };
14372
14374
  };
14373
- Ve[7] = function() {
14375
+ qe[7] = function() {
14374
14376
  return { error: "GPOS Lookup 7 not supported" };
14375
14377
  };
14376
- Ve[8] = function() {
14378
+ qe[8] = function() {
14377
14379
  return { error: "GPOS Lookup 8 not supported" };
14378
14380
  };
14379
- Ve[9] = function() {
14381
+ qe[9] = function() {
14380
14382
  return { error: "GPOS Lookup 9 not supported" };
14381
14383
  };
14382
14384
  function ud(t, e) {
14383
14385
  e = e || 0;
14384
- const n = new F(t, e), r = n.parseVersion(1);
14386
+ const n = new T(t, e), r = n.parseVersion(1);
14385
14387
  return H.argument(r === 1 || r === 1.1, "Unsupported GPOS table version " + r), r === 1 ? {
14386
14388
  version: r,
14387
14389
  scripts: n.parseScriptList(),
14388
14390
  features: n.parseFeatureList(),
14389
- lookups: n.parseLookupList(Ve)
14391
+ lookups: n.parseLookupList(qe)
14390
14392
  } : {
14391
14393
  version: r,
14392
14394
  scripts: n.parseScriptList(),
14393
14395
  features: n.parseFeatureList(),
14394
- lookups: n.parseLookupList(Ve),
14396
+ lookups: n.parseLookupList(qe),
14395
14397
  variations: n.parseFeatureVariationsList()
14396
14398
  };
14397
14399
  }
@@ -14509,7 +14511,7 @@ function Sd(t, e = {}) {
14509
14511
  throw new Error("WOFF2 require an external decompressor library, see examples at: " + U);
14510
14512
  } else
14511
14513
  throw new Error("Unsupported OpenType signature " + c);
14512
- let l, u, f, h, p, y, m, b, v, w, C, T, E, R, P, W, j, N;
14514
+ let l, u, f, h, p, y, m, b, v, w, C, F, E, R, P, W, j, N;
14513
14515
  for (let U = 0; U < a; U += 1) {
14514
14516
  const M = o[U];
14515
14517
  let _;
@@ -14548,7 +14550,7 @@ function Sd(t, e = {}) {
14548
14550
  E = M;
14549
14551
  break;
14550
14552
  case "hmtx":
14551
- T = M;
14553
+ F = M;
14552
14554
  break;
14553
14555
  case "ltag":
14554
14556
  _ = J(i, M), r = Ya.parse(_.data, _.offset);
@@ -14625,7 +14627,7 @@ function Sd(t, e = {}) {
14625
14627
  Dr.parse(U.data, U.offset, s, e);
14626
14628
  } else
14627
14629
  throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");
14628
- const ie = J(i, T);
14630
+ const ie = J(i, F);
14629
14631
  if ($a.parse(s, ie.data, ie.offset, s.numberOfHMetrics, s.numGlyphs, s.glyphs, e), gl(s, e), R) {
14630
14632
  const U = J(i, R);
14631
14633
  s.kerningPairs = yd.parse(U.data, U.offset);
@@ -14667,7 +14669,7 @@ function Sd(t, e = {}) {
14667
14669
  s.tables.avar = no.parse(U.data, U.offset, s.tables.fvar);
14668
14670
  }
14669
14671
  if (E) {
14670
- f || console.warn("This font provides an HVAR table, but no fvar table, which is required for variable fonts."), T || console.warn("This font provides an HVAR table, but no hmtx table to vary.");
14672
+ f || console.warn("This font provides an HVAR table, but no fvar table, which is required for variable fonts."), F || console.warn("This font provides an HVAR table, but no hmtx table to vary.");
14671
14673
  const U = J(i, E);
14672
14674
  s.tables.hvar = nd.parse(U.data, U.offset, s.tables.fvar);
14673
14675
  }
@@ -14677,12 +14679,12 @@ function Sd(t, e = {}) {
14677
14679
  }
14678
14680
  return s.palettes = new uo(s), s;
14679
14681
  }
14680
- const wd = 1.15, Cd = 0.9, Td = ["国", "中", "永"];
14682
+ const wd = 1.15, Cd = 0.9, Fd = ["国", "中", "永"];
14681
14683
  function bi(t, e) {
14682
14684
  const n = t.charToGlyphIndex(e);
14683
14685
  return n != null && n > 0;
14684
14686
  }
14685
- function Fd(t) {
14687
+ function Td(t) {
14686
14688
  var a;
14687
14689
  const e = t.unitsPerEm || 1e3;
14688
14690
  if (!bi(t, "A"))
@@ -14692,7 +14694,7 @@ function Fd(t) {
14692
14694
  return 1;
14693
14695
  const s = e / r;
14694
14696
  let i = 0;
14695
- for (const o of Td)
14697
+ for (const o of Fd)
14696
14698
  if (bi(t, o)) {
14697
14699
  i = ((a = t.charToGlyph(o)) == null ? void 0 : a.advanceWidth) ?? 0;
14698
14700
  break;
@@ -14802,40 +14804,40 @@ function Ed(t, e = 1e-4) {
14802
14804
  let a = 0;
14803
14805
  const o = Object.keys(t.attributes), c = {}, l = {}, u = [], f = ["getX", "getY", "getZ", "getW"], h = ["setX", "setY", "setZ", "setW"];
14804
14806
  for (let w = 0, C = o.length; w < C; w++) {
14805
- const T = o[w], E = t.attributes[T];
14806
- c[T] = new E.constructor(
14807
+ const F = o[w], E = t.attributes[F];
14808
+ c[F] = new E.constructor(
14807
14809
  new E.array.constructor(E.count * E.itemSize),
14808
14810
  E.itemSize,
14809
14811
  E.normalized
14810
14812
  );
14811
- const R = t.morphAttributes[T];
14812
- R && (l[T] || (l[T] = []), R.forEach((P, W) => {
14813
+ const R = t.morphAttributes[F];
14814
+ R && (l[F] || (l[F] = []), R.forEach((P, W) => {
14813
14815
  const j = new P.array.constructor(P.count * P.itemSize);
14814
- l[T][W] = new P.constructor(j, P.itemSize, P.normalized);
14816
+ l[F][W] = new P.constructor(j, P.itemSize, P.normalized);
14815
14817
  }));
14816
14818
  }
14817
14819
  const p = e * 0.5, y = Math.log10(1 / e), m = Math.pow(10, y), b = p * m;
14818
14820
  for (let w = 0; w < i; w++) {
14819
14821
  const C = r ? r.getX(w) : w;
14820
- let T = "";
14822
+ let F = "";
14821
14823
  for (let E = 0, R = o.length; E < R; E++) {
14822
14824
  const P = o[E], W = t.getAttribute(P), j = W.itemSize;
14823
14825
  for (let N = 0; N < j; N++)
14824
- T += `${~~(W[f[N]](C) * m + b)},`;
14826
+ F += `${~~(W[f[N]](C) * m + b)},`;
14825
14827
  }
14826
- if (T in n)
14827
- u.push(n[T]);
14828
+ if (F in n)
14829
+ u.push(n[F]);
14828
14830
  else {
14829
14831
  for (let E = 0, R = o.length; E < R; E++) {
14830
14832
  const P = o[E], W = t.getAttribute(P), j = t.morphAttributes[P], N = W.itemSize, X = c[P], ie = l[P];
14831
14833
  for (let U = 0; U < N; U++) {
14832
14834
  const M = f[U], _ = h[U];
14833
14835
  if (X[_](a, W[M](C)), j)
14834
- for (let re = 0, Te = j.length; re < Te; re++)
14836
+ for (let re = 0, Fe = j.length; re < Fe; re++)
14835
14837
  ie[re][_](a, j[re][M](C));
14836
14838
  }
14837
14839
  }
14838
- n[T] = a, u.push(a), a++;
14840
+ n[F] = a, u.push(a), a++;
14839
14841
  }
14840
14842
  }
14841
14843
  const v = t.clone();
@@ -14846,9 +14848,9 @@ function Ed(t, e = 1e-4) {
14846
14848
  C.itemSize,
14847
14849
  C.normalized
14848
14850
  )), w in l)
14849
- for (let T = 0; T < l[w].length; T++) {
14850
- const E = l[w][T];
14851
- v.morphAttributes[w][T] = new E.constructor(
14851
+ for (let F = 0; F < l[w].length; F++) {
14852
+ const E = l[w][F];
14853
+ v.morphAttributes[w][F] = new E.constructor(
14852
14854
  E.array.slice(0, a * E.itemSize),
14853
14855
  E.itemSize,
14854
14856
  E.normalized
@@ -15187,7 +15189,7 @@ class zd extends ia {
15187
15189
  * @returns An object containing the opentype font and parsed metadata
15188
15190
  */
15189
15191
  parseMeshFont(e) {
15190
- const n = Sd(e), r = Math.round, s = Fd(n), i = {
15192
+ const n = Sd(e), r = Math.round, s = Td(n), i = {
15191
15193
  glyphs: {},
15192
15194
  // Lazy loaded later
15193
15195
  familyName: n.getEnglishName("fullName"),
@@ -15390,11 +15392,11 @@ var wo = { exports: {} }, rs = {}, jn = {};
15390
15392
  jn.byteLength = $d;
15391
15393
  jn.toByteArray = Xd;
15392
15394
  jn.fromByteArray = Jd;
15393
- var Xe = [], Ue = [], qd = typeof Uint8Array < "u" ? Uint8Array : Array, cr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
15395
+ var Ke = [], Pe = [], qd = typeof Uint8Array < "u" ? Uint8Array : Array, cr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
15394
15396
  for (var Rt = 0, jd = cr.length; Rt < jd; ++Rt)
15395
- Xe[Rt] = cr[Rt], Ue[cr.charCodeAt(Rt)] = Rt;
15396
- Ue[45] = 62;
15397
- Ue[95] = 63;
15397
+ Ke[Rt] = cr[Rt], Pe[cr.charCodeAt(Rt)] = Rt;
15398
+ Pe[45] = 62;
15399
+ Pe[95] = 63;
15398
15400
  function Co(t) {
15399
15401
  var e = t.length;
15400
15402
  if (e % 4 > 0)
@@ -15414,11 +15416,11 @@ function Yd(t, e, n) {
15414
15416
  function Xd(t) {
15415
15417
  var e, n = Co(t), r = n[0], s = n[1], i = new qd(Yd(t, r, s)), a = 0, o = s > 0 ? r - 4 : r, c;
15416
15418
  for (c = 0; c < o; c += 4)
15417
- e = Ue[t.charCodeAt(c)] << 18 | Ue[t.charCodeAt(c + 1)] << 12 | Ue[t.charCodeAt(c + 2)] << 6 | Ue[t.charCodeAt(c + 3)], i[a++] = e >> 16 & 255, i[a++] = e >> 8 & 255, i[a++] = e & 255;
15418
- return s === 2 && (e = Ue[t.charCodeAt(c)] << 2 | Ue[t.charCodeAt(c + 1)] >> 4, i[a++] = e & 255), s === 1 && (e = Ue[t.charCodeAt(c)] << 10 | Ue[t.charCodeAt(c + 1)] << 4 | Ue[t.charCodeAt(c + 2)] >> 2, i[a++] = e >> 8 & 255, i[a++] = e & 255), i;
15419
+ e = Pe[t.charCodeAt(c)] << 18 | Pe[t.charCodeAt(c + 1)] << 12 | Pe[t.charCodeAt(c + 2)] << 6 | Pe[t.charCodeAt(c + 3)], i[a++] = e >> 16 & 255, i[a++] = e >> 8 & 255, i[a++] = e & 255;
15420
+ return s === 2 && (e = Pe[t.charCodeAt(c)] << 2 | Pe[t.charCodeAt(c + 1)] >> 4, i[a++] = e & 255), s === 1 && (e = Pe[t.charCodeAt(c)] << 10 | Pe[t.charCodeAt(c + 1)] << 4 | Pe[t.charCodeAt(c + 2)] >> 2, i[a++] = e >> 8 & 255, i[a++] = e & 255), i;
15419
15421
  }
15420
15422
  function Kd(t) {
15421
- return Xe[t >> 18 & 63] + Xe[t >> 12 & 63] + Xe[t >> 6 & 63] + Xe[t & 63];
15423
+ return Ke[t >> 18 & 63] + Ke[t >> 12 & 63] + Ke[t >> 6 & 63] + Ke[t & 63];
15422
15424
  }
15423
15425
  function Zd(t, e, n) {
15424
15426
  for (var r, s = [], i = e; i < n; i += 3)
@@ -15429,9 +15431,9 @@ function Jd(t) {
15429
15431
  for (var e, n = t.length, r = n % 3, s = [], i = 16383, a = 0, o = n - r; a < o; a += i)
15430
15432
  s.push(Zd(t, a, a + i > o ? o : a + i));
15431
15433
  return r === 1 ? (e = t[n - 1], s.push(
15432
- Xe[e >> 2] + Xe[e << 4 & 63] + "=="
15434
+ Ke[e >> 2] + Ke[e << 4 & 63] + "=="
15433
15435
  )) : r === 2 && (e = (t[n - 2] << 8) + t[n - 1], s.push(
15434
- Xe[e >> 10] + Xe[e >> 4 & 63] + Xe[e << 2 & 63] + "="
15436
+ Ke[e >> 10] + Ke[e >> 4 & 63] + Ke[e << 2 & 63] + "="
15435
15437
  )), s.join("");
15436
15438
  }
15437
15439
  var ss = {};
@@ -15702,7 +15704,7 @@ ss.write = function(t, e, n, r, s, i) {
15702
15704
  }
15703
15705
  }
15704
15706
  o.byteLength = C;
15705
- function T(x, d, g) {
15707
+ function F(x, d, g) {
15706
15708
  var S = !1;
15707
15709
  if ((d === void 0 || d < 0) && (d = 0), d > this.length || ((g === void 0 || g > this.length) && (g = this.length), g <= 0) || (g >>>= 0, d >>>= 0, g <= d))
15708
15710
  return "";
@@ -15714,10 +15716,10 @@ ss.write = function(t, e, n, r, s, i) {
15714
15716
  case "utf-8":
15715
15717
  return M(this, d, g);
15716
15718
  case "ascii":
15717
- return Te(this, d, g);
15719
+ return Fe(this, d, g);
15718
15720
  case "latin1":
15719
15721
  case "binary":
15720
- return Qe(this, d, g);
15722
+ return et(this, d, g);
15721
15723
  case "base64":
15722
15724
  return U(this, d, g);
15723
15725
  case "ucs2":
@@ -15758,7 +15760,7 @@ ss.write = function(t, e, n, r, s, i) {
15758
15760
  return this;
15759
15761
  }, o.prototype.toString = function() {
15760
15762
  var d = this.length;
15761
- return d === 0 ? "" : arguments.length === 0 ? M(this, 0, d) : T.apply(this, arguments);
15763
+ return d === 0 ? "" : arguments.length === 0 ? M(this, 0, d) : F.apply(this, arguments);
15762
15764
  }, o.prototype.toLocaleString = o.prototype.toString, o.prototype.equals = function(d) {
15763
15765
  if (!o.isBuffer(d)) throw new TypeError("Argument must be a Buffer");
15764
15766
  return this === d ? !0 : o.compare(this, d) === 0;
@@ -15943,14 +15945,14 @@ ss.write = function(t, e, n, r, s, i) {
15943
15945
  );
15944
15946
  return g;
15945
15947
  }
15946
- function Te(x, d, g) {
15948
+ function Fe(x, d, g) {
15947
15949
  var S = "";
15948
15950
  g = Math.min(x.length, g);
15949
15951
  for (var k = d; k < g; ++k)
15950
15952
  S += String.fromCharCode(x[k] & 127);
15951
15953
  return S;
15952
15954
  }
15953
- function Qe(x, d, g) {
15955
+ function et(x, d, g) {
15954
15956
  var S = "";
15955
15957
  g = Math.min(x.length, g);
15956
15958
  for (var k = d; k < g; ++k)
@@ -15961,7 +15963,7 @@ ss.write = function(t, e, n, r, s, i) {
15961
15963
  var S = x.length;
15962
15964
  (!d || d < 0) && (d = 0), (!g || g < 0 || g > S) && (g = S);
15963
15965
  for (var k = "", A = d; A < g; ++A)
15964
- k += et[x[A]];
15966
+ k += tt[x[A]];
15965
15967
  return k;
15966
15968
  }
15967
15969
  function me(x, d, g) {
@@ -16237,20 +16239,20 @@ ss.write = function(t, e, n, r, s, i) {
16237
16239
  function ve(x) {
16238
16240
  return x !== x;
16239
16241
  }
16240
- var et = function() {
16242
+ var tt = function() {
16241
16243
  for (var x = "0123456789abcdef", d = new Array(256), g = 0; g < 16; ++g)
16242
16244
  for (var S = g * 16, k = 0; k < 16; ++k)
16243
16245
  d[S + k] = x[g] + x[k];
16244
16246
  return d;
16245
16247
  }();
16246
16248
  })(rs);
16247
- var Cn = rs, Dt = Cn.Buffer, Pe = {}, Ne;
16248
- for (Ne in Cn)
16249
- Cn.hasOwnProperty(Ne) && (Ne === "SlowBuffer" || Ne === "Buffer" || (Pe[Ne] = Cn[Ne]));
16250
- var _t = Pe.Buffer = {};
16251
- for (Ne in Dt)
16252
- Dt.hasOwnProperty(Ne) && (Ne === "allocUnsafe" || Ne === "allocUnsafeSlow" || (_t[Ne] = Dt[Ne]));
16253
- Pe.Buffer.prototype = Dt.prototype;
16249
+ var Cn = rs, Dt = Cn.Buffer, Ne = {}, Ge;
16250
+ for (Ge in Cn)
16251
+ Cn.hasOwnProperty(Ge) && (Ge === "SlowBuffer" || Ge === "Buffer" || (Ne[Ge] = Cn[Ge]));
16252
+ var _t = Ne.Buffer = {};
16253
+ for (Ge in Dt)
16254
+ Dt.hasOwnProperty(Ge) && (Ge === "allocUnsafe" || Ge === "allocUnsafeSlow" || (_t[Ge] = Dt[Ge]));
16255
+ Ne.Buffer.prototype = Dt.prototype;
16254
16256
  (!_t.from || _t.from === Uint8Array.from) && (_t.from = function(t, e, n) {
16255
16257
  if (typeof t == "number")
16256
16258
  throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof t);
@@ -16266,21 +16268,21 @@ _t.alloc || (_t.alloc = function(t, e, n) {
16266
16268
  var r = Dt(t);
16267
16269
  return !e || e.length === 0 ? r.fill(0) : typeof n == "string" ? r.fill(e, n) : r.fill(e), r;
16268
16270
  });
16269
- if (!Pe.kStringMaxLength)
16271
+ if (!Ne.kStringMaxLength)
16270
16272
  try {
16271
- Pe.kStringMaxLength = process.binding("buffer").kStringMaxLength;
16273
+ Ne.kStringMaxLength = process.binding("buffer").kStringMaxLength;
16272
16274
  } catch {
16273
16275
  }
16274
- Pe.constants || (Pe.constants = {
16275
- MAX_LENGTH: Pe.kMaxLength
16276
- }, Pe.kStringMaxLength && (Pe.constants.MAX_STRING_LENGTH = Pe.kStringMaxLength));
16277
- var xt = Pe, is = {}, To = "\uFEFF";
16276
+ Ne.constants || (Ne.constants = {
16277
+ MAX_LENGTH: Ne.kMaxLength
16278
+ }, Ne.kStringMaxLength && (Ne.constants.MAX_STRING_LENGTH = Ne.kStringMaxLength));
16279
+ var xt = Ne, is = {}, Fo = "\uFEFF";
16278
16280
  is.PrependBOM = as;
16279
16281
  function as(t, e) {
16280
16282
  this.encoder = t, this.addBOM = !0;
16281
16283
  }
16282
16284
  as.prototype.write = function(t) {
16283
- return this.addBOM && (t = To + t, this.addBOM = !1), this.encoder.write(t);
16285
+ return this.addBOM && (t = Fo + t, this.addBOM = !1), this.encoder.write(t);
16284
16286
  };
16285
16287
  as.prototype.end = function() {
16286
16288
  return this.encoder.end();
@@ -16291,7 +16293,7 @@ function os(t, e) {
16291
16293
  }
16292
16294
  os.prototype.write = function(t) {
16293
16295
  var e = this.decoder.write(t);
16294
- return this.pass || !e || (e[0] === To && (e = e.slice(1), typeof this.options.stripBOM == "function" && this.options.stripBOM()), this.pass = !0), e;
16296
+ return this.pass || !e || (e[0] === Fo && (e = e.slice(1), typeof this.options.stripBOM == "function" && this.options.stripBOM()), this.pass = !0), e;
16295
16297
  };
16296
16298
  os.prototype.end = function() {
16297
16299
  return this.decoder.end();
@@ -16301,7 +16303,7 @@ function e0(t, e) {
16301
16303
  for (var n in e)
16302
16304
  Qd(e, n) && (t[n] = e[n]);
16303
16305
  }
16304
- var Fo = e0, lr = {}, ur = {}, mn = { exports: {} };
16306
+ var To = e0, lr = {}, ur = {}, mn = { exports: {} };
16305
16307
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
16306
16308
  var wi;
16307
16309
  function t0() {
@@ -16424,10 +16426,10 @@ function n0() {
16424
16426
  return v <= 127 ? 0 : v >> 5 === 6 ? 2 : v >> 4 === 14 ? 3 : v >> 3 === 30 ? 4 : v >> 6 === 2 ? -1 : -2;
16425
16427
  }
16426
16428
  function a(v, w, C) {
16427
- var T = w.length - 1;
16428
- if (T < C) return 0;
16429
- var E = i(w[T]);
16430
- return E >= 0 ? (E > 0 && (v.lastNeed = E - 1), E) : --T < C || E === -2 ? 0 : (E = i(w[T]), E >= 0 ? (E > 0 && (v.lastNeed = E - 2), E) : --T < C || E === -2 ? 0 : (E = i(w[T]), E >= 0 ? (E > 0 && (E === 2 ? E = 0 : v.lastNeed = E - 3), E) : 0));
16429
+ var F = w.length - 1;
16430
+ if (F < C) return 0;
16431
+ var E = i(w[F]);
16432
+ return E >= 0 ? (E > 0 && (v.lastNeed = E - 1), E) : --F < C || E === -2 ? 0 : (E = i(w[F]), E >= 0 ? (E > 0 && (v.lastNeed = E - 2), E) : --F < C || E === -2 ? 0 : (E = i(w[F]), E >= 0 ? (E > 0 && (E === 2 ? E = 0 : v.lastNeed = E - 3), E) : 0));
16431
16433
  }
16432
16434
  function o(v, w, C) {
16433
16435
  if ((w[0] & 192) !== 128)
@@ -16450,8 +16452,8 @@ function n0() {
16450
16452
  var C = a(this, v, w);
16451
16453
  if (!this.lastNeed) return v.toString("utf8", w);
16452
16454
  this.lastTotal = C;
16453
- var T = v.length - (C - this.lastNeed);
16454
- return v.copy(this.lastChar, 0, T), v.toString("utf8", w, T);
16455
+ var F = v.length - (C - this.lastNeed);
16456
+ return v.copy(this.lastChar, 0, F), v.toString("utf8", w, F);
16455
16457
  }
16456
16458
  function u(v) {
16457
16459
  var w = v && v.length ? this.write(v) : "";
@@ -16461,8 +16463,8 @@ function n0() {
16461
16463
  if ((v.length - w) % 2 === 0) {
16462
16464
  var C = v.toString("utf16le", w);
16463
16465
  if (C) {
16464
- var T = C.charCodeAt(C.length - 1);
16465
- if (T >= 55296 && T <= 56319)
16466
+ var F = C.charCodeAt(C.length - 1);
16467
+ if (F >= 55296 && F <= 56319)
16466
16468
  return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = v[v.length - 2], this.lastChar[1] = v[v.length - 1], C.slice(0, -1);
16467
16469
  }
16468
16470
  return C;
@@ -16493,10 +16495,10 @@ function n0() {
16493
16495
  }
16494
16496
  return ur;
16495
16497
  }
16496
- var hr, Ti;
16498
+ var hr, Fi;
16497
16499
  function r0() {
16498
- if (Ti) return hr;
16499
- Ti = 1;
16500
+ if (Fi) return hr;
16501
+ Fi = 1;
16500
16502
  var t = xt.Buffer;
16501
16503
  hr = {
16502
16504
  // Encodings
@@ -16580,16 +16582,16 @@ function r0() {
16580
16582
  }
16581
16583
  }, hr;
16582
16584
  }
16583
- var tt = {}, Fi;
16585
+ var nt = {}, Ti;
16584
16586
  function s0() {
16585
- if (Fi) return tt;
16586
- Fi = 1;
16587
+ if (Ti) return nt;
16588
+ Ti = 1;
16587
16589
  var t = xt.Buffer;
16588
- tt._utf32 = e;
16590
+ nt._utf32 = e;
16589
16591
  function e(l, u) {
16590
16592
  this.iconv = u, this.bomAware = !0, this.isLE = l.isLE;
16591
16593
  }
16592
- tt.utf32le = { type: "_utf32", isLE: !0 }, tt.utf32be = { type: "_utf32", isLE: !1 }, tt.ucs4le = "utf32le", tt.ucs4be = "utf32be", e.prototype.encoder = n, e.prototype.decoder = r;
16594
+ nt.utf32le = { type: "_utf32", isLE: !0 }, nt.utf32be = { type: "_utf32", isLE: !1 }, nt.ucs4le = "utf32le", nt.ucs4be = "utf32be", e.prototype.encoder = n, e.prototype.decoder = r;
16593
16595
  function n(l, u) {
16594
16596
  this.isLE = u.isLE, this.highSurrogate = 0;
16595
16597
  }
@@ -16642,7 +16644,7 @@ function s0() {
16642
16644
  }
16643
16645
  r.prototype.end = function() {
16644
16646
  this.overflow.length = 0;
16645
- }, tt.utf32 = i, tt.ucs4 = "utf32";
16647
+ }, nt.utf32 = i, nt.ucs4 = "utf32";
16646
16648
  function i(l, u) {
16647
16649
  this.iconv = u;
16648
16650
  }
@@ -16697,7 +16699,7 @@ function s0() {
16697
16699
  }
16698
16700
  return b - y > m - p ? "utf-32be" : b - y < m - p ? "utf-32le" : u || "utf-32le";
16699
16701
  }
16700
- return tt;
16702
+ return nt;
16701
16703
  }
16702
16704
  var yn = {}, ki;
16703
16705
  function i0() {
@@ -16812,17 +16814,17 @@ function a0() {
16812
16814
  a[o] = i.test(String.fromCharCode(o));
16813
16815
  var c = 43, l = 45, u = 38;
16814
16816
  s.prototype.write = function(m) {
16815
- for (var b = "", v = 0, w = this.inBase64, C = this.base64Accum, T = 0; T < m.length; T++)
16817
+ for (var b = "", v = 0, w = this.inBase64, C = this.base64Accum, F = 0; F < m.length; F++)
16816
16818
  if (!w)
16817
- m[T] == c && (b += this.iconv.decode(m.slice(v, T), "ascii"), v = T + 1, w = !0);
16818
- else if (!a[m[T]]) {
16819
- if (T == v && m[T] == l)
16819
+ m[F] == c && (b += this.iconv.decode(m.slice(v, F), "ascii"), v = F + 1, w = !0);
16820
+ else if (!a[m[F]]) {
16821
+ if (F == v && m[F] == l)
16820
16822
  b += "+";
16821
16823
  else {
16822
- var E = C + this.iconv.decode(m.slice(v, T), "ascii");
16824
+ var E = C + this.iconv.decode(m.slice(v, F), "ascii");
16823
16825
  b += this.iconv.decode(t.from(E, "base64"), "utf16-be");
16824
16826
  }
16825
- m[T] != l && T--, v = T + 1, w = !1, C = "";
16827
+ m[F] != l && F--, v = F + 1, w = !1, C = "";
16826
16828
  }
16827
16829
  if (!w)
16828
16830
  b += this.iconv.decode(m.slice(v), "ascii");
@@ -16843,11 +16845,11 @@ function a0() {
16843
16845
  this.iconv = b.iconv, this.inBase64 = !1, this.base64Accum = t.alloc(6), this.base64AccumIdx = 0;
16844
16846
  }
16845
16847
  h.prototype.write = function(m) {
16846
- for (var b = this.inBase64, v = this.base64Accum, w = this.base64AccumIdx, C = t.alloc(m.length * 5 + 10), T = 0, E = 0; E < m.length; E++) {
16848
+ for (var b = this.inBase64, v = this.base64Accum, w = this.base64AccumIdx, C = t.alloc(m.length * 5 + 10), F = 0, E = 0; E < m.length; E++) {
16847
16849
  var R = m.charCodeAt(E);
16848
- 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)));
16850
+ R >= 32 && R <= 126 ? (b && (w > 0 && (F += C.write(v.slice(0, w).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), F), w = 0), C[F++] = l, b = !1), b || (C[F++] = R, R === u && (C[F++] = l))) : (b || (C[F++] = u, b = !0), b && (v[w++] = R >> 8, v[w++] = R & 255, w == v.length && (F += C.write(v.toString("base64").replace(/\//g, ","), F), w = 0)));
16849
16851
  }
16850
- return this.inBase64 = b, this.base64AccumIdx = w, C.slice(0, T);
16852
+ return this.inBase64 = b, this.base64AccumIdx = w, C.slice(0, F);
16851
16853
  }, h.prototype.end = function() {
16852
16854
  var m = t.alloc(10), b = 0;
16853
16855
  return this.inBase64 && (this.base64AccumIdx > 0 && (b += m.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), b), this.base64AccumIdx = 0), m[b++] = l, this.inBase64 = !1), m.slice(0, b);
@@ -16857,17 +16859,17 @@ function a0() {
16857
16859
  }
16858
16860
  var y = a.slice();
16859
16861
  return y[44] = !0, p.prototype.write = function(m) {
16860
- for (var b = "", v = 0, w = this.inBase64, C = this.base64Accum, T = 0; T < m.length; T++)
16862
+ for (var b = "", v = 0, w = this.inBase64, C = this.base64Accum, F = 0; F < m.length; F++)
16861
16863
  if (!w)
16862
- m[T] == u && (b += this.iconv.decode(m.slice(v, T), "ascii"), v = T + 1, w = !0);
16863
- else if (!y[m[T]]) {
16864
- if (T == v && m[T] == l)
16864
+ m[F] == u && (b += this.iconv.decode(m.slice(v, F), "ascii"), v = F + 1, w = !0);
16865
+ else if (!y[m[F]]) {
16866
+ if (F == v && m[F] == l)
16865
16867
  b += "&";
16866
16868
  else {
16867
- var E = C + this.iconv.decode(m.slice(v, T), "ascii").replace(/,/g, "/");
16869
+ var E = C + this.iconv.decode(m.slice(v, F), "ascii").replace(/,/g, "/");
16868
16870
  b += this.iconv.decode(t.from(E, "base64"), "utf16-be");
16869
16871
  }
16870
- m[T] != l && T--, v = T + 1, w = !1, C = "";
16872
+ m[F] != l && F--, v = F + 1, w = !1, C = "";
16871
16873
  }
16872
16874
  if (!w)
16873
16875
  b += this.iconv.decode(m.slice(v), "ascii");
@@ -17551,12 +17553,12 @@ function u0() {
17551
17553
  var v = this.decodeTables.length;
17552
17554
  this.decodeTables.push(i.slice(0));
17553
17555
  for (var w = this.decodeTables[0], m = 129; m <= 254; m++)
17554
- for (var C = this.decodeTables[s - w[m]], T = 48; T <= 57; T++) {
17555
- if (C[T] === e)
17556
- C[T] = s - b;
17557
- else if (C[T] > s)
17556
+ for (var C = this.decodeTables[s - w[m]], F = 48; F <= 57; F++) {
17557
+ if (C[F] === e)
17558
+ C[F] = s - b;
17559
+ else if (C[F] > s)
17558
17560
  throw new Error("gb18030 decode tables conflict at byte 2");
17559
- for (var E = this.decodeTables[s - C[T]], R = 129; R <= 254; R++) {
17561
+ for (var E = this.decodeTables[s - C[F]], R = 129; R <= 254; R++) {
17560
17562
  if (E[R] === e)
17561
17563
  E[R] = s - v;
17562
17564
  else {
@@ -17578,8 +17580,8 @@ function u0() {
17578
17580
  if (typeof N == "number")
17579
17581
  j[N] = !0;
17580
17582
  else
17581
- for (var T = N.from; T <= N.to; T++)
17582
- j[T] = !0;
17583
+ for (var F = N.from; F <= N.to; F++)
17584
+ j[F] = !0;
17583
17585
  }
17584
17586
  if (this._fillEncodeTable(0, 0, j), h.encodeAdd)
17585
17587
  for (var X in h.encodeAdd)
@@ -17615,7 +17617,7 @@ function u0() {
17615
17617
  else
17616
17618
  throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + h[0]);
17617
17619
  } else if (w > 4080 && w <= 4095) {
17618
- for (var T = 4095 - w + 2, E = [], R = 0; R < T; R++)
17620
+ for (var F = 4095 - w + 2, E = [], R = 0; R < F; R++)
17619
17621
  E.push(b.charCodeAt(v++));
17620
17622
  y[p++] = r - this.decodeTableSeq.length, this.decodeTableSeq.push(E);
17621
17623
  } else
@@ -17645,17 +17647,17 @@ function u0() {
17645
17647
  y = h[h.length - 1], v[y] = p;
17646
17648
  }, c.prototype._fillEncodeTable = function(h, p, y) {
17647
17649
  for (var m = this.decodeTables[h], b = !1, v = {}, w = 0; w < 256; w++) {
17648
- var C = m[w], T = p + w;
17649
- if (!y[T])
17650
+ var C = m[w], F = p + w;
17651
+ if (!y[F])
17650
17652
  if (C >= 0)
17651
- this._setEncodeChar(C, T), b = !0;
17653
+ this._setEncodeChar(C, F), b = !0;
17652
17654
  else if (C <= s) {
17653
17655
  var E = s - C;
17654
17656
  if (!v[E]) {
17655
- var R = T << 8 >>> 0;
17657
+ var R = F << 8 >>> 0;
17656
17658
  this._fillEncodeTable(E, R, y) ? b = !0 : v[E] = !0;
17657
17659
  }
17658
- } else C <= r && (this._setEncodeSequence(this.decodeTableSeq[r - C], T), b = !0);
17660
+ } else C <= r && (this._setEncodeSequence(this.decodeTableSeq[r - C], F), b = !0);
17659
17661
  }
17660
17662
  return b;
17661
17663
  };
@@ -17681,30 +17683,30 @@ function u0() {
17681
17683
  else
17682
17684
  y !== -1 ? (C = 65536 + (y - 55296) * 1024 + (C - 56320), y = -1) : C = e;
17683
17685
  else y !== -1 && (b = C, C = e, y = -1);
17684
- var T = e;
17686
+ var F = e;
17685
17687
  if (m !== void 0 && C != e) {
17686
17688
  var E = m[C];
17687
17689
  if (typeof E == "object") {
17688
17690
  m = E;
17689
17691
  continue;
17690
- } else typeof E == "number" ? T = E : E == null && (E = m[a], E !== void 0 && (T = E, b = C));
17692
+ } else typeof E == "number" ? F = E : E == null && (E = m[a], E !== void 0 && (F = E, b = C));
17691
17693
  m = void 0;
17692
17694
  } else if (C >= 0) {
17693
17695
  var R = this.encodeTable[C >> 8];
17694
- if (R !== void 0 && (T = R[C & 255]), T <= r) {
17695
- m = this.encodeTableSeq[r - T];
17696
+ if (R !== void 0 && (F = R[C & 255]), F <= r) {
17697
+ m = this.encodeTableSeq[r - F];
17696
17698
  continue;
17697
17699
  }
17698
- if (T == e && this.gb18030) {
17700
+ if (F == e && this.gb18030) {
17699
17701
  var P = f(this.gb18030.uChars, C);
17700
17702
  if (P != -1) {
17701
- var T = this.gb18030.gbChars[P] + (C - this.gb18030.uChars[P]);
17702
- p[w++] = 129 + Math.floor(T / 12600), T = T % 12600, p[w++] = 48 + Math.floor(T / 1260), T = T % 1260, p[w++] = 129 + Math.floor(T / 10), T = T % 10, p[w++] = 48 + T;
17703
+ var F = this.gb18030.gbChars[P] + (C - this.gb18030.uChars[P]);
17704
+ p[w++] = 129 + Math.floor(F / 12600), F = F % 12600, p[w++] = 48 + Math.floor(F / 1260), F = F % 1260, p[w++] = 129 + Math.floor(F / 10), F = F % 10, p[w++] = 48 + F;
17703
17705
  continue;
17704
17706
  }
17705
17707
  }
17706
17708
  }
17707
- T === e && (T = this.defaultCharSingleByte), T < 256 ? p[w++] = T : T < 65536 ? (p[w++] = T >> 8, p[w++] = T & 255) : T < 16777216 ? (p[w++] = T >> 16, p[w++] = T >> 8 & 255, p[w++] = T & 255) : (p[w++] = T >>> 24, p[w++] = T >>> 16 & 255, p[w++] = T >>> 8 & 255, p[w++] = T & 255);
17709
+ F === e && (F = this.defaultCharSingleByte), F < 256 ? p[w++] = F : F < 65536 ? (p[w++] = F >> 8, p[w++] = F & 255) : F < 16777216 ? (p[w++] = F >> 16, p[w++] = F >> 8 & 255, p[w++] = F & 255) : (p[w++] = F >>> 24, p[w++] = F >>> 16 & 255, p[w++] = F >>> 8 & 255, p[w++] = F & 255);
17708
17710
  }
17709
17711
  return this.seqObj = m, this.leadSurrogate = y, p.slice(0, w);
17710
17712
  }, l.prototype.end = function() {
@@ -17721,7 +17723,7 @@ function u0() {
17721
17723
  this.nodeIdx = 0, this.prevBytes = [], this.decodeTables = p.decodeTables, this.decodeTableSeq = p.decodeTableSeq, this.defaultCharUnicode = p.defaultCharUnicode, this.gb18030 = p.gb18030;
17722
17724
  }
17723
17725
  u.prototype.write = function(h) {
17724
- for (var p = t.alloc(h.length * 2), y = this.nodeIdx, m = this.prevBytes, b = this.prevBytes.length, v = -this.prevBytes.length, w, C = 0, T = 0; C < h.length; C++) {
17726
+ for (var p = t.alloc(h.length * 2), y = this.nodeIdx, m = this.prevBytes, b = this.prevBytes.length, v = -this.prevBytes.length, w, C = 0, F = 0; C < h.length; C++) {
17725
17727
  var E = C >= 0 ? h[C] : m[C + b], w = this.decodeTables[y][E];
17726
17728
  if (!(w >= 0)) if (w === e)
17727
17729
  w = this.defaultCharUnicode.charCodeAt(0), C = v;
@@ -17737,18 +17739,18 @@ function u0() {
17737
17739
  continue;
17738
17740
  } else if (w <= r) {
17739
17741
  for (var W = this.decodeTableSeq[r - w], j = 0; j < W.length - 1; j++)
17740
- w = W[j], p[T++] = w & 255, p[T++] = w >> 8;
17742
+ w = W[j], p[F++] = w & 255, p[F++] = w >> 8;
17741
17743
  w = W[W.length - 1];
17742
17744
  } else
17743
17745
  throw new Error("iconv-lite internal error: invalid decoding table value " + w + " at " + y + "/" + E);
17744
17746
  if (w >= 65536) {
17745
17747
  w -= 65536;
17746
17748
  var N = 55296 | w >> 10;
17747
- p[T++] = N & 255, p[T++] = N >> 8, w = 56320 | w & 1023;
17749
+ p[F++] = N & 255, p[F++] = N >> 8, w = 56320 | w & 1023;
17748
17750
  }
17749
- p[T++] = w & 255, p[T++] = w >> 8, y = 0, v = C + 1;
17751
+ p[F++] = w & 255, p[F++] = w >> 8, y = 0, v = C + 1;
17750
17752
  }
17751
- return this.nodeIdx = y, this.prevBytes = v >= 0 ? Array.prototype.slice.call(h, v) : m.slice(v + b).concat(Array.prototype.slice.call(h)), p.slice(0, T).toString("ucs2");
17753
+ return this.nodeIdx = y, this.prevBytes = v >= 0 ? Array.prototype.slice.call(h, v) : m.slice(v + b).concat(Array.prototype.slice.call(h)), p.slice(0, F).toString("ucs2");
17752
17754
  }, u.prototype.end = function() {
17753
17755
  for (var h = ""; this.prevBytes.length > 0; ) {
17754
17756
  h += this.defaultCharUnicode;
@@ -26283,7 +26285,7 @@ function b0() {
26283
26285
  var Di;
26284
26286
  function x0() {
26285
26287
  return Di || (Di = 1, function(t) {
26286
- for (var e = Fo, n = [
26288
+ for (var e = To, n = [
26287
26289
  r0(),
26288
26290
  s0(),
26289
26291
  i0(),
@@ -26374,7 +26376,7 @@ const S0 = {}, w0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
26374
26376
  default: S0
26375
26377
  }, Symbol.toStringTag, { value: "Module" })), C0 = /* @__PURE__ */ Vd(w0);
26376
26378
  (function(t) {
26377
- var e = xt.Buffer, n = is, r = Fo, s = t.exports;
26379
+ var e = xt.Buffer, n = is, r = To, s = t.exports;
26378
26380
  s.encodings = null, s.defaultCharUnicode = "�", s.defaultCharSingleByte = "?", s.encode = function(o, c, l) {
26379
26381
  o = "" + (o || "");
26380
26382
  var u = s.getEncoder(c, l), f = u.write(o), h = u.end();
@@ -26441,8 +26443,8 @@ const S0 = {}, w0 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
26441
26443
  throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.");
26442
26444
  };
26443
26445
  })(wo);
26444
- var T0 = wo.exports;
26445
- const Ui = /* @__PURE__ */ Wd(T0);
26446
+ var F0 = wo.exports;
26447
+ const Ui = /* @__PURE__ */ Wd(F0);
26446
26448
  class cs extends aa {
26447
26449
  /**
26448
26450
  * Creates a new SHX text shape wrapper.
@@ -26647,7 +26649,7 @@ const ft = class ft extends ia {
26647
26649
  maxEntries: this.layoutShapeCache.capacity,
26648
26650
  estimatedBytes: n
26649
26651
  }, s = Math.round(
26650
- this.sourceByteLength * Tc
26652
+ this.sourceByteLength * Fc
26651
26653
  ), i = s + e.estimatedBytes + r.estimatedBytes;
26652
26654
  return {
26653
26655
  names: Array.from(this.names),
@@ -26712,7 +26714,7 @@ const ft = class ft extends ia {
26712
26714
  };
26713
26715
  ft.NOT_ENCODABLE = -1;
26714
26716
  let Gr = ft;
26715
- class Ke {
26717
+ class Ze {
26716
26718
  constructor() {
26717
26719
  }
26718
26720
  /**
@@ -26720,7 +26722,7 @@ class Ke {
26720
26722
  * @returns The FontFactory instance
26721
26723
  */
26722
26724
  static get instance() {
26723
- return Ke._instance || (Ke._instance = new Ke()), Ke._instance;
26725
+ return Ze._instance || (Ze._instance = new Ze()), Ze._instance;
26724
26726
  }
26725
26727
  /**
26726
26728
  * Creates a font instance based on the provided font data.
@@ -26745,7 +26747,7 @@ class $ {
26745
26747
  fontNotFound: new gs(),
26746
26748
  /** Event triggered when a font is successfully loaded */
26747
26749
  fontLoaded: new gs()
26748
- }, this.fontRequestInFlight = /* @__PURE__ */ new Map(), this.fontRequestFailed = /* @__PURE__ */ new Set(), this.loadEpoch = 0, this.loader = new I.FileLoader(), this.loader.setResponseType("arraybuffer"), this.fileNames = [], this.fontLoader = new F0();
26750
+ }, this.fontRequestInFlight = /* @__PURE__ */ new Map(), this.fontRequestFailed = /* @__PURE__ */ new Set(), this.loadEpoch = 0, this.loader = new I.FileLoader(), this.loader.setResponseType("arraybuffer"), this.fileNames = [], this.fontLoader = new T0();
26749
26751
  }
26750
26752
  /**
26751
26753
  * Gets the singleton instance of the FontManager
@@ -26829,7 +26831,7 @@ class $ {
26829
26831
  const i = lt(s.file).toLowerCase();
26830
26832
  n.set(i, { ...s, source: "remote" });
26831
26833
  }
26832
- const r = await st.instance.getAll();
26834
+ const r = await Ue.instance.getAll();
26833
26835
  for (const s of r) {
26834
26836
  const i = s.name.toLowerCase();
26835
26837
  n.has(i) || n.set(i, this.cachedFontDataToFontInfo(s));
@@ -26888,7 +26890,7 @@ class $ {
26888
26890
  const r = this.fontRequestInFlight.get(n);
26889
26891
  if (r)
26890
26892
  return r;
26891
- const s = this.loadEpoch, i = this.loadFontsByNames(n).then((a) => (s !== this.loadEpoch || (this.isFontLoaded(n) ? this.fontRequestFailed.delete(n) : this.fontRequestFailed.add(n)), a)).catch(() => (s === this.loadEpoch && this.fontRequestFailed.add(n), [
26893
+ const s = this.loadEpoch, i = this.loadFontsByNames(n).then((a) => (s !== this.loadEpoch || (this.isFontLoaded(n) ? this.fontRequestFailed.delete(n) : a.some((c) => c.status === "FailedToLoad") && this.fontRequestFailed.add(n)), a)).catch(() => (s === this.loadEpoch && this.fontRequestFailed.add(n), [
26892
26894
  {
26893
26895
  fontName: n,
26894
26896
  url: "",
@@ -26914,7 +26916,7 @@ class $ {
26914
26916
  return "";
26915
26917
  let n = String(e);
26916
26918
  const r = n.lastIndexOf(".");
26917
- return (r > 0 && r == n.length - 4 || r == n.length - 5) && (n = n.substring(0, r)), n.toLowerCase();
26919
+ return r > 0 && (r === n.length - 4 || r === n.length - 5) && (n = n.substring(0, r)), n.toLowerCase();
26918
26920
  }
26919
26921
  /**
26920
26922
  * Parses a user-uploaded font file, registers it for rendering, and stores
@@ -26964,8 +26966,8 @@ class $ {
26964
26966
  data: i
26965
26967
  };
26966
26968
  try {
26967
- const f = Ke.instance.createFont(u);
26968
- return l.forEach((h) => f.names.add(h)), this.registerFontInMap(o, f), this.enableFontCache && await st.instance.set(o, u), this.events.fontLoaded.dispatch({ fontName: o }), {
26969
+ const f = Ze.instance.createFont(u);
26970
+ return l.forEach((h) => f.names.add(h)), this.registerFontInMap(o, f), this.enableFontCache && await Ue.instance.set(o, u), this.events.fontLoaded.dispatch({ fontName: o }), {
26969
26971
  fontName: o,
26970
26972
  url: "",
26971
26973
  status: "Success"
@@ -26992,11 +26994,11 @@ class $ {
26992
26994
  const n = lt(e).toLowerCase();
26993
26995
  if (this.isFontLoaded(n))
26994
26996
  return !0;
26995
- const r = await st.instance.find(e);
26997
+ const r = await Ue.instance.find(e);
26996
26998
  if (!r)
26997
26999
  return !1;
26998
27000
  try {
26999
- const i = Ke.instance.createFont(r);
27001
+ const i = Ze.instance.createFont(r);
27000
27002
  return (s = r.alias) == null || s.forEach((a) => i.names.add(a)), this.registerFontInMap(r.name, i), this.events.fontLoaded.dispatch({ fontName: r.name }), !0;
27001
27003
  } catch {
27002
27004
  return !1;
@@ -27017,12 +27019,12 @@ class $ {
27017
27019
  s.forEach((i, a) => {
27018
27020
  const o = e[a].url, c = lt(
27019
27021
  e[a].file || o
27020
- ).toLowerCase(), l = i.status === "fulfilled" && this.isFontLoaded(c);
27022
+ ).toLowerCase(), l = e[a].name ?? [], u = i.status === "fulfilled" && (this.isFontLoaded(c) || l.some((f) => this.isFontLoaded(f)));
27021
27023
  r.push({
27022
27024
  fontName: c,
27023
27025
  url: o,
27024
- status: l ? "Success" : "FailedToLoad"
27025
- }), l && this.fileNames.push(c);
27026
+ status: u ? "Success" : "FailedToLoad"
27027
+ }), u && this.fileNames.push(c);
27026
27028
  });
27027
27029
  }), r;
27028
27030
  }
@@ -27046,7 +27048,7 @@ class $ {
27046
27048
  return s = this.loadedFontMap.get(c.toLowerCase()), !s && this.lazyFontLoading && this.requestFont(c), this.recordMissedFonts(r, !1), c;
27047
27049
  }
27048
27050
  if (s)
27049
- return n;
27051
+ return r || n;
27050
27052
  this.recordMissedFonts(r, !0);
27051
27053
  const i = this.pickLoadedDefaultFont(!0);
27052
27054
  if (i)
@@ -27081,7 +27083,7 @@ class $ {
27081
27083
  getFontByName(e, n = !0) {
27082
27084
  e == null && (e = "");
27083
27085
  const r = e.lastIndexOf(".");
27084
- (r > 0 && r == e.length - 4 || r == e.length - 5) && (e = e.substring(0, r));
27086
+ r > 0 && (r === e.length - 4 || r === e.length - 5) && (e = e.substring(0, r));
27085
27087
  const s = this.loadedFontMap.get(e.toLowerCase());
27086
27088
  if (!s) {
27087
27089
  n && this.recordMissedFonts(e);
@@ -27162,7 +27164,7 @@ class $ {
27162
27164
  * @returns The scale factor for the font, or 1 if the font is not found
27163
27165
  */
27164
27166
  getFontScaleFactor(e) {
27165
- const n = this.loadedFontMap.get(e.toLowerCase());
27167
+ const n = this.getFontByName(e, !1);
27166
27168
  return n ? n.getScaleFactor() : 1;
27167
27169
  }
27168
27170
  /**
@@ -27171,8 +27173,8 @@ class $ {
27171
27173
  * @returns The type of the font. If the specified font can't be found, `undefined` is returned
27172
27174
  */
27173
27175
  getFontType(e) {
27174
- const n = this.loadedFontMap.get(e.toLowerCase());
27175
- return n == null ? void 0 : n.type;
27176
+ var n;
27177
+ return (n = this.getFontByName(e, !1)) == null ? void 0 : n.type;
27176
27178
  }
27177
27179
  /**
27178
27180
  * Gets the type of the SHX font. Such as BIGFONT, SHAPES, UNIFONT.
@@ -27180,7 +27182,7 @@ class $ {
27180
27182
  * @returns The type of the SHX font, or undefined if the specified font is not a SHX font
27181
27183
  */
27182
27184
  getShxFontType(e) {
27183
- const n = this.loadedFontMap.get(e.toLowerCase());
27185
+ const n = this.getFontByName(e, !1);
27184
27186
  return (n == null ? void 0 : n.type) === "shx" ? n.data.header.fontType : void 0;
27185
27187
  }
27186
27188
  /**
@@ -27200,7 +27202,8 @@ class $ {
27200
27202
  * @returns True if the font is loaded, false otherwise
27201
27203
  */
27202
27204
  isFontLoaded(e) {
27203
- return this.loadedFontMap.has(e.toLowerCase());
27205
+ const n = this.normalizeFontName(e);
27206
+ return !!n && this.loadedFontMap.has(n);
27204
27207
  }
27205
27208
  /**
27206
27209
  * Applies a missed-font report from another isolate (e.g. a web worker).
@@ -27247,7 +27250,7 @@ class $ {
27247
27250
  if (!e)
27248
27251
  return e;
27249
27252
  const n = e.lastIndexOf(".");
27250
- return n > 0 && n == e.length - 4 || n == e.length - 5 ? e.substring(0, n) : e;
27253
+ return n > 0 && (n === e.length - 4 || n === e.length - 5) ? e.substring(0, n) : e;
27251
27254
  }
27252
27255
  /**
27253
27256
  * Removes {@link missedFonts} entries whose name matches `fontName`
@@ -27269,6 +27272,51 @@ class $ {
27269
27272
  count: this.missedFonts[e]
27270
27273
  }), n && this.lazyFontLoading && this.requestFont(e)));
27271
27274
  }
27275
+ /**
27276
+ * Adds catalog / `fonts.json` names onto a font instance.
27277
+ */
27278
+ applyCatalogNames(e, n) {
27279
+ n.forEach((r) => {
27280
+ r && e.names.add(r);
27281
+ });
27282
+ }
27283
+ /**
27284
+ * Ensures an already-loaded primary face is also addressable under the
27285
+ * current catalog names. Needed when IndexedDB still has an older alias
27286
+ * list (e.g. `noto-sans-kr` cached before `malgun` was added) or when the
27287
+ * binary was loaded under the file basename first.
27288
+ */
27289
+ ensureCatalogAliases(e, n) {
27290
+ const r = this.loadedFontMap.get(e.toLowerCase()) ?? n.map((s) => this.loadedFontMap.get(s.toLowerCase())).find((s) => s != null);
27291
+ r && (this.applyCatalogNames(r, n), this.registerFontInMap(e, r));
27292
+ }
27293
+ /**
27294
+ * Merges catalog / primary names into an existing IndexedDB alias list so
27295
+ * cold starts after `getAllFontsFromCache` pick up newly added style names.
27296
+ */
27297
+ async persistCatalogAliases(e, n) {
27298
+ if (!this.enableFontCache)
27299
+ return;
27300
+ const r = await Ue.instance.get(e);
27301
+ if (!r)
27302
+ return;
27303
+ const s = [
27304
+ .../* @__PURE__ */ new Set([...r.alias ?? [], ...n, e])
27305
+ ], i = r.alias ?? [];
27306
+ s.length === i.length && s.every((a) => i.includes(a)) || await Ue.instance.set(e, {
27307
+ ...r,
27308
+ alias: s
27309
+ });
27310
+ }
27311
+ /**
27312
+ * Clears miss / failed-request bookkeeping for a primary name and aliases
27313
+ * so a later alias request is not permanently blocked after the binary
27314
+ * loaded under a different key.
27315
+ */
27316
+ clearRequestStateForNames(e) {
27317
+ for (const n of e)
27318
+ n && (this.clearMissedFontEntry(n), this.fontRequestFailed.delete(n.toLowerCase()));
27319
+ }
27272
27320
  /**
27273
27321
  * Loads a single font
27274
27322
  * @param fontInfo - The matadata of the font to be loaded
@@ -27276,27 +27324,46 @@ class $ {
27276
27324
  async loadFont(e) {
27277
27325
  if (!ta(e.file))
27278
27326
  throw new Error(`Invalid font file name: ${e.file}`);
27279
- const r = this.fontInfoToFontData(e), s = r.name;
27280
- if (this.isFontLoaded(r.name))
27327
+ const r = this.fontInfoToFontData(e), s = r.name, i = e.name ?? [];
27328
+ if (this.isFontLoaded(r.name)) {
27329
+ this.ensureCatalogAliases(s, i), this.clearRequestStateForNames([s, ...i]), await this.persistCatalogAliases(s, i);
27281
27330
  return;
27282
- const i = this.loadEpoch, a = await st.instance.get(s);
27283
- if (i === this.loadEpoch) {
27284
- if (a) {
27285
- if (await new Promise((c) => setTimeout(c, 0)), i !== this.loadEpoch || this.isFontLoaded(s))
27286
- return;
27287
- const o = Ke.instance.createFont(a);
27288
- o && this.registerFontInMap(s, o);
27289
- } else {
27290
- const o = await this.loader.loadAsync(e.url);
27291
- if (i !== this.loadEpoch || (r.data = o, await new Promise((l) => setTimeout(l, 0)), i !== this.loadEpoch || this.isFontLoaded(s)))
27292
- return;
27293
- const c = Ke.instance.createFont(r);
27294
- c && (e.name.forEach((l) => c.names.add(l)), this.registerFontInMap(s, c), this.enableFontCache && await st.instance.set(s, r));
27331
+ }
27332
+ const a = this.loadEpoch, o = this.enableFontCache ? await Ue.instance.get(s) : void 0;
27333
+ if (a !== this.loadEpoch)
27334
+ return;
27335
+ let c = !1;
27336
+ if (o) {
27337
+ if (await new Promise((l) => setTimeout(l, 0)), a !== this.loadEpoch)
27338
+ return;
27339
+ if (this.isFontLoaded(s)) {
27340
+ this.ensureCatalogAliases(s, i), this.clearRequestStateForNames([s, ...i]), await this.persistCatalogAliases(s, i);
27341
+ return;
27342
+ }
27343
+ try {
27344
+ const l = Ze.instance.createFont(o);
27345
+ l && (this.applyCatalogNames(l, i), this.registerFontInMap(s, l), await this.persistCatalogAliases(s, i), c = !0);
27346
+ } catch {
27347
+ try {
27348
+ await Ue.instance.delete(s);
27349
+ } catch {
27350
+ }
27295
27351
  }
27296
- i !== this.loadEpoch || !this.isFontLoaded(s) || (this.clearMissedFontEntry(s), this.fontRequestFailed.delete(s.toLowerCase()), this.events.fontLoaded.dispatch({
27297
- fontName: s
27298
- }));
27299
27352
  }
27353
+ if (!c && !this.isFontLoaded(s)) {
27354
+ const l = await this.loader.loadAsync(e.url);
27355
+ if (a !== this.loadEpoch || (r.data = l, await new Promise((f) => setTimeout(f, 0)), a !== this.loadEpoch))
27356
+ return;
27357
+ if (this.isFontLoaded(s)) {
27358
+ this.ensureCatalogAliases(s, i), this.clearRequestStateForNames([s, ...i]), await this.persistCatalogAliases(s, i);
27359
+ return;
27360
+ }
27361
+ const u = Ze.instance.createFont(r);
27362
+ u && (this.applyCatalogNames(u, i), this.registerFontInMap(s, u), this.enableFontCache && await Ue.instance.set(s, r));
27363
+ }
27364
+ a !== this.loadEpoch || !this.isFontLoaded(s) || (this.clearRequestStateForNames([s, ...i]), this.events.fontLoaded.dispatch({
27365
+ fontName: s
27366
+ }));
27300
27367
  }
27301
27368
  fontInfoToFontData(e) {
27302
27369
  const n = lt(e.file).toLowerCase(), r = ["ttf", "otf", "woff"].includes(e.type) ? "mesh" : e.type;
@@ -27313,12 +27380,12 @@ class $ {
27313
27380
  async getAllFontsFromCache() {
27314
27381
  if (this.loadedFontMap.size !== 0)
27315
27382
  return;
27316
- const e = await st.instance.getAll();
27383
+ const e = await Ue.instance.getAll();
27317
27384
  for (const n of e) {
27318
27385
  const { name: r } = n;
27319
27386
  if (this.fileNames && !this.fileNames.includes(r))
27320
27387
  continue;
27321
- const s = Ke.instance.createFont(n);
27388
+ const s = Ze.instance.createFont(n);
27322
27389
  this.registerFontInMap(r, s);
27323
27390
  }
27324
27391
  }
@@ -27406,7 +27473,9 @@ class $ {
27406
27473
  const n = /* @__PURE__ */ new Set();
27407
27474
  for (const a of this.loadedFontMap.values())
27408
27475
  n.add(a);
27409
- const r = Array.from(n).map((a) => a.estimateMemoryUsage()), s = (e == null ? void 0 : e.materials) ?? da(), i = r.reduce((a, o) => a + o.estimatedBytes, 0);
27476
+ const r = Array.from(n).map(
27477
+ (a) => a.estimateMemoryUsage()
27478
+ ), s = (e == null ? void 0 : e.materials) ?? da(), i = r.reduce((a, o) => a + o.estimatedBytes, 0);
27410
27479
  return {
27411
27480
  id: (e == null ? void 0 : e.id) ?? "main",
27412
27481
  inFlightRequests: e == null ? void 0 : e.inFlightRequests,
@@ -27416,12 +27485,12 @@ class $ {
27416
27485
  };
27417
27486
  }
27418
27487
  }
27419
- class F0 {
27488
+ class T0 {
27420
27489
  /**
27421
27490
  * Creates a new instance of DefaultFontLoader
27422
27491
  */
27423
27492
  constructor() {
27424
- this._availableFontsPromise = null, this._avaiableFonts = [], this._avaiableFontMap = /* @__PURE__ */ new Map(), this._baseUrl = "https://cdn.jsdelivr.net/gh/mlightcad/cad-data/fonts/";
27493
+ this._availableFontsPromise = null, this._catalogRefreshAttempted = !1, this._avaiableFonts = [], this._avaiableFontMap = /* @__PURE__ */ new Map(), this._baseUrl = "https://cdn.jsdelivr.net/gh/mlightcad/cad-data/fonts/";
27425
27494
  }
27426
27495
  /**
27427
27496
  * Base URL to load fonts
@@ -27430,7 +27499,7 @@ class F0 {
27430
27499
  return this._baseUrl;
27431
27500
  }
27432
27501
  set baseUrl(e) {
27433
- this._baseUrl !== e && (this._baseUrl = e, this._avaiableFonts = [], this._avaiableFontMap.clear(), this._availableFontsPromise = null, this.onFontUrlChanged(e));
27502
+ this._baseUrl !== e && (this._baseUrl = e, this.clearAvailableFontsCache(), this._catalogRefreshAttempted = !1, this.onFontUrlChanged(e));
27434
27503
  }
27435
27504
  /**
27436
27505
  * Gets the list of available fonts
@@ -27473,81 +27542,99 @@ class F0 {
27473
27542
  async load(e) {
27474
27543
  if (e == null || e.length === 0)
27475
27544
  return [];
27476
- await this.getAvailableFonts();
27477
- const n = [], r = [], s = /* @__PURE__ */ new Map();
27478
- e.forEach((c) => {
27479
- const l = c.toLowerCase(), u = this._avaiableFontMap.get(l);
27480
- u && (s.set(l, u), $.instance.isFontLoaded(l) && n.push({
27481
- fontName: l,
27482
- url: u.url,
27545
+ await this.getAvailableFonts(), e.some(
27546
+ (l) => !this._avaiableFontMap.has(l.toLowerCase())
27547
+ ) && !this._catalogRefreshAttempted && (this._catalogRefreshAttempted = !0, await this.refreshAvailableFontsFromNetwork());
27548
+ const r = [], s = [], i = /* @__PURE__ */ new Map();
27549
+ e.forEach((l) => {
27550
+ const u = l.toLowerCase(), f = this._avaiableFontMap.get(u);
27551
+ f && (i.set(u, f), $.instance.isFontLoaded(u) && r.push({
27552
+ fontName: u,
27553
+ url: f.url,
27483
27554
  status: "Success"
27484
- }), r.push(u));
27555
+ }), s.push(f));
27485
27556
  });
27486
- const i = await $.instance.loadFonts(r), a = {};
27487
- [...n, ...i].forEach((c) => {
27488
- a[c.fontName] = c;
27557
+ const a = await $.instance.loadFonts(s), o = {};
27558
+ [...r, ...a].forEach((l) => {
27559
+ o[l.fontName] = l;
27489
27560
  });
27490
- const o = [];
27491
- for (const c of e) {
27492
- const l = c.toLowerCase(), u = a[l];
27493
- if (u) {
27494
- o.push(u);
27561
+ const c = [];
27562
+ for (const l of e) {
27563
+ const u = l.toLowerCase(), f = o[u];
27564
+ if (f) {
27565
+ c.push(f);
27495
27566
  continue;
27496
27567
  }
27497
- const f = s.get(l);
27498
- if (f) {
27499
- if ($.instance.isFontLoaded(l)) {
27500
- o.push({
27501
- fontName: l,
27502
- url: f.url,
27568
+ const h = i.get(u);
27569
+ if (h) {
27570
+ if ($.instance.isFontLoaded(u)) {
27571
+ c.push({
27572
+ fontName: u,
27573
+ url: h.url,
27503
27574
  status: "Success"
27504
27575
  });
27505
27576
  continue;
27506
27577
  }
27507
- const h = lt(
27508
- f.file
27509
- ).toLowerCase(), p = a[h];
27510
- if (p) {
27511
- o.push({
27512
- fontName: l,
27513
- url: f.url,
27514
- status: p.status
27578
+ const p = lt(
27579
+ h.file
27580
+ ).toLowerCase(), y = o[p];
27581
+ if (y) {
27582
+ c.push({
27583
+ fontName: u,
27584
+ url: h.url,
27585
+ status: y.status
27515
27586
  });
27516
27587
  continue;
27517
27588
  }
27518
27589
  }
27519
- if (await $.instance.loadFontFromCache(c)) {
27520
- o.push({
27521
- fontName: l,
27590
+ if (await $.instance.loadFontFromCache(l)) {
27591
+ c.push({
27592
+ fontName: u,
27522
27593
  url: "",
27523
27594
  status: "Success"
27524
27595
  });
27525
27596
  continue;
27526
27597
  }
27527
- o.push({
27528
- fontName: l,
27598
+ c.push({
27599
+ fontName: u,
27529
27600
  url: "",
27530
27601
  status: "NotFound"
27531
27602
  });
27532
27603
  }
27533
- return o;
27604
+ return c;
27605
+ }
27606
+ clearAvailableFontsCache() {
27607
+ this._avaiableFonts = [], this._avaiableFontMap.clear(), this._availableFontsPromise = null;
27608
+ }
27609
+ /**
27610
+ * Drops the in-memory catalog and refetches `fonts.json`, bypassing the HTTP
27611
+ * cache so CDN updates are visible after a miss.
27612
+ */
27613
+ async refreshAvailableFontsFromNetwork() {
27614
+ this.clearAvailableFontsCache();
27615
+ const e = this._baseUrl, n = this.fetchAvailableFonts(e, {
27616
+ bypassHttpCache: !0
27617
+ }).finally(() => {
27618
+ this._availableFontsPromise === n && (this._availableFontsPromise = null);
27619
+ });
27620
+ return this._availableFontsPromise = n, n;
27534
27621
  }
27535
27622
  /**
27536
27623
  * Fetches and caches remote font metadata for the given base URL.
27537
27624
  */
27538
- async fetchAvailableFonts(e) {
27539
- const n = e + "fonts.json";
27540
- let r;
27625
+ async fetchAvailableFonts(e, n) {
27626
+ const r = e + "fonts.json";
27627
+ let s;
27541
27628
  try {
27542
- r = await (await fetch(n)).json();
27543
- } catch (s) {
27629
+ s = await (n != null && n.bypassHttpCache ? await fetch(r, { cache: "no-cache" }) : await fetch(r)).json();
27630
+ } catch (i) {
27544
27631
  throw new Error(
27545
- `Filed to get avaiable font from '${n}' due to ${s}!`
27632
+ `Filed to get avaiable font from '${r}' due to ${i}!`
27546
27633
  );
27547
27634
  }
27548
- return this._baseUrl !== e ? this.getAvailableFonts() : (r.forEach((s) => {
27549
- s.url = e + s.file;
27550
- }), this._avaiableFonts = r, this.buildFontMap(), this._avaiableFonts);
27635
+ return this._baseUrl !== e ? this.getAvailableFonts() : (s.forEach((i) => {
27636
+ i.url = e + i.file;
27637
+ }), this._avaiableFonts = s, this.buildFontMap(), this._avaiableFonts);
27551
27638
  }
27552
27639
  /**
27553
27640
  * Build one font map. The key is font name. The value is font info.
@@ -28876,8 +28963,8 @@ function P0(t, e, n, r) {
28876
28963
  };
28877
28964
  }
28878
28965
  const N0 = 5 / 3, Gi = 1, bn = 0.3;
28879
- var Ge = /* @__PURE__ */ ((t) => (t[t.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", t[t.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", t[t.TOP_TO_BOTTOM = 3] = "TOP_TO_BOTTOM", t[t.BOTTOM_TO_TOP = 4] = "BOTTOM_TO_TOP", t[t.BY_STYLE = 5] = "BY_STYLE", t))(Ge || {}), Q = /* @__PURE__ */ ((t) => (t[t.TopLeft = 1] = "TopLeft", t[t.TopCenter = 2] = "TopCenter", t[t.TopRight = 3] = "TopRight", t[t.MiddleLeft = 4] = "MiddleLeft", t[t.MiddleCenter = 5] = "MiddleCenter", t[t.MiddleRight = 6] = "MiddleRight", t[t.BottomLeft = 7] = "BottomLeft", t[t.BottomCenter = 8] = "BottomCenter", t[t.BottomRight = 9] = "BottomRight", t[t.BaselineLeft = 10] = "BaselineLeft", t[t.BaselineCenter = 11] = "BaselineCenter", t[t.BaselineRight = 12] = "BaselineRight", t))(Q || {}), ue = /* @__PURE__ */ ((t) => (t.CHAR = "CHAR", t.STACK = "STACK", t))(ue || {});
28880
- const Tn = "", Ie = () => ({
28966
+ var He = /* @__PURE__ */ ((t) => (t[t.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", t[t.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", t[t.TOP_TO_BOTTOM = 3] = "TOP_TO_BOTTOM", t[t.BOTTOM_TO_TOP = 4] = "BOTTOM_TO_TOP", t[t.BY_STYLE = 5] = "BY_STYLE", t))(He || {}), Q = /* @__PURE__ */ ((t) => (t[t.TopLeft = 1] = "TopLeft", t[t.TopCenter = 2] = "TopCenter", t[t.TopRight = 3] = "TopRight", t[t.MiddleLeft = 4] = "MiddleLeft", t[t.MiddleCenter = 5] = "MiddleCenter", t[t.MiddleRight = 6] = "MiddleRight", t[t.BottomLeft = 7] = "BottomLeft", t[t.BottomCenter = 8] = "BottomCenter", t[t.BottomRight = 9] = "BottomRight", t[t.BaselineLeft = 10] = "BaselineLeft", t[t.BaselineCenter = 11] = "BaselineCenter", t[t.BaselineRight = 12] = "BaselineRight", t))(Q || {}), ue = /* @__PURE__ */ ((t) => (t.CHAR = "CHAR", t.STACK = "STACK", t))(ue || {});
28967
+ const Fn = "", Ie = () => ({
28881
28968
  byLayerColor: 16777215,
28882
28969
  byBlockColor: 16777215,
28883
28970
  layer: "0",
@@ -28896,7 +28983,7 @@ function G0(t) {
28896
28983
  }
28897
28984
  function Hr(t, e, n) {
28898
28985
  const r = [];
28899
- if (t.filter((h) => h.char !== Tn).forEach((h) => {
28986
+ if (t.filter((h) => h.char !== Fn).forEach((h) => {
28900
28987
  const p = G0(
28901
28988
  new I.Box3().copy(h.box).applyMatrix4(e)
28902
28989
  );
@@ -29497,7 +29584,7 @@ class $i {
29497
29584
  if (!r)
29498
29585
  return;
29499
29586
  this._lineBatchEntries = [];
29500
- const s = [], i = [], a = [], o = [], c = this.flowDirection === Ge.BOTTOM_TO_TOP ? 0 : -this.currentLayoutFontSize, l = this.buildShapeGeometry(
29587
+ const s = [], i = [], a = [], o = [], c = this.flowDirection === He.BOTTOM_TO_TOP ? 0 : -this.currentLayoutFontSize, l = this.buildShapeGeometry(
29501
29588
  r.shape,
29502
29589
  r.label,
29503
29590
  0,
@@ -29823,20 +29910,20 @@ class $i {
29823
29910
  this._hOffset = l, this._currentContext.charTrackingFactor = { value: 1, isRelative: !1 };
29824
29911
  let y = 0;
29825
29912
  for (const C of a) {
29826
- const T = this.getCharShape(C);
29827
- T && (y += T.width * this.currentWidthFactor);
29913
+ const F = this.getCharShape(C);
29914
+ F && (y += F.width * this.currentWidthFactor);
29828
29915
  }
29829
29916
  this._hOffset = l;
29830
29917
  let m = 0;
29831
29918
  for (const C of o) {
29832
- const T = this.getCharShape(C);
29833
- T && (m += T.width * this.currentWidthFactor);
29919
+ const F = this.getCharShape(C);
29920
+ F && (m += F.width * this.currentWidthFactor);
29834
29921
  }
29835
29922
  const b = Math.max(y, m), v = (b - y) / 2, w = (b - m) / 2;
29836
29923
  if (c === "^") {
29837
29924
  if (a && !o) {
29838
29925
  this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams();
29839
- const C = [], T = [], E = [], R = [];
29926
+ const C = [], F = [], E = [], R = [];
29840
29927
  this._hOffset = l, this._vOffset = this.convertTopAlignedVOffset(
29841
29928
  u + h * 0.1,
29842
29929
  this.currentFontSize
@@ -29845,14 +29932,14 @@ class $i {
29845
29932
  this.processChar(
29846
29933
  P,
29847
29934
  C,
29848
- T,
29935
+ F,
29849
29936
  E,
29850
29937
  R
29851
29938
  );
29852
- n.push(...C), r.push(...T), s.push(...E), i.push(...R), this._hOffset = l + y, this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams();
29939
+ n.push(...C), r.push(...F), s.push(...E), i.push(...R), this._hOffset = l + y, this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams();
29853
29940
  } else if (!a && o) {
29854
29941
  this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams();
29855
- const C = [], T = [], E = [], R = [];
29942
+ const C = [], F = [], E = [], R = [];
29856
29943
  this._hOffset = l, this._vOffset = this.convertTopAlignedVOffset(
29857
29944
  u - h * 0.6,
29858
29945
  this.currentFontSize
@@ -29861,15 +29948,15 @@ class $i {
29861
29948
  this.processChar(
29862
29949
  P,
29863
29950
  C,
29864
- T,
29951
+ F,
29865
29952
  E,
29866
29953
  R
29867
29954
  );
29868
- n.push(...C), r.push(...T), s.push(...E), i.push(...R), this._hOffset = l + m, this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams();
29955
+ n.push(...C), r.push(...F), s.push(...E), i.push(...R), this._hOffset = l + m, this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams();
29869
29956
  } else if (a && o) {
29870
- const C = this._currentContext.fontScaleFactor || 1, T = (this._maxFontSize || this.currentFontSize) / C, E = Math.abs(this.currentLayoutFontSize - T) < 1e-6;
29957
+ const C = this._currentContext.fontScaleFactor || 1, F = (this._maxFontSize || this.currentFontSize) / C, E = Math.abs(this.currentLayoutFontSize - F) < 1e-6;
29871
29958
  E && (this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams());
29872
- const R = Math.max(y, m), P = 0, W = 0, j = this.currentLayoutFontSize, N = u - T + j, X = N + this.currentFontSize, ie = [], U = [], M = [], _ = [];
29959
+ const R = Math.max(y, m), P = 0, W = 0, j = this.currentLayoutFontSize, N = u - F + j, X = N + this.currentFontSize, ie = [], U = [], M = [], _ = [];
29873
29960
  this._hOffset = l + P, this._vOffset = X;
29874
29961
  for (const me of a)
29875
29962
  this.processChar(
@@ -29880,20 +29967,20 @@ class $i {
29880
29967
  _
29881
29968
  );
29882
29969
  n.push(...ie), r.push(...U), s.push(...M), i.push(..._);
29883
- const re = [], Te = [], Qe = [], _e = [];
29970
+ const re = [], Fe = [], et = [], _e = [];
29884
29971
  this._hOffset = l + W, this._vOffset = N;
29885
29972
  for (const me of o)
29886
29973
  this.processChar(
29887
29974
  me,
29888
29975
  re,
29889
- Te,
29890
- Qe,
29976
+ Fe,
29977
+ et,
29891
29978
  _e
29892
29979
  );
29893
- n.push(...re), r.push(...Te), s.push(...Qe), i.push(..._e), this._hOffset = l + R, E && (this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams());
29980
+ n.push(...re), r.push(...Fe), s.push(...et), i.push(..._e), this._hOffset = l + R, E && (this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams());
29894
29981
  }
29895
29982
  } else {
29896
- const C = [], T = [], E = [], R = [];
29983
+ const C = [], F = [], E = [], R = [];
29897
29984
  this._hOffset = l + v, this._vOffset = this.convertTopAlignedVOffset(
29898
29985
  u + this.currentFontSize * 0.3,
29899
29986
  this.currentFontSize
@@ -29902,11 +29989,11 @@ class $i {
29902
29989
  this.processChar(
29903
29990
  X,
29904
29991
  C,
29905
- T,
29992
+ F,
29906
29993
  E,
29907
29994
  R
29908
29995
  );
29909
- n.push(...C), r.push(...T), s.push(...E), i.push(...R), (c === "/" || c === "#") && this.recordStackDivider(
29996
+ n.push(...C), r.push(...F), s.push(...E), i.push(...R), (c === "/" || c === "#") && this.recordStackDivider(
29910
29997
  l,
29911
29998
  u,
29912
29999
  b,
@@ -29965,12 +30052,12 @@ class $i {
29965
30052
  this.resolveCharBoxTarget(s, i) === "mesh" ? s.push({
29966
30053
  type: ue.CHAR,
29967
30054
  box: o,
29968
- char: Tn,
30055
+ char: Fn,
29969
30056
  children: []
29970
30057
  }) : i.push({
29971
30058
  type: ue.CHAR,
29972
30059
  box: o,
29973
- char: Tn,
30060
+ char: Fn,
29974
30061
  children: []
29975
30062
  });
29976
30063
  }
@@ -29993,7 +30080,7 @@ class $i {
29993
30080
  */
29994
30081
  processBlank(e, n) {
29995
30082
  if (this._options.collectCharBoxes !== !1) {
29996
- const r = this._hOffset, s = this.flowDirection == Ge.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.currentLayoutFontSize, i = new I.Box3(
30083
+ const r = this._hOffset, s = this.flowDirection == He.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.currentLayoutFontSize, i = new I.Box3(
29997
30084
  new I.Vector3(r, s, 0),
29998
30085
  new I.Vector3(
29999
30086
  r + this.currentBlankAdvance,
@@ -30033,7 +30120,7 @@ class $i {
30033
30120
  * Appends vertical layout metadata for the current visual line to {@link _lineLayouts}.
30034
30121
  */
30035
30122
  recordCurrentLineLayout() {
30036
- const e = this.flowDirection == Ge.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.defaultFontSize, n = this.currentLineHeight;
30123
+ const e = this.flowDirection == He.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.defaultFontSize, n = this.currentLineHeight;
30037
30124
  this._lineLayouts.push({
30038
30125
  y: e + n / 2,
30039
30126
  height: n
@@ -30083,7 +30170,7 @@ class $i {
30083
30170
  return;
30084
30171
  }
30085
30172
  this._lineHasRenderableChar || this.applyPendingEmptyLineYAdjust(), this.hOffset > (this.maxLineWidth || 1 / 0) && (this.recordVisualLineBreak(s, i), this.advanceToNextLine(!1));
30086
- const l = this.hOffset, u = this.flowDirection == Ge.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.currentLayoutFontSize, f = this.currentLayoutFontSize, h = c.width * this.currentWidthFactor, { matrix: p, obliqueExtraAdvance: y } = this.buildCharTransformMatrix(
30173
+ const l = this.hOffset, u = this.flowDirection == He.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.currentLayoutFontSize, f = this.currentLayoutFontSize, h = c.width * this.currentWidthFactor, { matrix: p, obliqueExtraAdvance: y } = this.buildCharTransformMatrix(
30087
30174
  l,
30088
30175
  u,
30089
30176
  f
@@ -30270,7 +30357,7 @@ class $i {
30270
30357
  * @param collectBreakIndex When `true`, records a char index for automatic wrapping.
30271
30358
  */
30272
30359
  advanceToNextLine(e = !0) {
30273
- e && this.recordVisualLineBreak(), this.captureCurrentLineAdvance(), this.recordCurrentLineLayout(), this._hOffset = 0, this._lineHasRenderableChar ? this._pendingEmptyLineFontSizeAdjust = void 0 : this._pendingEmptyLineFontSizeAdjust = this.currentFontSize, this.flowDirection == Ge.BOTTOM_TO_TOP ? this._vOffset += this.currentLineHeight : this._vOffset -= this.currentLineHeight, this._lineCount++, this.processAlignment(), this._currentLineObjects = [], this._lineCount == 2 ? this._totalHeight = this.currentMaxFontSize : this._totalHeight = this._totalHeight + this.currentLineHeight, this._maxFontSize = 0, this._lineHasRenderableChar = !1;
30360
+ e && this.recordVisualLineBreak(), this.captureCurrentLineAdvance(), this.recordCurrentLineLayout(), this._hOffset = 0, this._lineHasRenderableChar ? this._pendingEmptyLineFontSizeAdjust = void 0 : this._pendingEmptyLineFontSizeAdjust = this.currentFontSize, this.flowDirection == He.BOTTOM_TO_TOP ? this._vOffset += this.currentLineHeight : this._vOffset -= this.currentLineHeight, this._lineCount++, this.processAlignment(), this._currentLineObjects = [], this._lineCount == 2 ? this._totalHeight = this.currentMaxFontSize : this._totalHeight = this._totalHeight + this.currentLineHeight, this._maxFontSize = 0, this._lineHasRenderableChar = !1;
30274
30361
  }
30275
30362
  /**
30276
30363
  * Updates {@link _maxLineAdvance} from the current line's horizontal pen position.
@@ -30290,7 +30377,7 @@ class $i {
30290
30377
  */
30291
30378
  countFinalCharBoxes(e, n, r) {
30292
30379
  const s = [...e, ...n].filter(
30293
- (f) => f.char !== Tn
30380
+ (f) => f.char !== Fn
30294
30381
  );
30295
30382
  if (r !== ue.STACK)
30296
30383
  return s.length;
@@ -30312,7 +30399,7 @@ class $i {
30312
30399
  applyPendingEmptyLineYAdjust() {
30313
30400
  if (this._pendingEmptyLineFontSizeAdjust === void 0) return;
30314
30401
  const e = this.currentFontSize - this._pendingEmptyLineFontSizeAdjust;
30315
- e !== 0 && (this.flowDirection == Ge.BOTTOM_TO_TOP ? this._vOffset += e : this._vOffset -= e), this._pendingEmptyLineFontSizeAdjust = void 0;
30402
+ e !== 0 && (this.flowDirection == He.BOTTOM_TO_TOP ? this._vOffset += e : this._vOffset -= e), this._pendingEmptyLineFontSizeAdjust = void 0;
30316
30403
  }
30317
30404
  /**
30318
30405
  * Chooses whether subsequent char boxes should attach to mesh or line geometry owners.
@@ -30521,7 +30608,7 @@ function Q0(t) {
30521
30608
  return String.fromCharCode(r);
30522
30609
  });
30523
30610
  }
30524
- const $t = /* @__PURE__ */ new I.Vector3(), nt = /* @__PURE__ */ new I.Vector3(), rt = /* @__PURE__ */ new I.Vector3(), Yi = /* @__PURE__ */ new I.Vector3(1, 0, 0);
30611
+ const $t = /* @__PURE__ */ new I.Vector3(), rt = /* @__PURE__ */ new I.Vector3(), st = /* @__PURE__ */ new I.Vector3(), Yi = /* @__PURE__ */ new I.Vector3(1, 0, 0);
30525
30612
  class tn extends I.Object3D {
30526
30613
  /**
30527
30614
  * Extracts all unique font names used in an MText string.
@@ -30597,7 +30684,15 @@ class tn extends I.Object3D {
30597
30684
  }
30598
30685
  }
30599
30686
  const r = (e == null ? void 0 : e.awaitFonts) ?? (!this._fontManager.lazyFontLoading || this._fontManager.awaitFontsBeforeDraw), s = r ? [.../* @__PURE__ */ new Set([...n, ...this._fontManager.getFontsToLoad()])] : n;
30600
- s.length > 0 && (this._fontManager.lazyFontLoading ? r ? await this._fontManager.requestFonts(s) : this._fontManager.requestFonts(s) : await this._fontManager.loadFontsByNames(s), n.length > 0 && (this._fontsInStyleLoaded = !0)), this.syncDraw();
30687
+ if (s.length > 0 && (this._fontManager.lazyFontLoading ? r ? await this._fontManager.requestFonts(s) : this._fontManager.requestFonts(s) : await this._fontManager.loadFontsByNames(s), n.length > 0)) {
30688
+ const i = [
30689
+ this._style.font ? this.getFontName(this._style.font) : void 0,
30690
+ this._style.bigFont ? this.getFontName(this._style.bigFont) : void 0,
30691
+ this._style.extendedFont ? this.getFontName(this._style.extendedFont) : void 0
30692
+ ].filter((o) => !!o);
30693
+ (i.length === 0 || i.every((o) => this._fontManager.isFontLoaded(o))) && (this._fontsInStyleLoaded = !0);
30694
+ }
30695
+ this.syncDraw();
30601
30696
  }
30602
30697
  /**
30603
30698
  * Draw the MText object. This method assumes that fonts needed are loaded. If font needed
@@ -30705,18 +30800,15 @@ class tn extends I.Object3D {
30705
30800
  position: e.position,
30706
30801
  rotation: e.rotation,
30707
30802
  directionVector: e.directionVector,
30708
- drawingDirection: Ge.BOTTOM_TO_TOP,
30803
+ drawingDirection: He.BOTTOM_TO_TOP,
30709
30804
  collectCharBoxes: !1
30710
30805
  };
30711
- return this.finalizePlacement(
30712
- r,
30713
- i,
30714
- s,
30715
- { shxFontType: this._fontManager.getShxFontType(n.font) }
30716
- );
30806
+ return this.finalizePlacement(r, i, s, {
30807
+ shxFontType: this._fontManager.getShxFontType(n.font)
30808
+ });
30717
30809
  }
30718
30810
  /**
30719
- *
30811
+ *
30720
30812
  * @param options.shxFontType The type of SHX font.
30721
30813
  */
30722
30814
  finalizePlacement(e, n, r, s) {
@@ -30736,7 +30828,10 @@ class tn extends I.Object3D {
30736
30828
  n.drawingDirection
30737
30829
  );
30738
30830
  let c = { x: 0, y: 0 };
30739
- (s == null ? void 0 : s.shxFontType) === K.SHAPES ? c = { x: 0, y: 0 } : c = this.calculateAnchorPoint(o, n.attachmentPoint), e.userData.logicalBounds = {
30831
+ (s == null ? void 0 : s.shxFontType) === K.SHAPES ? c = { x: 0, y: 0 } : c = this.calculateAnchorPoint(
30832
+ o,
30833
+ n.attachmentPoint
30834
+ ), e.userData.logicalBounds = {
30740
30835
  minX: o.minX + c.x,
30741
30836
  maxX: o.maxX + c.x,
30742
30837
  minY: o.minY + c.y,
@@ -30781,7 +30876,7 @@ class tn extends I.Object3D {
30781
30876
  lineSpaceFactor: Gi,
30782
30877
  horizontalAlignment: oe.LEFT,
30783
30878
  maxWidth: 0,
30784
- flowDirection: Ge.BOTTOM_TO_TOP,
30879
+ flowDirection: He.BOTTOM_TO_TOP,
30785
30880
  byBlockColor: this._colorSettings.byBlockColor,
30786
30881
  byLayerColor: this._colorSettings.byLayerColor,
30787
30882
  removeFontExtension: !0,
@@ -30840,7 +30935,7 @@ class tn extends I.Object3D {
30840
30935
  Q.MiddleCenter,
30841
30936
  Q.MiddleRight
30842
30937
  ].includes(e.attachmentPoint) ? a = dt.MIDDLE : a = dt.BOTTOM);
30843
- const o = e.height || n.fixedTextHeight || 0, c = e.widthFactor || n.widthFactor || 1, l = e.lineSpaceFactor ?? Gi, u = e.drawingDirection ?? Ge.LEFT_TO_RIGHT, f = {
30938
+ const o = e.height || n.fixedTextHeight || 0, c = e.widthFactor || n.widthFactor || 1, l = e.lineSpaceFactor ?? Gi, u = e.drawingDirection ?? He.LEFT_TO_RIGHT, f = {
30844
30939
  fontSize: o,
30845
30940
  widthFactor: c,
30846
30941
  lineSpaceFactor: l,
@@ -30914,15 +31009,15 @@ class tn extends I.Object3D {
30914
31009
  var v;
30915
31010
  const b = (v = m.userData) == null ? void 0 : v.lineLayouts;
30916
31011
  !b || b.length === 0 || b.forEach((w) => {
30917
- const C = w.y - w.height / 2, T = w.y + w.height / 2;
30918
- a.hasLine = !0, a.minY = Math.min(a.minY, C), a.maxY = Math.max(a.maxY, T), o || (a.baselineY = C, o = !0);
31012
+ const C = w.y - w.height / 2, F = w.y + w.height / 2;
31013
+ a.hasLine = !0, a.minY = Math.min(a.minY, C), a.maxY = Math.max(a.maxY, F), o || (a.baselineY = C, o = !0);
30919
31014
  });
30920
31015
  });
30921
31016
  const c = s.isEmpty() ? 0 : s.max.y - s.min.y, l = Number.isFinite(c) && c > 0 ? c : Number.isFinite(r) && r > 0 ? r : 0;
30922
31017
  let u = 0, f = Number.isFinite(n) && n > 0 ? n : 0;
30923
31018
  f <= u && !s.isEmpty() && (u = s.min.x, f = s.max.x);
30924
31019
  let h = 0, p = 0;
30925
- i == Ge.BOTTOM_TO_TOP ? (h = s.isEmpty() ? 0 : s.min.y, p = h + l) : (p = s.isEmpty() ? 0 : s.max.y, h = p - l);
31020
+ i == He.BOTTOM_TO_TOP ? (h = s.isEmpty() ? 0 : s.min.y, p = h + l) : (p = s.isEmpty() ? 0 : s.max.y, h = p - l);
30926
31021
  const y = a.hasLine ? a.baselineY : h;
30927
31022
  return { minX: u, maxX: f, minY: h, maxY: p, baselineY: y };
30928
31023
  }
@@ -31008,9 +31103,9 @@ class tn extends I.Object3D {
31008
31103
  e.updateWorldMatrix(!1, !1);
31009
31104
  const s = (c = (o = e.userData) == null ? void 0 : o.layout) == null ? void 0 : c.chars, i = (l = e.userData) == null ? void 0 : l.lineLayouts;
31010
31105
  if (i && i.length > 0 && i.forEach((h) => {
31011
- $t.set(0, h.y, 0).applyMatrix4(e.matrixWorld), nt.set(0, h.y - h.height / 2, 0).applyMatrix4(e.matrixWorld), rt.set(0, h.y + h.height / 2, 0).applyMatrix4(e.matrixWorld), r.push({
31106
+ $t.set(0, h.y, 0).applyMatrix4(e.matrixWorld), rt.set(0, h.y - h.height / 2, 0).applyMatrix4(e.matrixWorld), st.set(0, h.y + h.height / 2, 0).applyMatrix4(e.matrixWorld), r.push({
31012
31107
  y: $t.y,
31013
- height: Math.abs(rt.y - nt.y),
31108
+ height: Math.abs(st.y - rt.y),
31014
31109
  breakIndex: h.breakIndex
31015
31110
  });
31016
31111
  }), s && s.length > 0) {
@@ -31075,7 +31170,7 @@ class tn extends I.Object3D {
31075
31170
  }
31076
31171
  const s = (c = e.userData) == null ? void 0 : c.lineLayouts;
31077
31172
  s && s.length > 0 && s.forEach((p) => {
31078
- nt.set(0, p.y - p.height / 2, 0).applyMatrix4(e.matrixWorld), rt.set(0, p.y + p.height / 2, 0).applyMatrix4(e.matrixWorld), n.hasLine = !0, n.minX = Math.min(n.minX, nt.x, rt.x), n.maxX = Math.max(n.maxX, nt.x, rt.x), n.minY = Math.min(n.minY, nt.y, rt.y), n.maxY = Math.max(n.maxY, nt.y, rt.y), n.minZ = Math.min(n.minZ, nt.z, rt.z), n.maxZ = Math.max(n.maxZ, nt.z, rt.z);
31173
+ rt.set(0, p.y - p.height / 2, 0).applyMatrix4(e.matrixWorld), st.set(0, p.y + p.height / 2, 0).applyMatrix4(e.matrixWorld), n.hasLine = !0, n.minX = Math.min(n.minX, rt.x, st.x), n.maxX = Math.max(n.maxX, rt.x, st.x), n.minY = Math.min(n.minY, rt.y, st.y), n.maxY = Math.max(n.maxY, rt.y, st.y), n.minZ = Math.min(n.minZ, rt.z, st.z), n.maxZ = Math.max(n.maxZ, rt.z, st.z);
31079
31174
  });
31080
31175
  const i = (u = (l = e.userData) == null ? void 0 : l.layout) == null ? void 0 : u.chars;
31081
31176
  if (i && i.length > 0) {
@@ -31168,7 +31263,9 @@ class Xi extends I.Object3D {
31168
31263
  a && n.push(a);
31169
31264
  }
31170
31265
  const r = (e == null ? void 0 : e.awaitFonts) ?? (!this._fontManager.lazyFontLoading || this._fontManager.awaitFontsBeforeDraw), s = r ? [.../* @__PURE__ */ new Set([...n, ...this._fontManager.getFontsToLoad()])] : n;
31171
- s.length > 0 && (this._fontManager.lazyFontLoading ? r ? await this._fontManager.requestFonts(s) : this._fontManager.requestFonts(s) : await this._fontManager.loadFontsByNames(s), n.length > 0 && (this._fontsInStyleLoaded = !0)), this.syncDraw();
31266
+ s.length > 0 && (this._fontManager.lazyFontLoading ? r ? await this._fontManager.requestFonts(s) : this._fontManager.requestFonts(s) : await this._fontManager.loadFontsByNames(s), n.length > 0 && n.every(
31267
+ (a) => this._fontManager.isFontLoaded(a)
31268
+ ) && (this._fontsInStyleLoaded = !0)), this.syncDraw();
31172
31269
  }
31173
31270
  syncDraw() {
31174
31271
  const n = new tn(
@@ -31193,7 +31290,7 @@ class Xi extends I.Object3D {
31193
31290
  position: this._shapeData.position,
31194
31291
  rotation: this._shapeData.rotation,
31195
31292
  directionVector: this._shapeData.directionVector,
31196
- drawingDirection: Ge.BOTTOM_TO_TOP,
31293
+ drawingDirection: He.BOTTOM_TO_TOP,
31197
31294
  collectCharBoxes: !1
31198
31295
  };
31199
31296
  }
@@ -31726,6 +31823,10 @@ class t1 {
31726
31823
  */
31727
31824
  async setFontUrl(e) {
31728
31825
  this.fontManager.baseUrl = e;
31826
+ try {
31827
+ await this.fontManager.getAvailableFonts();
31828
+ } catch {
31829
+ }
31729
31830
  }
31730
31831
  /**
31731
31832
  * Render MText directly in the main thread asynchronously. Fonts referenced by
@@ -31806,7 +31907,13 @@ class t1 {
31806
31907
  destroy() {
31807
31908
  }
31808
31909
  async ensureInitialized() {
31809
- this.isInitialized || (this.fontManager.lazyFontLoading || await this.loadFonts(this.fontManager.getFontsToLoad()), this.isInitialized = !0);
31910
+ if (!this.isInitialized) {
31911
+ try {
31912
+ await this.fontManager.getAvailableFonts();
31913
+ } catch {
31914
+ }
31915
+ this.fontManager.lazyFontLoading || await this.loadFonts(this.fontManager.getFontsToLoad()), this.isInitialized = !0;
31916
+ }
31810
31917
  }
31811
31918
  }
31812
31919
  class c1 {
@@ -31818,7 +31925,7 @@ class c1 {
31818
31925
  * when render mode is 'worker'.
31819
31926
  */
31820
31927
  constructor(e = "main", n = {}) {
31821
- this.webWorkerRenderer = null, this.webWorkerConfigured = !1, this.workerLazyFontLoading = null, this.workerAwaitFontsBeforeDraw = null, this.defaultMode = e, this.workerConfig = n, this.mainThreadRenderer = new t1(), this.renderer = this.mainThreadRenderer, e === "worker" && (this.renderer = this.ensureWebWorkerRenderer());
31928
+ this.webWorkerRenderer = null, this.webWorkerConfigured = !1, this.workerLazyFontLoading = null, this.workerAwaitFontsBeforeDraw = null, this.workerFontUrl = null, this.defaultMode = e, this.workerConfig = n, this.mainThreadRenderer = new t1(), this.renderer = this.mainThreadRenderer, e === "worker" && (this.renderer = this.ensureWebWorkerRenderer());
31822
31929
  }
31823
31930
  ensureWebWorkerRenderer() {
31824
31931
  return this.webWorkerRenderer || (this.webWorkerRenderer = new e1(this.workerConfig), this.webWorkerRenderer.styleManager = this.mainThreadRenderer.styleManager, this.webWorkerConfigured = !1), this.webWorkerRenderer;
@@ -31829,10 +31936,12 @@ class c1 {
31829
31936
  [...$.instance.defaultFonts],
31830
31937
  [...$.instance.symbolFonts]
31831
31938
  ), this.webWorkerConfigured = !0);
31832
- const n = $.instance.lazyFontLoading;
31833
- this.workerLazyFontLoading !== n && (await e.setLazyFontLoading(n), this.workerLazyFontLoading = n);
31834
- const r = $.instance.awaitFontsBeforeDraw;
31835
- return this.workerAwaitFontsBeforeDraw !== r && (await e.setAwaitFontsBeforeDraw(r), this.workerAwaitFontsBeforeDraw = r), e;
31939
+ const n = $.instance.baseUrl;
31940
+ n && this.workerFontUrl !== n && (await e.setFontUrl(n), this.workerFontUrl = n);
31941
+ const r = $.instance.lazyFontLoading;
31942
+ this.workerLazyFontLoading !== r && (await e.setLazyFontLoading(r), this.workerLazyFontLoading = r);
31943
+ const s = $.instance.awaitFontsBeforeDraw;
31944
+ return this.workerAwaitFontsBeforeDraw !== s && (await e.setAwaitFontsBeforeDraw(s), this.workerAwaitFontsBeforeDraw = s), e;
31836
31945
  }
31837
31946
  /**
31838
31947
  * Sets one new style manager to override the default style manager.
@@ -31858,8 +31967,8 @@ class c1 {
31858
31967
  * Set URL to load fonts
31859
31968
  * @param value - URL to load fonts
31860
31969
  */
31861
- setFontUrl(e) {
31862
- return this.renderer.setFontUrl(e);
31970
+ async setFontUrl(e) {
31971
+ await this.mainThreadRenderer.setFontUrl(e), this.webWorkerRenderer && (await this.webWorkerRenderer.setFontUrl(e), this.workerFontUrl = e);
31863
31972
  }
31864
31973
  /**
31865
31974
  * Get the default rendering mode
@@ -31991,7 +32100,7 @@ class c1 {
31991
32100
  fonts: []
31992
32101
  };
31993
32102
  try {
31994
- r = await st.instance.getStorageStats();
32103
+ r = await Ue.instance.getStorageStats();
31995
32104
  } catch {
31996
32105
  }
31997
32106
  const s = e.totalEstimatedBytes + n.reduce((i, a) => i + a.totalEstimatedBytes, 0);
@@ -32021,7 +32130,7 @@ class c1 {
32021
32130
  */
32022
32131
  terminateWorkers() {
32023
32132
  var e;
32024
- (e = this.webWorkerRenderer) == null || e.terminate(), this.webWorkerRenderer = null, this.webWorkerConfigured = !1, this.workerLazyFontLoading = null, this.renderer = this.mainThreadRenderer;
32133
+ (e = this.webWorkerRenderer) == null || e.terminate(), this.webWorkerRenderer = null, this.webWorkerConfigured = !1, this.workerLazyFontLoading = null, this.workerAwaitFontsBeforeDraw = null, this.workerFontUrl = null, this.renderer = this.mainThreadRenderer;
32025
32134
  }
32026
32135
  /**
32027
32136
  * Clean up resources
@@ -32037,9 +32146,9 @@ export {
32037
32146
  ue as CharBoxType,
32038
32147
  Ar as DEFAULT_FONTS_PRESETS,
32039
32148
  Gi as DEFAULT_LINE_SPACE_FACTOR,
32040
- F0 as DefaultFontLoader,
32149
+ T0 as DefaultFontLoader,
32041
32150
  gs as EventManager,
32042
- Ke as FontFactory,
32151
+ Ze as FontFactory,
32043
32152
  $ as FontManager,
32044
32153
  N0 as LINE_SPACING_SCALE_FACTOR,
32045
32154
  Sc as MATERIAL_ESTIMATED_BYTES,
@@ -32051,15 +32160,15 @@ export {
32051
32160
  Q as MTextAttachmentPoint,
32052
32161
  bt as MTextColor,
32053
32162
  ln as MTextContext,
32054
- Ge as MTextFlowDirection,
32163
+ He as MTextFlowDirection,
32055
32164
  dt as MTextLineAlignment,
32056
32165
  oe as MTextParagraphAlignment,
32057
32166
  _0 as MTextParser,
32058
32167
  ht as MTextStroke,
32059
32168
  vr as MTextToken,
32060
32169
  t1 as MainThreadRenderer,
32061
- Tc as SHX_PARSED_FONT_OVERHEAD,
32062
- Tn as STACK_DIVIDER_CHAR,
32170
+ Fc as SHX_PARSED_FONT_OVERHEAD,
32171
+ Fn as STACK_DIVIDER_CHAR,
32063
32172
  bn as STACK_VERTICAL_SHIFT_FACTOR,
32064
32173
  Zn as SYMBOL_FONTS_PRESETS,
32065
32174
  Xi as Shape,