@mlightcad/mtext-renderer 0.2.4 → 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 +884 -840
- package/dist/index.umd.cjs +3 -3
- package/dist/renderer/mtextProcessor.d.ts +6 -17
- package/package.json +2 -2
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
|
|
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
|
|
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
|
|
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
|
|
59
|
+
let dr, vr;
|
|
60
60
|
function xa() {
|
|
61
|
-
return
|
|
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
|
|
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(),
|
|
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
|
|
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
|
|
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 (
|
|
139
|
-
return
|
|
138
|
+
if (St.has(t))
|
|
139
|
+
return St.get(t);
|
|
140
140
|
const e = Fa(t);
|
|
141
|
-
return e !== t && (
|
|
141
|
+
return e !== t && (St.set(t, e), vt.set(e, t)), e;
|
|
142
142
|
}
|
|
143
|
-
const Ht = (t) =>
|
|
144
|
-
function
|
|
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
|
|
159
|
-
function
|
|
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 (
|
|
163
|
-
return
|
|
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 ||
|
|
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
|
|
178
|
+
return kt.set(e, s), s;
|
|
179
179
|
}
|
|
180
|
-
|
|
180
|
+
mn((t) => ({
|
|
181
181
|
...t,
|
|
182
|
-
get: (e, r, n) =>
|
|
183
|
-
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"],
|
|
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 =
|
|
190
|
-
return r || (r =
|
|
191
|
-
zt.set(this,
|
|
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 (
|
|
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
|
|
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
|
-
|
|
207
|
+
mn((t) => ({
|
|
208
208
|
...t,
|
|
209
209
|
get(e, r, n) {
|
|
210
|
-
return
|
|
210
|
+
return mr(e, r) ? La : t.get(e, r, n);
|
|
211
211
|
},
|
|
212
212
|
has(e, r) {
|
|
213
|
-
return
|
|
213
|
+
return mr(e, r) || t.has(e, r);
|
|
214
214
|
}
|
|
215
215
|
}));
|
|
216
216
|
const Ae = {
|
|
217
217
|
fonts: "fonts"
|
|
218
|
-
},
|
|
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
|
|
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 =
|
|
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 =
|
|
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),
|
|
348
|
-
const e =
|
|
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);
|
|
@@ -643,7 +643,7 @@ function Pa(t, e, r, n, a) {
|
|
|
643
643
|
return;
|
|
644
644
|
}
|
|
645
645
|
const i = new va();
|
|
646
|
-
let u, o, l, c, p, h, f,
|
|
646
|
+
let u, o, l, c, p, h, f, d;
|
|
647
647
|
if (s.o) {
|
|
648
648
|
const g = s._cachedOutline || (s._cachedOutline = s.o.split(" "));
|
|
649
649
|
for (let y = 0, m = g.length; y < m; )
|
|
@@ -658,7 +658,7 @@ function Pa(t, e, r, n, a) {
|
|
|
658
658
|
l = g[y++] * e + r, c = g[y++] * e + n, p = g[y++] * e + r, h = g[y++] * e + n, i.quadraticCurveTo(p, h, l, c);
|
|
659
659
|
break;
|
|
660
660
|
case "b":
|
|
661
|
-
l = g[y++] * e + r, c = g[y++] * e + n, p = g[y++] * e + r, h = g[y++] * e + n, f = g[y++] * e + r,
|
|
661
|
+
l = g[y++] * e + r, c = g[y++] * e + n, p = g[y++] * e + r, h = g[y++] * e + n, f = g[y++] * e + r, d = g[y++] * e + n, i.bezierCurveTo(p, h, f, d, l, c);
|
|
662
662
|
break;
|
|
663
663
|
}
|
|
664
664
|
}
|
|
@@ -676,7 +676,7 @@ class Ia extends ga {
|
|
|
676
676
|
this.type = "TextGeometry";
|
|
677
677
|
}
|
|
678
678
|
}
|
|
679
|
-
class
|
|
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
|
}
|
|
@@ -734,14 +734,14 @@ String.prototype.codePointAt || function() {
|
|
|
734
734
|
writable: !0
|
|
735
735
|
}) : String.prototype.codePointAt = e;
|
|
736
736
|
}();
|
|
737
|
-
var Jt = 0,
|
|
738
|
-
function
|
|
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
|
|
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
|
|
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
|
-
]),
|
|
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
|
|
792
|
-
function
|
|
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
|
-
|
|
799
|
+
kr[a] = s, s += t.table[a];
|
|
800
800
|
for (a = 0; a < n; ++a)
|
|
801
|
-
e[r + a] && (t.trans[
|
|
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
|
|
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 =
|
|
828
|
-
|
|
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 =
|
|
831
|
-
|
|
830
|
+
var l = fe(t, 3, 0);
|
|
831
|
+
he[Na[i]] = l;
|
|
832
832
|
}
|
|
833
|
-
for (
|
|
834
|
-
var c = Wt(t,
|
|
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 =
|
|
838
|
-
for (o =
|
|
839
|
-
|
|
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 =
|
|
843
|
-
|
|
842
|
+
for (o = fe(t, 3, 3); o; --o)
|
|
843
|
+
he[u++] = 0;
|
|
844
844
|
break;
|
|
845
845
|
case 18:
|
|
846
|
-
for (o =
|
|
847
|
-
|
|
846
|
+
for (o = fe(t, 7, 11); o; --o)
|
|
847
|
+
he[u++] = 0;
|
|
848
848
|
break;
|
|
849
849
|
default:
|
|
850
|
-
|
|
850
|
+
he[u++] = c;
|
|
851
851
|
break;
|
|
852
852
|
}
|
|
853
853
|
}
|
|
854
|
-
|
|
854
|
+
Ft(e, he, 0, n), Ft(r, he, n, a);
|
|
855
855
|
}
|
|
856
|
-
function
|
|
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 =
|
|
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
|
|
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 =
|
|
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 =
|
|
887
|
+
s = Tr(r, kn, Tn);
|
|
888
888
|
break;
|
|
889
889
|
case 2:
|
|
890
|
-
za(r, r.ltree, r.dtree), s =
|
|
890
|
+
za(r, r.ltree, r.dtree), s = Tr(r, r.ltree, r.dtree);
|
|
891
891
|
break;
|
|
892
892
|
default:
|
|
893
|
-
s =
|
|
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(
|
|
900
|
+
_a(kn, Tn);
|
|
901
901
|
wn($t, er, 4, 3);
|
|
902
|
-
wn(
|
|
902
|
+
wn(Fn, Cn, 2, 1);
|
|
903
903
|
$t[28] = 0;
|
|
904
904
|
er[28] = 258;
|
|
905
905
|
var qa = Va;
|
|
@@ -925,19 +925,19 @@ Fe.prototype.addBezier = function(t, e, r, n, a, s, i, u) {
|
|
|
925
925
|
var o = [t, e], l = [r, n], c = [a, s], p = [i, u];
|
|
926
926
|
this.addPoint(t, e), this.addPoint(i, u);
|
|
927
927
|
for (var h = 0; h <= 1; h++) {
|
|
928
|
-
var f = 6 * o[h] - 12 * l[h] + 6 * c[h],
|
|
929
|
-
if (
|
|
928
|
+
var f = 6 * o[h] - 12 * l[h] + 6 * c[h], d = -3 * o[h] + 9 * l[h] - 9 * c[h] + 3 * p[h], g = 3 * l[h] - 3 * o[h];
|
|
929
|
+
if (d === 0) {
|
|
930
930
|
if (f === 0)
|
|
931
931
|
continue;
|
|
932
932
|
var y = -g / f;
|
|
933
933
|
0 < y && y < 1 && (h === 0 && this.addX(Re(o[h], l[h], c[h], p[h], y)), h === 1 && this.addY(Re(o[h], l[h], c[h], p[h], y)));
|
|
934
934
|
continue;
|
|
935
935
|
}
|
|
936
|
-
var m = Math.pow(f, 2) - 4 * g *
|
|
936
|
+
var m = Math.pow(f, 2) - 4 * g * d;
|
|
937
937
|
if (!(m < 0)) {
|
|
938
|
-
var S = (-f + Math.sqrt(m)) / (2 *
|
|
938
|
+
var S = (-f + Math.sqrt(m)) / (2 * d);
|
|
939
939
|
0 < S && S < 1 && (h === 0 && this.addX(Re(o[h], l[h], c[h], p[h], S)), h === 1 && this.addY(Re(o[h], l[h], c[h], p[h], S)));
|
|
940
|
-
var x = (-f - Math.sqrt(m)) / (2 *
|
|
940
|
+
var x = (-f - Math.sqrt(m)) / (2 * d);
|
|
941
941
|
0 < x && x < 1 && (h === 0 && this.addX(Re(o[h], l[h], c[h], p[h], x)), h === 1 && this.addY(Re(o[h], l[h], c[h], p[h], x)));
|
|
942
942
|
}
|
|
943
943
|
}
|
|
@@ -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
|
|
1060
|
+
function En(t) {
|
|
1061
1061
|
throw new Error(t);
|
|
1062
1062
|
}
|
|
1063
|
-
function
|
|
1064
|
-
t ||
|
|
1063
|
+
function Fr(t, e) {
|
|
1064
|
+
t || En(e);
|
|
1065
1065
|
}
|
|
1066
|
-
var E = { fail:
|
|
1067
|
-
function
|
|
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 =
|
|
1075
|
+
U.BYTE = le(1);
|
|
1076
1076
|
b.CHAR = function(t) {
|
|
1077
1077
|
return [t.charCodeAt(0)];
|
|
1078
1078
|
};
|
|
1079
|
-
U.CHAR =
|
|
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 =
|
|
1092
|
+
U.USHORT = le(2);
|
|
1093
1093
|
b.SHORT = function(t) {
|
|
1094
|
-
return t >=
|
|
1094
|
+
return t >= Cr && (t = -(2 * Cr - t)), [t >> 8 & 255, t & 255];
|
|
1095
1095
|
};
|
|
1096
|
-
U.SHORT =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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) {
|
|
@@ -1241,16 +1241,16 @@ Pe.MACSTRING = function(t, e, r, n) {
|
|
|
1241
1241
|
return s;
|
|
1242
1242
|
}
|
|
1243
1243
|
};
|
|
1244
|
-
var
|
|
1245
|
-
if (!
|
|
1246
|
-
|
|
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
|
-
|
|
1248
|
+
nt[e] = new String(e);
|
|
1249
1249
|
}
|
|
1250
|
-
var r =
|
|
1250
|
+
var r = nt[t];
|
|
1251
1251
|
if (r !== void 0) {
|
|
1252
|
-
if (
|
|
1253
|
-
var n =
|
|
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
|
|
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
|
|
1375
|
+
var at = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap();
|
|
1376
1376
|
b.CHARSTRING = function(t) {
|
|
1377
|
-
if (
|
|
1378
|
-
var e =
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
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(
|
|
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
|
-
|
|
1489
|
-
|
|
1490
|
-
function
|
|
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
|
-
|
|
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(
|
|
1503
|
-
].concat(
|
|
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(
|
|
1510
|
+
].concat(qe("featureIndex", u.featureIndexes))) }
|
|
1511
1511
|
];
|
|
1512
1512
|
}))) }
|
|
1513
1513
|
];
|
|
1514
1514
|
})
|
|
1515
1515
|
);
|
|
1516
1516
|
}
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
function
|
|
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
|
-
|
|
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(
|
|
1529
|
+
].concat(qe("lookupListIndex", n.lookupListIndexes))) }
|
|
1530
1530
|
];
|
|
1531
1531
|
})
|
|
1532
1532
|
);
|
|
1533
1533
|
}
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
function
|
|
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
|
-
|
|
1546
|
-
|
|
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:
|
|
1551
|
-
ScriptList:
|
|
1552
|
-
FeatureList:
|
|
1553
|
-
LookupList:
|
|
1554
|
-
ushortList:
|
|
1550
|
+
Coverage: lt,
|
|
1551
|
+
ScriptList: ct,
|
|
1552
|
+
FeatureList: ht,
|
|
1553
|
+
LookupList: ft,
|
|
1554
|
+
ushortList: qe,
|
|
1555
1555
|
tableList: Xt,
|
|
1556
|
-
recordList:
|
|
1556
|
+
recordList: Xe
|
|
1557
1557
|
};
|
|
1558
|
-
function
|
|
1558
|
+
function Er(t, e) {
|
|
1559
1559
|
return t.getUint8(e);
|
|
1560
1560
|
}
|
|
1561
|
-
function
|
|
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
|
|
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
|
}
|
|
@@ -1600,98 +1600,98 @@ var ts = {
|
|
|
1600
1600
|
longDateTime: 8,
|
|
1601
1601
|
tag: 4
|
|
1602
1602
|
};
|
|
1603
|
-
function
|
|
1603
|
+
function v(t, e) {
|
|
1604
1604
|
this.data = t, this.offset = e, this.relativeOffset = 0;
|
|
1605
1605
|
}
|
|
1606
|
-
|
|
1606
|
+
v.prototype.parseByte = function() {
|
|
1607
1607
|
var t = this.data.getUint8(this.offset + this.relativeOffset);
|
|
1608
1608
|
return this.relativeOffset += 1, t;
|
|
1609
1609
|
};
|
|
1610
|
-
|
|
1610
|
+
v.prototype.parseChar = function() {
|
|
1611
1611
|
var t = this.data.getInt8(this.offset + this.relativeOffset);
|
|
1612
1612
|
return this.relativeOffset += 1, t;
|
|
1613
1613
|
};
|
|
1614
|
-
|
|
1615
|
-
|
|
1614
|
+
v.prototype.parseCard8 = v.prototype.parseByte;
|
|
1615
|
+
v.prototype.parseUShort = function() {
|
|
1616
1616
|
var t = this.data.getUint16(this.offset + this.relativeOffset);
|
|
1617
1617
|
return this.relativeOffset += 2, t;
|
|
1618
1618
|
};
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1619
|
+
v.prototype.parseCard16 = v.prototype.parseUShort;
|
|
1620
|
+
v.prototype.parseSID = v.prototype.parseUShort;
|
|
1621
|
+
v.prototype.parseOffset16 = v.prototype.parseUShort;
|
|
1622
|
+
v.prototype.parseShort = function() {
|
|
1623
1623
|
var t = this.data.getInt16(this.offset + this.relativeOffset);
|
|
1624
1624
|
return this.relativeOffset += 2, t;
|
|
1625
1625
|
};
|
|
1626
|
-
|
|
1626
|
+
v.prototype.parseF2Dot14 = function() {
|
|
1627
1627
|
var t = this.data.getInt16(this.offset + this.relativeOffset) / 16384;
|
|
1628
1628
|
return this.relativeOffset += 2, t;
|
|
1629
1629
|
};
|
|
1630
|
-
|
|
1630
|
+
v.prototype.parseULong = function() {
|
|
1631
1631
|
var t = tr(this.data, this.offset + this.relativeOffset);
|
|
1632
1632
|
return this.relativeOffset += 4, t;
|
|
1633
1633
|
};
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
var t =
|
|
1634
|
+
v.prototype.parseOffset32 = v.prototype.parseULong;
|
|
1635
|
+
v.prototype.parseFixed = function() {
|
|
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) {
|
|
1640
1640
|
var e = this.data, r = this.offset + this.relativeOffset, n = "";
|
|
1641
1641
|
this.relativeOffset += t;
|
|
1642
1642
|
for (var a = 0; a < t; a++)
|
|
1643
1643
|
n += String.fromCharCode(e.getUint8(r + a));
|
|
1644
1644
|
return n;
|
|
1645
1645
|
};
|
|
1646
|
-
|
|
1646
|
+
v.prototype.parseTag = function() {
|
|
1647
1647
|
return this.parseString(4);
|
|
1648
1648
|
};
|
|
1649
|
-
|
|
1649
|
+
v.prototype.parseLongDateTime = function() {
|
|
1650
1650
|
var t = tr(this.data, this.offset + this.relativeOffset + 4);
|
|
1651
1651
|
return t -= 2082844800, this.relativeOffset += 8, t;
|
|
1652
1652
|
};
|
|
1653
|
-
|
|
1654
|
-
var e =
|
|
1653
|
+
v.prototype.parseVersion = function(t) {
|
|
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) {
|
|
1658
1658
|
e === void 0 && (e = 1), this.relativeOffset += ts[t] * e;
|
|
1659
1659
|
};
|
|
1660
|
-
|
|
1660
|
+
v.prototype.parseULongList = function(t) {
|
|
1661
1661
|
t === void 0 && (t = this.parseULong());
|
|
1662
1662
|
for (var e = new Array(t), r = this.data, n = this.offset + this.relativeOffset, a = 0; a < t; a++)
|
|
1663
1663
|
e[a] = r.getUint32(n), n += 4;
|
|
1664
1664
|
return this.relativeOffset += t * 4, e;
|
|
1665
1665
|
};
|
|
1666
|
-
|
|
1666
|
+
v.prototype.parseOffset16List = v.prototype.parseUShortList = function(t) {
|
|
1667
1667
|
t === void 0 && (t = this.parseUShort());
|
|
1668
1668
|
for (var e = new Array(t), r = this.data, n = this.offset + this.relativeOffset, a = 0; a < t; a++)
|
|
1669
1669
|
e[a] = r.getUint16(n), n += 2;
|
|
1670
1670
|
return this.relativeOffset += t * 2, e;
|
|
1671
1671
|
};
|
|
1672
|
-
|
|
1672
|
+
v.prototype.parseShortList = function(t) {
|
|
1673
1673
|
for (var e = new Array(t), r = this.data, n = this.offset + this.relativeOffset, a = 0; a < t; a++)
|
|
1674
1674
|
e[a] = r.getInt16(n), n += 2;
|
|
1675
1675
|
return this.relativeOffset += t * 2, e;
|
|
1676
1676
|
};
|
|
1677
|
-
|
|
1677
|
+
v.prototype.parseByteList = function(t) {
|
|
1678
1678
|
for (var e = new Array(t), r = this.data, n = this.offset + this.relativeOffset, a = 0; a < t; a++)
|
|
1679
1679
|
e[a] = r.getUint8(n++);
|
|
1680
1680
|
return this.relativeOffset += t, e;
|
|
1681
1681
|
};
|
|
1682
|
-
|
|
1682
|
+
v.prototype.parseList = function(t, e) {
|
|
1683
1683
|
e || (e = t, t = this.parseUShort());
|
|
1684
1684
|
for (var r = new Array(t), n = 0; n < t; n++)
|
|
1685
1685
|
r[n] = e.call(this);
|
|
1686
1686
|
return r;
|
|
1687
1687
|
};
|
|
1688
|
-
|
|
1688
|
+
v.prototype.parseList32 = function(t, e) {
|
|
1689
1689
|
e || (e = t, t = this.parseULong());
|
|
1690
1690
|
for (var r = new Array(t), n = 0; n < t; n++)
|
|
1691
1691
|
r[n] = e.call(this);
|
|
1692
1692
|
return r;
|
|
1693
1693
|
};
|
|
1694
|
-
|
|
1694
|
+
v.prototype.parseRecordList = function(t, e) {
|
|
1695
1695
|
e || (e = t, t = this.parseUShort());
|
|
1696
1696
|
for (var r = new Array(t), n = Object.keys(e), a = 0; a < t; a++) {
|
|
1697
1697
|
for (var s = {}, i = 0; i < n.length; i++) {
|
|
@@ -1702,7 +1702,7 @@ d.prototype.parseRecordList = function(t, e) {
|
|
|
1702
1702
|
}
|
|
1703
1703
|
return r;
|
|
1704
1704
|
};
|
|
1705
|
-
|
|
1705
|
+
v.prototype.parseRecordList32 = function(t, e) {
|
|
1706
1706
|
e || (e = t, t = this.parseULong());
|
|
1707
1707
|
for (var r = new Array(t), n = Object.keys(e), a = 0; a < t; a++) {
|
|
1708
1708
|
for (var s = {}, i = 0; i < n.length; i++) {
|
|
@@ -1713,7 +1713,7 @@ d.prototype.parseRecordList32 = function(t, e) {
|
|
|
1713
1713
|
}
|
|
1714
1714
|
return r;
|
|
1715
1715
|
};
|
|
1716
|
-
|
|
1716
|
+
v.prototype.parseStruct = function(t) {
|
|
1717
1717
|
if (typeof t == "function")
|
|
1718
1718
|
return t.call(this);
|
|
1719
1719
|
for (var e = Object.keys(t), r = {}, n = 0; n < e.length; n++) {
|
|
@@ -1722,28 +1722,28 @@ d.prototype.parseStruct = function(t) {
|
|
|
1722
1722
|
}
|
|
1723
1723
|
return r;
|
|
1724
1724
|
};
|
|
1725
|
-
|
|
1725
|
+
v.prototype.parseValueRecord = function(t) {
|
|
1726
1726
|
if (t === void 0 && (t = this.parseUShort()), t !== 0) {
|
|
1727
1727
|
var e = {};
|
|
1728
1728
|
return t & 1 && (e.xPlacement = this.parseShort()), t & 2 && (e.yPlacement = this.parseShort()), t & 4 && (e.xAdvance = this.parseShort()), t & 8 && (e.yAdvance = this.parseShort()), t & 16 && (e.xPlaDevice = void 0, this.parseShort()), t & 32 && (e.yPlaDevice = void 0, this.parseShort()), t & 64 && (e.xAdvDevice = void 0, this.parseShort()), t & 128 && (e.yAdvDevice = void 0, this.parseShort()), e;
|
|
1729
1729
|
}
|
|
1730
1730
|
};
|
|
1731
|
-
|
|
1731
|
+
v.prototype.parseValueRecordList = function() {
|
|
1732
1732
|
for (var t = this.parseUShort(), e = this.parseUShort(), r = new Array(e), n = 0; n < e; n++)
|
|
1733
1733
|
r[n] = this.parseValueRecord(t);
|
|
1734
1734
|
return r;
|
|
1735
1735
|
};
|
|
1736
|
-
|
|
1736
|
+
v.prototype.parsePointer = function(t) {
|
|
1737
1737
|
var e = this.parseOffset16();
|
|
1738
1738
|
if (e > 0)
|
|
1739
|
-
return new
|
|
1739
|
+
return new v(this.data, this.offset + e).parseStruct(t);
|
|
1740
1740
|
};
|
|
1741
|
-
|
|
1741
|
+
v.prototype.parsePointer32 = function(t) {
|
|
1742
1742
|
var e = this.parseOffset32();
|
|
1743
1743
|
if (e > 0)
|
|
1744
|
-
return new
|
|
1744
|
+
return new v(this.data, this.offset + e).parseStruct(t);
|
|
1745
1745
|
};
|
|
1746
|
-
|
|
1746
|
+
v.prototype.parseListOfLists = function(t) {
|
|
1747
1747
|
for (var e = this.parseOffset16List(), r = e.length, n = this.relativeOffset, a = new Array(r), s = 0; s < r; s++) {
|
|
1748
1748
|
var i = e[s];
|
|
1749
1749
|
if (i === 0) {
|
|
@@ -1759,7 +1759,7 @@ d.prototype.parseListOfLists = function(t) {
|
|
|
1759
1759
|
}
|
|
1760
1760
|
return this.relativeOffset = n, a;
|
|
1761
1761
|
};
|
|
1762
|
-
|
|
1762
|
+
v.prototype.parseCoverage = function() {
|
|
1763
1763
|
var t = this.offset + this.relativeOffset, e = this.parseUShort(), r = this.parseUShort();
|
|
1764
1764
|
if (e === 1)
|
|
1765
1765
|
return {
|
|
@@ -1780,7 +1780,7 @@ d.prototype.parseCoverage = function() {
|
|
|
1780
1780
|
}
|
|
1781
1781
|
throw new Error("0x" + t.toString(16) + ": Coverage format must be 1 or 2.");
|
|
1782
1782
|
};
|
|
1783
|
-
|
|
1783
|
+
v.prototype.parseClassDef = function() {
|
|
1784
1784
|
var t = this.offset + this.relativeOffset, e = this.parseUShort();
|
|
1785
1785
|
if (e === 1)
|
|
1786
1786
|
return {
|
|
@@ -1792,115 +1792,115 @@ d.prototype.parseClassDef = function() {
|
|
|
1792
1792
|
return {
|
|
1793
1793
|
format: 2,
|
|
1794
1794
|
ranges: this.parseRecordList({
|
|
1795
|
-
start:
|
|
1796
|
-
end:
|
|
1797
|
-
classId:
|
|
1795
|
+
start: v.uShort,
|
|
1796
|
+
end: v.uShort,
|
|
1797
|
+
classId: v.uShort
|
|
1798
1798
|
})
|
|
1799
1799
|
};
|
|
1800
1800
|
throw new Error("0x" + t.toString(16) + ": ClassDef format must be 1 or 2.");
|
|
1801
1801
|
};
|
|
1802
|
-
|
|
1802
|
+
v.list = function(t, e) {
|
|
1803
1803
|
return function() {
|
|
1804
1804
|
return this.parseList(t, e);
|
|
1805
1805
|
};
|
|
1806
1806
|
};
|
|
1807
|
-
|
|
1807
|
+
v.list32 = function(t, e) {
|
|
1808
1808
|
return function() {
|
|
1809
1809
|
return this.parseList32(t, e);
|
|
1810
1810
|
};
|
|
1811
1811
|
};
|
|
1812
|
-
|
|
1812
|
+
v.recordList = function(t, e) {
|
|
1813
1813
|
return function() {
|
|
1814
1814
|
return this.parseRecordList(t, e);
|
|
1815
1815
|
};
|
|
1816
1816
|
};
|
|
1817
|
-
|
|
1817
|
+
v.recordList32 = function(t, e) {
|
|
1818
1818
|
return function() {
|
|
1819
1819
|
return this.parseRecordList32(t, e);
|
|
1820
1820
|
};
|
|
1821
1821
|
};
|
|
1822
|
-
|
|
1822
|
+
v.pointer = function(t) {
|
|
1823
1823
|
return function() {
|
|
1824
1824
|
return this.parsePointer(t);
|
|
1825
1825
|
};
|
|
1826
1826
|
};
|
|
1827
|
-
|
|
1827
|
+
v.pointer32 = function(t) {
|
|
1828
1828
|
return function() {
|
|
1829
1829
|
return this.parsePointer32(t);
|
|
1830
1830
|
};
|
|
1831
1831
|
};
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
var
|
|
1842
|
-
reserved:
|
|
1843
|
-
reqFeatureIndex:
|
|
1844
|
-
featureIndexes:
|
|
1845
|
-
};
|
|
1846
|
-
|
|
1847
|
-
return this.parsePointer(
|
|
1848
|
-
tag:
|
|
1849
|
-
script:
|
|
1850
|
-
defaultLangSys:
|
|
1851
|
-
langSysRecords:
|
|
1852
|
-
tag:
|
|
1853
|
-
langSys:
|
|
1832
|
+
v.tag = v.prototype.parseTag;
|
|
1833
|
+
v.byte = v.prototype.parseByte;
|
|
1834
|
+
v.uShort = v.offset16 = v.prototype.parseUShort;
|
|
1835
|
+
v.uShortList = v.prototype.parseUShortList;
|
|
1836
|
+
v.uLong = v.offset32 = v.prototype.parseULong;
|
|
1837
|
+
v.uLongList = v.prototype.parseULongList;
|
|
1838
|
+
v.struct = v.prototype.parseStruct;
|
|
1839
|
+
v.coverage = v.prototype.parseCoverage;
|
|
1840
|
+
v.classDef = v.prototype.parseClassDef;
|
|
1841
|
+
var Or = {
|
|
1842
|
+
reserved: v.uShort,
|
|
1843
|
+
reqFeatureIndex: v.uShort,
|
|
1844
|
+
featureIndexes: v.uShortList
|
|
1845
|
+
};
|
|
1846
|
+
v.prototype.parseScriptList = function() {
|
|
1847
|
+
return this.parsePointer(v.recordList({
|
|
1848
|
+
tag: v.tag,
|
|
1849
|
+
script: v.pointer({
|
|
1850
|
+
defaultLangSys: v.pointer(Or),
|
|
1851
|
+
langSysRecords: v.recordList({
|
|
1852
|
+
tag: v.tag,
|
|
1853
|
+
langSys: v.pointer(Or)
|
|
1854
1854
|
})
|
|
1855
1855
|
})
|
|
1856
1856
|
})) || [];
|
|
1857
1857
|
};
|
|
1858
|
-
|
|
1859
|
-
return this.parsePointer(
|
|
1860
|
-
tag:
|
|
1861
|
-
feature:
|
|
1862
|
-
featureParams:
|
|
1863
|
-
lookupListIndexes:
|
|
1858
|
+
v.prototype.parseFeatureList = function() {
|
|
1859
|
+
return this.parsePointer(v.recordList({
|
|
1860
|
+
tag: v.tag,
|
|
1861
|
+
feature: v.pointer({
|
|
1862
|
+
featureParams: v.offset16,
|
|
1863
|
+
lookupListIndexes: v.uShortList
|
|
1864
1864
|
})
|
|
1865
1865
|
})) || [];
|
|
1866
1866
|
};
|
|
1867
|
-
|
|
1868
|
-
return this.parsePointer(
|
|
1867
|
+
v.prototype.parseLookupList = function(t) {
|
|
1868
|
+
return this.parsePointer(v.list(v.pointer(function() {
|
|
1869
1869
|
var e = this.parseUShort();
|
|
1870
1870
|
E.argument(1 <= e && e <= 9, "GPOS/GSUB lookup type " + e + " unknown.");
|
|
1871
1871
|
var r = this.parseUShort(), n = r & 16;
|
|
1872
1872
|
return {
|
|
1873
1873
|
lookupType: e,
|
|
1874
1874
|
lookupFlag: r,
|
|
1875
|
-
subtables: this.parseList(
|
|
1875
|
+
subtables: this.parseList(v.pointer(t[e])),
|
|
1876
1876
|
markFilteringSet: n ? this.parseUShort() : void 0
|
|
1877
1877
|
};
|
|
1878
1878
|
}))) || [];
|
|
1879
1879
|
};
|
|
1880
|
-
|
|
1880
|
+
v.prototype.parseFeatureVariationsList = function() {
|
|
1881
1881
|
return this.parsePointer32(function() {
|
|
1882
1882
|
var t = this.parseUShort(), e = this.parseUShort();
|
|
1883
1883
|
E.argument(t === 1 && e < 1, "GPOS/GSUB feature variations table unknown.");
|
|
1884
1884
|
var r = this.parseRecordList32({
|
|
1885
|
-
conditionSetOffset:
|
|
1886
|
-
featureTableSubstitutionOffset:
|
|
1885
|
+
conditionSetOffset: v.offset32,
|
|
1886
|
+
featureTableSubstitutionOffset: v.offset32
|
|
1887
1887
|
});
|
|
1888
1888
|
return r;
|
|
1889
1889
|
}) || [];
|
|
1890
1890
|
};
|
|
1891
1891
|
var F = {
|
|
1892
|
-
getByte:
|
|
1893
|
-
getCard8:
|
|
1894
|
-
getUShort:
|
|
1895
|
-
getCard16:
|
|
1892
|
+
getByte: Er,
|
|
1893
|
+
getCard8: Er,
|
|
1894
|
+
getUShort: pt,
|
|
1895
|
+
getCard16: pt,
|
|
1896
1896
|
getShort: Ka,
|
|
1897
1897
|
getULong: tr,
|
|
1898
|
-
getFixed:
|
|
1898
|
+
getFixed: On,
|
|
1899
1899
|
getTag: Qa,
|
|
1900
1900
|
getOffset: Ja,
|
|
1901
1901
|
getBytes: $a,
|
|
1902
1902
|
bytesToString: es,
|
|
1903
|
-
Parser:
|
|
1903
|
+
Parser: v
|
|
1904
1904
|
};
|
|
1905
1905
|
function rs(t, e) {
|
|
1906
1906
|
e.parseUShort(), t.length = e.parseULong(), t.language = e.parseULong();
|
|
@@ -1915,8 +1915,8 @@ function ns(t, e, r, n, a) {
|
|
|
1915
1915
|
var s;
|
|
1916
1916
|
t.segCount = s = e.parseUShort() >> 1, e.skip("uShort", 3), t.glyphIndexMap = {};
|
|
1917
1917
|
for (var i = new F.Parser(r, n + a + 14), u = new F.Parser(r, n + a + 16 + s * 2), o = new F.Parser(r, n + a + 16 + s * 4), l = new F.Parser(r, n + a + 16 + s * 6), c = n + a + 16 + s * 8, p = 0; p < s - 1; p += 1)
|
|
1918
|
-
for (var h = void 0, f = i.parseUShort(),
|
|
1919
|
-
y !== 0 ? (c = l.offset + l.relativeOffset - 2, c += y, c += (m -
|
|
1918
|
+
for (var h = void 0, f = i.parseUShort(), d = u.parseUShort(), g = o.parseShort(), y = l.parseUShort(), m = d; m <= f; m += 1)
|
|
1919
|
+
y !== 0 ? (c = l.offset + l.relativeOffset - 2, c += y, c += (m - d) * 2, h = F.getUShort(r, c), h !== 0 && (h = h + g & 65535)) : h = m + g & 65535, t.glyphIndexMap[m] = h;
|
|
1920
1920
|
}
|
|
1921
1921
|
function as(t, e) {
|
|
1922
1922
|
var r = {};
|
|
@@ -1998,14 +1998,14 @@ function os(t) {
|
|
|
1998
1998
|
});
|
|
1999
1999
|
}
|
|
2000
2000
|
is(s);
|
|
2001
|
-
var o = s.segments.length, l = 0, c = [], p = [], h = [], f = [],
|
|
2001
|
+
var o = s.segments.length, l = 0, c = [], p = [], h = [], f = [], d = [], g = [];
|
|
2002
2002
|
for (r = 0; r < o; r += 1) {
|
|
2003
2003
|
var y = s.segments[r];
|
|
2004
|
-
y.end <= 65535 && y.start <= 65535 ? (c = c.concat({ name: "end_" + r, type: "USHORT", value: y.end }), p = p.concat({ name: "start_" + r, type: "USHORT", value: y.start }), h = h.concat({ name: "idDelta_" + r, type: "SHORT", value: y.delta }), f = f.concat({ name: "idRangeOffset_" + r, type: "USHORT", value: y.offset }), y.glyphId !== void 0 && (
|
|
2004
|
+
y.end <= 65535 && y.start <= 65535 ? (c = c.concat({ name: "end_" + r, type: "USHORT", value: y.end }), p = p.concat({ name: "start_" + r, type: "USHORT", value: y.start }), h = h.concat({ name: "idDelta_" + r, type: "SHORT", value: y.delta }), f = f.concat({ name: "idRangeOffset_" + r, type: "USHORT", value: y.offset }), y.glyphId !== void 0 && (d = d.concat({ name: "glyph_" + r, type: "USHORT", value: y.glyphId }))) : l += 1, !e && y.glyphIndex !== void 0 && (g = g.concat({ name: "cmap12Start_" + r, type: "ULONG", value: y.start }), g = g.concat({ name: "cmap12End_" + r, type: "ULONG", value: y.end }), g = g.concat({ name: "cmap12Glyph_" + r, type: "ULONG", value: y.glyphIndex }));
|
|
2005
2005
|
}
|
|
2006
|
-
if (s.segCountX2 = (o - l) * 2, s.searchRange = Math.pow(2, Math.floor(Math.log(o - l) / Math.log(2))) * 2, s.entrySelector = Math.log(s.searchRange / 2) / Math.log(2), s.rangeShift = s.segCountX2 - s.searchRange, s.fields = s.fields.concat(c), s.fields.push({ name: "reservedPad", type: "USHORT", value: 0 }), s.fields = s.fields.concat(p), s.fields = s.fields.concat(h), s.fields = s.fields.concat(f), s.fields = s.fields.concat(
|
|
2006
|
+
if (s.segCountX2 = (o - l) * 2, s.searchRange = Math.pow(2, Math.floor(Math.log(o - l) / Math.log(2))) * 2, s.entrySelector = Math.log(s.searchRange / 2) / Math.log(2), s.rangeShift = s.segCountX2 - s.searchRange, s.fields = s.fields.concat(c), s.fields.push({ name: "reservedPad", type: "USHORT", value: 0 }), s.fields = s.fields.concat(p), s.fields = s.fields.concat(h), s.fields = s.fields.concat(f), s.fields = s.fields.concat(d), s.cmap4Length = 14 + // Subtable header
|
|
2007
2007
|
c.length * 2 + 2 + // reservedPad
|
|
2008
|
-
p.length * 2 + h.length * 2 + f.length * 2 +
|
|
2008
|
+
p.length * 2 + h.length * 2 + f.length * 2 + d.length * 2, !e) {
|
|
2009
2009
|
var m = 16 + // Subtable header
|
|
2010
2010
|
g.length * 4;
|
|
2011
2011
|
s.cmap12Offset = 12 + 2 * 2 + 4 + s.cmap4Length, s.fields = s.fields.concat([
|
|
@@ -2018,7 +2018,7 @@ function os(t) {
|
|
|
2018
2018
|
}
|
|
2019
2019
|
return s;
|
|
2020
2020
|
}
|
|
2021
|
-
var
|
|
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
|
|
3182
|
+
function Ln(t) {
|
|
3183
3183
|
this.font = t;
|
|
3184
3184
|
}
|
|
3185
|
-
|
|
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
|
|
3195
|
+
function Rn(t) {
|
|
3196
3196
|
this.cmap = t;
|
|
3197
3197
|
}
|
|
3198
|
-
|
|
3198
|
+
Rn.prototype.charToGlyphIndex = function(t) {
|
|
3199
3199
|
return this.cmap.glyphIndexMap[t.codePointAt(0)] || 0;
|
|
3200
3200
|
};
|
|
3201
|
-
function
|
|
3201
|
+
function dt(t, e) {
|
|
3202
3202
|
this.encoding = t, this.charset = e;
|
|
3203
3203
|
}
|
|
3204
|
-
|
|
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
|
|
3260
|
+
var Ce = { line: ps };
|
|
3261
3261
|
function ds(t, e) {
|
|
3262
3262
|
var r = e || new _();
|
|
3263
3263
|
return {
|
|
@@ -3339,10 +3339,10 @@ ae.prototype.draw = function(t, e, r, n, a) {
|
|
|
3339
3339
|
this.getPath(e, r, n, a).draw(t);
|
|
3340
3340
|
};
|
|
3341
3341
|
ae.prototype.drawPoints = function(t, e, r, n) {
|
|
3342
|
-
function a(p, h, f,
|
|
3342
|
+
function a(p, h, f, d) {
|
|
3343
3343
|
t.beginPath();
|
|
3344
3344
|
for (var g = 0; g < p.length; g += 1)
|
|
3345
|
-
t.moveTo(h + p[g].x *
|
|
3345
|
+
t.moveTo(h + p[g].x * d, f + p[g].y * d), t.arc(h + p[g].x * d, f + p[g].y * d, 2, 0, Math.PI * 2, !1);
|
|
3346
3346
|
t.closePath(), t.fill();
|
|
3347
3347
|
}
|
|
3348
3348
|
e = e !== void 0 ? e : 0, r = r !== void 0 ? r : 0, n = n !== void 0 ? n : 24;
|
|
@@ -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",
|
|
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",
|
|
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
|
|
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
|
-
},
|
|
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
|
|
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 (!
|
|
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
|
|
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 =
|
|
3517
|
+
return e <= 390 ? e = ot[e] : e = t[e - 391], e;
|
|
3518
3518
|
}
|
|
3519
|
-
function
|
|
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
|
|
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,26 +3570,26 @@ 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
|
-
],
|
|
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 =
|
|
3580
|
-
return
|
|
3579
|
+
var r = Dn(t, 0, t.byteLength);
|
|
3580
|
+
return Mn(r, Bn, e);
|
|
3581
3581
|
}
|
|
3582
|
-
function
|
|
3583
|
-
var a =
|
|
3584
|
-
return
|
|
3582
|
+
function In(t, e, r, n) {
|
|
3583
|
+
var a = Dn(t, e, r);
|
|
3584
|
+
return Mn(a, Pn, n);
|
|
3585
3585
|
}
|
|
3586
|
-
function
|
|
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;
|
|
3590
3590
|
var o = u.private[0], l = u.private[1];
|
|
3591
3591
|
if (o !== 0 && l !== 0) {
|
|
3592
|
-
var c =
|
|
3592
|
+
var c = In(t, l + e, o, n);
|
|
3593
3593
|
if (u._defaultWidthX = c.defaultWidthX, u._nominalWidthX = c.nominalWidthX, c.subrs !== 0) {
|
|
3594
3594
|
var p = l + c.subrs, h = xe(t, p + e);
|
|
3595
3595
|
u._subrs = h.objects, u._subrsBias = Yt(u._subrs);
|
|
@@ -3600,7 +3600,7 @@ function Or(t, e, r, n) {
|
|
|
3600
3600
|
}
|
|
3601
3601
|
return a;
|
|
3602
3602
|
}
|
|
3603
|
-
function
|
|
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
|
|
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,26 +3636,26 @@ 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
|
|
3639
|
+
return new dt(a, r);
|
|
3640
3640
|
}
|
|
3641
|
-
function
|
|
3642
|
-
var n, a, s, i, u = new _(), o = [], l = 0, c = !1, p = !1, h = 0, f = 0,
|
|
3641
|
+
function Lr(t, e, r) {
|
|
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];
|
|
3645
|
-
|
|
3645
|
+
d = x._subrs, g = x._subrsBias, y = x._defaultWidthX, m = x._nominalWidthX;
|
|
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
|
|
3650
|
-
p && u.closePath(), u.moveTo(
|
|
3649
|
+
function C(w, N) {
|
|
3650
|
+
p && u.closePath(), u.moveTo(w, N), p = !0;
|
|
3651
3651
|
}
|
|
3652
3652
|
function D() {
|
|
3653
|
-
var
|
|
3654
|
-
|
|
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(
|
|
3657
|
-
for (var N, j, K, re, ne, G, H, V, q, X, z, Z, M = 0; M <
|
|
3658
|
-
var Y =
|
|
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(),
|
|
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; )
|
|
@@ -3683,12 +3683,12 @@ function Ur(t, e, r) {
|
|
|
3683
3683
|
n = h + o.shift(), a = f + o.shift(), s = n + o.shift(), i = a + o.shift(), h = s + o.shift(), f = i + o.shift(), u.curveTo(n, a, s, i, h, f);
|
|
3684
3684
|
break;
|
|
3685
3685
|
case 10:
|
|
3686
|
-
ne = o.pop() + g, G =
|
|
3686
|
+
ne = o.pop() + g, G = d[ne], G && L(G);
|
|
3687
3687
|
break;
|
|
3688
3688
|
case 11:
|
|
3689
3689
|
return;
|
|
3690
3690
|
case 12:
|
|
3691
|
-
switch (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(),
|
|
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(),
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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,10 +3803,10 @@ 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),
|
|
3807
|
-
c._fdArray =
|
|
3806
|
+
var f = xe(t, p), d = Ur(t, e, f.objects, u.objects);
|
|
3807
|
+
c._fdArray = d, h += e, c._fdSelect = Es(t, h, r.numGlyphs, d.length);
|
|
3808
3808
|
}
|
|
3809
|
-
var g = e + c.private[1], y =
|
|
3809
|
+
var g = e + c.private[1], y = In(t, g, c.private[0], u.objects);
|
|
3810
3810
|
if (r.defaultWidthX = y.defaultWidthX, r.nominalWidthX = y.nominalWidthX, y.subrs !== 0) {
|
|
3811
3811
|
var m = g + y.subrs, S = xe(t, m);
|
|
3812
3812
|
r.subrs = S.objects, r.subrsBias = Yt(r.subrs);
|
|
@@ -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 =
|
|
3818
|
-
if (c.encoding === 0 ? r.cffEncoding = new
|
|
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
|
|
3821
|
-
r.glyphs.push(L, de.cffGlyphLoader(r, L,
|
|
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
|
|
3825
|
-
var D = x.objects[
|
|
3826
|
-
r.glyphs.push(
|
|
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
|
|
3830
|
-
var r, n =
|
|
3831
|
-
return n >= 0 && (r = n), n = e.indexOf(t), n >= 0 ? r = n +
|
|
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
|
|
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 && !
|
|
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
|
|
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 =
|
|
3861
|
+
return r.dict = Nn(Bn, t, e), r;
|
|
3862
3862
|
}
|
|
3863
|
-
function
|
|
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 =
|
|
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;
|
|
@@ -3911,8 +3911,8 @@ function Ms(t) {
|
|
|
3911
3911
|
else if (o.type === "L")
|
|
3912
3912
|
i = Math.round(o.x - n), u = Math.round(o.y - a), e.push({ name: "dx", type: "NUMBER", value: i }), e.push({ name: "dy", type: "NUMBER", value: u }), e.push({ name: "rlineto", type: "OP", value: 5 }), n = Math.round(o.x), a = Math.round(o.y);
|
|
3913
3913
|
else if (o.type === "C") {
|
|
3914
|
-
var p = Math.round(o.x1 - n), h = Math.round(o.y1 - a), f = Math.round(o.x2 - o.x1),
|
|
3915
|
-
i = Math.round(o.x - o.x2), u = Math.round(o.y - o.y2), e.push({ name: "dx1", type: "NUMBER", value: p }), e.push({ name: "dy1", type: "NUMBER", value: h }), e.push({ name: "dx2", type: "NUMBER", value: f }), e.push({ name: "dy2", type: "NUMBER", value:
|
|
3914
|
+
var p = Math.round(o.x1 - n), h = Math.round(o.y1 - a), f = Math.round(o.x2 - o.x1), d = Math.round(o.y2 - o.y1);
|
|
3915
|
+
i = Math.round(o.x - o.x2), u = Math.round(o.y - o.y2), e.push({ name: "dx1", type: "NUMBER", value: p }), e.push({ name: "dy1", type: "NUMBER", value: h }), e.push({ name: "dx2", type: "NUMBER", value: f }), e.push({ name: "dy2", type: "NUMBER", value: d }), e.push({ name: "dx", type: "NUMBER", value: i }), e.push({ name: "dy", type: "NUMBER", value: u }), e.push({ name: "rrcurveto", type: "OP", value: 8 }), n = Math.round(o.x), a = Math.round(o.y);
|
|
3916
3916
|
}
|
|
3917
3917
|
}
|
|
3918
3918
|
return e.push({ name: "endchar", type: "OP", value: 14 }), e;
|
|
@@ -3930,7 +3930,7 @@ 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 =
|
|
3933
|
+
return r.dict = Nn(Pn, t, e), r;
|
|
3934
3934
|
}
|
|
3935
3935
|
function Is(t, e) {
|
|
3936
3936
|
for (var r = new k.Table("CFF ", [
|
|
@@ -3957,12 +3957,12 @@ function Is(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 =
|
|
3961
|
-
r.topDictIndex =
|
|
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 =
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
],
|
|
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
|
-
},
|
|
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
|
|
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 =
|
|
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 = Pe.UTF16(t, u + g,
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
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 =
|
|
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
|
-
for (var
|
|
4876
|
-
var g = f[
|
|
4877
|
-
O === void 0 && (y = 0, m = e.indexOf(
|
|
4878
|
-
var
|
|
4879
|
-
c.push(
|
|
4875
|
+
for (var d in f) {
|
|
4876
|
+
var g = f[d], y = 1, m = o[d], S = Ks[m], x = jn(y, S, m), O = b.MACSTRING(g, x);
|
|
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 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
|
-
|
|
4885
|
+
C
|
|
4886
4886
|
));
|
|
4887
|
-
var D = l[
|
|
4887
|
+
var D = l[d];
|
|
4888
4888
|
if (D !== void 0) {
|
|
4889
|
-
var L = b.UTF16(g),
|
|
4890
|
-
c.push(
|
|
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
|
-
|
|
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
|
|
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,44 +5261,44 @@ function oi() {
|
|
|
5261
5261
|
{ name: "maxMemType1", type: "ULONG", value: 0 }
|
|
5262
5262
|
]);
|
|
5263
5263
|
}
|
|
5264
|
-
var
|
|
5265
|
-
|
|
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 {
|
|
5269
5269
|
substFormat: 1,
|
|
5270
|
-
coverage: this.parsePointer(
|
|
5270
|
+
coverage: this.parsePointer(v.coverage),
|
|
5271
5271
|
deltaGlyphId: this.parseUShort()
|
|
5272
5272
|
};
|
|
5273
5273
|
if (r === 2)
|
|
5274
5274
|
return {
|
|
5275
5275
|
substFormat: 2,
|
|
5276
|
-
coverage: this.parsePointer(
|
|
5276
|
+
coverage: this.parsePointer(v.coverage),
|
|
5277
5277
|
substitute: this.parseOffset16List()
|
|
5278
5278
|
};
|
|
5279
5279
|
E.assert(!1, "0x" + e.toString(16) + ": lookup type 1 format must be 1 or 2.");
|
|
5280
5280
|
};
|
|
5281
|
-
|
|
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,
|
|
5285
|
-
coverage: this.parsePointer(
|
|
5285
|
+
coverage: this.parsePointer(v.coverage),
|
|
5286
5286
|
sequences: this.parseListOfLists()
|
|
5287
5287
|
};
|
|
5288
5288
|
};
|
|
5289
|
-
|
|
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,
|
|
5293
|
-
coverage: this.parsePointer(
|
|
5293
|
+
coverage: this.parsePointer(v.coverage),
|
|
5294
5294
|
alternateSets: this.parseListOfLists()
|
|
5295
5295
|
};
|
|
5296
5296
|
};
|
|
5297
|
-
|
|
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,
|
|
5301
|
-
coverage: this.parsePointer(
|
|
5301
|
+
coverage: this.parsePointer(v.coverage),
|
|
5302
5302
|
ligatureSets: this.parseListOfLists(function() {
|
|
5303
5303
|
return {
|
|
5304
5304
|
ligGlyph: this.parseUShort(),
|
|
@@ -5308,15 +5308,15 @@ se[4] = function() {
|
|
|
5308
5308
|
};
|
|
5309
5309
|
};
|
|
5310
5310
|
var Be = {
|
|
5311
|
-
sequenceIndex:
|
|
5312
|
-
lookupListIndex:
|
|
5311
|
+
sequenceIndex: v.uShort,
|
|
5312
|
+
lookupListIndex: v.uShort
|
|
5313
5313
|
};
|
|
5314
|
-
|
|
5314
|
+
ie[5] = function() {
|
|
5315
5315
|
var e = this.offset + this.relativeOffset, r = this.parseUShort();
|
|
5316
5316
|
if (r === 1)
|
|
5317
5317
|
return {
|
|
5318
5318
|
substFormat: r,
|
|
5319
|
-
coverage: this.parsePointer(
|
|
5319
|
+
coverage: this.parsePointer(v.coverage),
|
|
5320
5320
|
ruleSets: this.parseListOfLists(function() {
|
|
5321
5321
|
var s = this.parseUShort(), i = this.parseUShort();
|
|
5322
5322
|
return {
|
|
@@ -5328,8 +5328,8 @@ se[5] = function() {
|
|
|
5328
5328
|
if (r === 2)
|
|
5329
5329
|
return {
|
|
5330
5330
|
substFormat: r,
|
|
5331
|
-
coverage: this.parsePointer(
|
|
5332
|
-
classDef: this.parsePointer(
|
|
5331
|
+
coverage: this.parsePointer(v.coverage),
|
|
5332
|
+
classDef: this.parsePointer(v.classDef),
|
|
5333
5333
|
classSets: this.parseListOfLists(function() {
|
|
5334
5334
|
var s = this.parseUShort(), i = this.parseUShort();
|
|
5335
5335
|
return {
|
|
@@ -5342,18 +5342,18 @@ se[5] = function() {
|
|
|
5342
5342
|
var n = this.parseUShort(), a = this.parseUShort();
|
|
5343
5343
|
return {
|
|
5344
5344
|
substFormat: r,
|
|
5345
|
-
coverages: this.parseList(n,
|
|
5345
|
+
coverages: this.parseList(n, v.pointer(v.coverage)),
|
|
5346
5346
|
lookupRecords: this.parseRecordList(a, Be)
|
|
5347
5347
|
};
|
|
5348
5348
|
}
|
|
5349
5349
|
E.assert(!1, "0x" + e.toString(16) + ": lookup type 5 format must be 1, 2 or 3.");
|
|
5350
5350
|
};
|
|
5351
|
-
|
|
5351
|
+
ie[6] = function() {
|
|
5352
5352
|
var e = this.offset + this.relativeOffset, r = this.parseUShort();
|
|
5353
5353
|
if (r === 1)
|
|
5354
5354
|
return {
|
|
5355
5355
|
substFormat: 1,
|
|
5356
|
-
coverage: this.parsePointer(
|
|
5356
|
+
coverage: this.parsePointer(v.coverage),
|
|
5357
5357
|
chainRuleSets: this.parseListOfLists(function() {
|
|
5358
5358
|
return {
|
|
5359
5359
|
backtrack: this.parseUShortList(),
|
|
@@ -5366,10 +5366,10 @@ se[6] = function() {
|
|
|
5366
5366
|
if (r === 2)
|
|
5367
5367
|
return {
|
|
5368
5368
|
substFormat: 2,
|
|
5369
|
-
coverage: this.parsePointer(
|
|
5370
|
-
backtrackClassDef: this.parsePointer(
|
|
5371
|
-
inputClassDef: this.parsePointer(
|
|
5372
|
-
lookaheadClassDef: this.parsePointer(
|
|
5369
|
+
coverage: this.parsePointer(v.coverage),
|
|
5370
|
+
backtrackClassDef: this.parsePointer(v.classDef),
|
|
5371
|
+
inputClassDef: this.parsePointer(v.classDef),
|
|
5372
|
+
lookaheadClassDef: this.parsePointer(v.classDef),
|
|
5373
5373
|
chainClassSet: this.parseListOfLists(function() {
|
|
5374
5374
|
return {
|
|
5375
5375
|
backtrack: this.parseUShortList(),
|
|
@@ -5382,46 +5382,46 @@ se[6] = function() {
|
|
|
5382
5382
|
if (r === 3)
|
|
5383
5383
|
return {
|
|
5384
5384
|
substFormat: 3,
|
|
5385
|
-
backtrackCoverage: this.parseList(
|
|
5386
|
-
inputCoverage: this.parseList(
|
|
5387
|
-
lookaheadCoverage: this.parseList(
|
|
5385
|
+
backtrackCoverage: this.parseList(v.pointer(v.coverage)),
|
|
5386
|
+
inputCoverage: this.parseList(v.pointer(v.coverage)),
|
|
5387
|
+
lookaheadCoverage: this.parseList(v.pointer(v.coverage)),
|
|
5388
5388
|
lookupRecords: this.parseRecordList(Be)
|
|
5389
5389
|
};
|
|
5390
5390
|
E.assert(!1, "0x" + e.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
|
|
5391
5391
|
};
|
|
5392
|
-
|
|
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
|
-
var r = this.parseUShort(), n = new
|
|
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:
|
|
5399
|
+
extension: ie[r].call(n)
|
|
5400
5400
|
};
|
|
5401
5401
|
};
|
|
5402
|
-
|
|
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,
|
|
5406
|
-
coverage: this.parsePointer(
|
|
5407
|
-
backtrackCoverage: this.parseList(
|
|
5408
|
-
lookaheadCoverage: this.parseList(
|
|
5406
|
+
coverage: this.parsePointer(v.coverage),
|
|
5407
|
+
backtrackCoverage: this.parseList(v.pointer(v.coverage)),
|
|
5408
|
+
lookaheadCoverage: this.parseList(v.pointer(v.coverage)),
|
|
5409
5409
|
substitutes: this.parseUShortList()
|
|
5410
5410
|
};
|
|
5411
5411
|
};
|
|
5412
5412
|
function ui(t, e) {
|
|
5413
5413
|
e = e || 0;
|
|
5414
|
-
var r = new
|
|
5414
|
+
var r = new v(t, e), n = r.parseVersion(1);
|
|
5415
5415
|
return E.argument(n === 1 || n === 1.1, "Unsupported GSUB table version."), n === 1 ? {
|
|
5416
5416
|
version: n,
|
|
5417
5417
|
scripts: r.parseScriptList(),
|
|
5418
5418
|
features: r.parseFeatureList(),
|
|
5419
|
-
lookups: r.parseLookupList(
|
|
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(
|
|
5424
|
+
lookups: r.parseLookupList(ie),
|
|
5425
5425
|
variations: r.parseFeatureVariationsList()
|
|
5426
5426
|
};
|
|
5427
5427
|
}
|
|
@@ -5507,7 +5507,7 @@ function li(t) {
|
|
|
5507
5507
|
{ name: "lookups", type: "TABLE", value: new k.LookupList(t.lookups, Ie) }
|
|
5508
5508
|
]);
|
|
5509
5509
|
}
|
|
5510
|
-
var
|
|
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();
|
|
@@ -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
|
|
5534
|
-
function
|
|
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
|
|
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
|
|
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,
|
|
5562
|
-
e.searchRange = 16 * r, e.entrySelector =
|
|
5563
|
-
for (var n = [], a = [], s = e.sizeOf() +
|
|
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 =
|
|
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
|
}
|
|
@@ -5573,7 +5573,7 @@ function $n(t) {
|
|
|
5573
5573
|
return c.value.tag > p.value.tag ? 1 : -1;
|
|
5574
5574
|
}), e.fields = e.fields.concat(n), e.fields = e.fields.concat(a), e;
|
|
5575
5575
|
}
|
|
5576
|
-
function
|
|
5576
|
+
function Ir(t, e, r) {
|
|
5577
5577
|
for (var n = 0; n < e.length; n += 1) {
|
|
5578
5578
|
var a = t.charToGlyphIndex(e[n]);
|
|
5579
5579
|
if (a > 0) {
|
|
@@ -5589,10 +5589,10 @@ function fi(t) {
|
|
|
5589
5589
|
return e / t.length;
|
|
5590
5590
|
}
|
|
5591
5591
|
function pi(t) {
|
|
5592
|
-
for (var e = [], r = [], n = [], a = [], s = [], i = [], u = [], o, l = 0, c = 0, p = 0, h = 0, f = 0,
|
|
5593
|
-
var g = t.glyphs.get(
|
|
5592
|
+
for (var e = [], r = [], n = [], a = [], s = [], i = [], u = [], o, l = 0, c = 0, p = 0, h = 0, f = 0, d = 0; d < t.glyphs.length; d += 1) {
|
|
5593
|
+
var g = t.glyphs.get(d), y = g.unicode | 0;
|
|
5594
5594
|
if (isNaN(g.advanceWidth))
|
|
5595
|
-
throw new Error("Glyph " + g.name + " (" +
|
|
5595
|
+
throw new Error("Glyph " + g.name + " (" + d + "): advanceWidth is not a number.");
|
|
5596
5596
|
(o > y || o === void 0) && y > 0 && (o = y), l < y && (l = y);
|
|
5597
5597
|
var m = Kt.getUnicodeRange(y);
|
|
5598
5598
|
if (m < 32)
|
|
@@ -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 =
|
|
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
|
-
}),
|
|
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 =
|
|
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,
|
|
@@ -5659,19 +5659,19 @@ function pi(t) {
|
|
|
5659
5659
|
usWinDescent: Math.abs(x.yMin),
|
|
5660
5660
|
ulCodePageRange1: 1,
|
|
5661
5661
|
// FIXME: hard-code Latin 1 support for now
|
|
5662
|
-
sxHeight:
|
|
5663
|
-
sCapHeight:
|
|
5662
|
+
sxHeight: Ir(t, "xyvw", { yMax: Math.round(x.ascender / 2) }).yMax,
|
|
5663
|
+
sCapHeight: Ir(t, "HIKLEFJMNTZBDPRAGOQSUVWXY", x).yMax,
|
|
5664
5664
|
usDefaultChar: t.hasChar(" ") ? 32 : 0,
|
|
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)),
|
|
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 =
|
|
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 ?
|
|
5683
|
-
X && Y.push(X), t.tables.gsub && Y.push(
|
|
5684
|
-
for (var
|
|
5685
|
-
if (
|
|
5686
|
-
|
|
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 (!
|
|
5689
|
+
if (!fr)
|
|
5690
5690
|
throw new Error("Could not find head table with checkSum to adjust.");
|
|
5691
|
-
return
|
|
5691
|
+
return xt;
|
|
5692
5692
|
}
|
|
5693
|
-
var di = { make:
|
|
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
|
|
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 Ir(t, e) {
|
|
|
5709
5709
|
}
|
|
5710
5710
|
return -r - 1;
|
|
5711
5711
|
}
|
|
5712
|
-
function
|
|
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
|
|
5724
|
+
function Ke(t, e) {
|
|
5725
5725
|
this.font = t, this.tableName = e;
|
|
5726
5726
|
}
|
|
5727
|
-
|
|
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:
|
|
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 =
|
|
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 =
|
|
5916
|
+
var r = Gr(t.glyphs, e);
|
|
5917
5917
|
return r >= 0 ? r : -1;
|
|
5918
5918
|
case 2:
|
|
5919
|
-
var n =
|
|
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
|
|
5941
|
-
|
|
5940
|
+
function Qe(t) {
|
|
5941
|
+
Ke.call(this, t, "gpos");
|
|
5942
5942
|
}
|
|
5943
|
-
|
|
5944
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
5993
|
+
ee.prototype = Ke.prototype;
|
|
5994
5994
|
ee.prototype.createDefaultTable = function() {
|
|
5995
5995
|
return {
|
|
5996
5996
|
version: 1,
|
|
@@ -6045,8 +6045,8 @@ ee.prototype.getLigatures = function(t, e, r) {
|
|
|
6045
6045
|
for (var n = [], a = this.getLookupTables(e, r, t, 4), s = 0; s < a.length; s++)
|
|
6046
6046
|
for (var i = a[s].subtables, u = 0; u < i.length; u++)
|
|
6047
6047
|
for (var o = i[u], l = this.expandCoverage(o.coverage), c = o.ligatureSets, p = 0; p < l.length; p++)
|
|
6048
|
-
for (var h = l[p], f = c[p],
|
|
6049
|
-
var g = f[
|
|
6048
|
+
for (var h = l[p], f = c[p], d = 0; d < f.length; d++) {
|
|
6049
|
+
var g = f[d];
|
|
6050
6050
|
n.push({
|
|
6051
6051
|
sub: [h].concat(g.components),
|
|
6052
6052
|
by: g.ligGlyph
|
|
@@ -6152,11 +6152,11 @@ function Ne(t, e) {
|
|
|
6152
6152
|
if (!t)
|
|
6153
6153
|
throw e;
|
|
6154
6154
|
}
|
|
6155
|
-
function
|
|
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
|
|
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;
|
|
@@ -6173,14 +6173,14 @@ function ea(t, e, r) {
|
|
|
6173
6173
|
for (var p = n.parseByte(), h = 0; h < p; h += 1)
|
|
6174
6174
|
a.push(s), c += 1;
|
|
6175
6175
|
if (E.argument(a.length === l, "Bad flags."), i.length > 0) {
|
|
6176
|
-
var f = [],
|
|
6176
|
+
var f = [], d;
|
|
6177
6177
|
if (l > 0) {
|
|
6178
6178
|
for (var g = 0; g < l; g += 1)
|
|
6179
|
-
s = a[g],
|
|
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],
|
|
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],
|
|
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
|
|
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 ? (
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
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 =
|
|
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
|
|
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,
|
|
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,
|
|
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
|
|
6300
|
-
function
|
|
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
|
|
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
|
|
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
|
|
6317
|
+
function Ci(t) {
|
|
6318
6318
|
return Math.sign(t) * Math.ceil(Math.abs(t));
|
|
6319
6319
|
}
|
|
6320
|
-
function
|
|
6320
|
+
function wi(t) {
|
|
6321
6321
|
return Math.sign(t) * Math.floor(Math.abs(t));
|
|
6322
6322
|
}
|
|
6323
|
-
var
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
6476
|
+
Je.prototype.touch = function(t) {
|
|
6477
6477
|
t.xTouched = !0, t.yTouched = !0;
|
|
6478
6478
|
};
|
|
6479
|
-
function
|
|
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
|
|
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
|
|
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 =
|
|
6512
|
+
this.fv = this.pv = this.dpv = pe, this.round = ua;
|
|
6513
6513
|
}
|
|
6514
6514
|
}
|
|
6515
|
-
|
|
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
|
|
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
|
-
|
|
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;
|
|
@@ -6561,12 +6561,12 @@ sa = function(t, e) {
|
|
|
6561
6561
|
for (var l = 0; l < a.length; l++) {
|
|
6562
6562
|
var c = a[l], p = o.glyphs.get(c.glyphIndex);
|
|
6563
6563
|
u = new be("glyf", p.instructions), exports.DEBUG && (console.log("---EXEC COMP " + l + "---"), u.step = -1), Qt(p, u, r, n);
|
|
6564
|
-
for (var h = Math.round(c.dx * r), f = Math.round(c.dy * n),
|
|
6565
|
-
var m =
|
|
6564
|
+
for (var h = Math.round(c.dx * r), f = Math.round(c.dy * n), d = u.gZone, g = u.contours, y = 0; y < d.length; y++) {
|
|
6565
|
+
var m = d[y];
|
|
6566
6566
|
m.xTouched = m.yTouched = !1, m.xo = m.x = m.x + h, m.yo = m.y = m.y + f;
|
|
6567
6567
|
}
|
|
6568
6568
|
var S = i.length;
|
|
6569
|
-
i.push.apply(i,
|
|
6569
|
+
i.push.apply(i, d);
|
|
6570
6570
|
for (var x = 0; x < g.length; x++)
|
|
6571
6571
|
s.push(g[x] + S);
|
|
6572
6572
|
}
|
|
@@ -6598,8 +6598,8 @@ Qt = function(t, e, r, n) {
|
|
|
6598
6598
|
new ge(Math.round(t.advanceWidth * r), 0)
|
|
6599
6599
|
), Le(e), i.length -= 2, exports.DEBUG) {
|
|
6600
6600
|
console.log("FINISHED GLYPH", e.stack);
|
|
6601
|
-
for (var
|
|
6602
|
-
console.log(
|
|
6601
|
+
for (var d = 0; d < s; d++)
|
|
6602
|
+
console.log(d, i[d].x, i[d].y);
|
|
6603
6603
|
}
|
|
6604
6604
|
}
|
|
6605
6605
|
};
|
|
@@ -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 =
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
6649
|
+
function Wr(t, e) {
|
|
6650
6650
|
exports.DEBUG && console.log(e.step, "SFVTCA[" + t.axis + "]"), e.fv = t;
|
|
6651
6651
|
}
|
|
6652
|
-
function
|
|
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 =
|
|
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
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
|
6687
|
-
f.x = (L * (S - O) -
|
|
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);
|
|
@@ -6699,7 +6699,7 @@ 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 ||
|
|
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 ||
|
|
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 ||
|
|
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 ||
|
|
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 =
|
|
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[]"),
|
|
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
|
|
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
|
|
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,
|
|
6831
|
-
t && (i = e.round(i)), a.setRelative(n,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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,
|
|
6931
|
-
t && (Math.abs(l - o) < e.cvCutIn && (l = o), l = e.round(l)), i.setRelative(s,
|
|
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
|
|
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,
|
|
6971
|
+
exports.DEBUG && console.log(e.step, "GC[" + t + "]", n), r.push(e.dpv.distance(a, Ye, t, !1) * 64);
|
|
6972
6972
|
}
|
|
6973
|
-
function
|
|
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 || (
|
|
7017
|
+
exports.DEBUG && console.log(t.step, "IF[]", e), e || (ca(t, !0), exports.DEBUG && console.log(t.step, "EIF[]"));
|
|
7018
7018
|
}
|
|
7019
|
-
function
|
|
7019
|
+
function Co(t) {
|
|
7020
7020
|
exports.DEBUG && console.log(t.step, "EIF[]");
|
|
7021
7021
|
}
|
|
7022
|
-
function
|
|
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,16 +7031,16 @@ 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
|
|
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++) {
|
|
7038
7038
|
var p = r.pop(), h = r.pop(), f = u + ((h & 240) >> 4);
|
|
7039
7039
|
if (f === i) {
|
|
7040
|
-
var
|
|
7041
|
-
|
|
7040
|
+
var d = (h & 15) - 8;
|
|
7041
|
+
d >= 0 && d++, exports.DEBUG && console.log(e.step, "DELTAPFIX", p, "by", d * o);
|
|
7042
7042
|
var g = l[p];
|
|
7043
|
-
a.setRelative(g, g,
|
|
7043
|
+
a.setRelative(g, g, d * o, s);
|
|
7044
7044
|
}
|
|
7045
7045
|
}
|
|
7046
7046
|
}
|
|
@@ -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
|
|
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
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
|
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 =
|
|
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;
|
|
@@ -7244,8 +7244,8 @@ function me(t, e) {
|
|
|
7244
7244
|
e.ip = r;
|
|
7245
7245
|
}
|
|
7246
7246
|
function T(t, e, r, n, a, s) {
|
|
7247
|
-
var i = s.stack, u = t && i.pop(), o = i.pop(), l = s.rp0, c = s.z0[l], p = s.z1[o], h = s.minDis, f = s.fv,
|
|
7248
|
-
y = g =
|
|
7247
|
+
var i = s.stack, u = t && i.pop(), o = i.pop(), l = s.rp0, c = s.z0[l], p = s.z1[o], h = s.minDis, f = s.fv, d = s.dpv, g, y, m, S;
|
|
7248
|
+
y = g = d.distance(p, c, !0, !0), m = y >= 0 ? 1 : -1, y = Math.abs(y), t && (S = s.cvt[u], n && Math.abs(y - S) < s.cvCutIn && (y = S)), r && y < h && (y = h), n && (y = s.round(y)), f.setRelative(p, c, m * y, d), f.touch(p), exports.DEBUG && console.log(
|
|
7249
7249
|
s.step,
|
|
7250
7250
|
(t ? "MIRP[" : "MDRP[") + (e ? "M" : "m") + (r ? ">" : "_") + (n ? "R" : "_") + (a === 0 ? "Gr" : a === 1 ? "Bl" : a === 2 ? "Wh" : "") + "]",
|
|
7251
7251
|
t ? u + "(" + s.cvt[u] + "," + S + ")" : "",
|
|
@@ -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
|
-
|
|
7260
|
+
sa = [
|
|
7261
7261
|
/* 0x00 */
|
|
7262
|
-
|
|
7262
|
+
Hr.bind(void 0, ve),
|
|
7263
7263
|
/* 0x01 */
|
|
7264
|
-
|
|
7264
|
+
Hr.bind(void 0, pe),
|
|
7265
7265
|
/* 0x02 */
|
|
7266
|
-
|
|
7266
|
+
zr.bind(void 0, ve),
|
|
7267
7267
|
/* 0x03 */
|
|
7268
|
-
|
|
7268
|
+
zr.bind(void 0, pe),
|
|
7269
7269
|
/* 0x04 */
|
|
7270
|
-
|
|
7270
|
+
Wr.bind(void 0, ve),
|
|
7271
7271
|
/* 0x05 */
|
|
7272
|
-
|
|
7272
|
+
Wr.bind(void 0, pe),
|
|
7273
7273
|
/* 0x06 */
|
|
7274
|
-
|
|
7274
|
+
Vr.bind(void 0, 0),
|
|
7275
7275
|
/* 0x07 */
|
|
7276
|
-
|
|
7276
|
+
Vr.bind(void 0, 1),
|
|
7277
7277
|
/* 0x08 */
|
|
7278
|
-
|
|
7278
|
+
qr.bind(void 0, 0),
|
|
7279
7279
|
/* 0x09 */
|
|
7280
|
-
|
|
7280
|
+
qr.bind(void 0, 1),
|
|
7281
7281
|
/* 0x0A */
|
|
7282
7282
|
Oi,
|
|
7283
7283
|
/* 0x0B */
|
|
@@ -7327,7 +7327,7 @@ aa = [
|
|
|
7327
7327
|
/* 0x20 */
|
|
7328
7328
|
Zi,
|
|
7329
7329
|
/* 0x21 */
|
|
7330
|
-
|
|
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
|
-
|
|
7359
|
+
Xr.bind(void 0, 0),
|
|
7360
7360
|
/* 0x2F */
|
|
7361
|
-
|
|
7361
|
+
Xr.bind(void 0, 1),
|
|
7362
7362
|
/* 0x30 */
|
|
7363
|
-
|
|
7363
|
+
Yr.bind(void 0, ve),
|
|
7364
7364
|
/* 0x31 */
|
|
7365
|
-
|
|
7365
|
+
Yr.bind(void 0, pe),
|
|
7366
7366
|
/* 0x32 */
|
|
7367
|
-
|
|
7367
|
+
Zr.bind(void 0, 0),
|
|
7368
7368
|
/* 0x33 */
|
|
7369
|
-
|
|
7369
|
+
Zr.bind(void 0, 1),
|
|
7370
7370
|
/* 0x34 */
|
|
7371
|
-
|
|
7371
|
+
jr.bind(void 0, 0),
|
|
7372
7372
|
/* 0x35 */
|
|
7373
|
-
|
|
7373
|
+
jr.bind(void 0, 1),
|
|
7374
7374
|
/* 0x36 */
|
|
7375
|
-
|
|
7375
|
+
Kr.bind(void 0, 0),
|
|
7376
7376
|
/* 0x37 */
|
|
7377
|
-
|
|
7377
|
+
Kr.bind(void 0, 1),
|
|
7378
7378
|
/* 0x38 */
|
|
7379
7379
|
no,
|
|
7380
7380
|
/* 0x39 */
|
|
7381
7381
|
ao,
|
|
7382
7382
|
/* 0x3A */
|
|
7383
|
-
|
|
7383
|
+
Qr.bind(void 0, 0),
|
|
7384
7384
|
/* 0x3B */
|
|
7385
|
-
|
|
7385
|
+
Qr.bind(void 0, 1),
|
|
7386
7386
|
/* 0x3C */
|
|
7387
7387
|
so,
|
|
7388
7388
|
/* 0x3D */
|
|
7389
7389
|
io,
|
|
7390
7390
|
/* 0x3E */
|
|
7391
|
-
|
|
7391
|
+
Jr.bind(void 0, 0),
|
|
7392
7392
|
/* 0x3F */
|
|
7393
|
-
|
|
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
|
-
|
|
7407
|
+
$r.bind(void 0, 0),
|
|
7408
7408
|
/* 0x47 */
|
|
7409
|
-
|
|
7409
|
+
$r.bind(void 0, 1),
|
|
7410
7410
|
/* 0x48 */
|
|
7411
7411
|
void 0,
|
|
7412
7412
|
// TODO SCFS
|
|
7413
7413
|
/* 0x49 */
|
|
7414
|
-
|
|
7414
|
+
en.bind(void 0, 0),
|
|
7415
7415
|
/* 0x4A */
|
|
7416
|
-
|
|
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
|
-
|
|
7457
|
+
Ut.bind(void 0, 1),
|
|
7458
7458
|
/* 0x5E */
|
|
7459
7459
|
Uo,
|
|
7460
7460
|
/* 0x5F */
|
|
@@ -7476,13 +7476,13 @@ aa = [
|
|
|
7476
7476
|
/* 0x67 */
|
|
7477
7477
|
Go,
|
|
7478
7478
|
/* 0x68 */
|
|
7479
|
-
|
|
7479
|
+
it.bind(void 0, 0),
|
|
7480
7480
|
/* 0x69 */
|
|
7481
|
-
|
|
7481
|
+
it.bind(void 0, 1),
|
|
7482
7482
|
/* 0x6A */
|
|
7483
|
-
|
|
7483
|
+
it.bind(void 0, 2),
|
|
7484
7484
|
/* 0x6B */
|
|
7485
|
-
|
|
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
|
-
|
|
7501
|
+
Ut.bind(void 0, 2),
|
|
7502
7502
|
/* 0x72 */
|
|
7503
|
-
|
|
7503
|
+
Ut.bind(void 0, 3),
|
|
7504
7504
|
/* 0x73 */
|
|
7505
|
-
|
|
7505
|
+
Lt.bind(void 0, 1),
|
|
7506
7506
|
/* 0x74 */
|
|
7507
|
-
|
|
7507
|
+
Lt.bind(void 0, 2),
|
|
7508
7508
|
/* 0x75 */
|
|
7509
|
-
|
|
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
|
-
|
|
7529
|
+
Ot,
|
|
7530
7530
|
// actually SANGW, supposed to do only a pop though
|
|
7531
7531
|
/* 0x7F */
|
|
7532
|
-
|
|
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
|
-
|
|
7550
|
+
tn.bind(void 0, 0),
|
|
7551
7551
|
/* 0x87 */
|
|
7552
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
7931
|
+
yt.prototype.unsubscribe = function(t) {
|
|
7932
7932
|
this.subscribers.splice(t, 1);
|
|
7933
7933
|
};
|
|
7934
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
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 =
|
|
8094
|
+
var r = et(t, e.coverage);
|
|
8095
8095
|
return r === -1 ? null : e.substitute[r];
|
|
8096
8096
|
}
|
|
8097
|
-
function
|
|
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 =
|
|
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 =
|
|
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
|
|
8121
|
+
var i = new oe(s, 0), u = Rt(
|
|
8122
8122
|
e.lookaheadCoverage,
|
|
8123
8123
|
i
|
|
8124
8124
|
), o = [].concat(t.backtrack);
|
|
@@ -8126,24 +8126,24 @@ function nu(t, e) {
|
|
|
8126
8126
|
o.shift();
|
|
8127
8127
|
if (o.length < e.backtrackCoverage.length)
|
|
8128
8128
|
return [];
|
|
8129
|
-
var l = new
|
|
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 = [];
|
|
8133
8133
|
if (p)
|
|
8134
8134
|
for (var f = 0; f < e.lookupRecords.length; f++)
|
|
8135
|
-
for (var
|
|
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
|
|
8139
|
-
var D = t.get(
|
|
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 =
|
|
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 =
|
|
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
|
|
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
|
|
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 &&
|
|
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 =
|
|
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 (
|
|
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
|
|
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
|
|
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
|
|
8496
|
+
function nn(t, e) {
|
|
8497
8497
|
var r = t.map(function(n) {
|
|
8498
8498
|
return n.activeState.value;
|
|
8499
8499
|
});
|
|
8500
|
-
return new
|
|
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 =
|
|
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 =
|
|
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 &&
|
|
8523
|
-
!
|
|
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
|
-
!
|
|
8531
|
+
!ut(e)
|
|
8532
8532
|
);
|
|
8533
8533
|
}
|
|
8534
8534
|
var ku = {
|
|
8535
8535
|
startCheck: bu,
|
|
8536
8536
|
endCheck: Su
|
|
8537
8537
|
};
|
|
8538
|
-
function
|
|
8538
|
+
function an(t, e) {
|
|
8539
8539
|
var r = t.map(function(n) {
|
|
8540
8540
|
return n.activeState.value;
|
|
8541
8541
|
});
|
|
8542
|
-
return new
|
|
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 =
|
|
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 =
|
|
8557
|
+
), a = an(n));
|
|
8558
8558
|
});
|
|
8559
8559
|
}
|
|
8560
|
-
function
|
|
8560
|
+
function ce(t) {
|
|
8561
8561
|
this.baseDir = t || "ltr", this.tokenizer = new B(), this.featuresTags = {};
|
|
8562
8562
|
}
|
|
8563
|
-
|
|
8563
|
+
ce.prototype.setText = function(t) {
|
|
8564
8564
|
this.text = t;
|
|
8565
8565
|
};
|
|
8566
|
-
|
|
8566
|
+
ce.prototype.contextChecks = {
|
|
8567
8567
|
latinWordCheck: ku,
|
|
8568
8568
|
arabicWordCheck: uu,
|
|
8569
8569
|
arabicSentenceCheck: hu
|
|
8570
8570
|
};
|
|
8571
|
-
function
|
|
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
|
|
8580
|
+
return At.call(this, "latinWord"), At.call(this, "arabicWord"), At.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
|
|
8581
8581
|
}
|
|
8582
|
-
function
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
8657
|
+
ce.prototype.checkContextReady = function(t) {
|
|
8658
8658
|
return !!this.tokenizer.getContext(t);
|
|
8659
8659
|
};
|
|
8660
|
-
|
|
8661
|
-
this.checkContextReady("arabicWord") && (
|
|
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
|
-
|
|
8663
|
+
ce.prototype.processText = function(t) {
|
|
8664
8664
|
(!this.text || this.text !== t) && (this.setText(t), Fu.call(this), this.applyFeaturesToContexts());
|
|
8665
8665
|
};
|
|
8666
|
-
|
|
8666
|
+
ce.prototype.getBidiText = function(t) {
|
|
8667
8667
|
return this.processText(t), this.tokenizer.getText();
|
|
8668
8668
|
};
|
|
8669
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
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 =
|
|
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) {
|
|
@@ -8973,14 +8973,14 @@ function Mu(t, e, r) {
|
|
|
8973
8973
|
n.skip("uShort", 1);
|
|
8974
8974
|
for (var i = n.parseUShort(), u = n.parseUShort(), o = n.parseUShort(), l = n.parseUShort(), c = [], p = 0; p < i; p++)
|
|
8975
8975
|
c.push(Lu(t, e + s + p * u, r));
|
|
8976
|
-
for (var h = [], f = e + s + i * u,
|
|
8977
|
-
h.push(Au(t, f +
|
|
8976
|
+
for (var h = [], f = e + s + i * u, d = 0; d < o; d++)
|
|
8977
|
+
h.push(Au(t, f + d * l, c, r));
|
|
8978
8978
|
return { axes: c, instances: h };
|
|
8979
8979
|
}
|
|
8980
8980
|
var Bu = { make: Du, parse: Mu }, Pu = function() {
|
|
8981
8981
|
return {
|
|
8982
|
-
coverage: this.parsePointer(
|
|
8983
|
-
attachPoints: this.parseList(
|
|
8982
|
+
coverage: this.parsePointer(v.coverage),
|
|
8983
|
+
attachPoints: this.parseList(v.pointer(v.uShortList))
|
|
8984
8984
|
};
|
|
8985
8985
|
}, Iu = function() {
|
|
8986
8986
|
var t = this.parseUShort();
|
|
@@ -8994,59 +8994,59 @@ var Bu = { make: Du, parse: Mu }, Pu = function() {
|
|
|
8994
8994
|
if (t === 3)
|
|
8995
8995
|
return { coordinate: this.parseShort() };
|
|
8996
8996
|
}, Gu = function() {
|
|
8997
|
-
return this.parseList(
|
|
8997
|
+
return this.parseList(v.pointer(Iu));
|
|
8998
8998
|
}, Nu = function() {
|
|
8999
8999
|
return {
|
|
9000
|
-
coverage: this.parsePointer(
|
|
9001
|
-
ligGlyphs: this.parseList(
|
|
9000
|
+
coverage: this.parsePointer(v.coverage),
|
|
9001
|
+
ligGlyphs: this.parseList(v.pointer(Gu))
|
|
9002
9002
|
};
|
|
9003
9003
|
}, _u = function() {
|
|
9004
|
-
return this.parseUShort(), this.parseList(
|
|
9004
|
+
return this.parseUShort(), this.parseList(v.pointer(v.coverage));
|
|
9005
9005
|
};
|
|
9006
9006
|
function Hu(t, e) {
|
|
9007
9007
|
e = e || 0;
|
|
9008
|
-
var r = new
|
|
9008
|
+
var r = new v(t, e), n = r.parseVersion(1);
|
|
9009
9009
|
E.argument(
|
|
9010
9010
|
n === 1 || n === 1.2 || n === 1.3,
|
|
9011
9011
|
"Unsupported GDEF table version."
|
|
9012
9012
|
);
|
|
9013
9013
|
var a = {
|
|
9014
9014
|
version: n,
|
|
9015
|
-
classDef: r.parsePointer(
|
|
9015
|
+
classDef: r.parsePointer(v.classDef),
|
|
9016
9016
|
attachList: r.parsePointer(Pu),
|
|
9017
9017
|
ligCaretList: r.parsePointer(Nu),
|
|
9018
|
-
markAttachClassDef: r.parsePointer(
|
|
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 },
|
|
9023
|
-
|
|
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 {
|
|
9027
9027
|
posFormat: 1,
|
|
9028
|
-
coverage: this.parsePointer(
|
|
9028
|
+
coverage: this.parsePointer(v.coverage),
|
|
9029
9029
|
value: this.parseValueRecord()
|
|
9030
9030
|
};
|
|
9031
9031
|
if (r === 2)
|
|
9032
9032
|
return {
|
|
9033
9033
|
posFormat: 2,
|
|
9034
|
-
coverage: this.parsePointer(
|
|
9034
|
+
coverage: this.parsePointer(v.coverage),
|
|
9035
9035
|
values: this.parseValueRecordList()
|
|
9036
9036
|
};
|
|
9037
9037
|
E.assert(!1, "0x" + e.toString(16) + ": GPOS lookup type 1 format must be 1 or 2.");
|
|
9038
9038
|
};
|
|
9039
|
-
|
|
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
|
-
var n = this.parsePointer(
|
|
9042
|
+
var n = this.parsePointer(v.coverage), a = this.parseUShort(), s = this.parseUShort();
|
|
9043
9043
|
if (r === 1)
|
|
9044
9044
|
return {
|
|
9045
9045
|
posFormat: r,
|
|
9046
9046
|
coverage: n,
|
|
9047
9047
|
valueFormat1: a,
|
|
9048
9048
|
valueFormat2: s,
|
|
9049
|
-
pairSets: this.parseList(
|
|
9049
|
+
pairSets: this.parseList(v.pointer(v.list(function() {
|
|
9050
9050
|
return {
|
|
9051
9051
|
// pairValueRecord
|
|
9052
9052
|
secondGlyph: this.parseUShort(),
|
|
@@ -9056,7 +9056,7 @@ oe[2] = function() {
|
|
|
9056
9056
|
})))
|
|
9057
9057
|
};
|
|
9058
9058
|
if (r === 2) {
|
|
9059
|
-
var i = this.parsePointer(
|
|
9059
|
+
var i = this.parsePointer(v.classDef), u = this.parsePointer(v.classDef), o = this.parseUShort(), l = this.parseUShort();
|
|
9060
9060
|
return {
|
|
9061
9061
|
// Class Pair Adjustment
|
|
9062
9062
|
posFormat: r,
|
|
@@ -9067,7 +9067,7 @@ oe[2] = function() {
|
|
|
9067
9067
|
classDef2: u,
|
|
9068
9068
|
class1Count: o,
|
|
9069
9069
|
class2Count: l,
|
|
9070
|
-
classRecords: this.parseList(o,
|
|
9070
|
+
classRecords: this.parseList(o, v.list(l, function() {
|
|
9071
9071
|
return {
|
|
9072
9072
|
value1: this.parseValueRecord(a),
|
|
9073
9073
|
value2: this.parseValueRecord(s)
|
|
@@ -9076,40 +9076,40 @@ oe[2] = function() {
|
|
|
9076
9076
|
};
|
|
9077
9077
|
}
|
|
9078
9078
|
};
|
|
9079
|
-
|
|
9079
|
+
ue[3] = function() {
|
|
9080
9080
|
return { error: "GPOS Lookup 3 not supported" };
|
|
9081
9081
|
};
|
|
9082
|
-
|
|
9082
|
+
ue[4] = function() {
|
|
9083
9083
|
return { error: "GPOS Lookup 4 not supported" };
|
|
9084
9084
|
};
|
|
9085
|
-
|
|
9085
|
+
ue[5] = function() {
|
|
9086
9086
|
return { error: "GPOS Lookup 5 not supported" };
|
|
9087
9087
|
};
|
|
9088
|
-
|
|
9088
|
+
ue[6] = function() {
|
|
9089
9089
|
return { error: "GPOS Lookup 6 not supported" };
|
|
9090
9090
|
};
|
|
9091
|
-
|
|
9091
|
+
ue[7] = function() {
|
|
9092
9092
|
return { error: "GPOS Lookup 7 not supported" };
|
|
9093
9093
|
};
|
|
9094
|
-
|
|
9094
|
+
ue[8] = function() {
|
|
9095
9095
|
return { error: "GPOS Lookup 8 not supported" };
|
|
9096
9096
|
};
|
|
9097
|
-
|
|
9097
|
+
ue[9] = function() {
|
|
9098
9098
|
return { error: "GPOS Lookup 9 not supported" };
|
|
9099
9099
|
};
|
|
9100
9100
|
function Wu(t, e) {
|
|
9101
9101
|
e = e || 0;
|
|
9102
|
-
var r = new
|
|
9102
|
+
var r = new v(t, e), n = r.parseVersion(1);
|
|
9103
9103
|
return E.argument(n === 1 || n === 1.1, "Unsupported GPOS table version " + n), n === 1 ? {
|
|
9104
9104
|
version: n,
|
|
9105
9105
|
scripts: r.parseScriptList(),
|
|
9106
9106
|
features: r.parseFeatureList(),
|
|
9107
|
-
lookups: r.parseLookupList(
|
|
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(
|
|
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
|
|
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;
|
|
@@ -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 =
|
|
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 =
|
|
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,
|
|
9221
|
-
var L = u[D],
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
9245
|
+
w = P(s, L), n = Vn.parse(w.data, w.offset);
|
|
9246
9246
|
break;
|
|
9247
9247
|
case "maxp":
|
|
9248
|
-
|
|
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
|
-
|
|
9254
|
+
w = P(s, L), a.tables.os2 = Kt.parse(w.data, w.offset);
|
|
9255
9255
|
break;
|
|
9256
9256
|
case "post":
|
|
9257
|
-
|
|
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
|
-
|
|
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;
|
|
@@ -9275,7 +9275,7 @@ function el(t, e) {
|
|
|
9275
9275
|
f = L;
|
|
9276
9276
|
break;
|
|
9277
9277
|
case "GPOS":
|
|
9278
|
-
|
|
9278
|
+
d = L;
|
|
9279
9279
|
break;
|
|
9280
9280
|
case "GSUB":
|
|
9281
9281
|
g = L;
|
|
@@ -9286,16 +9286,16 @@ function el(t, e) {
|
|
|
9286
9286
|
}
|
|
9287
9287
|
}
|
|
9288
9288
|
var N = P(s, x);
|
|
9289
|
-
if (a.tables.name =
|
|
9289
|
+
if (a.tables.name = Kn.parse(N.data, N.offset, n), a.names = a.tables.name, h && S) {
|
|
9290
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 =
|
|
9291
|
+
a.glyphs = aa.parse(ne.data, ne.offset, re, a, e);
|
|
9292
9292
|
} else if (c) {
|
|
9293
9293
|
var G = P(s, c);
|
|
9294
|
-
|
|
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
9297
|
var H = P(s, y);
|
|
9298
|
-
if (
|
|
9298
|
+
if (Wn.parse(a, H.data, H.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, e), fs(a, e), m) {
|
|
9299
9299
|
var V = P(s, m);
|
|
9300
9300
|
a.kerningPairs = Ku.parse(V.data, V.offset);
|
|
9301
9301
|
} else
|
|
@@ -9304,13 +9304,13 @@ function el(t, e) {
|
|
|
9304
9304
|
var q = P(s, f);
|
|
9305
9305
|
a.tables.gdef = zu.parse(q.data, q.offset);
|
|
9306
9306
|
}
|
|
9307
|
-
if (
|
|
9308
|
-
var X = P(s,
|
|
9307
|
+
if (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
9312
|
var z = P(s, g);
|
|
9313
|
-
a.tables.gsub =
|
|
9313
|
+
a.tables.gsub = Jn.parse(z.data, z.offset);
|
|
9314
9314
|
}
|
|
9315
9315
|
if (p) {
|
|
9316
9316
|
var Z = P(s, p);
|
|
@@ -9318,7 +9318,7 @@ function el(t, e) {
|
|
|
9318
9318
|
}
|
|
9319
9319
|
if (O) {
|
|
9320
9320
|
var M = P(s, O);
|
|
9321
|
-
a.tables.meta =
|
|
9321
|
+
a.tables.meta = $n.parse(M.data, M.offset), a.metas = a.tables.meta;
|
|
9322
9322
|
}
|
|
9323
9323
|
return a;
|
|
9324
9324
|
}
|
|
@@ -9336,8 +9336,8 @@ function tl(t) {
|
|
|
9336
9336
|
x_max: a(h.xMax),
|
|
9337
9337
|
o: ""
|
|
9338
9338
|
};
|
|
9339
|
-
h.path.commands.forEach(function(
|
|
9340
|
-
|
|
9339
|
+
h.path.commands.forEach(function(d) {
|
|
9340
|
+
d.type.toLowerCase() === "c" && (d.type = "b"), f.o += d.type.toLowerCase() + " ", d.x !== void 0 && d.y !== void 0 && (f.o += a(d.x) + " " + a(d.y) + " "), d.x1 !== void 0 && d.y1 !== void 0 && (f.o += a(d.x1) + " " + a(d.y1) + " "), d.x2 !== void 0 && d.y2 !== void 0 && (f.o += a(d.x2) + " " + a(d.y2) + " ");
|
|
9341
9341
|
}), s[String.fromCodePoint(h.unicode)] = f;
|
|
9342
9342
|
}
|
|
9343
9343
|
}
|
|
@@ -9360,7 +9360,7 @@ function tl(t) {
|
|
|
9360
9360
|
};
|
|
9361
9361
|
})(el(t));
|
|
9362
9362
|
}
|
|
9363
|
-
class
|
|
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
|
|
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
|
|
9408
|
+
return new br("?", e, this);
|
|
9409
9409
|
}
|
|
9410
9410
|
}
|
|
9411
9411
|
let Q = class {
|
|
@@ -9889,8 +9889,8 @@ class I {
|
|
|
9889
9889
|
return Math.sqrt(r * r + n * n);
|
|
9890
9890
|
}
|
|
9891
9891
|
}
|
|
9892
|
-
const
|
|
9893
|
-
class
|
|
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
|
|
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
|
|
9917
|
+
return new Ze({
|
|
9918
9918
|
center: e,
|
|
9919
9919
|
radius: r,
|
|
9920
9920
|
startOctant: n,
|
|
@@ -9935,8 +9935,8 @@ class Ye {
|
|
|
9935
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 *
|
|
9939
|
-
const r = (e.octantCount === 0 ? 8 : e.octantCount) *
|
|
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
9941
|
new I(
|
|
9942
9942
|
this.radius * Math.cos(this.startAngle),
|
|
@@ -9973,7 +9973,7 @@ class Ye {
|
|
|
9973
9973
|
), r;
|
|
9974
9974
|
}
|
|
9975
9975
|
}
|
|
9976
|
-
|
|
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
|
|
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);
|
|
@@ -10011,14 +10011,14 @@ let At = class fa {
|
|
|
10011
10011
|
const { strokeWidth: r = "0.5%", strokeColor: n = "black", isAutoFit: a = !1 } = e;
|
|
10012
10012
|
let s, i;
|
|
10013
10013
|
if (a) {
|
|
10014
|
-
const u = this.bbox, o = 0.2, l = u.maxX - u.minX, c = u.maxY - u.minY, p = u.minX - l * o, h = u.maxX + l * o, f = u.minY - c * o,
|
|
10014
|
+
const u = this.bbox, o = 0.2, l = u.maxX - u.minX, c = u.maxY - u.minY, p = u.minX - l * o, h = u.maxX + l * o, f = u.minY - c * o, d = u.maxY + c * o;
|
|
10015
10015
|
i = this.polylines.map((g) => {
|
|
10016
10016
|
let y = "";
|
|
10017
10017
|
return g.forEach((m, S) => {
|
|
10018
10018
|
const x = m.x, O = -m.y;
|
|
10019
10019
|
y += S === 0 ? `M ${x} ${O} ` : `L ${x} ${O} `;
|
|
10020
10020
|
}), `<path d="${y}" stroke="${n}" stroke-width="${r}" fill="none"/>`;
|
|
10021
|
-
}).join(""), s = `${p} ${-
|
|
10021
|
+
}).join(""), s = `${p} ${-d} ${h - p} ${d - f}`;
|
|
10022
10022
|
} else
|
|
10023
10023
|
s = "0 0 20 20", i = this.polylines.map((u) => {
|
|
10024
10024
|
let o = "";
|
|
@@ -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,
|
|
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 =
|
|
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 /
|
|
10065
|
-
i = new
|
|
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
|
);
|
|
@@ -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
|
|
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.
|
|
@@ -10252,10 +10252,10 @@ 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 I(Math.cos(p) * i, Math.sin(p) * i)), f =
|
|
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
|
-
const
|
|
10258
|
-
n.currentPolyline.pop(), n.currentPolyline.push(...
|
|
10257
|
+
const d = f.tessellate();
|
|
10258
|
+
n.currentPolyline.pop(), n.currentPolyline.push(...d.slice());
|
|
10259
10259
|
}
|
|
10260
10260
|
return n.currentPoint = (a = f.tessellate().pop()) == null ? void 0 : a.clone(), s;
|
|
10261
10261
|
}
|
|
@@ -10265,27 +10265,27 @@ class ul {
|
|
|
10265
10265
|
let h = c & 7;
|
|
10266
10266
|
h === 0 && (h = 8), i !== 0 && h--;
|
|
10267
10267
|
const f = Math.PI / 4;
|
|
10268
|
-
let
|
|
10269
|
-
c < 0 && (g = -g,
|
|
10270
|
-
let m = f * p, S = m +
|
|
10268
|
+
let d = f * h, g = ol, y = 1;
|
|
10269
|
+
c < 0 && (g = -g, d = -d, y = -1);
|
|
10270
|
+
let m = f * p, S = m + d;
|
|
10271
10271
|
m += f * s / 256 * y, S += f * i / 256 * y;
|
|
10272
10272
|
const x = n.currentPoint.clone().subtract(new I(l * Math.cos(m), l * Math.sin(m)));
|
|
10273
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
|
|
10276
|
-
if (
|
|
10275
|
+
const C = [];
|
|
10276
|
+
if (C.push(
|
|
10277
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,
|
|
10280
|
+
O += g, C.push(
|
|
10281
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,
|
|
10285
|
+
O += g, C.push(
|
|
10286
10286
|
x.clone().add(new I(l * Math.cos(O), l * Math.sin(O)))
|
|
10287
10287
|
);
|
|
10288
|
-
|
|
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
|
}
|
|
@@ -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
|
|
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 =
|
|
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
|
|
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
|
|
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
|
}
|
|
@@ -10561,9 +10561,9 @@ class Se {
|
|
|
10561
10561
|
*/
|
|
10562
10562
|
createFont(e) {
|
|
10563
10563
|
if (e.type === "shx")
|
|
10564
|
-
return new
|
|
10564
|
+
return new cn(e.data);
|
|
10565
10565
|
if (e.type === "mesh")
|
|
10566
|
-
return new
|
|
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
|
|
10581
|
+
return new cn(r);
|
|
10582
10582
|
if (["ttf", "otf", "woff"].includes(n))
|
|
10583
|
-
return new
|
|
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
|
|
10591
|
+
fontNotFound: new pr(),
|
|
10592
10592
|
/** Event triggered when a font is successfully loaded */
|
|
10593
|
-
fontLoaded: new
|
|
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 =
|
|
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 =
|
|
10714
|
+
const r = bn(e);
|
|
10715
10715
|
if (!r)
|
|
10716
10716
|
throw new Error(`Invalid font url: ${e}`);
|
|
10717
|
-
const 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
|
|
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
|
|
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 = "
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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) {
|
|
@@ -11737,14 +11743,14 @@ function hn(t, e = !1) {
|
|
|
11737
11743
|
const p = [];
|
|
11738
11744
|
for (let h = 0; h < t.length; ++h) {
|
|
11739
11745
|
const f = t[h].index;
|
|
11740
|
-
for (let
|
|
11741
|
-
p.push(f.getX(
|
|
11746
|
+
for (let d = 0; d < f.count; ++d)
|
|
11747
|
+
p.push(f.getX(d) + c);
|
|
11742
11748
|
c += t[h].attributes.position.count;
|
|
11743
11749
|
}
|
|
11744
11750
|
o.setIndex(p);
|
|
11745
11751
|
}
|
|
11746
11752
|
for (const c in s) {
|
|
11747
|
-
const p =
|
|
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,15 +11763,15 @@ 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
|
|
11761
|
-
if (!
|
|
11766
|
+
const d = pn(f);
|
|
11767
|
+
if (!d)
|
|
11762
11768
|
return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + c + " morphAttribute."), null;
|
|
11763
|
-
o.morphAttributes[c].push(
|
|
11769
|
+
o.morphAttributes[c].push(d);
|
|
11764
11770
|
}
|
|
11765
11771
|
}
|
|
11766
11772
|
return o;
|
|
11767
11773
|
}
|
|
11768
|
-
function
|
|
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];
|
|
@@ -11786,9 +11792,9 @@ function fn(t) {
|
|
|
11786
11792
|
if (c.isInterleavedBufferAttribute) {
|
|
11787
11793
|
const p = o / r;
|
|
11788
11794
|
for (let h = 0, f = c.count; h < f; h++)
|
|
11789
|
-
for (let
|
|
11790
|
-
const g = c.getComponent(h,
|
|
11791
|
-
u.setComponent(h + p,
|
|
11795
|
+
for (let d = 0; d < r; d++) {
|
|
11796
|
+
const g = c.getComponent(h, d);
|
|
11797
|
+
u.setComponent(h + p, d, g);
|
|
11792
11798
|
}
|
|
11793
11799
|
} else
|
|
11794
11800
|
i.set(c.array, o);
|
|
@@ -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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
11951
|
+
return this._currentContext.widthFactor;
|
|
11919
11952
|
}
|
|
11920
11953
|
/**
|
|
11921
11954
|
* The current text color
|
|
11922
11955
|
*/
|
|
11923
11956
|
get currentColor() {
|
|
11924
|
-
return this.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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 && (
|
|
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.
|
|
12015
|
+
e.changes.paragraph && e.changes.paragraph.align && (this._currentContext.horizontalAlignment = e.changes.paragraph.align);
|
|
11983
12016
|
break;
|
|
11984
12017
|
case "L":
|
|
11985
|
-
this.
|
|
12018
|
+
this._currentContext.underline = !0;
|
|
11986
12019
|
break;
|
|
11987
12020
|
case "l":
|
|
11988
|
-
this.
|
|
12021
|
+
this._currentContext.underline = !1;
|
|
11989
12022
|
break;
|
|
11990
12023
|
case "O":
|
|
11991
|
-
this.
|
|
12024
|
+
this._currentContext.overline = !0;
|
|
11992
12025
|
break;
|
|
11993
12026
|
case "o":
|
|
11994
|
-
this.
|
|
12027
|
+
this._currentContext.overline = !1;
|
|
11995
12028
|
break;
|
|
11996
12029
|
case "K":
|
|
11997
|
-
this.
|
|
12030
|
+
this._currentContext.strikeThrough = !0;
|
|
11998
12031
|
break;
|
|
11999
12032
|
case "k":
|
|
12000
|
-
this.
|
|
12033
|
+
this._currentContext.strikeThrough = !1;
|
|
12001
12034
|
break;
|
|
12002
12035
|
case "Q":
|
|
12003
|
-
e.changes.oblique !== void 0 && (this.
|
|
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
|
|
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.
|
|
12034
|
-
this._hOffset = u, this.
|
|
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]);
|
|
@@ -12043,9 +12081,9 @@ class gl {
|
|
|
12043
12081
|
const S = this.getCharShape(s[m]);
|
|
12044
12082
|
S && (f += S.width * this.currentWidthFactor);
|
|
12045
12083
|
}
|
|
12046
|
-
const
|
|
12084
|
+
const d = Math.max(h, f), g = (d - h) / 2, y = (d - f) / 2;
|
|
12047
12085
|
if (i === "^") {
|
|
12048
|
-
if (this.
|
|
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,34 +12096,34 @@ 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.
|
|
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
|
|
12066
|
-
this.processChar(a[
|
|
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
|
|
12071
|
-
this.processChar(s[
|
|
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
|
|
12111
|
+
const C = new R.BufferGeometry(), D = new Float32Array([
|
|
12074
12112
|
u,
|
|
12075
12113
|
o - this.currentFontSize * 0.8,
|
|
12076
12114
|
0,
|
|
12077
|
-
u +
|
|
12115
|
+
u + d,
|
|
12078
12116
|
o - this.currentFontSize * 0.8,
|
|
12079
12117
|
0
|
|
12080
12118
|
]);
|
|
12081
|
-
|
|
12119
|
+
C.setAttribute("position", new R.BufferAttribute(D, 3)), C.setIndex(null), n.push(C);
|
|
12082
12120
|
}
|
|
12083
|
-
this._hOffset = u +
|
|
12121
|
+
this._hOffset = u + d;
|
|
12084
12122
|
}
|
|
12085
|
-
this._vOffset = o, this.
|
|
12123
|
+
this._vOffset = o, this._currentContext.wordSpace = l;
|
|
12086
12124
|
}
|
|
12087
12125
|
processBlank() {
|
|
12088
|
-
this._hOffset += this.
|
|
12126
|
+
this._hOffset += this._currentContext.blankWidth;
|
|
12089
12127
|
}
|
|
12090
12128
|
processChar(e, r, n) {
|
|
12091
12129
|
const a = this.getCharShape(e);
|
|
@@ -12093,44 +12131,47 @@ class gl {
|
|
|
12093
12131
|
this.processBlank();
|
|
12094
12132
|
return;
|
|
12095
12133
|
}
|
|
12096
|
-
|
|
12097
|
-
|
|
12098
|
-
|
|
12099
|
-
|
|
12100
|
-
|
|
12101
|
-
|
|
12102
|
-
|
|
12103
|
-
|
|
12104
|
-
|
|
12105
|
-
|
|
12106
|
-
|
|
12107
|
-
|
|
12134
|
+
let s = a.toGeometry();
|
|
12135
|
+
s.scale(this.currentWidthFactor, 1, 1);
|
|
12136
|
+
let i = this.currentObliqueAngle;
|
|
12137
|
+
if (this._currentContext.italic && (i += 15), i) {
|
|
12138
|
+
const d = i * Math.PI / 180, g = new R.Matrix4();
|
|
12139
|
+
g.set(1, Math.tan(d), 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1), s.applyMatrix4(g);
|
|
12140
|
+
}
|
|
12141
|
+
const u = this.fontManager.getFontType(this.currentFont);
|
|
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);
|
|
12145
|
+
const h = p * 0.05, f = 1e-3;
|
|
12146
|
+
if (this._currentContext.underline) {
|
|
12147
|
+
const d = new R.BufferGeometry(), g = l - h;
|
|
12148
|
+
d.setAttribute(
|
|
12108
12149
|
"position",
|
|
12109
12150
|
new R.BufferAttribute(
|
|
12110
|
-
new Float32Array([
|
|
12151
|
+
new Float32Array([o, g, f, o + c, g, f]),
|
|
12111
12152
|
3
|
|
12112
12153
|
)
|
|
12113
|
-
),
|
|
12154
|
+
), d.setIndex(null), n.push(d);
|
|
12114
12155
|
}
|
|
12115
|
-
if (this.
|
|
12116
|
-
const
|
|
12117
|
-
|
|
12156
|
+
if (this._currentContext.overline) {
|
|
12157
|
+
const d = new R.BufferGeometry(), g = l + p + h;
|
|
12158
|
+
d.setAttribute(
|
|
12118
12159
|
"position",
|
|
12119
12160
|
new R.BufferAttribute(
|
|
12120
|
-
new Float32Array([
|
|
12161
|
+
new Float32Array([o, g, f, o + c, g, f]),
|
|
12121
12162
|
3
|
|
12122
12163
|
)
|
|
12123
|
-
),
|
|
12164
|
+
), d.setIndex(null), n.push(d);
|
|
12124
12165
|
}
|
|
12125
|
-
if (this.
|
|
12126
|
-
const
|
|
12127
|
-
|
|
12166
|
+
if (this._currentContext.strikeThrough) {
|
|
12167
|
+
const d = new R.BufferGeometry(), g = l + p / 2;
|
|
12168
|
+
d.setAttribute(
|
|
12128
12169
|
"position",
|
|
12129
12170
|
new R.BufferAttribute(
|
|
12130
|
-
new Float32Array([
|
|
12171
|
+
new Float32Array([o, g, f, o + c, g, f]),
|
|
12131
12172
|
3
|
|
12132
12173
|
)
|
|
12133
|
-
),
|
|
12174
|
+
), d.setIndex(null), n.push(d);
|
|
12134
12175
|
}
|
|
12135
12176
|
}
|
|
12136
12177
|
processLastLine() {
|
|
@@ -12139,23 +12180,20 @@ class gl {
|
|
|
12139
12180
|
initLineParams() {
|
|
12140
12181
|
this.calcuateLineParams();
|
|
12141
12182
|
}
|
|
12142
|
-
changeFontHeight(e) {
|
|
12143
|
-
this.calcuateLineParams(e);
|
|
12144
|
-
}
|
|
12145
12183
|
changeFont(e) {
|
|
12146
12184
|
let r = e;
|
|
12147
|
-
this._options.removeFontExtension && (r = e.replace(/\.(ttf|otf|woff|shx)$/, "")), this.
|
|
12148
|
-
|
|
12149
|
-
|
|
12150
|
-
|
|
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();
|
|
12151
12189
|
}
|
|
12152
12190
|
/**
|
|
12153
12191
|
* Calcuate font size, line space, line height and other parameters.
|
|
12154
12192
|
*/
|
|
12155
12193
|
calcuateLineParams(e) {
|
|
12156
|
-
this.
|
|
12194
|
+
this._currentContext.fontScaleFactor = this.fontManager.getFontScaleFactor(this.currentFont);
|
|
12157
12195
|
const r = e || this.defaultFontSize || this.textStyle.fixedTextHeight;
|
|
12158
|
-
this.
|
|
12196
|
+
this._currentContext.fontSize = r * this._currentContext.fontScaleFactor * this._currentContext.fontSizeScaleFactor;
|
|
12159
12197
|
}
|
|
12160
12198
|
/**
|
|
12161
12199
|
* Get text shape of the specified character
|
|
@@ -12164,10 +12202,10 @@ class gl {
|
|
|
12164
12202
|
*/
|
|
12165
12203
|
getCharShape(e) {
|
|
12166
12204
|
let r = this.fontManager.getCharShape(e, this.currentFont, this.currentFontSize);
|
|
12167
|
-
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.
|
|
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;
|
|
12168
12206
|
}
|
|
12169
12207
|
startNewLine() {
|
|
12170
|
-
this._hOffset = 0, this.flowDirection ==
|
|
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;
|
|
12171
12209
|
}
|
|
12172
12210
|
/**
|
|
12173
12211
|
* Apply translation on the specified buffer geometries according to text alignment setting
|
|
@@ -12185,15 +12223,15 @@ class gl {
|
|
|
12185
12223
|
}), r) {
|
|
12186
12224
|
const n = r.getSize(dl);
|
|
12187
12225
|
switch (this.currentHorizontalAlignment) {
|
|
12188
|
-
case
|
|
12226
|
+
case se.LEFT:
|
|
12189
12227
|
break;
|
|
12190
|
-
case
|
|
12228
|
+
case se.CENTER:
|
|
12191
12229
|
e.forEach((a) => a.translate((this.maxWidth - n.x) / 2, 0, 0));
|
|
12192
12230
|
break;
|
|
12193
|
-
case
|
|
12231
|
+
case se.RIGHT:
|
|
12194
12232
|
e.forEach((a) => a.translate(this.maxWidth - n.x, 0, 0));
|
|
12195
12233
|
break;
|
|
12196
|
-
case
|
|
12234
|
+
case se.DISTRIBUTED:
|
|
12197
12235
|
if (e.length > 1) {
|
|
12198
12236
|
const a = (this.maxWidth - n.x) / (e.length - 1);
|
|
12199
12237
|
for (let s = 1; s < e.length; s++)
|
|
@@ -12213,8 +12251,8 @@ class gl {
|
|
|
12213
12251
|
* - For SHX fonts (AutoCAD's built-in vector fonts, such as txt.shx), the space width is often half the text height.
|
|
12214
12252
|
* So if the text height is 10, the space width is typically 5 units.
|
|
12215
12253
|
*/
|
|
12216
|
-
|
|
12217
|
-
return this.fontManager.getFontType(
|
|
12254
|
+
calculateBlankWidthForFont(e, r) {
|
|
12255
|
+
return this.fontManager.getFontType(e) === "shx" ? r * 0.5 : r * 0.3;
|
|
12218
12256
|
}
|
|
12219
12257
|
/**
|
|
12220
12258
|
* Convert the text shape geometries to three.js object
|
|
@@ -12225,7 +12263,7 @@ class gl {
|
|
|
12225
12263
|
const n = new R.Group(), a = this.currentColor, s = e.filter((u) => u instanceof R.ExtrudeGeometry);
|
|
12226
12264
|
if (s.length > 0) {
|
|
12227
12265
|
const u = new R.Mesh();
|
|
12228
|
-
u.geometry =
|
|
12266
|
+
u.geometry = fn(s), u.material = this.styleManager.getMeshBasicMaterial(a), u.userData.bboxIntersectionCheck = !0, n.add(u);
|
|
12229
12267
|
}
|
|
12230
12268
|
const i = [
|
|
12231
12269
|
...r,
|
|
@@ -12233,12 +12271,18 @@ class gl {
|
|
|
12233
12271
|
];
|
|
12234
12272
|
if (i.length > 0) {
|
|
12235
12273
|
const u = new R.LineSegments();
|
|
12236
|
-
u.geometry =
|
|
12274
|
+
u.geometry = fn(i), u.material = this.styleManager.getLineBasicMaterial(a), u.userData.bboxIntersectionCheck = !0, n.add(u);
|
|
12237
12275
|
}
|
|
12238
12276
|
return n.children.length === 1 ? n.children[0] : n;
|
|
12239
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
|
+
}
|
|
12240
12284
|
}
|
|
12241
|
-
const Mt = /* @__PURE__ */ new R.Vector3(),
|
|
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);
|
|
12242
12286
|
class Sl extends R.Object3D {
|
|
12243
12287
|
/**
|
|
12244
12288
|
* Creates a new instance of MText.
|
|
@@ -12319,7 +12363,7 @@ class Sl extends R.Object3D {
|
|
|
12319
12363
|
const { object: n, height: a } = this.createMTextGroup(e, r);
|
|
12320
12364
|
if (!n)
|
|
12321
12365
|
return;
|
|
12322
|
-
n.matrix.decompose(
|
|
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));
|
|
12323
12367
|
const s = e.width, i = this.calculateAnchorPoint(
|
|
12324
12368
|
s,
|
|
12325
12369
|
a,
|
|
@@ -12331,12 +12375,12 @@ class Sl extends R.Object3D {
|
|
|
12331
12375
|
});
|
|
12332
12376
|
let u = e.rotation || 0;
|
|
12333
12377
|
if (e.directionVector) {
|
|
12334
|
-
const l = e.directionVector, c = new R.Vector3(l.x, l.y, l.z), p = c.clone().cross(
|
|
12378
|
+
const l = e.directionVector, c = new R.Vector3(l.x, l.y, l.z), p = c.clone().cross(vn), h = vn.angleTo(c);
|
|
12335
12379
|
u = p.z > 0 ? -h : h;
|
|
12336
12380
|
}
|
|
12337
|
-
n.matrix.compose(
|
|
12338
|
-
const o = e.position ?
|
|
12339
|
-
return It.makeTranslation(-o.x, -o.y, 0),
|
|
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;
|
|
12340
12384
|
}
|
|
12341
12385
|
/**
|
|
12342
12386
|
* Creates a group of text elements from MText data.
|
|
@@ -12350,11 +12394,11 @@ class Sl extends R.Object3D {
|
|
|
12350
12394
|
this.styleManager.unsupportedTextStyles[g] || (this.styleManager.unsupportedTextStyles[g] = 0), this.styleManager.unsupportedTextStyles[g]++;
|
|
12351
12395
|
}
|
|
12352
12396
|
const n = e.width || 0;
|
|
12353
|
-
let a =
|
|
12354
|
-
e.width && e.attachmentPoint && ([1, 4, 7].includes(e.attachmentPoint) ? a =
|
|
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));
|
|
12355
12399
|
let s = _e.BOTTOM;
|
|
12356
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));
|
|
12357
|
-
const i = e.height || 0, u = e.lineSpaceFactor || 0.3, o = e.drawingDirection ??
|
|
12401
|
+
const i = e.height || 0, u = e.lineSpaceFactor || 0.3, o = e.drawingDirection ?? je.LEFT_TO_RIGHT, l = {
|
|
12358
12402
|
fontSize: i,
|
|
12359
12403
|
widthFactor: e.widthFactor ?? 1,
|
|
12360
12404
|
lineSpaceFactor: u,
|
|
@@ -12364,16 +12408,16 @@ class Sl extends R.Object3D {
|
|
|
12364
12408
|
byBlockColor: this._colorSettings.byBlockColor,
|
|
12365
12409
|
byLayerColor: this._colorSettings.byLayerColor,
|
|
12366
12410
|
removeFontExtension: !0
|
|
12367
|
-
}, c = new
|
|
12411
|
+
}, c = new mt();
|
|
12368
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;
|
|
12369
12413
|
const h = new pl(e.text, c, !0).parse(), f = new gl(
|
|
12370
12414
|
r,
|
|
12371
12415
|
this.styleManager,
|
|
12372
12416
|
this.fontManager,
|
|
12373
12417
|
l
|
|
12374
|
-
),
|
|
12418
|
+
), d = f.processText(h);
|
|
12375
12419
|
return f.processLastLine(), {
|
|
12376
|
-
object:
|
|
12420
|
+
object: d,
|
|
12377
12421
|
height: f.totalHeight
|
|
12378
12422
|
};
|
|
12379
12423
|
}
|
|
@@ -12417,7 +12461,7 @@ class Sl extends R.Object3D {
|
|
|
12417
12461
|
s -= e, i += r;
|
|
12418
12462
|
break;
|
|
12419
12463
|
}
|
|
12420
|
-
return a ==
|
|
12464
|
+
return a == je.BOTTOM_TO_TOP && (i -= r), { x: s, y: i };
|
|
12421
12465
|
}
|
|
12422
12466
|
/**
|
|
12423
12467
|
* Recursively calculates bounding boxes for an object and its children.
|
|
@@ -12452,14 +12496,14 @@ class kl {
|
|
|
12452
12496
|
}
|
|
12453
12497
|
}
|
|
12454
12498
|
export {
|
|
12455
|
-
|
|
12456
|
-
|
|
12499
|
+
gn as BaseFont,
|
|
12500
|
+
yn as BaseTextShape,
|
|
12457
12501
|
bl as DefaultFontLoader,
|
|
12458
|
-
|
|
12502
|
+
pr as EventManager,
|
|
12459
12503
|
Se as FontFactory,
|
|
12460
12504
|
Me as FontManager,
|
|
12461
12505
|
Sl as MText,
|
|
12462
12506
|
cl as MTextAttachmentPoint,
|
|
12463
|
-
|
|
12507
|
+
je as MTextFlowDirection,
|
|
12464
12508
|
kl as StyleManager
|
|
12465
12509
|
};
|