@mlightcad/mtext-renderer 0.2.5 → 0.3.0

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
@@ -1,6 +1,6 @@
1
1
  import * as R from "three";
2
2
  import { ShapePath as va, ExtrudeGeometry as ga, BufferGeometry as ya, BufferAttribute as ma } from "three";
3
- class fr {
3
+ class pr {
4
4
  constructor() {
5
5
  this.listeners = [];
6
6
  }
@@ -34,7 +34,7 @@ class fr {
34
34
  n.call(null, e, ...r);
35
35
  }
36
36
  }
37
- class vn {
37
+ class gn {
38
38
  constructor() {
39
39
  this.unsupportedChars = {};
40
40
  }
@@ -47,7 +47,7 @@ class vn {
47
47
  this.unsupportedChars[e] || (this.unsupportedChars[e] = 0), this.unsupportedChars[e]++;
48
48
  }
49
49
  }
50
- class gn extends R.Shape {
50
+ class yn extends R.Shape {
51
51
  /**
52
52
  * Creates a new instance of BaseTextShape
53
53
  * @param char - The character this shape represents */
@@ -56,9 +56,9 @@ class gn extends R.Shape {
56
56
  }
57
57
  }
58
58
  const Gt = (t, e) => e.some((r) => t instanceof r);
59
- let pr, dr;
59
+ let dr, vr;
60
60
  function xa() {
61
- return pr || (pr = [
61
+ return dr || (dr = [
62
62
  IDBDatabase,
63
63
  IDBObjectStore,
64
64
  IDBIndex,
@@ -67,13 +67,13 @@ function xa() {
67
67
  ]);
68
68
  }
69
69
  function ba() {
70
- return dr || (dr = [
70
+ return vr || (vr = [
71
71
  IDBCursor.prototype.advance,
72
72
  IDBCursor.prototype.continue,
73
73
  IDBCursor.prototype.continuePrimaryKey
74
74
  ]);
75
75
  }
76
- const Nt = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap();
76
+ const Nt = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap();
77
77
  function Sa(t) {
78
78
  const e = new Promise((r, n) => {
79
79
  const a = () => {
@@ -85,7 +85,7 @@ function Sa(t) {
85
85
  };
86
86
  t.addEventListener("success", s), t.addEventListener("error", i);
87
87
  });
88
- return dt.set(e, t), e;
88
+ return vt.set(e, t), e;
89
89
  }
90
90
  function ka(t) {
91
91
  if (Nt.has(t))
@@ -119,7 +119,7 @@ let _t = {
119
119
  return t instanceof IDBTransaction && (e === "done" || e === "store") ? !0 : e in t;
120
120
  }
121
121
  };
122
- function yn(t) {
122
+ function mn(t) {
123
123
  _t = t(_t);
124
124
  }
125
125
  function Ta(t) {
@@ -135,13 +135,13 @@ function Fa(t) {
135
135
  function Ue(t) {
136
136
  if (t instanceof IDBRequest)
137
137
  return Sa(t);
138
- if (bt.has(t))
139
- return bt.get(t);
138
+ if (St.has(t))
139
+ return St.get(t);
140
140
  const e = Fa(t);
141
- return e !== t && (bt.set(t, e), dt.set(e, t)), e;
141
+ return e !== t && (St.set(t, e), vt.set(e, t)), e;
142
142
  }
143
- const Ht = (t) => dt.get(t);
144
- function wa(t, e, { blocked: r, upgrade: n, blocking: a, terminated: s } = {}) {
143
+ const Ht = (t) => vt.get(t);
144
+ function Ca(t, e, { blocked: r, upgrade: n, blocking: a, terminated: s } = {}) {
145
145
  const i = indexedDB.open(t, e), u = Ue(i);
146
146
  return n && i.addEventListener("upgradeneeded", (o) => {
147
147
  n(Ue(i.result), o.oldVersion, o.newVersion, Ue(i.transaction), o);
@@ -155,16 +155,16 @@ function wa(t, e, { blocked: r, upgrade: n, blocking: a, terminated: s } = {}) {
155
155
  }).catch(() => {
156
156
  }), u;
157
157
  }
158
- const Ca = ["get", "getKey", "getAll", "getAllKeys", "count"], Ea = ["put", "add", "delete", "clear"], St = /* @__PURE__ */ new Map();
159
- function vr(t, e) {
158
+ const wa = ["get", "getKey", "getAll", "getAllKeys", "count"], Ea = ["put", "add", "delete", "clear"], kt = /* @__PURE__ */ new Map();
159
+ function gr(t, e) {
160
160
  if (!(t instanceof IDBDatabase && !(e in t) && typeof e == "string"))
161
161
  return;
162
- if (St.get(e))
163
- return St.get(e);
162
+ if (kt.get(e))
163
+ return kt.get(e);
164
164
  const r = e.replace(/FromIndex$/, ""), n = e !== r, a = Ea.includes(r);
165
165
  if (
166
166
  // Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
167
- !(r in (n ? IDBIndex : IDBObjectStore).prototype) || !(a || Ca.includes(r))
167
+ !(r in (n ? IDBIndex : IDBObjectStore).prototype) || !(a || wa.includes(r))
168
168
  )
169
169
  return;
170
170
  const s = async function(i, ...u) {
@@ -175,20 +175,20 @@ function vr(t, e) {
175
175
  a && o.done
176
176
  ]))[0];
177
177
  };
178
- return St.set(e, s), s;
178
+ return kt.set(e, s), s;
179
179
  }
180
- yn((t) => ({
180
+ mn((t) => ({
181
181
  ...t,
182
- get: (e, r, n) => vr(e, r) || t.get(e, r, n),
183
- has: (e, r) => !!vr(e, r) || t.has(e, r)
182
+ get: (e, r, n) => gr(e, r) || t.get(e, r, n),
183
+ has: (e, r) => !!gr(e, r) || t.has(e, r)
184
184
  }));
185
- const Oa = ["continue", "continuePrimaryKey", "advance"], gr = {}, zt = /* @__PURE__ */ new WeakMap(), mn = /* @__PURE__ */ new WeakMap(), Ua = {
185
+ const Oa = ["continue", "continuePrimaryKey", "advance"], yr = {}, zt = /* @__PURE__ */ new WeakMap(), xn = /* @__PURE__ */ new WeakMap(), Ua = {
186
186
  get(t, e) {
187
187
  if (!Oa.includes(e))
188
188
  return t[e];
189
- let r = gr[e];
190
- return r || (r = gr[e] = function(...n) {
191
- zt.set(this, mn.get(this)[e](...n));
189
+ let r = yr[e];
190
+ return r || (r = yr[e] = function(...n) {
191
+ zt.set(this, xn.get(this)[e](...n));
192
192
  }), r;
193
193
  }
194
194
  };
@@ -198,24 +198,24 @@ async function* La(...t) {
198
198
  return;
199
199
  e = e;
200
200
  const r = new Proxy(e, Ua);
201
- for (mn.set(r, e), dt.set(r, Ht(e)); e; )
201
+ for (xn.set(r, e), vt.set(r, Ht(e)); e; )
202
202
  yield r, e = await (zt.get(r) || e.continue()), zt.delete(r);
203
203
  }
204
- function yr(t, e) {
204
+ function mr(t, e) {
205
205
  return e === Symbol.asyncIterator && Gt(t, [IDBIndex, IDBObjectStore, IDBCursor]) || e === "iterate" && Gt(t, [IDBIndex, IDBObjectStore]);
206
206
  }
207
- yn((t) => ({
207
+ mn((t) => ({
208
208
  ...t,
209
209
  get(e, r, n) {
210
- return yr(e, r) ? La : t.get(e, r, n);
210
+ return mr(e, r) ? La : t.get(e, r, n);
211
211
  },
212
212
  has(e, r) {
213
- return yr(e, r) || t.has(e, r);
213
+ return mr(e, r) || t.has(e, r);
214
214
  }
215
215
  }));
216
216
  const Ae = {
217
217
  fonts: "fonts"
218
- }, kt = [
218
+ }, Tt = [
219
219
  {
220
220
  version: 1,
221
221
  stores: [
@@ -305,7 +305,7 @@ const Ae = {
305
305
  async getDatabase() {
306
306
  if (this.isClosing)
307
307
  throw new Error("Cannot perform operation while database is closing");
308
- return this.db ? this.db : (this.db = await wa(
308
+ return this.db ? this.db : (this.db = await Ca(
309
309
  J.DATABASE_NAME,
310
310
  J.DATABASE_VERSION,
311
311
  {
@@ -326,7 +326,7 @@ const Ae = {
326
326
  * @param newVersion The new version of the database
327
327
  */
328
328
  handleUpgrade(e, r, n) {
329
- const a = kt.filter(
329
+ const a = Tt.filter(
330
330
  (s) => s.version > r && (!n || s.version <= n)
331
331
  );
332
332
  for (const s of a)
@@ -342,10 +342,10 @@ const Ae = {
342
342
  e.objectStoreNames.contains(n.name) || e.createObjectStore(n.name, { keyPath: n.keyPath });
343
343
  }
344
344
  };
345
- J.DATABASE_NAME = "mlightcad", J.DATABASE_VERSION = kt[kt.length - 1].version;
345
+ J.DATABASE_NAME = "mlightcad", J.DATABASE_VERSION = Tt[Tt.length - 1].version;
346
346
  let He = J;
347
- const Ra = (t) => t.substring(t.lastIndexOf(".") + 1), xn = (t) => t.split("/").pop(), mr = (t) => {
348
- const e = xn(t);
347
+ const Ra = (t) => t.substring(t.lastIndexOf(".") + 1), bn = (t) => t.split("/").pop(), xr = (t) => {
348
+ const e = bn(t);
349
349
  if (e) {
350
350
  const r = e.lastIndexOf(".");
351
351
  return r === -1 ? e : e.substring(0, r);
@@ -630,13 +630,13 @@ function Ba(t, e, r) {
630
630
  `)
631
631
  u = 0, o -= s;
632
632
  else {
633
- const p = Ia(c, a, u, o, r);
633
+ const p = Pa(c, a, u, o, r);
634
634
  u += p.offsetX, i.push(p.path);
635
635
  }
636
636
  }
637
637
  return i;
638
638
  }
639
- function Ia(t, e, r, n, a) {
639
+ function Pa(t, e, r, n, a) {
640
640
  const s = a.glyphs[t] || a.glyphs["?"];
641
641
  if (!s) {
642
642
  console.error('THREE.Font: character "' + t + '" does not exists in font family ' + a.familyName + ".");
@@ -664,7 +664,7 @@ function Ia(t, e, r, n, a) {
664
664
  }
665
665
  return { offsetX: s.ha * e, path: i };
666
666
  }
667
- class Pa extends ga {
667
+ class Ia extends ga {
668
668
  constructor(e, r = {}) {
669
669
  const n = r.font;
670
670
  if (n === void 0)
@@ -676,7 +676,7 @@ class Pa extends ga {
676
676
  this.type = "TextGeometry";
677
677
  }
678
678
  }
679
- class xr extends gn {
679
+ class br extends yn {
680
680
  constructor(e, r, n) {
681
681
  super(e), this.isFound = !1, this.fontSize = r, this.font = n, this.width = this.getCharWidth(e, r, n);
682
682
  }
@@ -686,7 +686,7 @@ class xr extends gn {
686
686
  * @returns A THREE.js BufferGeometry representing the text shape
687
687
  */
688
688
  toGeometry() {
689
- return new Pa(this.char, {
689
+ return new Ia(this.char, {
690
690
  font: this.font.font,
691
691
  depth: 0,
692
692
  size: this.fontSize,
@@ -734,14 +734,14 @@ String.prototype.codePointAt || function() {
734
734
  writable: !0
735
735
  }) : String.prototype.codePointAt = e;
736
736
  }();
737
- var Jt = 0, bn = -3;
738
- function We() {
737
+ var Jt = 0, Sn = -3;
738
+ function Ve() {
739
739
  this.table = new Uint16Array(16), this.trans = new Uint16Array(288);
740
740
  }
741
741
  function Ga(t, e) {
742
- this.source = t, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = e, this.destLen = 0, this.ltree = new We(), this.dtree = new We();
742
+ 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();
743
743
  }
744
- var Sn = new We(), kn = new We(), $t = new Uint8Array(30), er = new Uint16Array(30), Tn = new Uint8Array(30), Fn = new Uint16Array(30), Na = new Uint8Array([
744
+ var kn = new Ve(), Tn = new Ve(), $t = new Uint8Array(30), er = new Uint16Array(30), Fn = new Uint8Array(30), Cn = new Uint16Array(30), Na = new Uint8Array([
745
745
  16,
746
746
  17,
747
747
  18,
@@ -761,7 +761,7 @@ var Sn = new We(), kn = new We(), $t = new Uint8Array(30), er = new Uint16Array(
761
761
  14,
762
762
  1,
763
763
  15
764
- ]), br = new We(), ce = new Uint8Array(320);
764
+ ]), Sr = new Ve(), he = new Uint8Array(320);
765
765
  function wn(t, e, r, n) {
766
766
  var a, s;
767
767
  for (a = 0; a < r; ++a)
@@ -788,24 +788,24 @@ function _a(t, e) {
788
788
  for (e.table[5] = 32, r = 0; r < 32; ++r)
789
789
  e.trans[r] = r;
790
790
  }
791
- var Sr = new Uint16Array(16);
792
- function Tt(t, e, r, n) {
791
+ var kr = new Uint16Array(16);
792
+ function Ft(t, e, r, n) {
793
793
  var a, s;
794
794
  for (a = 0; a < 16; ++a)
795
795
  t.table[a] = 0;
796
796
  for (a = 0; a < n; ++a)
797
797
  t.table[e[r + a]]++;
798
798
  for (t.table[0] = 0, s = 0, a = 0; a < 16; ++a)
799
- Sr[a] = s, s += t.table[a];
799
+ kr[a] = s, s += t.table[a];
800
800
  for (a = 0; a < n; ++a)
801
- e[r + a] && (t.trans[Sr[e[r + a]]++] = a);
801
+ e[r + a] && (t.trans[kr[e[r + a]]++] = a);
802
802
  }
803
803
  function Ha(t) {
804
804
  t.bitcount-- || (t.tag = t.source[t.sourceIndex++], t.bitcount = 7);
805
805
  var e = t.tag & 1;
806
806
  return t.tag >>>= 1, e;
807
807
  }
808
- function he(t, e, r) {
808
+ function fe(t, e, r) {
809
809
  if (!e)
810
810
  return r;
811
811
  for (; t.bitcount < 24; )
@@ -824,36 +824,36 @@ function Wt(t, e) {
824
824
  }
825
825
  function za(t, e, r) {
826
826
  var n, a, s, i, u, o;
827
- for (n = he(t, 5, 257), a = he(t, 5, 1), s = he(t, 4, 4), i = 0; i < 19; ++i)
828
- ce[i] = 0;
827
+ for (n = fe(t, 5, 257), a = fe(t, 5, 1), s = fe(t, 4, 4), i = 0; i < 19; ++i)
828
+ he[i] = 0;
829
829
  for (i = 0; i < s; ++i) {
830
- var l = he(t, 3, 0);
831
- ce[Na[i]] = l;
830
+ var l = fe(t, 3, 0);
831
+ he[Na[i]] = l;
832
832
  }
833
- for (Tt(br, ce, 0, 19), u = 0; u < n + a; ) {
834
- var c = Wt(t, br);
833
+ for (Ft(Sr, he, 0, 19), u = 0; u < n + a; ) {
834
+ var c = Wt(t, Sr);
835
835
  switch (c) {
836
836
  case 16:
837
- var p = ce[u - 1];
838
- for (o = he(t, 2, 3); o; --o)
839
- ce[u++] = p;
837
+ var p = he[u - 1];
838
+ for (o = fe(t, 2, 3); o; --o)
839
+ he[u++] = p;
840
840
  break;
841
841
  case 17:
842
- for (o = he(t, 3, 3); o; --o)
843
- ce[u++] = 0;
842
+ for (o = fe(t, 3, 3); o; --o)
843
+ he[u++] = 0;
844
844
  break;
845
845
  case 18:
846
- for (o = he(t, 7, 11); o; --o)
847
- ce[u++] = 0;
846
+ for (o = fe(t, 7, 11); o; --o)
847
+ he[u++] = 0;
848
848
  break;
849
849
  default:
850
- ce[u++] = c;
850
+ he[u++] = c;
851
851
  break;
852
852
  }
853
853
  }
854
- Tt(e, ce, 0, n), Tt(r, ce, n, a);
854
+ Ft(e, he, 0, n), Ft(r, he, n, a);
855
855
  }
856
- function kr(t, e, r) {
856
+ function Tr(t, e, r) {
857
857
  for (; ; ) {
858
858
  var n = Wt(t, e);
859
859
  if (n === 256)
@@ -862,7 +862,7 @@ function kr(t, e, r) {
862
862
  t.dest[t.destLen++] = n;
863
863
  else {
864
864
  var a, s, i, u;
865
- for (n -= 257, a = he(t, $t[n], er[n]), s = Wt(t, r), i = t.destLen - he(t, Tn[s], Fn[s]), u = i; u < i + a; ++u)
865
+ for (n -= 257, a = fe(t, $t[n], er[n]), s = Wt(t, r), i = t.destLen - fe(t, Fn[s], Cn[s]), u = i; u < i + a; ++u)
866
866
  t.dest[t.destLen++] = t.dest[u];
867
867
  }
868
868
  }
@@ -871,7 +871,7 @@ function Wa(t) {
871
871
  for (var e, r, n; t.bitcount > 8; )
872
872
  t.sourceIndex--, t.bitcount -= 8;
873
873
  if (e = t.source[t.sourceIndex + 1], e = 256 * e + t.source[t.sourceIndex], r = t.source[t.sourceIndex + 3], r = 256 * r + t.source[t.sourceIndex + 2], e !== (~r & 65535))
874
- return bn;
874
+ return Sn;
875
875
  for (t.sourceIndex += 4, n = e; n; --n)
876
876
  t.dest[t.destLen++] = t.source[t.sourceIndex++];
877
877
  return t.bitcount = 0, Jt;
@@ -879,27 +879,27 @@ function Wa(t) {
879
879
  function Va(t, e) {
880
880
  var r = new Ga(t, e), n, a, s;
881
881
  do {
882
- switch (n = Ha(r), a = he(r, 2, 0), a) {
882
+ switch (n = Ha(r), a = fe(r, 2, 0), a) {
883
883
  case 0:
884
884
  s = Wa(r);
885
885
  break;
886
886
  case 1:
887
- s = kr(r, Sn, kn);
887
+ s = Tr(r, kn, Tn);
888
888
  break;
889
889
  case 2:
890
- za(r, r.ltree, r.dtree), s = kr(r, r.ltree, r.dtree);
890
+ za(r, r.ltree, r.dtree), s = Tr(r, r.ltree, r.dtree);
891
891
  break;
892
892
  default:
893
- s = bn;
893
+ s = Sn;
894
894
  }
895
895
  if (s !== Jt)
896
896
  throw new Error("Data error");
897
897
  } while (!n);
898
898
  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;
899
899
  }
900
- _a(Sn, kn);
900
+ _a(kn, Tn);
901
901
  wn($t, er, 4, 3);
902
- wn(Tn, Fn, 2, 1);
902
+ wn(Fn, Cn, 2, 1);
903
903
  $t[28] = 0;
904
904
  er[28] = 258;
905
905
  var qa = Va;
@@ -1057,14 +1057,14 @@ _.prototype.toDOMElement = function(t) {
1057
1057
  var e = this.toPathData(t), r = document.createElementNS("http://www.w3.org/2000/svg", "path");
1058
1058
  return r.setAttribute("d", e), r;
1059
1059
  };
1060
- function Cn(t) {
1060
+ function En(t) {
1061
1061
  throw new Error(t);
1062
1062
  }
1063
- function Tr(t, e) {
1064
- t || Cn(e);
1063
+ function Fr(t, e) {
1064
+ t || En(e);
1065
1065
  }
1066
- var E = { fail: Cn, argument: Tr, assert: Tr }, Fr = 32768, wr = 2147483648, Ie = {}, b = {}, U = {};
1067
- function ue(t) {
1066
+ var E = { fail: En, argument: Fr, assert: Fr }, Cr = 32768, wr = 2147483648, Pe = {}, b = {}, U = {};
1067
+ function le(t) {
1068
1068
  return function() {
1069
1069
  return t;
1070
1070
  };
@@ -1072,11 +1072,11 @@ function ue(t) {
1072
1072
  b.BYTE = function(t) {
1073
1073
  return E.argument(t >= 0 && t <= 255, "Byte value should be between 0 and 255."), [t];
1074
1074
  };
1075
- U.BYTE = ue(1);
1075
+ U.BYTE = le(1);
1076
1076
  b.CHAR = function(t) {
1077
1077
  return [t.charCodeAt(0)];
1078
1078
  };
1079
- U.CHAR = ue(1);
1079
+ U.CHAR = le(1);
1080
1080
  b.CHARARRAY = function(t) {
1081
1081
  typeof t > "u" && (t = "", console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));
1082
1082
  for (var e = [], r = 0; r < t.length; r += 1)
@@ -1089,23 +1089,23 @@ U.CHARARRAY = function(t) {
1089
1089
  b.USHORT = function(t) {
1090
1090
  return [t >> 8 & 255, t & 255];
1091
1091
  };
1092
- U.USHORT = ue(2);
1092
+ U.USHORT = le(2);
1093
1093
  b.SHORT = function(t) {
1094
- return t >= Fr && (t = -(2 * Fr - t)), [t >> 8 & 255, t & 255];
1094
+ return t >= Cr && (t = -(2 * Cr - t)), [t >> 8 & 255, t & 255];
1095
1095
  };
1096
- U.SHORT = ue(2);
1096
+ U.SHORT = le(2);
1097
1097
  b.UINT24 = function(t) {
1098
1098
  return [t >> 16 & 255, t >> 8 & 255, t & 255];
1099
1099
  };
1100
- U.UINT24 = ue(3);
1100
+ U.UINT24 = le(3);
1101
1101
  b.ULONG = function(t) {
1102
1102
  return [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
1103
1103
  };
1104
- U.ULONG = ue(4);
1104
+ U.ULONG = le(4);
1105
1105
  b.LONG = function(t) {
1106
1106
  return t >= wr && (t = -(2 * wr - t)), [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
1107
1107
  };
1108
- U.LONG = ue(4);
1108
+ U.LONG = le(4);
1109
1109
  b.FIXED = b.ULONG;
1110
1110
  U.FIXED = U.ULONG;
1111
1111
  b.FWORD = b.SHORT;
@@ -1115,7 +1115,7 @@ U.UFWORD = U.USHORT;
1115
1115
  b.LONGDATETIME = function(t) {
1116
1116
  return [0, 0, 0, 0, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
1117
1117
  };
1118
- U.LONGDATETIME = ue(8);
1118
+ U.LONGDATETIME = le(8);
1119
1119
  b.TAG = function(t) {
1120
1120
  return E.argument(t.length === 4, "Tag should be exactly 4 ASCII characters."), [
1121
1121
  t.charCodeAt(0),
@@ -1124,7 +1124,7 @@ b.TAG = function(t) {
1124
1124
  t.charCodeAt(3)
1125
1125
  ];
1126
1126
  };
1127
- U.TAG = ue(4);
1127
+ U.TAG = le(4);
1128
1128
  b.Card8 = b.BYTE;
1129
1129
  U.Card8 = U.BYTE;
1130
1130
  b.Card16 = b.USHORT;
@@ -1142,11 +1142,11 @@ U.NUMBER = function(t) {
1142
1142
  b.NUMBER16 = function(t) {
1143
1143
  return [28, t >> 8 & 255, t & 255];
1144
1144
  };
1145
- U.NUMBER16 = ue(3);
1145
+ U.NUMBER16 = le(3);
1146
1146
  b.NUMBER32 = function(t) {
1147
1147
  return [29, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
1148
1148
  };
1149
- U.NUMBER32 = ue(5);
1149
+ U.NUMBER32 = le(5);
1150
1150
  b.REAL = function(t) {
1151
1151
  var e = t.toString(), r = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);
1152
1152
  if (r) {
@@ -1169,12 +1169,12 @@ b.NAME = b.CHARARRAY;
1169
1169
  U.NAME = U.CHARARRAY;
1170
1170
  b.STRING = b.CHARARRAY;
1171
1171
  U.STRING = U.CHARARRAY;
1172
- Ie.UTF8 = function(t, e, r) {
1172
+ Pe.UTF8 = function(t, e, r) {
1173
1173
  for (var n = [], a = r, s = 0; s < a; s++, e += 1)
1174
1174
  n[s] = t.getUint8(e);
1175
1175
  return String.fromCharCode.apply(null, n);
1176
1176
  };
1177
- Ie.UTF16 = function(t, e, r) {
1177
+ Pe.UTF16 = function(t, e, r) {
1178
1178
  for (var n = [], a = r / 2, s = 0; s < a; s++, e += 2)
1179
1179
  n[s] = t.getUint16(e);
1180
1180
  return String.fromCharCode.apply(null, n);
@@ -1231,7 +1231,7 @@ var Vt = {
1231
1231
  "ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"
1232
1232
  )
1233
1233
  };
1234
- Ie.MACSTRING = function(t, e, r, n) {
1234
+ Pe.MACSTRING = function(t, e, r, n) {
1235
1235
  var a = Vt[n];
1236
1236
  if (a !== void 0) {
1237
1237
  for (var s = "", i = 0; i < r; i++) {
@@ -1241,16 +1241,16 @@ Ie.MACSTRING = function(t, e, r, n) {
1241
1241
  return s;
1242
1242
  }
1243
1243
  };
1244
- var tt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), rt, Xa = function(t) {
1245
- if (!rt) {
1246
- rt = {};
1244
+ var rt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), nt, Xa = function(t) {
1245
+ if (!nt) {
1246
+ nt = {};
1247
1247
  for (var e in Vt)
1248
- rt[e] = new String(e);
1248
+ nt[e] = new String(e);
1249
1249
  }
1250
- var r = rt[t];
1250
+ var r = nt[t];
1251
1251
  if (r !== void 0) {
1252
- if (tt) {
1253
- var n = tt.get(r);
1252
+ if (rt) {
1253
+ var n = rt.get(r);
1254
1254
  if (n !== void 0)
1255
1255
  return n;
1256
1256
  }
@@ -1258,7 +1258,7 @@ var tt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), rt, Xa =
1258
1258
  if (a !== void 0) {
1259
1259
  for (var s = {}, i = 0; i < a.length; i++)
1260
1260
  s[a.charCodeAt(i)] = i + 128;
1261
- return tt && tt.set(r, s), s;
1261
+ return rt && rt.set(r, s), s;
1262
1262
  }
1263
1263
  }
1264
1264
  };
@@ -1372,10 +1372,10 @@ b.OPERAND = function(t, e) {
1372
1372
  };
1373
1373
  b.OP = b.BYTE;
1374
1374
  U.OP = U.BYTE;
1375
- var nt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap();
1375
+ var at = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap();
1376
1376
  b.CHARSTRING = function(t) {
1377
- if (nt) {
1378
- var e = nt.get(t);
1377
+ if (at) {
1378
+ var e = at.get(t);
1379
1379
  if (e !== void 0)
1380
1380
  return e;
1381
1381
  }
@@ -1383,7 +1383,7 @@ b.CHARSTRING = function(t) {
1383
1383
  var s = t[a];
1384
1384
  r = r.concat(b[s.type](s.value));
1385
1385
  }
1386
- return nt && nt.set(t, r), r;
1386
+ return at && at.set(t, r), r;
1387
1387
  };
1388
1388
  U.CHARSTRING = function(t) {
1389
1389
  return b.CHARSTRING(t).length;
@@ -1446,7 +1446,7 @@ W.prototype.encode = function() {
1446
1446
  W.prototype.sizeOf = function() {
1447
1447
  return U.TABLE(this);
1448
1448
  };
1449
- function Ve(t, e, r) {
1449
+ function qe(t, e, r) {
1450
1450
  r === void 0 && (r = e.length);
1451
1451
  var n = new Array(e.length + 1);
1452
1452
  n[0] = { name: t + "Count", type: "USHORT", value: r };
@@ -1461,22 +1461,22 @@ function Xt(t, e, r) {
1461
1461
  a[s + 1] = { name: t + s, type: "TABLE", value: r(e[s], s) };
1462
1462
  return a;
1463
1463
  }
1464
- function qe(t, e, r) {
1464
+ function Xe(t, e, r) {
1465
1465
  var n = e.length, a = [];
1466
1466
  a[0] = { name: t + "Count", type: "USHORT", value: n };
1467
1467
  for (var s = 0; s < n; s++)
1468
1468
  a = a.concat(r(e[s], s));
1469
1469
  return a;
1470
1470
  }
1471
- function ut(t) {
1471
+ function lt(t) {
1472
1472
  t.format === 1 ? W.call(
1473
1473
  this,
1474
1474
  "coverageTable",
1475
- [{ name: "coverageFormat", type: "USHORT", value: 1 }].concat(Ve("glyph", t.glyphs))
1475
+ [{ name: "coverageFormat", type: "USHORT", value: 1 }].concat(qe("glyph", t.glyphs))
1476
1476
  ) : t.format === 2 ? W.call(
1477
1477
  this,
1478
1478
  "coverageTable",
1479
- [{ name: "coverageFormat", type: "USHORT", value: 2 }].concat(qe("rangeRecord", t.ranges, function(e) {
1479
+ [{ name: "coverageFormat", type: "USHORT", value: 2 }].concat(Xe("rangeRecord", t.ranges, function(e) {
1480
1480
  return [
1481
1481
  { name: "startGlyphID", type: "USHORT", value: e.start },
1482
1482
  { name: "endGlyphID", type: "USHORT", value: e.end },
@@ -1485,13 +1485,13 @@ function ut(t) {
1485
1485
  }))
1486
1486
  ) : E.assert(!1, "Coverage format must be 1 or 2.");
1487
1487
  }
1488
- ut.prototype = Object.create(W.prototype);
1489
- ut.prototype.constructor = ut;
1490
- function lt(t) {
1488
+ lt.prototype = Object.create(W.prototype);
1489
+ lt.prototype.constructor = lt;
1490
+ function ct(t) {
1491
1491
  W.call(
1492
1492
  this,
1493
1493
  "scriptListTable",
1494
- qe("scriptRecord", t, function(e, r) {
1494
+ Xe("scriptRecord", t, function(e, r) {
1495
1495
  var n = e.script, a = n.defaultLangSys;
1496
1496
  return E.assert(!!a, "Unable to write GSUB: script " + e.tag + " has no default language system."), [
1497
1497
  { name: "scriptTag" + r, type: "TAG", value: e.tag },
@@ -1499,41 +1499,41 @@ function lt(t) {
1499
1499
  { name: "defaultLangSys", type: "TABLE", value: new W("defaultLangSys", [
1500
1500
  { name: "lookupOrder", type: "USHORT", value: 0 },
1501
1501
  { name: "reqFeatureIndex", type: "USHORT", value: a.reqFeatureIndex }
1502
- ].concat(Ve("featureIndex", a.featureIndexes))) }
1503
- ].concat(qe("langSys", n.langSysRecords, function(s, i) {
1502
+ ].concat(qe("featureIndex", a.featureIndexes))) }
1503
+ ].concat(Xe("langSys", n.langSysRecords, function(s, i) {
1504
1504
  var u = s.langSys;
1505
1505
  return [
1506
1506
  { name: "langSysTag" + i, type: "TAG", value: s.tag },
1507
1507
  { name: "langSys" + i, type: "TABLE", value: new W("langSys", [
1508
1508
  { name: "lookupOrder", type: "USHORT", value: 0 },
1509
1509
  { name: "reqFeatureIndex", type: "USHORT", value: u.reqFeatureIndex }
1510
- ].concat(Ve("featureIndex", u.featureIndexes))) }
1510
+ ].concat(qe("featureIndex", u.featureIndexes))) }
1511
1511
  ];
1512
1512
  }))) }
1513
1513
  ];
1514
1514
  })
1515
1515
  );
1516
1516
  }
1517
- lt.prototype = Object.create(W.prototype);
1518
- lt.prototype.constructor = lt;
1519
- function ct(t) {
1517
+ ct.prototype = Object.create(W.prototype);
1518
+ ct.prototype.constructor = ct;
1519
+ function ht(t) {
1520
1520
  W.call(
1521
1521
  this,
1522
1522
  "featureListTable",
1523
- qe("featureRecord", t, function(e, r) {
1523
+ Xe("featureRecord", t, function(e, r) {
1524
1524
  var n = e.feature;
1525
1525
  return [
1526
1526
  { name: "featureTag" + r, type: "TAG", value: e.tag },
1527
1527
  { name: "feature" + r, type: "TABLE", value: new W("featureTable", [
1528
1528
  { name: "featureParams", type: "USHORT", value: n.featureParams }
1529
- ].concat(Ve("lookupListIndex", n.lookupListIndexes))) }
1529
+ ].concat(qe("lookupListIndex", n.lookupListIndexes))) }
1530
1530
  ];
1531
1531
  })
1532
1532
  );
1533
1533
  }
1534
- ct.prototype = Object.create(W.prototype);
1535
- ct.prototype.constructor = ct;
1536
- function ht(t, e) {
1534
+ ht.prototype = Object.create(W.prototype);
1535
+ ht.prototype.constructor = ht;
1536
+ function ft(t, e) {
1537
1537
  W.call(this, "lookupListTable", Xt("lookup", t, function(r) {
1538
1538
  var n = e[r.lookupType];
1539
1539
  return E.assert(!!n, "Unable to write GSUB lookup type " + r.lookupType + " tables."), new W("lookupTable", [
@@ -1542,23 +1542,23 @@ function ht(t, e) {
1542
1542
  ].concat(Xt("subtable", r.subtables, n)));
1543
1543
  }));
1544
1544
  }
1545
- ht.prototype = Object.create(W.prototype);
1546
- ht.prototype.constructor = ht;
1545
+ ft.prototype = Object.create(W.prototype);
1546
+ ft.prototype.constructor = ft;
1547
1547
  var k = {
1548
1548
  Table: W,
1549
1549
  Record: W,
1550
- Coverage: ut,
1551
- ScriptList: lt,
1552
- FeatureList: ct,
1553
- LookupList: ht,
1554
- ushortList: Ve,
1550
+ Coverage: lt,
1551
+ ScriptList: ct,
1552
+ FeatureList: ht,
1553
+ LookupList: ft,
1554
+ ushortList: qe,
1555
1555
  tableList: Xt,
1556
- recordList: qe
1556
+ recordList: Xe
1557
1557
  };
1558
- function Cr(t, e) {
1558
+ function Er(t, e) {
1559
1559
  return t.getUint8(e);
1560
1560
  }
1561
- function ft(t, e) {
1561
+ function pt(t, e) {
1562
1562
  return t.getUint16(e, !1);
1563
1563
  }
1564
1564
  function Ka(t, e) {
@@ -1567,7 +1567,7 @@ function Ka(t, e) {
1567
1567
  function tr(t, e) {
1568
1568
  return t.getUint32(e, !1);
1569
1569
  }
1570
- function En(t, e) {
1570
+ function On(t, e) {
1571
1571
  var r = t.getInt16(e, !1), n = t.getUint16(e + 2, !1);
1572
1572
  return r + n / 65535;
1573
1573
  }
@@ -1633,7 +1633,7 @@ v.prototype.parseULong = function() {
1633
1633
  };
1634
1634
  v.prototype.parseOffset32 = v.prototype.parseULong;
1635
1635
  v.prototype.parseFixed = function() {
1636
- var t = En(this.data, this.offset + this.relativeOffset);
1636
+ var t = On(this.data, this.offset + this.relativeOffset);
1637
1637
  return this.relativeOffset += 4, t;
1638
1638
  };
1639
1639
  v.prototype.parseString = function(t) {
@@ -1651,7 +1651,7 @@ v.prototype.parseLongDateTime = function() {
1651
1651
  return t -= 2082844800, this.relativeOffset += 8, t;
1652
1652
  };
1653
1653
  v.prototype.parseVersion = function(t) {
1654
- var e = ft(this.data, this.offset + this.relativeOffset), r = ft(this.data, this.offset + this.relativeOffset + 2);
1654
+ var e = pt(this.data, this.offset + this.relativeOffset), r = pt(this.data, this.offset + this.relativeOffset + 2);
1655
1655
  return this.relativeOffset += 4, t === void 0 && (t = 4096), e + r / t / 10;
1656
1656
  };
1657
1657
  v.prototype.skip = function(t, e) {
@@ -1838,7 +1838,7 @@ v.uLongList = v.prototype.parseULongList;
1838
1838
  v.struct = v.prototype.parseStruct;
1839
1839
  v.coverage = v.prototype.parseCoverage;
1840
1840
  v.classDef = v.prototype.parseClassDef;
1841
- var Er = {
1841
+ var Or = {
1842
1842
  reserved: v.uShort,
1843
1843
  reqFeatureIndex: v.uShort,
1844
1844
  featureIndexes: v.uShortList
@@ -1847,10 +1847,10 @@ v.prototype.parseScriptList = function() {
1847
1847
  return this.parsePointer(v.recordList({
1848
1848
  tag: v.tag,
1849
1849
  script: v.pointer({
1850
- defaultLangSys: v.pointer(Er),
1850
+ defaultLangSys: v.pointer(Or),
1851
1851
  langSysRecords: v.recordList({
1852
1852
  tag: v.tag,
1853
- langSys: v.pointer(Er)
1853
+ langSys: v.pointer(Or)
1854
1854
  })
1855
1855
  })
1856
1856
  })) || [];
@@ -1889,13 +1889,13 @@ v.prototype.parseFeatureVariationsList = function() {
1889
1889
  }) || [];
1890
1890
  };
1891
1891
  var F = {
1892
- getByte: Cr,
1893
- getCard8: Cr,
1894
- getUShort: ft,
1895
- getCard16: ft,
1892
+ getByte: Er,
1893
+ getCard8: Er,
1894
+ getUShort: pt,
1895
+ getCard16: pt,
1896
1896
  getShort: Ka,
1897
1897
  getULong: tr,
1898
- getFixed: En,
1898
+ getFixed: On,
1899
1899
  getTag: Qa,
1900
1900
  getOffset: Ja,
1901
1901
  getBytes: $a,
@@ -2018,7 +2018,7 @@ function os(t) {
2018
2018
  }
2019
2019
  return s;
2020
2020
  }
2021
- var On = { parse: as, make: os }, it = [
2021
+ var Un = { parse: as, make: os }, ot = [
2022
2022
  ".notdef",
2023
2023
  "space",
2024
2024
  "exclam",
@@ -3179,10 +3179,10 @@ var On = { parse: as, make: os }, it = [
3179
3179
  "ccaron",
3180
3180
  "dcroat"
3181
3181
  ];
3182
- function Un(t) {
3182
+ function Ln(t) {
3183
3183
  this.font = t;
3184
3184
  }
3185
- Un.prototype.charToGlyphIndex = function(t) {
3185
+ Ln.prototype.charToGlyphIndex = function(t) {
3186
3186
  var e = t.codePointAt(0), r = this.font.glyphs;
3187
3187
  if (r) {
3188
3188
  for (var n = 0; n < r.length; n += 1)
@@ -3192,16 +3192,16 @@ Un.prototype.charToGlyphIndex = function(t) {
3192
3192
  }
3193
3193
  return null;
3194
3194
  };
3195
- function Ln(t) {
3195
+ function Rn(t) {
3196
3196
  this.cmap = t;
3197
3197
  }
3198
- Ln.prototype.charToGlyphIndex = function(t) {
3198
+ Rn.prototype.charToGlyphIndex = function(t) {
3199
3199
  return this.cmap.glyphIndexMap[t.codePointAt(0)] || 0;
3200
3200
  };
3201
- function pt(t, e) {
3201
+ function dt(t, e) {
3202
3202
  this.encoding = t, this.charset = e;
3203
3203
  }
3204
- pt.prototype.charToGlyphIndex = function(t) {
3204
+ dt.prototype.charToGlyphIndex = function(t) {
3205
3205
  var e = t.codePointAt(0), r = this.encoding[e];
3206
3206
  return this.charset.indexOf(r);
3207
3207
  };
@@ -3257,7 +3257,7 @@ function fs(t, e) {
3257
3257
  function ps(t, e, r, n, a) {
3258
3258
  t.beginPath(), t.moveTo(e, r), t.lineTo(n, a), t.stroke();
3259
3259
  }
3260
- var we = { line: ps };
3260
+ var Ce = { line: ps };
3261
3261
  function ds(t, e) {
3262
3262
  var r = e || new _();
3263
3263
  return {
@@ -3354,11 +3354,11 @@ ae.prototype.drawPoints = function(t, e, r, n) {
3354
3354
  };
3355
3355
  ae.prototype.drawMetrics = function(t, e, r, n) {
3356
3356
  var a;
3357
- e = e !== void 0 ? e : 0, r = r !== void 0 ? r : 0, n = n !== void 0 ? n : 24, a = 1 / this.path.unitsPerEm * n, t.lineWidth = 1, t.strokeStyle = "black", we.line(t, e, -1e4, e, 1e4), we.line(t, -1e4, r, 1e4, r);
3357
+ e = e !== void 0 ? e : 0, r = r !== void 0 ? r : 0, n = n !== void 0 ? n : 24, a = 1 / this.path.unitsPerEm * n, t.lineWidth = 1, t.strokeStyle = "black", Ce.line(t, e, -1e4, e, 1e4), Ce.line(t, -1e4, r, 1e4, r);
3358
3358
  var s = this.xMin || 0, i = this.yMin || 0, u = this.xMax || 0, o = this.yMax || 0, l = this.advanceWidth || 0;
3359
- t.strokeStyle = "blue", we.line(t, e + s * a, -1e4, e + s * a, 1e4), we.line(t, e + u * a, -1e4, e + u * a, 1e4), we.line(t, -1e4, r + -i * a, 1e4, r + -i * a), we.line(t, -1e4, r + -o * a, 1e4, r + -o * a), t.strokeStyle = "green", we.line(t, e + l * a, -1e4, e + l * a, 1e4);
3359
+ t.strokeStyle = "blue", Ce.line(t, e + s * a, -1e4, e + s * a, 1e4), Ce.line(t, e + u * a, -1e4, e + u * a, 1e4), Ce.line(t, -1e4, r + -i * a, 1e4, r + -i * a), Ce.line(t, -1e4, r + -o * a, 1e4, r + -o * a), t.strokeStyle = "green", Ce.line(t, e + l * a, -1e4, e + l * a, 1e4);
3360
3360
  };
3361
- function at(t, e, r) {
3361
+ function st(t, e, r) {
3362
3362
  Object.defineProperty(t, e, {
3363
3363
  get: function() {
3364
3364
  return t.path, t[r];
@@ -3403,7 +3403,7 @@ function gs(t, e, r, n, a, s) {
3403
3403
  r(i, n, a);
3404
3404
  var u = s(t.glyphs, i);
3405
3405
  return u.unitsPerEm = t.unitsPerEm, u;
3406
- }, at(i, "xMin", "_xMin"), at(i, "xMax", "_xMax"), at(i, "yMin", "_yMin"), at(i, "yMax", "_yMax"), i;
3406
+ }, st(i, "xMin", "_xMin"), st(i, "xMax", "_xMax"), st(i, "yMin", "_yMin"), st(i, "yMax", "_yMax"), i;
3407
3407
  };
3408
3408
  }
3409
3409
  function ys(t, e, r, n) {
@@ -3416,14 +3416,14 @@ function ys(t, e, r, n) {
3416
3416
  };
3417
3417
  }
3418
3418
  var de = { GlyphSet: nr, glyphLoader: vs, ttfGlyphLoader: gs, cffGlyphLoader: ys };
3419
- function Rn(t, e) {
3419
+ function An(t, e) {
3420
3420
  if (t === e)
3421
3421
  return !0;
3422
3422
  if (Array.isArray(t) && Array.isArray(e)) {
3423
3423
  if (t.length !== e.length)
3424
3424
  return !1;
3425
3425
  for (var r = 0; r < t.length; r += 1)
3426
- if (!Rn(t[r], e[r]))
3426
+ if (!An(t[r], e[r]))
3427
3427
  return !1;
3428
3428
  return !0;
3429
3429
  } else
@@ -3504,7 +3504,7 @@ function ks(t) {
3504
3504
  }
3505
3505
  return e;
3506
3506
  }
3507
- function An(t, e, r) {
3507
+ function Dn(t, e, r) {
3508
3508
  e = e !== void 0 ? e : 0;
3509
3509
  var n = new F.Parser(t, e), a = [], s = [];
3510
3510
  for (r = r !== void 0 ? r : t.length; n.relativeOffset < r; ) {
@@ -3514,9 +3514,9 @@ function An(t, e, r) {
3514
3514
  return ks(a);
3515
3515
  }
3516
3516
  function ze(t, e) {
3517
- return e <= 390 ? e = it[e] : e = t[e - 391], e;
3517
+ return e <= 390 ? e = ot[e] : e = t[e - 391], e;
3518
3518
  }
3519
- function Dn(t, e, r) {
3519
+ function Mn(t, e, r) {
3520
3520
  for (var n = {}, a, s = 0; s < e.length; s += 1) {
3521
3521
  var i = e[s];
3522
3522
  if (Array.isArray(i.type)) {
@@ -3534,7 +3534,7 @@ function Ts(t, e) {
3534
3534
  var r = {};
3535
3535
  return r.formatMajor = F.getCard8(t, e), r.formatMinor = F.getCard8(t, e + 1), r.size = F.getCard8(t, e + 2), r.offsetSize = F.getCard8(t, e + 3), r.startOffset = e, r.endOffset = e + 4, r;
3536
3536
  }
3537
- var Mn = [
3537
+ var Bn = [
3538
3538
  { name: "version", op: 0, type: "SID" },
3539
3539
  { name: "notice", op: 1, type: "SID" },
3540
3540
  { name: "copyright", op: 1200, type: "SID" },
@@ -3570,20 +3570,20 @@ var Mn = [
3570
3570
  { name: "fdArray", op: 1236, type: "offset" },
3571
3571
  { name: "fdSelect", op: 1237, type: "offset" },
3572
3572
  { name: "fontName", op: 1238, type: "SID" }
3573
- ], Bn = [
3573
+ ], Pn = [
3574
3574
  { name: "subrs", op: 19, type: "offset", value: 0 },
3575
3575
  { name: "defaultWidthX", op: 20, type: "number", value: 0 },
3576
3576
  { name: "nominalWidthX", op: 21, type: "number", value: 0 }
3577
3577
  ];
3578
3578
  function Fs(t, e) {
3579
- var r = An(t, 0, t.byteLength);
3580
- return Dn(r, Mn, e);
3579
+ var r = Dn(t, 0, t.byteLength);
3580
+ return Mn(r, Bn, e);
3581
3581
  }
3582
3582
  function In(t, e, r, n) {
3583
- var a = An(t, e, r);
3584
- return Dn(a, Bn, n);
3583
+ var a = Dn(t, e, r);
3584
+ return Mn(a, Pn, n);
3585
3585
  }
3586
- function Or(t, e, r, n) {
3586
+ function Ur(t, e, r, n) {
3587
3587
  for (var a = [], s = 0; s < r.length; s += 1) {
3588
3588
  var i = new DataView(new Uint8Array(r[s]).buffer), u = Fs(i, n);
3589
3589
  u._subrs = [], u._subrsBias = 0, u._defaultWidthX = 0, u._nominalWidthX = 0;
@@ -3600,7 +3600,7 @@ function Or(t, e, r, n) {
3600
3600
  }
3601
3601
  return a;
3602
3602
  }
3603
- function ws(t, e, r, n) {
3603
+ function Cs(t, e, r, n) {
3604
3604
  var a, s, i = new F.Parser(t, e);
3605
3605
  r -= 1;
3606
3606
  var u = [".notdef"], o = i.parseCard8();
@@ -3623,7 +3623,7 @@ function ws(t, e, r, n) {
3623
3623
  throw new Error("Unknown charset format " + o);
3624
3624
  return u;
3625
3625
  }
3626
- function Cs(t, e, r) {
3626
+ function ws(t, e, r) {
3627
3627
  var n, a = {}, s = new F.Parser(t, e), i = s.parseCard8();
3628
3628
  if (i === 0)
3629
3629
  for (var u = s.parseCard8(), o = 0; o < u; o += 1)
@@ -3636,9 +3636,9 @@ function Cs(t, e, r) {
3636
3636
  a[f] = n, n += 1;
3637
3637
  } else
3638
3638
  throw new Error("Unknown encoding format " + i);
3639
- return new pt(a, r);
3639
+ return new dt(a, r);
3640
3640
  }
3641
- function Ur(t, e, r) {
3641
+ function Lr(t, e, r) {
3642
3642
  var n, a, s, i, u = new _(), o = [], l = 0, c = !1, p = !1, h = 0, f = 0, d, g, y, m;
3643
3643
  if (t.isCIDFont) {
3644
3644
  var S = t.tables.cff.topDict._fdSelect[e.index], x = t.tables.cff.topDict._fdArray[S];
@@ -3646,16 +3646,16 @@ function Ur(t, e, r) {
3646
3646
  } else
3647
3647
  d = t.tables.cff.topDict._subrs, g = t.tables.cff.topDict._subrsBias, y = t.tables.cff.topDict._defaultWidthX, m = t.tables.cff.topDict._nominalWidthX;
3648
3648
  var O = y;
3649
- function w(C, N) {
3650
- p && u.closePath(), u.moveTo(C, N), p = !0;
3649
+ function C(w, N) {
3650
+ p && u.closePath(), u.moveTo(w, N), p = !0;
3651
3651
  }
3652
3652
  function D() {
3653
- var C;
3654
- C = o.length % 2 !== 0, C && !c && (O = o.shift() + m), l += o.length >> 1, o.length = 0, c = !0;
3653
+ var w;
3654
+ w = o.length % 2 !== 0, w && !c && (O = o.shift() + m), l += o.length >> 1, o.length = 0, c = !0;
3655
3655
  }
3656
- function L(C) {
3657
- for (var N, j, K, re, ne, G, H, V, q, X, z, Z, M = 0; M < C.length; ) {
3658
- var Y = C[M];
3656
+ function L(w) {
3657
+ for (var N, j, K, re, ne, G, H, V, q, X, z, Z, M = 0; M < w.length; ) {
3658
+ var Y = w[M];
3659
3659
  switch (M += 1, Y) {
3660
3660
  case 1:
3661
3661
  D();
@@ -3664,7 +3664,7 @@ function Ur(t, e, r) {
3664
3664
  D();
3665
3665
  break;
3666
3666
  case 4:
3667
- o.length > 1 && !c && (O = o.shift() + m, c = !0), f += o.pop(), w(h, f);
3667
+ o.length > 1 && !c && (O = o.shift() + m, c = !0), f += o.pop(), C(h, f);
3668
3668
  break;
3669
3669
  case 5:
3670
3670
  for (; o.length > 0; )
@@ -3688,7 +3688,7 @@ function Ur(t, e, r) {
3688
3688
  case 11:
3689
3689
  return;
3690
3690
  case 12:
3691
- switch (Y = C[M], M += 1, Y) {
3691
+ switch (Y = w[M], M += 1, Y) {
3692
3692
  case 35:
3693
3693
  n = h + o.shift(), a = f + o.shift(), s = n + o.shift(), i = a + o.shift(), H = s + o.shift(), V = i + o.shift(), q = H + o.shift(), X = V + o.shift(), z = q + o.shift(), Z = X + o.shift(), h = z + o.shift(), f = Z + o.shift(), o.shift(), u.curveTo(n, a, s, i, H, V), u.curveTo(q, X, z, Z, h, f);
3694
3694
  break;
@@ -3716,10 +3716,10 @@ function Ur(t, e, r) {
3716
3716
  D(), M += l + 7 >> 3;
3717
3717
  break;
3718
3718
  case 21:
3719
- o.length > 2 && !c && (O = o.shift() + m, c = !0), f += o.pop(), h += o.pop(), w(h, f);
3719
+ o.length > 2 && !c && (O = o.shift() + m, c = !0), f += o.pop(), h += o.pop(), C(h, f);
3720
3720
  break;
3721
3721
  case 22:
3722
- o.length > 1 && !c && (O = o.shift() + m, c = !0), h += o.pop(), w(h, f);
3722
+ o.length > 1 && !c && (O = o.shift() + m, c = !0), h += o.pop(), C(h, f);
3723
3723
  break;
3724
3724
  case 23:
3725
3725
  D();
@@ -3743,7 +3743,7 @@ function Ur(t, e, r) {
3743
3743
  n = h + o.shift(), a = f, s = n + o.shift(), i = a + o.shift(), h = s + o.shift(), f = i, u.curveTo(n, a, s, i, h, f);
3744
3744
  break;
3745
3745
  case 28:
3746
- N = C[M], j = C[M + 1], o.push((N << 24 | j << 16) >> 16), M += 2;
3746
+ N = w[M], j = w[M + 1], o.push((N << 24 | j << 16) >> 16), M += 2;
3747
3747
  break;
3748
3748
  case 29:
3749
3749
  ne = o.pop() + t.gsubrsBias, G = t.gsubrs[ne], G && L(G);
@@ -3757,7 +3757,7 @@ function Ur(t, e, r) {
3757
3757
  n = h, a = f + o.shift(), s = n + o.shift(), i = a + o.shift(), h = s + o.shift(), f = i + (o.length === 1 ? o.shift() : 0), u.curveTo(n, a, s, i, h, f);
3758
3758
  break;
3759
3759
  default:
3760
- Y < 32 ? console.log("Glyph " + e.index + ": unknown operator " + Y) : Y < 247 ? o.push(Y - 139) : Y < 251 ? (N = C[M], M += 1, o.push((Y - 247) * 256 + N + 108)) : Y < 255 ? (N = C[M], M += 1, o.push(-(Y - 251) * 256 - N - 108)) : (N = C[M], j = C[M + 1], K = C[M + 2], re = C[M + 3], M += 4, o.push((N << 24 | j << 16 | K << 8 | re) / 65536));
3760
+ Y < 32 ? console.log("Glyph " + e.index + ": unknown operator " + Y) : Y < 247 ? o.push(Y - 139) : Y < 251 ? (N = w[M], M += 1, o.push((Y - 247) * 256 + N + 108)) : Y < 255 ? (N = w[M], M += 1, o.push(-(Y - 251) * 256 - N - 108)) : (N = w[M], j = w[M + 1], K = w[M + 2], re = w[M + 3], M += 4, o.push((N << 24 | j << 16 | K << 8 | re) / 65536));
3761
3761
  }
3762
3762
  }
3763
3763
  }
@@ -3794,7 +3794,7 @@ function Os(t, e, r, n) {
3794
3794
  r.tables.cff = {};
3795
3795
  var a = Ts(t, e), s = xe(t, a.endOffset, F.bytesToString), i = xe(t, s.endOffset), u = xe(t, i.endOffset, F.bytesToString), o = xe(t, u.endOffset);
3796
3796
  r.gsubrs = o.objects, r.gsubrsBias = Yt(r.gsubrs);
3797
- var l = Or(t, e, i.objects, u.objects);
3797
+ var l = Ur(t, e, i.objects, u.objects);
3798
3798
  if (l.length !== 1)
3799
3799
  throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " + l.length);
3800
3800
  var c = l[0];
@@ -3803,7 +3803,7 @@ function Os(t, e, r, n) {
3803
3803
  if (p === 0 || h === 0)
3804
3804
  throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
3805
3805
  p += e;
3806
- var f = xe(t, p), d = Or(t, e, f.objects, u.objects);
3806
+ var f = xe(t, p), d = Ur(t, e, f.objects, u.objects);
3807
3807
  c._fdArray = d, h += e, c._fdSelect = Es(t, h, r.numGlyphs, d.length);
3808
3808
  }
3809
3809
  var g = e + c.private[1], y = In(t, g, c.private[0], u.objects);
@@ -3814,21 +3814,21 @@ function Os(t, e, r, n) {
3814
3814
  r.subrs = [], r.subrsBias = 0;
3815
3815
  var x;
3816
3816
  n.lowMemory ? (x = ms(t, e + c.charStrings), r.nGlyphs = x.offsets.length) : (x = xe(t, e + c.charStrings), r.nGlyphs = x.objects.length);
3817
- var O = ws(t, e + c.charset, r.nGlyphs, u.objects);
3818
- if (c.encoding === 0 ? r.cffEncoding = new pt(us, O) : c.encoding === 1 ? r.cffEncoding = new pt(ls, O) : r.cffEncoding = Cs(t, e + c.encoding, O), r.encoding = r.encoding || r.cffEncoding, r.glyphs = new de.GlyphSet(r), n.lowMemory)
3817
+ var O = Cs(t, e + c.charset, r.nGlyphs, u.objects);
3818
+ if (c.encoding === 0 ? r.cffEncoding = new dt(us, O) : c.encoding === 1 ? r.cffEncoding = new dt(ls, O) : r.cffEncoding = ws(t, e + c.encoding, O), r.encoding = r.encoding || r.cffEncoding, r.glyphs = new de.GlyphSet(r), n.lowMemory)
3819
3819
  r._push = function(L) {
3820
- var C = xs(L, x.offsets, t, e + c.charStrings);
3821
- r.glyphs.push(L, de.cffGlyphLoader(r, L, Ur, C));
3820
+ var w = xs(L, x.offsets, t, e + c.charStrings);
3821
+ r.glyphs.push(L, de.cffGlyphLoader(r, L, Lr, w));
3822
3822
  };
3823
3823
  else
3824
- for (var w = 0; w < r.nGlyphs; w += 1) {
3825
- var D = x.objects[w];
3826
- r.glyphs.push(w, de.cffGlyphLoader(r, w, Ur, D));
3824
+ for (var C = 0; C < r.nGlyphs; C += 1) {
3825
+ var D = x.objects[C];
3826
+ r.glyphs.push(C, de.cffGlyphLoader(r, C, Lr, D));
3827
3827
  }
3828
3828
  }
3829
- function Pn(t, e) {
3830
- var r, n = it.indexOf(t);
3831
- return n >= 0 && (r = n), n = e.indexOf(t), n >= 0 ? r = n + it.length : (r = it.length + e.length, e.push(t)), r;
3829
+ function Gn(t, e) {
3830
+ var r, n = ot.indexOf(t);
3831
+ return n >= 0 && (r = n), n = e.indexOf(t), n >= 0 ? r = n + ot.length : (r = ot.length + e.length, e.push(t)), r;
3832
3832
  }
3833
3833
  function Us() {
3834
3834
  return new k.Record("Header", [
@@ -3847,20 +3847,20 @@ function Ls(t) {
3847
3847
  e.names.push({ name: "name_" + r, type: "NAME", value: t[r] });
3848
3848
  return e;
3849
3849
  }
3850
- function Gn(t, e, r) {
3850
+ function Nn(t, e, r) {
3851
3851
  for (var n = {}, a = 0; a < t.length; a += 1) {
3852
3852
  var s = t[a], i = e[s.name];
3853
- i !== void 0 && !Rn(i, s.value) && (s.type === "SID" && (i = Pn(i, r)), n[s.op] = { name: s.name, type: s.type, value: i });
3853
+ i !== void 0 && !An(i, s.value) && (s.type === "SID" && (i = Gn(i, r)), n[s.op] = { name: s.name, type: s.type, value: i });
3854
3854
  }
3855
3855
  return n;
3856
3856
  }
3857
- function Lr(t, e) {
3857
+ function Rr(t, e) {
3858
3858
  var r = new k.Record("Top DICT", [
3859
3859
  { name: "dict", type: "DICT", value: {} }
3860
3860
  ]);
3861
- return r.dict = Gn(Mn, t, e), r;
3861
+ return r.dict = Nn(Bn, t, e), r;
3862
3862
  }
3863
- function Rr(t) {
3863
+ function Ar(t) {
3864
3864
  var e = new k.Record("Top DICT INDEX", [
3865
3865
  { name: "topDicts", type: "INDEX", value: [] }
3866
3866
  ]);
@@ -3884,7 +3884,7 @@ function Ds(t, e) {
3884
3884
  for (var r = new k.Record("Charsets", [
3885
3885
  { name: "format", type: "Card8", value: 0 }
3886
3886
  ]), n = 0; n < t.length; n += 1) {
3887
- var a = t[n], s = Pn(a, e);
3887
+ var a = t[n], s = Gn(a, e);
3888
3888
  r.fields.push({ name: "glyph_" + n, type: "SID", value: s });
3889
3889
  }
3890
3890
  return r;
@@ -3926,13 +3926,13 @@ function Bs(t) {
3926
3926
  }
3927
3927
  return e;
3928
3928
  }
3929
- function Is(t, e) {
3929
+ function Ps(t, e) {
3930
3930
  var r = new k.Record("Private DICT", [
3931
3931
  { name: "dict", type: "DICT", value: {} }
3932
3932
  ]);
3933
- return r.dict = Gn(Bn, t, e), r;
3933
+ return r.dict = Nn(Pn, t, e), r;
3934
3934
  }
3935
- function Ps(t, e) {
3935
+ function Is(t, e) {
3936
3936
  for (var r = new k.Table("CFF ", [
3937
3937
  { name: "header", type: "RECORD" },
3938
3938
  { name: "nameIndex", type: "RECORD" },
@@ -3957,12 +3957,12 @@ function Ps(t, e) {
3957
3957
  u = t.get(o), i.push(u.name);
3958
3958
  var l = [];
3959
3959
  r.header = Us(), r.nameIndex = Ls([e.postScriptName]);
3960
- var c = Lr(a, l);
3961
- r.topDictIndex = Rr(c), r.globalSubrIndex = As(), r.charsets = Ds(i, l), r.charStringsIndex = Bs(t), r.privateDict = Is(s, l), r.stringIndex = Rs(l);
3960
+ var c = Rr(a, l);
3961
+ r.topDictIndex = Ar(c), r.globalSubrIndex = As(), r.charsets = Ds(i, l), r.charStringsIndex = Bs(t), r.privateDict = Ps(s, l), r.stringIndex = Rs(l);
3962
3962
  var p = r.header.sizeOf() + r.nameIndex.sizeOf() + r.topDictIndex.sizeOf() + r.stringIndex.sizeOf() + r.globalSubrIndex.sizeOf();
3963
- return a.charset = p, a.encoding = 0, a.charStrings = a.charset + r.charsets.sizeOf(), a.private[1] = a.charStrings + r.charStringsIndex.sizeOf(), c = Lr(a, l), r.topDictIndex = Rr(c), r;
3963
+ return a.charset = p, a.encoding = 0, a.charStrings = a.charset + r.charsets.sizeOf(), a.private[1] = a.charStrings + r.charStringsIndex.sizeOf(), c = Rr(a, l), r.topDictIndex = Ar(c), r;
3964
3964
  }
3965
- var Nn = { parse: Os, make: Ps };
3965
+ var _n = { parse: Os, make: Is };
3966
3966
  function Gs(t, e) {
3967
3967
  var r = {}, n = new F.Parser(t, e);
3968
3968
  return r.version = n.parseVersion(), r.fontRevision = Math.round(n.parseFixed() * 1e3) / 1e3, r.checkSumAdjustment = n.parseULong(), r.magicNumber = n.parseULong(), E.argument(r.magicNumber === 1594834165, "Font header has wrong magic number."), r.flags = n.parseUShort(), r.unitsPerEm = n.parseUShort(), r.created = n.parseLongDateTime(), r.modified = n.parseLongDateTime(), r.xMin = n.parseShort(), r.yMin = n.parseShort(), r.xMax = n.parseShort(), r.yMax = n.parseShort(), r.macStyle = n.parseUShort(), r.lowestRecPPEM = n.parseUShort(), r.fontDirectionHint = n.parseShort(), r.indexToLocFormat = n.parseShort(), r.glyphDataFormat = n.parseShort(), r;
@@ -3989,7 +3989,7 @@ function Ns(t) {
3989
3989
  { name: "glyphDataFormat", type: "SHORT", value: 0 }
3990
3990
  ], t);
3991
3991
  }
3992
- var _n = { parse: Gs, make: Ns };
3992
+ var Hn = { parse: Gs, make: Ns };
3993
3993
  function _s(t, e) {
3994
3994
  var r = {}, n = new F.Parser(t, e);
3995
3995
  return r.version = n.parseVersion(), r.ascender = n.parseShort(), r.descender = n.parseShort(), r.lineGap = n.parseShort(), r.advanceWidthMax = n.parseUShort(), r.minLeftSideBearing = n.parseShort(), r.minRightSideBearing = n.parseShort(), r.xMaxExtent = n.parseShort(), r.caretSlopeRise = n.parseShort(), r.caretSlopeRun = n.parseShort(), r.caretOffset = n.parseShort(), n.relativeOffset += 8, r.metricDataFormat = n.parseShort(), r.numberOfHMetrics = n.parseUShort(), r;
@@ -4015,7 +4015,7 @@ function Hs(t) {
4015
4015
  { name: "numberOfHMetrics", type: "USHORT", value: 0 }
4016
4016
  ], t);
4017
4017
  }
4018
- var Hn = { parse: _s, make: Hs };
4018
+ var zn = { parse: _s, make: Hs };
4019
4019
  function zs(t, e, r, n, a) {
4020
4020
  for (var s, i, u = new F.Parser(t, e), o = 0; o < n; o += 1) {
4021
4021
  o < r && (s = u.parseUShort(), i = u.parseShort());
@@ -4041,7 +4041,7 @@ function qs(t) {
4041
4041
  }
4042
4042
  return e;
4043
4043
  }
4044
- var zn = { parse: Vs, make: qs };
4044
+ var Wn = { parse: Vs, make: qs };
4045
4045
  function Xs(t) {
4046
4046
  for (var e = new k.Table("ltag", [
4047
4047
  { name: "version", type: "ULONG", value: 1 },
@@ -4063,7 +4063,7 @@ function Ys(t, e) {
4063
4063
  }
4064
4064
  return s;
4065
4065
  }
4066
- var Wn = { make: Xs, parse: Ys };
4066
+ var Vn = { make: Xs, parse: Ys };
4067
4067
  function Zs(t, e) {
4068
4068
  var r = {}, n = new F.Parser(t, e);
4069
4069
  return r.version = n.parseVersion(), r.numGlyphs = n.parseUShort(), r.version === 1 && (r.maxPoints = n.parseUShort(), r.maxContours = n.parseUShort(), r.maxCompositePoints = n.parseUShort(), r.maxCompositeContours = n.parseUShort(), r.maxZones = n.parseUShort(), r.maxTwilightPoints = n.parseUShort(), r.maxStorage = n.parseUShort(), r.maxFunctionDefs = n.parseUShort(), r.maxInstructionDefs = n.parseUShort(), r.maxStackElements = n.parseUShort(), r.maxSizeOfInstructions = n.parseUShort(), r.maxComponentElements = n.parseUShort(), r.maxComponentDepth = n.parseUShort()), r;
@@ -4074,7 +4074,7 @@ function js(t) {
4074
4074
  { name: "numGlyphs", type: "USHORT", value: t }
4075
4075
  ]);
4076
4076
  }
4077
- var Vn = { parse: Zs, make: js }, qn = [
4077
+ var qn = { parse: Zs, make: js }, Xn = [
4078
4078
  "copyright",
4079
4079
  // 0
4080
4080
  "fontFamily",
@@ -4121,7 +4121,7 @@ var Vn = { parse: Zs, make: js }, qn = [
4121
4121
  // 21
4122
4122
  "wwsSubfamily"
4123
4123
  // 22
4124
- ], Xn = {
4124
+ ], Yn = {
4125
4125
  0: "en",
4126
4126
  1: "fr",
4127
4127
  2: "de",
@@ -4480,7 +4480,7 @@ var Vn = { parse: Zs, make: js }, qn = [
4480
4480
  // langAzerbaijanRoman → smRoman
4481
4481
  151: 0
4482
4482
  // langNynorsk → smRoman
4483
- }, Yn = {
4483
+ }, Zn = {
4484
4484
  1078: "af",
4485
4485
  1052: "sq",
4486
4486
  1156: "gsw",
@@ -4703,9 +4703,9 @@ function Qs(t, e, r) {
4703
4703
  return r[e];
4704
4704
  break;
4705
4705
  case 1:
4706
- return Xn[e];
4707
- case 3:
4708
4706
  return Yn[e];
4707
+ case 3:
4708
+ return Zn[e];
4709
4709
  }
4710
4710
  }
4711
4711
  var Zt = "utf-16", Js = {
@@ -4799,7 +4799,7 @@ var Zt = "utf-16", Js = {
4799
4799
  146: "x-mac-gaelic"
4800
4800
  // langIrishGaelicScript
4801
4801
  };
4802
- function Zn(t, e, r) {
4802
+ function jn(t, e, r) {
4803
4803
  switch (t) {
4804
4804
  case 0:
4805
4805
  return Zt;
@@ -4813,10 +4813,10 @@ function Zn(t, e, r) {
4813
4813
  }
4814
4814
  function ei(t, e, r) {
4815
4815
  for (var n = {}, a = new F.Parser(t, e), s = a.parseUShort(), i = a.parseUShort(), u = a.offset + a.parseUShort(), o = 0; o < i; o++) {
4816
- var l = a.parseUShort(), c = a.parseUShort(), p = a.parseUShort(), h = a.parseUShort(), f = qn[h] || h, d = a.parseUShort(), g = a.parseUShort(), y = Qs(l, p, r), m = Zn(l, c, p);
4816
+ var l = a.parseUShort(), c = a.parseUShort(), p = a.parseUShort(), h = a.parseUShort(), f = Xn[h] || h, d = a.parseUShort(), g = a.parseUShort(), y = Qs(l, p, r), m = jn(l, c, p);
4817
4817
  if (m !== void 0 && y !== void 0) {
4818
4818
  var S = void 0;
4819
- if (m === Zt ? S = Ie.UTF16(t, u + g, d) : S = Ie.MACSTRING(t, u + g, d, m), S) {
4819
+ if (m === Zt ? S = Pe.UTF16(t, u + g, d) : S = Pe.MACSTRING(t, u + g, d, m), S) {
4820
4820
  var x = n[f];
4821
4821
  x === void 0 && (x = n[f] = {}), x[y] = S;
4822
4822
  }
@@ -4824,13 +4824,13 @@ function ei(t, e, r) {
4824
4824
  }
4825
4825
  return s === 1 && a.parseUShort(), n;
4826
4826
  }
4827
- function Ft(t) {
4827
+ function Ct(t) {
4828
4828
  var e = {};
4829
4829
  for (var r in t)
4830
4830
  e[t[r]] = parseInt(r);
4831
4831
  return e;
4832
4832
  }
4833
- function Ar(t, e, r, n, a, s) {
4833
+ function Dr(t, e, r, n, a, s) {
4834
4834
  return new k.Record("NameRecord", [
4835
4835
  { name: "platformID", type: "USHORT", value: t },
4836
4836
  { name: "encodingID", type: "USHORT", value: e },
@@ -4852,7 +4852,7 @@ function ti(t, e) {
4852
4852
  }
4853
4853
  return -1;
4854
4854
  }
4855
- function Dr(t, e) {
4855
+ function Mr(t, e) {
4856
4856
  var r = ti(t, e);
4857
4857
  if (r < 0) {
4858
4858
  r = e.length;
@@ -4862,38 +4862,38 @@ function Dr(t, e) {
4862
4862
  return r;
4863
4863
  }
4864
4864
  function ri(t, e) {
4865
- var r, n = [], a = {}, s = Ft(qn);
4865
+ var r, n = [], a = {}, s = Ct(Xn);
4866
4866
  for (var i in t) {
4867
4867
  var u = s[i];
4868
4868
  if (u === void 0 && (u = i), r = parseInt(u), isNaN(r))
4869
4869
  throw new Error('Name table entry "' + i + '" does not exist, see nameTableNames for complete list.');
4870
4870
  a[r] = t[i], n.push(r);
4871
4871
  }
4872
- for (var o = Ft(Xn), l = Ft(Yn), c = [], p = [], h = 0; h < n.length; h++) {
4872
+ for (var o = Ct(Yn), l = Ct(Zn), c = [], p = [], h = 0; h < n.length; h++) {
4873
4873
  r = n[h];
4874
4874
  var f = a[r];
4875
4875
  for (var d in f) {
4876
- var g = f[d], y = 1, m = o[d], S = Ks[m], x = Zn(y, S, m), O = b.MACSTRING(g, x);
4876
+ var g = f[d], y = 1, m = o[d], S = Ks[m], x = jn(y, S, m), O = b.MACSTRING(g, x);
4877
4877
  O === void 0 && (y = 0, m = e.indexOf(d), m < 0 && (m = e.length, e.push(d)), S = 4, O = b.UTF16(g));
4878
- var w = Dr(O, p);
4879
- c.push(Ar(
4878
+ var C = Mr(O, p);
4879
+ c.push(Dr(
4880
4880
  y,
4881
4881
  S,
4882
4882
  m,
4883
4883
  r,
4884
4884
  O.length,
4885
- w
4885
+ C
4886
4886
  ));
4887
4887
  var D = l[d];
4888
4888
  if (D !== void 0) {
4889
- var L = b.UTF16(g), C = Dr(L, p);
4890
- c.push(Ar(
4889
+ var L = b.UTF16(g), w = Mr(L, p);
4890
+ c.push(Dr(
4891
4891
  3,
4892
4892
  1,
4893
4893
  D,
4894
4894
  r,
4895
4895
  L.length,
4896
- C
4896
+ w
4897
4897
  ));
4898
4898
  }
4899
4899
  }
@@ -4909,7 +4909,7 @@ function ri(t, e) {
4909
4909
  N.fields.push({ name: "record_" + j, type: "RECORD", value: c[j] });
4910
4910
  return N.fields.push({ name: "strings", type: "LITERAL", value: p }), N;
4911
4911
  }
4912
- var jn = { parse: ei, make: ri }, jt = [
4912
+ var Kn = { parse: ei, make: ri }, jt = [
4913
4913
  { begin: 0, end: 127 },
4914
4914
  // Basic Latin
4915
4915
  { begin: 128, end: 255 },
@@ -5261,8 +5261,8 @@ function oi() {
5261
5261
  { name: "maxMemType1", type: "ULONG", value: 0 }
5262
5262
  ]);
5263
5263
  }
5264
- var Kn = { parse: ii, make: oi }, se = new Array(9);
5265
- se[1] = function() {
5264
+ var Qn = { parse: ii, make: oi }, ie = new Array(9);
5265
+ ie[1] = function() {
5266
5266
  var e = this.offset + this.relativeOffset, r = this.parseUShort();
5267
5267
  if (r === 1)
5268
5268
  return {
@@ -5278,7 +5278,7 @@ se[1] = function() {
5278
5278
  };
5279
5279
  E.assert(!1, "0x" + e.toString(16) + ": lookup type 1 format must be 1 or 2.");
5280
5280
  };
5281
- se[2] = function() {
5281
+ ie[2] = function() {
5282
5282
  var e = this.parseUShort();
5283
5283
  return E.argument(e === 1, "GSUB Multiple Substitution Subtable identifier-format must be 1"), {
5284
5284
  substFormat: e,
@@ -5286,7 +5286,7 @@ se[2] = function() {
5286
5286
  sequences: this.parseListOfLists()
5287
5287
  };
5288
5288
  };
5289
- se[3] = function() {
5289
+ ie[3] = function() {
5290
5290
  var e = this.parseUShort();
5291
5291
  return E.argument(e === 1, "GSUB Alternate Substitution Subtable identifier-format must be 1"), {
5292
5292
  substFormat: e,
@@ -5294,7 +5294,7 @@ se[3] = function() {
5294
5294
  alternateSets: this.parseListOfLists()
5295
5295
  };
5296
5296
  };
5297
- se[4] = function() {
5297
+ ie[4] = function() {
5298
5298
  var e = this.parseUShort();
5299
5299
  return E.argument(e === 1, "GSUB ligature table identifier-format must be 1"), {
5300
5300
  substFormat: e,
@@ -5311,7 +5311,7 @@ var Be = {
5311
5311
  sequenceIndex: v.uShort,
5312
5312
  lookupListIndex: v.uShort
5313
5313
  };
5314
- se[5] = function() {
5314
+ ie[5] = function() {
5315
5315
  var e = this.offset + this.relativeOffset, r = this.parseUShort();
5316
5316
  if (r === 1)
5317
5317
  return {
@@ -5348,7 +5348,7 @@ se[5] = function() {
5348
5348
  }
5349
5349
  E.assert(!1, "0x" + e.toString(16) + ": lookup type 5 format must be 1, 2 or 3.");
5350
5350
  };
5351
- se[6] = function() {
5351
+ ie[6] = function() {
5352
5352
  var e = this.offset + this.relativeOffset, r = this.parseUShort();
5353
5353
  if (r === 1)
5354
5354
  return {
@@ -5389,17 +5389,17 @@ se[6] = function() {
5389
5389
  };
5390
5390
  E.assert(!1, "0x" + e.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
5391
5391
  };
5392
- se[7] = function() {
5392
+ ie[7] = function() {
5393
5393
  var e = this.parseUShort();
5394
5394
  E.argument(e === 1, "GSUB Extension Substitution subtable identifier-format must be 1");
5395
5395
  var r = this.parseUShort(), n = new v(this.data, this.offset + this.parseULong());
5396
5396
  return {
5397
5397
  substFormat: 1,
5398
5398
  lookupType: r,
5399
- extension: se[r].call(n)
5399
+ extension: ie[r].call(n)
5400
5400
  };
5401
5401
  };
5402
- se[8] = function() {
5402
+ ie[8] = function() {
5403
5403
  var e = this.parseUShort();
5404
5404
  return E.argument(e === 1, "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"), {
5405
5405
  substFormat: e,
@@ -5416,17 +5416,17 @@ function ui(t, e) {
5416
5416
  version: n,
5417
5417
  scripts: r.parseScriptList(),
5418
5418
  features: r.parseFeatureList(),
5419
- lookups: r.parseLookupList(se)
5419
+ lookups: r.parseLookupList(ie)
5420
5420
  } : {
5421
5421
  version: n,
5422
5422
  scripts: r.parseScriptList(),
5423
5423
  features: r.parseFeatureList(),
5424
- lookups: r.parseLookupList(se),
5424
+ lookups: r.parseLookupList(ie),
5425
5425
  variations: r.parseFeatureVariationsList()
5426
5426
  };
5427
5427
  }
5428
- var Pe = new Array(9);
5429
- Pe[1] = function(e) {
5428
+ var Ie = new Array(9);
5429
+ Ie[1] = function(e) {
5430
5430
  return e.substFormat === 1 ? new k.Table("substitutionTable", [
5431
5431
  { name: "substFormat", type: "USHORT", value: 1 },
5432
5432
  { name: "coverage", type: "TABLE", value: new k.Coverage(e.coverage) },
@@ -5436,7 +5436,7 @@ Pe[1] = function(e) {
5436
5436
  { name: "coverage", type: "TABLE", value: new k.Coverage(e.coverage) }
5437
5437
  ].concat(k.ushortList("substitute", e.substitute)));
5438
5438
  };
5439
- Pe[2] = function(e) {
5439
+ Ie[2] = function(e) {
5440
5440
  return E.assert(e.substFormat === 1, "Lookup type 2 substFormat must be 1."), new k.Table("substitutionTable", [
5441
5441
  { name: "substFormat", type: "USHORT", value: 1 },
5442
5442
  { name: "coverage", type: "TABLE", value: new k.Coverage(e.coverage) }
@@ -5444,7 +5444,7 @@ Pe[2] = function(e) {
5444
5444
  return new k.Table("sequenceSetTable", k.ushortList("sequence", r));
5445
5445
  })));
5446
5446
  };
5447
- Pe[3] = function(e) {
5447
+ Ie[3] = function(e) {
5448
5448
  return E.assert(e.substFormat === 1, "Lookup type 3 substFormat must be 1."), new k.Table("substitutionTable", [
5449
5449
  { name: "substFormat", type: "USHORT", value: 1 },
5450
5450
  { name: "coverage", type: "TABLE", value: new k.Coverage(e.coverage) }
@@ -5452,7 +5452,7 @@ Pe[3] = function(e) {
5452
5452
  return new k.Table("alternateSetTable", k.ushortList("alternate", r));
5453
5453
  })));
5454
5454
  };
5455
- Pe[4] = function(e) {
5455
+ Ie[4] = function(e) {
5456
5456
  return E.assert(e.substFormat === 1, "Lookup type 4 substFormat must be 1."), new k.Table("substitutionTable", [
5457
5457
  { name: "substFormat", type: "USHORT", value: 1 },
5458
5458
  { name: "coverage", type: "TABLE", value: new k.Coverage(e.coverage) }
@@ -5465,7 +5465,7 @@ Pe[4] = function(e) {
5465
5465
  }));
5466
5466
  })));
5467
5467
  };
5468
- Pe[6] = function(e) {
5468
+ Ie[6] = function(e) {
5469
5469
  if (e.substFormat === 1) {
5470
5470
  var r = new k.Table("chainContextTable", [
5471
5471
  { name: "substFormat", type: "USHORT", value: e.substFormat },
@@ -5504,15 +5504,15 @@ function li(t) {
5504
5504
  { name: "version", type: "ULONG", value: 65536 },
5505
5505
  { name: "scripts", type: "TABLE", value: new k.ScriptList(t.scripts) },
5506
5506
  { name: "features", type: "TABLE", value: new k.FeatureList(t.features) },
5507
- { name: "lookups", type: "TABLE", value: new k.LookupList(t.lookups, Pe) }
5507
+ { name: "lookups", type: "TABLE", value: new k.LookupList(t.lookups, Ie) }
5508
5508
  ]);
5509
5509
  }
5510
- var Qn = { parse: ui, make: li };
5510
+ var Jn = { parse: ui, make: li };
5511
5511
  function ci(t, e) {
5512
5512
  var r = new F.Parser(t, e), n = r.parseULong();
5513
5513
  E.argument(n === 1, "Unsupported META table version."), r.parseULong(), r.parseULong();
5514
5514
  for (var a = r.parseULong(), s = {}, i = 0; i < a; i++) {
5515
- var u = r.parseTag(), o = r.parseULong(), l = r.parseULong(), c = Ie.UTF8(t, e + o, l);
5515
+ var u = r.parseTag(), o = r.parseULong(), l = r.parseULong(), c = Pe.UTF8(t, e + o, l);
5516
5516
  s[u] = c;
5517
5517
  }
5518
5518
  return s;
@@ -5530,8 +5530,8 @@ function hi(t) {
5530
5530
  }
5531
5531
  return a.fields.push({ name: "stringPool", type: "CHARARRAY", value: r }), a;
5532
5532
  }
5533
- var Jn = { parse: ci, make: hi };
5534
- function Mr(t) {
5533
+ var $n = { parse: ci, make: hi };
5534
+ function Br(t) {
5535
5535
  return Math.log(t) / Math.log(2) | 0;
5536
5536
  }
5537
5537
  function ar(t) {
@@ -5541,7 +5541,7 @@ function ar(t) {
5541
5541
  e += (t[r] << 24) + (t[r + 1] << 16) + (t[r + 2] << 8) + t[r + 3];
5542
5542
  return e %= Math.pow(2, 32), e;
5543
5543
  }
5544
- function Br(t, e, r, n) {
5544
+ function Pr(t, e, r, n) {
5545
5545
  return new k.Record("Table Record", [
5546
5546
  { name: "tag", type: "TAG", value: t !== void 0 ? t : "" },
5547
5547
  { name: "checkSum", type: "ULONG", value: e !== void 0 ? e : 0 },
@@ -5549,7 +5549,7 @@ function Br(t, e, r, n) {
5549
5549
  { name: "length", type: "ULONG", value: n !== void 0 ? n : 0 }
5550
5550
  ]);
5551
5551
  }
5552
- function $n(t) {
5552
+ function ea(t) {
5553
5553
  var e = new k.Table("sfnt", [
5554
5554
  { name: "version", type: "TAG", value: "OTTO" },
5555
5555
  { name: "numTables", type: "USHORT", value: 0 },
@@ -5558,14 +5558,14 @@ function $n(t) {
5558
5558
  { name: "rangeShift", type: "USHORT", value: 0 }
5559
5559
  ]);
5560
5560
  e.tables = t, e.numTables = t.length;
5561
- var r = Math.pow(2, Mr(e.numTables));
5562
- e.searchRange = 16 * r, e.entrySelector = Mr(r), e.rangeShift = e.numTables * 16 - e.searchRange;
5563
- for (var n = [], a = [], s = e.sizeOf() + Br().sizeOf() * e.numTables; s % 4 !== 0; )
5561
+ var r = Math.pow(2, Br(e.numTables));
5562
+ e.searchRange = 16 * r, e.entrySelector = Br(r), e.rangeShift = e.numTables * 16 - e.searchRange;
5563
+ for (var n = [], a = [], s = e.sizeOf() + Pr().sizeOf() * e.numTables; s % 4 !== 0; )
5564
5564
  s += 1, a.push({ name: "padding", type: "BYTE", value: 0 });
5565
5565
  for (var i = 0; i < t.length; i += 1) {
5566
5566
  var u = t[i];
5567
5567
  E.argument(u.tableName.length === 4, "Table name" + u.tableName + " is invalid.");
5568
- var o = u.sizeOf(), l = Br(u.tableName, ar(u.encode()), s, o);
5568
+ var o = u.sizeOf(), l = Pr(u.tableName, ar(u.encode()), s, o);
5569
5569
  for (n.push({ name: l.tag + " Table Record", type: "RECORD", value: l }), a.push({ name: u.tableName + " table", type: "RECORD", value: u }), s += o, E.argument(!isNaN(s), "Something went wrong calculating the offset."); s % 4 !== 0; )
5570
5570
  s += 1, a.push({ name: "padding", type: "BYTE", value: 0 });
5571
5571
  }
@@ -5622,7 +5622,7 @@ function pi(t) {
5622
5622
  minRightSideBearing: Math.min.apply(null, u)
5623
5623
  };
5624
5624
  x.ascender = t.ascender, x.descender = t.descender;
5625
- var O = _n.make({
5625
+ var O = Hn.make({
5626
5626
  flags: 3,
5627
5627
  // 00000011 (baseline for font at y=0; left sidebearing point at x=0)
5628
5628
  unitsPerEm: t.unitsPerEm,
@@ -5632,7 +5632,7 @@ function pi(t) {
5632
5632
  yMax: x.yMax,
5633
5633
  lowestRecPPEM: 3,
5634
5634
  createdTimestamp: t.createdTimestamp
5635
- }), w = Hn.make({
5635
+ }), C = zn.make({
5636
5636
  ascender: x.ascender,
5637
5637
  descender: x.descender,
5638
5638
  advanceWidthMax: x.advanceWidthMax,
@@ -5640,7 +5640,7 @@ function pi(t) {
5640
5640
  minRightSideBearing: x.minRightSideBearing,
5641
5641
  xMaxExtent: x.maxLeftSideBearing + (x.xMax - x.xMin),
5642
5642
  numberOfHMetrics: t.glyphs.length
5643
- }), D = Vn.make(t.glyphs.length), L = Kt.make(Object.assign({
5643
+ }), D = qn.make(t.glyphs.length), L = Kt.make(Object.assign({
5644
5644
  xAvgCharWidth: Math.round(x.advanceWidthAvg),
5645
5645
  usFirstCharIndex: o,
5646
5646
  usLastCharIndex: l,
@@ -5665,13 +5665,13 @@ function pi(t) {
5665
5665
  // Use space as the default character, if available.
5666
5666
  usBreakChar: t.hasChar(" ") ? 32 : 0
5667
5667
  // Use space as the break character, if available.
5668
- }, t.tables.os2)), C = zn.make(t.glyphs), N = On.make(t.glyphs), j = t.getEnglishName("fontFamily"), K = t.getEnglishName("fontSubfamily"), re = j + " " + K, ne = t.getEnglishName("postScriptName");
5668
+ }, t.tables.os2)), w = Wn.make(t.glyphs), N = Un.make(t.glyphs), j = t.getEnglishName("fontFamily"), K = t.getEnglishName("fontSubfamily"), re = j + " " + K, ne = t.getEnglishName("postScriptName");
5669
5669
  ne || (ne = j.replace(/\s/g, "") + "-" + K);
5670
5670
  var G = {};
5671
5671
  for (var H in t.names)
5672
5672
  G[H] = t.names[H];
5673
5673
  G.uniqueID || (G.uniqueID = { en: t.getEnglishName("manufacturer") + ":" + re }), G.postScriptName || (G.postScriptName = { en: ne }), G.preferredFamily || (G.preferredFamily = t.names.fontFamily), G.preferredSubfamily || (G.preferredSubfamily = t.names.fontSubfamily);
5674
- var V = [], q = jn.make(G, V), X = V.length > 0 ? Wn.make(V) : void 0, z = Kn.make(), Z = Nn.make(t.glyphs, {
5674
+ var V = [], q = Kn.make(G, V), X = V.length > 0 ? Vn.make(V) : void 0, z = Qn.make(), Z = _n.make(t.glyphs, {
5675
5675
  version: t.getEnglishName("version"),
5676
5676
  fullName: re,
5677
5677
  familyName: j,
@@ -5679,18 +5679,18 @@ function pi(t) {
5679
5679
  postScriptName: ne,
5680
5680
  unitsPerEm: t.unitsPerEm,
5681
5681
  fontBBox: [0, x.yMin, x.ascender, x.advanceWidthMax]
5682
- }), M = t.metas && Object.keys(t.metas).length > 0 ? Jn.make(t.metas) : void 0, Y = [O, w, D, L, q, N, z, Z, C];
5683
- X && Y.push(X), t.tables.gsub && Y.push(Qn.make(t.tables.gsub)), M && Y.push(M);
5684
- for (var mt = $n(Y), pa = mt.encode(), da = ar(pa), xt = mt.fields, hr = !1, et = 0; et < xt.length; et += 1)
5685
- if (xt[et].name === "head table") {
5686
- xt[et].value.checkSumAdjustment = 2981146554 - da, hr = !0;
5682
+ }), M = t.metas && Object.keys(t.metas).length > 0 ? $n.make(t.metas) : void 0, Y = [O, C, D, L, q, N, z, Z, w];
5683
+ X && Y.push(X), t.tables.gsub && Y.push(Jn.make(t.tables.gsub)), M && Y.push(M);
5684
+ for (var xt = ea(Y), pa = xt.encode(), da = ar(pa), bt = xt.fields, fr = !1, tt = 0; tt < bt.length; tt += 1)
5685
+ if (bt[tt].name === "head table") {
5686
+ bt[tt].value.checkSumAdjustment = 2981146554 - da, fr = !0;
5687
5687
  break;
5688
5688
  }
5689
- if (!hr)
5689
+ if (!fr)
5690
5690
  throw new Error("Could not find head table with checkSum to adjust.");
5691
- return mt;
5691
+ return xt;
5692
5692
  }
5693
- var di = { make: $n, fontToTable: pi, computeCheckSum: ar };
5693
+ var di = { make: ea, fontToTable: pi, computeCheckSum: ar };
5694
5694
  function wt(t, e) {
5695
5695
  for (var r = 0, n = t.length - 1; r <= n; ) {
5696
5696
  var a = r + n >>> 1, s = t[a].tag;
@@ -5700,7 +5700,7 @@ function wt(t, e) {
5700
5700
  }
5701
5701
  return -r - 1;
5702
5702
  }
5703
- function Pr(t, e) {
5703
+ function Gr(t, e) {
5704
5704
  for (var r = 0, n = t.length - 1; r <= n; ) {
5705
5705
  var a = r + n >>> 1, s = t[a];
5706
5706
  if (s === e)
@@ -5709,7 +5709,7 @@ function Pr(t, e) {
5709
5709
  }
5710
5710
  return -r - 1;
5711
5711
  }
5712
- function Gr(t, e) {
5712
+ function Nr(t, e) {
5713
5713
  for (var r, n = 0, a = t.length - 1; n <= a; ) {
5714
5714
  var s = n + a >>> 1;
5715
5715
  r = t[s];
@@ -5721,10 +5721,10 @@ function Gr(t, e) {
5721
5721
  if (n > 0)
5722
5722
  return r = t[n - 1], e > r.end ? 0 : r;
5723
5723
  }
5724
- function je(t, e) {
5724
+ function Ke(t, e) {
5725
5725
  this.font = t, this.tableName = e;
5726
5726
  }
5727
- je.prototype = {
5727
+ Ke.prototype = {
5728
5728
  /**
5729
5729
  * Binary search an object by "tag" property
5730
5730
  * @instance
@@ -5744,7 +5744,7 @@ je.prototype = {
5744
5744
  * @param {number} value
5745
5745
  * @return {number}
5746
5746
  */
5747
- binSearch: Pr,
5747
+ binSearch: Gr,
5748
5748
  /**
5749
5749
  * Get or create the Layout table (GSUB, GPOS etc).
5750
5750
  * @param {boolean} create - Whether to create a new one.
@@ -5899,7 +5899,7 @@ je.prototype = {
5899
5899
  case 1:
5900
5900
  return t.startGlyph <= e && e < t.startGlyph + t.classes.length ? t.classes[e - t.startGlyph] : 0;
5901
5901
  case 2:
5902
- var r = Gr(t.ranges, e);
5902
+ var r = Nr(t.ranges, e);
5903
5903
  return r ? r.classId : 0;
5904
5904
  }
5905
5905
  },
@@ -5913,10 +5913,10 @@ je.prototype = {
5913
5913
  getCoverageIndex: function(t, e) {
5914
5914
  switch (t.format) {
5915
5915
  case 1:
5916
- var r = Pr(t.glyphs, e);
5916
+ var r = Gr(t.glyphs, e);
5917
5917
  return r >= 0 ? r : -1;
5918
5918
  case 2:
5919
- var n = Gr(t.ranges, e);
5919
+ var n = Nr(t.ranges, e);
5920
5920
  return n ? n.index + e - n.start : -1;
5921
5921
  }
5922
5922
  },
@@ -5937,15 +5937,15 @@ je.prototype = {
5937
5937
  return e;
5938
5938
  }
5939
5939
  };
5940
- function Ke(t) {
5941
- je.call(this, t, "gpos");
5940
+ function Qe(t) {
5941
+ Ke.call(this, t, "gpos");
5942
5942
  }
5943
- Ke.prototype = je.prototype;
5944
- Ke.prototype.init = function() {
5943
+ Qe.prototype = Ke.prototype;
5944
+ Qe.prototype.init = function() {
5945
5945
  var t = this.getDefaultScriptName();
5946
5946
  this.defaultKerningTables = this.getKerningTables(t);
5947
5947
  };
5948
- Ke.prototype.getKerningValue = function(t, e, r) {
5948
+ Qe.prototype.getKerningValue = function(t, e, r) {
5949
5949
  for (var n = 0; n < t.length; n++)
5950
5950
  for (var a = t[n].subtables, s = 0; s < a.length; s++) {
5951
5951
  var i = a[s], u = this.getCoverageIndex(i.coverage, e);
@@ -5965,12 +5965,12 @@ Ke.prototype.getKerningValue = function(t, e, r) {
5965
5965
  }
5966
5966
  return 0;
5967
5967
  };
5968
- Ke.prototype.getKerningTables = function(t, e) {
5968
+ Qe.prototype.getKerningTables = function(t, e) {
5969
5969
  if (this.font.tables.gpos)
5970
5970
  return this.getLookupTables(t, e, "kern", 2);
5971
5971
  };
5972
5972
  function ee(t) {
5973
- je.call(this, t, "gsub");
5973
+ Ke.call(this, t, "gsub");
5974
5974
  }
5975
5975
  function vi(t, e) {
5976
5976
  var r = t.length;
@@ -5990,7 +5990,7 @@ function sr(t, e, r) {
5990
5990
  if (r)
5991
5991
  return n.push(r), r;
5992
5992
  }
5993
- ee.prototype = je.prototype;
5993
+ ee.prototype = Ke.prototype;
5994
5994
  ee.prototype.createDefaultTable = function() {
5995
5995
  return {
5996
5996
  version: 1,
@@ -6152,11 +6152,11 @@ function Ne(t, e) {
6152
6152
  if (!t)
6153
6153
  throw e;
6154
6154
  }
6155
- function Nr(t, e, r, n, a) {
6155
+ function _r(t, e, r, n, a) {
6156
6156
  var s;
6157
6157
  return (e & n) > 0 ? (s = t.parseByte(), e & a || (s = -s), s = r + s) : (e & a) > 0 ? s = r : s = r + t.parseShort(), s;
6158
6158
  }
6159
- function ea(t, e, r) {
6159
+ function ta(t, e, r) {
6160
6160
  var n = new F.Parser(e, r);
6161
6161
  t.numberOfContours = n.parseShort(), t._xMin = n.parseShort(), t._yMin = n.parseShort(), t._xMax = n.parseShort(), t._yMax = n.parseShort();
6162
6162
  var a, s;
@@ -6178,9 +6178,9 @@ function ea(t, e, r) {
6178
6178
  for (var g = 0; g < l; g += 1)
6179
6179
  s = a[g], d = {}, d.onCurve = !!(s & 1), d.lastPointOfContour = i.indexOf(g) >= 0, f.push(d);
6180
6180
  for (var y = 0, m = 0; m < l; m += 1)
6181
- s = a[m], d = f[m], d.x = Nr(n, s, y, 2, 16), y = d.x;
6181
+ s = a[m], d = f[m], d.x = _r(n, s, y, 2, 16), y = d.x;
6182
6182
  for (var S = 0, x = 0; x < l; x += 1)
6183
- s = a[x], d = f[x], d.y = Nr(n, s, S, 4, 32), S = d.y;
6183
+ s = a[x], d = f[x], d.y = _r(n, s, S, 4, 32), S = d.y;
6184
6184
  }
6185
6185
  t.points = f;
6186
6186
  } else
@@ -6191,7 +6191,7 @@ function ea(t, e, r) {
6191
6191
  t.isComposite = !0, t.points = [], t.components = [];
6192
6192
  for (var O = !0; O; ) {
6193
6193
  a = n.parseUShort();
6194
- var w = {
6194
+ var C = {
6195
6195
  glyphIndex: n.parseUShort(),
6196
6196
  xScale: 1,
6197
6197
  scale01: 0,
@@ -6200,7 +6200,7 @@ function ea(t, e, r) {
6200
6200
  dx: 0,
6201
6201
  dy: 0
6202
6202
  };
6203
- (a & 1) > 0 ? (a & 2) > 0 ? (w.dx = n.parseShort(), w.dy = n.parseShort()) : w.matchedPoints = [n.parseUShort(), n.parseUShort()] : (a & 2) > 0 ? (w.dx = n.parseChar(), w.dy = n.parseChar()) : w.matchedPoints = [n.parseByte(), n.parseByte()], (a & 8) > 0 ? w.xScale = w.yScale = n.parseF2Dot14() : (a & 64) > 0 ? (w.xScale = n.parseF2Dot14(), w.yScale = n.parseF2Dot14()) : (a & 128) > 0 && (w.xScale = n.parseF2Dot14(), w.scale01 = n.parseF2Dot14(), w.scale10 = n.parseF2Dot14(), w.yScale = n.parseF2Dot14()), t.components.push(w), O = !!(a & 32);
6203
+ (a & 1) > 0 ? (a & 2) > 0 ? (C.dx = n.parseShort(), C.dy = n.parseShort()) : C.matchedPoints = [n.parseUShort(), n.parseUShort()] : (a & 2) > 0 ? (C.dx = n.parseChar(), C.dy = n.parseChar()) : C.matchedPoints = [n.parseByte(), n.parseByte()], (a & 8) > 0 ? C.xScale = C.yScale = n.parseF2Dot14() : (a & 64) > 0 ? (C.xScale = n.parseF2Dot14(), C.yScale = n.parseF2Dot14()) : (a & 128) > 0 && (C.xScale = n.parseF2Dot14(), C.scale01 = n.parseF2Dot14(), C.scale10 = n.parseF2Dot14(), C.yScale = n.parseF2Dot14()), t.components.push(C), O = !!(a & 32);
6204
6204
  }
6205
6205
  if (a & 256) {
6206
6206
  t.instructionLength = n.parseUShort(), t.instructions = [];
@@ -6209,7 +6209,7 @@ function ea(t, e, r) {
6209
6209
  }
6210
6210
  }
6211
6211
  }
6212
- function Ct(t, e) {
6212
+ function Et(t, e) {
6213
6213
  for (var r = [], n = 0; n < t.length; n += 1) {
6214
6214
  var a = t[n], s = {
6215
6215
  x: e.xScale * a.x + e.scale01 * a.y + e.dx,
@@ -6228,7 +6228,7 @@ function mi(t) {
6228
6228
  }
6229
6229
  return E.argument(r.length === 0, "There are still points left in the current contour."), e;
6230
6230
  }
6231
- function ta(t) {
6231
+ function ra(t) {
6232
6232
  var e = new _();
6233
6233
  if (!t)
6234
6234
  return e;
@@ -6253,14 +6253,14 @@ function ta(t) {
6253
6253
  }
6254
6254
  return e;
6255
6255
  }
6256
- function ra(t, e) {
6256
+ function na(t, e) {
6257
6257
  if (e.isComposite)
6258
6258
  for (var r = 0; r < e.components.length; r += 1) {
6259
6259
  var n = e.components[r], a = t.get(n.glyphIndex);
6260
6260
  if (a.getPath(), a.points) {
6261
6261
  var s = void 0;
6262
6262
  if (n.matchedPoints === void 0)
6263
- s = Ct(a.points, n);
6263
+ s = Et(a.points, n);
6264
6264
  else {
6265
6265
  if (n.matchedPoints[0] > e.points.length - 1 || n.matchedPoints[1] > a.points.length - 1)
6266
6266
  throw Error("Matched points out of range in " + e.name);
@@ -6272,17 +6272,17 @@ function ra(t, e) {
6272
6272
  dx: 0,
6273
6273
  dy: 0
6274
6274
  };
6275
- u = Ct([u], o)[0], o.dx = i.x - u.x, o.dy = i.y - u.y, s = Ct(a.points, o);
6275
+ u = Et([u], o)[0], o.dx = i.x - u.x, o.dy = i.y - u.y, s = Et(a.points, o);
6276
6276
  }
6277
6277
  e.points = e.points.concat(s);
6278
6278
  }
6279
6279
  }
6280
- return ta(e.points);
6280
+ return ra(e.points);
6281
6281
  }
6282
6282
  function xi(t, e, r, n) {
6283
6283
  for (var a = new de.GlyphSet(n), s = 0; s < r.length - 1; s += 1) {
6284
6284
  var i = r[s], u = r[s + 1];
6285
- i !== u ? a.push(s, de.ttfGlyphLoader(n, s, ea, t, e + i, ra)) : a.push(s, de.glyphLoader(n, s));
6285
+ i !== u ? a.push(s, de.ttfGlyphLoader(n, s, ta, t, e + i, na)) : a.push(s, de.glyphLoader(n, s));
6286
6286
  }
6287
6287
  return a;
6288
6288
  }
@@ -6290,22 +6290,22 @@ function bi(t, e, r, n) {
6290
6290
  var a = new de.GlyphSet(n);
6291
6291
  return n._push = function(s) {
6292
6292
  var i = r[s], u = r[s + 1];
6293
- i !== u ? a.push(s, de.ttfGlyphLoader(n, s, ea, t, e + i, ra)) : a.push(s, de.glyphLoader(n, s));
6293
+ i !== u ? a.push(s, de.ttfGlyphLoader(n, s, ta, t, e + i, na)) : a.push(s, de.glyphLoader(n, s));
6294
6294
  }, a;
6295
6295
  }
6296
6296
  function Si(t, e, r, n, a) {
6297
6297
  return a.lowMemory ? bi(t, e, r, n) : xi(t, e, r, n);
6298
6298
  }
6299
- var na = { getPath: ta, parse: Si }, aa, Le, sa, Qt;
6300
- function ia(t) {
6299
+ var aa = { getPath: ra, parse: Si }, sa, Le, ia, Qt;
6300
+ function oa(t) {
6301
6301
  this.font = t, this.getCommands = function(e) {
6302
- return na.getPath(e).commands;
6302
+ return aa.getPath(e).commands;
6303
6303
  }, this._fpgmState = this._prepState = void 0, this._errorState = 0;
6304
6304
  }
6305
6305
  function ki(t) {
6306
6306
  return t;
6307
6307
  }
6308
- function oa(t) {
6308
+ function ua(t) {
6309
6309
  return Math.sign(t) * Math.round(Math.abs(t));
6310
6310
  }
6311
6311
  function Ti(t) {
@@ -6314,13 +6314,13 @@ function Ti(t) {
6314
6314
  function Fi(t) {
6315
6315
  return Math.sign(t) * (Math.round(Math.abs(t) + 0.5) - 0.5);
6316
6316
  }
6317
- function wi(t) {
6317
+ function Ci(t) {
6318
6318
  return Math.sign(t) * Math.ceil(Math.abs(t));
6319
6319
  }
6320
- function Ci(t) {
6320
+ function wi(t) {
6321
6321
  return Math.sign(t) * Math.floor(Math.abs(t));
6322
6322
  }
6323
- var ua = function(t) {
6323
+ var la = function(t) {
6324
6324
  var e = this.srPeriod, r = this.srPhase, n = this.srThreshold, a = 1;
6325
6325
  return t < 0 && (t = -t, a = -1), t += n - r, t = Math.trunc(t / e) * e, t += r, t < 0 ? r * a : t * a;
6326
6326
  }, pe = {
@@ -6454,13 +6454,13 @@ var ua = function(t) {
6454
6454
  };
6455
6455
  Object.freeze(pe);
6456
6456
  Object.freeze(ve);
6457
- function Qe(t, e) {
6457
+ function Je(t, e) {
6458
6458
  this.x = t, this.y = e, this.axis = void 0, this.slope = e / t, this.normalSlope = -t / e, Object.freeze(this);
6459
6459
  }
6460
- Qe.prototype.distance = function(t, e, r, n) {
6460
+ Je.prototype.distance = function(t, e, r, n) {
6461
6461
  return this.x * pe.distance(t, e, r, n) + this.y * ve.distance(t, e, r, n);
6462
6462
  };
6463
- Qe.prototype.interpolate = function(t, e, r, n) {
6463
+ Je.prototype.interpolate = function(t, e, r, n) {
6464
6464
  var a, s, i, u, o, l, c;
6465
6465
  if (i = n.distance(t, e, !0, !0), u = n.distance(t, r, !0, !0), a = n.distance(e, e, !1, !0), s = n.distance(r, r, !1, !0), o = Math.abs(i), l = Math.abs(u), c = o + l, c === 0) {
6466
6466
  this.setRelative(t, t, (a + s) / 2, n, !0);
@@ -6468,17 +6468,17 @@ Qe.prototype.interpolate = function(t, e, r, n) {
6468
6468
  }
6469
6469
  this.setRelative(t, t, (a * l + s * o) / c, n, !0);
6470
6470
  };
6471
- Qe.prototype.setRelative = function(t, e, r, n, a) {
6471
+ Je.prototype.setRelative = function(t, e, r, n, a) {
6472
6472
  n = n || this;
6473
6473
  var s = a ? e.xo : e.x, i = a ? e.yo : e.y, u = s + r * n.x, o = i + r * n.y, l = n.normalSlope, c = this.slope, p = t.x, h = t.y;
6474
6474
  t.x = (c * p - l * u + o - h) / (c - l), t.y = c * (t.x - p) + h;
6475
6475
  };
6476
- Qe.prototype.touch = function(t) {
6476
+ Je.prototype.touch = function(t) {
6477
6477
  t.xTouched = !0, t.yTouched = !0;
6478
6478
  };
6479
- function Je(t, e) {
6479
+ function $e(t, e) {
6480
6480
  var r = Math.sqrt(t * t + e * e);
6481
- return t /= r, e /= r, t === 1 && e === 0 ? pe : t === 0 && e === 1 ? ve : new Qe(t, e);
6481
+ return t /= r, e /= r, t === 1 && e === 0 ? pe : t === 0 && e === 1 ? ve : new Je(t, e);
6482
6482
  }
6483
6483
  function ge(t, e, r, n) {
6484
6484
  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);
@@ -6493,7 +6493,7 @@ ge.prototype.prevTouched = function(t) {
6493
6493
  e = e.prevPointOnContour;
6494
6494
  return e;
6495
6495
  };
6496
- var Xe = Object.freeze(new ge(0, 0)), Ei = {
6496
+ var Ye = Object.freeze(new ge(0, 0)), Ei = {
6497
6497
  cvCutIn: 17 / 16,
6498
6498
  // control value cut in
6499
6499
  deltaBase: 9,
@@ -6509,10 +6509,10 @@ function be(t, e) {
6509
6509
  case "glyf":
6510
6510
  this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
6511
6511
  case "prep":
6512
- this.fv = this.pv = this.dpv = pe, this.round = oa;
6512
+ this.fv = this.pv = this.dpv = pe, this.round = ua;
6513
6513
  }
6514
6514
  }
6515
- ia.prototype.exec = function(t, e) {
6515
+ oa.prototype.exec = function(t, e) {
6516
6516
  if (typeof e != "number")
6517
6517
  throw new Error("Point size is not a number!");
6518
6518
  if (!(this._errorState > 2)) {
@@ -6544,14 +6544,14 @@ ia.prototype.exec = function(t, e) {
6544
6544
  }
6545
6545
  if (!(this._errorState > 1))
6546
6546
  try {
6547
- return sa(t, n);
6547
+ return ia(t, n);
6548
6548
  } catch (l) {
6549
6549
  this._errorState < 1 && (console.log("Hinting error:" + l), console.log("Note: further hinting errors are silenced")), this._errorState = 1;
6550
6550
  return;
6551
6551
  }
6552
6552
  }
6553
6553
  };
6554
- sa = function(t, e) {
6554
+ ia = function(t, e) {
6555
6555
  var r = e.ppem / e.font.unitsPerEm, n = r, a = t.components, s, i, u;
6556
6556
  if (be.prototype = e, !a)
6557
6557
  u = new be("glyf", t.instructions), exports.DEBUG && (console.log("---EXEC GLYPH---"), u.step = -1), Qt(t, u, r, n), i = u.gZone;
@@ -6608,7 +6608,7 @@ Le = function(t) {
6608
6608
  if (e) {
6609
6609
  var r = e.length, n;
6610
6610
  for (t.ip = 0; t.ip < r; t.ip++) {
6611
- if (exports.DEBUG && t.step++, n = aa[e[t.ip]], !n)
6611
+ if (exports.DEBUG && t.step++, n = sa[e[t.ip]], !n)
6612
6612
  throw new Error(
6613
6613
  "unknown instruction: 0x" + Number(e[t.ip]).toString(16)
6614
6614
  );
@@ -6616,11 +6616,11 @@ Le = function(t) {
6616
6616
  }
6617
6617
  }
6618
6618
  };
6619
- function vt(t) {
6619
+ function gt(t) {
6620
6620
  for (var e = t.tZone = new Array(t.gZone.length), r = 0; r < e.length; r++)
6621
6621
  e[r] = new ge(0, 0);
6622
6622
  }
6623
- function la(t, e) {
6623
+ function ca(t, e) {
6624
6624
  var r = t.prog, n = t.ip, a = 1, s;
6625
6625
  do
6626
6626
  if (s = r[++n], s === 88)
@@ -6640,34 +6640,34 @@ function la(t, e) {
6640
6640
  while (a > 0);
6641
6641
  t.ip = n;
6642
6642
  }
6643
- function _r(t, e) {
6643
+ function Hr(t, e) {
6644
6644
  exports.DEBUG && console.log(e.step, "SVTCA[" + t.axis + "]"), e.fv = e.pv = e.dpv = t;
6645
6645
  }
6646
- function Hr(t, e) {
6646
+ function zr(t, e) {
6647
6647
  exports.DEBUG && console.log(e.step, "SPVTCA[" + t.axis + "]"), e.pv = e.dpv = t;
6648
6648
  }
6649
- function zr(t, e) {
6649
+ function Wr(t, e) {
6650
6650
  exports.DEBUG && console.log(e.step, "SFVTCA[" + t.axis + "]"), e.fv = t;
6651
6651
  }
6652
- function Wr(t, e) {
6652
+ function Vr(t, e) {
6653
6653
  var r = e.stack, n = r.pop(), a = r.pop(), s = e.z2[n], i = e.z1[a];
6654
6654
  exports.DEBUG && console.log("SPVTL[" + t + "]", n, a);
6655
6655
  var u, o;
6656
- t ? (u = s.y - i.y, o = i.x - s.x) : (u = i.x - s.x, o = i.y - s.y), e.pv = e.dpv = Je(u, o);
6656
+ t ? (u = s.y - i.y, o = i.x - s.x) : (u = i.x - s.x, o = i.y - s.y), e.pv = e.dpv = $e(u, o);
6657
6657
  }
6658
- function Vr(t, e) {
6658
+ function qr(t, e) {
6659
6659
  var r = e.stack, n = r.pop(), a = r.pop(), s = e.z2[n], i = e.z1[a];
6660
6660
  exports.DEBUG && console.log("SFVTL[" + t + "]", n, a);
6661
6661
  var u, o;
6662
- t ? (u = s.y - i.y, o = i.x - s.x) : (u = i.x - s.x, o = i.y - s.y), e.fv = Je(u, o);
6662
+ t ? (u = s.y - i.y, o = i.x - s.x) : (u = i.x - s.x, o = i.y - s.y), e.fv = $e(u, o);
6663
6663
  }
6664
6664
  function Oi(t) {
6665
6665
  var e = t.stack, r = e.pop(), n = e.pop();
6666
- exports.DEBUG && console.log(t.step, "SPVFS[]", r, n), t.pv = t.dpv = Je(n, r);
6666
+ exports.DEBUG && console.log(t.step, "SPVFS[]", r, n), t.pv = t.dpv = $e(n, r);
6667
6667
  }
6668
6668
  function Ui(t) {
6669
6669
  var e = t.stack, r = e.pop(), n = e.pop();
6670
- exports.DEBUG && console.log(t.step, "SPVFS[]", r, n), t.fv = Je(n, r);
6670
+ exports.DEBUG && console.log(t.step, "SPVFS[]", r, n), t.fv = $e(n, r);
6671
6671
  }
6672
6672
  function Li(t) {
6673
6673
  var e = t.stack, r = t.pv;
@@ -6683,8 +6683,8 @@ function Ai(t) {
6683
6683
  function Di(t) {
6684
6684
  var e = t.stack, r = e.pop(), n = e.pop(), a = e.pop(), s = e.pop(), i = e.pop(), u = t.z0, o = t.z1, l = u[r], c = u[n], p = o[a], h = o[s], f = t.z2[i];
6685
6685
  exports.DEBUG && console.log("ISECT[], ", r, n, a, s, i);
6686
- var d = l.x, g = l.y, y = c.x, m = c.y, S = p.x, x = p.y, O = h.x, w = h.y, D = (d - y) * (x - w) - (g - m) * (S - O), L = d * m - g * y, C = S * w - x * O;
6687
- f.x = (L * (S - O) - C * (d - y)) / D, f.y = (L * (x - w) - C * (g - m)) / D;
6686
+ var d = l.x, g = l.y, y = c.x, m = c.y, S = p.x, x = p.y, O = h.x, C = h.y, D = (d - y) * (x - C) - (g - m) * (S - O), L = d * m - g * y, w = S * C - x * O;
6687
+ f.x = (L * (S - O) - w * (d - y)) / D, f.y = (L * (x - C) - w * (g - m)) / D;
6688
6688
  }
6689
6689
  function Mi(t) {
6690
6690
  t.rp0 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP0[]", t.rp0);
@@ -6692,14 +6692,14 @@ function Mi(t) {
6692
6692
  function Bi(t) {
6693
6693
  t.rp1 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP1[]", t.rp1);
6694
6694
  }
6695
- function Ii(t) {
6695
+ function Pi(t) {
6696
6696
  t.rp2 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP2[]", t.rp2);
6697
6697
  }
6698
- function Pi(t) {
6698
+ function Ii(t) {
6699
6699
  var e = t.stack.pop();
6700
6700
  switch (exports.DEBUG && console.log(t.step, "SZP0[]", e), t.zp0 = e, e) {
6701
6701
  case 0:
6702
- t.tZone || vt(t), t.z0 = t.tZone;
6702
+ t.tZone || gt(t), t.z0 = t.tZone;
6703
6703
  break;
6704
6704
  case 1:
6705
6705
  t.z0 = t.gZone;
@@ -6712,7 +6712,7 @@ function Gi(t) {
6712
6712
  var e = t.stack.pop();
6713
6713
  switch (exports.DEBUG && console.log(t.step, "SZP1[]", e), t.zp1 = e, e) {
6714
6714
  case 0:
6715
- t.tZone || vt(t), t.z1 = t.tZone;
6715
+ t.tZone || gt(t), t.z1 = t.tZone;
6716
6716
  break;
6717
6717
  case 1:
6718
6718
  t.z1 = t.gZone;
@@ -6725,7 +6725,7 @@ function Ni(t) {
6725
6725
  var e = t.stack.pop();
6726
6726
  switch (exports.DEBUG && console.log(t.step, "SZP2[]", e), t.zp2 = e, e) {
6727
6727
  case 0:
6728
- t.tZone || vt(t), t.z2 = t.tZone;
6728
+ t.tZone || gt(t), t.z2 = t.tZone;
6729
6729
  break;
6730
6730
  case 1:
6731
6731
  t.z2 = t.gZone;
@@ -6738,7 +6738,7 @@ function _i(t) {
6738
6738
  var e = t.stack.pop();
6739
6739
  switch (exports.DEBUG && console.log(t.step, "SZPS[]", e), t.zp0 = t.zp1 = t.zp2 = e, e) {
6740
6740
  case 0:
6741
- t.tZone || vt(t), t.z0 = t.z1 = t.z2 = t.tZone;
6741
+ t.tZone || gt(t), t.z0 = t.z1 = t.z2 = t.tZone;
6742
6742
  break;
6743
6743
  case 1:
6744
6744
  t.z0 = t.z1 = t.z2 = t.gZone;
@@ -6751,7 +6751,7 @@ function Hi(t) {
6751
6751
  t.loop = t.stack.pop(), exports.DEBUG && console.log(t.step, "SLOOP[]", t.loop);
6752
6752
  }
6753
6753
  function zi(t) {
6754
- exports.DEBUG && console.log(t.step, "RTG[]"), t.round = oa;
6754
+ exports.DEBUG && console.log(t.step, "RTG[]"), t.round = ua;
6755
6755
  }
6756
6756
  function Wi(t) {
6757
6757
  exports.DEBUG && console.log(t.step, "RTHG[]"), t.round = Fi;
@@ -6761,7 +6761,7 @@ function Vi(t) {
6761
6761
  exports.DEBUG && console.log(t.step, "SMD[]", e), t.minDis = e / 64;
6762
6762
  }
6763
6763
  function qi(t) {
6764
- exports.DEBUG && console.log(t.step, "ELSE[]"), la(t, !1);
6764
+ exports.DEBUG && console.log(t.step, "ELSE[]"), ca(t, !1);
6765
6765
  }
6766
6766
  function Xi(t) {
6767
6767
  var e = t.stack.pop();
@@ -6775,7 +6775,7 @@ function Zi(t) {
6775
6775
  var e = t.stack;
6776
6776
  exports.DEBUG && console.log(t.step, "DUP[]"), e.push(e[e.length - 1]);
6777
6777
  }
6778
- function Et(t) {
6778
+ function Ot(t) {
6779
6779
  exports.DEBUG && console.log(t.step, "POP[]"), t.stack.pop();
6780
6780
  }
6781
6781
  function ji(t) {
@@ -6824,19 +6824,19 @@ function ro(t) {
6824
6824
  ;
6825
6825
  t.ip = n, t.funcs[a] = r.slice(s + 1, n);
6826
6826
  }
6827
- function qr(t, e) {
6827
+ function Xr(t, e) {
6828
6828
  var r = e.stack.pop(), n = e.z0[r], a = e.fv, s = e.pv;
6829
6829
  exports.DEBUG && console.log(e.step, "MDAP[" + t + "]", r);
6830
- var i = s.distance(n, Xe);
6831
- t && (i = e.round(i)), a.setRelative(n, Xe, i, s), a.touch(n), e.rp0 = e.rp1 = r;
6830
+ var i = s.distance(n, Ye);
6831
+ t && (i = e.round(i)), a.setRelative(n, Ye, i, s), a.touch(n), e.rp0 = e.rp1 = r;
6832
6832
  }
6833
- function Xr(t, e) {
6833
+ function Yr(t, e) {
6834
6834
  var r = e.z2, n = r.length - 2, a, s, i;
6835
6835
  exports.DEBUG && console.log(e.step, "IUP[" + t.axis + "]");
6836
6836
  for (var u = 0; u < n; u++)
6837
6837
  a = r[u], !t.touched(a) && (s = a.prevTouched(t), s !== a && (i = a.nextTouched(t), s === i && t.setRelative(a, a, t.distance(s, s, !1, !0), t, !0), t.interpolate(a, s, i, t)));
6838
6838
  }
6839
- function Yr(t, e) {
6839
+ function Zr(t, e) {
6840
6840
  for (var r = e.stack, n = t ? e.rp1 : e.rp2, a = (t ? e.z0 : e.z1)[n], s = e.fv, i = e.pv, u = e.loop, o = e.z2; u--; ) {
6841
6841
  var l = r.pop(), c = o[l], p = i.distance(a, a, !1, !0);
6842
6842
  s.setRelative(c, c, p, i), s.touch(c), exports.DEBUG && console.log(
@@ -6847,7 +6847,7 @@ function Yr(t, e) {
6847
6847
  }
6848
6848
  e.loop = 1;
6849
6849
  }
6850
- function Zr(t, e) {
6850
+ function jr(t, e) {
6851
6851
  var r = e.stack, n = t ? e.rp1 : e.rp2, a = (t ? e.z0 : e.z1)[n], s = e.fv, i = e.pv, u = r.pop(), o = e.z2[e.contours[u]], l = o;
6852
6852
  exports.DEBUG && console.log(e.step, "SHC[" + t + "]", u);
6853
6853
  var c = i.distance(a, a, !1, !0);
@@ -6855,7 +6855,7 @@ function Zr(t, e) {
6855
6855
  l !== a && s.setRelative(l, l, c, i), l = l.nextPointOnContour;
6856
6856
  while (l !== o);
6857
6857
  }
6858
- function jr(t, e) {
6858
+ function Kr(t, e) {
6859
6859
  var r = e.stack, n = t ? e.rp1 : e.rp2, a = (t ? e.z0 : e.z1)[n], s = e.fv, i = e.pv, u = r.pop();
6860
6860
  exports.DEBUG && console.log(e.step, "SHZ[" + t + "]", u);
6861
6861
  var o;
@@ -6898,7 +6898,7 @@ function ao(t) {
6898
6898
  }
6899
6899
  t.loop = 1;
6900
6900
  }
6901
- function Kr(t, e) {
6901
+ function Qr(t, e) {
6902
6902
  var r = e.stack, n = r.pop() / 64, a = r.pop(), s = e.z1[a], i = e.z0[e.rp0], u = e.fv, o = e.pv;
6903
6903
  u.setRelative(s, i, n, o), u.touch(s), exports.DEBUG && console.log(e.step, "MSIRP[" + t + "]", n, a), e.rp1 = e.rp0, e.rp2 = a, t && (e.rp0 = a);
6904
6904
  }
@@ -6916,7 +6916,7 @@ function so(t) {
6916
6916
  function io(t) {
6917
6917
  exports.DEBUG && console.log(t.step, "RTDG[]"), t.round = Ti;
6918
6918
  }
6919
- function Qr(t, e) {
6919
+ function Jr(t, e) {
6920
6920
  var r = e.stack, n = r.pop(), a = r.pop(), s = e.z0[a], i = e.fv, u = e.pv, o = e.cvt[n];
6921
6921
  exports.DEBUG && console.log(
6922
6922
  e.step,
@@ -6927,8 +6927,8 @@ function Qr(t, e) {
6927
6927
  ")",
6928
6928
  a
6929
6929
  );
6930
- var l = u.distance(s, Xe);
6931
- t && (Math.abs(l - o) < e.cvCutIn && (l = o), l = e.round(l)), i.setRelative(s, Xe, l, u), e.zp0 === 0 && (s.xo = s.x, s.yo = s.y), i.touch(s), e.rp0 = e.rp1 = a;
6930
+ var l = u.distance(s, Ye);
6931
+ t && (Math.abs(l - o) < e.cvCutIn && (l = o), l = e.round(l)), i.setRelative(s, Ye, l, u), e.zp0 === 0 && (s.xo = s.x, s.yo = s.y), i.touch(s), e.rp0 = e.rp1 = a;
6932
6932
  }
6933
6933
  function oo(t) {
6934
6934
  var e = t.prog, r = t.ip, n = t.stack, a = e[++r];
@@ -6966,11 +6966,11 @@ function fo(t) {
6966
6966
  var e = t.stack, r = e.pop();
6967
6967
  exports.DEBUG && console.log(t.step, "RCVT", r), e.push(t.cvt[r] * 64);
6968
6968
  }
6969
- function Jr(t, e) {
6969
+ function $r(t, e) {
6970
6970
  var r = e.stack, n = r.pop(), a = e.z2[n];
6971
- exports.DEBUG && console.log(e.step, "GC[" + t + "]", n), r.push(e.dpv.distance(a, Xe, t, !1) * 64);
6971
+ exports.DEBUG && console.log(e.step, "GC[" + t + "]", n), r.push(e.dpv.distance(a, Ye, t, !1) * 64);
6972
6972
  }
6973
- function $r(t, e) {
6973
+ function en(t, e) {
6974
6974
  var r = e.stack, n = r.pop(), a = r.pop(), s = e.z1[n], i = e.z0[a], u = e.dpv.distance(i, s, t, t);
6975
6975
  exports.DEBUG && console.log(e.step, "MD[" + t + "]", n, a, "->", u), e.stack.push(Math.round(u * 64));
6976
6976
  }
@@ -7014,12 +7014,12 @@ function To(t) {
7014
7014
  }
7015
7015
  function Fo(t) {
7016
7016
  var e = t.stack.pop();
7017
- exports.DEBUG && console.log(t.step, "IF[]", e), e || (la(t, !0), exports.DEBUG && console.log(t.step, "EIF[]"));
7017
+ exports.DEBUG && console.log(t.step, "IF[]", e), e || (ca(t, !0), exports.DEBUG && console.log(t.step, "EIF[]"));
7018
7018
  }
7019
- function wo(t) {
7019
+ function Co(t) {
7020
7020
  exports.DEBUG && console.log(t.step, "EIF[]");
7021
7021
  }
7022
- function Co(t) {
7022
+ function wo(t) {
7023
7023
  var e = t.stack, r = e.pop(), n = e.pop();
7024
7024
  exports.DEBUG && console.log(t.step, "AND[]", r, n), e.push(r && n ? 1 : 0);
7025
7025
  }
@@ -7031,7 +7031,7 @@ function Oo(t) {
7031
7031
  var e = t.stack, r = e.pop();
7032
7032
  exports.DEBUG && console.log(t.step, "NOT[]", r), e.push(r ? 0 : 1);
7033
7033
  }
7034
- function Ot(t, e) {
7034
+ function Ut(t, e) {
7035
7035
  var r = e.stack, n = r.pop(), a = e.fv, s = e.pv, i = e.ppem, u = e.deltaBase + (t - 1) * 16, o = e.deltaShift, l = e.z0;
7036
7036
  exports.DEBUG && console.log(e.step, "DELTAP[" + t + "]", n, r);
7037
7037
  for (var c = 0; c < n; c++) {
@@ -7072,11 +7072,11 @@ function Bo(t) {
7072
7072
  var e = t.stack, r = e.pop();
7073
7073
  exports.DEBUG && console.log(t.step, "ABS[]", r), e.push(Math.abs(r));
7074
7074
  }
7075
- function Io(t) {
7075
+ function Po(t) {
7076
7076
  var e = t.stack, r = e.pop();
7077
7077
  exports.DEBUG && console.log(t.step, "NEG[]", r), e.push(-r);
7078
7078
  }
7079
- function Po(t) {
7079
+ function Io(t) {
7080
7080
  var e = t.stack, r = e.pop();
7081
7081
  exports.DEBUG && console.log(t.step, "FLOOR[]", r), e.push(Math.floor(r / 64) * 64);
7082
7082
  }
@@ -7084,7 +7084,7 @@ function Go(t) {
7084
7084
  var e = t.stack, r = e.pop();
7085
7085
  exports.DEBUG && console.log(t.step, "CEILING[]", r), e.push(Math.ceil(r / 64) * 64);
7086
7086
  }
7087
- function st(t, e) {
7087
+ function it(t, e) {
7088
7088
  var r = e.stack, n = r.pop();
7089
7089
  exports.DEBUG && console.log(e.step, "ROUND[]"), r.push(e.round(n / 64) * 64);
7090
7090
  }
@@ -7092,7 +7092,7 @@ function No(t) {
7092
7092
  var e = t.stack, r = e.pop(), n = e.pop();
7093
7093
  exports.DEBUG && console.log(t.step, "WCVTF[]", r, n), t.cvt[n] = r * t.ppem / t.font.unitsPerEm;
7094
7094
  }
7095
- function Ut(t, e) {
7095
+ function Lt(t, e) {
7096
7096
  var r = e.stack, n = r.pop(), a = e.ppem, s = e.deltaBase + (t - 1) * 16, i = e.deltaShift;
7097
7097
  exports.DEBUG && console.log(e.step, "DELTAC[" + t + "]", n, r);
7098
7098
  for (var u = 0; u < n; u++) {
@@ -7107,7 +7107,7 @@ function Ut(t, e) {
7107
7107
  }
7108
7108
  function _o(t) {
7109
7109
  var e = t.stack.pop();
7110
- exports.DEBUG && console.log(t.step, "SROUND[]", e), t.round = ua;
7110
+ exports.DEBUG && console.log(t.step, "SROUND[]", e), t.round = la;
7111
7111
  var r;
7112
7112
  switch (e & 192) {
7113
7113
  case 0:
@@ -7142,7 +7142,7 @@ function _o(t) {
7142
7142
  }
7143
7143
  function Ho(t) {
7144
7144
  var e = t.stack.pop();
7145
- exports.DEBUG && console.log(t.step, "S45ROUND[]", e), t.round = ua;
7145
+ exports.DEBUG && console.log(t.step, "S45ROUND[]", e), t.round = la;
7146
7146
  var r;
7147
7147
  switch (e & 192) {
7148
7148
  case 0:
@@ -7179,20 +7179,20 @@ function zo(t) {
7179
7179
  exports.DEBUG && console.log(t.step, "ROFF[]"), t.round = ki;
7180
7180
  }
7181
7181
  function Wo(t) {
7182
- exports.DEBUG && console.log(t.step, "RUTG[]"), t.round = wi;
7182
+ exports.DEBUG && console.log(t.step, "RUTG[]"), t.round = Ci;
7183
7183
  }
7184
7184
  function Vo(t) {
7185
- exports.DEBUG && console.log(t.step, "RDTG[]"), t.round = Ci;
7185
+ exports.DEBUG && console.log(t.step, "RDTG[]"), t.round = wi;
7186
7186
  }
7187
7187
  function qo(t) {
7188
7188
  var e = t.stack.pop();
7189
7189
  exports.DEBUG && console.log(t.step, "SCANCTRL[]", e);
7190
7190
  }
7191
- function en(t, e) {
7191
+ function tn(t, e) {
7192
7192
  var r = e.stack, n = r.pop(), a = r.pop(), s = e.z2[n], i = e.z1[a];
7193
7193
  exports.DEBUG && console.log(e.step, "SDPVTL[" + t + "]", n, a);
7194
7194
  var u, o;
7195
- t ? (u = s.y - i.y, o = i.x - s.x) : (u = i.x - s.x, o = i.y - s.y), e.dpv = Je(u, o);
7195
+ t ? (u = s.y - i.y, o = i.x - s.x) : (u = i.x - s.x, o = i.y - s.y), e.dpv = $e(u, o);
7196
7196
  }
7197
7197
  function Xo(t) {
7198
7198
  var e = t.stack, r = e.pop(), n = 0;
@@ -7257,27 +7257,27 @@ function T(t, e, r, n, a, s) {
7257
7257
  ")"
7258
7258
  ), s.rp1 = s.rp0, s.rp2 = o, e && (s.rp0 = o);
7259
7259
  }
7260
- aa = [
7260
+ sa = [
7261
7261
  /* 0x00 */
7262
- _r.bind(void 0, ve),
7262
+ Hr.bind(void 0, ve),
7263
7263
  /* 0x01 */
7264
- _r.bind(void 0, pe),
7264
+ Hr.bind(void 0, pe),
7265
7265
  /* 0x02 */
7266
- Hr.bind(void 0, ve),
7266
+ zr.bind(void 0, ve),
7267
7267
  /* 0x03 */
7268
- Hr.bind(void 0, pe),
7268
+ zr.bind(void 0, pe),
7269
7269
  /* 0x04 */
7270
- zr.bind(void 0, ve),
7270
+ Wr.bind(void 0, ve),
7271
7271
  /* 0x05 */
7272
- zr.bind(void 0, pe),
7272
+ Wr.bind(void 0, pe),
7273
7273
  /* 0x06 */
7274
- Wr.bind(void 0, 0),
7274
+ Vr.bind(void 0, 0),
7275
7275
  /* 0x07 */
7276
- Wr.bind(void 0, 1),
7276
+ Vr.bind(void 0, 1),
7277
7277
  /* 0x08 */
7278
- Vr.bind(void 0, 0),
7278
+ qr.bind(void 0, 0),
7279
7279
  /* 0x09 */
7280
- Vr.bind(void 0, 1),
7280
+ qr.bind(void 0, 1),
7281
7281
  /* 0x0A */
7282
7282
  Oi,
7283
7283
  /* 0x0B */
@@ -7295,9 +7295,9 @@ aa = [
7295
7295
  /* 0x11 */
7296
7296
  Bi,
7297
7297
  /* 0x12 */
7298
- Ii,
7299
- /* 0x13 */
7300
7298
  Pi,
7299
+ /* 0x13 */
7300
+ Ii,
7301
7301
  /* 0x14 */
7302
7302
  Gi,
7303
7303
  /* 0x15 */
@@ -7327,7 +7327,7 @@ aa = [
7327
7327
  /* 0x20 */
7328
7328
  Zi,
7329
7329
  /* 0x21 */
7330
- Et,
7330
+ Ot,
7331
7331
  /* 0x22 */
7332
7332
  ji,
7333
7333
  /* 0x23 */
@@ -7356,41 +7356,41 @@ aa = [
7356
7356
  void 0,
7357
7357
  // ENDF (eaten by FDEF)
7358
7358
  /* 0x2E */
7359
- qr.bind(void 0, 0),
7359
+ Xr.bind(void 0, 0),
7360
7360
  /* 0x2F */
7361
- qr.bind(void 0, 1),
7361
+ Xr.bind(void 0, 1),
7362
7362
  /* 0x30 */
7363
- Xr.bind(void 0, ve),
7363
+ Yr.bind(void 0, ve),
7364
7364
  /* 0x31 */
7365
- Xr.bind(void 0, pe),
7365
+ Yr.bind(void 0, pe),
7366
7366
  /* 0x32 */
7367
- Yr.bind(void 0, 0),
7367
+ Zr.bind(void 0, 0),
7368
7368
  /* 0x33 */
7369
- Yr.bind(void 0, 1),
7369
+ Zr.bind(void 0, 1),
7370
7370
  /* 0x34 */
7371
- Zr.bind(void 0, 0),
7371
+ jr.bind(void 0, 0),
7372
7372
  /* 0x35 */
7373
- Zr.bind(void 0, 1),
7373
+ jr.bind(void 0, 1),
7374
7374
  /* 0x36 */
7375
- jr.bind(void 0, 0),
7375
+ Kr.bind(void 0, 0),
7376
7376
  /* 0x37 */
7377
- jr.bind(void 0, 1),
7377
+ Kr.bind(void 0, 1),
7378
7378
  /* 0x38 */
7379
7379
  no,
7380
7380
  /* 0x39 */
7381
7381
  ao,
7382
7382
  /* 0x3A */
7383
- Kr.bind(void 0, 0),
7383
+ Qr.bind(void 0, 0),
7384
7384
  /* 0x3B */
7385
- Kr.bind(void 0, 1),
7385
+ Qr.bind(void 0, 1),
7386
7386
  /* 0x3C */
7387
7387
  so,
7388
7388
  /* 0x3D */
7389
7389
  io,
7390
7390
  /* 0x3E */
7391
- Qr.bind(void 0, 0),
7391
+ Jr.bind(void 0, 0),
7392
7392
  /* 0x3F */
7393
- Qr.bind(void 0, 1),
7393
+ Jr.bind(void 0, 1),
7394
7394
  /* 0x40 */
7395
7395
  oo,
7396
7396
  /* 0x41 */
@@ -7404,16 +7404,16 @@ aa = [
7404
7404
  /* 0x45 */
7405
7405
  fo,
7406
7406
  /* 0x46 */
7407
- Jr.bind(void 0, 0),
7407
+ $r.bind(void 0, 0),
7408
7408
  /* 0x47 */
7409
- Jr.bind(void 0, 1),
7409
+ $r.bind(void 0, 1),
7410
7410
  /* 0x48 */
7411
7411
  void 0,
7412
7412
  // TODO SCFS
7413
7413
  /* 0x49 */
7414
- $r.bind(void 0, 0),
7414
+ en.bind(void 0, 0),
7415
7415
  /* 0x4A */
7416
- $r.bind(void 0, 1),
7416
+ en.bind(void 0, 1),
7417
7417
  /* 0x4B */
7418
7418
  po,
7419
7419
  /* 0x4C */
@@ -7446,15 +7446,15 @@ aa = [
7446
7446
  /* 0x58 */
7447
7447
  Fo,
7448
7448
  /* 0x59 */
7449
- wo,
7450
- /* 0x5A */
7451
7449
  Co,
7450
+ /* 0x5A */
7451
+ wo,
7452
7452
  /* 0x5B */
7453
7453
  Eo,
7454
7454
  /* 0x5C */
7455
7455
  Oo,
7456
7456
  /* 0x5D */
7457
- Ot.bind(void 0, 1),
7457
+ Ut.bind(void 0, 1),
7458
7458
  /* 0x5E */
7459
7459
  Uo,
7460
7460
  /* 0x5F */
@@ -7470,19 +7470,19 @@ aa = [
7470
7470
  /* 0x64 */
7471
7471
  Bo,
7472
7472
  /* 0x65 */
7473
- Io,
7474
- /* 0x66 */
7475
7473
  Po,
7474
+ /* 0x66 */
7475
+ Io,
7476
7476
  /* 0x67 */
7477
7477
  Go,
7478
7478
  /* 0x68 */
7479
- st.bind(void 0, 0),
7479
+ it.bind(void 0, 0),
7480
7480
  /* 0x69 */
7481
- st.bind(void 0, 1),
7481
+ it.bind(void 0, 1),
7482
7482
  /* 0x6A */
7483
- st.bind(void 0, 2),
7483
+ it.bind(void 0, 2),
7484
7484
  /* 0x6B */
7485
- st.bind(void 0, 3),
7485
+ it.bind(void 0, 3),
7486
7486
  /* 0x6C */
7487
7487
  void 0,
7488
7488
  // TODO NROUND[ab]
@@ -7498,15 +7498,15 @@ aa = [
7498
7498
  /* 0x70 */
7499
7499
  No,
7500
7500
  /* 0x71 */
7501
- Ot.bind(void 0, 2),
7501
+ Ut.bind(void 0, 2),
7502
7502
  /* 0x72 */
7503
- Ot.bind(void 0, 3),
7503
+ Ut.bind(void 0, 3),
7504
7504
  /* 0x73 */
7505
- Ut.bind(void 0, 1),
7505
+ Lt.bind(void 0, 1),
7506
7506
  /* 0x74 */
7507
- Ut.bind(void 0, 2),
7507
+ Lt.bind(void 0, 2),
7508
7508
  /* 0x75 */
7509
- Ut.bind(void 0, 3),
7509
+ Lt.bind(void 0, 3),
7510
7510
  /* 0x76 */
7511
7511
  _o,
7512
7512
  /* 0x77 */
@@ -7526,10 +7526,10 @@ aa = [
7526
7526
  /* 0x7D */
7527
7527
  Vo,
7528
7528
  /* 0x7E */
7529
- Et,
7529
+ Ot,
7530
7530
  // actually SANGW, supposed to do only a pop though
7531
7531
  /* 0x7F */
7532
- Et,
7532
+ Ot,
7533
7533
  // actually AA, supposed to do only a pop though
7534
7534
  /* 0x80 */
7535
7535
  void 0,
@@ -7547,9 +7547,9 @@ aa = [
7547
7547
  /* 0x85 */
7548
7548
  qo,
7549
7549
  /* 0x86 */
7550
- en.bind(void 0, 0),
7550
+ tn.bind(void 0, 0),
7551
7551
  /* 0x87 */
7552
- en.bind(void 0, 1),
7552
+ tn.bind(void 0, 1),
7553
7553
  /* 0x88 */
7554
7554
  Xo,
7555
7555
  /* 0x89 */
@@ -7801,10 +7801,10 @@ function ir(t, e, r) {
7801
7801
  function Jo(t, e, r) {
7802
7802
  this.contextName = t, this.openRange = null, this.ranges = [], this.checkStart = e, this.checkEnd = r;
7803
7803
  }
7804
- function ie(t, e) {
7804
+ function oe(t, e) {
7805
7805
  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);
7806
7806
  }
7807
- function gt(t) {
7807
+ function yt(t) {
7808
7808
  this.eventId = t, this.subscribers = [];
7809
7809
  }
7810
7810
  function $o(t) {
@@ -7825,7 +7825,7 @@ function $o(t) {
7825
7825
  ];
7826
7826
  r.forEach(function(a) {
7827
7827
  Object.defineProperty(e.events, a, {
7828
- value: new gt(a)
7828
+ value: new yt(a)
7829
7829
  });
7830
7830
  }), t && r.forEach(function(a) {
7831
7831
  var s = t[a];
@@ -7925,16 +7925,16 @@ B.prototype.registerModifier = function(t, e, r) {
7925
7925
  }
7926
7926
  }), this.registeredModifiers.push(t);
7927
7927
  };
7928
- gt.prototype.subscribe = function(t) {
7928
+ yt.prototype.subscribe = function(t) {
7929
7929
  return typeof t == "function" ? this.subscribers.push(t) - 1 : { FAIL: "invalid '" + this.eventId + "' event handler" };
7930
7930
  };
7931
- gt.prototype.unsubscribe = function(t) {
7931
+ yt.prototype.unsubscribe = function(t) {
7932
7932
  this.subscribers.splice(t, 1);
7933
7933
  };
7934
- ie.prototype.setCurrentIndex = function(t) {
7934
+ oe.prototype.setCurrentIndex = function(t) {
7935
7935
  this.index = t, this.current = this.context[t], this.backtrack = this.context.slice(0, t), this.lookahead = this.context.slice(t + 1);
7936
7936
  };
7937
- ie.prototype.get = function(t) {
7937
+ oe.prototype.get = function(t) {
7938
7938
  switch (!0) {
7939
7939
  case t === 0:
7940
7940
  return this.current;
@@ -7967,7 +7967,7 @@ B.prototype.on = function(t, e) {
7967
7967
  };
7968
7968
  B.prototype.dispatch = function(t, e) {
7969
7969
  var r = this, n = this.events[t];
7970
- n instanceof gt && n.subscribers.forEach(function(a) {
7970
+ n instanceof yt && n.subscribers.forEach(function(a) {
7971
7971
  a.apply(r, e || []);
7972
7972
  });
7973
7973
  };
@@ -8014,7 +8014,7 @@ B.prototype.updateContextsRanges = function() {
8014
8014
  for (var t = this.tokens.map(function(n) {
8015
8015
  return n.char;
8016
8016
  }), e = 0; e < t.length; e++) {
8017
- var r = new ie(t, e);
8017
+ var r = new oe(t, e);
8018
8018
  this.runContextCheck(r);
8019
8019
  }
8020
8020
  this.dispatch("updateContextsRanges", [this.registeredContexts]);
@@ -8038,7 +8038,7 @@ B.prototype.tokenize = function(t) {
8038
8038
  var e = Array.from(t);
8039
8039
  this.dispatch("start");
8040
8040
  for (var r = 0; r < e.length; r++) {
8041
- var n = e[r], a = new ie(e, r);
8041
+ var n = e[r], a = new oe(e, r);
8042
8042
  this.dispatch("next", [a]), this.runContextCheck(a);
8043
8043
  var s = new Ge(n);
8044
8044
  this.tokens.push(s), this.dispatch("newToken", [s, a]);
@@ -8048,13 +8048,13 @@ B.prototype.tokenize = function(t) {
8048
8048
  function ke(t) {
8049
8049
  return /[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(t);
8050
8050
  }
8051
- function ca(t) {
8051
+ function ha(t) {
8052
8052
  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);
8053
8053
  }
8054
8054
  function Te(t) {
8055
8055
  return /[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(t);
8056
8056
  }
8057
- function ot(t) {
8057
+ function ut(t) {
8058
8058
  return /[A-z]/.test(t);
8059
8059
  }
8060
8060
  function eu(t) {
@@ -8066,7 +8066,7 @@ function te(t) {
8066
8066
  function Oe(t) {
8067
8067
  this.id = t.id, this.tag = t.tag, this.substitution = t.substitution;
8068
8068
  }
8069
- function $e(t, e) {
8069
+ function et(t, e) {
8070
8070
  if (!t)
8071
8071
  return -1;
8072
8072
  switch (e.format) {
@@ -8087,18 +8087,18 @@ function $e(t, e) {
8087
8087
  return -1;
8088
8088
  }
8089
8089
  function tu(t, e) {
8090
- var r = $e(t, e.coverage);
8090
+ var r = et(t, e.coverage);
8091
8091
  return r === -1 ? null : t + e.deltaGlyphId;
8092
8092
  }
8093
8093
  function ru(t, e) {
8094
- var r = $e(t, e.coverage);
8094
+ var r = et(t, e.coverage);
8095
8095
  return r === -1 ? null : e.substitute[r];
8096
8096
  }
8097
- function Lt(t, e) {
8097
+ function Rt(t, e) {
8098
8098
  for (var r = [], n = 0; n < t.length; n++) {
8099
8099
  var a = t[n], s = e.current;
8100
8100
  s = Array.isArray(s) ? s[0] : s;
8101
- var i = $e(s, a);
8101
+ var i = et(s, a);
8102
8102
  i !== -1 && r.push(i);
8103
8103
  }
8104
8104
  return r.length !== t.length ? -1 : r;
@@ -8107,7 +8107,7 @@ function nu(t, e) {
8107
8107
  var r = e.inputCoverage.length + e.lookaheadCoverage.length + e.backtrackCoverage.length;
8108
8108
  if (t.context.length < r)
8109
8109
  return [];
8110
- var n = Lt(
8110
+ var n = Rt(
8111
8111
  e.inputCoverage,
8112
8112
  t
8113
8113
  );
@@ -8118,7 +8118,7 @@ function nu(t, e) {
8118
8118
  return [];
8119
8119
  for (var s = t.lookahead.slice(a); s.length && Te(s[0].char); )
8120
8120
  s.shift();
8121
- var i = new ie(s, 0), u = Lt(
8121
+ var i = new oe(s, 0), u = Rt(
8122
8122
  e.lookaheadCoverage,
8123
8123
  i
8124
8124
  ), o = [].concat(t.backtrack);
@@ -8126,7 +8126,7 @@ function nu(t, e) {
8126
8126
  o.shift();
8127
8127
  if (o.length < e.backtrackCoverage.length)
8128
8128
  return [];
8129
- var l = new ie(o, 0), c = Lt(
8129
+ var l = new oe(o, 0), c = Rt(
8130
8130
  e.backtrackCoverage,
8131
8131
  l
8132
8132
  ), p = n.length === e.inputCoverage.length && u.length === e.lookaheadCoverage.length && c.length === e.backtrackCoverage.length, h = [];
@@ -8135,15 +8135,15 @@ function nu(t, e) {
8135
8135
  for (var d = e.lookupRecords[f], g = d.lookupListIndex, y = this.getLookupByIndex(g), m = 0; m < y.subtables.length; m++) {
8136
8136
  var S = y.subtables[m], x = this.getLookupMethod(y, S), O = this.getSubstitutionType(y, S);
8137
8137
  if (O === "12")
8138
- for (var w = 0; w < n.length; w++) {
8139
- var D = t.get(w), L = x(D);
8138
+ for (var C = 0; C < n.length; C++) {
8139
+ var D = t.get(C), L = x(D);
8140
8140
  L && h.push(L);
8141
8141
  }
8142
8142
  }
8143
8143
  return h;
8144
8144
  }
8145
8145
  function au(t, e) {
8146
- var r = t.current, n = $e(r, e.coverage);
8146
+ var r = t.current, n = et(r, e.coverage);
8147
8147
  if (n === -1)
8148
8148
  return null;
8149
8149
  for (var a, s = e.ligatureSets[n], i = 0; i < s.length; i++) {
@@ -8159,7 +8159,7 @@ function au(t, e) {
8159
8159
  return null;
8160
8160
  }
8161
8161
  function su(t, e) {
8162
- var r = $e(t, e.coverage);
8162
+ var r = et(t, e.coverage);
8163
8163
  return r === -1 ? null : e.sequences[r];
8164
8164
  }
8165
8165
  te.prototype.getDefaultScriptFeaturesIndexes = function() {
@@ -8308,7 +8308,7 @@ te.prototype.lookupFeature = function(t) {
8308
8308
  }));
8309
8309
  break;
8310
8310
  }
8311
- e = new ie(s, r), !(Array.isArray(f) && !f.length) && (f = null);
8311
+ e = new oe(s, r), !(Array.isArray(f) && !f.length) && (f = null);
8312
8312
  }
8313
8313
  return s.length ? s : null;
8314
8314
  };
@@ -8413,18 +8413,18 @@ function vu(t, e, r) {
8413
8413
  for (var a = t.substitution.components.length, s = 0; s < a; s++)
8414
8414
  n = e[r + s + 1], n.setState("deleted", !0);
8415
8415
  }
8416
- var tn = {
8416
+ var rn = {
8417
8417
  11: fu,
8418
8418
  12: pu,
8419
8419
  63: du,
8420
8420
  41: vu
8421
8421
  };
8422
8422
  function or(t, e, r) {
8423
- t instanceof Oe && tn[t.id] && tn[t.id](t, e, r);
8423
+ t instanceof Oe && rn[t.id] && rn[t.id](t, e, r);
8424
8424
  }
8425
8425
  function gu(t) {
8426
8426
  for (var e = [].concat(t.backtrack), r = e.length - 1; r >= 0; r--) {
8427
- var n = e[r], a = ca(n), s = Te(n);
8427
+ var n = e[r], a = ha(n), s = Te(n);
8428
8428
  if (!a && !s)
8429
8429
  return !0;
8430
8430
  if (a)
@@ -8433,7 +8433,7 @@ function gu(t) {
8433
8433
  return !1;
8434
8434
  }
8435
8435
  function yu(t) {
8436
- if (ca(t.current))
8436
+ if (ha(t.current))
8437
8437
  return !1;
8438
8438
  for (var e = 0; e < t.lookahead.length; e++) {
8439
8439
  var r = t.lookahead[e], n = Te(r);
@@ -8445,14 +8445,14 @@ function yu(t) {
8445
8445
  function mu(t) {
8446
8446
  var e = this, r = "arab", n = this.featuresTags[r], a = this.tokenizer.getRangeTokens(t);
8447
8447
  if (a.length !== 1) {
8448
- var s = new ie(
8448
+ var s = new oe(
8449
8449
  a.map(
8450
8450
  function(u) {
8451
8451
  return u.getState("glyphIndex");
8452
8452
  }
8453
8453
  ),
8454
8454
  0
8455
- ), i = new ie(
8455
+ ), i = new oe(
8456
8456
  a.map(
8457
8457
  function(u) {
8458
8458
  return u.char;
@@ -8493,14 +8493,14 @@ function mu(t) {
8493
8493
  });
8494
8494
  }
8495
8495
  }
8496
- function rn(t, e) {
8496
+ function nn(t, e) {
8497
8497
  var r = t.map(function(n) {
8498
8498
  return n.activeState.value;
8499
8499
  });
8500
- return new ie(r, 0);
8500
+ return new oe(r, 0);
8501
8501
  }
8502
8502
  function xu(t) {
8503
- var e = this, r = "arab", n = this.tokenizer.getRangeTokens(t), a = rn(n);
8503
+ var e = this, r = "arab", n = this.tokenizer.getRangeTokens(t), a = nn(n);
8504
8504
  a.context.forEach(function(s, i) {
8505
8505
  a.setCurrentIndex(i);
8506
8506
  var u = e.query.lookupFeature({
@@ -8512,15 +8512,15 @@ function xu(t) {
8512
8512
  function(o) {
8513
8513
  return or(o, n, i);
8514
8514
  }
8515
- ), a = rn(n));
8515
+ ), a = nn(n));
8516
8516
  });
8517
8517
  }
8518
8518
  function bu(t) {
8519
8519
  var e = t.current, r = t.get(-1);
8520
8520
  return (
8521
8521
  // ? latin first char
8522
- r === null && ot(e) || // ? latin char preceded with a non latin char
8523
- !ot(r) && ot(e)
8522
+ r === null && ut(e) || // ? latin char preceded with a non latin char
8523
+ !ut(r) && ut(e)
8524
8524
  );
8525
8525
  }
8526
8526
  function Su(t) {
@@ -8528,21 +8528,21 @@ function Su(t) {
8528
8528
  return (
8529
8529
  // ? last latin char
8530
8530
  e === null || // ? next char is not latin
8531
- !ot(e)
8531
+ !ut(e)
8532
8532
  );
8533
8533
  }
8534
8534
  var ku = {
8535
8535
  startCheck: bu,
8536
8536
  endCheck: Su
8537
8537
  };
8538
- function nn(t, e) {
8538
+ function an(t, e) {
8539
8539
  var r = t.map(function(n) {
8540
8540
  return n.activeState.value;
8541
8541
  });
8542
- return new ie(r, 0);
8542
+ return new oe(r, 0);
8543
8543
  }
8544
8544
  function Tu(t) {
8545
- var e = this, r = "latn", n = this.tokenizer.getRangeTokens(t), a = nn(n);
8545
+ var e = this, r = "latn", n = this.tokenizer.getRangeTokens(t), a = an(n);
8546
8546
  a.context.forEach(function(s, i) {
8547
8547
  a.setCurrentIndex(i);
8548
8548
  var u = e.query.lookupFeature({
@@ -8554,21 +8554,21 @@ function Tu(t) {
8554
8554
  function(o) {
8555
8555
  return or(o, n, i);
8556
8556
  }
8557
- ), a = nn(n));
8557
+ ), a = an(n));
8558
8558
  });
8559
8559
  }
8560
- function le(t) {
8560
+ function ce(t) {
8561
8561
  this.baseDir = t || "ltr", this.tokenizer = new B(), this.featuresTags = {};
8562
8562
  }
8563
- le.prototype.setText = function(t) {
8563
+ ce.prototype.setText = function(t) {
8564
8564
  this.text = t;
8565
8565
  };
8566
- le.prototype.contextChecks = {
8566
+ ce.prototype.contextChecks = {
8567
8567
  latinWordCheck: ku,
8568
8568
  arabicWordCheck: uu,
8569
8569
  arabicSentenceCheck: hu
8570
8570
  };
8571
- function Rt(t) {
8571
+ function At(t) {
8572
8572
  var e = this.contextChecks[t + "Check"];
8573
8573
  return this.tokenizer.registerContextChecker(
8574
8574
  t,
@@ -8577,9 +8577,9 @@ function Rt(t) {
8577
8577
  );
8578
8578
  }
8579
8579
  function Fu() {
8580
- return Rt.call(this, "latinWord"), Rt.call(this, "arabicWord"), Rt.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
8580
+ return At.call(this, "latinWord"), At.call(this, "arabicWord"), At.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
8581
8581
  }
8582
- function wu() {
8582
+ function Cu() {
8583
8583
  var t = this, e = this.tokenizer.getContextRanges("arabicSentence");
8584
8584
  e.forEach(function(r) {
8585
8585
  var n = t.tokenizer.getRangeTokens(r);
@@ -8590,7 +8590,7 @@ function wu() {
8590
8590
  );
8591
8591
  });
8592
8592
  }
8593
- le.prototype.registerFeatures = function(t, e) {
8593
+ ce.prototype.registerFeatures = function(t, e) {
8594
8594
  var r = this, n = e.filter(
8595
8595
  function(a) {
8596
8596
  return r.query.supports({ script: t, tag: a });
@@ -8598,7 +8598,7 @@ le.prototype.registerFeatures = function(t, e) {
8598
8598
  );
8599
8599
  this.featuresTags.hasOwnProperty(t) ? this.featuresTags[t] = this.featuresTags[t].concat(n) : this.featuresTags[t] = n;
8600
8600
  };
8601
- le.prototype.applyFeatures = function(t, e) {
8601
+ ce.prototype.applyFeatures = function(t, e) {
8602
8602
  if (!t)
8603
8603
  throw new Error(
8604
8604
  "No valid font was provided to apply features"
@@ -8609,7 +8609,7 @@ le.prototype.applyFeatures = function(t, e) {
8609
8609
  this.query.supports({ script: n.script }) && this.registerFeatures(n.script, n.tags);
8610
8610
  }
8611
8611
  };
8612
- le.prototype.registerModifier = function(t, e, r) {
8612
+ ce.prototype.registerModifier = function(t, e, r) {
8613
8613
  this.tokenizer.registerModifier(t, e, r);
8614
8614
  };
8615
8615
  function ur() {
@@ -8618,7 +8618,7 @@ function ur() {
8618
8618
  "glyphIndex modifier is required to apply arabic presentation features."
8619
8619
  );
8620
8620
  }
8621
- function Cu() {
8621
+ function wu() {
8622
8622
  var t = this, e = "arab";
8623
8623
  if (this.featuresTags.hasOwnProperty(e)) {
8624
8624
  ur.call(this);
@@ -8654,19 +8654,19 @@ function Ou() {
8654
8654
  }
8655
8655
  }
8656
8656
  }
8657
- le.prototype.checkContextReady = function(t) {
8657
+ ce.prototype.checkContextReady = function(t) {
8658
8658
  return !!this.tokenizer.getContext(t);
8659
8659
  };
8660
- le.prototype.applyFeaturesToContexts = function() {
8661
- this.checkContextReady("arabicWord") && (Cu.call(this), Eu.call(this)), this.checkContextReady("latinWord") && Ou.call(this), this.checkContextReady("arabicSentence") && wu.call(this);
8660
+ ce.prototype.applyFeaturesToContexts = function() {
8661
+ this.checkContextReady("arabicWord") && (wu.call(this), Eu.call(this)), this.checkContextReady("latinWord") && Ou.call(this), this.checkContextReady("arabicSentence") && Cu.call(this);
8662
8662
  };
8663
- le.prototype.processText = function(t) {
8663
+ ce.prototype.processText = function(t) {
8664
8664
  (!this.text || this.text !== t) && (this.setText(t), Fu.call(this), this.applyFeaturesToContexts());
8665
8665
  };
8666
- le.prototype.getBidiText = function(t) {
8666
+ ce.prototype.getBidiText = function(t) {
8667
8667
  return this.processText(t), this.tokenizer.getText();
8668
8668
  };
8669
- le.prototype.getTextGlyphs = function(t) {
8669
+ ce.prototype.getTextGlyphs = function(t) {
8670
8670
  this.processText(t);
8671
8671
  for (var e = [], r = 0; r < this.tokenizer.tokens.length; r++) {
8672
8672
  var n = this.tokenizer.tokens[r];
@@ -8700,12 +8700,12 @@ function A(t) {
8700
8700
  usWidthClass: t.widthClass || this.usWidthClasses.MEDIUM,
8701
8701
  fsSelection: t.fsSelection || this.fsSelectionValues.REGULAR
8702
8702
  }, t.tables.os2)
8703
- })), this.supported = !0, this.glyphs = new de.GlyphSet(this, t.glyphs || []), this.encoding = new Un(this), this.position = new Ke(this), this.substitution = new ee(this), this.tables = this.tables || {}, this._push = null, this._hmtxTableData = {}, Object.defineProperty(this, "hinting", {
8703
+ })), this.supported = !0, this.glyphs = new de.GlyphSet(this, t.glyphs || []), this.encoding = new Ln(this), this.position = new Qe(this), this.substitution = new ee(this), this.tables = this.tables || {}, this._push = null, this._hmtxTableData = {}, Object.defineProperty(this, "hinting", {
8704
8704
  get: function() {
8705
8705
  if (this._hinting)
8706
8706
  return this._hinting;
8707
8707
  if (this.outlinesFormat === "truetype")
8708
- return this._hinting = new ia(this);
8708
+ return this._hinting = new oa(this);
8709
8709
  }
8710
8710
  });
8711
8711
  }
@@ -8730,7 +8730,7 @@ A.prototype.updateFeatures = function(t) {
8730
8730
  });
8731
8731
  };
8732
8732
  A.prototype.stringToGlyphs = function(t, e) {
8733
- var r = this, n = new le(), a = function(p) {
8733
+ var r = this, n = new ce(), a = function(p) {
8734
8734
  return r.charToGlyphIndex(p.char);
8735
8735
  };
8736
8736
  n.registerModifier("glyphIndex", null, a);
@@ -8901,7 +8901,7 @@ A.prototype.usWeightClasses = {
8901
8901
  EXTRA_BOLD: 800,
8902
8902
  BLACK: 900
8903
8903
  };
8904
- function ha(t, e) {
8904
+ function fa(t, e) {
8905
8905
  var r = JSON.stringify(t), n = 256;
8906
8906
  for (var a in e) {
8907
8907
  var s = parseInt(a);
@@ -8914,7 +8914,7 @@ function ha(t, e) {
8914
8914
  return e[n] = t, n;
8915
8915
  }
8916
8916
  function Uu(t, e, r) {
8917
- var n = ha(e.name, r);
8917
+ var n = fa(e.name, r);
8918
8918
  return [
8919
8919
  { name: "tag_" + t, type: "TAG", value: e.tag },
8920
8920
  { name: "minValue_" + t, type: "FIXED", value: e.minValue << 16 },
@@ -8929,7 +8929,7 @@ function Lu(t, e, r) {
8929
8929
  return n.tag = a.parseTag(), n.minValue = a.parseFixed(), n.defaultValue = a.parseFixed(), n.maxValue = a.parseFixed(), a.skip("uShort", 1), n.name = r[a.parseUShort()] || {}, n;
8930
8930
  }
8931
8931
  function Ru(t, e, r, n) {
8932
- for (var a = ha(e.name, n), s = [
8932
+ for (var a = fa(e.name, n), s = [
8933
8933
  { name: "nameID_" + t, type: "USHORT", value: a },
8934
8934
  { name: "flags_" + t, type: "USHORT", value: 0 }
8935
8935
  ], i = 0; i < r.length; ++i) {
@@ -8977,12 +8977,12 @@ function Mu(t, e, r) {
8977
8977
  h.push(Au(t, f + d * l, c, r));
8978
8978
  return { axes: c, instances: h };
8979
8979
  }
8980
- var Bu = { make: Du, parse: Mu }, Iu = function() {
8980
+ var Bu = { make: Du, parse: Mu }, Pu = function() {
8981
8981
  return {
8982
8982
  coverage: this.parsePointer(v.coverage),
8983
8983
  attachPoints: this.parseList(v.pointer(v.uShortList))
8984
8984
  };
8985
- }, Pu = function() {
8985
+ }, Iu = function() {
8986
8986
  var t = this.parseUShort();
8987
8987
  if (E.argument(
8988
8988
  t === 1 || t === 2 || t === 3,
@@ -8994,7 +8994,7 @@ var Bu = { make: Du, parse: Mu }, Iu = function() {
8994
8994
  if (t === 3)
8995
8995
  return { coordinate: this.parseShort() };
8996
8996
  }, Gu = function() {
8997
- return this.parseList(v.pointer(Pu));
8997
+ return this.parseList(v.pointer(Iu));
8998
8998
  }, Nu = function() {
8999
8999
  return {
9000
9000
  coverage: this.parsePointer(v.coverage),
@@ -9013,14 +9013,14 @@ function Hu(t, e) {
9013
9013
  var a = {
9014
9014
  version: n,
9015
9015
  classDef: r.parsePointer(v.classDef),
9016
- attachList: r.parsePointer(Iu),
9016
+ attachList: r.parsePointer(Pu),
9017
9017
  ligCaretList: r.parsePointer(Nu),
9018
9018
  markAttachClassDef: r.parsePointer(v.classDef)
9019
9019
  };
9020
9020
  return n >= 1.2 && (a.markGlyphSets = r.parsePointer(_u)), a;
9021
9021
  }
9022
- var zu = { parse: Hu }, oe = new Array(10);
9023
- oe[1] = function() {
9022
+ var zu = { parse: Hu }, ue = new Array(10);
9023
+ ue[1] = function() {
9024
9024
  var e = this.offset + this.relativeOffset, r = this.parseUShort();
9025
9025
  if (r === 1)
9026
9026
  return {
@@ -9036,7 +9036,7 @@ oe[1] = function() {
9036
9036
  };
9037
9037
  E.assert(!1, "0x" + e.toString(16) + ": GPOS lookup type 1 format must be 1 or 2.");
9038
9038
  };
9039
- oe[2] = function() {
9039
+ ue[2] = function() {
9040
9040
  var e = this.offset + this.relativeOffset, r = this.parseUShort();
9041
9041
  E.assert(r === 1 || r === 2, "0x" + e.toString(16) + ": GPOS lookup type 2 format must be 1 or 2.");
9042
9042
  var n = this.parsePointer(v.coverage), a = this.parseUShort(), s = this.parseUShort();
@@ -9076,25 +9076,25 @@ oe[2] = function() {
9076
9076
  };
9077
9077
  }
9078
9078
  };
9079
- oe[3] = function() {
9079
+ ue[3] = function() {
9080
9080
  return { error: "GPOS Lookup 3 not supported" };
9081
9081
  };
9082
- oe[4] = function() {
9082
+ ue[4] = function() {
9083
9083
  return { error: "GPOS Lookup 4 not supported" };
9084
9084
  };
9085
- oe[5] = function() {
9085
+ ue[5] = function() {
9086
9086
  return { error: "GPOS Lookup 5 not supported" };
9087
9087
  };
9088
- oe[6] = function() {
9088
+ ue[6] = function() {
9089
9089
  return { error: "GPOS Lookup 6 not supported" };
9090
9090
  };
9091
- oe[7] = function() {
9091
+ ue[7] = function() {
9092
9092
  return { error: "GPOS Lookup 7 not supported" };
9093
9093
  };
9094
- oe[8] = function() {
9094
+ ue[8] = function() {
9095
9095
  return { error: "GPOS Lookup 8 not supported" };
9096
9096
  };
9097
- oe[9] = function() {
9097
+ ue[9] = function() {
9098
9098
  return { error: "GPOS Lookup 9 not supported" };
9099
9099
  };
9100
9100
  function Wu(t, e) {
@@ -9104,12 +9104,12 @@ function Wu(t, e) {
9104
9104
  version: n,
9105
9105
  scripts: r.parseScriptList(),
9106
9106
  features: r.parseFeatureList(),
9107
- lookups: r.parseLookupList(oe)
9107
+ lookups: r.parseLookupList(ue)
9108
9108
  } : {
9109
9109
  version: n,
9110
9110
  scripts: r.parseScriptList(),
9111
9111
  features: r.parseFeatureList(),
9112
- lookups: r.parseLookupList(oe),
9112
+ lookups: r.parseLookupList(ue),
9113
9113
  variations: r.parseFeatureVariationsList()
9114
9114
  };
9115
9115
  }
@@ -9169,7 +9169,7 @@ function Qu(t, e, r, n) {
9169
9169
  return i;
9170
9170
  }
9171
9171
  var Ju = { parse: Qu };
9172
- function an(t, e) {
9172
+ function sn(t, e) {
9173
9173
  for (var r = [], n = 12, a = 0; a < e; a += 1) {
9174
9174
  var s = F.getTag(t, n), i = F.getULong(t, n + 4), u = F.getULong(t, n + 8), o = F.getULong(t, n + 12);
9175
9175
  r.push({ tag: s, checksum: i, offset: u, length: o, compression: !1 }), n += 16;
@@ -9189,7 +9189,7 @@ function $u(t, e) {
9189
9189
  }
9190
9190
  return r;
9191
9191
  }
9192
- function I(t, e) {
9192
+ function P(t, e) {
9193
9193
  if (e.compression === "WOFF") {
9194
9194
  var r = new Uint8Array(t.buffer, e.offset + 2, e.compressedLength - 2), n = new Uint8Array(e.length);
9195
9195
  if (qa(r, n), n.byteLength !== e.length)
@@ -9203,9 +9203,9 @@ function el(t, e) {
9203
9203
  e = e ?? {};
9204
9204
  var r, n, a = new A({ empty: !0 }), s = new DataView(t, 0), i, u = [], o = F.getTag(s, 0);
9205
9205
  if (o === "\0\0\0" || o === "true" || o === "typ1")
9206
- a.outlinesFormat = "truetype", i = F.getUShort(s, 4), u = an(s, i);
9206
+ a.outlinesFormat = "truetype", i = F.getUShort(s, 4), u = sn(s, i);
9207
9207
  else if (o === "OTTO")
9208
- a.outlinesFormat = "cff", i = F.getUShort(s, 4), u = an(s, i);
9208
+ a.outlinesFormat = "cff", i = F.getUShort(s, 4), u = sn(s, i);
9209
9209
  else if (o === "wOFF") {
9210
9210
  var l = F.getTag(s, 4);
9211
9211
  if (l === "\0\0\0")
@@ -9217,47 +9217,47 @@ function el(t, e) {
9217
9217
  i = F.getUShort(s, 12), u = $u(s, i);
9218
9218
  } else
9219
9219
  throw new Error("Unsupported OpenType signature " + o);
9220
- for (var c, p, h, f, d, g, y, m, S, x, O, w, D = 0; D < i; D += 1) {
9221
- var L = u[D], C = void 0;
9220
+ for (var c, p, h, f, d, g, y, m, S, x, O, C, D = 0; D < i; D += 1) {
9221
+ var L = u[D], w = void 0;
9222
9222
  switch (L.tag) {
9223
9223
  case "cmap":
9224
- C = I(s, L), a.tables.cmap = On.parse(C.data, C.offset), a.encoding = new Ln(a.tables.cmap);
9224
+ w = P(s, L), a.tables.cmap = Un.parse(w.data, w.offset), a.encoding = new Rn(a.tables.cmap);
9225
9225
  break;
9226
9226
  case "cvt ":
9227
- C = I(s, L), w = new F.Parser(C.data, C.offset), a.tables.cvt = w.parseShortList(L.length / 2);
9227
+ w = P(s, L), C = new F.Parser(w.data, w.offset), a.tables.cvt = C.parseShortList(L.length / 2);
9228
9228
  break;
9229
9229
  case "fvar":
9230
9230
  p = L;
9231
9231
  break;
9232
9232
  case "fpgm":
9233
- C = I(s, L), w = new F.Parser(C.data, C.offset), a.tables.fpgm = w.parseByteList(L.length);
9233
+ w = P(s, L), C = new F.Parser(w.data, w.offset), a.tables.fpgm = C.parseByteList(L.length);
9234
9234
  break;
9235
9235
  case "head":
9236
- C = I(s, L), a.tables.head = _n.parse(C.data, C.offset), a.unitsPerEm = a.tables.head.unitsPerEm, r = a.tables.head.indexToLocFormat;
9236
+ w = P(s, L), a.tables.head = Hn.parse(w.data, w.offset), a.unitsPerEm = a.tables.head.unitsPerEm, r = a.tables.head.indexToLocFormat;
9237
9237
  break;
9238
9238
  case "hhea":
9239
- C = I(s, L), a.tables.hhea = Hn.parse(C.data, C.offset), a.ascender = a.tables.hhea.ascender, a.descender = a.tables.hhea.descender, a.numberOfHMetrics = a.tables.hhea.numberOfHMetrics;
9239
+ w = P(s, L), a.tables.hhea = zn.parse(w.data, w.offset), a.ascender = a.tables.hhea.ascender, a.descender = a.tables.hhea.descender, a.numberOfHMetrics = a.tables.hhea.numberOfHMetrics;
9240
9240
  break;
9241
9241
  case "hmtx":
9242
9242
  y = L;
9243
9243
  break;
9244
9244
  case "ltag":
9245
- C = I(s, L), n = Wn.parse(C.data, C.offset);
9245
+ w = P(s, L), n = Vn.parse(w.data, w.offset);
9246
9246
  break;
9247
9247
  case "maxp":
9248
- C = I(s, L), a.tables.maxp = Vn.parse(C.data, C.offset), a.numGlyphs = a.tables.maxp.numGlyphs;
9248
+ w = P(s, L), a.tables.maxp = qn.parse(w.data, w.offset), a.numGlyphs = a.tables.maxp.numGlyphs;
9249
9249
  break;
9250
9250
  case "name":
9251
9251
  x = L;
9252
9252
  break;
9253
9253
  case "OS/2":
9254
- C = I(s, L), a.tables.os2 = Kt.parse(C.data, C.offset);
9254
+ w = P(s, L), a.tables.os2 = Kt.parse(w.data, w.offset);
9255
9255
  break;
9256
9256
  case "post":
9257
- C = I(s, L), a.tables.post = Kn.parse(C.data, C.offset), a.glyphNames = new rr(a.tables.post);
9257
+ w = P(s, L), a.tables.post = Qn.parse(w.data, w.offset), a.glyphNames = new rr(a.tables.post);
9258
9258
  break;
9259
9259
  case "prep":
9260
- C = I(s, L), w = new F.Parser(C.data, C.offset), a.tables.prep = w.parseByteList(L.length);
9260
+ w = P(s, L), C = new F.Parser(w.data, w.offset), a.tables.prep = C.parseByteList(L.length);
9261
9261
  break;
9262
9262
  case "glyf":
9263
9263
  h = L;
@@ -9285,40 +9285,40 @@ function el(t, e) {
9285
9285
  break;
9286
9286
  }
9287
9287
  }
9288
- var N = I(s, x);
9289
- if (a.tables.name = jn.parse(N.data, N.offset, n), a.names = a.tables.name, h && S) {
9290
- var j = r === 0, K = I(s, S), re = Ju.parse(K.data, K.offset, a.numGlyphs, j), ne = I(s, h);
9291
- a.glyphs = na.parse(ne.data, ne.offset, re, a, e);
9288
+ var N = P(s, x);
9289
+ if (a.tables.name = Kn.parse(N.data, N.offset, n), a.names = a.tables.name, h && S) {
9290
+ var j = r === 0, K = P(s, S), re = Ju.parse(K.data, K.offset, a.numGlyphs, j), ne = P(s, h);
9291
+ a.glyphs = aa.parse(ne.data, ne.offset, re, a, e);
9292
9292
  } else if (c) {
9293
- var G = I(s, c);
9294
- Nn.parse(G.data, G.offset, a, e);
9293
+ var G = P(s, c);
9294
+ _n.parse(G.data, G.offset, a, e);
9295
9295
  } else
9296
9296
  throw new Error("Font doesn't contain TrueType or CFF outlines.");
9297
- var H = I(s, y);
9298
- if (zn.parse(a, H.data, H.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, e), fs(a, e), m) {
9299
- var V = I(s, m);
9297
+ var H = P(s, y);
9298
+ if (Wn.parse(a, H.data, H.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, e), fs(a, e), m) {
9299
+ var V = P(s, m);
9300
9300
  a.kerningPairs = Ku.parse(V.data, V.offset);
9301
9301
  } else
9302
9302
  a.kerningPairs = {};
9303
9303
  if (f) {
9304
- var q = I(s, f);
9304
+ var q = P(s, f);
9305
9305
  a.tables.gdef = zu.parse(q.data, q.offset);
9306
9306
  }
9307
9307
  if (d) {
9308
- var X = I(s, d);
9308
+ var X = P(s, d);
9309
9309
  a.tables.gpos = Xu.parse(X.data, X.offset), a.position.init();
9310
9310
  }
9311
9311
  if (g) {
9312
- var z = I(s, g);
9313
- a.tables.gsub = Qn.parse(z.data, z.offset);
9312
+ var z = P(s, g);
9313
+ a.tables.gsub = Jn.parse(z.data, z.offset);
9314
9314
  }
9315
9315
  if (p) {
9316
- var Z = I(s, p);
9316
+ var Z = P(s, p);
9317
9317
  a.tables.fvar = Bu.parse(Z.data, Z.offset, a.names);
9318
9318
  }
9319
9319
  if (O) {
9320
- var M = I(s, O);
9321
- a.tables.meta = Jn.parse(M.data, M.offset), a.metas = a.tables.meta;
9320
+ var M = P(s, O);
9321
+ a.tables.meta = $n.parse(M.data, M.offset), a.metas = a.tables.meta;
9322
9322
  }
9323
9323
  return a;
9324
9324
  }
@@ -9360,7 +9360,7 @@ function tl(t) {
9360
9360
  };
9361
9361
  })(el(t));
9362
9362
  }
9363
- class sn extends vn {
9363
+ class on extends gn {
9364
9364
  /**
9365
9365
  * Creates a new instance of MeshFont.
9366
9366
  * @param data - Either a MeshFontData object containing font information or an ArrayBuffer containing raw font data
@@ -9388,7 +9388,7 @@ class sn extends vn {
9388
9388
  this.addUnsupportedChar(e);
9389
9389
  return;
9390
9390
  }
9391
- return new xr(e, r, this);
9391
+ return new br(e, r, this);
9392
9392
  }
9393
9393
  /**
9394
9394
  * Gets the scale factor for this font.
@@ -9405,7 +9405,7 @@ class sn extends vn {
9405
9405
  * @returns The shape data for the not found indicator
9406
9406
  */
9407
9407
  getNotFoundTextShape(e) {
9408
- return new xr("?", e, this);
9408
+ return new br("?", e, this);
9409
9409
  }
9410
9410
  }
9411
9411
  let Q = class {
@@ -9789,7 +9789,7 @@ class il {
9789
9789
  }
9790
9790
  }
9791
9791
  }
9792
- class P {
9792
+ class I {
9793
9793
  /**
9794
9794
  * Creates a new Point instance.
9795
9795
  * @param x - The x-coordinate (defaults to 0)
@@ -9827,7 +9827,7 @@ class P {
9827
9827
  * @returns A new Point instance with the same x and y values
9828
9828
  */
9829
9829
  clone() {
9830
- return new P(this.x, this.y);
9830
+ return new I(this.x, this.y);
9831
9831
  }
9832
9832
  /**
9833
9833
  * Adds another point's coordinates to this point.
@@ -9889,8 +9889,8 @@ class P {
9889
9889
  return Math.sqrt(r * r + n * n);
9890
9890
  }
9891
9891
  }
9892
- const on = Math.PI / 4;
9893
- class Ye {
9892
+ const un = Math.PI / 4;
9893
+ class Ze {
9894
9894
  /**
9895
9895
  * Creates a bulge-defined arc
9896
9896
  * @param start Start point
@@ -9899,7 +9899,7 @@ class Ye {
9899
9899
  */
9900
9900
  static fromBulge(e, r, n) {
9901
9901
  const a = Math.max(-1, Math.min(1, n));
9902
- return new Ye({
9902
+ return new Ze({
9903
9903
  start: e,
9904
9904
  end: r,
9905
9905
  bulge: a
@@ -9914,7 +9914,7 @@ class Ye {
9914
9914
  * @param isClockwise Whether the arc goes clockwise
9915
9915
  */
9916
9916
  static fromOctant(e, r, n, a, s) {
9917
- return new Ye({
9917
+ return new Ze({
9918
9918
  center: e,
9919
9919
  radius: r,
9920
9920
  startOctant: n,
@@ -9932,18 +9932,18 @@ class Ye {
9932
9932
  }
9933
9933
  const a = 4 * Math.atan(Math.abs(this.bulge));
9934
9934
  this.radius = n / (2 * Math.sin(a / 2));
9935
- const s = this.start.clone().add(r.clone().divide(2)), i = new P(-r.y, r.x);
9935
+ const s = this.start.clone().add(r.clone().divide(2)), i = new I(-r.y, r.x);
9936
9936
  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);
9937
9937
  } else if (e.center && e.radius !== void 0 && e.startOctant !== void 0 && e.octantCount !== void 0 && e.isClockwise !== void 0) {
9938
- this.center = e.center.clone(), this.radius = e.radius, this.isClockwise = e.isClockwise, this.startAngle = e.startOctant * on;
9939
- const r = (e.octantCount === 0 ? 8 : e.octantCount) * on;
9938
+ this.center = e.center.clone(), this.radius = e.radius, this.isClockwise = e.isClockwise, this.startAngle = e.startOctant * un;
9939
+ const r = (e.octantCount === 0 ? 8 : e.octantCount) * un;
9940
9940
  this.endAngle = this.startAngle + (this.isClockwise ? -r : r), this.start = this.center.clone().add(
9941
- new P(
9941
+ new I(
9942
9942
  this.radius * Math.cos(this.startAngle),
9943
9943
  this.radius * Math.sin(this.startAngle)
9944
9944
  )
9945
9945
  ), this.end = this.center.clone().add(
9946
- new P(this.radius * Math.cos(this.endAngle), this.radius * Math.sin(this.endAngle))
9946
+ new I(this.radius * Math.cos(this.endAngle), this.radius * Math.sin(this.endAngle))
9947
9947
  );
9948
9948
  } else
9949
9949
  throw new Error("Invalid arc parameters");
@@ -9960,12 +9960,12 @@ class Ye {
9960
9960
  for (let s = 1; s < a; s++) {
9961
9961
  const i = s / a, u = this.isClockwise ? this.startAngle - i * n : this.startAngle + i * n;
9962
9962
  r.push(
9963
- this.center.clone().add(new P(this.radius * Math.cos(u), this.radius * Math.sin(u)))
9963
+ this.center.clone().add(new I(this.radius * Math.cos(u), this.radius * Math.sin(u)))
9964
9964
  );
9965
9965
  }
9966
9966
  return r.push(
9967
9967
  this.end ? this.end.clone() : this.center.clone().add(
9968
- new P(
9968
+ new I(
9969
9969
  this.radius * Math.cos(this.endAngle),
9970
9970
  this.radius * Math.sin(this.endAngle)
9971
9971
  )
@@ -9973,7 +9973,7 @@ class Ye {
9973
9973
  ), r;
9974
9974
  }
9975
9975
  }
9976
- let At = class fa {
9976
+ class We {
9977
9977
  constructor(e, r = []) {
9978
9978
  this.lastPoint = e, this.polylines = r;
9979
9979
  }
@@ -9997,7 +9997,7 @@ let At = class fa {
9997
9997
  */
9998
9998
  offset(e, r = !0) {
9999
9999
  var n, a;
10000
- return r ? new fa(
10000
+ return r ? new We(
10001
10001
  (n = this.lastPoint) == null ? void 0 : n.clone().add(e),
10002
10002
  this.polylines.map((s) => s.map((i) => i.clone().add(e)))
10003
10003
  ) : ((a = this.lastPoint) == null || a.add(e), this.polylines.forEach((s) => s.forEach((i) => i.add(e))), this);
@@ -10029,8 +10029,8 @@ let At = class fa {
10029
10029
  }).join("");
10030
10030
  return `<svg width="100%" height="100%" viewBox="${s}" preserveAspectRatio="xMidYMid meet">${i}</svg>`;
10031
10031
  }
10032
- };
10033
- const ol = Math.PI / 18, un = 12;
10032
+ }
10033
+ const ol = Math.PI / 18, ln = 12;
10034
10034
  class ul {
10035
10035
  constructor(e) {
10036
10036
  this.shapeCache = /* @__PURE__ */ new Map(), this.shapeData = /* @__PURE__ */ new Map(), this.fontData = e;
@@ -10057,12 +10057,12 @@ class ul {
10057
10057
  const s = this.fontData.content.data;
10058
10058
  let i;
10059
10059
  if (!this.shapeData.has(e) && s[e]) {
10060
- const u = s[e], o = un / this.fontData.content.baseUp;
10060
+ const u = s[e], o = ln / this.fontData.content.baseUp;
10061
10061
  i = this.parseShape(u, o), this.shapeData.set(e, i);
10062
10062
  }
10063
10063
  if (this.shapeData.has(e)) {
10064
- const u = r / un, o = this.shapeData.get(e);
10065
- i = new At(
10064
+ const u = r / ln, o = this.shapeData.get(e);
10065
+ i = new We(
10066
10066
  (n = o.lastPoint) == null ? void 0 : n.clone().multiply(u),
10067
10067
  o.polylines.map((l) => l.map((c) => c.clone().multiply(u)))
10068
10068
  );
@@ -10077,7 +10077,7 @@ class ul {
10077
10077
  */
10078
10078
  parseShape(e, r) {
10079
10079
  const n = {
10080
- currentPoint: new P(),
10080
+ currentPoint: new I(),
10081
10081
  polylines: [],
10082
10082
  currentPolyline: [],
10083
10083
  sp: [],
@@ -10088,7 +10088,7 @@ class ul {
10088
10088
  const s = e[a];
10089
10089
  s <= 15 ? a = this.handleSpecialCommand(s, e, a, n) : this.handleVectorCommand(s, n);
10090
10090
  }
10091
- return new At(n.currentPoint, n.polylines);
10091
+ return new We(n.currentPoint, n.polylines);
10092
10092
  }
10093
10093
  /**
10094
10094
  * Please refer to special codes reference in the following link for more information.
@@ -10163,7 +10163,7 @@ class ul {
10163
10163
  * @returns Returns the vector for the given direction code
10164
10164
  */
10165
10165
  getVectorForDirection(e) {
10166
- const r = new P();
10166
+ const r = new I();
10167
10167
  switch (e) {
10168
10168
  case 0:
10169
10169
  r.x = 1;
@@ -10234,13 +10234,13 @@ class ul {
10234
10234
  }
10235
10235
  handleXYDisplacement(e, r, n) {
10236
10236
  let a = r;
10237
- const s = new P();
10237
+ const s = new I();
10238
10238
  return s.x = Q.byteToSByte(e[++a]), s.y = Q.byteToSByte(e[++a]), n.currentPoint.add(s.multiply(n.scale)), n.isPenDown && n.currentPolyline.push(n.currentPoint.clone()), a;
10239
10239
  }
10240
10240
  handleMultipleXYDisplacements(e, r, n) {
10241
10241
  let a = r;
10242
10242
  for (; ; ) {
10243
- const s = new P();
10243
+ const s = new I();
10244
10244
  if (s.x = Q.byteToSByte(e[++a]), s.y = Q.byteToSByte(e[++a]), s.x === 0 && s.y === 0)
10245
10245
  break;
10246
10246
  n.currentPoint.add(s.multiply(n.scale)), n.isPenDown && n.currentPolyline.push(n.currentPoint.clone());
@@ -10252,7 +10252,7 @@ class ul {
10252
10252
  let s = r;
10253
10253
  const i = e[++s] * n.scale, u = Q.byteToSByte(e[++s]), o = (u & 112) >> 4;
10254
10254
  let l = u & 7;
10255
- const c = u < 0, p = Math.PI / 4 * o, h = n.currentPoint.clone().subtract(new P(Math.cos(p) * i, Math.sin(p) * i)), f = Ye.fromOctant(h, i, o, l, c);
10255
+ const c = u < 0, p = Math.PI / 4 * o, h = n.currentPoint.clone().subtract(new I(Math.cos(p) * i, Math.sin(p) * i)), f = Ze.fromOctant(h, i, o, l, c);
10256
10256
  if (n.isPenDown) {
10257
10257
  const d = f.tessellate();
10258
10258
  n.currentPolyline.pop(), n.currentPolyline.push(...d.slice());
@@ -10269,29 +10269,29 @@ class ul {
10269
10269
  c < 0 && (g = -g, d = -d, y = -1);
10270
10270
  let m = f * p, S = m + d;
10271
10271
  m += f * s / 256 * y, S += f * i / 256 * y;
10272
- const x = n.currentPoint.clone().subtract(new P(l * Math.cos(m), l * Math.sin(m)));
10273
- if (n.currentPoint = x.clone().add(new P(l * Math.cos(S), l * Math.sin(S))), n.isPenDown) {
10272
+ const x = n.currentPoint.clone().subtract(new I(l * Math.cos(m), l * Math.sin(m)));
10273
+ if (n.currentPoint = x.clone().add(new I(l * Math.cos(S), l * Math.sin(S))), n.isPenDown) {
10274
10274
  let O = m;
10275
- const w = [];
10276
- if (w.push(
10277
- x.clone().add(new P(l * Math.cos(O), l * Math.sin(O)))
10275
+ const C = [];
10276
+ if (C.push(
10277
+ x.clone().add(new I(l * Math.cos(O), l * Math.sin(O)))
10278
10278
  ), g > 0)
10279
10279
  for (; O + g < S; )
10280
- O += g, w.push(
10281
- x.clone().add(new P(l * Math.cos(O), l * Math.sin(O)))
10280
+ O += g, C.push(
10281
+ x.clone().add(new I(l * Math.cos(O), l * Math.sin(O)))
10282
10282
  );
10283
10283
  else
10284
10284
  for (; O + g > S; )
10285
- O += g, w.push(
10286
- x.clone().add(new P(l * Math.cos(O), l * Math.sin(O)))
10285
+ O += g, C.push(
10286
+ x.clone().add(new I(l * Math.cos(O), l * Math.sin(O)))
10287
10287
  );
10288
- w.push(x.clone().add(new P(l * Math.cos(S), l * Math.sin(S)))), n.currentPolyline.push(...w);
10288
+ C.push(x.clone().add(new I(l * Math.cos(S), l * Math.sin(S)))), n.currentPolyline.push(...C);
10289
10289
  }
10290
10290
  return a;
10291
10291
  }
10292
10292
  handleBulgeArc(e, r, n) {
10293
10293
  let a = r;
10294
- const s = new P();
10294
+ const s = new I();
10295
10295
  s.x = Q.byteToSByte(e[++a]), s.y = Q.byteToSByte(e[++a]);
10296
10296
  const i = Q.byteToSByte(e[++a]);
10297
10297
  return n.currentPoint = this.handleArcSegment(
@@ -10306,7 +10306,7 @@ class ul {
10306
10306
  handleMultipleBulgeArcs(e, r, n) {
10307
10307
  let a = r;
10308
10308
  for (; ; ) {
10309
- const s = new P();
10309
+ const s = new I();
10310
10310
  if (s.x = Q.byteToSByte(e[++a]), s.y = Q.byteToSByte(e[++a]), s.x === 0 && s.y === 0)
10311
10311
  break;
10312
10312
  const i = Q.byteToSByte(e[++a]);
@@ -10390,7 +10390,7 @@ class ul {
10390
10390
  const u = (s = i.lastPoint) == null ? void 0 : s.clone();
10391
10391
  u && (u.x *= r / n);
10392
10392
  const o = i.polylines.map((l) => l.map((c) => c.clone()));
10393
- return o.forEach((l) => l.forEach((c) => c.x *= r / n)), new At(
10393
+ return o.forEach((l) => l.forEach((c) => c.x *= r / n)), new We(
10394
10394
  u == null ? void 0 : u.add(a),
10395
10395
  o.map((l) => l.map((c) => c.add(a)))
10396
10396
  );
@@ -10414,7 +10414,7 @@ class ul {
10414
10414
  if (n === 0)
10415
10415
  i.push(u.clone().add(r));
10416
10416
  else {
10417
- const o = u.clone().add(r), l = Ye.fromBulge(u, o, n / 127).tessellate();
10417
+ const o = u.clone().add(r), l = Ze.fromBulge(u, o, n / 127).tessellate();
10418
10418
  i.push(...l.slice(1));
10419
10419
  }
10420
10420
  return u.add(r), u;
@@ -10454,7 +10454,7 @@ class ll {
10454
10454
  this.shapeParser.release();
10455
10455
  }
10456
10456
  }
10457
- class lr extends gn {
10457
+ class lr extends yn {
10458
10458
  /**
10459
10459
  * Creates a new instance of ShxTextShape
10460
10460
  * @param char - The character this shape represents
@@ -10488,7 +10488,7 @@ class lr extends gn {
10488
10488
  return s.setAttribute("position", new R.Float32BufferAttribute(r, 3)), s.setIndex(n), s;
10489
10489
  }
10490
10490
  }
10491
- class ln extends vn {
10491
+ class cn extends gn {
10492
10492
  constructor(e) {
10493
10493
  super(), this.type = "shx", this.font = new ll(e), this.data = this.font.fontData;
10494
10494
  }
@@ -10506,7 +10506,7 @@ class ln extends vn {
10506
10506
  a += r, this.addUnsupportedChar(i);
10507
10507
  continue;
10508
10508
  }
10509
- n.push(u.offset(new P(a, 0))), a += u.width;
10509
+ n.push(u.offset(new I(a, 0))), a += u.width;
10510
10510
  }
10511
10511
  return n;
10512
10512
  }
@@ -10561,9 +10561,9 @@ class Se {
10561
10561
  */
10562
10562
  createFont(e) {
10563
10563
  if (e.type === "shx")
10564
- return new ln(e.data);
10564
+ return new cn(e.data);
10565
10565
  if (e.type === "mesh")
10566
- return new sn(e.data);
10566
+ return new on(e.data);
10567
10567
  throw new Error("Unsupported font data type");
10568
10568
  }
10569
10569
  /**
@@ -10578,9 +10578,9 @@ class Se {
10578
10578
  createFontFromBuffer(e, r) {
10579
10579
  const n = Ra(e).toLowerCase();
10580
10580
  if (n === "shx")
10581
- return new ln(r);
10581
+ return new cn(r);
10582
10582
  if (["ttf", "otf", "woff"].includes(n))
10583
- return new sn(r);
10583
+ return new on(r);
10584
10584
  throw new Error(`Unsupported font file type: ${n}`);
10585
10585
  }
10586
10586
  }
@@ -10588,9 +10588,9 @@ class Me {
10588
10588
  constructor() {
10589
10589
  this.fontMapping = {}, this.fontMap = /* @__PURE__ */ new Map(), this.unsupportedChars = {}, this.missedFonts = {}, this.enableFontCache = !0, this.defaultFont = "simsun", this.events = {
10590
10590
  /** Event triggered when a font cannot be found */
10591
- fontNotFound: new fr(),
10591
+ fontNotFound: new pr(),
10592
10592
  /** Event triggered when a font is successfully loaded */
10593
- fontLoaded: new fr()
10593
+ fontLoaded: new pr()
10594
10594
  }, this.loader = new R.FileLoader(), this.loader.setResponseType("arraybuffer"), this.fileNames = [];
10595
10595
  }
10596
10596
  /**
@@ -10622,7 +10622,7 @@ class Me {
10622
10622
  const n = [];
10623
10623
  return await Promise.allSettled(r).then((a) => {
10624
10624
  a.forEach((s, i) => {
10625
- const u = s.status === "fulfilled", o = e[i], l = mr(o.toLowerCase());
10625
+ const u = s.status === "fulfilled", o = e[i], l = xr(o.toLowerCase());
10626
10626
  n.push({
10627
10627
  fontName: l,
10628
10628
  url: o,
@@ -10711,10 +10711,10 @@ class Me {
10711
10711
  * @param url - The URL of the font file to load
10712
10712
  */
10713
10713
  async loadFont(e) {
10714
- const r = xn(e);
10714
+ const r = bn(e);
10715
10715
  if (!r)
10716
10716
  throw new Error(`Invalid font url: ${e}`);
10717
- const n = mr(e).toLowerCase(), a = await He.instance.get(n);
10717
+ const n = xr(e).toLowerCase(), a = await He.instance.get(n);
10718
10718
  if (a) {
10719
10719
  const s = Se.instance.createFont(a);
10720
10720
  this.fontMap.set(n, s);
@@ -10811,7 +10811,7 @@ class bl {
10811
10811
  }), await Me.instance.loadFonts(r);
10812
10812
  }
10813
10813
  }
10814
- 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 || {}), De = /* @__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))(De || {}), _e = /* @__PURE__ */ ((t) => (t[t.BOTTOM = 0] = "BOTTOM", t[t.MIDDLE = 1] = "MIDDLE", t[t.TOP = 2] = "TOP", t))(_e || {}), fe = /* @__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))(fe || {});
10814
+ var je = /* @__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))(je || {}), 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 || {}), De = /* @__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))(De || {}), _e = /* @__PURE__ */ ((t) => (t[t.BOTTOM = 0] = "BOTTOM", t[t.MIDDLE = 1] = "MIDDLE", t[t.TOP = 2] = "TOP", t))(_e || {}), 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 || {});
10815
10815
  const hl = {
10816
10816
  c: "Ø",
10817
10817
  d: "°",
@@ -10832,7 +10832,7 @@ class pl {
10832
10832
  * @param yieldPropertyCommands - Whether to yield property change commands
10833
10833
  */
10834
10834
  constructor(e, r, n = !1) {
10835
- this.ctxStack = [], this.continueStroke = !1, this.inStackContext = !1, this.scanner = new Dt(e), this.ctx = r ?? new yt(), this.lastCtx = this.ctx.copy(), this.yieldPropertyCommands = n;
10835
+ this.ctxStack = [], this.continueStroke = !1, this.inStackContext = !1, this.scanner = new Dt(e), this.ctx = r ?? new mt(), this.lastCtx = this.ctx.copy(), this.yieldPropertyCommands = n;
10836
10836
  }
10837
10837
  /**
10838
10838
  * Decode multi-byte character from hex code
@@ -11145,7 +11145,7 @@ class pl {
11145
11145
  const n = r[0];
11146
11146
  let a = "Regular", s = 400;
11147
11147
  for (const i of r.slice(1))
11148
- i.startsWith("b1") ? s = 700 : i.startsWith("i1") && (a = "Italic");
11148
+ i.startsWith("b1") ? s = 700 : i === "i" || i.startsWith("i1") ? a = "Italic" : (i === "i0" || i.startsWith("i0")) && (a = "Regular");
11149
11149
  e.fontFace = {
11150
11150
  family: n,
11151
11151
  style: a,
@@ -11312,7 +11312,13 @@ class pl {
11312
11312
  } else if (i === "}") {
11313
11313
  if (a)
11314
11314
  return [1, a];
11315
- this.scanner.consume(1), this.popCtx();
11315
+ if (this.scanner.consume(1), this.yieldPropertyCommands) {
11316
+ this.popCtx();
11317
+ const o = this.getPropertyChanges(this.lastCtx, this.ctx);
11318
+ if (Object.keys(o).length > 0)
11319
+ return this.lastCtx = this.ctx.copy(), [9, { command: void 0, changes: o }];
11320
+ } else
11321
+ this.popCtx();
11316
11322
  continue;
11317
11323
  }
11318
11324
  }
@@ -11341,7 +11347,7 @@ class pl {
11341
11347
  for (; ; ) {
11342
11348
  const [n, a] = r();
11343
11349
  if (n)
11344
- yield new cn(n, this.ctx, a), e && (yield new cn(e, this.ctx, null), e = null);
11350
+ yield new hn(n, this.ctx, a), e && (yield new hn(e, this.ctx, null), e = null);
11345
11351
  else
11346
11352
  break;
11347
11353
  }
@@ -11542,7 +11548,7 @@ class cr {
11542
11548
  return this._aci === e._aci && this._rgbValue === e._rgbValue;
11543
11549
  }
11544
11550
  }
11545
- class yt {
11551
+ class mt {
11546
11552
  constructor() {
11547
11553
  this._stroke = 0, this.continueStroke = !1, this.color = new cr(), 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 = {
11548
11554
  indent: 0,
@@ -11684,11 +11690,11 @@ class yt {
11684
11690
  * @returns A new context with the same properties
11685
11691
  */
11686
11692
  copy() {
11687
- const e = new yt();
11693
+ const e = new mt();
11688
11694
  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;
11689
11695
  }
11690
11696
  }
11691
- class cn {
11697
+ class hn {
11692
11698
  /**
11693
11699
  * Create a new MText token
11694
11700
  * @param type - The token type
@@ -11699,7 +11705,7 @@ class cn {
11699
11705
  this.type = e, this.ctx = r, this.data = n;
11700
11706
  }
11701
11707
  }
11702
- function hn(t, e = !1) {
11708
+ function fn(t, e = !1) {
11703
11709
  const r = t[0].index !== null, n = new Set(Object.keys(t[0].attributes)), a = new Set(Object.keys(t[0].morphAttributes)), s = {}, i = {}, u = t[0].morphTargetsRelative, o = new ya();
11704
11710
  let l = 0;
11705
11711
  for (let c = 0; c < t.length; ++c) {
@@ -11744,7 +11750,7 @@ function hn(t, e = !1) {
11744
11750
  o.setIndex(p);
11745
11751
  }
11746
11752
  for (const c in s) {
11747
- const p = fn(s[c]);
11753
+ const p = pn(s[c]);
11748
11754
  if (!p)
11749
11755
  return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + c + " attribute."), null;
11750
11756
  o.setAttribute(c, p);
@@ -11757,7 +11763,7 @@ function hn(t, e = !1) {
11757
11763
  const f = [];
11758
11764
  for (let g = 0; g < i[c].length; ++g)
11759
11765
  f.push(i[c][g][h]);
11760
- const d = fn(f);
11766
+ const d = pn(f);
11761
11767
  if (!d)
11762
11768
  return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + c + " morphAttribute."), null;
11763
11769
  o.morphAttributes[c].push(d);
@@ -11765,7 +11771,7 @@ function hn(t, e = !1) {
11765
11771
  }
11766
11772
  return o;
11767
11773
  }
11768
- function fn(t) {
11774
+ function pn(t) {
11769
11775
  let e, r, n, a = -1, s = 0;
11770
11776
  for (let l = 0; l < t.length; ++l) {
11771
11777
  const c = t[l];
@@ -11797,6 +11803,14 @@ function fn(t) {
11797
11803
  return a !== void 0 && (u.gpuType = a), u;
11798
11804
  }
11799
11805
  const dl = /* @__PURE__ */ new R.Vector3(), vl = 1.666666;
11806
+ class hr {
11807
+ constructor(e) {
11808
+ this.font = "", this.fontScaleFactor = 1, this.fontSize = 1, this.fontSizeScaleFactor = 1, this.color = 16777215, this.underline = !1, this.overline = !1, this.strikeThrough = !1, this.obliqueAngle = 0, this.italic = !1, this.bold = !1, this.widthFactor = 1, this.wordSpace = 1, this.blankWidth = 0, this.horizontalAlignment = se.LEFT, Object.assign(this, e);
11809
+ }
11810
+ clone() {
11811
+ return new hr({ ...this });
11812
+ }
11813
+ }
11800
11814
  class gl {
11801
11815
  /**
11802
11816
  * Construct one instance of this class and initialize some properties with default values.
@@ -11806,7 +11820,26 @@ class gl {
11806
11820
  * @param options Input formating options
11807
11821
  */
11808
11822
  constructor(e, r, n, a) {
11809
- this._currentUnderline = !1, this._currentOverline = !1, this._currentStrikeThrough = !1, this._currentObliqueAngle = 0, this._currentItalic = !1, this._currentBold = !1, 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._currentHorizontalAlignment = a.horizontalAlignment, this._currentFont = this.textStyle.font.toLowerCase(), this._currentWidthFactor = a.widthFactor, this._currentWordSpace = 1, this._currentColor = a.byLayerColor, this._currentFontSizeScaleFactor = 1, this._currentMaxFontSize = 0, this._currentObliqueAngle = e.obliqueAngle || 0, this.initLineParams(), this._currentBlankWidth = this.calculateBlankWidth();
11823
+ this._contextStack = [], this._maxFontSize = 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 hr({
11824
+ font: this.textStyle.font.toLowerCase(),
11825
+ fontScaleFactor: this.fontManager.getFontScaleFactor(this.textStyle.font.toLowerCase()),
11826
+ fontSize: a.fontSize,
11827
+ fontSizeScaleFactor: 1,
11828
+ color: a.byLayerColor,
11829
+ underline: !1,
11830
+ overline: !1,
11831
+ strikeThrough: !1,
11832
+ obliqueAngle: e.obliqueAngle || 0,
11833
+ italic: !1,
11834
+ bold: !1,
11835
+ widthFactor: a.widthFactor,
11836
+ wordSpace: 1,
11837
+ blankWidth: this.calculateBlankWidthForFont(
11838
+ this.textStyle.font.toLowerCase(),
11839
+ a.fontSize
11840
+ ),
11841
+ horizontalAlignment: a.horizontalAlignment
11842
+ }), this._maxFontSize = 0, this.initLineParams();
11810
11843
  }
11811
11844
  get fontManager() {
11812
11845
  return this._fontManager;
@@ -11863,13 +11896,13 @@ class gl {
11863
11896
  * Font name of current character
11864
11897
  */
11865
11898
  get currentFont() {
11866
- return this._currentFont;
11899
+ return this._currentContext.font;
11867
11900
  }
11868
11901
  /**
11869
11902
  * The current horizontal alignment of one text line
11870
11903
  */
11871
11904
  get currentHorizontalAlignment() {
11872
- return this._currentHorizontalAlignment;
11905
+ return this._currentContext.horizontalAlignment;
11873
11906
  }
11874
11907
  /**
11875
11908
  * Scale factor of current font height. The scale factor isn't set by users in text editor.
@@ -11877,25 +11910,25 @@ class gl {
11877
11910
  * algorithm. For shx font, it is alway equal to 1.
11878
11911
  */
11879
11912
  get currentFontScaleFactor() {
11880
- return this._currentFontScaleFactor;
11913
+ return this._currentContext.fontScaleFactor;
11881
11914
  }
11882
11915
  /**
11883
11916
  * Font size of current character
11884
11917
  */
11885
11918
  get currentFontSize() {
11886
- return this._currentFontSize;
11919
+ return this._currentContext.fontSize;
11887
11920
  }
11888
11921
  /**
11889
11922
  * Font size scale factor of current character
11890
11923
  */
11891
11924
  get currentFontSizeScaleFactor() {
11892
- return this._currentFontSizeScaleFactor;
11925
+ return this._currentContext.fontSizeScaleFactor;
11893
11926
  }
11894
11927
  /**
11895
11928
  * The height of current line of texts
11896
11929
  */
11897
11930
  get currentLineHeight() {
11898
- return this.defaultLineSpaceFactor * this._currentFontSize * vl + this.currentMaxFontSize;
11931
+ return this.defaultLineSpaceFactor * this.currentFontSize * vl + this.currentMaxFontSize;
11899
11932
  }
11900
11933
  /**
11901
11934
  * The maximum font size in current line. Characters in one line may have different font and font
@@ -11903,25 +11936,25 @@ class gl {
11903
11936
  * of current line.
11904
11937
  */
11905
11938
  get currentMaxFontSize() {
11906
- return this._currentMaxFontSize;
11939
+ return this._maxFontSize;
11907
11940
  }
11908
11941
  /**
11909
11942
  * The current space setting between two characters
11910
11943
  */
11911
11944
  get currentWordSpace() {
11912
- return this._currentWordSpace;
11945
+ return this._currentContext.wordSpace;
11913
11946
  }
11914
11947
  /**
11915
11948
  * The current scale factor of character width
11916
11949
  */
11917
11950
  get currentWidthFactor() {
11918
- return this._currentWidthFactor;
11951
+ return this._currentContext.widthFactor;
11919
11952
  }
11920
11953
  /**
11921
11954
  * The current text color
11922
11955
  */
11923
11956
  get currentColor() {
11924
- return this._currentColor;
11957
+ return this._currentContext.color;
11925
11958
  }
11926
11959
  /**
11927
11960
  * All of THREE.js objects in current line. It contains objects in all of sections of this line.
@@ -11951,7 +11984,7 @@ class gl {
11951
11984
  * Oblique angle of current character
11952
11985
  */
11953
11986
  get currentObliqueAngle() {
11954
- return this._currentObliqueAngle;
11987
+ return this._currentContext.obliqueAngle;
11955
11988
  }
11956
11989
  /**
11957
11990
  * Process text format information
@@ -11962,45 +11995,45 @@ class gl {
11962
11995
  case "f":
11963
11996
  case "F":
11964
11997
  if (e.changes.fontFace) {
11965
- this.changeFont(e.changes.fontFace.family), this.fontManager.getFontType(this.currentFont) === "mesh" ? (this._currentItalic = e.changes.fontFace.style === "Italic", this._currentBold = (e.changes.fontFace.weight || 400) >= 700, this._currentObliqueAngle = this.textStyle.obliqueAngle || 0) : (this._currentItalic = !1, this._currentBold = !1, e.changes.fontFace.style === "Italic" ? this._currentObliqueAngle = 15 : this._currentObliqueAngle = this.textStyle.obliqueAngle || 0), this.currentFont && this.currentFont.includes(".shx") && console.log(`Doesn't support custom fonts: ${this.currentFont}`);
11998
+ this.changeFont(e.changes.fontFace.family), this.fontManager.getFontType(this._currentContext.font) === "mesh" ? (this._currentContext.italic = e.changes.fontFace.style === "Italic", this._currentContext.bold = (e.changes.fontFace.weight || 400) >= 700, this._currentContext.obliqueAngle = this.textStyle.obliqueAngle || 0) : (this._currentContext.italic = !1, this._currentContext.bold = !1, e.changes.fontFace.style === "Italic" ? this._currentContext.obliqueAngle = 15 : this._currentContext.obliqueAngle = this.textStyle.obliqueAngle || 0);
11966
11999
  break;
11967
12000
  }
11968
12001
  case "c":
11969
12002
  case "C":
11970
- e.changes.aci ? e.changes.aci === 0 ? this._currentColor = this._options.byBlockColor : e.changes.aci === 256 ? this._currentColor = this._options.byLayerColor : this._currentColor = Da(e.changes.aci) : e.changes.rgb && (this._currentColor = (e.changes.rgb[0] << 16) + (e.changes.rgb[1] << 8) + e.changes.rgb[2]);
12003
+ e.changes.aci ? e.changes.aci === 0 ? this._currentContext.color = this._options.byBlockColor : e.changes.aci === 256 ? this._currentContext.color = this._options.byLayerColor : this._currentContext.color = Da(e.changes.aci) : e.changes.rgb && (this._currentContext.color = (e.changes.rgb[0] << 16) + (e.changes.rgb[1] << 8) + e.changes.rgb[2]);
11971
12004
  break;
11972
12005
  case "W":
11973
- e.changes.widthFactor && (e.changes.widthFactor.isRelative ? this._currentWidthFactor = e.changes.widthFactor.value * this.maxWidth : this._currentWidthFactor = e.changes.widthFactor.value * 0.93);
12006
+ e.changes.widthFactor && (e.changes.widthFactor.isRelative ? this._currentContext.widthFactor = e.changes.widthFactor.value * this.maxWidth : this._currentContext.widthFactor = e.changes.widthFactor.value * 0.93);
11974
12007
  break;
11975
12008
  case "H":
11976
12009
  e.changes.capHeight && (e.changes.capHeight.isRelative ? this.changeFontSizeScaleFactor(e.changes.capHeight.value) : this.changeFontHeight(e.changes.capHeight.value));
11977
12010
  break;
11978
12011
  case "T":
11979
- e.changes.charTrackingFactor && (e.changes.charTrackingFactor.isRelative ? this._currentWordSpace = e.changes.charTrackingFactor.value : this._currentWordSpace = e.changes.charTrackingFactor.value);
12012
+ e.changes.charTrackingFactor && (this._currentContext.wordSpace = e.changes.charTrackingFactor.value);
11980
12013
  break;
11981
12014
  case "q":
11982
- e.changes.paragraph && e.changes.paragraph.align && (this._currentHorizontalAlignment = e.changes.paragraph.align);
12015
+ e.changes.paragraph && e.changes.paragraph.align && (this._currentContext.horizontalAlignment = e.changes.paragraph.align);
11983
12016
  break;
11984
12017
  case "L":
11985
- this._currentUnderline = !0;
12018
+ this._currentContext.underline = !0;
11986
12019
  break;
11987
12020
  case "l":
11988
- this._currentUnderline = !1;
12021
+ this._currentContext.underline = !1;
11989
12022
  break;
11990
12023
  case "O":
11991
- this._currentOverline = !0;
12024
+ this._currentContext.overline = !0;
11992
12025
  break;
11993
12026
  case "o":
11994
- this._currentOverline = !1;
12027
+ this._currentContext.overline = !1;
11995
12028
  break;
11996
12029
  case "K":
11997
- this._currentStrikeThrough = !0;
12030
+ this._currentContext.strikeThrough = !0;
11998
12031
  break;
11999
12032
  case "k":
12000
- this._currentStrikeThrough = !1;
12033
+ this._currentContext.strikeThrough = !1;
12001
12034
  break;
12002
12035
  case "Q":
12003
- e.changes.oblique !== void 0 && (this._currentObliqueAngle = e.changes.oblique);
12036
+ e.changes.oblique !== void 0 && (this._currentContext.obliqueAngle = e.changes.oblique);
12004
12037
  break;
12005
12038
  }
12006
12039
  }
@@ -12016,7 +12049,12 @@ class gl {
12016
12049
  else if (s.type === De.WORD) {
12017
12050
  const i = s.data;
12018
12051
  Array.isArray(i) ? i.forEach((u) => this.processWord(u, r, n)) : typeof i == "string" && i.length > 0 && this.processWord(i, r, n), this.processGeometries(r, n, a);
12019
- } else s.type === De.SPACE ? this.processBlank() : s.type === De.PROPERTIES_CHANGED ? (this.processFormat(s.data), this.processGeometries(r, n, a)) : s.type === De.STACK && (this.processStack(s.data, r, n), this.processGeometries(r, n, a));
12052
+ } else if (s.type === De.SPACE)
12053
+ this.processBlank();
12054
+ else if (s.type === De.PROPERTIES_CHANGED) {
12055
+ const i = s.data;
12056
+ i.command === void 0 ? this._contextStack.length > 0 && (this._currentContext = this._contextStack.pop()) : (this._contextStack.push(this._currentContext.clone()), this.processFormat(i)), this.processGeometries(r, n, a);
12057
+ } else s.type === De.STACK && (this.processStack(s.data, r, n), this.processGeometries(r, n, a));
12020
12058
  return (r.length > 0 || n.length > 0) && this.processGeometries(r, n, a), a;
12021
12059
  }
12022
12060
  processGeometries(e, r, n) {
@@ -12030,8 +12068,8 @@ class gl {
12030
12068
  this.processChar(e[a], r, n);
12031
12069
  }
12032
12070
  processStack(e, r, n) {
12033
- const [a, s, i] = e, u = this._hOffset, o = this._vOffset, l = this._currentWordSpace, c = this._currentFontSize, p = this._currentFontSizeScaleFactor;
12034
- this._hOffset = u, this._currentWordSpace = 1;
12071
+ const [a, s, i] = e, u = this._hOffset, o = this._vOffset, l = this._currentContext.wordSpace, c = this._currentContext.fontSize, p = this._currentContext.fontSizeScaleFactor;
12072
+ this._hOffset = u, this._currentContext.wordSpace = 1;
12035
12073
  let h = 0;
12036
12074
  for (let m = 0; m < a.length; m++) {
12037
12075
  const S = this.getCharShape(a[m]);
@@ -12045,7 +12083,7 @@ class gl {
12045
12083
  }
12046
12084
  const d = Math.max(h, f), g = (d - h) / 2, y = (d - f) / 2;
12047
12085
  if (i === "^") {
12048
- if (this._currentFontSizeScaleFactor = p * 0.7, this.calcuateLineParams(), a && !s) {
12086
+ if (this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams(), a && !s) {
12049
12087
  const m = [], S = [];
12050
12088
  this._hOffset = u, this._vOffset = o + c * 0.1;
12051
12089
  for (let x = 0; x < a.length; x++)
@@ -12058,19 +12096,19 @@ class gl {
12058
12096
  this.processChar(s[x], m, S);
12059
12097
  r.push(...m), n.push(...S), this._hOffset = u + f;
12060
12098
  }
12061
- this._currentFontSizeScaleFactor = p, this.calcuateLineParams();
12099
+ this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams();
12062
12100
  } else {
12063
12101
  const m = [], S = [];
12064
12102
  this._hOffset = u + g, this._vOffset = o + this.currentFontSize * 0.3;
12065
- for (let w = 0; w < a.length; w++)
12066
- this.processChar(a[w], m, S);
12103
+ for (let C = 0; C < a.length; C++)
12104
+ this.processChar(a[C], m, S);
12067
12105
  r.push(...m), n.push(...S);
12068
12106
  const x = [], O = [];
12069
12107
  this._hOffset = u + y, this._vOffset = o - this.currentFontSize * 0.6;
12070
- for (let w = 0; w < s.length; w++)
12071
- this.processChar(s[w], x, O);
12108
+ for (let C = 0; C < s.length; C++)
12109
+ this.processChar(s[C], x, O);
12072
12110
  if (r.push(...x), n.push(...O), i === "/" || i === "#") {
12073
- const w = new R.BufferGeometry(), D = new Float32Array([
12111
+ const C = new R.BufferGeometry(), D = new Float32Array([
12074
12112
  u,
12075
12113
  o - this.currentFontSize * 0.8,
12076
12114
  0,
@@ -12078,14 +12116,14 @@ class gl {
12078
12116
  o - this.currentFontSize * 0.8,
12079
12117
  0
12080
12118
  ]);
12081
- w.setAttribute("position", new R.BufferAttribute(D, 3)), w.setIndex(null), n.push(w);
12119
+ C.setAttribute("position", new R.BufferAttribute(D, 3)), C.setIndex(null), n.push(C);
12082
12120
  }
12083
12121
  this._hOffset = u + d;
12084
12122
  }
12085
- this._vOffset = o, this._currentWordSpace = l;
12123
+ this._vOffset = o, this._currentContext.wordSpace = l;
12086
12124
  }
12087
12125
  processBlank() {
12088
- this._hOffset += this._currentBlankWidth;
12126
+ this._hOffset += this._currentContext.blankWidth;
12089
12127
  }
12090
12128
  processChar(e, r, n) {
12091
12129
  const a = this.getCharShape(e);
@@ -12096,16 +12134,16 @@ class gl {
12096
12134
  let s = a.toGeometry();
12097
12135
  s.scale(this.currentWidthFactor, 1, 1);
12098
12136
  let i = this.currentObliqueAngle;
12099
- if (this._currentItalic && (i += 15), i) {
12137
+ if (this._currentContext.italic && (i += 15), i) {
12100
12138
  const d = i * Math.PI / 180, g = new R.Matrix4();
12101
12139
  g.set(1, Math.tan(d), 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), s.applyMatrix4(g);
12102
12140
  }
12103
12141
  const u = this.fontManager.getFontType(this.currentFont);
12104
- this._currentBold && u === "mesh" && s.scale(1.06, 1.06, 1), this.hOffset > (this.maxWidth || 1 / 0) && this.startNewLine();
12105
- let o = this.hOffset, l = this.flowDirection == Ze.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.currentFontSize, c = a.width * this.currentWidthFactor, p = this.currentFontSize;
12106
- s.translate(o, l, 0), this.currentHorizontalAlignment == fe.DISTRIBUTED ? this._hOffset += a.width * this.currentWidthFactor : this._hOffset += a.width * this.currentWordSpace * this.currentWidthFactor, r.push(s);
12142
+ this._currentContext.bold && u === "mesh" && s.scale(1.06, 1.06, 1), this.hOffset > (this.maxWidth || 1 / 0) && this.startNewLine();
12143
+ let o = this.hOffset, l = this.flowDirection == je.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.currentFontSize, c = a.width * this.currentWidthFactor, p = this.currentFontSize;
12144
+ s.translate(o, l, 0), this.currentHorizontalAlignment == se.DISTRIBUTED ? this._hOffset += a.width * this.currentWidthFactor : this._hOffset += a.width * this.currentWordSpace * this.currentWidthFactor, r.push(s);
12107
12145
  const h = p * 0.05, f = 1e-3;
12108
- if (this._currentUnderline) {
12146
+ if (this._currentContext.underline) {
12109
12147
  const d = new R.BufferGeometry(), g = l - h;
12110
12148
  d.setAttribute(
12111
12149
  "position",
@@ -12115,7 +12153,7 @@ class gl {
12115
12153
  )
12116
12154
  ), d.setIndex(null), n.push(d);
12117
12155
  }
12118
- if (this._currentOverline) {
12156
+ if (this._currentContext.overline) {
12119
12157
  const d = new R.BufferGeometry(), g = l + p + h;
12120
12158
  d.setAttribute(
12121
12159
  "position",
@@ -12125,7 +12163,7 @@ class gl {
12125
12163
  )
12126
12164
  ), d.setIndex(null), n.push(d);
12127
12165
  }
12128
- if (this._currentStrikeThrough) {
12166
+ if (this._currentContext.strikeThrough) {
12129
12167
  const d = new R.BufferGeometry(), g = l + p / 2;
12130
12168
  d.setAttribute(
12131
12169
  "position",
@@ -12142,23 +12180,20 @@ class gl {
12142
12180
  initLineParams() {
12143
12181
  this.calcuateLineParams();
12144
12182
  }
12145
- changeFontHeight(e) {
12146
- this.calcuateLineParams(e);
12147
- }
12148
12183
  changeFont(e) {
12149
12184
  let r = e;
12150
- this._options.removeFontExtension && (r = e.replace(/\.(ttf|otf|woff|shx)$/, "")), this._currentFont = this.fontManager.findAndReplaceFont(r), this._currentBlankWidth = this.calculateBlankWidth(), this.calcuateLineParams();
12151
- }
12152
- changeFontSizeScaleFactor(e) {
12153
- this._currentFontSizeScaleFactor *= e, this.calcuateLineParams();
12185
+ this._options.removeFontExtension && (r = e.replace(/\.(ttf|otf|woff|shx)$/, "")), this._currentContext.font = this.fontManager.findAndReplaceFont(r), this._currentContext.blankWidth = this.calculateBlankWidthForFont(
12186
+ this._currentContext.font,
12187
+ this._currentContext.fontSize
12188
+ ), this.calcuateLineParams();
12154
12189
  }
12155
12190
  /**
12156
12191
  * Calcuate font size, line space, line height and other parameters.
12157
12192
  */
12158
12193
  calcuateLineParams(e) {
12159
- this._currentFontScaleFactor = this.fontManager.getFontScaleFactor(this.currentFont);
12194
+ this._currentContext.fontScaleFactor = this.fontManager.getFontScaleFactor(this.currentFont);
12160
12195
  const r = e || this.defaultFontSize || this.textStyle.fixedTextHeight;
12161
- this._currentFontSize = r * this.currentFontScaleFactor * this.currentFontSizeScaleFactor;
12196
+ this._currentContext.fontSize = r * this._currentContext.fontScaleFactor * this._currentContext.fontSizeScaleFactor;
12162
12197
  }
12163
12198
  /**
12164
12199
  * Get text shape of the specified character
@@ -12167,10 +12202,10 @@ class gl {
12167
12202
  */
12168
12203
  getCharShape(e) {
12169
12204
  let r = this.fontManager.getCharShape(e, this.currentFont, this.currentFontSize);
12170
- return this.textStyle.bigFont && !r && (r = this.fontManager.getCharShape(e, this.textStyle.bigFont, this.currentFontSize)), r || (r = this.fontManager.getCharShape(e, "", this.currentFontSize)), r || (r = this.fontManager.getNotFoundTextShape(this.currentFontSize)), this.currentFontSize > this.currentMaxFontSize && (this._currentMaxFontSize = this.currentFontSize), r;
12205
+ return this.textStyle.bigFont && !r && (r = this.fontManager.getCharShape(e, this.textStyle.bigFont, this.currentFontSize)), r || (r = this.fontManager.getCharShape(e, "", this.currentFontSize)), r || (r = this.fontManager.getNotFoundTextShape(this.currentFontSize)), this.currentFontSize > this._maxFontSize && (this._maxFontSize = this.currentFontSize), r;
12171
12206
  }
12172
12207
  startNewLine() {
12173
- this._hOffset = 0, this.flowDirection == Ze.BOTTOM_TO_TOP ? this._vOffset += this.currentLineHeight : this._vOffset -= this.currentLineHeight, this._lineCount++, this.processAlignment(), this._currentLineObjects = [], this._lineCount == 2 ? this._totalHeight = this.currentMaxFontSize : this._totalHeight = this._totalHeight + this.currentLineHeight;
12208
+ this._hOffset = 0, this.flowDirection == je.BOTTOM_TO_TOP ? this._vOffset += this.currentLineHeight : this._vOffset -= this.currentLineHeight, this._lineCount++, this.processAlignment(), this._currentLineObjects = [], this._lineCount == 2 ? this._totalHeight = this.currentMaxFontSize : this._totalHeight = this._totalHeight + this.currentLineHeight, this._maxFontSize = 0;
12174
12209
  }
12175
12210
  /**
12176
12211
  * Apply translation on the specified buffer geometries according to text alignment setting
@@ -12188,15 +12223,15 @@ class gl {
12188
12223
  }), r) {
12189
12224
  const n = r.getSize(dl);
12190
12225
  switch (this.currentHorizontalAlignment) {
12191
- case fe.LEFT:
12226
+ case se.LEFT:
12192
12227
  break;
12193
- case fe.CENTER:
12228
+ case se.CENTER:
12194
12229
  e.forEach((a) => a.translate((this.maxWidth - n.x) / 2, 0, 0));
12195
12230
  break;
12196
- case fe.RIGHT:
12231
+ case se.RIGHT:
12197
12232
  e.forEach((a) => a.translate(this.maxWidth - n.x, 0, 0));
12198
12233
  break;
12199
- case fe.DISTRIBUTED:
12234
+ case se.DISTRIBUTED:
12200
12235
  if (e.length > 1) {
12201
12236
  const a = (this.maxWidth - n.x) / (e.length - 1);
12202
12237
  for (let s = 1; s < e.length; s++)
@@ -12216,8 +12251,8 @@ class gl {
12216
12251
  * - For SHX fonts (AutoCAD's built-in vector fonts, such as txt.shx), the space width is often half the text height.
12217
12252
  * So if the text height is 10, the space width is typically 5 units.
12218
12253
  */
12219
- calculateBlankWidth() {
12220
- return this.fontManager.getFontType(this.currentFont) === "shx" ? this.currentFontSize * 0.5 : this.currentFontSize * 0.3;
12254
+ calculateBlankWidthForFont(e, r) {
12255
+ return this.fontManager.getFontType(e) === "shx" ? r * 0.5 : r * 0.3;
12221
12256
  }
12222
12257
  /**
12223
12258
  * Convert the text shape geometries to three.js object
@@ -12228,7 +12263,7 @@ class gl {
12228
12263
  const n = new R.Group(), a = this.currentColor, s = e.filter((u) => u instanceof R.ExtrudeGeometry);
12229
12264
  if (s.length > 0) {
12230
12265
  const u = new R.Mesh();
12231
- u.geometry = hn(s), u.material = this.styleManager.getMeshBasicMaterial(a), u.userData.bboxIntersectionCheck = !0, n.add(u);
12266
+ u.geometry = fn(s), u.material = this.styleManager.getMeshBasicMaterial(a), u.userData.bboxIntersectionCheck = !0, n.add(u);
12232
12267
  }
12233
12268
  const i = [
12234
12269
  ...r,
@@ -12236,12 +12271,18 @@ class gl {
12236
12271
  ];
12237
12272
  if (i.length > 0) {
12238
12273
  const u = new R.LineSegments();
12239
- u.geometry = hn(i), u.material = this.styleManager.getLineBasicMaterial(a), u.userData.bboxIntersectionCheck = !0, n.add(u);
12274
+ u.geometry = fn(i), u.material = this.styleManager.getLineBasicMaterial(a), u.userData.bboxIntersectionCheck = !0, n.add(u);
12240
12275
  }
12241
12276
  return n.children.length === 1 ? n.children[0] : n;
12242
12277
  }
12278
+ changeFontSizeScaleFactor(e) {
12279
+ this._currentContext.fontSizeScaleFactor *= e, this.calcuateLineParams();
12280
+ }
12281
+ changeFontHeight(e) {
12282
+ this._currentContext.fontSize = e * this._currentContext.fontScaleFactor * this._currentContext.fontSizeScaleFactor, this.calcuateLineParams();
12283
+ }
12243
12284
  }
12244
- const Mt = /* @__PURE__ */ new R.Vector3(), Ce = /* @__PURE__ */ new R.Vector3(), Bt = /* @__PURE__ */ new R.Vector3(), It = /* @__PURE__ */ new R.Quaternion(), Pt = /* @__PURE__ */ new R.Matrix4(), pn = /* @__PURE__ */ new R.Matrix4(), dn = /* @__PURE__ */ new R.Vector3(1, 0, 0);
12285
+ const Mt = /* @__PURE__ */ new R.Vector3(), we = /* @__PURE__ */ new R.Vector3(), Bt = /* @__PURE__ */ new R.Vector3(), Pt = /* @__PURE__ */ new R.Quaternion(), It = /* @__PURE__ */ new R.Matrix4(), dn = /* @__PURE__ */ new R.Matrix4(), vn = /* @__PURE__ */ new R.Vector3(1, 0, 0);
12245
12286
  class Sl extends R.Object3D {
12246
12287
  /**
12247
12288
  * Creates a new instance of MText.
@@ -12322,7 +12363,7 @@ class Sl extends R.Object3D {
12322
12363
  const { object: n, height: a } = this.createMTextGroup(e, r);
12323
12364
  if (!n)
12324
12365
  return;
12325
- n.matrix.decompose(Ce, It, Bt), e.position && (Ce.x += e.position.x, Ce.y += e.position.y, n.matrix.compose(Ce, It, Bt));
12366
+ n.matrix.decompose(we, Pt, Bt), e.position && (we.x += e.position.x, we.y += e.position.y, n.matrix.compose(we, Pt, Bt));
12326
12367
  const s = e.width, i = this.calculateAnchorPoint(
12327
12368
  s,
12328
12369
  a,
@@ -12334,12 +12375,12 @@ class Sl extends R.Object3D {
12334
12375
  });
12335
12376
  let u = e.rotation || 0;
12336
12377
  if (e.directionVector) {
12337
- const l = e.directionVector, c = new R.Vector3(l.x, l.y, l.z), p = c.clone().cross(dn), h = dn.angleTo(c);
12378
+ const l = e.directionVector, c = new R.Vector3(l.x, l.y, l.z), p = c.clone().cross(vn), h = vn.angleTo(c);
12338
12379
  u = p.z > 0 ? -h : h;
12339
12380
  }
12340
- n.matrix.compose(Ce, It, Bt);
12341
- const o = e.position ? Ce.clone().sub(e.position) : Ce;
12342
- return Pt.makeTranslation(-o.x, -o.y, 0), pn.makeRotationZ(u), n.matrix.multiply(Pt), n.matrix.multiply(pn), n.matrix.multiply(Pt.invert()), n.matrix.decompose(n.position, n.quaternion, n.scale), n;
12381
+ n.matrix.compose(we, Pt, Bt);
12382
+ const o = e.position ? we.clone().sub(e.position) : we;
12383
+ return It.makeTranslation(-o.x, -o.y, 0), dn.makeRotationZ(u), n.matrix.multiply(It), n.matrix.multiply(dn), n.matrix.multiply(It.invert()), n.matrix.decompose(n.position, n.quaternion, n.scale), n;
12343
12384
  }
12344
12385
  /**
12345
12386
  * Creates a group of text elements from MText data.
@@ -12353,11 +12394,11 @@ class Sl extends R.Object3D {
12353
12394
  this.styleManager.unsupportedTextStyles[g] || (this.styleManager.unsupportedTextStyles[g] = 0), this.styleManager.unsupportedTextStyles[g]++;
12354
12395
  }
12355
12396
  const n = e.width || 0;
12356
- let a = fe.LEFT;
12357
- e.width && e.attachmentPoint && ([1, 4, 7].includes(e.attachmentPoint) ? a = fe.LEFT : [2, 5, 8].includes(e.attachmentPoint) ? a = fe.CENTER : [3, 6, 9].includes(e.attachmentPoint) && (a = fe.RIGHT));
12397
+ let a = se.LEFT;
12398
+ e.width && e.attachmentPoint && ([1, 4, 7].includes(e.attachmentPoint) ? a = se.LEFT : [2, 5, 8].includes(e.attachmentPoint) ? a = se.CENTER : [3, 6, 9].includes(e.attachmentPoint) && (a = se.RIGHT));
12358
12399
  let s = _e.BOTTOM;
12359
12400
  e.attachmentPoint && ([1, 2, 3].includes(e.attachmentPoint) ? s = _e.TOP : [4, 5, 6].includes(e.attachmentPoint) ? s = _e.MIDDLE : [7, 8, 9].includes(e.attachmentPoint) && (s = _e.BOTTOM));
12360
- const i = e.height || 0, u = e.lineSpaceFactor || 0.3, o = e.drawingDirection ?? Ze.LEFT_TO_RIGHT, l = {
12401
+ const i = e.height || 0, u = e.lineSpaceFactor || 0.3, o = e.drawingDirection ?? je.LEFT_TO_RIGHT, l = {
12361
12402
  fontSize: i,
12362
12403
  widthFactor: e.widthFactor ?? 1,
12363
12404
  lineSpaceFactor: u,
@@ -12367,7 +12408,7 @@ class Sl extends R.Object3D {
12367
12408
  byBlockColor: this._colorSettings.byBlockColor,
12368
12409
  byLayerColor: this._colorSettings.byLayerColor,
12369
12410
  removeFontExtension: !0
12370
- }, c = new yt();
12411
+ }, c = new mt();
12371
12412
  c.fontFace.family = r.font, c.capHeight = { value: e.height || 1, isRelative: !0 }, c.widthFactor = { value: e.widthFactor ?? 1, isRelative: !0 }, c.align = s, c.paragraph.align = a;
12372
12413
  const h = new pl(e.text, c, !0).parse(), f = new gl(
12373
12414
  r,
@@ -12420,7 +12461,7 @@ class Sl extends R.Object3D {
12420
12461
  s -= e, i += r;
12421
12462
  break;
12422
12463
  }
12423
- return a == Ze.BOTTOM_TO_TOP && (i -= r), { x: s, y: i };
12464
+ return a == je.BOTTOM_TO_TOP && (i -= r), { x: s, y: i };
12424
12465
  }
12425
12466
  /**
12426
12467
  * Recursively calculates bounding boxes for an object and its children.
@@ -12455,14 +12496,14 @@ class kl {
12455
12496
  }
12456
12497
  }
12457
12498
  export {
12458
- vn as BaseFont,
12459
- gn as BaseTextShape,
12499
+ gn as BaseFont,
12500
+ yn as BaseTextShape,
12460
12501
  bl as DefaultFontLoader,
12461
- fr as EventManager,
12502
+ pr as EventManager,
12462
12503
  Se as FontFactory,
12463
12504
  Me as FontManager,
12464
12505
  Sl as MText,
12465
12506
  cl as MTextAttachmentPoint,
12466
- Ze as MTextFlowDirection,
12507
+ je as MTextFlowDirection,
12467
12508
  kl as StyleManager
12468
12509
  };