@mlightcad/mtext-renderer 0.5.1 → 0.6.1

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
@@ -111,7 +111,7 @@ class Tn extends R.Shape {
111
111
  super(), this.width = 0, this.char = e;
112
112
  }
113
113
  }
114
- const _t = (t, e) => e.some((r) => t instanceof r);
114
+ const Ht = (t, e) => e.some((r) => t instanceof r);
115
115
  let br, Sr;
116
116
  function Oa() {
117
117
  return br || (br = [
@@ -129,7 +129,7 @@ function Ua() {
129
129
  IDBCursor.prototype.continuePrimaryKey
130
130
  ]);
131
131
  }
132
- const Ht = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap();
132
+ const Wt = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakMap();
133
133
  function La(t) {
134
134
  const e = new Promise((r, n) => {
135
135
  const a = () => {
@@ -141,10 +141,10 @@ function La(t) {
141
141
  };
142
142
  t.addEventListener("success", s), t.addEventListener("error", i);
143
143
  });
144
- return vt.set(e, t), e;
144
+ return yt.set(e, t), e;
145
145
  }
146
146
  function Ra(t) {
147
- if (Ht.has(t))
147
+ if (Wt.has(t))
148
148
  return;
149
149
  const e = new Promise((r, n) => {
150
150
  const a = () => {
@@ -156,13 +156,13 @@ function Ra(t) {
156
156
  };
157
157
  t.addEventListener("complete", s), t.addEventListener("error", i), t.addEventListener("abort", i);
158
158
  });
159
- Ht.set(t, e);
159
+ Wt.set(t, e);
160
160
  }
161
161
  let zt = {
162
162
  get(t, e, r) {
163
163
  if (t instanceof IDBTransaction) {
164
164
  if (e === "done")
165
- return Ht.get(t);
165
+ return Wt.get(t);
166
166
  if (e === "store")
167
167
  return r.objectStoreNames[1] ? void 0 : r.objectStore(r.objectStoreNames[0]);
168
168
  }
@@ -180,24 +180,24 @@ function wn(t) {
180
180
  }
181
181
  function Aa(t) {
182
182
  return Ua().includes(t) ? function(...e) {
183
- return t.apply(Wt(this), e), Re(this.request);
183
+ return t.apply(Vt(this), e), Re(this.request);
184
184
  } : function(...e) {
185
- return Re(t.apply(Wt(this), e));
185
+ return Re(t.apply(Vt(this), e));
186
186
  };
187
187
  }
188
188
  function Ma(t) {
189
- return typeof t == "function" ? Aa(t) : (t instanceof IDBTransaction && Ra(t), _t(t, Oa()) ? new Proxy(t, zt) : t);
189
+ return typeof t == "function" ? Aa(t) : (t instanceof IDBTransaction && Ra(t), Ht(t, Oa()) ? new Proxy(t, zt) : t);
190
190
  }
191
191
  function Re(t) {
192
192
  if (t instanceof IDBRequest)
193
193
  return La(t);
194
- if (St.has(t))
195
- return St.get(t);
194
+ if (kt.has(t))
195
+ return kt.get(t);
196
196
  const e = Ma(t);
197
- return e !== t && (St.set(t, e), vt.set(e, t)), e;
197
+ return e !== t && (kt.set(t, e), yt.set(e, t)), e;
198
198
  }
199
- const Wt = (t) => vt.get(t);
200
- function Pa(t, e, { blocked: r, upgrade: n, blocking: a, terminated: s } = {}) {
199
+ const Vt = (t) => yt.get(t);
200
+ function Ba(t, e, { blocked: r, upgrade: n, blocking: a, terminated: s } = {}) {
201
201
  const i = indexedDB.open(t, e), o = Re(i);
202
202
  return n && i.addEventListener("upgradeneeded", (u) => {
203
203
  n(Re(i.result), u.oldVersion, u.newVersion, Re(i.transaction), u);
@@ -211,16 +211,16 @@ function Pa(t, e, { blocked: r, upgrade: n, blocking: a, terminated: s } = {}) {
211
211
  }).catch(() => {
212
212
  }), o;
213
213
  }
214
- const Ba = ["get", "getKey", "getAll", "getAllKeys", "count"], Ia = ["put", "add", "delete", "clear"], kt = /* @__PURE__ */ new Map();
214
+ const Pa = ["get", "getKey", "getAll", "getAllKeys", "count"], Ia = ["put", "add", "delete", "clear"], Ft = /* @__PURE__ */ new Map();
215
215
  function kr(t, e) {
216
216
  if (!(t instanceof IDBDatabase && !(e in t) && typeof e == "string"))
217
217
  return;
218
- if (kt.get(e))
219
- return kt.get(e);
218
+ if (Ft.get(e))
219
+ return Ft.get(e);
220
220
  const r = e.replace(/FromIndex$/, ""), n = e !== r, a = Ia.includes(r);
221
221
  if (
222
222
  // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
223
- !(r in (n ? IDBIndex : IDBObjectStore).prototype) || !(a || Ba.includes(r))
223
+ !(r in (n ? IDBIndex : IDBObjectStore).prototype) || !(a || Pa.includes(r))
224
224
  )
225
225
  return;
226
226
  const s = async function(i, ...o) {
@@ -231,20 +231,20 @@ function kr(t, e) {
231
231
  a && u.done
232
232
  ]))[0];
233
233
  };
234
- return kt.set(e, s), s;
234
+ return Ft.set(e, s), s;
235
235
  }
236
236
  wn((t) => ({
237
237
  ...t,
238
238
  get: (e, r, n) => kr(e, r) || t.get(e, r, n),
239
239
  has: (e, r) => !!kr(e, r) || t.has(e, r)
240
240
  }));
241
- const Da = ["continue", "continuePrimaryKey", "advance"], Fr = {}, Vt = /* @__PURE__ */ new WeakMap(), Cn = /* @__PURE__ */ new WeakMap(), Ga = {
241
+ const Da = ["continue", "continuePrimaryKey", "advance"], Fr = {}, qt = /* @__PURE__ */ new WeakMap(), Cn = /* @__PURE__ */ new WeakMap(), Ga = {
242
242
  get(t, e) {
243
243
  if (!Da.includes(e))
244
244
  return t[e];
245
245
  let r = Fr[e];
246
246
  return r || (r = Fr[e] = function(...n) {
247
- Vt.set(this, Cn.get(this)[e](...n));
247
+ qt.set(this, Cn.get(this)[e](...n));
248
248
  }), r;
249
249
  }
250
250
  };
@@ -254,11 +254,11 @@ async function* Na(...t) {
254
254
  return;
255
255
  e = e;
256
256
  const r = new Proxy(e, Ga);
257
- for (Cn.set(r, e), vt.set(r, Wt(e)); e; )
258
- yield r, e = await (Vt.get(r) || e.continue()), Vt.delete(r);
257
+ for (Cn.set(r, e), yt.set(r, Vt(e)); e; )
258
+ yield r, e = await (qt.get(r) || e.continue()), qt.delete(r);
259
259
  }
260
260
  function Tr(t, e) {
261
- return e === Symbol.asyncIterator && _t(t, [IDBIndex, IDBObjectStore, IDBCursor]) || e === "iterate" && _t(t, [IDBIndex, IDBObjectStore]);
261
+ return e === Symbol.asyncIterator && Ht(t, [IDBIndex, IDBObjectStore, IDBCursor]) || e === "iterate" && Ht(t, [IDBIndex, IDBObjectStore]);
262
262
  }
263
263
  wn((t) => ({
264
264
  ...t,
@@ -269,14 +269,14 @@ wn((t) => ({
269
269
  return Tr(e, r) || t.has(e, r);
270
270
  }
271
271
  }));
272
- const Pe = {
272
+ const Be = {
273
273
  fonts: "fonts"
274
- }, Ft = [
274
+ }, Tt = [
275
275
  {
276
276
  version: 1,
277
277
  stores: [
278
278
  {
279
- name: Pe.fonts,
279
+ name: Be.fonts,
280
280
  keyPath: "name"
281
281
  }
282
282
  ]
@@ -299,7 +299,7 @@ const Pe = {
299
299
  * @param fontData The font data to store
300
300
  */
301
301
  async set(e, r) {
302
- await (await this.getDatabase()).put(Pe.fonts, { ...r, name: e });
302
+ await (await this.getDatabase()).put(Be.fonts, { ...r, name: e });
303
303
  }
304
304
  /**
305
305
  * Gets a font from the cache
@@ -307,27 +307,27 @@ const Pe = {
307
307
  * @returns The font data if found, undefined otherwise
308
308
  */
309
309
  async get(e) {
310
- return await (await this.getDatabase()).get(Pe.fonts, e);
310
+ return await (await this.getDatabase()).get(Be.fonts, e);
311
311
  }
312
312
  /**
313
313
  * Deletes a font from the cache
314
314
  * @param fileName The font file name (key)
315
315
  */
316
316
  async delete(e) {
317
- await (await this.getDatabase()).delete(Pe.fonts, e);
317
+ await (await this.getDatabase()).delete(Be.fonts, e);
318
318
  }
319
319
  /**
320
320
  * Gets all fonts from the cache
321
321
  * @returns An array of all font data in the cache
322
322
  */
323
323
  async getAll() {
324
- return await (await this.getDatabase()).getAll(Pe.fonts);
324
+ return await (await this.getDatabase()).getAll(Be.fonts);
325
325
  }
326
326
  /**
327
327
  * Clears all fonts from the cache
328
328
  */
329
329
  async clear() {
330
- await (await this.getDatabase()).clear(Pe.fonts);
330
+ await (await this.getDatabase()).clear(Be.fonts);
331
331
  }
332
332
  /**
333
333
  * Checks if a font exists in the cache
@@ -361,7 +361,7 @@ const Pe = {
361
361
  async getDatabase() {
362
362
  if (this.isClosing)
363
363
  throw new Error("Cannot perform operation while database is closing");
364
- return this.db ? this.db : (this.db = await Pa(
364
+ return this.db ? this.db : (this.db = await Ba(
365
365
  ee.DATABASE_NAME,
366
366
  ee.DATABASE_VERSION,
367
367
  {
@@ -384,7 +384,7 @@ const Pe = {
384
384
  * @param newVersion The new version of the database
385
385
  */
386
386
  handleUpgrade(e, r, n) {
387
- const a = Ft.filter(
387
+ const a = Tt.filter(
388
388
  (s) => s.version > r && (!n || s.version <= n)
389
389
  );
390
390
  for (const s of a)
@@ -400,8 +400,8 @@ const Pe = {
400
400
  e.objectStoreNames.contains(n.name) || e.createObjectStore(n.name, { keyPath: n.keyPath });
401
401
  }
402
402
  };
403
- ee.DATABASE_NAME = "mlightcad", ee.DATABASE_VERSION = Ft[Ft.length - 1].version;
404
- let ze = ee;
403
+ ee.DATABASE_NAME = "mlightcad", ee.DATABASE_VERSION = Tt[Tt.length - 1].version;
404
+ let We = ee;
405
405
  const _a = (t) => t.substring(t.lastIndexOf(".") + 1), En = (t) => t.split("/").pop(), wr = (t) => {
406
406
  const e = En(t);
407
407
  if (e) {
@@ -667,8 +667,8 @@ const _a = (t) => t.substring(t.lastIndexOf(".") + 1), En = (t) => t.split("/").
667
667
  14079702,
668
668
  16777215,
669
669
  0
670
- ], za = (t) => Ha[t];
671
- let Wa = class {
670
+ ], Wa = (t) => Ha[t];
671
+ let za = class {
672
672
  constructor(e) {
673
673
  this.isFont = !0, this.type = "Font", this.data = e;
674
674
  }
@@ -704,19 +704,19 @@ function qa(t, e, r, n, a) {
704
704
  let o, u, l, h, f, c, p, d;
705
705
  if (s.o) {
706
706
  const v = s._cachedOutline || (s._cachedOutline = s.o.split(" "));
707
- for (let y = 0, m = v.length; y < m; )
708
- switch (v[y++]) {
707
+ for (let m = 0, y = v.length; m < y; )
708
+ switch (v[m++]) {
709
709
  case "m":
710
- o = v[y++] * e + r, u = v[y++] * e + n, i.moveTo(o, u);
710
+ o = v[m++] * e + r, u = v[m++] * e + n, i.moveTo(o, u);
711
711
  break;
712
712
  case "l":
713
- o = v[y++] * e + r, u = v[y++] * e + n, i.lineTo(o, u);
713
+ o = v[m++] * e + r, u = v[m++] * e + n, i.lineTo(o, u);
714
714
  break;
715
715
  case "q":
716
- l = v[y++] * e + r, h = v[y++] * e + n, f = v[y++] * e + r, c = v[y++] * e + n, i.quadraticCurveTo(f, c, l, h);
716
+ l = v[m++] * e + r, h = v[m++] * e + n, f = v[m++] * e + r, c = v[m++] * e + n, i.quadraticCurveTo(f, c, l, h);
717
717
  break;
718
718
  case "b":
719
- l = v[y++] * e + r, h = v[y++] * e + n, f = v[y++] * e + r, c = v[y++] * e + n, p = v[y++] * e + r, d = v[y++] * e + n, i.bezierCurveTo(f, c, p, d, l, h);
719
+ l = v[m++] * e + r, h = v[m++] * e + n, f = v[m++] * e + r, c = v[m++] * e + n, p = v[m++] * e + r, d = v[m++] * e + n, i.bezierCurveTo(f, c, p, d, l, h);
720
720
  break;
721
721
  }
722
722
  }
@@ -749,14 +749,14 @@ String.prototype.codePointAt || function() {
749
749
  writable: !0
750
750
  }) : String.prototype.codePointAt = e;
751
751
  }();
752
- var rr = 0, On = -3;
752
+ var nr = 0, On = -3;
753
753
  function Ve() {
754
754
  this.table = new Uint16Array(16), this.trans = new Uint16Array(288);
755
755
  }
756
756
  function Xa(t, e) {
757
757
  this.source = t, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = e, this.destLen = 0, this.ltree = new Ve(), this.dtree = new Ve();
758
758
  }
759
- var Un = new Ve(), Ln = new Ve(), nr = new Uint8Array(30), ar = new Uint16Array(30), Rn = new Uint8Array(30), An = new Uint16Array(30), Ya = new Uint8Array([
759
+ var Un = new Ve(), Ln = new Ve(), ar = new Uint8Array(30), sr = new Uint16Array(30), Rn = new Uint8Array(30), An = new Uint16Array(30), Ya = new Uint8Array([
760
760
  16,
761
761
  17,
762
762
  18,
@@ -804,7 +804,7 @@ function Za(t, e) {
804
804
  e.trans[r] = r;
805
805
  }
806
806
  var Er = new Uint16Array(16);
807
- function Tt(t, e, r, n) {
807
+ function wt(t, e, r, n) {
808
808
  var a, s;
809
809
  for (a = 0; a < 16; ++a)
810
810
  t.table[a] = 0;
@@ -828,7 +828,7 @@ function fe(t, e, r) {
828
828
  var n = t.tag & 65535 >>> 16 - e;
829
829
  return t.tag >>>= e, t.bitcount -= e, n + r;
830
830
  }
831
- function qt(t, e) {
831
+ function Xt(t, e) {
832
832
  for (; t.bitcount < 24; )
833
833
  t.tag |= t.source[t.sourceIndex++] << t.bitcount, t.bitcount += 8;
834
834
  var r = 0, n = 0, a = 0, s = t.tag;
@@ -845,8 +845,8 @@ function Ka(t, e, r) {
845
845
  var l = fe(t, 3, 0);
846
846
  ce[Ya[i]] = l;
847
847
  }
848
- for (Tt(Cr, ce, 0, 19), o = 0; o < n + a; ) {
849
- var h = qt(t, Cr);
848
+ for (wt(Cr, ce, 0, 19), o = 0; o < n + a; ) {
849
+ var h = Xt(t, Cr);
850
850
  switch (h) {
851
851
  case 16:
852
852
  var f = ce[o - 1];
@@ -866,18 +866,18 @@ function Ka(t, e, r) {
866
866
  break;
867
867
  }
868
868
  }
869
- Tt(e, ce, 0, n), Tt(r, ce, n, a);
869
+ wt(e, ce, 0, n), wt(r, ce, n, a);
870
870
  }
871
871
  function Or(t, e, r) {
872
872
  for (; ; ) {
873
- var n = qt(t, e);
873
+ var n = Xt(t, e);
874
874
  if (n === 256)
875
- return rr;
875
+ return nr;
876
876
  if (n < 256)
877
877
  t.dest[t.destLen++] = n;
878
878
  else {
879
879
  var a, s, i, o;
880
- for (n -= 257, a = fe(t, nr[n], ar[n]), s = qt(t, r), i = t.destLen - fe(t, Rn[s], An[s]), o = i; o < i + a; ++o)
880
+ for (n -= 257, a = fe(t, ar[n], sr[n]), s = Xt(t, r), i = t.destLen - fe(t, Rn[s], An[s]), o = i; o < i + a; ++o)
881
881
  t.dest[t.destLen++] = t.dest[o];
882
882
  }
883
883
  }
@@ -889,7 +889,7 @@ function Qa(t) {
889
889
  return On;
890
890
  for (t.sourceIndex += 4, n = e; n; --n)
891
891
  t.dest[t.destLen++] = t.source[t.sourceIndex++];
892
- return t.bitcount = 0, rr;
892
+ return t.bitcount = 0, nr;
893
893
  }
894
894
  function $a(t, e) {
895
895
  var r = new Xa(t, e), n, a, s;
@@ -907,16 +907,16 @@ function $a(t, e) {
907
907
  default:
908
908
  s = On;
909
909
  }
910
- if (s !== rr)
910
+ if (s !== nr)
911
911
  throw new Error("Data error");
912
912
  } while (!n);
913
913
  return r.destLen < r.dest.length ? typeof r.dest.slice == "function" ? r.dest.slice(0, r.destLen) : r.dest.subarray(0, r.destLen) : r.dest;
914
914
  }
915
915
  Za(Un, Ln);
916
- Mn(nr, ar, 4, 3);
916
+ Mn(ar, sr, 4, 3);
917
917
  Mn(Rn, An, 2, 1);
918
- nr[28] = 0;
919
- ar[28] = 258;
918
+ ar[28] = 0;
919
+ sr[28] = 258;
920
920
  var Ja = $a;
921
921
  function Me(t, e, r, n, a) {
922
922
  return Math.pow(1 - a, 3) * t + 3 * Math.pow(1 - a, 2) * a * e + 3 * (1 - a) * Math.pow(a, 2) * r + Math.pow(a, 3) * n;
@@ -944,15 +944,15 @@ we.prototype.addBezier = function(t, e, r, n, a, s, i, o) {
944
944
  if (d === 0) {
945
945
  if (p === 0)
946
946
  continue;
947
- var y = -v / p;
948
- 0 < y && y < 1 && (c === 0 && this.addX(Me(u[c], l[c], h[c], f[c], y)), c === 1 && this.addY(Me(u[c], l[c], h[c], f[c], y)));
947
+ var m = -v / p;
948
+ 0 < m && m < 1 && (c === 0 && this.addX(Me(u[c], l[c], h[c], f[c], m)), c === 1 && this.addY(Me(u[c], l[c], h[c], f[c], m)));
949
949
  continue;
950
950
  }
951
- var m = Math.pow(p, 2) - 4 * v * d;
952
- if (!(m < 0)) {
953
- var b = (-p + Math.sqrt(m)) / (2 * d);
951
+ var y = Math.pow(p, 2) - 4 * v * d;
952
+ if (!(y < 0)) {
953
+ var b = (-p + Math.sqrt(y)) / (2 * d);
954
954
  0 < b && b < 1 && (c === 0 && this.addX(Me(u[c], l[c], h[c], f[c], b)), c === 1 && this.addY(Me(u[c], l[c], h[c], f[c], b)));
955
- var x = (-p - Math.sqrt(m)) / (2 * d);
955
+ var x = (-p - Math.sqrt(y)) / (2 * d);
956
956
  0 < x && x < 1 && (c === 0 && this.addX(Me(u[c], l[c], h[c], f[c], x)), c === 1 && this.addY(Me(u[c], l[c], h[c], f[c], x)));
957
957
  }
958
958
  }
@@ -1072,13 +1072,13 @@ V.prototype.toDOMElement = function(t) {
1072
1072
  var e = this.toPathData(t), r = document.createElementNS("http://www.w3.org/2000/svg", "path");
1073
1073
  return r.setAttribute("d", e), r;
1074
1074
  };
1075
- function Pn(t) {
1075
+ function Bn(t) {
1076
1076
  throw new Error(t);
1077
1077
  }
1078
1078
  function Ur(t, e) {
1079
- t || Pn(e);
1079
+ t || Bn(e);
1080
1080
  }
1081
- var U = { fail: Pn, argument: Ur, assert: Ur }, Lr = 32768, Rr = 2147483648, De = {}, k = {}, L = {};
1081
+ var U = { fail: Bn, argument: Ur, assert: Ur }, Lr = 32768, Rr = 2147483648, De = {}, k = {}, L = {};
1082
1082
  function le(t) {
1083
1083
  return function() {
1084
1084
  return t;
@@ -1204,7 +1204,7 @@ k.UTF16 = function(t) {
1204
1204
  L.UTF16 = function(t) {
1205
1205
  return t.length * 2;
1206
1206
  };
1207
- var Xt = {
1207
+ var Yt = {
1208
1208
  "x-mac-croatian": (
1209
1209
  // Python: 'mac_croatian'
1210
1210
  "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"
@@ -1247,7 +1247,7 @@ var Xt = {
1247
1247
  )
1248
1248
  };
1249
1249
  De.MACSTRING = function(t, e, r, n) {
1250
- var a = Xt[n];
1250
+ var a = Yt[n];
1251
1251
  if (a !== void 0) {
1252
1252
  for (var s = "", i = 0; i < r; i++) {
1253
1253
  var o = t.getUint8(e + i);
@@ -1259,7 +1259,7 @@ De.MACSTRING = function(t, e, r, n) {
1259
1259
  var rt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), nt, es = function(t) {
1260
1260
  if (!nt) {
1261
1261
  nt = {};
1262
- for (var e in Xt)
1262
+ for (var e in Yt)
1263
1263
  nt[e] = new String(e);
1264
1264
  }
1265
1265
  var r = nt[t];
@@ -1269,7 +1269,7 @@ var rt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), nt, es =
1269
1269
  if (n !== void 0)
1270
1270
  return n;
1271
1271
  }
1272
- var a = Xt[t];
1272
+ var a = Yt[t];
1273
1273
  if (a !== void 0) {
1274
1274
  for (var s = {}, i = 0; i < a.length; i++)
1275
1275
  s[a.charCodeAt(i)] = i + 128;
@@ -1293,7 +1293,7 @@ L.MACSTRING = function(t, e) {
1293
1293
  var r = k.MACSTRING(t, e);
1294
1294
  return r !== void 0 ? r.length : 0;
1295
1295
  };
1296
- function Yt(t) {
1296
+ function Zt(t) {
1297
1297
  return t >= -128 && t <= 127;
1298
1298
  }
1299
1299
  function ts(t, e, r) {
@@ -1304,7 +1304,7 @@ function ts(t, e, r) {
1304
1304
  function rs(t, e, r) {
1305
1305
  for (var n = 0, a = t.length, s = e; s < a && n < 64; ) {
1306
1306
  var i = t[s];
1307
- if (!Yt(i) || i === 0 && s + 1 < a && t[s + 1] === 0)
1307
+ if (!Zt(i) || i === 0 && s + 1 < a && t[s + 1] === 0)
1308
1308
  break;
1309
1309
  ++s, ++n;
1310
1310
  }
@@ -1316,7 +1316,7 @@ function rs(t, e, r) {
1316
1316
  function ns(t, e, r) {
1317
1317
  for (var n = 0, a = t.length, s = e; s < a && n < 64; ) {
1318
1318
  var i = t[s];
1319
- if (i === 0 || Yt(i) && s + 1 < a && Yt(t[s + 1]))
1319
+ if (i === 0 || Zt(i) && s + 1 < a && Zt(t[s + 1]))
1320
1320
  break;
1321
1321
  ++s, ++n;
1322
1322
  }
@@ -1469,7 +1469,7 @@ function qe(t, e, r) {
1469
1469
  n[a + 1] = { name: t + a, type: "USHORT", value: e[a] };
1470
1470
  return n;
1471
1471
  }
1472
- function Zt(t, e, r) {
1472
+ function jt(t, e, r) {
1473
1473
  var n = e.length, a = new Array(n + 1);
1474
1474
  a[0] = { name: t + "Count", type: "USHORT", value: n };
1475
1475
  for (var s = 0; s < n; s++)
@@ -1549,12 +1549,12 @@ function ft(t) {
1549
1549
  ft.prototype = Object.create(X.prototype);
1550
1550
  ft.prototype.constructor = ft;
1551
1551
  function pt(t, e) {
1552
- X.call(this, "lookupListTable", Zt("lookup", t, function(r) {
1552
+ X.call(this, "lookupListTable", jt("lookup", t, function(r) {
1553
1553
  var n = e[r.lookupType];
1554
1554
  return U.assert(!!n, "Unable to write GSUB lookup type " + r.lookupType + " tables."), new X("lookupTable", [
1555
1555
  { name: "lookupType", type: "USHORT", value: r.lookupType },
1556
1556
  { name: "lookupFlag", type: "USHORT", value: r.lookupFlag }
1557
- ].concat(Zt("subtable", r.subtables, n)));
1557
+ ].concat(jt("subtable", r.subtables, n)));
1558
1558
  }));
1559
1559
  }
1560
1560
  pt.prototype = Object.create(X.prototype);
@@ -1567,7 +1567,7 @@ var F = {
1567
1567
  FeatureList: ft,
1568
1568
  LookupList: pt,
1569
1569
  ushortList: qe,
1570
- tableList: Zt,
1570
+ tableList: jt,
1571
1571
  recordList: Xe
1572
1572
  };
1573
1573
  function Ar(t, e) {
@@ -1579,10 +1579,10 @@ function dt(t, e) {
1579
1579
  function as(t, e) {
1580
1580
  return t.getInt16(e, !1);
1581
1581
  }
1582
- function sr(t, e) {
1582
+ function ir(t, e) {
1583
1583
  return t.getUint32(e, !1);
1584
1584
  }
1585
- function Bn(t, e) {
1585
+ function Pn(t, e) {
1586
1586
  var r = t.getInt16(e, !1), n = t.getUint16(e + 2, !1);
1587
1587
  return r + n / 65535;
1588
1588
  }
@@ -1643,12 +1643,12 @@ g.prototype.parseF2Dot14 = function() {
1643
1643
  return this.relativeOffset += 2, t;
1644
1644
  };
1645
1645
  g.prototype.parseULong = function() {
1646
- var t = sr(this.data, this.offset + this.relativeOffset);
1646
+ var t = ir(this.data, this.offset + this.relativeOffset);
1647
1647
  return this.relativeOffset += 4, t;
1648
1648
  };
1649
1649
  g.prototype.parseOffset32 = g.prototype.parseULong;
1650
1650
  g.prototype.parseFixed = function() {
1651
- var t = Bn(this.data, this.offset + this.relativeOffset);
1651
+ var t = Pn(this.data, this.offset + this.relativeOffset);
1652
1652
  return this.relativeOffset += 4, t;
1653
1653
  };
1654
1654
  g.prototype.parseString = function(t) {
@@ -1662,7 +1662,7 @@ g.prototype.parseTag = function() {
1662
1662
  return this.parseString(4);
1663
1663
  };
1664
1664
  g.prototype.parseLongDateTime = function() {
1665
- var t = sr(this.data, this.offset + this.relativeOffset + 4);
1665
+ var t = ir(this.data, this.offset + this.relativeOffset + 4);
1666
1666
  return t -= 2082844800, this.relativeOffset += 8, t;
1667
1667
  };
1668
1668
  g.prototype.parseVersion = function(t) {
@@ -1909,8 +1909,8 @@ var E = {
1909
1909
  getUShort: dt,
1910
1910
  getCard16: dt,
1911
1911
  getShort: as,
1912
- getULong: sr,
1913
- getFixed: Bn,
1912
+ getULong: ir,
1913
+ getFixed: Pn,
1914
1914
  getTag: ss,
1915
1915
  getOffset: is,
1916
1916
  getBytes: os,
@@ -1930,8 +1930,8 @@ function cs(t, e, r, n, a) {
1930
1930
  var s;
1931
1931
  t.segCount = s = e.parseUShort() >> 1, e.skip("uShort", 3), t.glyphIndexMap = {};
1932
1932
  for (var i = new E.Parser(r, n + a + 14), o = new E.Parser(r, n + a + 16 + s * 2), u = new E.Parser(r, n + a + 16 + s * 4), l = new E.Parser(r, n + a + 16 + s * 6), h = n + a + 16 + s * 8, f = 0; f < s - 1; f += 1)
1933
- for (var c = void 0, p = i.parseUShort(), d = o.parseUShort(), v = u.parseShort(), y = l.parseUShort(), m = d; m <= p; m += 1)
1934
- y !== 0 ? (h = l.offset + l.relativeOffset - 2, h += y, h += (m - d) * 2, c = E.getUShort(r, h), c !== 0 && (c = c + v & 65535)) : c = m + v & 65535, t.glyphIndexMap[m] = c;
1933
+ for (var c = void 0, p = i.parseUShort(), d = o.parseUShort(), v = u.parseShort(), m = l.parseUShort(), y = d; y <= p; y += 1)
1934
+ m !== 0 ? (h = l.offset + l.relativeOffset - 2, h += m, h += (y - d) * 2, c = E.getUShort(r, h), c !== 0 && (c = c + v & 65535)) : c = y + v & 65535, t.glyphIndexMap[y] = c;
1935
1935
  }
1936
1936
  function fs(t, e) {
1937
1937
  var r = {};
@@ -2015,18 +2015,18 @@ function gs(t) {
2015
2015
  ds(s);
2016
2016
  var u = s.segments.length, l = 0, h = [], f = [], c = [], p = [], d = [], v = [];
2017
2017
  for (r = 0; r < u; r += 1) {
2018
- var y = s.segments[r];
2019
- y.end <= 65535 && y.start <= 65535 ? (h = h.concat({ name: "end_" + r, type: "USHORT", value: y.end }), f = f.concat({ name: "start_" + r, type: "USHORT", value: y.start }), c = c.concat({ name: "idDelta_" + r, type: "SHORT", value: y.delta }), p = p.concat({ name: "idRangeOffset_" + r, type: "USHORT", value: y.offset }), y.glyphId !== void 0 && (d = d.concat({ name: "glyph_" + r, type: "USHORT", value: y.glyphId }))) : l += 1, !e && y.glyphIndex !== void 0 && (v = v.concat({ name: "cmap12Start_" + r, type: "ULONG", value: y.start }), v = v.concat({ name: "cmap12End_" + r, type: "ULONG", value: y.end }), v = v.concat({ name: "cmap12Glyph_" + r, type: "ULONG", value: y.glyphIndex }));
2018
+ var m = s.segments[r];
2019
+ m.end <= 65535 && m.start <= 65535 ? (h = h.concat({ name: "end_" + r, type: "USHORT", value: m.end }), f = f.concat({ name: "start_" + r, type: "USHORT", value: m.start }), c = c.concat({ name: "idDelta_" + r, type: "SHORT", value: m.delta }), p = p.concat({ name: "idRangeOffset_" + r, type: "USHORT", value: m.offset }), m.glyphId !== void 0 && (d = d.concat({ name: "glyph_" + r, type: "USHORT", value: m.glyphId }))) : l += 1, !e && m.glyphIndex !== void 0 && (v = v.concat({ name: "cmap12Start_" + r, type: "ULONG", value: m.start }), v = v.concat({ name: "cmap12End_" + r, type: "ULONG", value: m.end }), v = v.concat({ name: "cmap12Glyph_" + r, type: "ULONG", value: m.glyphIndex }));
2020
2020
  }
2021
2021
  if (s.segCountX2 = (u - l) * 2, s.searchRange = Math.pow(2, Math.floor(Math.log(u - l) / Math.log(2))) * 2, s.entrySelector = Math.log(s.searchRange / 2) / Math.log(2), s.rangeShift = s.segCountX2 - s.searchRange, s.fields = s.fields.concat(h), s.fields.push({ name: "reservedPad", type: "USHORT", value: 0 }), s.fields = s.fields.concat(f), s.fields = s.fields.concat(c), s.fields = s.fields.concat(p), s.fields = s.fields.concat(d), s.cmap4Length = 14 + // Subtable header
2022
2022
  h.length * 2 + 2 + // reservedPad
2023
2023
  f.length * 2 + c.length * 2 + p.length * 2 + d.length * 2, !e) {
2024
- var m = 16 + // Subtable header
2024
+ var y = 16 + // Subtable header
2025
2025
  v.length * 4;
2026
2026
  s.cmap12Offset = 12 + 2 * 2 + 4 + s.cmap4Length, s.fields = s.fields.concat([
2027
2027
  { name: "cmap12Format", type: "USHORT", value: 12 },
2028
2028
  { name: "cmap12Reserved", type: "USHORT", value: 0 },
2029
- { name: "cmap12Length", type: "ULONG", value: m },
2029
+ { name: "cmap12Length", type: "ULONG", value: y },
2030
2030
  { name: "cmap12Language", type: "ULONG", value: 0 },
2031
2031
  { name: "cmap12nGroups", type: "ULONG", value: v.length / 3 }
2032
2032
  ]), s.fields = s.fields.concat(v);
@@ -2678,7 +2678,7 @@ var In = { parse: fs, make: gs }, ut = [
2678
2678
  "oslash",
2679
2679
  "oe",
2680
2680
  "germandbls"
2681
- ], ms = [
2681
+ ], ys = [
2682
2682
  "",
2683
2683
  "",
2684
2684
  "",
@@ -3220,7 +3220,7 @@ gt.prototype.charToGlyphIndex = function(t) {
3220
3220
  var e = t.codePointAt(0), r = this.encoding[e];
3221
3221
  return this.charset.indexOf(r);
3222
3222
  };
3223
- function ir(t) {
3223
+ function or(t) {
3224
3224
  switch (t.version) {
3225
3225
  case 1:
3226
3226
  this.names = Ue.slice();
@@ -3243,13 +3243,13 @@ function ir(t) {
3243
3243
  break;
3244
3244
  }
3245
3245
  }
3246
- ir.prototype.nameToGlyphIndex = function(t) {
3246
+ or.prototype.nameToGlyphIndex = function(t) {
3247
3247
  return this.names.indexOf(t);
3248
3248
  };
3249
- ir.prototype.glyphIndexToName = function(t) {
3249
+ or.prototype.glyphIndexToName = function(t) {
3250
3250
  return this.names[t];
3251
3251
  };
3252
- function ys(t) {
3252
+ function ms(t) {
3253
3253
  for (var e, r = t.tables.cmap.glyphIndexMap, n = Object.keys(r), a = 0; a < n.length; a += 1) {
3254
3254
  var s = n[a], i = r[s];
3255
3255
  e = t.glyphs.get(i), e.addUnicode(parseInt(s));
@@ -3267,7 +3267,7 @@ function xs(t) {
3267
3267
  }
3268
3268
  }
3269
3269
  function bs(t, e) {
3270
- e.lowMemory ? xs(t) : ys(t);
3270
+ e.lowMemory ? xs(t) : ms(t);
3271
3271
  }
3272
3272
  function Ss(t, e, r, n, a) {
3273
3273
  t.beginPath(), t.moveTo(e, r), t.lineTo(n, a), t.stroke();
@@ -3385,7 +3385,7 @@ function st(t, e, r) {
3385
3385
  configurable: !0
3386
3386
  });
3387
3387
  }
3388
- function or(t, e) {
3388
+ function ur(t, e) {
3389
3389
  if (this.font = t, this.glyphs = {}, Array.isArray(e))
3390
3390
  for (var r = 0; r < e.length; r++) {
3391
3391
  var n = e[r];
@@ -3393,7 +3393,7 @@ function or(t, e) {
3393
3393
  }
3394
3394
  this.length = e && e.length || 0;
3395
3395
  }
3396
- or.prototype.get = function(t) {
3396
+ ur.prototype.get = function(t) {
3397
3397
  if (this.glyphs[t] === void 0) {
3398
3398
  this.font._push(t), typeof this.glyphs[t] == "function" && (this.glyphs[t] = this.glyphs[t]());
3399
3399
  var e = this.glyphs[t], r = this.font._IndexToUnicodeMap[t];
@@ -3405,7 +3405,7 @@ or.prototype.get = function(t) {
3405
3405
  typeof this.glyphs[t] == "function" && (this.glyphs[t] = this.glyphs[t]());
3406
3406
  return this.glyphs[t];
3407
3407
  };
3408
- or.prototype.push = function(t, e) {
3408
+ ur.prototype.push = function(t, e) {
3409
3409
  this.glyphs[t] = e, this.length++;
3410
3410
  };
3411
3411
  function Fs(t, e) {
@@ -3430,7 +3430,7 @@ function ws(t, e, r, n) {
3430
3430
  }, a;
3431
3431
  };
3432
3432
  }
3433
- var ge = { GlyphSet: or, glyphLoader: Fs, ttfGlyphLoader: Ts, cffGlyphLoader: ws };
3433
+ var ge = { GlyphSet: ur, glyphLoader: Fs, ttfGlyphLoader: Ts, cffGlyphLoader: ws };
3434
3434
  function Nn(t, e) {
3435
3435
  if (t === e)
3436
3436
  return !0;
@@ -3444,7 +3444,7 @@ function Nn(t, e) {
3444
3444
  } else
3445
3445
  return !1;
3446
3446
  }
3447
- function jt(t) {
3447
+ function Kt(t) {
3448
3448
  var e;
3449
3449
  return t.length < 1240 ? e = 107 : t.length < 33900 ? e = 1131 : e = 32768, e;
3450
3450
  }
@@ -3528,7 +3528,7 @@ function _n(t, e, r) {
3528
3528
  }
3529
3529
  return Ls(a);
3530
3530
  }
3531
- function We(t, e) {
3531
+ function ze(t, e) {
3532
3532
  return e <= 390 ? e = ut[e] : e = t[e - 391], e;
3533
3533
  }
3534
3534
  function Hn(t, e, r) {
@@ -3538,10 +3538,10 @@ function Hn(t, e, r) {
3538
3538
  var o = [];
3539
3539
  o.length = i.type.length;
3540
3540
  for (var u = 0; u < i.type.length; u++)
3541
- a = t[i.op] !== void 0 ? t[i.op][u] : void 0, a === void 0 && (a = i.value !== void 0 && i.value[u] !== void 0 ? i.value[u] : null), i.type[u] === "SID" && (a = We(r, a)), o[u] = a;
3541
+ a = t[i.op] !== void 0 ? t[i.op][u] : void 0, a === void 0 && (a = i.value !== void 0 && i.value[u] !== void 0 ? i.value[u] : null), i.type[u] === "SID" && (a = ze(r, a)), o[u] = a;
3542
3542
  n[i.name] = o;
3543
3543
  } else
3544
- a = t[i.op], a === void 0 && (a = i.value !== void 0 ? i.value : null), i.type === "SID" && (a = We(r, a)), n[i.name] = a;
3544
+ a = t[i.op], a === void 0 && (a = i.value !== void 0 ? i.value : null), i.type === "SID" && (a = ze(r, a)), n[i.name] = a;
3545
3545
  }
3546
3546
  return n;
3547
3547
  }
@@ -3549,7 +3549,7 @@ function Rs(t, e) {
3549
3549
  var r = {};
3550
3550
  return r.formatMajor = E.getCard8(t, e), r.formatMinor = E.getCard8(t, e + 1), r.size = E.getCard8(t, e + 2), r.offsetSize = E.getCard8(t, e + 3), r.startOffset = e, r.endOffset = e + 4, r;
3551
3551
  }
3552
- var zn = [
3552
+ var Wn = [
3553
3553
  { name: "version", op: 0, type: "SID" },
3554
3554
  { name: "notice", op: 1, type: "SID" },
3555
3555
  { name: "copyright", op: 1200, type: "SID" },
@@ -3585,20 +3585,20 @@ var zn = [
3585
3585
  { name: "fdArray", op: 1236, type: "offset" },
3586
3586
  { name: "fdSelect", op: 1237, type: "offset" },
3587
3587
  { name: "fontName", op: 1238, type: "SID" }
3588
- ], Wn = [
3588
+ ], zn = [
3589
3589
  { name: "subrs", op: 19, type: "offset", value: 0 },
3590
3590
  { name: "defaultWidthX", op: 20, type: "number", value: 0 },
3591
3591
  { name: "nominalWidthX", op: 21, type: "number", value: 0 }
3592
3592
  ];
3593
3593
  function As(t, e) {
3594
3594
  var r = _n(t, 0, t.byteLength);
3595
- return Hn(r, zn, e);
3595
+ return Hn(r, Wn, e);
3596
3596
  }
3597
3597
  function Vn(t, e, r, n) {
3598
3598
  var a = _n(t, e, r);
3599
- return Hn(a, Wn, n);
3599
+ return Hn(a, zn, n);
3600
3600
  }
3601
- function Pr(t, e, r, n) {
3601
+ function Br(t, e, r, n) {
3602
3602
  for (var a = [], s = 0; s < r.length; s += 1) {
3603
3603
  var i = new DataView(new Uint8Array(r[s]).buffer), o = As(i, n);
3604
3604
  o._subrs = [], o._subrsBias = 0, o._defaultWidthX = 0, o._nominalWidthX = 0;
@@ -3607,7 +3607,7 @@ function Pr(t, e, r, n) {
3607
3607
  var h = Vn(t, l + e, u, n);
3608
3608
  if (o._defaultWidthX = h.defaultWidthX, o._nominalWidthX = h.nominalWidthX, h.subrs !== 0) {
3609
3609
  var f = l + h.subrs, c = be(t, f + e);
3610
- o._subrs = c.objects, o._subrsBias = jt(o._subrs);
3610
+ o._subrs = c.objects, o._subrsBias = Kt(o._subrs);
3611
3611
  }
3612
3612
  o._privateDict = h;
3613
3613
  }
@@ -3621,24 +3621,24 @@ function Ms(t, e, r, n) {
3621
3621
  var o = [".notdef"], u = i.parseCard8();
3622
3622
  if (u === 0)
3623
3623
  for (var l = 0; l < r; l += 1)
3624
- a = i.parseSID(), o.push(We(n, a));
3624
+ a = i.parseSID(), o.push(ze(n, a));
3625
3625
  else if (u === 1)
3626
3626
  for (; o.length <= r; ) {
3627
3627
  a = i.parseSID(), s = i.parseCard8();
3628
3628
  for (var h = 0; h <= s; h += 1)
3629
- o.push(We(n, a)), a += 1;
3629
+ o.push(ze(n, a)), a += 1;
3630
3630
  }
3631
3631
  else if (u === 2)
3632
3632
  for (; o.length <= r; ) {
3633
3633
  a = i.parseSID(), s = i.parseCard16();
3634
3634
  for (var f = 0; f <= s; f += 1)
3635
- o.push(We(n, a)), a += 1;
3635
+ o.push(ze(n, a)), a += 1;
3636
3636
  }
3637
3637
  else
3638
3638
  throw new Error("Unknown charset format " + u);
3639
3639
  return o;
3640
3640
  }
3641
- function Ps(t, e, r) {
3641
+ function Bs(t, e, r) {
3642
3642
  var n, a = {}, s = new E.Parser(t, e), i = s.parseCard8();
3643
3643
  if (i === 0)
3644
3644
  for (var o = s.parseCard8(), u = 0; u < o; u += 1)
@@ -3653,25 +3653,25 @@ function Ps(t, e, r) {
3653
3653
  throw new Error("Unknown encoding format " + i);
3654
3654
  return new gt(a, r);
3655
3655
  }
3656
- function Br(t, e, r) {
3657
- var n, a, s, i, o = new V(), u = [], l = 0, h = !1, f = !1, c = 0, p = 0, d, v, y, m;
3656
+ function Pr(t, e, r) {
3657
+ var n, a, s, i, o = new V(), u = [], l = 0, h = !1, f = !1, c = 0, p = 0, d, v, m, y;
3658
3658
  if (t.isCIDFont) {
3659
3659
  var b = t.tables.cff.topDict._fdSelect[e.index], x = t.tables.cff.topDict._fdArray[b];
3660
- d = x._subrs, v = x._subrsBias, y = x._defaultWidthX, m = x._nominalWidthX;
3660
+ d = x._subrs, v = x._subrsBias, m = x._defaultWidthX, y = x._nominalWidthX;
3661
3661
  } else
3662
- d = t.tables.cff.topDict._subrs, v = t.tables.cff.topDict._subrsBias, y = t.tables.cff.topDict._defaultWidthX, m = t.tables.cff.topDict._nominalWidthX;
3663
- var T = y;
3662
+ d = t.tables.cff.topDict._subrs, v = t.tables.cff.topDict._subrsBias, m = t.tables.cff.topDict._defaultWidthX, y = t.tables.cff.topDict._nominalWidthX;
3663
+ var T = m;
3664
3664
  function S(w, M) {
3665
3665
  f && o.closePath(), o.moveTo(w, M), f = !0;
3666
3666
  }
3667
3667
  function A() {
3668
3668
  var w;
3669
- w = u.length % 2 !== 0, w && !h && (T = u.shift() + m), l += u.length >> 1, u.length = 0, h = !0;
3669
+ w = u.length % 2 !== 0, w && !h && (T = u.shift() + y), l += u.length >> 1, u.length = 0, h = !0;
3670
3670
  }
3671
3671
  function O(w) {
3672
- for (var M, N, K, $, Y, I, _, D, W, Z, q, Q, B = 0; B < w.length; ) {
3673
- var j = w[B];
3674
- switch (B += 1, j) {
3672
+ for (var M, N, K, $, Y, I, _, D, z, Z, q, Q, P = 0; P < w.length; ) {
3673
+ var j = w[P];
3674
+ switch (P += 1, j) {
3675
3675
  case 1:
3676
3676
  A();
3677
3677
  break;
@@ -3679,7 +3679,7 @@ function Br(t, e, r) {
3679
3679
  A();
3680
3680
  break;
3681
3681
  case 4:
3682
- u.length > 1 && !h && (T = u.shift() + m, h = !0), p += u.pop(), S(c, p);
3682
+ u.length > 1 && !h && (T = u.shift() + y, h = !0), p += u.pop(), S(c, p);
3683
3683
  break;
3684
3684
  case 5:
3685
3685
  for (; u.length > 0; )
@@ -3703,38 +3703,38 @@ function Br(t, e, r) {
3703
3703
  case 11:
3704
3704
  return;
3705
3705
  case 12:
3706
- switch (j = w[B], B += 1, j) {
3706
+ switch (j = w[P], P += 1, j) {
3707
3707
  case 35:
3708
- n = c + u.shift(), a = p + u.shift(), s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i + u.shift(), W = _ + u.shift(), Z = D + u.shift(), q = W + u.shift(), Q = Z + u.shift(), c = q + u.shift(), p = Q + u.shift(), u.shift(), o.curveTo(n, a, s, i, _, D), o.curveTo(W, Z, q, Q, c, p);
3708
+ n = c + u.shift(), a = p + u.shift(), s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i + u.shift(), z = _ + u.shift(), Z = D + u.shift(), q = z + u.shift(), Q = Z + u.shift(), c = q + u.shift(), p = Q + u.shift(), u.shift(), o.curveTo(n, a, s, i, _, D), o.curveTo(z, Z, q, Q, c, p);
3709
3709
  break;
3710
3710
  case 34:
3711
- n = c + u.shift(), a = p, s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i, W = _ + u.shift(), Z = i, q = W + u.shift(), Q = p, c = q + u.shift(), o.curveTo(n, a, s, i, _, D), o.curveTo(W, Z, q, Q, c, p);
3711
+ n = c + u.shift(), a = p, s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i, z = _ + u.shift(), Z = i, q = z + u.shift(), Q = p, c = q + u.shift(), o.curveTo(n, a, s, i, _, D), o.curveTo(z, Z, q, Q, c, p);
3712
3712
  break;
3713
3713
  case 36:
3714
- n = c + u.shift(), a = p + u.shift(), s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i, W = _ + u.shift(), Z = i, q = W + u.shift(), Q = Z + u.shift(), c = q + u.shift(), o.curveTo(n, a, s, i, _, D), o.curveTo(W, Z, q, Q, c, p);
3714
+ n = c + u.shift(), a = p + u.shift(), s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i, z = _ + u.shift(), Z = i, q = z + u.shift(), Q = Z + u.shift(), c = q + u.shift(), o.curveTo(n, a, s, i, _, D), o.curveTo(z, Z, q, Q, c, p);
3715
3715
  break;
3716
3716
  case 37:
3717
- n = c + u.shift(), a = p + u.shift(), s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i + u.shift(), W = _ + u.shift(), Z = D + u.shift(), q = W + u.shift(), Q = Z + u.shift(), Math.abs(q - c) > Math.abs(Q - p) ? c = q + u.shift() : p = Q + u.shift(), o.curveTo(n, a, s, i, _, D), o.curveTo(W, Z, q, Q, c, p);
3717
+ n = c + u.shift(), a = p + u.shift(), s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i + u.shift(), z = _ + u.shift(), Z = D + u.shift(), q = z + u.shift(), Q = Z + u.shift(), Math.abs(q - c) > Math.abs(Q - p) ? c = q + u.shift() : p = Q + u.shift(), o.curveTo(n, a, s, i, _, D), o.curveTo(z, Z, q, Q, c, p);
3718
3718
  break;
3719
3719
  default:
3720
3720
  console.log("Glyph " + e.index + ": unknown operator 1200" + j), u.length = 0;
3721
3721
  }
3722
3722
  break;
3723
3723
  case 14:
3724
- u.length > 0 && !h && (T = u.shift() + m, h = !0), f && (o.closePath(), f = !1);
3724
+ u.length > 0 && !h && (T = u.shift() + y, h = !0), f && (o.closePath(), f = !1);
3725
3725
  break;
3726
3726
  case 18:
3727
3727
  A();
3728
3728
  break;
3729
3729
  case 19:
3730
3730
  case 20:
3731
- A(), B += l + 7 >> 3;
3731
+ A(), P += l + 7 >> 3;
3732
3732
  break;
3733
3733
  case 21:
3734
- u.length > 2 && !h && (T = u.shift() + m, h = !0), p += u.pop(), c += u.pop(), S(c, p);
3734
+ u.length > 2 && !h && (T = u.shift() + y, h = !0), p += u.pop(), c += u.pop(), S(c, p);
3735
3735
  break;
3736
3736
  case 22:
3737
- u.length > 1 && !h && (T = u.shift() + m, h = !0), c += u.pop(), S(c, p);
3737
+ u.length > 1 && !h && (T = u.shift() + y, h = !0), c += u.pop(), S(c, p);
3738
3738
  break;
3739
3739
  case 23:
3740
3740
  A();
@@ -3758,7 +3758,7 @@ function Br(t, e, r) {
3758
3758
  n = c + u.shift(), a = p, s = n + u.shift(), i = a + u.shift(), c = s + u.shift(), p = i, o.curveTo(n, a, s, i, c, p);
3759
3759
  break;
3760
3760
  case 28:
3761
- M = w[B], N = w[B + 1], u.push((M << 24 | N << 16) >> 16), B += 2;
3761
+ M = w[P], N = w[P + 1], u.push((M << 24 | N << 16) >> 16), P += 2;
3762
3762
  break;
3763
3763
  case 29:
3764
3764
  Y = u.pop() + t.gsubrsBias, I = t.gsubrs[Y], I && O(I);
@@ -3772,13 +3772,13 @@ function Br(t, e, r) {
3772
3772
  n = c, a = p + u.shift(), s = n + u.shift(), i = a + u.shift(), c = s + u.shift(), p = i + (u.length === 1 ? u.shift() : 0), o.curveTo(n, a, s, i, c, p);
3773
3773
  break;
3774
3774
  default:
3775
- j < 32 ? console.log("Glyph " + e.index + ": unknown operator " + j) : j < 247 ? u.push(j - 139) : j < 251 ? (M = w[B], B += 1, u.push((j - 247) * 256 + M + 108)) : j < 255 ? (M = w[B], B += 1, u.push(-(j - 251) * 256 - M - 108)) : (M = w[B], N = w[B + 1], K = w[B + 2], $ = w[B + 3], B += 4, u.push((M << 24 | N << 16 | K << 8 | $) / 65536));
3775
+ j < 32 ? console.log("Glyph " + e.index + ": unknown operator " + j) : j < 247 ? u.push(j - 139) : j < 251 ? (M = w[P], P += 1, u.push((j - 247) * 256 + M + 108)) : j < 255 ? (M = w[P], P += 1, u.push(-(j - 251) * 256 - M - 108)) : (M = w[P], N = w[P + 1], K = w[P + 2], $ = w[P + 3], P += 4, u.push((M << 24 | N << 16 | K << 8 | $) / 65536));
3776
3776
  }
3777
3777
  }
3778
3778
  }
3779
3779
  return O(r), e.advanceWidth = T, o;
3780
3780
  }
3781
- function Bs(t, e, r, n) {
3781
+ function Ps(t, e, r, n) {
3782
3782
  var a = [], s, i = new E.Parser(t, e), o = i.parseCard8();
3783
3783
  if (o === 0)
3784
3784
  for (var u = 0; u < r; u++) {
@@ -3808,8 +3808,8 @@ function Bs(t, e, r, n) {
3808
3808
  function Is(t, e, r, n) {
3809
3809
  r.tables.cff = {};
3810
3810
  var a = Rs(t, e), s = be(t, a.endOffset, E.bytesToString), i = be(t, s.endOffset), o = be(t, i.endOffset, E.bytesToString), u = be(t, o.endOffset);
3811
- r.gsubrs = u.objects, r.gsubrsBias = jt(r.gsubrs);
3812
- var l = Pr(t, e, i.objects, o.objects);
3811
+ r.gsubrs = u.objects, r.gsubrsBias = Kt(r.gsubrs);
3812
+ var l = Br(t, e, i.objects, o.objects);
3813
3813
  if (l.length !== 1)
3814
3814
  throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " + l.length);
3815
3815
  var h = l[0];
@@ -3818,27 +3818,27 @@ function Is(t, e, r, n) {
3818
3818
  if (f === 0 || c === 0)
3819
3819
  throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
3820
3820
  f += e;
3821
- var p = be(t, f), d = Pr(t, e, p.objects, o.objects);
3822
- h._fdArray = d, c += e, h._fdSelect = Bs(t, c, r.numGlyphs, d.length);
3821
+ var p = be(t, f), d = Br(t, e, p.objects, o.objects);
3822
+ h._fdArray = d, c += e, h._fdSelect = Ps(t, c, r.numGlyphs, d.length);
3823
3823
  }
3824
- var v = e + h.private[1], y = Vn(t, v, h.private[0], o.objects);
3825
- if (r.defaultWidthX = y.defaultWidthX, r.nominalWidthX = y.nominalWidthX, y.subrs !== 0) {
3826
- var m = v + y.subrs, b = be(t, m);
3827
- r.subrs = b.objects, r.subrsBias = jt(r.subrs);
3824
+ var v = e + h.private[1], m = Vn(t, v, h.private[0], o.objects);
3825
+ if (r.defaultWidthX = m.defaultWidthX, r.nominalWidthX = m.nominalWidthX, m.subrs !== 0) {
3826
+ var y = v + m.subrs, b = be(t, y);
3827
+ r.subrs = b.objects, r.subrsBias = Kt(r.subrs);
3828
3828
  } else
3829
3829
  r.subrs = [], r.subrsBias = 0;
3830
3830
  var x;
3831
3831
  n.lowMemory ? (x = Cs(t, e + h.charStrings), r.nGlyphs = x.offsets.length) : (x = be(t, e + h.charStrings), r.nGlyphs = x.objects.length);
3832
3832
  var T = Ms(t, e + h.charset, r.nGlyphs, o.objects);
3833
- if (h.encoding === 0 ? r.cffEncoding = new gt(vs, T) : h.encoding === 1 ? r.cffEncoding = new gt(ms, T) : r.cffEncoding = Ps(t, e + h.encoding, T), r.encoding = r.encoding || r.cffEncoding, r.glyphs = new ge.GlyphSet(r), n.lowMemory)
3833
+ if (h.encoding === 0 ? r.cffEncoding = new gt(vs, T) : h.encoding === 1 ? r.cffEncoding = new gt(ys, T) : r.cffEncoding = Bs(t, e + h.encoding, T), r.encoding = r.encoding || r.cffEncoding, r.glyphs = new ge.GlyphSet(r), n.lowMemory)
3834
3834
  r._push = function(O) {
3835
3835
  var w = Es(O, x.offsets, t, e + h.charStrings);
3836
- r.glyphs.push(O, ge.cffGlyphLoader(r, O, Br, w));
3836
+ r.glyphs.push(O, ge.cffGlyphLoader(r, O, Pr, w));
3837
3837
  };
3838
3838
  else
3839
3839
  for (var S = 0; S < r.nGlyphs; S += 1) {
3840
3840
  var A = x.objects[S];
3841
- r.glyphs.push(S, ge.cffGlyphLoader(r, S, Br, A));
3841
+ r.glyphs.push(S, ge.cffGlyphLoader(r, S, Pr, A));
3842
3842
  }
3843
3843
  }
3844
3844
  function qn(t, e) {
@@ -3873,7 +3873,7 @@ function Ir(t, e) {
3873
3873
  var r = new F.Record("Top DICT", [
3874
3874
  { name: "dict", type: "DICT", value: {} }
3875
3875
  ]);
3876
- return r.dict = Xn(zn, t, e), r;
3876
+ return r.dict = Xn(Wn, t, e), r;
3877
3877
  }
3878
3878
  function Dr(t) {
3879
3879
  var e = new F.Record("Top DICT INDEX", [
@@ -3904,7 +3904,7 @@ function Hs(t, e) {
3904
3904
  }
3905
3905
  return r;
3906
3906
  }
3907
- function zs(t) {
3907
+ function Ws(t) {
3908
3908
  var e = [], r = t.path;
3909
3909
  e.push({ name: "width", type: "NUMBER", value: t.advanceWidth });
3910
3910
  for (var n = 0, a = 0, s = 0; s < r.commands.length; s += 1) {
@@ -3932,11 +3932,11 @@ function zs(t) {
3932
3932
  }
3933
3933
  return e.push({ name: "endchar", type: "OP", value: 14 }), e;
3934
3934
  }
3935
- function Ws(t) {
3935
+ function zs(t) {
3936
3936
  for (var e = new F.Record("CharStrings INDEX", [
3937
3937
  { name: "charStrings", type: "INDEX", value: [] }
3938
3938
  ]), r = 0; r < t.length; r += 1) {
3939
- var n = t.get(r), a = zs(n);
3939
+ var n = t.get(r), a = Ws(n);
3940
3940
  e.charStrings.push({ name: n.name, type: "CHARSTRING", value: a });
3941
3941
  }
3942
3942
  return e;
@@ -3945,7 +3945,7 @@ function Vs(t, e) {
3945
3945
  var r = new F.Record("Private DICT", [
3946
3946
  { name: "dict", type: "DICT", value: {} }
3947
3947
  ]);
3948
- return r.dict = Xn(Wn, t, e), r;
3948
+ return r.dict = Xn(zn, t, e), r;
3949
3949
  }
3950
3950
  function qs(t, e) {
3951
3951
  for (var r = new F.Table("CFF ", [
@@ -3973,7 +3973,7 @@ function qs(t, e) {
3973
3973
  var l = [];
3974
3974
  r.header = Ds(), r.nameIndex = Gs([e.postScriptName]);
3975
3975
  var h = Ir(a, l);
3976
- r.topDictIndex = Dr(h), r.globalSubrIndex = _s(), r.charsets = Hs(i, l), r.charStringsIndex = Ws(t), r.privateDict = Vs(s, l), r.stringIndex = Ns(l);
3976
+ r.topDictIndex = Dr(h), r.globalSubrIndex = _s(), r.charsets = Hs(i, l), r.charStringsIndex = zs(t), r.privateDict = Vs(s, l), r.stringIndex = Ns(l);
3977
3977
  var f = r.header.sizeOf() + r.nameIndex.sizeOf() + r.topDictIndex.sizeOf() + r.stringIndex.sizeOf() + r.globalSubrIndex.sizeOf();
3978
3978
  return a.charset = f, a.encoding = 0, a.charStrings = a.charset + r.charsets.sizeOf(), a.private[1] = a.charStrings + r.charStringsIndex.sizeOf(), h = Ir(a, l), r.topDictIndex = Dr(h), r;
3979
3979
  }
@@ -4723,7 +4723,7 @@ function si(t, e, r) {
4723
4723
  return ta[e];
4724
4724
  }
4725
4725
  }
4726
- var Kt = "utf-16", ii = {
4726
+ var Qt = "utf-16", ii = {
4727
4727
  0: "macintosh",
4728
4728
  // smRoman
4729
4729
  1: "x-mac-japanese",
@@ -4817,29 +4817,29 @@ var Kt = "utf-16", ii = {
4817
4817
  function ra(t, e, r) {
4818
4818
  switch (t) {
4819
4819
  case 0:
4820
- return Kt;
4820
+ return Qt;
4821
4821
  case 1:
4822
4822
  return oi[r] || ii[e];
4823
4823
  case 3:
4824
4824
  if (e === 1 || e === 10)
4825
- return Kt;
4825
+ return Qt;
4826
4826
  break;
4827
4827
  }
4828
4828
  }
4829
4829
  function ui(t, e, r) {
4830
4830
  for (var n = {}, a = new E.Parser(t, e), s = a.parseUShort(), i = a.parseUShort(), o = a.offset + a.parseUShort(), u = 0; u < i; u++) {
4831
- var l = a.parseUShort(), h = a.parseUShort(), f = a.parseUShort(), c = a.parseUShort(), p = Jn[c] || c, d = a.parseUShort(), v = a.parseUShort(), y = si(l, f, r), m = ra(l, h, f);
4832
- if (m !== void 0 && y !== void 0) {
4831
+ var l = a.parseUShort(), h = a.parseUShort(), f = a.parseUShort(), c = a.parseUShort(), p = Jn[c] || c, d = a.parseUShort(), v = a.parseUShort(), m = si(l, f, r), y = ra(l, h, f);
4832
+ if (y !== void 0 && m !== void 0) {
4833
4833
  var b = void 0;
4834
- if (m === Kt ? b = De.UTF16(t, o + v, d) : b = De.MACSTRING(t, o + v, d, m), b) {
4834
+ if (y === Qt ? b = De.UTF16(t, o + v, d) : b = De.MACSTRING(t, o + v, d, y), b) {
4835
4835
  var x = n[p];
4836
- x === void 0 && (x = n[p] = {}), x[y] = b;
4836
+ x === void 0 && (x = n[p] = {}), x[m] = b;
4837
4837
  }
4838
4838
  }
4839
4839
  }
4840
4840
  return s === 1 && a.parseUShort(), n;
4841
4841
  }
4842
- function wt(t) {
4842
+ function Ct(t) {
4843
4843
  var e = {};
4844
4844
  for (var r in t)
4845
4845
  e[t[r]] = parseInt(r);
@@ -4877,24 +4877,24 @@ function Nr(t, e) {
4877
4877
  return r;
4878
4878
  }
4879
4879
  function hi(t, e) {
4880
- var r, n = [], a = {}, s = wt(Jn);
4880
+ var r, n = [], a = {}, s = Ct(Jn);
4881
4881
  for (var i in t) {
4882
4882
  var o = s[i];
4883
4883
  if (o === void 0 && (o = i), r = parseInt(o), isNaN(r))
4884
4884
  throw new Error('Name table entry "' + i + '" does not exist, see nameTableNames for complete list.');
4885
4885
  a[r] = t[i], n.push(r);
4886
4886
  }
4887
- for (var u = wt(ea), l = wt(ta), h = [], f = [], c = 0; c < n.length; c++) {
4887
+ for (var u = Ct(ea), l = Ct(ta), h = [], f = [], c = 0; c < n.length; c++) {
4888
4888
  r = n[c];
4889
4889
  var p = a[r];
4890
4890
  for (var d in p) {
4891
- var v = p[d], y = 1, m = u[d], b = ai[m], x = ra(y, b, m), T = k.MACSTRING(v, x);
4892
- T === void 0 && (y = 0, m = e.indexOf(d), m < 0 && (m = e.length, e.push(d)), b = 4, T = k.UTF16(v));
4891
+ var v = p[d], m = 1, y = u[d], b = ai[y], x = ra(m, b, y), T = k.MACSTRING(v, x);
4892
+ T === void 0 && (m = 0, y = e.indexOf(d), y < 0 && (y = e.length, e.push(d)), b = 4, T = k.UTF16(v));
4893
4893
  var S = Nr(T, f);
4894
4894
  h.push(Gr(
4895
- y,
4896
- b,
4897
4895
  m,
4896
+ b,
4897
+ y,
4898
4898
  r,
4899
4899
  T.length,
4900
4900
  S
@@ -4924,7 +4924,7 @@ function hi(t, e) {
4924
4924
  M.fields.push({ name: "record_" + N, type: "RECORD", value: h[N] });
4925
4925
  return M.fields.push({ name: "strings", type: "LITERAL", value: f }), M;
4926
4926
  }
4927
- var na = { parse: ui, make: hi }, Qt = [
4927
+ var na = { parse: ui, make: hi }, $t = [
4928
4928
  { begin: 0, end: 127 },
4929
4929
  // Basic Latin
4930
4930
  { begin: 128, end: 255 },
@@ -5173,8 +5173,8 @@ var na = { parse: ui, make: hi }, Qt = [
5173
5173
  // Domino Tiles
5174
5174
  ];
5175
5175
  function ci(t) {
5176
- for (var e = 0; e < Qt.length; e += 1) {
5177
- var r = Qt[e];
5176
+ for (var e = 0; e < $t.length; e += 1) {
5177
+ var r = $t[e];
5178
5178
  if (t >= r.begin && t < r.end)
5179
5179
  return e;
5180
5180
  }
@@ -5237,7 +5237,7 @@ function pi(t) {
5237
5237
  { name: "usMaxContext", type: "USHORT", value: 0 }
5238
5238
  ], t);
5239
5239
  }
5240
- var $t = { parse: fi, make: pi, unicodeRanges: Qt, getUnicodeRange: ci };
5240
+ var Jt = { parse: fi, make: pi, unicodeRanges: $t, getUnicodeRange: ci };
5241
5241
  function di(t, e) {
5242
5242
  var r = {}, n = new E.Parser(t, e);
5243
5243
  switch (r.version = n.parseVersion(), r.italicAngle = n.parseFixed(), r.underlinePosition = n.parseShort(), r.underlineThickness = n.parseShort(), r.isFixedPitch = n.parseULong(), r.minMemType42 = n.parseULong(), r.maxMemType42 = n.parseULong(), r.minMemType1 = n.parseULong(), r.maxMemType1 = n.parseULong(), r.version) {
@@ -5514,7 +5514,7 @@ Ge[6] = function(e) {
5514
5514
  }
5515
5515
  U.assert(!1, "lookup type 6 format must be 1, 2 or 3.");
5516
5516
  };
5517
- function mi(t) {
5517
+ function yi(t) {
5518
5518
  return new F.Table("GSUB", [
5519
5519
  { name: "version", type: "ULONG", value: 65536 },
5520
5520
  { name: "scripts", type: "TABLE", value: new F.ScriptList(t.scripts) },
@@ -5522,8 +5522,8 @@ function mi(t) {
5522
5522
  { name: "lookups", type: "TABLE", value: new F.LookupList(t.lookups, Ge) }
5523
5523
  ]);
5524
5524
  }
5525
- var sa = { parse: vi, make: mi };
5526
- function yi(t, e) {
5525
+ var sa = { parse: vi, make: yi };
5526
+ function mi(t, e) {
5527
5527
  var r = new E.Parser(t, e), n = r.parseULong();
5528
5528
  U.argument(n === 1, "Unsupported META table version."), r.parseULong(), r.parseULong();
5529
5529
  for (var a = r.parseULong(), s = {}, i = 0; i < a; i++) {
@@ -5545,11 +5545,11 @@ function xi(t) {
5545
5545
  }
5546
5546
  return a.fields.push({ name: "stringPool", type: "CHARARRAY", value: r }), a;
5547
5547
  }
5548
- var ia = { parse: yi, make: xi };
5548
+ var ia = { parse: mi, make: xi };
5549
5549
  function _r(t) {
5550
5550
  return Math.log(t) / Math.log(2) | 0;
5551
5551
  }
5552
- function ur(t) {
5552
+ function lr(t) {
5553
5553
  for (; t.length % 4 !== 0; )
5554
5554
  t.push(0);
5555
5555
  for (var e = 0, r = 0; r < t.length; r += 4)
@@ -5580,7 +5580,7 @@ function oa(t) {
5580
5580
  for (var i = 0; i < t.length; i += 1) {
5581
5581
  var o = t[i];
5582
5582
  U.argument(o.tableName.length === 4, "Table name" + o.tableName + " is invalid.");
5583
- var u = o.sizeOf(), l = Hr(o.tableName, ur(o.encode()), s, u);
5583
+ var u = o.sizeOf(), l = Hr(o.tableName, lr(o.encode()), s, u);
5584
5584
  for (n.push({ name: l.tag + " Table Record", type: "RECORD", value: l }), a.push({ name: o.tableName + " table", type: "RECORD", value: o }), s += u, U.argument(!isNaN(s), "Something went wrong calculating the offset."); s % 4 !== 0; )
5585
5585
  s += 1, a.push({ name: "padding", type: "BYTE", value: 0 });
5586
5586
  }
@@ -5588,7 +5588,7 @@ function oa(t) {
5588
5588
  return h.value.tag > f.value.tag ? 1 : -1;
5589
5589
  }), e.fields = e.fields.concat(n), e.fields = e.fields.concat(a), e;
5590
5590
  }
5591
- function zr(t, e, r) {
5591
+ function Wr(t, e, r) {
5592
5592
  for (var n = 0; n < e.length; n += 1) {
5593
5593
  var a = t.charToGlyphIndex(e[n]);
5594
5594
  if (a > 0) {
@@ -5605,19 +5605,19 @@ function bi(t) {
5605
5605
  }
5606
5606
  function Si(t) {
5607
5607
  for (var e = [], r = [], n = [], a = [], s = [], i = [], o = [], u, l = 0, h = 0, f = 0, c = 0, p = 0, d = 0; d < t.glyphs.length; d += 1) {
5608
- var v = t.glyphs.get(d), y = v.unicode | 0;
5608
+ var v = t.glyphs.get(d), m = v.unicode | 0;
5609
5609
  if (isNaN(v.advanceWidth))
5610
5610
  throw new Error("Glyph " + v.name + " (" + d + "): advanceWidth is not a number.");
5611
- (u > y || u === void 0) && y > 0 && (u = y), l < y && (l = y);
5612
- var m = $t.getUnicodeRange(y);
5613
- if (m < 32)
5614
- h |= 1 << m;
5615
- else if (m < 64)
5616
- f |= 1 << m - 32;
5617
- else if (m < 96)
5618
- c |= 1 << m - 64;
5619
- else if (m < 123)
5620
- p |= 1 << m - 96;
5611
+ (u > m || u === void 0) && m > 0 && (u = m), l < m && (l = m);
5612
+ var y = Jt.getUnicodeRange(m);
5613
+ if (y < 32)
5614
+ h |= 1 << y;
5615
+ else if (y < 64)
5616
+ f |= 1 << y - 32;
5617
+ else if (y < 96)
5618
+ c |= 1 << y - 64;
5619
+ else if (y < 123)
5620
+ p |= 1 << y - 96;
5621
5621
  else
5622
5622
  throw new Error("Unicode ranges bits > 123 are reserved for internal usage");
5623
5623
  if (v.name !== ".notdef") {
@@ -5655,7 +5655,7 @@ function Si(t) {
5655
5655
  minRightSideBearing: x.minRightSideBearing,
5656
5656
  xMaxExtent: x.maxLeftSideBearing + (x.xMax - x.xMin),
5657
5657
  numberOfHMetrics: t.glyphs.length
5658
- }), A = $n.make(t.glyphs.length), O = $t.make(Object.assign({
5658
+ }), A = $n.make(t.glyphs.length), O = Jt.make(Object.assign({
5659
5659
  xAvgCharWidth: Math.round(x.advanceWidthAvg),
5660
5660
  usFirstCharIndex: u,
5661
5661
  usLastCharIndex: l,
@@ -5674,8 +5674,8 @@ function Si(t) {
5674
5674
  usWinDescent: Math.abs(x.yMin),
5675
5675
  ulCodePageRange1: 1,
5676
5676
  // FIXME: hard-code Latin 1 support for now
5677
- sxHeight: zr(t, "xyvw", { yMax: Math.round(x.ascender / 2) }).yMax,
5678
- sCapHeight: zr(t, "HIKLEFJMNTZBDPRAGOQSUVWXY", x).yMax,
5677
+ sxHeight: Wr(t, "xyvw", { yMax: Math.round(x.ascender / 2) }).yMax,
5678
+ sCapHeight: Wr(t, "HIKLEFJMNTZBDPRAGOQSUVWXY", x).yMax,
5679
5679
  usDefaultChar: t.hasChar(" ") ? 32 : 0,
5680
5680
  // Use space as the default character, if available.
5681
5681
  usBreakChar: t.hasChar(" ") ? 32 : 0
@@ -5686,7 +5686,7 @@ function Si(t) {
5686
5686
  for (var _ in t.names)
5687
5687
  I[_] = t.names[_];
5688
5688
  I.uniqueID || (I.uniqueID = { en: t.getEnglishName("manufacturer") + ":" + $ }), I.postScriptName || (I.postScriptName = { en: Y }), I.preferredFamily || (I.preferredFamily = t.names.fontFamily), I.preferredSubfamily || (I.preferredSubfamily = t.names.fontSubfamily);
5689
- var D = [], W = na.make(I, D), Z = D.length > 0 ? Qn.make(D) : void 0, q = aa.make(), Q = Yn.make(t.glyphs, {
5689
+ var D = [], z = na.make(I, D), Z = D.length > 0 ? Qn.make(D) : void 0, q = aa.make(), Q = Yn.make(t.glyphs, {
5690
5690
  version: t.getEnglishName("version"),
5691
5691
  fullName: $,
5692
5692
  familyName: N,
@@ -5694,19 +5694,19 @@ function Si(t) {
5694
5694
  postScriptName: Y,
5695
5695
  unitsPerEm: t.unitsPerEm,
5696
5696
  fontBBox: [0, x.yMin, x.ascender, x.advanceWidthMax]
5697
- }), B = t.metas && Object.keys(t.metas).length > 0 ? ia.make(t.metas) : void 0, j = [T, S, A, O, W, M, q, Q, w];
5698
- Z && j.push(Z), t.tables.gsub && j.push(sa.make(t.tables.gsub)), B && j.push(B);
5699
- for (var xt = oa(j), ka = xt.encode(), Fa = ur(ka), bt = xt.fields, yr = !1, tt = 0; tt < bt.length; tt += 1)
5700
- if (bt[tt].name === "head table") {
5701
- bt[tt].value.checkSumAdjustment = 2981146554 - Fa, yr = !0;
5697
+ }), P = t.metas && Object.keys(t.metas).length > 0 ? ia.make(t.metas) : void 0, j = [T, S, A, O, z, M, q, Q, w];
5698
+ Z && j.push(Z), t.tables.gsub && j.push(sa.make(t.tables.gsub)), P && j.push(P);
5699
+ for (var bt = oa(j), ka = bt.encode(), Fa = lr(ka), St = bt.fields, mr = !1, tt = 0; tt < St.length; tt += 1)
5700
+ if (St[tt].name === "head table") {
5701
+ St[tt].value.checkSumAdjustment = 2981146554 - Fa, mr = !0;
5702
5702
  break;
5703
5703
  }
5704
- if (!yr)
5704
+ if (!mr)
5705
5705
  throw new Error("Could not find head table with checkSum to adjust.");
5706
- return xt;
5706
+ return bt;
5707
5707
  }
5708
- var ki = { make: oa, fontToTable: Si, computeCheckSum: ur };
5709
- function Ct(t, e) {
5708
+ var ki = { make: oa, fontToTable: Si, computeCheckSum: lr };
5709
+ function Et(t, e) {
5710
5710
  for (var r = 0, n = t.length - 1; r <= n; ) {
5711
5711
  var a = r + n >>> 1, s = t[a].tag;
5712
5712
  if (s === e)
@@ -5715,7 +5715,7 @@ function Ct(t, e) {
5715
5715
  }
5716
5716
  return -r - 1;
5717
5717
  }
5718
- function Wr(t, e) {
5718
+ function zr(t, e) {
5719
5719
  for (var r = 0, n = t.length - 1; r <= n; ) {
5720
5720
  var a = r + n >>> 1, s = t[a];
5721
5721
  if (s === e)
@@ -5749,7 +5749,7 @@ je.prototype = {
5749
5749
  * @param {string} tag
5750
5750
  * @return {number}
5751
5751
  */
5752
- searchTag: Ct,
5752
+ searchTag: Et,
5753
5753
  /**
5754
5754
  * Binary search in a list of numbers
5755
5755
  * @instance
@@ -5759,7 +5759,7 @@ je.prototype = {
5759
5759
  * @param {number} value
5760
5760
  * @return {number}
5761
5761
  */
5762
- binSearch: Wr,
5762
+ binSearch: zr,
5763
5763
  /**
5764
5764
  * Get or create the Layout table (GSUB, GPOS etc).
5765
5765
  * @param {boolean} create - Whether to create a new one.
@@ -5810,7 +5810,7 @@ je.prototype = {
5810
5810
  var r = this.getTable(e);
5811
5811
  if (r) {
5812
5812
  t = t || "DFLT";
5813
- var n = r.scripts, a = Ct(r.scripts, t);
5813
+ var n = r.scripts, a = Et(r.scripts, t);
5814
5814
  if (a >= 0)
5815
5815
  return n[a].script;
5816
5816
  if (e) {
@@ -5838,7 +5838,7 @@ je.prototype = {
5838
5838
  if (n) {
5839
5839
  if (!e || e === "dflt" || e === "DFLT")
5840
5840
  return n.defaultLangSys;
5841
- var a = Ct(n.langSysRecords, e);
5841
+ var a = Et(n.langSysRecords, e);
5842
5842
  if (a >= 0)
5843
5843
  return n.langSysRecords[a].langSys;
5844
5844
  if (r) {
@@ -5928,7 +5928,7 @@ je.prototype = {
5928
5928
  getCoverageIndex: function(t, e) {
5929
5929
  switch (t.format) {
5930
5930
  case 1:
5931
- var r = Wr(t.glyphs, e);
5931
+ var r = zr(t.glyphs, e);
5932
5932
  return r >= 0 ? r : -1;
5933
5933
  case 2:
5934
5934
  var n = Vr(t.ranges, e);
@@ -5996,7 +5996,7 @@ function Fi(t, e) {
5996
5996
  return !1;
5997
5997
  return !0;
5998
5998
  }
5999
- function lr(t, e, r) {
5999
+ function hr(t, e, r) {
6000
6000
  for (var n = t.subtables, a = 0; a < n.length; a++) {
6001
6001
  var s = n[a];
6002
6002
  if (s.substFormat === e)
@@ -6070,7 +6070,7 @@ re.prototype.getLigatures = function(t, e, r) {
6070
6070
  return n;
6071
6071
  };
6072
6072
  re.prototype.addSingle = function(t, e, r, n) {
6073
- var a = this.getLookupTables(r, n, t, 1, !0)[0], s = lr(a, 2, {
6073
+ var a = this.getLookupTables(r, n, t, 1, !0)[0], s = hr(a, 2, {
6074
6074
  // lookup type 1 subtable, format 2, coverage format 1
6075
6075
  substFormat: 2,
6076
6076
  coverage: { format: 1, glyphs: [] },
@@ -6082,7 +6082,7 @@ re.prototype.addSingle = function(t, e, r, n) {
6082
6082
  };
6083
6083
  re.prototype.addMultiple = function(t, e, r, n) {
6084
6084
  U.assert(e.by instanceof Array && e.by.length > 1, 'Multiple: "by" must be an array of two or more ids');
6085
- var a = this.getLookupTables(r, n, t, 2, !0)[0], s = lr(a, 1, {
6085
+ var a = this.getLookupTables(r, n, t, 2, !0)[0], s = hr(a, 1, {
6086
6086
  // lookup type 2 subtable, format 1, coverage format 1
6087
6087
  substFormat: 1,
6088
6088
  coverage: { format: 1, glyphs: [] },
@@ -6093,7 +6093,7 @@ re.prototype.addMultiple = function(t, e, r, n) {
6093
6093
  o < 0 && (o = -1 - o, s.coverage.glyphs.splice(o, 0, i), s.sequences.splice(o, 0, 0)), s.sequences[o] = e.by;
6094
6094
  };
6095
6095
  re.prototype.addAlternate = function(t, e, r, n) {
6096
- var a = this.getLookupTables(r, n, t, 3, !0)[0], s = lr(a, 1, {
6096
+ var a = this.getLookupTables(r, n, t, 3, !0)[0], s = hr(a, 1, {
6097
6097
  // lookup type 3 subtable, format 1, coverage format 1
6098
6098
  substFormat: 1,
6099
6099
  coverage: { format: 1, glyphs: [] },
@@ -6192,8 +6192,8 @@ function ua(t, e, r) {
6192
6192
  if (l > 0) {
6193
6193
  for (var v = 0; v < l; v += 1)
6194
6194
  s = a[v], d = {}, d.onCurve = !!(s & 1), d.lastPointOfContour = i.indexOf(v) >= 0, p.push(d);
6195
- for (var y = 0, m = 0; m < l; m += 1)
6196
- s = a[m], d = p[m], d.x = qr(n, s, y, 2, 16), y = d.x;
6195
+ for (var m = 0, y = 0; y < l; y += 1)
6196
+ s = a[y], d = p[y], d.x = qr(n, s, m, 2, 16), m = d.x;
6197
6197
  for (var b = 0, x = 0; x < l; x += 1)
6198
6198
  s = a[x], d = p[x], d.y = qr(n, s, b, 4, 32), b = d.y;
6199
6199
  }
@@ -6224,7 +6224,7 @@ function ua(t, e, r) {
6224
6224
  }
6225
6225
  }
6226
6226
  }
6227
- function Et(t, e) {
6227
+ function Ot(t, e) {
6228
6228
  for (var r = [], n = 0; n < t.length; n += 1) {
6229
6229
  var a = t[n], s = {
6230
6230
  x: e.xScale * a.x + e.scale01 * a.y + e.dx,
@@ -6275,7 +6275,7 @@ function ha(t, e) {
6275
6275
  if (a.getPath(), a.points) {
6276
6276
  var s = void 0;
6277
6277
  if (n.matchedPoints === void 0)
6278
- s = Et(a.points, n);
6278
+ s = Ot(a.points, n);
6279
6279
  else {
6280
6280
  if (n.matchedPoints[0] > e.points.length - 1 || n.matchedPoints[1] > a.points.length - 1)
6281
6281
  throw Error("Matched points out of range in " + e.name);
@@ -6287,7 +6287,7 @@ function ha(t, e) {
6287
6287
  dx: 0,
6288
6288
  dy: 0
6289
6289
  };
6290
- o = Et([o], u)[0], u.dx = i.x - o.x, u.dy = i.y - o.y, s = Et(a.points, u);
6290
+ o = Ot([o], u)[0], u.dx = i.x - o.x, u.dy = i.y - o.y, s = Ot(a.points, u);
6291
6291
  }
6292
6292
  e.points = e.points.concat(s);
6293
6293
  }
@@ -6311,7 +6311,7 @@ function Oi(t, e, r, n) {
6311
6311
  function Ui(t, e, r, n, a) {
6312
6312
  return a.lowMemory ? Oi(t, e, r, n) : Ei(t, e, r, n);
6313
6313
  }
6314
- var ca = { getPath: la, parse: Ui }, fa, Ae, pa, Jt;
6314
+ var ca = { getPath: la, parse: Ui }, fa, Ae, pa, er;
6315
6315
  function da(t) {
6316
6316
  this.font = t, this.getCommands = function(e) {
6317
6317
  return ca.getPath(e).commands;
@@ -6332,7 +6332,7 @@ function Ai(t) {
6332
6332
  function Mi(t) {
6333
6333
  return Math.sign(t) * Math.ceil(Math.abs(t));
6334
6334
  }
6335
- function Pi(t) {
6335
+ function Bi(t) {
6336
6336
  return Math.sign(t) * Math.floor(Math.abs(t));
6337
6337
  }
6338
6338
  var va = function(t) {
@@ -6495,20 +6495,20 @@ function $e(t, e) {
6495
6495
  var r = Math.sqrt(t * t + e * e);
6496
6496
  return t /= r, e /= r, t === 1 && e === 0 ? pe : t === 0 && e === 1 ? ve : new Qe(t, e);
6497
6497
  }
6498
- function me(t, e, r, n) {
6498
+ function ye(t, e, r, n) {
6499
6499
  this.x = this.xo = Math.round(t * 64) / 64, this.y = this.yo = Math.round(e * 64) / 64, this.lastPointOfContour = r, this.onCurve = n, this.prevPointOnContour = void 0, this.nextPointOnContour = void 0, this.xTouched = !1, this.yTouched = !1, Object.preventExtensions(this);
6500
6500
  }
6501
- me.prototype.nextTouched = function(t) {
6501
+ ye.prototype.nextTouched = function(t) {
6502
6502
  for (var e = this.nextPointOnContour; !t.touched(e) && e !== this; )
6503
6503
  e = e.nextPointOnContour;
6504
6504
  return e;
6505
6505
  };
6506
- me.prototype.prevTouched = function(t) {
6506
+ ye.prototype.prevTouched = function(t) {
6507
6507
  for (var e = this.prevPointOnContour; !t.touched(e) && e !== this; )
6508
6508
  e = e.prevPointOnContour;
6509
6509
  return e;
6510
6510
  };
6511
- var Ye = Object.freeze(new me(0, 0)), Bi = {
6511
+ var Ye = Object.freeze(new ye(0, 0)), Pi = {
6512
6512
  cvCutIn: 17 / 16,
6513
6513
  // control value cut in
6514
6514
  deltaBase: 9,
@@ -6535,7 +6535,7 @@ da.prototype.exec = function(t, e) {
6535
6535
  if (!n || n.ppem !== e) {
6536
6536
  var a = this._fpgmState;
6537
6537
  if (!a) {
6538
- Se.prototype = Bi, a = this._fpgmState = new Se("fpgm", r.tables.fpgm), a.funcs = [], a.font = r, exports.DEBUG && (console.log("---EXEC FPGM---"), a.step = -1);
6538
+ Se.prototype = Pi, a = this._fpgmState = new Se("fpgm", r.tables.fpgm), a.funcs = [], a.font = r, exports.DEBUG && (console.log("---EXEC FPGM---"), a.step = -1);
6539
6539
  try {
6540
6540
  Ae(a);
6541
6541
  } catch (l) {
@@ -6569,16 +6569,16 @@ da.prototype.exec = function(t, e) {
6569
6569
  pa = function(t, e) {
6570
6570
  var r = e.ppem / e.font.unitsPerEm, n = r, a = t.components, s, i, o;
6571
6571
  if (Se.prototype = e, !a)
6572
- o = new Se("glyf", t.instructions), exports.DEBUG && (console.log("---EXEC GLYPH---"), o.step = -1), Jt(t, o, r, n), i = o.gZone;
6572
+ o = new Se("glyf", t.instructions), exports.DEBUG && (console.log("---EXEC GLYPH---"), o.step = -1), er(t, o, r, n), i = o.gZone;
6573
6573
  else {
6574
6574
  var u = e.font;
6575
6575
  i = [], s = [];
6576
6576
  for (var l = 0; l < a.length; l++) {
6577
6577
  var h = a[l], f = u.glyphs.get(h.glyphIndex);
6578
- o = new Se("glyf", f.instructions), exports.DEBUG && (console.log("---EXEC COMP " + l + "---"), o.step = -1), Jt(f, o, r, n);
6579
- for (var c = Math.round(h.dx * r), p = Math.round(h.dy * n), d = o.gZone, v = o.contours, y = 0; y < d.length; y++) {
6580
- var m = d[y];
6581
- m.xTouched = m.yTouched = !1, m.xo = m.x = m.x + c, m.yo = m.y = m.y + p;
6578
+ o = new Se("glyf", f.instructions), exports.DEBUG && (console.log("---EXEC COMP " + l + "---"), o.step = -1), er(f, o, r, n);
6579
+ for (var c = Math.round(h.dx * r), p = Math.round(h.dy * n), d = o.gZone, v = o.contours, m = 0; m < d.length; m++) {
6580
+ var y = d[m];
6581
+ y.xTouched = y.yTouched = !1, y.xo = y.x = y.x + c, y.yo = y.y = y.y + p;
6582
6582
  }
6583
6583
  var b = i.length;
6584
6584
  i.push.apply(i, d);
@@ -6586,15 +6586,15 @@ pa = function(t, e) {
6586
6586
  s.push(v[x] + b);
6587
6587
  }
6588
6588
  t.instructions && !o.inhibitGridFit && (o = new Se("glyf", t.instructions), o.gZone = o.z0 = o.z1 = o.z2 = i, o.contours = s, i.push(
6589
- new me(0, 0),
6590
- new me(Math.round(t.advanceWidth * r), 0)
6589
+ new ye(0, 0),
6590
+ new ye(Math.round(t.advanceWidth * r), 0)
6591
6591
  ), exports.DEBUG && (console.log("---EXEC COMPOSITE---"), o.step = -1), Ae(o), i.length -= 2);
6592
6592
  }
6593
6593
  return i;
6594
6594
  };
6595
- Jt = function(t, e, r, n) {
6595
+ er = function(t, e, r, n) {
6596
6596
  for (var a = t.points || [], s = a.length, i = e.gZone = e.z0 = e.z1 = e.z2 = [], o = e.contours = [], u, l = 0; l < s; l++)
6597
- u = a[l], i[l] = new me(
6597
+ u = a[l], i[l] = new ye(
6598
6598
  u.x * r,
6599
6599
  u.y * n,
6600
6600
  u.lastPointOfContour,
@@ -6609,8 +6609,8 @@ Jt = function(t, e, r, n) {
6609
6609
  console.log(p, i[p].x, i[p].y);
6610
6610
  }
6611
6611
  if (i.push(
6612
- new me(0, 0),
6613
- new me(Math.round(t.advanceWidth * r), 0)
6612
+ new ye(0, 0),
6613
+ new ye(Math.round(t.advanceWidth * r), 0)
6614
6614
  ), Ae(e), i.length -= 2, exports.DEBUG) {
6615
6615
  console.log("FINISHED GLYPH", e.stack);
6616
6616
  for (var d = 0; d < s; d++)
@@ -6633,9 +6633,9 @@ Ae = function(t) {
6633
6633
  };
6634
6634
  function mt(t) {
6635
6635
  for (var e = t.tZone = new Array(t.gZone.length), r = 0; r < e.length; r++)
6636
- e[r] = new me(0, 0);
6636
+ e[r] = new ye(0, 0);
6637
6637
  }
6638
- function ma(t, e) {
6638
+ function ya(t, e) {
6639
6639
  var r = t.prog, n = t.ip, a = 1, s;
6640
6640
  do
6641
6641
  if (s = r[++n], s === 88)
@@ -6698,13 +6698,13 @@ function _i(t) {
6698
6698
  function Hi(t) {
6699
6699
  var e = t.stack, r = e.pop(), n = e.pop(), a = e.pop(), s = e.pop(), i = e.pop(), o = t.z0, u = t.z1, l = o[r], h = o[n], f = u[a], c = u[s], p = t.z2[i];
6700
6700
  exports.DEBUG && console.log("ISECT[], ", r, n, a, s, i);
6701
- var d = l.x, v = l.y, y = h.x, m = h.y, b = f.x, x = f.y, T = c.x, S = c.y, A = (d - y) * (x - S) - (v - m) * (b - T), O = d * m - v * y, w = b * S - x * T;
6702
- p.x = (O * (b - T) - w * (d - y)) / A, p.y = (O * (x - S) - w * (v - m)) / A;
6701
+ var d = l.x, v = l.y, m = h.x, y = h.y, b = f.x, x = f.y, T = c.x, S = c.y, A = (d - m) * (x - S) - (v - y) * (b - T), O = d * y - v * m, w = b * S - x * T;
6702
+ p.x = (O * (b - T) - w * (d - m)) / A, p.y = (O * (x - S) - w * (v - y)) / A;
6703
6703
  }
6704
- function zi(t) {
6704
+ function Wi(t) {
6705
6705
  t.rp0 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP0[]", t.rp0);
6706
6706
  }
6707
- function Wi(t) {
6707
+ function zi(t) {
6708
6708
  t.rp1 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP1[]", t.rp1);
6709
6709
  }
6710
6710
  function Vi(t) {
@@ -6776,7 +6776,7 @@ function $i(t) {
6776
6776
  exports.DEBUG && console.log(t.step, "SMD[]", e), t.minDis = e / 64;
6777
6777
  }
6778
6778
  function Ji(t) {
6779
- exports.DEBUG && console.log(t.step, "ELSE[]"), ma(t, !1);
6779
+ exports.DEBUG && console.log(t.step, "ELSE[]"), ya(t, !1);
6780
6780
  }
6781
6781
  function eo(t) {
6782
6782
  var e = t.stack.pop();
@@ -6790,7 +6790,7 @@ function ro(t) {
6790
6790
  var e = t.stack;
6791
6791
  exports.DEBUG && console.log(t.step, "DUP[]"), e.push(e[e.length - 1]);
6792
6792
  }
6793
- function Ot(t) {
6793
+ function Ut(t) {
6794
6794
  exports.DEBUG && console.log(t.step, "POP[]"), t.stack.pop();
6795
6795
  }
6796
6796
  function no(t) {
@@ -6952,7 +6952,7 @@ function vo(t) {
6952
6952
  n.push(e[++r]);
6953
6953
  t.ip = r;
6954
6954
  }
6955
- function mo(t) {
6955
+ function yo(t) {
6956
6956
  var e = t.ip, r = t.prog, n = t.stack, a = r[++e];
6957
6957
  exports.DEBUG && console.log(t.step, "NPUSHW[]", a);
6958
6958
  for (var s = 0; s < a; s++) {
@@ -6961,7 +6961,7 @@ function mo(t) {
6961
6961
  }
6962
6962
  t.ip = e;
6963
6963
  }
6964
- function yo(t) {
6964
+ function mo(t) {
6965
6965
  var e = t.stack, r = t.store;
6966
6966
  r || (r = t.store = []);
6967
6967
  var n = e.pop(), a = e.pop();
@@ -7029,16 +7029,16 @@ function Ro(t) {
7029
7029
  }
7030
7030
  function Ao(t) {
7031
7031
  var e = t.stack.pop();
7032
- exports.DEBUG && console.log(t.step, "IF[]", e), e || (ma(t, !0), exports.DEBUG && console.log(t.step, "EIF[]"));
7032
+ exports.DEBUG && console.log(t.step, "IF[]", e), e || (ya(t, !0), exports.DEBUG && console.log(t.step, "EIF[]"));
7033
7033
  }
7034
7034
  function Mo(t) {
7035
7035
  exports.DEBUG && console.log(t.step, "EIF[]");
7036
7036
  }
7037
- function Po(t) {
7037
+ function Bo(t) {
7038
7038
  var e = t.stack, r = e.pop(), n = e.pop();
7039
7039
  exports.DEBUG && console.log(t.step, "AND[]", r, n), e.push(r && n ? 1 : 0);
7040
7040
  }
7041
- function Bo(t) {
7041
+ function Po(t) {
7042
7042
  var e = t.stack, r = e.pop(), n = e.pop();
7043
7043
  exports.DEBUG && console.log(t.step, "OR[]", r, n), e.push(r || n ? 1 : 0);
7044
7044
  }
@@ -7046,7 +7046,7 @@ function Io(t) {
7046
7046
  var e = t.stack, r = e.pop();
7047
7047
  exports.DEBUG && console.log(t.step, "NOT[]", r), e.push(r ? 0 : 1);
7048
7048
  }
7049
- function Ut(t, e) {
7049
+ function Lt(t, e) {
7050
7050
  var r = e.stack, n = r.pop(), a = e.fv, s = e.pv, i = e.ppem, o = e.deltaBase + (t - 1) * 16, u = e.deltaShift, l = e.z0;
7051
7051
  exports.DEBUG && console.log(e.step, "DELTAP[" + t + "]", n, r);
7052
7052
  for (var h = 0; h < n; h++) {
@@ -7079,11 +7079,11 @@ function Ho(t) {
7079
7079
  var e = t.stack, r = e.pop(), n = e.pop();
7080
7080
  exports.DEBUG && console.log(t.step, "DIV[]", r, n), e.push(n * 64 / r);
7081
7081
  }
7082
- function zo(t) {
7082
+ function Wo(t) {
7083
7083
  var e = t.stack, r = e.pop(), n = e.pop();
7084
7084
  exports.DEBUG && console.log(t.step, "MUL[]", r, n), e.push(n * r / 64);
7085
7085
  }
7086
- function Wo(t) {
7086
+ function zo(t) {
7087
7087
  var e = t.stack, r = e.pop();
7088
7088
  exports.DEBUG && console.log(t.step, "ABS[]", r), e.push(Math.abs(r));
7089
7089
  }
@@ -7107,7 +7107,7 @@ function Yo(t) {
7107
7107
  var e = t.stack, r = e.pop(), n = e.pop();
7108
7108
  exports.DEBUG && console.log(t.step, "WCVTF[]", r, n), t.cvt[n] = r * t.ppem / t.font.unitsPerEm;
7109
7109
  }
7110
- function Lt(t, e) {
7110
+ function Rt(t, e) {
7111
7111
  var r = e.stack, n = r.pop(), a = e.ppem, s = e.deltaBase + (t - 1) * 16, i = e.deltaShift;
7112
7112
  exports.DEBUG && console.log(e.step, "DELTAC[" + t + "]", n, r);
7113
7113
  for (var o = 0; o < n; o++) {
@@ -7197,7 +7197,7 @@ function Qo(t) {
7197
7197
  exports.DEBUG && console.log(t.step, "RUTG[]"), t.round = Mi;
7198
7198
  }
7199
7199
  function $o(t) {
7200
- exports.DEBUG && console.log(t.step, "RDTG[]"), t.round = Pi;
7200
+ exports.DEBUG && console.log(t.step, "RDTG[]"), t.round = Bi;
7201
7201
  }
7202
7202
  function Jo(t) {
7203
7203
  var e = t.stack.pop();
@@ -7242,7 +7242,7 @@ function su(t) {
7242
7242
  throw new Error("invalid INSTCTRL[] selector");
7243
7243
  }
7244
7244
  }
7245
- function ye(t, e) {
7245
+ function me(t, e) {
7246
7246
  var r = e.stack, n = e.prog, a = e.ip;
7247
7247
  exports.DEBUG && console.log(e.step, "PUSHB[" + t + "]");
7248
7248
  for (var s = 0; s < t; s++)
@@ -7259,8 +7259,8 @@ function xe(t, e) {
7259
7259
  e.ip = r;
7260
7260
  }
7261
7261
  function C(t, e, r, n, a, s) {
7262
- var i = s.stack, o = t && i.pop(), u = i.pop(), l = s.rp0, h = s.z0[l], f = s.z1[u], c = s.minDis, p = s.fv, d = s.dpv, v, y, m, b;
7263
- y = v = d.distance(f, h, !0, !0), m = y >= 0 ? 1 : -1, y = Math.abs(y), t && (b = s.cvt[o], n && Math.abs(y - b) < s.cvCutIn && (y = b)), r && y < c && (y = c), n && (y = s.round(y)), p.setRelative(f, h, m * y, d), p.touch(f), exports.DEBUG && console.log(
7262
+ var i = s.stack, o = t && i.pop(), u = i.pop(), l = s.rp0, h = s.z0[l], f = s.z1[u], c = s.minDis, p = s.fv, d = s.dpv, v, m, y, b;
7263
+ m = v = d.distance(f, h, !0, !0), y = m >= 0 ? 1 : -1, m = Math.abs(m), t && (b = s.cvt[o], n && Math.abs(m - b) < s.cvCutIn && (m = b)), r && m < c && (m = c), n && (m = s.round(m)), p.setRelative(f, h, y * m, d), p.touch(f), exports.DEBUG && console.log(
7264
7264
  s.step,
7265
7265
  (t ? "MIRP[" : "MDRP[") + (e ? "M" : "m") + (r ? ">" : "_") + (n ? "R" : "_") + (a === 0 ? "Gr" : a === 1 ? "Bl" : a === 2 ? "Wh" : "") + "]",
7266
7266
  t ? o + "(" + s.cvt[o] + "," + b + ")" : "",
@@ -7268,7 +7268,7 @@ function C(t, e, r, n, a, s) {
7268
7268
  "(d =",
7269
7269
  v,
7270
7270
  "->",
7271
- m * y,
7271
+ y * m,
7272
7272
  ")"
7273
7273
  ), s.rp1 = s.rp0, s.rp2 = u, e && (s.rp0 = u);
7274
7274
  }
@@ -7306,9 +7306,9 @@ fa = [
7306
7306
  /* 0x0F */
7307
7307
  Hi,
7308
7308
  /* 0x10 */
7309
- zi,
7310
- /* 0x11 */
7311
7309
  Wi,
7310
+ /* 0x11 */
7311
+ zi,
7312
7312
  /* 0x12 */
7313
7313
  Vi,
7314
7314
  /* 0x13 */
@@ -7342,7 +7342,7 @@ fa = [
7342
7342
  /* 0x20 */
7343
7343
  ro,
7344
7344
  /* 0x21 */
7345
- Ot,
7345
+ Ut,
7346
7346
  /* 0x22 */
7347
7347
  no,
7348
7348
  /* 0x23 */
@@ -7409,9 +7409,9 @@ fa = [
7409
7409
  /* 0x40 */
7410
7410
  vo,
7411
7411
  /* 0x41 */
7412
- mo,
7413
- /* 0x42 */
7414
7412
  yo,
7413
+ /* 0x42 */
7414
+ mo,
7415
7415
  /* 0x43 */
7416
7416
  xo,
7417
7417
  /* 0x44 */
@@ -7463,13 +7463,13 @@ fa = [
7463
7463
  /* 0x59 */
7464
7464
  Mo,
7465
7465
  /* 0x5A */
7466
- Po,
7467
- /* 0x5B */
7468
7466
  Bo,
7467
+ /* 0x5B */
7468
+ Po,
7469
7469
  /* 0x5C */
7470
7470
  Io,
7471
7471
  /* 0x5D */
7472
- Ut.bind(void 0, 1),
7472
+ Lt.bind(void 0, 1),
7473
7473
  /* 0x5E */
7474
7474
  Do,
7475
7475
  /* 0x5F */
@@ -7481,9 +7481,9 @@ fa = [
7481
7481
  /* 0x62 */
7482
7482
  Ho,
7483
7483
  /* 0x63 */
7484
- zo,
7485
- /* 0x64 */
7486
7484
  Wo,
7485
+ /* 0x64 */
7486
+ zo,
7487
7487
  /* 0x65 */
7488
7488
  Vo,
7489
7489
  /* 0x66 */
@@ -7513,15 +7513,15 @@ fa = [
7513
7513
  /* 0x70 */
7514
7514
  Yo,
7515
7515
  /* 0x71 */
7516
- Ut.bind(void 0, 2),
7516
+ Lt.bind(void 0, 2),
7517
7517
  /* 0x72 */
7518
- Ut.bind(void 0, 3),
7518
+ Lt.bind(void 0, 3),
7519
7519
  /* 0x73 */
7520
- Lt.bind(void 0, 1),
7520
+ Rt.bind(void 0, 1),
7521
7521
  /* 0x74 */
7522
- Lt.bind(void 0, 2),
7522
+ Rt.bind(void 0, 2),
7523
7523
  /* 0x75 */
7524
- Lt.bind(void 0, 3),
7524
+ Rt.bind(void 0, 3),
7525
7525
  /* 0x76 */
7526
7526
  Zo,
7527
7527
  /* 0x77 */
@@ -7541,10 +7541,10 @@ fa = [
7541
7541
  /* 0x7D */
7542
7542
  $o,
7543
7543
  /* 0x7E */
7544
- Ot,
7544
+ Ut,
7545
7545
  // actually SANGW, supposed to do only a pop though
7546
7546
  /* 0x7F */
7547
- Ot,
7547
+ Ut,
7548
7548
  // actually AA, supposed to do only a pop though
7549
7549
  /* 0x80 */
7550
7550
  void 0,
@@ -7647,21 +7647,21 @@ fa = [
7647
7647
  /* 0xAF */
7648
7648
  void 0,
7649
7649
  /* 0xB0 */
7650
- ye.bind(void 0, 1),
7650
+ me.bind(void 0, 1),
7651
7651
  /* 0xB1 */
7652
- ye.bind(void 0, 2),
7652
+ me.bind(void 0, 2),
7653
7653
  /* 0xB2 */
7654
- ye.bind(void 0, 3),
7654
+ me.bind(void 0, 3),
7655
7655
  /* 0xB3 */
7656
- ye.bind(void 0, 4),
7656
+ me.bind(void 0, 4),
7657
7657
  /* 0xB4 */
7658
- ye.bind(void 0, 5),
7658
+ me.bind(void 0, 5),
7659
7659
  /* 0xB5 */
7660
- ye.bind(void 0, 6),
7660
+ me.bind(void 0, 6),
7661
7661
  /* 0xB6 */
7662
- ye.bind(void 0, 7),
7662
+ me.bind(void 0, 7),
7663
7663
  /* 0xB7 */
7664
- ye.bind(void 0, 8),
7664
+ me.bind(void 0, 8),
7665
7665
  /* 0xB8 */
7666
7666
  xe.bind(void 0, 1),
7667
7667
  /* 0xB9 */
@@ -7810,7 +7810,7 @@ fa = [
7810
7810
  function Ne(t) {
7811
7811
  this.char = t, this.state = {}, this.activeState = null;
7812
7812
  }
7813
- function hr(t, e, r) {
7813
+ function cr(t, e, r) {
7814
7814
  this.contextName = r, this.startIndex = t, this.endOffset = e;
7815
7815
  }
7816
7816
  function iu(t, e, r) {
@@ -7819,7 +7819,7 @@ function iu(t, e, r) {
7819
7819
  function oe(t, e) {
7820
7820
  this.context = t, this.index = e, this.length = t.length, this.current = t[e], this.backtrack = t.slice(0, e), this.lookahead = t.slice(e + 1);
7821
7821
  }
7822
- function yt(t) {
7822
+ function xt(t) {
7823
7823
  this.eventId = t, this.subscribers = [];
7824
7824
  }
7825
7825
  function ou(t) {
@@ -7840,7 +7840,7 @@ function ou(t) {
7840
7840
  ];
7841
7841
  r.forEach(function(a) {
7842
7842
  Object.defineProperty(e.events, a, {
7843
- value: new yt(a)
7843
+ value: new xt(a)
7844
7844
  });
7845
7845
  }), t && r.forEach(function(a) {
7846
7846
  var s = t[a];
@@ -7940,10 +7940,10 @@ G.prototype.registerModifier = function(t, e, r) {
7940
7940
  }
7941
7941
  }), this.registeredModifiers.push(t);
7942
7942
  };
7943
- yt.prototype.subscribe = function(t) {
7943
+ xt.prototype.subscribe = function(t) {
7944
7944
  return typeof t == "function" ? this.subscribers.push(t) - 1 : { FAIL: "invalid '" + this.eventId + "' event handler" };
7945
7945
  };
7946
- yt.prototype.unsubscribe = function(t) {
7946
+ xt.prototype.unsubscribe = function(t) {
7947
7947
  this.subscribers.splice(t, 1);
7948
7948
  };
7949
7949
  oe.prototype.setCurrentIndex = function(t) {
@@ -7962,7 +7962,7 @@ oe.prototype.get = function(t) {
7962
7962
  }
7963
7963
  };
7964
7964
  G.prototype.rangeToText = function(t) {
7965
- if (t instanceof hr)
7965
+ if (t instanceof cr)
7966
7966
  return this.getRangeTokens(t).map(function(e) {
7967
7967
  return e.char;
7968
7968
  }).join("");
@@ -7982,7 +7982,7 @@ G.prototype.on = function(t, e) {
7982
7982
  };
7983
7983
  G.prototype.dispatch = function(t, e) {
7984
7984
  var r = this, n = this.events[t];
7985
- n instanceof yt && n.subscribers.forEach(function(a) {
7985
+ n instanceof xt && n.subscribers.forEach(function(a) {
7986
7986
  a.apply(r, e || []);
7987
7987
  });
7988
7988
  };
@@ -8035,14 +8035,14 @@ G.prototype.updateContextsRanges = function() {
8035
8035
  this.dispatch("updateContextsRanges", [this.registeredContexts]);
8036
8036
  };
8037
8037
  G.prototype.setEndOffset = function(t, e) {
8038
- var r = this.getContext(e).openRange.startIndex, n = new hr(r, t, e), a = this.getContext(e).ranges;
8038
+ var r = this.getContext(e).openRange.startIndex, n = new cr(r, t, e), a = this.getContext(e).ranges;
8039
8039
  return n.rangeId = e + "." + a.length, a.push(n), this.getContext(e).openRange = null, n;
8040
8040
  };
8041
8041
  G.prototype.runContextCheck = function(t) {
8042
8042
  var e = this, r = t.index;
8043
8043
  this.contextCheckers.forEach(function(n) {
8044
8044
  var a = n.contextName, s = e.getContext(a).openRange;
8045
- if (!s && n.checkStart(t) && (s = new hr(r, null, a), e.getContext(a).openRange = s, e.dispatch("contextStart", [a, r])), s && n.checkEnd(t)) {
8045
+ if (!s && n.checkStart(t) && (s = new cr(r, null, a), e.getContext(a).openRange = s, e.dispatch("contextStart", [a, r])), s && n.checkEnd(t)) {
8046
8046
  var i = r - s.startIndex + 1, o = e.setEndOffset(i, a);
8047
8047
  e.dispatch("contextEnd", [a, o]);
8048
8048
  }
@@ -8063,7 +8063,7 @@ G.prototype.tokenize = function(t) {
8063
8063
  function Fe(t) {
8064
8064
  return /[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(t);
8065
8065
  }
8066
- function ya(t) {
8066
+ function ma(t) {
8067
8067
  return /[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(t);
8068
8068
  }
8069
8069
  function Te(t) {
@@ -8109,7 +8109,7 @@ function hu(t, e) {
8109
8109
  var r = Je(t, e.coverage);
8110
8110
  return r === -1 ? null : e.substitute[r];
8111
8111
  }
8112
- function Rt(t, e) {
8112
+ function At(t, e) {
8113
8113
  for (var r = [], n = 0; n < t.length; n++) {
8114
8114
  var a = t[n], s = e.current;
8115
8115
  s = Array.isArray(s) ? s[0] : s;
@@ -8122,7 +8122,7 @@ function cu(t, e) {
8122
8122
  var r = e.inputCoverage.length + e.lookaheadCoverage.length + e.backtrackCoverage.length;
8123
8123
  if (t.context.length < r)
8124
8124
  return [];
8125
- var n = Rt(
8125
+ var n = At(
8126
8126
  e.inputCoverage,
8127
8127
  t
8128
8128
  );
@@ -8133,7 +8133,7 @@ function cu(t, e) {
8133
8133
  return [];
8134
8134
  for (var s = t.lookahead.slice(a); s.length && Te(s[0].char); )
8135
8135
  s.shift();
8136
- var i = new oe(s, 0), o = Rt(
8136
+ var i = new oe(s, 0), o = At(
8137
8137
  e.lookaheadCoverage,
8138
8138
  i
8139
8139
  ), u = [].concat(t.backtrack);
@@ -8141,14 +8141,14 @@ function cu(t, e) {
8141
8141
  u.shift();
8142
8142
  if (u.length < e.backtrackCoverage.length)
8143
8143
  return [];
8144
- var l = new oe(u, 0), h = Rt(
8144
+ var l = new oe(u, 0), h = At(
8145
8145
  e.backtrackCoverage,
8146
8146
  l
8147
8147
  ), f = n.length === e.inputCoverage.length && o.length === e.lookaheadCoverage.length && h.length === e.backtrackCoverage.length, c = [];
8148
8148
  if (f)
8149
8149
  for (var p = 0; p < e.lookupRecords.length; p++)
8150
- for (var d = e.lookupRecords[p], v = d.lookupListIndex, y = this.getLookupByIndex(v), m = 0; m < y.subtables.length; m++) {
8151
- var b = y.subtables[m], x = this.getLookupMethod(y, b), T = this.getSubstitutionType(y, b);
8150
+ for (var d = e.lookupRecords[p], v = d.lookupListIndex, m = this.getLookupByIndex(v), y = 0; y < m.subtables.length; y++) {
8151
+ var b = m.subtables[y], x = this.getLookupMethod(m, b), T = this.getSubstitutionType(m, b);
8152
8152
  if (T === "12")
8153
8153
  for (var S = 0; S < n.length; S++) {
8154
8154
  var A = t.get(S), O = x(A);
@@ -8376,14 +8376,14 @@ var vu = {
8376
8376
  startCheck: du,
8377
8377
  endCheck: gu
8378
8378
  };
8379
- function mu(t) {
8379
+ function yu(t) {
8380
8380
  var e = t.current, r = t.get(-1);
8381
8381
  return (
8382
8382
  // ? an arabic char preceded with a non arabic char
8383
8383
  (Fe(e) || Te(e)) && !Fe(r)
8384
8384
  );
8385
8385
  }
8386
- function yu(t) {
8386
+ function mu(t) {
8387
8387
  var e = t.get(1);
8388
8388
  switch (!0) {
8389
8389
  case e === null:
@@ -8407,8 +8407,8 @@ function yu(t) {
8407
8407
  }
8408
8408
  }
8409
8409
  var xu = {
8410
- startCheck: mu,
8411
- endCheck: yu
8410
+ startCheck: yu,
8411
+ endCheck: mu
8412
8412
  };
8413
8413
  function bu(t, e, r) {
8414
8414
  e[r].setState(t.tag, t.substitution);
@@ -8434,12 +8434,12 @@ var un = {
8434
8434
  63: ku,
8435
8435
  41: Fu
8436
8436
  };
8437
- function cr(t, e, r) {
8437
+ function fr(t, e, r) {
8438
8438
  t instanceof Le && un[t.id] && un[t.id](t, e, r);
8439
8439
  }
8440
8440
  function Tu(t) {
8441
8441
  for (var e = [].concat(t.backtrack), r = e.length - 1; r >= 0; r--) {
8442
- var n = e[r], a = ya(n), s = Te(n);
8442
+ var n = e[r], a = ma(n), s = Te(n);
8443
8443
  if (!a && !s)
8444
8444
  return !0;
8445
8445
  if (a)
@@ -8448,7 +8448,7 @@ function Tu(t) {
8448
8448
  return !1;
8449
8449
  }
8450
8450
  function wu(t) {
8451
- if (ya(t.current))
8451
+ if (ma(t.current))
8452
8452
  return !1;
8453
8453
  for (var e = 0; e < t.lookahead.length; e++) {
8454
8454
  var r = t.lookahead[e], n = Te(r);
@@ -8501,7 +8501,7 @@ function Cu(t) {
8501
8501
  if (f instanceof Error)
8502
8502
  return console.info(f.message);
8503
8503
  f.forEach(function(c, p) {
8504
- c instanceof Le && (cr(c, a, p), s.context[p] = c.substitution);
8504
+ c instanceof Le && (fr(c, a, p), s.context[p] = c.substitution);
8505
8505
  });
8506
8506
  }
8507
8507
  }
@@ -8525,7 +8525,7 @@ function Eu(t) {
8525
8525
  });
8526
8526
  o.length && (o.forEach(
8527
8527
  function(u) {
8528
- return cr(u, n, i);
8528
+ return fr(u, n, i);
8529
8529
  }
8530
8530
  ), a = ln(n));
8531
8531
  });
@@ -8567,7 +8567,7 @@ function Ru(t) {
8567
8567
  });
8568
8568
  o.length && (o.forEach(
8569
8569
  function(u) {
8570
- return cr(u, n, i);
8570
+ return fr(u, n, i);
8571
8571
  }
8572
8572
  ), a = hn(n));
8573
8573
  });
@@ -8583,7 +8583,7 @@ he.prototype.contextChecks = {
8583
8583
  arabicWordCheck: vu,
8584
8584
  arabicSentenceCheck: xu
8585
8585
  };
8586
- function At(t) {
8586
+ function Mt(t) {
8587
8587
  var e = this.contextChecks[t + "Check"];
8588
8588
  return this.tokenizer.registerContextChecker(
8589
8589
  t,
@@ -8592,7 +8592,7 @@ function At(t) {
8592
8592
  );
8593
8593
  }
8594
8594
  function Au() {
8595
- return At.call(this, "latinWord"), At.call(this, "arabicWord"), At.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
8595
+ return Mt.call(this, "latinWord"), Mt.call(this, "arabicWord"), Mt.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
8596
8596
  }
8597
8597
  function Mu() {
8598
8598
  var t = this, e = this.tokenizer.getContextRanges("arabicSentence");
@@ -8627,28 +8627,28 @@ he.prototype.applyFeatures = function(t, e) {
8627
8627
  he.prototype.registerModifier = function(t, e, r) {
8628
8628
  this.tokenizer.registerModifier(t, e, r);
8629
8629
  };
8630
- function fr() {
8630
+ function pr() {
8631
8631
  if (this.tokenizer.registeredModifiers.indexOf("glyphIndex") === -1)
8632
8632
  throw new Error(
8633
8633
  "glyphIndex modifier is required to apply arabic presentation features."
8634
8634
  );
8635
8635
  }
8636
- function Pu() {
8636
+ function Bu() {
8637
8637
  var t = this, e = "arab";
8638
8638
  if (this.featuresTags.hasOwnProperty(e)) {
8639
- fr.call(this);
8639
+ pr.call(this);
8640
8640
  var r = this.tokenizer.getContextRanges("arabicWord");
8641
8641
  r.forEach(function(n) {
8642
8642
  Cu.call(t, n);
8643
8643
  });
8644
8644
  }
8645
8645
  }
8646
- function Bu() {
8646
+ function Pu() {
8647
8647
  var t = this, e = "arab";
8648
8648
  if (this.featuresTags.hasOwnProperty(e)) {
8649
8649
  var r = this.featuresTags[e];
8650
8650
  if (r.indexOf("rlig") !== -1) {
8651
- fr.call(this);
8651
+ pr.call(this);
8652
8652
  var n = this.tokenizer.getContextRanges("arabicWord");
8653
8653
  n.forEach(function(a) {
8654
8654
  Eu.call(t, a);
@@ -8661,7 +8661,7 @@ function Iu() {
8661
8661
  if (this.featuresTags.hasOwnProperty(e)) {
8662
8662
  var r = this.featuresTags[e];
8663
8663
  if (r.indexOf("liga") !== -1) {
8664
- fr.call(this);
8664
+ pr.call(this);
8665
8665
  var n = this.tokenizer.getContextRanges("latinWord");
8666
8666
  n.forEach(function(a) {
8667
8667
  Ru.call(t, a);
@@ -8673,7 +8673,7 @@ he.prototype.checkContextReady = function(t) {
8673
8673
  return !!this.tokenizer.getContext(t);
8674
8674
  };
8675
8675
  he.prototype.applyFeaturesToContexts = function() {
8676
- this.checkContextReady("arabicWord") && (Pu.call(this), Bu.call(this)), this.checkContextReady("latinWord") && Iu.call(this), this.checkContextReady("arabicSentence") && Mu.call(this);
8676
+ this.checkContextReady("arabicWord") && (Bu.call(this), Pu.call(this)), this.checkContextReady("latinWord") && Iu.call(this), this.checkContextReady("arabicSentence") && Mu.call(this);
8677
8677
  };
8678
8678
  he.prototype.processText = function(t) {
8679
8679
  (!this.text || this.text !== t) && (this.setText(t), Au.call(this), this.applyFeaturesToContexts());
@@ -8692,7 +8692,7 @@ he.prototype.getTextGlyphs = function(t) {
8692
8692
  }
8693
8693
  return e;
8694
8694
  };
8695
- function P(t) {
8695
+ function B(t) {
8696
8696
  t = t || {}, t.tables = t.tables || {}, t.empty || (_e(t.familyName, "When creating a new Font object, familyName is required."), _e(t.styleName, "When creating a new Font object, styleName is required."), _e(t.unitsPerEm, "When creating a new Font object, unitsPerEm is required."), _e(t.ascender, "When creating a new Font object, ascender is required."), _e(t.descender <= 0, "When creating a new Font object, negative descender value is required."), this.names = {
8697
8697
  fontFamily: { en: t.familyName || " " },
8698
8698
  fontSubfamily: { en: t.styleName || " " },
@@ -8724,17 +8724,17 @@ function P(t) {
8724
8724
  }
8725
8725
  });
8726
8726
  }
8727
- P.prototype.hasChar = function(t) {
8727
+ B.prototype.hasChar = function(t) {
8728
8728
  return this.encoding.charToGlyphIndex(t) !== null;
8729
8729
  };
8730
- P.prototype.charToGlyphIndex = function(t) {
8730
+ B.prototype.charToGlyphIndex = function(t) {
8731
8731
  return this.encoding.charToGlyphIndex(t);
8732
8732
  };
8733
- P.prototype.charToGlyph = function(t) {
8733
+ B.prototype.charToGlyph = function(t) {
8734
8734
  var e = this.charToGlyphIndex(t), r = this.glyphs.get(e);
8735
8735
  return r || (r = this.glyphs.get(0)), r;
8736
8736
  };
8737
- P.prototype.updateFeatures = function(t) {
8737
+ B.prototype.updateFeatures = function(t) {
8738
8738
  return this.defaultRenderOptions.features.map(function(e) {
8739
8739
  return e.script === "latn" ? {
8740
8740
  script: "latn",
@@ -8744,7 +8744,7 @@ P.prototype.updateFeatures = function(t) {
8744
8744
  } : e;
8745
8745
  });
8746
8746
  };
8747
- P.prototype.stringToGlyphs = function(t, e) {
8747
+ B.prototype.stringToGlyphs = function(t, e) {
8748
8748
  var r = this, n = new he(), a = function(f) {
8749
8749
  return r.charToGlyphIndex(f.char);
8750
8750
  };
@@ -8755,22 +8755,22 @@ P.prototype.stringToGlyphs = function(t, e) {
8755
8755
  u[h] = this.glyphs.get(i[h]) || l;
8756
8756
  return u;
8757
8757
  };
8758
- P.prototype.nameToGlyphIndex = function(t) {
8758
+ B.prototype.nameToGlyphIndex = function(t) {
8759
8759
  return this.glyphNames.nameToGlyphIndex(t);
8760
8760
  };
8761
- P.prototype.nameToGlyph = function(t) {
8761
+ B.prototype.nameToGlyph = function(t) {
8762
8762
  var e = this.nameToGlyphIndex(t), r = this.glyphs.get(e);
8763
8763
  return r || (r = this.glyphs.get(0)), r;
8764
8764
  };
8765
- P.prototype.glyphIndexToName = function(t) {
8765
+ B.prototype.glyphIndexToName = function(t) {
8766
8766
  return this.glyphNames.glyphIndexToName ? this.glyphNames.glyphIndexToName(t) : "";
8767
8767
  };
8768
- P.prototype.getKerningValue = function(t, e) {
8768
+ B.prototype.getKerningValue = function(t, e) {
8769
8769
  t = t.index || t, e = e.index || e;
8770
8770
  var r = this.position.defaultKerningTables;
8771
8771
  return r ? this.position.getKerningValue(r, t, e) : this.kerningPairs[t + "," + e] || 0;
8772
8772
  };
8773
- P.prototype.defaultRenderOptions = {
8773
+ B.prototype.defaultRenderOptions = {
8774
8774
  kerning: !0,
8775
8775
  features: [
8776
8776
  /**
@@ -8781,7 +8781,7 @@ P.prototype.defaultRenderOptions = {
8781
8781
  { script: "latn", tags: ["liga", "rlig"] }
8782
8782
  ]
8783
8783
  };
8784
- P.prototype.forEachGlyph = function(t, e, r, n, a, s) {
8784
+ B.prototype.forEachGlyph = function(t, e, r, n, a, s) {
8785
8785
  e = e !== void 0 ? e : 0, r = r !== void 0 ? r : 0, n = n !== void 0 ? n : 72, a = Object.assign({}, this.defaultRenderOptions, a);
8786
8786
  var i = 1 / this.unitsPerEm * n, o = this.stringToGlyphs(t, a), u;
8787
8787
  if (a.kerning) {
@@ -8798,43 +8798,43 @@ P.prototype.forEachGlyph = function(t, e, r, n, a, s) {
8798
8798
  }
8799
8799
  return e;
8800
8800
  };
8801
- P.prototype.getPath = function(t, e, r, n, a) {
8801
+ B.prototype.getPath = function(t, e, r, n, a) {
8802
8802
  var s = new V();
8803
8803
  return this.forEachGlyph(t, e, r, n, a, function(i, o, u, l) {
8804
8804
  var h = i.getPath(o, u, l, a, this);
8805
8805
  s.extend(h);
8806
8806
  }), s;
8807
8807
  };
8808
- P.prototype.getPaths = function(t, e, r, n, a) {
8808
+ B.prototype.getPaths = function(t, e, r, n, a) {
8809
8809
  var s = [];
8810
8810
  return this.forEachGlyph(t, e, r, n, a, function(i, o, u, l) {
8811
8811
  var h = i.getPath(o, u, l, a, this);
8812
8812
  s.push(h);
8813
8813
  }), s;
8814
8814
  };
8815
- P.prototype.getAdvanceWidth = function(t, e, r) {
8815
+ B.prototype.getAdvanceWidth = function(t, e, r) {
8816
8816
  return this.forEachGlyph(t, 0, 0, e, r, function() {
8817
8817
  });
8818
8818
  };
8819
- P.prototype.draw = function(t, e, r, n, a, s) {
8819
+ B.prototype.draw = function(t, e, r, n, a, s) {
8820
8820
  this.getPath(e, r, n, a, s).draw(t);
8821
8821
  };
8822
- P.prototype.drawPoints = function(t, e, r, n, a, s) {
8822
+ B.prototype.drawPoints = function(t, e, r, n, a, s) {
8823
8823
  this.forEachGlyph(e, r, n, a, s, function(i, o, u, l) {
8824
8824
  i.drawPoints(t, o, u, l);
8825
8825
  });
8826
8826
  };
8827
- P.prototype.drawMetrics = function(t, e, r, n, a, s) {
8827
+ B.prototype.drawMetrics = function(t, e, r, n, a, s) {
8828
8828
  this.forEachGlyph(e, r, n, a, s, function(i, o, u, l) {
8829
8829
  i.drawMetrics(t, o, u, l);
8830
8830
  });
8831
8831
  };
8832
- P.prototype.getEnglishName = function(t) {
8832
+ B.prototype.getEnglishName = function(t) {
8833
8833
  var e = this.names[t];
8834
8834
  if (e)
8835
8835
  return e.en;
8836
8836
  };
8837
- P.prototype.validate = function() {
8837
+ B.prototype.validate = function() {
8838
8838
  var t = this;
8839
8839
  function e(n, a) {
8840
8840
  }
@@ -8844,18 +8844,18 @@ P.prototype.validate = function() {
8844
8844
  }
8845
8845
  r("fontFamily"), r("weightName"), r("manufacturer"), r("copyright"), r("version"), this.unitsPerEm > 0;
8846
8846
  };
8847
- P.prototype.toTables = function() {
8847
+ B.prototype.toTables = function() {
8848
8848
  return ki.fontToTable(this);
8849
8849
  };
8850
- P.prototype.toBuffer = function() {
8850
+ B.prototype.toBuffer = function() {
8851
8851
  return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."), this.toArrayBuffer();
8852
8852
  };
8853
- P.prototype.toArrayBuffer = function() {
8853
+ B.prototype.toArrayBuffer = function() {
8854
8854
  for (var t = this.toTables(), e = t.encode(), r = new ArrayBuffer(e.length), n = new Uint8Array(r), a = 0; a < e.length; a++)
8855
8855
  n[a] = e[a];
8856
8856
  return r;
8857
8857
  };
8858
- P.prototype.download = function(t) {
8858
+ B.prototype.download = function(t) {
8859
8859
  var e = this.getEnglishName("fontFamily"), r = this.getEnglishName("fontSubfamily");
8860
8860
  t = t || e.replace(/\s/g, "") + "-" + r + ".otf";
8861
8861
  var n = this.toArrayBuffer();
@@ -8872,7 +8872,7 @@ P.prototype.download = function(t) {
8872
8872
  u.writeFileSync(t, l);
8873
8873
  }
8874
8874
  };
8875
- P.prototype.fsSelectionValues = {
8875
+ B.prototype.fsSelectionValues = {
8876
8876
  ITALIC: 1,
8877
8877
  //1
8878
8878
  UNDERSCORE: 2,
@@ -8894,7 +8894,7 @@ P.prototype.fsSelectionValues = {
8894
8894
  OBLIQUE: 512
8895
8895
  //512
8896
8896
  };
8897
- P.prototype.usWidthClasses = {
8897
+ B.prototype.usWidthClasses = {
8898
8898
  ULTRA_CONDENSED: 1,
8899
8899
  EXTRA_CONDENSED: 2,
8900
8900
  CONDENSED: 3,
@@ -8905,7 +8905,7 @@ P.prototype.usWidthClasses = {
8905
8905
  EXTRA_EXPANDED: 8,
8906
8906
  ULTRA_EXPANDED: 9
8907
8907
  };
8908
- P.prototype.usWeightClasses = {
8908
+ B.prototype.usWeightClasses = {
8909
8909
  THIN: 100,
8910
8910
  EXTRA_LIGHT: 200,
8911
8911
  LIGHT: 300,
@@ -8981,7 +8981,7 @@ function Hu(t, e) {
8981
8981
  r.fields = r.fields.concat(Nu(a, t.instances[a], t.axes, e));
8982
8982
  return r;
8983
8983
  }
8984
- function zu(t, e, r) {
8984
+ function Wu(t, e, r) {
8985
8985
  var n = new E.Parser(t, e), a = n.parseULong();
8986
8986
  U.argument(a === 65536, "Unsupported fvar table version.");
8987
8987
  var s = n.parseOffset16();
@@ -8992,7 +8992,7 @@ function zu(t, e, r) {
8992
8992
  c.push(_u(t, p + d * l, h, r));
8993
8993
  return { axes: h, instances: c };
8994
8994
  }
8995
- var Wu = { make: Hu, parse: zu }, Vu = function() {
8995
+ var zu = { make: Hu, parse: Wu }, Vu = function() {
8996
8996
  return {
8997
8997
  coverage: this.parsePointer(g.coverage),
8998
8998
  attachPoints: this.parseList(g.pointer(g.uShortList))
@@ -9216,7 +9216,7 @@ function H(t, e) {
9216
9216
  }
9217
9217
  function ul(t, e) {
9218
9218
  e = e ?? {};
9219
- var r, n, a = new P({ empty: !0 }), s = new DataView(t, 0), i, o = [], u = E.getTag(s, 0);
9219
+ var r, n, a = new B({ empty: !0 }), s = new DataView(t, 0), i, o = [], u = E.getTag(s, 0);
9220
9220
  if (u === "\0\0\0" || u === "true" || u === "typ1")
9221
9221
  a.outlinesFormat = "truetype", i = E.getUShort(s, 4), o = cn(s, i);
9222
9222
  else if (u === "OTTO")
@@ -9232,7 +9232,7 @@ function ul(t, e) {
9232
9232
  i = E.getUShort(s, 12), o = ol(s, i);
9233
9233
  } else
9234
9234
  throw new Error("Unsupported OpenType signature " + u);
9235
- for (var h, f, c, p, d, v, y, m, b, x, T, S, A = 0; A < i; A += 1) {
9235
+ for (var h, f, c, p, d, v, m, y, b, x, T, S, A = 0; A < i; A += 1) {
9236
9236
  var O = o[A], w = void 0;
9237
9237
  switch (O.tag) {
9238
9238
  case "cmap":
@@ -9254,7 +9254,7 @@ function ul(t, e) {
9254
9254
  w = H(s, O), a.tables.hhea = jn.parse(w.data, w.offset), a.ascender = a.tables.hhea.ascender, a.descender = a.tables.hhea.descender, a.numberOfHMetrics = a.tables.hhea.numberOfHMetrics;
9255
9255
  break;
9256
9256
  case "hmtx":
9257
- y = O;
9257
+ m = O;
9258
9258
  break;
9259
9259
  case "ltag":
9260
9260
  w = H(s, O), n = Qn.parse(w.data, w.offset);
@@ -9266,10 +9266,10 @@ function ul(t, e) {
9266
9266
  x = O;
9267
9267
  break;
9268
9268
  case "OS/2":
9269
- w = H(s, O), a.tables.os2 = $t.parse(w.data, w.offset);
9269
+ w = H(s, O), a.tables.os2 = Jt.parse(w.data, w.offset);
9270
9270
  break;
9271
9271
  case "post":
9272
- w = H(s, O), a.tables.post = aa.parse(w.data, w.offset), a.glyphNames = new ir(a.tables.post);
9272
+ w = H(s, O), a.tables.post = aa.parse(w.data, w.offset), a.glyphNames = new or(a.tables.post);
9273
9273
  break;
9274
9274
  case "prep":
9275
9275
  w = H(s, O), S = new E.Parser(w.data, w.offset), a.tables.prep = S.parseByteList(O.length);
@@ -9284,7 +9284,7 @@ function ul(t, e) {
9284
9284
  h = O;
9285
9285
  break;
9286
9286
  case "kern":
9287
- m = O;
9287
+ y = O;
9288
9288
  break;
9289
9289
  case "GDEF":
9290
9290
  p = O;
@@ -9309,15 +9309,15 @@ function ul(t, e) {
9309
9309
  Yn.parse(I.data, I.offset, a, e);
9310
9310
  } else
9311
9311
  throw new Error("Font doesn't contain TrueType or CFF outlines.");
9312
- var _ = H(s, y);
9313
- if (Kn.parse(a, _.data, _.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, e), bs(a, e), m) {
9314
- var D = H(s, m);
9312
+ var _ = H(s, m);
9313
+ if (Kn.parse(a, _.data, _.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, e), bs(a, e), y) {
9314
+ var D = H(s, y);
9315
9315
  a.kerningPairs = al.parse(D.data, D.offset);
9316
9316
  } else
9317
9317
  a.kerningPairs = {};
9318
9318
  if (p) {
9319
- var W = H(s, p);
9320
- a.tables.gdef = Ku.parse(W.data, W.offset);
9319
+ var z = H(s, p);
9320
+ a.tables.gdef = Ku.parse(z.data, z.offset);
9321
9321
  }
9322
9322
  if (d) {
9323
9323
  var Z = H(s, d);
@@ -9329,11 +9329,11 @@ function ul(t, e) {
9329
9329
  }
9330
9330
  if (f) {
9331
9331
  var Q = H(s, f);
9332
- a.tables.fvar = Wu.parse(Q.data, Q.offset, a.names);
9332
+ a.tables.fvar = zu.parse(Q.data, Q.offset, a.names);
9333
9333
  }
9334
9334
  if (T) {
9335
- var B = H(s, T);
9336
- a.tables.meta = ia.parse(B.data, B.offset), a.metas = a.tables.meta;
9335
+ var P = H(s, T);
9336
+ a.tables.meta = ia.parse(P.data, P.offset), a.metas = a.tables.meta;
9337
9337
  }
9338
9338
  return a;
9339
9339
  }
@@ -9502,14 +9502,14 @@ function cl(t, e = 1e-4) {
9502
9502
  l[T][w] = new O.constructor(M, O.itemSize, O.normalized);
9503
9503
  }));
9504
9504
  }
9505
- const p = e * 0.5, d = Math.log10(1 / e), v = Math.pow(10, d), y = p * v;
9505
+ const p = e * 0.5, d = Math.log10(1 / e), v = Math.pow(10, d), m = p * v;
9506
9506
  for (let b = 0; b < s; b++) {
9507
9507
  const x = n ? n.getX(b) : b;
9508
9508
  let T = "";
9509
9509
  for (let S = 0, A = o.length; S < A; S++) {
9510
9510
  const O = o[S], w = t.getAttribute(O), M = w.itemSize;
9511
9511
  for (let N = 0; N < M; N++)
9512
- T += `${~~(w[f[N]](x) * v + y)},`;
9512
+ T += `${~~(w[f[N]](x) * v + m)},`;
9513
9513
  }
9514
9514
  if (T in r)
9515
9515
  h.push(r[T]);
@@ -9519,33 +9519,33 @@ function cl(t, e = 1e-4) {
9519
9519
  for (let Y = 0; Y < N; Y++) {
9520
9520
  const I = f[Y], _ = c[Y];
9521
9521
  if (K[_](i, w[I](x)), M)
9522
- for (let D = 0, W = M.length; D < W; D++)
9522
+ for (let D = 0, z = M.length; D < z; D++)
9523
9523
  $[D][_](i, M[D][I](x));
9524
9524
  }
9525
9525
  }
9526
9526
  r[T] = i, h.push(i), i++;
9527
9527
  }
9528
9528
  }
9529
- const m = t.clone();
9529
+ const y = t.clone();
9530
9530
  for (const b in t.attributes) {
9531
9531
  const x = u[b];
9532
- if (m.setAttribute(b, new x.constructor(
9532
+ if (y.setAttribute(b, new x.constructor(
9533
9533
  x.array.slice(0, i * x.itemSize),
9534
9534
  x.itemSize,
9535
9535
  x.normalized
9536
9536
  )), b in l)
9537
9537
  for (let T = 0; T < l[b].length; T++) {
9538
9538
  const S = l[b][T];
9539
- m.morphAttributes[b][T] = new S.constructor(
9539
+ y.morphAttributes[b][T] = new S.constructor(
9540
9540
  S.array.slice(0, i * S.itemSize),
9541
9541
  S.itemSize,
9542
9542
  S.normalized
9543
9543
  );
9544
9544
  }
9545
9545
  }
9546
- return m.setIndex(h), m;
9546
+ return y.setIndex(h), y;
9547
9547
  }
9548
- const mr = class mr {
9548
+ const yr = class yr {
9549
9549
  /**
9550
9550
  * Dummy replacement for `computeVertexNormals` that does nothing.
9551
9551
  */
@@ -9591,8 +9591,8 @@ const mr = class mr {
9591
9591
  }
9592
9592
  }
9593
9593
  };
9594
- mr.originalComputeVertexNormals = ot.prototype.computeVertexNormals;
9595
- let er = mr;
9594
+ yr.originalComputeVertexNormals = ot.prototype.computeVertexNormals;
9595
+ let tr = yr;
9596
9596
  const Ee = new R.Vector2();
9597
9597
  class dn extends Tn {
9598
9598
  constructor(e, r, n) {
@@ -9605,7 +9605,7 @@ class dn extends Tn {
9605
9605
  */
9606
9606
  toGeometry() {
9607
9607
  let e = this.font.cache.getGeometry(this.char, this.fontSize);
9608
- return e == null && (e = er.runWithoutNormals(() => {
9608
+ return e == null && (e = tr.runWithoutNormals(() => {
9609
9609
  const r = new hl(this.char, {
9610
9610
  font: this.font.font,
9611
9611
  depth: 0,
@@ -9641,7 +9641,7 @@ class gn extends Fn {
9641
9641
  * @param data - Either a MeshFontData object containing font information or an ArrayBuffer containing raw font data
9642
9642
  */
9643
9643
  constructor(e) {
9644
- super(), this.type = "mesh", e instanceof ArrayBuffer ? this.data = ll(e) : this.data = e, this.font = new Wa(this.data);
9644
+ super(), this.type = "mesh", e instanceof ArrayBuffer ? this.data = ll(e) : this.data = e, this.font = new za(this.data);
9645
9645
  }
9646
9646
  /**
9647
9647
  * Return true if this font contains glyph of the specified character. Otherwise, return false.
@@ -10080,7 +10080,7 @@ class vl {
10080
10080
  }
10081
10081
  }
10082
10082
  }
10083
- class z {
10083
+ class W {
10084
10084
  /**
10085
10085
  * Creates a new Point instance.
10086
10086
  * @param x - The x-coordinate (defaults to 0)
@@ -10118,7 +10118,7 @@ class z {
10118
10118
  * @returns A new Point instance with the same x and y values
10119
10119
  */
10120
10120
  clone() {
10121
- return new z(this.x, this.y);
10121
+ return new W(this.x, this.y);
10122
10122
  }
10123
10123
  /**
10124
10124
  * Adds another point's coordinates to this point.
@@ -10181,7 +10181,7 @@ class z {
10181
10181
  }
10182
10182
  }
10183
10183
  const vn = Math.PI / 4;
10184
- let mn = class tr {
10184
+ let yn = class rr {
10185
10185
  /**
10186
10186
  * Creates a bulge-defined arc
10187
10187
  * @param start Start point
@@ -10190,7 +10190,7 @@ let mn = class tr {
10190
10190
  */
10191
10191
  static fromBulge(e, r, n) {
10192
10192
  const a = Math.max(-1, Math.min(1, n));
10193
- return new tr({
10193
+ return new rr({
10194
10194
  start: e,
10195
10195
  end: r,
10196
10196
  bulge: a
@@ -10205,7 +10205,7 @@ let mn = class tr {
10205
10205
  * @param isClockwise Whether the arc goes clockwise
10206
10206
  */
10207
10207
  static fromOctant(e, r, n, a, s) {
10208
- return new tr({
10208
+ return new rr({
10209
10209
  center: e,
10210
10210
  radius: r,
10211
10211
  startOctant: n,
@@ -10223,18 +10223,18 @@ let mn = class tr {
10223
10223
  }
10224
10224
  const a = 4 * Math.atan(Math.abs(this.bulge));
10225
10225
  this.radius = n / (2 * Math.sin(a / 2));
10226
- const s = this.start.clone().add(r.clone().divide(2)), i = new z(-r.y, r.x);
10226
+ const s = this.start.clone().add(r.clone().divide(2)), i = new W(-r.y, r.x);
10227
10227
  i.normalize(), i.multiply(Math.abs(this.radius * Math.cos(a / 2))), this.center = s.clone(), this.isClockwise ? this.center.subtract(i) : this.center.add(i), this.startAngle = Math.atan2(this.start.y - this.center.y, this.start.x - this.center.x), this.endAngle = Math.atan2(this.end.y - this.center.y, this.end.x - this.center.x), this.isClockwise ? this.endAngle >= this.startAngle && (this.endAngle -= 2 * Math.PI) : this.endAngle <= this.startAngle && (this.endAngle += 2 * Math.PI);
10228
10228
  } else if (e.center && e.radius !== void 0 && e.startOctant !== void 0 && e.octantCount !== void 0 && e.isClockwise !== void 0) {
10229
10229
  this.center = e.center.clone(), this.radius = e.radius, this.isClockwise = e.isClockwise, this.startAngle = e.startOctant * vn;
10230
10230
  const r = (e.octantCount === 0 ? 8 : e.octantCount) * vn;
10231
10231
  this.endAngle = this.startAngle + (this.isClockwise ? -r : r), this.start = this.center.clone().add(
10232
- new z(
10232
+ new W(
10233
10233
  this.radius * Math.cos(this.startAngle),
10234
10234
  this.radius * Math.sin(this.startAngle)
10235
10235
  )
10236
10236
  ), this.end = this.center.clone().add(
10237
- new z(this.radius * Math.cos(this.endAngle), this.radius * Math.sin(this.endAngle))
10237
+ new W(this.radius * Math.cos(this.endAngle), this.radius * Math.sin(this.endAngle))
10238
10238
  );
10239
10239
  } else
10240
10240
  throw new Error("Invalid arc parameters");
@@ -10251,19 +10251,19 @@ let mn = class tr {
10251
10251
  for (let s = 1; s < a; s++) {
10252
10252
  const i = s / a, o = this.isClockwise ? this.startAngle - i * n : this.startAngle + i * n;
10253
10253
  r.push(
10254
- this.center.clone().add(new z(this.radius * Math.cos(o), this.radius * Math.sin(o)))
10254
+ this.center.clone().add(new W(this.radius * Math.cos(o), this.radius * Math.sin(o)))
10255
10255
  );
10256
10256
  }
10257
10257
  return r.push(
10258
10258
  this.end ? this.end.clone() : this.center.clone().add(
10259
- new z(
10259
+ new W(
10260
10260
  this.radius * Math.cos(this.endAngle),
10261
10261
  this.radius * Math.sin(this.endAngle)
10262
10262
  )
10263
10263
  )
10264
10264
  ), r;
10265
10265
  }
10266
- }, Mt = class ba {
10266
+ }, Bt = class ba {
10267
10267
  constructor(e, r = []) {
10268
10268
  this.lastPoint = e, this.polylines = r;
10269
10269
  }
@@ -10303,11 +10303,11 @@ let mn = class tr {
10303
10303
  if (a) {
10304
10304
  const o = this.bbox, u = 0.2, l = o.maxX - o.minX, h = o.maxY - o.minY, f = o.minX - l * u, c = o.maxX + l * u, p = o.minY - h * u, d = o.maxY + h * u;
10305
10305
  i = this.polylines.map((v) => {
10306
- let y = "";
10307
- return v.forEach((m, b) => {
10308
- const x = m.x, T = -m.y;
10309
- y += b === 0 ? `M ${x} ${T} ` : `L ${x} ${T} `;
10310
- }), `<path d="${y}" stroke="${n}" stroke-width="${r}" fill="none"/>`;
10306
+ let m = "";
10307
+ return v.forEach((y, b) => {
10308
+ const x = y.x, T = -y.y;
10309
+ m += b === 0 ? `M ${x} ${T} ` : `L ${x} ${T} `;
10310
+ }), `<path d="${m}" stroke="${n}" stroke-width="${r}" fill="none"/>`;
10311
10311
  }).join(""), s = `${f} ${-d} ${c - f} ${d - p}`;
10312
10312
  } else
10313
10313
  s = "0 0 20 20", i = this.polylines.map((o) => {
@@ -10320,8 +10320,8 @@ let mn = class tr {
10320
10320
  return `<svg width="100%" height="100%" viewBox="${s}" preserveAspectRatio="xMidYMid meet">${i}</svg>`;
10321
10321
  }
10322
10322
  };
10323
- const ml = Math.PI / 18, yn = 12;
10324
- let yl = class {
10323
+ const yl = Math.PI / 18, mn = 12;
10324
+ let ml = class {
10325
10325
  constructor(e) {
10326
10326
  this.shapeCache = /* @__PURE__ */ new Map(), this.shapeData = /* @__PURE__ */ new Map(), this.fontData = e;
10327
10327
  }
@@ -10347,12 +10347,12 @@ let yl = class {
10347
10347
  const s = this.fontData.content.data;
10348
10348
  let i;
10349
10349
  if (!this.shapeData.has(e) && s[e]) {
10350
- const o = s[e], u = yn / this.fontData.content.baseUp;
10350
+ const o = s[e], u = mn / this.fontData.content.baseUp;
10351
10351
  i = this.parseShape(o, u), this.shapeData.set(e, i);
10352
10352
  }
10353
10353
  if (this.shapeData.has(e)) {
10354
- const o = r / yn, u = this.shapeData.get(e);
10355
- i = new Mt(
10354
+ const o = r / mn, u = this.shapeData.get(e);
10355
+ i = new Bt(
10356
10356
  (n = u.lastPoint) == null ? void 0 : n.clone().multiply(o),
10357
10357
  u.polylines.map((l) => l.map((h) => h.clone().multiply(o)))
10358
10358
  );
@@ -10367,7 +10367,7 @@ let yl = class {
10367
10367
  */
10368
10368
  parseShape(e, r) {
10369
10369
  const n = {
10370
- currentPoint: new z(),
10370
+ currentPoint: new W(),
10371
10371
  polylines: [],
10372
10372
  currentPolyline: [],
10373
10373
  sp: [],
@@ -10378,7 +10378,7 @@ let yl = class {
10378
10378
  const s = e[a];
10379
10379
  s <= 15 ? a = this.handleSpecialCommand(s, e, a, n) : this.handleVectorCommand(s, n);
10380
10380
  }
10381
- return new Mt(n.currentPoint, n.polylines);
10381
+ return new Bt(n.currentPoint, n.polylines);
10382
10382
  }
10383
10383
  /**
10384
10384
  * Please refer to special codes reference in the following link for more information.
@@ -10453,7 +10453,7 @@ let yl = class {
10453
10453
  * @returns Returns the vector for the given direction code
10454
10454
  */
10455
10455
  getVectorForDirection(e) {
10456
- const r = new z();
10456
+ const r = new W();
10457
10457
  switch (e) {
10458
10458
  case 0:
10459
10459
  r.x = 1;
@@ -10524,13 +10524,13 @@ let yl = class {
10524
10524
  }
10525
10525
  handleXYDisplacement(e, r, n) {
10526
10526
  let a = r;
10527
- const s = new z();
10527
+ const s = new W();
10528
10528
  return s.x = J.byteToSByte(e[++a]), s.y = J.byteToSByte(e[++a]), n.currentPoint.add(s.multiply(n.scale)), n.isPenDown && n.currentPolyline.push(n.currentPoint.clone()), a;
10529
10529
  }
10530
10530
  handleMultipleXYDisplacements(e, r, n) {
10531
10531
  let a = r;
10532
10532
  for (; ; ) {
10533
- const s = new z();
10533
+ const s = new W();
10534
10534
  if (s.x = J.byteToSByte(e[++a]), s.y = J.byteToSByte(e[++a]), s.x === 0 && s.y === 0)
10535
10535
  break;
10536
10536
  n.currentPoint.add(s.multiply(n.scale)), n.isPenDown && n.currentPolyline.push(n.currentPoint.clone());
@@ -10542,7 +10542,7 @@ let yl = class {
10542
10542
  let s = r;
10543
10543
  const i = e[++s] * n.scale, o = J.byteToSByte(e[++s]), u = (o & 112) >> 4;
10544
10544
  let l = o & 7;
10545
- const h = o < 0, f = Math.PI / 4 * u, c = n.currentPoint.clone().subtract(new z(Math.cos(f) * i, Math.sin(f) * i)), p = mn.fromOctant(c, i, u, l, h);
10545
+ const h = o < 0, f = Math.PI / 4 * u, c = n.currentPoint.clone().subtract(new W(Math.cos(f) * i, Math.sin(f) * i)), p = yn.fromOctant(c, i, u, l, h);
10546
10546
  if (n.isPenDown) {
10547
10547
  const d = p.tessellate();
10548
10548
  n.currentPolyline.pop(), n.currentPolyline.push(...d.slice());
@@ -10555,33 +10555,33 @@ let yl = class {
10555
10555
  let c = h & 7;
10556
10556
  c === 0 && (c = 8), i !== 0 && c--;
10557
10557
  const p = Math.PI / 4;
10558
- let d = p * c, v = ml, y = 1;
10559
- h < 0 && (v = -v, d = -d, y = -1);
10560
- let m = p * f, b = m + d;
10561
- m += p * s / 256 * y, b += p * i / 256 * y;
10562
- const x = n.currentPoint.clone().subtract(new z(l * Math.cos(m), l * Math.sin(m)));
10563
- if (n.currentPoint = x.clone().add(new z(l * Math.cos(b), l * Math.sin(b))), n.isPenDown) {
10564
- let T = m;
10558
+ let d = p * c, v = yl, m = 1;
10559
+ h < 0 && (v = -v, d = -d, m = -1);
10560
+ let y = p * f, b = y + d;
10561
+ y += p * s / 256 * m, b += p * i / 256 * m;
10562
+ const x = n.currentPoint.clone().subtract(new W(l * Math.cos(y), l * Math.sin(y)));
10563
+ if (n.currentPoint = x.clone().add(new W(l * Math.cos(b), l * Math.sin(b))), n.isPenDown) {
10564
+ let T = y;
10565
10565
  const S = [];
10566
10566
  if (S.push(
10567
- x.clone().add(new z(l * Math.cos(T), l * Math.sin(T)))
10567
+ x.clone().add(new W(l * Math.cos(T), l * Math.sin(T)))
10568
10568
  ), v > 0)
10569
10569
  for (; T + v < b; )
10570
10570
  T += v, S.push(
10571
- x.clone().add(new z(l * Math.cos(T), l * Math.sin(T)))
10571
+ x.clone().add(new W(l * Math.cos(T), l * Math.sin(T)))
10572
10572
  );
10573
10573
  else
10574
10574
  for (; T + v > b; )
10575
10575
  T += v, S.push(
10576
- x.clone().add(new z(l * Math.cos(T), l * Math.sin(T)))
10576
+ x.clone().add(new W(l * Math.cos(T), l * Math.sin(T)))
10577
10577
  );
10578
- S.push(x.clone().add(new z(l * Math.cos(b), l * Math.sin(b)))), n.currentPolyline.push(...S);
10578
+ S.push(x.clone().add(new W(l * Math.cos(b), l * Math.sin(b)))), n.currentPolyline.push(...S);
10579
10579
  }
10580
10580
  return a;
10581
10581
  }
10582
10582
  handleBulgeArc(e, r, n) {
10583
10583
  let a = r;
10584
- const s = new z();
10584
+ const s = new W();
10585
10585
  s.x = J.byteToSByte(e[++a]), s.y = J.byteToSByte(e[++a]);
10586
10586
  const i = J.byteToSByte(e[++a]);
10587
10587
  return n.currentPoint = this.handleArcSegment(
@@ -10596,7 +10596,7 @@ let yl = class {
10596
10596
  handleMultipleBulgeArcs(e, r, n) {
10597
10597
  let a = r;
10598
10598
  for (; ; ) {
10599
- const s = new z();
10599
+ const s = new W();
10600
10600
  if (s.x = J.byteToSByte(e[++a]), s.y = J.byteToSByte(e[++a]), s.x === 0 && s.y === 0)
10601
10601
  break;
10602
10602
  const i = J.byteToSByte(e[++a]);
@@ -10680,7 +10680,7 @@ let yl = class {
10680
10680
  const o = (s = i.lastPoint) == null ? void 0 : s.clone();
10681
10681
  o && (o.x *= r / n);
10682
10682
  const u = i.polylines.map((l) => l.map((h) => h.clone()));
10683
- return u.forEach((l) => l.forEach((h) => h.x *= r / n)), new Mt(
10683
+ return u.forEach((l) => l.forEach((h) => h.x *= r / n)), new Bt(
10684
10684
  o == null ? void 0 : o.add(a),
10685
10685
  u.map((l) => l.map((h) => h.add(a)))
10686
10686
  );
@@ -10704,7 +10704,7 @@ let yl = class {
10704
10704
  if (n === 0)
10705
10705
  i.push(o.clone().add(r));
10706
10706
  else {
10707
- const u = o.clone().add(r), l = mn.fromBulge(o, u, n / 127).tessellate();
10707
+ const u = o.clone().add(r), l = yn.fromBulge(o, u, n / 127).tessellate();
10708
10708
  i.push(...l.slice(1));
10709
10709
  }
10710
10710
  return o.add(r), o;
@@ -10725,7 +10725,7 @@ class xl {
10725
10725
  };
10726
10726
  } else
10727
10727
  this.fontData = e;
10728
- this.shapeParser = new yl(this.fontData);
10728
+ this.shapeParser = new ml(this.fontData);
10729
10729
  }
10730
10730
  /**
10731
10731
  * Return true if this font contains glyph of the specified character. Otherwise, return false.
@@ -10752,7 +10752,7 @@ class xl {
10752
10752
  this.shapeParser.release();
10753
10753
  }
10754
10754
  }
10755
- class pr extends Tn {
10755
+ class dr extends Tn {
10756
10756
  /**
10757
10757
  * Creates a new instance of ShxTextShape
10758
10758
  * @param char - The character this shape represents
@@ -10766,7 +10766,7 @@ class pr extends Tn {
10766
10766
  return e.maxX - e.minX;
10767
10767
  }
10768
10768
  offset(e) {
10769
- return new pr(
10769
+ return new dr(
10770
10770
  this.char,
10771
10771
  this.fontSize,
10772
10772
  this.shape.offset(e),
@@ -10825,7 +10825,7 @@ class xn extends Fn {
10825
10825
  a += r, this.addUnsupportedChar(i);
10826
10826
  continue;
10827
10827
  }
10828
- n.push(o.offset(new z(a, 0))), a += o.width;
10828
+ n.push(o.offset(new W(a, 0))), a += o.width;
10829
10829
  }
10830
10830
  return n;
10831
10831
  }
@@ -10844,7 +10844,7 @@ class xn extends Fn {
10844
10844
  */
10845
10845
  getCharShape(e, r) {
10846
10846
  const n = this.getCode(e), a = this.font.getCharShape(n, r);
10847
- return a ? new pr(e, r, a, this) : void 0;
10847
+ return a ? new dr(e, r, a, this) : void 0;
10848
10848
  }
10849
10849
  /**
10850
10850
  * For an unsupported char, use "?" as a replacement.
@@ -11099,13 +11099,13 @@ class de {
11099
11099
  const r = En(e);
11100
11100
  if (!r)
11101
11101
  throw new Error(`Invalid font url: ${e}`);
11102
- const n = wr(e).toLowerCase(), a = await ze.instance.get(n);
11102
+ const n = wr(e).toLowerCase(), a = await We.instance.get(n);
11103
11103
  if (a) {
11104
11104
  const s = ke.instance.createFont(a);
11105
11105
  this.fontMap.set(n, s);
11106
11106
  } else {
11107
11107
  const s = await this.loader.loadAsync(e), i = ke.instance.createFontFromBuffer(r, s);
11108
- i && (this.fontMap.set(n, i), this.enableFontCache && await ze.instance.set(n, {
11108
+ i && (this.fontMap.set(n, i), this.enableFontCache && await We.instance.set(n, {
11109
11109
  name: n,
11110
11110
  type: i.type,
11111
11111
  data: i.data
@@ -11121,7 +11121,7 @@ class de {
11121
11121
  async getAllFontsFromCache() {
11122
11122
  if (this.fontMap.size !== 0)
11123
11123
  return;
11124
- const e = await ze.instance.getAll();
11124
+ const e = await We.instance.getAll();
11125
11125
  for (const r of e) {
11126
11126
  const { name: n } = r;
11127
11127
  if (this.fileNames && !this.fileNames.includes(n))
@@ -11227,7 +11227,7 @@ class bl {
11227
11227
  });
11228
11228
  }
11229
11229
  }
11230
- var Be = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.WORD = 1] = "WORD", t[t.STACK = 2] = "STACK", t[t.SPACE = 3] = "SPACE", t[t.NBSP = 4] = "NBSP", t[t.TABULATOR = 5] = "TABULATOR", t[t.NEW_PARAGRAPH = 6] = "NEW_PARAGRAPH", t[t.NEW_COLUMN = 7] = "NEW_COLUMN", t[t.WRAP_AT_DIMLINE = 8] = "WRAP_AT_DIMLINE", t[t.PROPERTIES_CHANGED = 9] = "PROPERTIES_CHANGED", t))(Be || {}), He = /* @__PURE__ */ ((t) => (t[t.BOTTOM = 0] = "BOTTOM", t[t.MIDDLE = 1] = "MIDDLE", t[t.TOP = 2] = "TOP", t))(He || {}), se = /* @__PURE__ */ ((t) => (t[t.DEFAULT = 0] = "DEFAULT", t[t.LEFT = 1] = "LEFT", t[t.RIGHT = 2] = "RIGHT", t[t.CENTER = 3] = "CENTER", t[t.JUSTIFIED = 4] = "JUSTIFIED", t[t.DISTRIBUTED = 5] = "DISTRIBUTED", t))(se || {});
11230
+ var Pe = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.WORD = 1] = "WORD", t[t.STACK = 2] = "STACK", t[t.SPACE = 3] = "SPACE", t[t.NBSP = 4] = "NBSP", t[t.TABULATOR = 5] = "TABULATOR", t[t.NEW_PARAGRAPH = 6] = "NEW_PARAGRAPH", t[t.NEW_COLUMN = 7] = "NEW_COLUMN", t[t.WRAP_AT_DIMLINE = 8] = "WRAP_AT_DIMLINE", t[t.PROPERTIES_CHANGED = 9] = "PROPERTIES_CHANGED", t))(Pe || {}), He = /* @__PURE__ */ ((t) => (t[t.BOTTOM = 0] = "BOTTOM", t[t.MIDDLE = 1] = "MIDDLE", t[t.TOP = 2] = "TOP", t))(He || {}), se = /* @__PURE__ */ ((t) => (t[t.DEFAULT = 0] = "DEFAULT", t[t.LEFT = 1] = "LEFT", t[t.RIGHT = 2] = "RIGHT", t[t.CENTER = 3] = "CENTER", t[t.JUSTIFIED = 4] = "JUSTIFIED", t[t.DISTRIBUTED = 5] = "DISTRIBUTED", t))(se || {});
11231
11231
  const Sl = {
11232
11232
  c: "Ø",
11233
11233
  d: "°",
@@ -11861,15 +11861,15 @@ class wl {
11861
11861
  for (; ; ) {
11862
11862
  const [a, s] = n.call(this);
11863
11863
  if (a) {
11864
- if (yield new Bt(a, this.ctxStack.current.copy(), s), a === 6 && this.resetParagraphParameters) {
11864
+ if (yield new It(a, this.ctxStack.current.copy(), s), a === 6 && this.resetParagraphParameters) {
11865
11865
  const i = this.ctxStack.current, o = r(i);
11866
- this.yieldPropertyCommands && Object.keys(o).length > 0 && (yield new Bt(9, i.copy(), {
11866
+ this.yieldPropertyCommands && Object.keys(o).length > 0 && (yield new It(9, i.copy(), {
11867
11867
  command: void 0,
11868
11868
  changes: { paragraph: o },
11869
11869
  depth: this.ctxStack.depth
11870
11870
  }));
11871
11871
  }
11872
- e && (yield new Bt(e, this.ctxStack.current.copy(), null), e = null);
11872
+ e && (yield new It(e, this.ctxStack.current.copy(), null), e = null);
11873
11873
  } else
11874
11874
  break;
11875
11875
  }
@@ -11975,7 +11975,7 @@ class Pt {
11975
11975
  return e;
11976
11976
  }
11977
11977
  }
11978
- class dr {
11978
+ class gr {
11979
11979
  // Store as 0xRRGGBB or null
11980
11980
  /**
11981
11981
  * Create a new MTextColor instance.
@@ -12051,7 +12051,7 @@ class dr {
12051
12051
  * @returns A new MTextColor instance with the same color state.
12052
12052
  */
12053
12053
  copy() {
12054
- const e = new dr();
12054
+ const e = new gr();
12055
12055
  return e._aci = this._aci, e._rgbValue = this._rgbValue, e;
12056
12056
  }
12057
12057
  /**
@@ -12072,7 +12072,7 @@ class dr {
12072
12072
  }
12073
12073
  class et {
12074
12074
  constructor() {
12075
- this._stroke = 0, this.continueStroke = !1, this.color = new dr(), this.align = 0, this.fontFace = { family: "", style: "Regular", weight: 400 }, this._capHeight = { value: 1, isRelative: !1 }, this._widthFactor = { value: 1, isRelative: !1 }, this._charTrackingFactor = { value: 1, isRelative: !1 }, this.oblique = 0, this.paragraph = {
12075
+ this._stroke = 0, this.continueStroke = !1, this.color = new gr(), this.align = 0, this.fontFace = { family: "", style: "Regular", weight: 400 }, this._capHeight = { value: 1, isRelative: !1 }, this._widthFactor = { value: 1, isRelative: !1 }, this._charTrackingFactor = { value: 1, isRelative: !1 }, this.oblique = 0, this.paragraph = {
12076
12076
  indent: 0,
12077
12077
  left: 0,
12078
12078
  right: 0,
@@ -12246,7 +12246,7 @@ class et {
12246
12246
  return e._stroke = this._stroke, e.continueStroke = this.continueStroke, e.color = this.color.copy(), e.align = this.align, e.fontFace = { ...this.fontFace }, e._capHeight = { ...this._capHeight }, e._widthFactor = { ...this._widthFactor }, e._charTrackingFactor = { ...this._charTrackingFactor }, e.oblique = this.oblique, e.paragraph = { ...this.paragraph }, e;
12247
12247
  }
12248
12248
  }
12249
- class Bt {
12249
+ class It {
12250
12250
  /**
12251
12251
  * Create a new MText token
12252
12252
  * @param type - The token type
@@ -12259,7 +12259,7 @@ class Bt {
12259
12259
  }
12260
12260
  var Ze = /* @__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))(Ze || {}), Cl = /* @__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))(Cl || {});
12261
12261
  const El = /* @__PURE__ */ new R.Vector3(), Ol = 1.666666;
12262
- class gr extends et {
12262
+ class vr extends et {
12263
12263
  /**
12264
12264
  * Creates a new RenderContext instance with optional initial values.
12265
12265
  * @param init - Partial object containing initial values for context properties
@@ -12273,7 +12273,7 @@ class gr extends et {
12273
12273
  * @returns A new RenderContext instance with identical property values
12274
12274
  */
12275
12275
  clone() {
12276
- const e = new gr();
12276
+ const e = new vr();
12277
12277
  return e.continueStroke = this.continueStroke, e.color = this.color.copy(), e.align = this.align, e.fontFace = { ...this.fontFace }, e.capHeight = { ...this.capHeight }, e.widthFactor = { ...this.widthFactor }, e.charTrackingFactor = { ...this.charTrackingFactor }, e.oblique = this.oblique, e.paragraph = { ...this.paragraph }, e.fontScaleFactor = this.fontScaleFactor, e.fontSize = this.fontSize, e.fontSizeScaleFactor = this.fontSizeScaleFactor, e.blankWidth = this.blankWidth, e;
12278
12278
  }
12279
12279
  /**
@@ -12281,7 +12281,7 @@ class gr extends et {
12281
12281
  * @returns The color as a hex number (0xRRGGBB)
12282
12282
  */
12283
12283
  getColorAsHex() {
12284
- return this.color.isRgb && this.color.rgbValue !== null ? this.color.rgbValue : this.color.isAci && this.color.aci !== null ? za(this.color.aci) : 16777215;
12284
+ return this.color.isRgb && this.color.rgbValue !== null ? this.color.rgbValue : this.color.isAci && this.color.aci !== null ? Wa(this.color.aci) : 16777215;
12285
12285
  }
12286
12286
  /**
12287
12287
  * Set the color using a hex value for rendering purposes.
@@ -12301,7 +12301,7 @@ class Ul {
12301
12301
  * @param options Input formating options
12302
12302
  */
12303
12303
  constructor(e, r, n, a) {
12304
- this._contextStack = [], this._maxFontSize = 0, this._currentIndent = 0, this._currentLeftMargin = 0, this._currentRightMargin = 0, this._style = e, this._styleManager = r, this._fontManager = n, this._options = a, this._totalHeight = 0, this._hOffset = 0, this._vOffset = 0, this._lineCount = 1, this._currentLineObjects = [], this._currentContext = new gr({
12304
+ this._contextStack = [], this._maxFontSize = 0, this._currentIndent = 0, this._currentLeftMargin = 0, this._currentRightMargin = 0, this._style = e, this._styleManager = r, this._fontManager = n, this._options = a, this._totalHeight = 0, this._hOffset = 0, this._vOffset = 0, this._lineCount = 1, this._currentLineObjects = [], this._currentContext = new vr({
12305
12305
  fontScaleFactor: this.fontManager.getFontScaleFactor(
12306
12306
  this.textStyle.font.toLowerCase()
12307
12307
  ),
@@ -12538,20 +12538,20 @@ class Ul {
12538
12538
  processText(e) {
12539
12539
  const r = [], n = [], a = new R.Group();
12540
12540
  for (const s of e)
12541
- if (s.type === Be.NEW_PARAGRAPH)
12541
+ if (s.type === Pe.NEW_PARAGRAPH)
12542
12542
  this.startNewParagraph(r, n, a);
12543
- else if (s.type === Be.WORD) {
12543
+ else if (s.type === Pe.WORD) {
12544
12544
  const i = s.data;
12545
12545
  Array.isArray(i) ? i.forEach(
12546
12546
  (o) => this.processWord(o, r, n)
12547
12547
  ) : typeof i == "string" && i.length > 0 && this.processWord(i, r, n);
12548
- } else if (s.type === Be.SPACE)
12548
+ } else if (s.type === Pe.SPACE)
12549
12549
  this.processBlank();
12550
- else if (s.type === Be.PROPERTIES_CHANGED) {
12550
+ else if (s.type === Pe.PROPERTIES_CHANGED) {
12551
12551
  this.processGeometries(r, n, a);
12552
12552
  const i = s.data;
12553
12553
  i.command === void 0 ? this._contextStack.length > 0 && (this._currentContext = this._contextStack.pop()) : (i.depth > 0 && this._contextStack.push(this._currentContext.clone()), this.processFormat(i));
12554
- } else s.type === Be.STACK && (this.processStack(s.data, r, n), this.processGeometries(r, n, a));
12554
+ } else s.type === Pe.STACK && (this.processStack(s.data, r, n), this.processGeometries(r, n, a));
12555
12555
  return (r.length > 0 || n.length > 0) && this.processGeometries(r, n, a), this.processLastLine(), a;
12556
12556
  }
12557
12557
  processGeometries(e, r, n) {
@@ -12574,52 +12574,52 @@ class Ul {
12574
12574
  const [a, s, i] = e, o = this._hOffset, u = this._vOffset, l = this._currentContext.charTrackingFactor.value, h = this._currentContext.fontSize, f = this._currentContext.fontSizeScaleFactor;
12575
12575
  this._hOffset = o, this._currentContext.charTrackingFactor = { value: 1, isRelative: !1 };
12576
12576
  let c = 0;
12577
- for (let m = 0; m < a.length; m++) {
12578
- const b = this.getCharShape(a[m]);
12577
+ for (let y = 0; y < a.length; y++) {
12578
+ const b = this.getCharShape(a[y]);
12579
12579
  b && (c += b.width * this.currentWidthFactor);
12580
12580
  }
12581
12581
  this._hOffset = o;
12582
12582
  let p = 0;
12583
- for (let m = 0; m < s.length; m++) {
12584
- const b = this.getCharShape(s[m]);
12583
+ for (let y = 0; y < s.length; y++) {
12584
+ const b = this.getCharShape(s[y]);
12585
12585
  b && (p += b.width * this.currentWidthFactor);
12586
12586
  }
12587
- const d = Math.max(c, p), v = (d - c) / 2, y = (d - p) / 2;
12587
+ const d = Math.max(c, p), v = (d - c) / 2, m = (d - p) / 2;
12588
12588
  if (i === "^") {
12589
12589
  if (this._currentContext.fontSizeScaleFactor = f * 0.7, this.calcuateLineParams(), a && !s) {
12590
- const m = [], b = [];
12590
+ const y = [], b = [];
12591
12591
  this._hOffset = o, this._vOffset = u + h * 0.1;
12592
12592
  for (let x = 0; x < a.length; x++)
12593
12593
  this.processChar(
12594
12594
  a[x],
12595
- m,
12595
+ y,
12596
12596
  b
12597
12597
  );
12598
- r.push(...m), n.push(...b), this._hOffset = o + c;
12598
+ r.push(...y), n.push(...b), this._hOffset = o + c;
12599
12599
  } else if (!a && s) {
12600
- const m = [], b = [];
12600
+ const y = [], b = [];
12601
12601
  this._hOffset = o, this._vOffset = u - h * 0.6;
12602
12602
  for (let x = 0; x < s.length; x++)
12603
12603
  this.processChar(
12604
12604
  s[x],
12605
- m,
12605
+ y,
12606
12606
  b
12607
12607
  );
12608
- r.push(...m), n.push(...b), this._hOffset = o + p;
12608
+ r.push(...y), n.push(...b), this._hOffset = o + p;
12609
12609
  }
12610
12610
  this._currentContext.fontSizeScaleFactor = f, this.calcuateLineParams();
12611
12611
  } else {
12612
- const m = [], b = [];
12612
+ const y = [], b = [];
12613
12613
  this._hOffset = o + v, this._vOffset = u + this.currentFontSize * 0.3;
12614
12614
  for (let S = 0; S < a.length; S++)
12615
12615
  this.processChar(
12616
12616
  a[S],
12617
- m,
12617
+ y,
12618
12618
  b
12619
12619
  );
12620
- r.push(...m), n.push(...b);
12620
+ r.push(...y), n.push(...b);
12621
12621
  const x = [], T = [];
12622
- this._hOffset = o + y, this._vOffset = u - this.currentFontSize * 0.6;
12622
+ this._hOffset = o + m, this._vOffset = u - this.currentFontSize * 0.6;
12623
12623
  for (let S = 0; S < s.length; S++)
12624
12624
  this.processChar(
12625
12625
  s[S],
@@ -12873,8 +12873,8 @@ class Ul {
12873
12873
  this._currentContext.fontSize = e * this._currentContext.fontScaleFactor * this._currentContext.fontSizeScaleFactor, this.calcuateLineParams();
12874
12874
  }
12875
12875
  }
12876
- const It = /* @__PURE__ */ new R.Vector3(), Oe = /* @__PURE__ */ new R.Vector3(), Dt = /* @__PURE__ */ new R.Vector3(), Gt = /* @__PURE__ */ new R.Quaternion(), Nt = /* @__PURE__ */ new R.Matrix4(), bn = /* @__PURE__ */ new R.Matrix4(), Sn = /* @__PURE__ */ new R.Vector3(1, 0, 0);
12877
- class vr extends R.Object3D {
12876
+ const Dt = /* @__PURE__ */ new R.Vector3(), Oe = /* @__PURE__ */ new R.Vector3(), Gt = /* @__PURE__ */ new R.Vector3(), Nt = /* @__PURE__ */ new R.Quaternion(), _t = /* @__PURE__ */ new R.Matrix4(), bn = /* @__PURE__ */ new R.Matrix4(), Sn = /* @__PURE__ */ new R.Vector3(1, 0, 0);
12877
+ class vt extends R.Object3D {
12878
12878
  /**
12879
12879
  * Extracts all unique font names used in an MText string.
12880
12880
  * This function searches for font commands in the format \f{fontname}| or \f{fontname}; and returns a set of unique font names.
@@ -12919,16 +12919,18 @@ class vr extends R.Object3D {
12919
12919
  }
12920
12920
  /**
12921
12921
  * Draw the MText object. This method loads required fonts on demand and builds the object graph.
12922
- *
12923
- * @param isLoadFontsOnDemand - The flag indicate whether to load required fonts on demand
12924
12922
  */
12925
- async draw(e = !0) {
12926
- if (e) {
12927
- const n = Array.from(vr.getFonts(this._mtextData.text || "", !0));
12928
- n.length > 0 && await this._fontManager.loadFontsByNames(n);
12929
- }
12930
- const r = this.loadMText(this._mtextData, this._style);
12931
- r && (this.getBoxes(r, this._boxes), this._boxes.forEach((n) => this.box.union(n)), this.add(r));
12923
+ async asyncDraw() {
12924
+ const e = Array.from(vt.getFonts(this._mtextData.text || "", !0));
12925
+ e.length > 0 && await this._fontManager.loadFontsByNames(e), this.syncDraw();
12926
+ }
12927
+ /**
12928
+ * Draw the MText object. This method assumes that fonts needed are loaded. If font needed
12929
+ * not found, the default font will be used.
12930
+ */
12931
+ syncDraw() {
12932
+ const e = this.loadMText(this._mtextData, this._style);
12933
+ e && (this.getBoxes(e, this._boxes), this._boxes.forEach((r) => this.box.union(r)), this.add(e));
12932
12934
  }
12933
12935
  /**
12934
12936
  * Gets the style manager instance associated with this MText object.
@@ -12963,11 +12965,11 @@ class vr extends R.Object3D {
12963
12965
  */
12964
12966
  raycast(e, r) {
12965
12967
  this._boxes.forEach((n) => {
12966
- if (e.ray.intersectBox(n, It)) {
12967
- const a = e.ray.origin.distanceTo(It);
12968
+ if (e.ray.intersectBox(n, Dt)) {
12969
+ const a = e.ray.origin.distanceTo(Dt);
12968
12970
  r.push({
12969
12971
  distance: a,
12970
- point: It.clone(),
12972
+ point: Dt.clone(),
12971
12973
  object: this,
12972
12974
  face: null,
12973
12975
  faceIndex: void 0,
@@ -12986,7 +12988,7 @@ class vr extends R.Object3D {
12986
12988
  const { object: n, height: a } = this.createMTextGroup(e, r);
12987
12989
  if (!n)
12988
12990
  return;
12989
- n.matrix.decompose(Oe, Gt, Dt), e.position && (Oe.x += e.position.x, Oe.y += e.position.y, n.matrix.compose(Oe, Gt, Dt));
12991
+ n.matrix.decompose(Oe, Nt, Gt), e.position && (Oe.x += e.position.x, Oe.y += e.position.y, n.matrix.compose(Oe, Nt, Gt));
12990
12992
  const s = e.width, i = this.calculateAnchorPoint(
12991
12993
  s,
12992
12994
  a,
@@ -13001,9 +13003,9 @@ class vr extends R.Object3D {
13001
13003
  const l = e.directionVector, h = new R.Vector3(l.x, l.y, l.z), f = h.clone().cross(Sn), c = Sn.angleTo(h);
13002
13004
  o = f.z > 0 ? -c : c;
13003
13005
  }
13004
- n.matrix.compose(Oe, Gt, Dt);
13006
+ n.matrix.compose(Oe, Nt, Gt);
13005
13007
  const u = e.position ? Oe.clone().sub(e.position) : Oe;
13006
- return Nt.makeTranslation(-u.x, -u.y, 0), bn.makeRotationZ(o), n.matrix.multiply(Nt), n.matrix.multiply(bn), n.matrix.multiply(Nt.invert()), n.matrix.decompose(n.position, n.quaternion, n.scale), n;
13008
+ return _t.makeTranslation(-u.x, -u.y, 0), bn.makeRotationZ(o), n.matrix.multiply(_t), n.matrix.multiply(bn), n.matrix.multiply(_t.invert()), n.matrix.decompose(n.position, n.quaternion, n.scale), n;
13007
13009
  }
13008
13010
  /**
13009
13011
  * Creates a group of text elements from MText data.
@@ -13125,11 +13127,11 @@ class Sa {
13125
13127
  }
13126
13128
  }
13127
13129
  class kn {
13128
- constructor(e = { isLoadFontsOnDemand: !0 }) {
13130
+ constructor(e = {}) {
13129
13131
  this.workers = [], this.inFlightPerWorker = [], this.pendingRequests = /* @__PURE__ */ new Map(), this.requestId = 0, this.readyPromise = null, this.poolSize = e.poolSize ?? Math.max(
13130
13132
  1,
13131
13133
  navigator.hardwareConcurrency ? Math.min(4, navigator.hardwareConcurrency) : 2
13132
- ), this.isLoadFontsOnDemand = !!e.isLoadFontsOnDemand, this.styleManager = new Sa();
13134
+ ), this.styleManager = new Sa();
13133
13135
  const r = e.workerUrl ?? "./mtext-renderer-worker.js";
13134
13136
  this.timeOut = e.timeOut ?? 12e4;
13135
13137
  for (let n = 0; n < this.poolSize; n++) {
@@ -13213,9 +13215,9 @@ class kn {
13213
13215
  }), this.readyPromise);
13214
13216
  }
13215
13217
  /**
13216
- * Render MText in the worker and return serialized data
13218
+ * Render MText in the worker and return serialized data asynchronously.
13217
13219
  */
13218
- async renderMText(e, r, n = {
13220
+ async asyncRenderMText(e, r, n = {
13219
13221
  byLayerColor: 16777215,
13220
13222
  byBlockColor: 16777215
13221
13223
  }) {
@@ -13223,11 +13225,22 @@ class kn {
13223
13225
  const a = await this.sendMessage("render", {
13224
13226
  mtextContent: e,
13225
13227
  textStyle: r,
13226
- colorSettings: n,
13227
- isLoadFontsOnDemand: this.isLoadFontsOnDemand
13228
+ colorSettings: n
13228
13229
  });
13229
13230
  return this.reconstructMText(a);
13230
13231
  }
13232
+ /**
13233
+ * Render MText synchronously.
13234
+ * Notes: It isn't supported yet.
13235
+ */
13236
+ syncRenderMText(e, r, n = {
13237
+ byLayerColor: 16777215,
13238
+ byBlockColor: 16777215
13239
+ }) {
13240
+ throw new Error(
13241
+ "Fuction 'syncRenderMText' isn't supported in 'WebWorkerRenderer'!"
13242
+ );
13243
+ }
13231
13244
  /**
13232
13245
  * Load fonts in the worker
13233
13246
  */
@@ -13359,21 +13372,39 @@ class Ll {
13359
13372
  this.fontManager = de.instance, this.styleManager = new Sa(), this.isInitialized = !1;
13360
13373
  }
13361
13374
  /**
13362
- * Render MText directly in the main thread
13375
+ * Render MText directly in the main thread asynchronously. It will ensure that default font
13376
+ * is loaded. And fonts needed in mtext are loaded on demand.
13363
13377
  */
13364
- async renderMText(e, r, n = {
13378
+ async asyncRenderMText(e, r, n = {
13365
13379
  byLayerColor: 16777215,
13366
13380
  byBlockColor: 16777215
13367
13381
  }) {
13368
13382
  await this.ensureInitialized();
13369
- const a = new vr(
13383
+ const a = new vt(
13384
+ e,
13385
+ r,
13386
+ this.styleManager,
13387
+ this.fontManager,
13388
+ n
13389
+ );
13390
+ return await a.asyncDraw(), a.updateMatrixWorld(!0), a;
13391
+ }
13392
+ /**
13393
+ * Render MText directly in the main thread synchronously. It is user's responsibility to ensure
13394
+ * that default font is loaded and fonts needed in mtext are loaded.
13395
+ */
13396
+ syncRenderMText(e, r, n = {
13397
+ byLayerColor: 16777215,
13398
+ byBlockColor: 16777215
13399
+ }) {
13400
+ const a = new vt(
13370
13401
  e,
13371
13402
  r,
13372
13403
  this.styleManager,
13373
13404
  this.fontManager,
13374
13405
  n
13375
13406
  );
13376
- return await a.draw(), a.updateMatrixWorld(!0), a;
13407
+ return a.syncDraw(), a.updateMatrixWorld(!0), a;
13377
13408
  }
13378
13409
  /**
13379
13410
  * Load fonts in the main thread
@@ -13393,7 +13424,7 @@ class Ll {
13393
13424
  this.isInitialized || (await this.loadFonts([de.instance.defaultFont]), this.isInitialized = !0);
13394
13425
  }
13395
13426
  }
13396
- class Bl {
13427
+ class Pl {
13397
13428
  /**
13398
13429
  * Constructor
13399
13430
  *
@@ -13402,14 +13433,14 @@ class Bl {
13402
13433
  * when render mode is 'worker'.
13403
13434
  */
13404
13435
  constructor(e = "main", r = {}) {
13405
- this.workerManager = null, this.currentMode = e, this.mainThreadRenderer = new Ll(), this.adapter = this.mainThreadRenderer, this.workerConfig = r, e === "worker" && (this.workerManager = new kn(r), this.adapter = this.workerManager);
13436
+ this.webWorkerRenderer = null, this.currentMode = e, this.mainThreadRenderer = new Ll(), this.adapter = this.mainThreadRenderer, this.webWorkerConfig = r, e === "worker" && (this.webWorkerRenderer = new kn(r), this.adapter = this.webWorkerRenderer);
13406
13437
  }
13407
13438
  /**
13408
13439
  * Switch between main thread and worker rendering modes
13409
13440
  * @param mode The rendering mode to switch to
13410
13441
  */
13411
13442
  switchMode(e) {
13412
- this.currentMode !== e && (this.currentMode === "worker" && this.workerManager && (this.workerManager.terminate(), this.workerManager = null), this.currentMode = e, e === "worker" ? (this.workerManager = new kn(this.workerConfig), this.adapter = this.workerManager) : this.adapter = this.mainThreadRenderer);
13443
+ this.currentMode !== e && (this.currentMode = e, e === "worker" ? this.webWorkerRenderer || (this.webWorkerRenderer = new kn(this.webWorkerConfig), this.adapter = this.webWorkerRenderer) : this.adapter = this.mainThreadRenderer);
13413
13444
  }
13414
13445
  /**
13415
13446
  * Get current rendering mode
@@ -13418,13 +13449,26 @@ class Bl {
13418
13449
  return this.currentMode;
13419
13450
  }
13420
13451
  /**
13421
- * Render MText using the current mode
13452
+ * Render MText using the current mode asynchronously
13453
+ */
13454
+ async asyncRenderMText(e, r, n = {
13455
+ byLayerColor: 16777215,
13456
+ byBlockColor: 16777215
13457
+ }) {
13458
+ return this.adapter.asyncRenderMText(e, r, n);
13459
+ }
13460
+ /**
13461
+ * Render MText using the current mode synchronously.
13462
+ *
13463
+ * Notes:
13464
+ * One error will be thrown if calling this function in 'worker' mode because rendering
13465
+ * process is always asynchronous in web worker mode.
13422
13466
  */
13423
- async renderMText(e, r, n = {
13467
+ syncRenderMText(e, r, n = {
13424
13468
  byLayerColor: 16777215,
13425
13469
  byBlockColor: 16777215
13426
13470
  }) {
13427
- return this.adapter.renderMText(e, r, n);
13471
+ return this.adapter.syncRenderMText(e, r, n);
13428
13472
  }
13429
13473
  /**
13430
13474
  * Load fonts using the current mode
@@ -13442,7 +13486,7 @@ class Bl {
13442
13486
  * Clean up resources
13443
13487
  */
13444
13488
  destroy() {
13445
- this.workerManager && (this.workerManager.terminate(), this.workerManager = null), this.mainThreadRenderer.destroy();
13489
+ this.webWorkerRenderer && (this.webWorkerRenderer.terminate(), this.webWorkerRenderer = null), this.mainThreadRenderer.destroy();
13446
13490
  }
13447
13491
  }
13448
13492
  export {
@@ -13452,11 +13496,11 @@ export {
13452
13496
  xr as EventManager,
13453
13497
  ke as FontFactory,
13454
13498
  de as FontManager,
13455
- vr as MText,
13499
+ vt as MText,
13456
13500
  Cl as MTextAttachmentPoint,
13457
13501
  Ze as MTextFlowDirection,
13458
13502
  Ll as MainThreadRenderer,
13459
13503
  Sa as StyleManager,
13460
- Bl as UnifiedRenderer,
13504
+ Pl as UnifiedRenderer,
13461
13505
  kn as WebWorkerRenderer
13462
13506
  };