@mlightcad/mtext-renderer 0.2.0 → 0.2.2
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.
|
@@ -55,14 +55,303 @@ class gn extends R.Shape {
|
|
|
55
55
|
super(), this.width = 0, this.char = e;
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
const
|
|
59
|
-
|
|
58
|
+
const Gt = (t, e) => e.some((r) => t instanceof r);
|
|
59
|
+
let pr, dr;
|
|
60
|
+
function xa() {
|
|
61
|
+
return pr || (pr = [
|
|
62
|
+
IDBDatabase,
|
|
63
|
+
IDBObjectStore,
|
|
64
|
+
IDBIndex,
|
|
65
|
+
IDBCursor,
|
|
66
|
+
IDBTransaction
|
|
67
|
+
]);
|
|
68
|
+
}
|
|
69
|
+
function ba() {
|
|
70
|
+
return dr || (dr = [
|
|
71
|
+
IDBCursor.prototype.advance,
|
|
72
|
+
IDBCursor.prototype.continue,
|
|
73
|
+
IDBCursor.prototype.continuePrimaryKey
|
|
74
|
+
]);
|
|
75
|
+
}
|
|
76
|
+
const Nt = /* @__PURE__ */ new WeakMap(), bt = /* @__PURE__ */ new WeakMap(), dt = /* @__PURE__ */ new WeakMap();
|
|
77
|
+
function Sa(t) {
|
|
78
|
+
const e = new Promise((r, n) => {
|
|
79
|
+
const a = () => {
|
|
80
|
+
t.removeEventListener("success", s), t.removeEventListener("error", i);
|
|
81
|
+
}, s = () => {
|
|
82
|
+
r(Ue(t.result)), a();
|
|
83
|
+
}, i = () => {
|
|
84
|
+
n(t.error), a();
|
|
85
|
+
};
|
|
86
|
+
t.addEventListener("success", s), t.addEventListener("error", i);
|
|
87
|
+
});
|
|
88
|
+
return dt.set(e, t), e;
|
|
89
|
+
}
|
|
90
|
+
function ka(t) {
|
|
91
|
+
if (Nt.has(t))
|
|
92
|
+
return;
|
|
93
|
+
const e = new Promise((r, n) => {
|
|
94
|
+
const a = () => {
|
|
95
|
+
t.removeEventListener("complete", s), t.removeEventListener("error", i), t.removeEventListener("abort", i);
|
|
96
|
+
}, s = () => {
|
|
97
|
+
r(), a();
|
|
98
|
+
}, i = () => {
|
|
99
|
+
n(t.error || new DOMException("AbortError", "AbortError")), a();
|
|
100
|
+
};
|
|
101
|
+
t.addEventListener("complete", s), t.addEventListener("error", i), t.addEventListener("abort", i);
|
|
102
|
+
});
|
|
103
|
+
Nt.set(t, e);
|
|
104
|
+
}
|
|
105
|
+
let _t = {
|
|
106
|
+
get(t, e, r) {
|
|
107
|
+
if (t instanceof IDBTransaction) {
|
|
108
|
+
if (e === "done")
|
|
109
|
+
return Nt.get(t);
|
|
110
|
+
if (e === "store")
|
|
111
|
+
return r.objectStoreNames[1] ? void 0 : r.objectStore(r.objectStoreNames[0]);
|
|
112
|
+
}
|
|
113
|
+
return Ue(t[e]);
|
|
114
|
+
},
|
|
115
|
+
set(t, e, r) {
|
|
116
|
+
return t[e] = r, !0;
|
|
117
|
+
},
|
|
118
|
+
has(t, e) {
|
|
119
|
+
return t instanceof IDBTransaction && (e === "done" || e === "store") ? !0 : e in t;
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
function yn(t) {
|
|
123
|
+
_t = t(_t);
|
|
124
|
+
}
|
|
125
|
+
function Ta(t) {
|
|
126
|
+
return ba().includes(t) ? function(...e) {
|
|
127
|
+
return t.apply(Ht(this), e), Ue(this.request);
|
|
128
|
+
} : function(...e) {
|
|
129
|
+
return Ue(t.apply(Ht(this), e));
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function Fa(t) {
|
|
133
|
+
return typeof t == "function" ? Ta(t) : (t instanceof IDBTransaction && ka(t), Gt(t, xa()) ? new Proxy(t, _t) : t);
|
|
134
|
+
}
|
|
135
|
+
function Ue(t) {
|
|
136
|
+
if (t instanceof IDBRequest)
|
|
137
|
+
return Sa(t);
|
|
138
|
+
if (bt.has(t))
|
|
139
|
+
return bt.get(t);
|
|
140
|
+
const e = Fa(t);
|
|
141
|
+
return e !== t && (bt.set(t, e), dt.set(e, t)), e;
|
|
142
|
+
}
|
|
143
|
+
const Ht = (t) => dt.get(t);
|
|
144
|
+
function wa(t, e, { blocked: r, upgrade: n, blocking: a, terminated: s } = {}) {
|
|
145
|
+
const i = indexedDB.open(t, e), u = Ue(i);
|
|
146
|
+
return n && i.addEventListener("upgradeneeded", (o) => {
|
|
147
|
+
n(Ue(i.result), o.oldVersion, o.newVersion, Ue(i.transaction), o);
|
|
148
|
+
}), r && i.addEventListener("blocked", (o) => r(
|
|
149
|
+
// Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
|
|
150
|
+
o.oldVersion,
|
|
151
|
+
o.newVersion,
|
|
152
|
+
o
|
|
153
|
+
)), u.then((o) => {
|
|
154
|
+
s && o.addEventListener("close", () => s()), a && o.addEventListener("versionchange", (l) => a(l.oldVersion, l.newVersion, l));
|
|
155
|
+
}).catch(() => {
|
|
156
|
+
}), u;
|
|
157
|
+
}
|
|
158
|
+
const Ca = ["get", "getKey", "getAll", "getAllKeys", "count"], Ea = ["put", "add", "delete", "clear"], St = /* @__PURE__ */ new Map();
|
|
159
|
+
function vr(t, e) {
|
|
160
|
+
if (!(t instanceof IDBDatabase && !(e in t) && typeof e == "string"))
|
|
161
|
+
return;
|
|
162
|
+
if (St.get(e))
|
|
163
|
+
return St.get(e);
|
|
164
|
+
const r = e.replace(/FromIndex$/, ""), n = e !== r, a = Ea.includes(r);
|
|
165
|
+
if (
|
|
166
|
+
// Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
|
|
167
|
+
!(r in (n ? IDBIndex : IDBObjectStore).prototype) || !(a || Ca.includes(r))
|
|
168
|
+
)
|
|
169
|
+
return;
|
|
170
|
+
const s = async function(i, ...u) {
|
|
171
|
+
const o = this.transaction(i, a ? "readwrite" : "readonly");
|
|
172
|
+
let l = o.store;
|
|
173
|
+
return n && (l = l.index(u.shift())), (await Promise.all([
|
|
174
|
+
l[r](...u),
|
|
175
|
+
a && o.done
|
|
176
|
+
]))[0];
|
|
177
|
+
};
|
|
178
|
+
return St.set(e, s), s;
|
|
179
|
+
}
|
|
180
|
+
yn((t) => ({
|
|
181
|
+
...t,
|
|
182
|
+
get: (e, r, n) => vr(e, r) || t.get(e, r, n),
|
|
183
|
+
has: (e, r) => !!vr(e, r) || t.has(e, r)
|
|
184
|
+
}));
|
|
185
|
+
const Oa = ["continue", "continuePrimaryKey", "advance"], gr = {}, zt = /* @__PURE__ */ new WeakMap(), mn = /* @__PURE__ */ new WeakMap(), Ua = {
|
|
186
|
+
get(t, e) {
|
|
187
|
+
if (!Oa.includes(e))
|
|
188
|
+
return t[e];
|
|
189
|
+
let r = gr[e];
|
|
190
|
+
return r || (r = gr[e] = function(...n) {
|
|
191
|
+
zt.set(this, mn.get(this)[e](...n));
|
|
192
|
+
}), r;
|
|
193
|
+
}
|
|
194
|
+
};
|
|
195
|
+
async function* La(...t) {
|
|
196
|
+
let e = this;
|
|
197
|
+
if (e instanceof IDBCursor || (e = await e.openCursor(...t)), !e)
|
|
198
|
+
return;
|
|
199
|
+
e = e;
|
|
200
|
+
const r = new Proxy(e, Ua);
|
|
201
|
+
for (mn.set(r, e), dt.set(r, Ht(e)); e; )
|
|
202
|
+
yield r, e = await (zt.get(r) || e.continue()), zt.delete(r);
|
|
203
|
+
}
|
|
204
|
+
function yr(t, e) {
|
|
205
|
+
return e === Symbol.asyncIterator && Gt(t, [IDBIndex, IDBObjectStore, IDBCursor]) || e === "iterate" && Gt(t, [IDBIndex, IDBObjectStore]);
|
|
206
|
+
}
|
|
207
|
+
yn((t) => ({
|
|
208
|
+
...t,
|
|
209
|
+
get(e, r, n) {
|
|
210
|
+
return yr(e, r) ? La : t.get(e, r, n);
|
|
211
|
+
},
|
|
212
|
+
has(e, r) {
|
|
213
|
+
return yr(e, r) || t.has(e, r);
|
|
214
|
+
}
|
|
215
|
+
}));
|
|
216
|
+
const Ae = {
|
|
217
|
+
fonts: "fonts"
|
|
218
|
+
}, kt = [
|
|
219
|
+
{
|
|
220
|
+
version: 1,
|
|
221
|
+
stores: [
|
|
222
|
+
{
|
|
223
|
+
name: Ae.fonts,
|
|
224
|
+
keyPath: "name"
|
|
225
|
+
}
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
], J = class J {
|
|
229
|
+
constructor() {
|
|
230
|
+
this.isClosing = !1, typeof window < "u" && window.addEventListener("unload", () => {
|
|
231
|
+
this.close();
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Returns the singleton instance of the FontCacheManager
|
|
236
|
+
*/
|
|
237
|
+
static get instance() {
|
|
238
|
+
return J._instance || (J._instance = new J()), J._instance;
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Sets a font in the cache
|
|
242
|
+
* @param fileName The font file name (key)
|
|
243
|
+
* @param fontData The font data to store
|
|
244
|
+
*/
|
|
245
|
+
async set(e, r) {
|
|
246
|
+
await (await this.getDatabase()).put(Ae.fonts, { ...r, name: e });
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Gets a font from the cache
|
|
250
|
+
* @param fileName The font file name (key)
|
|
251
|
+
* @returns The font data if found, undefined otherwise
|
|
252
|
+
*/
|
|
253
|
+
async get(e) {
|
|
254
|
+
return await (await this.getDatabase()).get(Ae.fonts, e);
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Deletes a font from the cache
|
|
258
|
+
* @param fileName The font file name (key)
|
|
259
|
+
*/
|
|
260
|
+
async delete(e) {
|
|
261
|
+
await (await this.getDatabase()).delete(Ae.fonts, e);
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Gets all fonts from the cache
|
|
265
|
+
* @returns An array of all font data in the cache
|
|
266
|
+
*/
|
|
267
|
+
async getAll() {
|
|
268
|
+
return await (await this.getDatabase()).getAll(Ae.fonts);
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Clears all fonts from the cache
|
|
272
|
+
*/
|
|
273
|
+
async clear() {
|
|
274
|
+
await (await this.getDatabase()).clear(Ae.fonts);
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Checks if a font exists in the cache
|
|
278
|
+
* @param fileName The font file name (key)
|
|
279
|
+
*/
|
|
280
|
+
async has(e) {
|
|
281
|
+
return await this.get(e) !== void 0;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Closes the database connection and cleans up resources.
|
|
285
|
+
* After calling this, any further operations will require reopening the database.
|
|
286
|
+
*/
|
|
287
|
+
close() {
|
|
288
|
+
if (!this.isClosing) {
|
|
289
|
+
this.isClosing = !0;
|
|
290
|
+
try {
|
|
291
|
+
this.db && (this.db.close(), this.db = void 0);
|
|
292
|
+
} finally {
|
|
293
|
+
this.isClosing = !1;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Destroys the database instance and deletes all data.
|
|
299
|
+
* Use with caution as this operation cannot be undone.
|
|
300
|
+
*/
|
|
301
|
+
async destroy() {
|
|
302
|
+
this.close(), await indexedDB.deleteDatabase(J.DATABASE_NAME), J._instance = void 0;
|
|
303
|
+
}
|
|
304
|
+
// Private methods for database management
|
|
305
|
+
async getDatabase() {
|
|
306
|
+
if (this.isClosing)
|
|
307
|
+
throw new Error("Cannot perform operation while database is closing");
|
|
308
|
+
return this.db ? this.db : (this.db = await wa(
|
|
309
|
+
J.DATABASE_NAME,
|
|
310
|
+
J.DATABASE_VERSION,
|
|
311
|
+
{
|
|
312
|
+
upgrade: (e, r, n) => this.handleUpgrade(e, r, n),
|
|
313
|
+
blocked() {
|
|
314
|
+
console.warn("Database upgrade blocked - please close other tabs using the application");
|
|
315
|
+
},
|
|
316
|
+
blocking() {
|
|
317
|
+
console.warn("Database blocking newer version - closing connection"), J.instance.close();
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
), this.db);
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Applies all schema versions that are greater than the old version and less than or equal to the new version
|
|
324
|
+
* @param db The database instance
|
|
325
|
+
* @param oldVersion The old version of the database
|
|
326
|
+
* @param newVersion The new version of the database
|
|
327
|
+
*/
|
|
328
|
+
handleUpgrade(e, r, n) {
|
|
329
|
+
const a = kt.filter(
|
|
330
|
+
(s) => s.version > r && (!n || s.version <= n)
|
|
331
|
+
);
|
|
332
|
+
for (const s of a)
|
|
333
|
+
this.applySchemaVersion(e, s);
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Applies a single schema version's changes to the database
|
|
337
|
+
* @param db The database instance
|
|
338
|
+
* @param schema The schema version to apply
|
|
339
|
+
*/
|
|
340
|
+
applySchemaVersion(e, r) {
|
|
341
|
+
for (const n of r.stores)
|
|
342
|
+
e.objectStoreNames.contains(n.name) || e.createObjectStore(n.name, { keyPath: n.keyPath });
|
|
343
|
+
}
|
|
344
|
+
};
|
|
345
|
+
J.DATABASE_NAME = "mlightcad", J.DATABASE_VERSION = kt[kt.length - 1].version;
|
|
346
|
+
let He = J;
|
|
347
|
+
const Ra = (t) => t.substring(t.lastIndexOf(".") + 1), xn = (t) => t.split("/").pop(), mr = (t) => {
|
|
348
|
+
const e = xn(t);
|
|
60
349
|
if (e) {
|
|
61
350
|
const r = e.lastIndexOf(".");
|
|
62
351
|
return r === -1 ? e : e.substring(0, r);
|
|
63
352
|
}
|
|
64
353
|
return t;
|
|
65
|
-
},
|
|
354
|
+
}, Aa = [
|
|
66
355
|
0,
|
|
67
356
|
16711680,
|
|
68
357
|
16776960,
|
|
@@ -320,19 +609,19 @@ const xa = (t) => t.substring(t.lastIndexOf(".") + 1), yn = (t) => t.split("/").
|
|
|
320
609
|
14079702,
|
|
321
610
|
16777215,
|
|
322
611
|
0
|
|
323
|
-
],
|
|
324
|
-
let
|
|
612
|
+
], Da = (t) => Aa[t];
|
|
613
|
+
let Ma = class {
|
|
325
614
|
constructor(e) {
|
|
326
615
|
this.isFont = !0, this.type = "Font", this.data = e;
|
|
327
616
|
}
|
|
328
617
|
generateShapes(e, r = 100) {
|
|
329
|
-
const n = [], a =
|
|
618
|
+
const n = [], a = Ba(e, r, this.data);
|
|
330
619
|
for (let s = 0, i = a.length; s < i; s++)
|
|
331
620
|
n.push(...a[s].toShapes());
|
|
332
621
|
return n;
|
|
333
622
|
}
|
|
334
623
|
};
|
|
335
|
-
function
|
|
624
|
+
function Ba(t, e, r) {
|
|
336
625
|
const n = Array.from(t), a = e / r.resolution, s = (r.boundingBox.yMax - r.boundingBox.yMin + r.underlineThickness) * a, i = [];
|
|
337
626
|
let u = 0, o = 0;
|
|
338
627
|
for (let l = 0; l < n.length; l++) {
|
|
@@ -341,13 +630,13 @@ function Ta(t, e, r) {
|
|
|
341
630
|
`)
|
|
342
631
|
u = 0, o -= s;
|
|
343
632
|
else {
|
|
344
|
-
const p =
|
|
633
|
+
const p = Pa(c, a, u, o, r);
|
|
345
634
|
u += p.offsetX, i.push(p.path);
|
|
346
635
|
}
|
|
347
636
|
}
|
|
348
637
|
return i;
|
|
349
638
|
}
|
|
350
|
-
function
|
|
639
|
+
function Pa(t, e, r, n, a) {
|
|
351
640
|
const s = a.glyphs[t] || a.glyphs["?"];
|
|
352
641
|
if (!s) {
|
|
353
642
|
console.error('THREE.Font: character "' + t + '" does not exists in font family ' + a.familyName + ".");
|
|
@@ -375,7 +664,7 @@ function Fa(t, e, r, n, a) {
|
|
|
375
664
|
}
|
|
376
665
|
return { offsetX: s.ha * e, path: i };
|
|
377
666
|
}
|
|
378
|
-
class
|
|
667
|
+
class Ia extends ga {
|
|
379
668
|
constructor(e, r = {}) {
|
|
380
669
|
const n = r.font;
|
|
381
670
|
if (n === void 0)
|
|
@@ -387,7 +676,7 @@ class wa extends ga {
|
|
|
387
676
|
this.type = "TextGeometry";
|
|
388
677
|
}
|
|
389
678
|
}
|
|
390
|
-
class
|
|
679
|
+
class xr extends gn {
|
|
391
680
|
constructor(e, r, n) {
|
|
392
681
|
super(e), this.isFound = !1, this.fontSize = r, this.font = n, this.width = this.getCharWidth(e, r, n);
|
|
393
682
|
}
|
|
@@ -397,7 +686,7 @@ class dr extends gn {
|
|
|
397
686
|
* @returns A THREE.js BufferGeometry representing the text shape
|
|
398
687
|
*/
|
|
399
688
|
toGeometry() {
|
|
400
|
-
return new
|
|
689
|
+
return new Ia(this.char, {
|
|
401
690
|
font: this.font.font,
|
|
402
691
|
depth: 0,
|
|
403
692
|
size: this.fontSize,
|
|
@@ -445,14 +734,14 @@ String.prototype.codePointAt || function() {
|
|
|
445
734
|
writable: !0
|
|
446
735
|
}) : String.prototype.codePointAt = e;
|
|
447
736
|
}();
|
|
448
|
-
var Jt = 0,
|
|
737
|
+
var Jt = 0, bn = -3;
|
|
449
738
|
function We() {
|
|
450
739
|
this.table = new Uint16Array(16), this.trans = new Uint16Array(288);
|
|
451
740
|
}
|
|
452
|
-
function
|
|
741
|
+
function Ga(t, e) {
|
|
453
742
|
this.source = t, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = e, this.destLen = 0, this.ltree = new We(), this.dtree = new We();
|
|
454
743
|
}
|
|
455
|
-
var
|
|
744
|
+
var Sn = new We(), kn = new We(), $t = new Uint8Array(30), er = new Uint16Array(30), Tn = new Uint8Array(30), Fn = new Uint16Array(30), Na = new Uint8Array([
|
|
456
745
|
16,
|
|
457
746
|
17,
|
|
458
747
|
18,
|
|
@@ -472,8 +761,8 @@ var xn = new We(), bn = new We(), $t = new Uint8Array(30), er = new Uint16Array(
|
|
|
472
761
|
14,
|
|
473
762
|
1,
|
|
474
763
|
15
|
|
475
|
-
]),
|
|
476
|
-
function
|
|
764
|
+
]), br = new We(), ce = new Uint8Array(320);
|
|
765
|
+
function wn(t, e, r, n) {
|
|
477
766
|
var a, s;
|
|
478
767
|
for (a = 0; a < r; ++a)
|
|
479
768
|
t[a] = 0;
|
|
@@ -482,7 +771,7 @@ function Tn(t, e, r, n) {
|
|
|
482
771
|
for (s = n, a = 0; a < 30; ++a)
|
|
483
772
|
e[a] = s, s += 1 << t[a];
|
|
484
773
|
}
|
|
485
|
-
function
|
|
774
|
+
function _a(t, e) {
|
|
486
775
|
var r;
|
|
487
776
|
for (r = 0; r < 7; ++r)
|
|
488
777
|
t.table[r] = 0;
|
|
@@ -499,19 +788,19 @@ function Oa(t, e) {
|
|
|
499
788
|
for (e.table[5] = 32, r = 0; r < 32; ++r)
|
|
500
789
|
e.trans[r] = r;
|
|
501
790
|
}
|
|
502
|
-
var
|
|
503
|
-
function
|
|
791
|
+
var Sr = new Uint16Array(16);
|
|
792
|
+
function Tt(t, e, r, n) {
|
|
504
793
|
var a, s;
|
|
505
794
|
for (a = 0; a < 16; ++a)
|
|
506
795
|
t.table[a] = 0;
|
|
507
796
|
for (a = 0; a < n; ++a)
|
|
508
797
|
t.table[e[r + a]]++;
|
|
509
798
|
for (t.table[0] = 0, s = 0, a = 0; a < 16; ++a)
|
|
510
|
-
|
|
799
|
+
Sr[a] = s, s += t.table[a];
|
|
511
800
|
for (a = 0; a < n; ++a)
|
|
512
|
-
e[r + a] && (t.trans[
|
|
801
|
+
e[r + a] && (t.trans[Sr[e[r + a]]++] = a);
|
|
513
802
|
}
|
|
514
|
-
function
|
|
803
|
+
function Ha(t) {
|
|
515
804
|
t.bitcount-- || (t.tag = t.source[t.sourceIndex++], t.bitcount = 7);
|
|
516
805
|
var e = t.tag & 1;
|
|
517
806
|
return t.tag >>>= 1, e;
|
|
@@ -524,7 +813,7 @@ function he(t, e, r) {
|
|
|
524
813
|
var n = t.tag & 65535 >>> 16 - e;
|
|
525
814
|
return t.tag >>>= e, t.bitcount -= e, n + r;
|
|
526
815
|
}
|
|
527
|
-
function
|
|
816
|
+
function Wt(t, e) {
|
|
528
817
|
for (; t.bitcount < 24; )
|
|
529
818
|
t.tag |= t.source[t.sourceIndex++] << t.bitcount, t.bitcount += 8;
|
|
530
819
|
var r = 0, n = 0, a = 0, s = t.tag;
|
|
@@ -533,16 +822,16 @@ function Gt(t, e) {
|
|
|
533
822
|
while (n >= 0);
|
|
534
823
|
return t.tag = s, t.bitcount -= a, e.trans[r + n];
|
|
535
824
|
}
|
|
536
|
-
function
|
|
825
|
+
function za(t, e, r) {
|
|
537
826
|
var n, a, s, i, u, o;
|
|
538
827
|
for (n = he(t, 5, 257), a = he(t, 5, 1), s = he(t, 4, 4), i = 0; i < 19; ++i)
|
|
539
828
|
ce[i] = 0;
|
|
540
829
|
for (i = 0; i < s; ++i) {
|
|
541
830
|
var l = he(t, 3, 0);
|
|
542
|
-
ce[
|
|
831
|
+
ce[Na[i]] = l;
|
|
543
832
|
}
|
|
544
|
-
for (
|
|
545
|
-
var c =
|
|
833
|
+
for (Tt(br, ce, 0, 19), u = 0; u < n + a; ) {
|
|
834
|
+
var c = Wt(t, br);
|
|
546
835
|
switch (c) {
|
|
547
836
|
case 16:
|
|
548
837
|
var p = ce[u - 1];
|
|
@@ -562,58 +851,58 @@ function La(t, e, r) {
|
|
|
562
851
|
break;
|
|
563
852
|
}
|
|
564
853
|
}
|
|
565
|
-
|
|
854
|
+
Tt(e, ce, 0, n), Tt(r, ce, n, a);
|
|
566
855
|
}
|
|
567
|
-
function
|
|
856
|
+
function kr(t, e, r) {
|
|
568
857
|
for (; ; ) {
|
|
569
|
-
var n =
|
|
858
|
+
var n = Wt(t, e);
|
|
570
859
|
if (n === 256)
|
|
571
860
|
return Jt;
|
|
572
861
|
if (n < 256)
|
|
573
862
|
t.dest[t.destLen++] = n;
|
|
574
863
|
else {
|
|
575
864
|
var a, s, i, u;
|
|
576
|
-
for (n -= 257, a = he(t, $t[n], er[n]), s =
|
|
865
|
+
for (n -= 257, a = he(t, $t[n], er[n]), s = Wt(t, r), i = t.destLen - he(t, Tn[s], Fn[s]), u = i; u < i + a; ++u)
|
|
577
866
|
t.dest[t.destLen++] = t.dest[u];
|
|
578
867
|
}
|
|
579
868
|
}
|
|
580
869
|
}
|
|
581
|
-
function
|
|
870
|
+
function Wa(t) {
|
|
582
871
|
for (var e, r, n; t.bitcount > 8; )
|
|
583
872
|
t.sourceIndex--, t.bitcount -= 8;
|
|
584
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))
|
|
585
|
-
return
|
|
874
|
+
return bn;
|
|
586
875
|
for (t.sourceIndex += 4, n = e; n; --n)
|
|
587
876
|
t.dest[t.destLen++] = t.source[t.sourceIndex++];
|
|
588
877
|
return t.bitcount = 0, Jt;
|
|
589
878
|
}
|
|
590
|
-
function
|
|
591
|
-
var r = new
|
|
879
|
+
function Va(t, e) {
|
|
880
|
+
var r = new Ga(t, e), n, a, s;
|
|
592
881
|
do {
|
|
593
|
-
switch (n =
|
|
882
|
+
switch (n = Ha(r), a = he(r, 2, 0), a) {
|
|
594
883
|
case 0:
|
|
595
|
-
s =
|
|
884
|
+
s = Wa(r);
|
|
596
885
|
break;
|
|
597
886
|
case 1:
|
|
598
|
-
s =
|
|
887
|
+
s = kr(r, Sn, kn);
|
|
599
888
|
break;
|
|
600
889
|
case 2:
|
|
601
|
-
|
|
890
|
+
za(r, r.ltree, r.dtree), s = kr(r, r.ltree, r.dtree);
|
|
602
891
|
break;
|
|
603
892
|
default:
|
|
604
|
-
s =
|
|
893
|
+
s = bn;
|
|
605
894
|
}
|
|
606
895
|
if (s !== Jt)
|
|
607
896
|
throw new Error("Data error");
|
|
608
897
|
} while (!n);
|
|
609
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;
|
|
610
899
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
Tn
|
|
900
|
+
_a(Sn, kn);
|
|
901
|
+
wn($t, er, 4, 3);
|
|
902
|
+
wn(Tn, Fn, 2, 1);
|
|
614
903
|
$t[28] = 0;
|
|
615
904
|
er[28] = 258;
|
|
616
|
-
var
|
|
905
|
+
var qa = Va;
|
|
617
906
|
function Re(t, e, r, n, a) {
|
|
618
907
|
return Math.pow(1 - a, 3) * t + 3 * Math.pow(1 - a, 2) * a * e + 3 * (1 - a) * Math.pow(a, 2) * r + Math.pow(a, 3) * n;
|
|
619
908
|
}
|
|
@@ -768,13 +1057,13 @@ _.prototype.toDOMElement = function(t) {
|
|
|
768
1057
|
var e = this.toPathData(t), r = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
769
1058
|
return r.setAttribute("d", e), r;
|
|
770
1059
|
};
|
|
771
|
-
function
|
|
1060
|
+
function Cn(t) {
|
|
772
1061
|
throw new Error(t);
|
|
773
1062
|
}
|
|
774
|
-
function
|
|
775
|
-
t ||
|
|
1063
|
+
function Tr(t, e) {
|
|
1064
|
+
t || Cn(e);
|
|
776
1065
|
}
|
|
777
|
-
var E = { fail:
|
|
1066
|
+
var E = { fail: Cn, argument: Tr, assert: Tr }, Fr = 32768, wr = 2147483648, Pe = {}, b = {}, U = {};
|
|
778
1067
|
function ue(t) {
|
|
779
1068
|
return function() {
|
|
780
1069
|
return t;
|
|
@@ -802,7 +1091,7 @@ b.USHORT = function(t) {
|
|
|
802
1091
|
};
|
|
803
1092
|
U.USHORT = ue(2);
|
|
804
1093
|
b.SHORT = function(t) {
|
|
805
|
-
return t >=
|
|
1094
|
+
return t >= Fr && (t = -(2 * Fr - t)), [t >> 8 & 255, t & 255];
|
|
806
1095
|
};
|
|
807
1096
|
U.SHORT = ue(2);
|
|
808
1097
|
b.UINT24 = function(t) {
|
|
@@ -814,7 +1103,7 @@ b.ULONG = function(t) {
|
|
|
814
1103
|
};
|
|
815
1104
|
U.ULONG = ue(4);
|
|
816
1105
|
b.LONG = function(t) {
|
|
817
|
-
return t >=
|
|
1106
|
+
return t >= wr && (t = -(2 * wr - t)), [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
818
1107
|
};
|
|
819
1108
|
U.LONG = ue(4);
|
|
820
1109
|
b.FIXED = b.ULONG;
|
|
@@ -880,12 +1169,12 @@ b.NAME = b.CHARARRAY;
|
|
|
880
1169
|
U.NAME = U.CHARARRAY;
|
|
881
1170
|
b.STRING = b.CHARARRAY;
|
|
882
1171
|
U.STRING = U.CHARARRAY;
|
|
883
|
-
|
|
1172
|
+
Pe.UTF8 = function(t, e, r) {
|
|
884
1173
|
for (var n = [], a = r, s = 0; s < a; s++, e += 1)
|
|
885
1174
|
n[s] = t.getUint8(e);
|
|
886
1175
|
return String.fromCharCode.apply(null, n);
|
|
887
1176
|
};
|
|
888
|
-
|
|
1177
|
+
Pe.UTF16 = function(t, e, r) {
|
|
889
1178
|
for (var n = [], a = r / 2, s = 0; s < a; s++, e += 2)
|
|
890
1179
|
n[s] = t.getUint16(e);
|
|
891
1180
|
return String.fromCharCode.apply(null, n);
|
|
@@ -900,7 +1189,7 @@ b.UTF16 = function(t) {
|
|
|
900
1189
|
U.UTF16 = function(t) {
|
|
901
1190
|
return t.length * 2;
|
|
902
1191
|
};
|
|
903
|
-
var
|
|
1192
|
+
var Vt = {
|
|
904
1193
|
"x-mac-croatian": (
|
|
905
1194
|
// Python: 'mac_croatian'
|
|
906
1195
|
"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"
|
|
@@ -942,8 +1231,8 @@ var Nt = {
|
|
|
942
1231
|
"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"
|
|
943
1232
|
)
|
|
944
1233
|
};
|
|
945
|
-
|
|
946
|
-
var a =
|
|
1234
|
+
Pe.MACSTRING = function(t, e, r, n) {
|
|
1235
|
+
var a = Vt[n];
|
|
947
1236
|
if (a !== void 0) {
|
|
948
1237
|
for (var s = "", i = 0; i < r; i++) {
|
|
949
1238
|
var u = t.getUint8(e + i);
|
|
@@ -952,10 +1241,10 @@ Be.MACSTRING = function(t, e, r, n) {
|
|
|
952
1241
|
return s;
|
|
953
1242
|
}
|
|
954
1243
|
};
|
|
955
|
-
var tt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), rt,
|
|
1244
|
+
var tt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), rt, Xa = function(t) {
|
|
956
1245
|
if (!rt) {
|
|
957
1246
|
rt = {};
|
|
958
|
-
for (var e in
|
|
1247
|
+
for (var e in Vt)
|
|
959
1248
|
rt[e] = new String(e);
|
|
960
1249
|
}
|
|
961
1250
|
var r = rt[t];
|
|
@@ -965,7 +1254,7 @@ var tt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), rt, Ma =
|
|
|
965
1254
|
if (n !== void 0)
|
|
966
1255
|
return n;
|
|
967
1256
|
}
|
|
968
|
-
var a =
|
|
1257
|
+
var a = Vt[t];
|
|
969
1258
|
if (a !== void 0) {
|
|
970
1259
|
for (var s = {}, i = 0; i < a.length; i++)
|
|
971
1260
|
s[a.charCodeAt(i)] = i + 128;
|
|
@@ -974,7 +1263,7 @@ var tt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), rt, Ma =
|
|
|
974
1263
|
}
|
|
975
1264
|
};
|
|
976
1265
|
b.MACSTRING = function(t, e) {
|
|
977
|
-
var r =
|
|
1266
|
+
var r = Xa(e);
|
|
978
1267
|
if (r !== void 0) {
|
|
979
1268
|
for (var n = [], a = 0; a < t.length; a++) {
|
|
980
1269
|
var s = t.charCodeAt(a);
|
|
@@ -989,18 +1278,18 @@ U.MACSTRING = function(t, e) {
|
|
|
989
1278
|
var r = b.MACSTRING(t, e);
|
|
990
1279
|
return r !== void 0 ? r.length : 0;
|
|
991
1280
|
};
|
|
992
|
-
function
|
|
1281
|
+
function qt(t) {
|
|
993
1282
|
return t >= -128 && t <= 127;
|
|
994
1283
|
}
|
|
995
|
-
function
|
|
1284
|
+
function Ya(t, e, r) {
|
|
996
1285
|
for (var n = 0, a = t.length; e < a && n < 64 && t[e] === 0; )
|
|
997
1286
|
++e, ++n;
|
|
998
1287
|
return r.push(128 | n - 1), e;
|
|
999
1288
|
}
|
|
1000
|
-
function
|
|
1289
|
+
function Za(t, e, r) {
|
|
1001
1290
|
for (var n = 0, a = t.length, s = e; s < a && n < 64; ) {
|
|
1002
1291
|
var i = t[s];
|
|
1003
|
-
if (!
|
|
1292
|
+
if (!qt(i) || i === 0 && s + 1 < a && t[s + 1] === 0)
|
|
1004
1293
|
break;
|
|
1005
1294
|
++s, ++n;
|
|
1006
1295
|
}
|
|
@@ -1009,10 +1298,10 @@ function Pa(t, e, r) {
|
|
|
1009
1298
|
r.push(t[u] + 256 & 255);
|
|
1010
1299
|
return s;
|
|
1011
1300
|
}
|
|
1012
|
-
function
|
|
1301
|
+
function ja(t, e, r) {
|
|
1013
1302
|
for (var n = 0, a = t.length, s = e; s < a && n < 64; ) {
|
|
1014
1303
|
var i = t[s];
|
|
1015
|
-
if (i === 0 ||
|
|
1304
|
+
if (i === 0 || qt(i) && s + 1 < a && qt(t[s + 1]))
|
|
1016
1305
|
break;
|
|
1017
1306
|
++s, ++n;
|
|
1018
1307
|
}
|
|
@@ -1026,7 +1315,7 @@ function Ia(t, e, r) {
|
|
|
1026
1315
|
b.VARDELTAS = function(t) {
|
|
1027
1316
|
for (var e = 0, r = []; e < t.length; ) {
|
|
1028
1317
|
var n = t[e];
|
|
1029
|
-
n === 0 ? e =
|
|
1318
|
+
n === 0 ? e = Ya(t, e, r) : n >= -128 && n <= 127 ? e = Za(t, e, r) : e = ja(t, e, r);
|
|
1030
1319
|
}
|
|
1031
1320
|
return r;
|
|
1032
1321
|
};
|
|
@@ -1165,7 +1454,7 @@ function Ve(t, e, r) {
|
|
|
1165
1454
|
n[a + 1] = { name: t + a, type: "USHORT", value: e[a] };
|
|
1166
1455
|
return n;
|
|
1167
1456
|
}
|
|
1168
|
-
function
|
|
1457
|
+
function Xt(t, e, r) {
|
|
1169
1458
|
var n = e.length, a = new Array(n + 1);
|
|
1170
1459
|
a[0] = { name: t + "Count", type: "USHORT", value: n };
|
|
1171
1460
|
for (var s = 0; s < n; s++)
|
|
@@ -1245,12 +1534,12 @@ function ct(t) {
|
|
|
1245
1534
|
ct.prototype = Object.create(W.prototype);
|
|
1246
1535
|
ct.prototype.constructor = ct;
|
|
1247
1536
|
function ht(t, e) {
|
|
1248
|
-
W.call(this, "lookupListTable",
|
|
1537
|
+
W.call(this, "lookupListTable", Xt("lookup", t, function(r) {
|
|
1249
1538
|
var n = e[r.lookupType];
|
|
1250
1539
|
return E.assert(!!n, "Unable to write GSUB lookup type " + r.lookupType + " tables."), new W("lookupTable", [
|
|
1251
1540
|
{ name: "lookupType", type: "USHORT", value: r.lookupType },
|
|
1252
1541
|
{ name: "lookupFlag", type: "USHORT", value: r.lookupFlag }
|
|
1253
|
-
].concat(
|
|
1542
|
+
].concat(Xt("subtable", r.subtables, n)));
|
|
1254
1543
|
}));
|
|
1255
1544
|
}
|
|
1256
1545
|
ht.prototype = Object.create(W.prototype);
|
|
@@ -1263,46 +1552,46 @@ var k = {
|
|
|
1263
1552
|
FeatureList: ct,
|
|
1264
1553
|
LookupList: ht,
|
|
1265
1554
|
ushortList: Ve,
|
|
1266
|
-
tableList:
|
|
1555
|
+
tableList: Xt,
|
|
1267
1556
|
recordList: qe
|
|
1268
1557
|
};
|
|
1269
|
-
function
|
|
1558
|
+
function Cr(t, e) {
|
|
1270
1559
|
return t.getUint8(e);
|
|
1271
1560
|
}
|
|
1272
1561
|
function ft(t, e) {
|
|
1273
1562
|
return t.getUint16(e, !1);
|
|
1274
1563
|
}
|
|
1275
|
-
function
|
|
1564
|
+
function Ka(t, e) {
|
|
1276
1565
|
return t.getInt16(e, !1);
|
|
1277
1566
|
}
|
|
1278
1567
|
function tr(t, e) {
|
|
1279
1568
|
return t.getUint32(e, !1);
|
|
1280
1569
|
}
|
|
1281
|
-
function
|
|
1570
|
+
function En(t, e) {
|
|
1282
1571
|
var r = t.getInt16(e, !1), n = t.getUint16(e + 2, !1);
|
|
1283
1572
|
return r + n / 65535;
|
|
1284
1573
|
}
|
|
1285
|
-
function
|
|
1574
|
+
function Qa(t, e) {
|
|
1286
1575
|
for (var r = "", n = e; n < e + 4; n += 1)
|
|
1287
1576
|
r += String.fromCharCode(t.getInt8(n));
|
|
1288
1577
|
return r;
|
|
1289
1578
|
}
|
|
1290
|
-
function
|
|
1579
|
+
function Ja(t, e, r) {
|
|
1291
1580
|
for (var n = 0, a = 0; a < r; a += 1)
|
|
1292
1581
|
n <<= 8, n += t.getUint8(e + a);
|
|
1293
1582
|
return n;
|
|
1294
1583
|
}
|
|
1295
|
-
function
|
|
1584
|
+
function $a(t, e, r) {
|
|
1296
1585
|
for (var n = [], a = e; a < r; a += 1)
|
|
1297
1586
|
n.push(t.getUint8(a));
|
|
1298
1587
|
return n;
|
|
1299
1588
|
}
|
|
1300
|
-
function
|
|
1589
|
+
function es(t) {
|
|
1301
1590
|
for (var e = "", r = 0; r < t.length; r += 1)
|
|
1302
1591
|
e += String.fromCharCode(t[r]);
|
|
1303
1592
|
return e;
|
|
1304
1593
|
}
|
|
1305
|
-
var
|
|
1594
|
+
var ts = {
|
|
1306
1595
|
byte: 1,
|
|
1307
1596
|
uShort: 2,
|
|
1308
1597
|
short: 2,
|
|
@@ -1344,7 +1633,7 @@ d.prototype.parseULong = function() {
|
|
|
1344
1633
|
};
|
|
1345
1634
|
d.prototype.parseOffset32 = d.prototype.parseULong;
|
|
1346
1635
|
d.prototype.parseFixed = function() {
|
|
1347
|
-
var t =
|
|
1636
|
+
var t = En(this.data, this.offset + this.relativeOffset);
|
|
1348
1637
|
return this.relativeOffset += 4, t;
|
|
1349
1638
|
};
|
|
1350
1639
|
d.prototype.parseString = function(t) {
|
|
@@ -1366,7 +1655,7 @@ d.prototype.parseVersion = function(t) {
|
|
|
1366
1655
|
return this.relativeOffset += 4, t === void 0 && (t = 4096), e + r / t / 10;
|
|
1367
1656
|
};
|
|
1368
1657
|
d.prototype.skip = function(t, e) {
|
|
1369
|
-
e === void 0 && (e = 1), this.relativeOffset +=
|
|
1658
|
+
e === void 0 && (e = 1), this.relativeOffset += ts[t] * e;
|
|
1370
1659
|
};
|
|
1371
1660
|
d.prototype.parseULongList = function(t) {
|
|
1372
1661
|
t === void 0 && (t = this.parseULong());
|
|
@@ -1549,7 +1838,7 @@ d.uLongList = d.prototype.parseULongList;
|
|
|
1549
1838
|
d.struct = d.prototype.parseStruct;
|
|
1550
1839
|
d.coverage = d.prototype.parseCoverage;
|
|
1551
1840
|
d.classDef = d.prototype.parseClassDef;
|
|
1552
|
-
var
|
|
1841
|
+
var Er = {
|
|
1553
1842
|
reserved: d.uShort,
|
|
1554
1843
|
reqFeatureIndex: d.uShort,
|
|
1555
1844
|
featureIndexes: d.uShortList
|
|
@@ -1558,10 +1847,10 @@ d.prototype.parseScriptList = function() {
|
|
|
1558
1847
|
return this.parsePointer(d.recordList({
|
|
1559
1848
|
tag: d.tag,
|
|
1560
1849
|
script: d.pointer({
|
|
1561
|
-
defaultLangSys: d.pointer(
|
|
1850
|
+
defaultLangSys: d.pointer(Er),
|
|
1562
1851
|
langSysRecords: d.recordList({
|
|
1563
1852
|
tag: d.tag,
|
|
1564
|
-
langSys: d.pointer(
|
|
1853
|
+
langSys: d.pointer(Er)
|
|
1565
1854
|
})
|
|
1566
1855
|
})
|
|
1567
1856
|
})) || [];
|
|
@@ -1600,20 +1889,20 @@ d.prototype.parseFeatureVariationsList = function() {
|
|
|
1600
1889
|
}) || [];
|
|
1601
1890
|
};
|
|
1602
1891
|
var F = {
|
|
1603
|
-
getByte:
|
|
1604
|
-
getCard8:
|
|
1892
|
+
getByte: Cr,
|
|
1893
|
+
getCard8: Cr,
|
|
1605
1894
|
getUShort: ft,
|
|
1606
1895
|
getCard16: ft,
|
|
1607
|
-
getShort:
|
|
1896
|
+
getShort: Ka,
|
|
1608
1897
|
getULong: tr,
|
|
1609
|
-
getFixed:
|
|
1610
|
-
getTag:
|
|
1611
|
-
getOffset:
|
|
1612
|
-
getBytes:
|
|
1613
|
-
bytesToString:
|
|
1898
|
+
getFixed: En,
|
|
1899
|
+
getTag: Qa,
|
|
1900
|
+
getOffset: Ja,
|
|
1901
|
+
getBytes: $a,
|
|
1902
|
+
bytesToString: es,
|
|
1614
1903
|
Parser: d
|
|
1615
1904
|
};
|
|
1616
|
-
function
|
|
1905
|
+
function rs(t, e) {
|
|
1617
1906
|
e.parseUShort(), t.length = e.parseULong(), t.language = e.parseULong();
|
|
1618
1907
|
var r;
|
|
1619
1908
|
t.groupCount = r = e.parseULong(), t.glyphIndexMap = {};
|
|
@@ -1621,7 +1910,7 @@ function Va(t, e) {
|
|
|
1621
1910
|
for (var a = e.parseULong(), s = e.parseULong(), i = e.parseULong(), u = a; u <= s; u += 1)
|
|
1622
1911
|
t.glyphIndexMap[u] = i, i++;
|
|
1623
1912
|
}
|
|
1624
|
-
function
|
|
1913
|
+
function ns(t, e, r, n, a) {
|
|
1625
1914
|
t.length = e.parseUShort(), t.language = e.parseUShort();
|
|
1626
1915
|
var s;
|
|
1627
1916
|
t.segCount = s = e.parseUShort() >> 1, e.skip("uShort", 3), t.glyphIndexMap = {};
|
|
@@ -1629,7 +1918,7 @@ function qa(t, e, r, n, a) {
|
|
|
1629
1918
|
for (var h = void 0, f = i.parseUShort(), v = u.parseUShort(), g = o.parseShort(), y = l.parseUShort(), m = v; m <= f; m += 1)
|
|
1630
1919
|
y !== 0 ? (c = l.offset + l.relativeOffset - 2, c += y, c += (m - v) * 2, h = F.getUShort(r, c), h !== 0 && (h = h + g & 65535)) : h = m + g & 65535, t.glyphIndexMap[m] = h;
|
|
1631
1920
|
}
|
|
1632
|
-
function
|
|
1921
|
+
function as(t, e) {
|
|
1633
1922
|
var r = {};
|
|
1634
1923
|
r.version = F.getUShort(t, e), E.argument(r.version === 0, "cmap table version should be 0."), r.numTables = F.getUShort(t, e + 2);
|
|
1635
1924
|
for (var n = -1, a = r.numTables - 1; a >= 0; a -= 1) {
|
|
@@ -1643,14 +1932,14 @@ function Xa(t, e) {
|
|
|
1643
1932
|
throw new Error("No valid cmap sub-tables found.");
|
|
1644
1933
|
var u = new F.Parser(t, e + n);
|
|
1645
1934
|
if (r.format = u.parseUShort(), r.format === 12)
|
|
1646
|
-
|
|
1935
|
+
rs(r, u);
|
|
1647
1936
|
else if (r.format === 4)
|
|
1648
|
-
|
|
1937
|
+
ns(r, u, t, e, n);
|
|
1649
1938
|
else
|
|
1650
1939
|
throw new Error("Only format 4 and 12 cmap tables are supported (found format " + r.format + ").");
|
|
1651
1940
|
return r;
|
|
1652
1941
|
}
|
|
1653
|
-
function
|
|
1942
|
+
function ss(t, e, r) {
|
|
1654
1943
|
t.segments.push({
|
|
1655
1944
|
end: e,
|
|
1656
1945
|
start: e,
|
|
@@ -1659,7 +1948,7 @@ function Ya(t, e, r) {
|
|
|
1659
1948
|
glyphIndex: r
|
|
1660
1949
|
});
|
|
1661
1950
|
}
|
|
1662
|
-
function
|
|
1951
|
+
function is(t) {
|
|
1663
1952
|
t.segments.push({
|
|
1664
1953
|
end: 65535,
|
|
1665
1954
|
start: 65535,
|
|
@@ -1667,7 +1956,7 @@ function Za(t) {
|
|
|
1667
1956
|
offset: 0
|
|
1668
1957
|
});
|
|
1669
1958
|
}
|
|
1670
|
-
function
|
|
1959
|
+
function os(t) {
|
|
1671
1960
|
var e = !0, r;
|
|
1672
1961
|
for (r = t.length - 1; r > 0; r -= 1) {
|
|
1673
1962
|
var n = t.get(r);
|
|
@@ -1703,12 +1992,12 @@ function Ka(t) {
|
|
|
1703
1992
|
var s = new k.Table("cmap", a);
|
|
1704
1993
|
for (s.segments = [], r = 0; r < t.length; r += 1) {
|
|
1705
1994
|
for (var i = t.get(r), u = 0; u < i.unicodes.length; u += 1)
|
|
1706
|
-
|
|
1995
|
+
ss(s, i.unicodes[u], r);
|
|
1707
1996
|
s.segments = s.segments.sort(function(S, x) {
|
|
1708
1997
|
return S.start - x.start;
|
|
1709
1998
|
});
|
|
1710
1999
|
}
|
|
1711
|
-
|
|
2000
|
+
is(s);
|
|
1712
2001
|
var o = s.segments.length, l = 0, c = [], p = [], h = [], f = [], v = [], g = [];
|
|
1713
2002
|
for (r = 0; r < o; r += 1) {
|
|
1714
2003
|
var y = s.segments[r];
|
|
@@ -1729,7 +2018,7 @@ function Ka(t) {
|
|
|
1729
2018
|
}
|
|
1730
2019
|
return s;
|
|
1731
2020
|
}
|
|
1732
|
-
var
|
|
2021
|
+
var On = { parse: as, make: os }, it = [
|
|
1733
2022
|
".notdef",
|
|
1734
2023
|
"space",
|
|
1735
2024
|
"exclam",
|
|
@@ -2121,7 +2410,7 @@ var Cn = { parse: Xa, make: Ka }, it = [
|
|
|
2121
2410
|
"Regular",
|
|
2122
2411
|
"Roman",
|
|
2123
2412
|
"Semibold"
|
|
2124
|
-
],
|
|
2413
|
+
], us = [
|
|
2125
2414
|
"",
|
|
2126
2415
|
"",
|
|
2127
2416
|
"",
|
|
@@ -2374,7 +2663,7 @@ var Cn = { parse: Xa, make: Ka }, it = [
|
|
|
2374
2663
|
"oslash",
|
|
2375
2664
|
"oe",
|
|
2376
2665
|
"germandbls"
|
|
2377
|
-
],
|
|
2666
|
+
], ls = [
|
|
2378
2667
|
"",
|
|
2379
2668
|
"",
|
|
2380
2669
|
"",
|
|
@@ -2890,10 +3179,10 @@ var Cn = { parse: Xa, make: Ka }, it = [
|
|
|
2890
3179
|
"ccaron",
|
|
2891
3180
|
"dcroat"
|
|
2892
3181
|
];
|
|
2893
|
-
function
|
|
3182
|
+
function Un(t) {
|
|
2894
3183
|
this.font = t;
|
|
2895
3184
|
}
|
|
2896
|
-
|
|
3185
|
+
Un.prototype.charToGlyphIndex = function(t) {
|
|
2897
3186
|
var e = t.codePointAt(0), r = this.font.glyphs;
|
|
2898
3187
|
if (r) {
|
|
2899
3188
|
for (var n = 0; n < r.length; n += 1)
|
|
@@ -2903,10 +3192,10 @@ En.prototype.charToGlyphIndex = function(t) {
|
|
|
2903
3192
|
}
|
|
2904
3193
|
return null;
|
|
2905
3194
|
};
|
|
2906
|
-
function
|
|
3195
|
+
function Ln(t) {
|
|
2907
3196
|
this.cmap = t;
|
|
2908
3197
|
}
|
|
2909
|
-
|
|
3198
|
+
Ln.prototype.charToGlyphIndex = function(t) {
|
|
2910
3199
|
return this.cmap.glyphIndexMap[t.codePointAt(0)] || 0;
|
|
2911
3200
|
};
|
|
2912
3201
|
function pt(t, e) {
|
|
@@ -2945,7 +3234,7 @@ rr.prototype.nameToGlyphIndex = function(t) {
|
|
|
2945
3234
|
rr.prototype.glyphIndexToName = function(t) {
|
|
2946
3235
|
return this.names[t];
|
|
2947
3236
|
};
|
|
2948
|
-
function
|
|
3237
|
+
function cs(t) {
|
|
2949
3238
|
for (var e, r = t.tables.cmap.glyphIndexMap, n = Object.keys(r), a = 0; a < n.length; a += 1) {
|
|
2950
3239
|
var s = n[a], i = r[s];
|
|
2951
3240
|
e = t.glyphs.get(i), e.addUnicode(parseInt(s));
|
|
@@ -2953,7 +3242,7 @@ function Ja(t) {
|
|
|
2953
3242
|
for (var u = 0; u < t.glyphs.length; u += 1)
|
|
2954
3243
|
e = t.glyphs.get(u), t.cffEncoding ? t.isCIDFont ? e.name = "gid" + u : e.name = t.cffEncoding.charset[u] : t.glyphNames.names && (e.name = t.glyphNames.glyphIndexToName(u));
|
|
2955
3244
|
}
|
|
2956
|
-
function
|
|
3245
|
+
function hs(t) {
|
|
2957
3246
|
t._IndexToUnicodeMap = {};
|
|
2958
3247
|
for (var e = t.tables.cmap.glyphIndexMap, r = Object.keys(e), n = 0; n < r.length; n += 1) {
|
|
2959
3248
|
var a = r[n], s = e[a];
|
|
@@ -2962,14 +3251,14 @@ function $a(t) {
|
|
|
2962
3251
|
} : t._IndexToUnicodeMap[s].unicodes.push(parseInt(a));
|
|
2963
3252
|
}
|
|
2964
3253
|
}
|
|
2965
|
-
function
|
|
2966
|
-
e.lowMemory ?
|
|
3254
|
+
function fs(t, e) {
|
|
3255
|
+
e.lowMemory ? hs(t) : cs(t);
|
|
2967
3256
|
}
|
|
2968
|
-
function
|
|
3257
|
+
function ps(t, e, r, n, a) {
|
|
2969
3258
|
t.beginPath(), t.moveTo(e, r), t.lineTo(n, a), t.stroke();
|
|
2970
3259
|
}
|
|
2971
|
-
var we = { line:
|
|
2972
|
-
function
|
|
3260
|
+
var we = { line: ps };
|
|
3261
|
+
function ds(t, e) {
|
|
2973
3262
|
var r = e || new _();
|
|
2974
3263
|
return {
|
|
2975
3264
|
configurable: !0,
|
|
@@ -2985,7 +3274,7 @@ function ae(t) {
|
|
|
2985
3274
|
this.bindConstructorValues(t);
|
|
2986
3275
|
}
|
|
2987
3276
|
ae.prototype.bindConstructorValues = function(t) {
|
|
2988
|
-
this.index = t.index || 0, this.name = t.name || null, this.unicode = t.unicode || void 0, this.unicodes = t.unicodes || t.unicode !== void 0 ? [t.unicode] : [], "xMin" in t && (this.xMin = t.xMin), "yMin" in t && (this.yMin = t.yMin), "xMax" in t && (this.xMax = t.xMax), "yMax" in t && (this.yMax = t.yMax), "advanceWidth" in t && (this.advanceWidth = t.advanceWidth), Object.defineProperty(this, "path",
|
|
3277
|
+
this.index = t.index || 0, this.name = t.name || null, this.unicode = t.unicode || void 0, this.unicodes = t.unicodes || t.unicode !== void 0 ? [t.unicode] : [], "xMin" in t && (this.xMin = t.xMin), "yMin" in t && (this.yMin = t.yMin), "xMax" in t && (this.xMax = t.xMax), "yMax" in t && (this.yMax = t.yMax), "advanceWidth" in t && (this.advanceWidth = t.advanceWidth), Object.defineProperty(this, "path", ds(this, t.path));
|
|
2989
3278
|
};
|
|
2990
3279
|
ae.prototype.addUnicode = function(t) {
|
|
2991
3280
|
this.unicodes.length === 0 && (this.unicode = t), this.unicodes.push(t);
|
|
@@ -3104,10 +3393,10 @@ nr.prototype.get = function(t) {
|
|
|
3104
3393
|
nr.prototype.push = function(t, e) {
|
|
3105
3394
|
this.glyphs[t] = e, this.length++;
|
|
3106
3395
|
};
|
|
3107
|
-
function
|
|
3396
|
+
function vs(t, e) {
|
|
3108
3397
|
return new ae({ index: e, font: t });
|
|
3109
3398
|
}
|
|
3110
|
-
function
|
|
3399
|
+
function gs(t, e, r, n, a, s) {
|
|
3111
3400
|
return function() {
|
|
3112
3401
|
var i = new ae({ index: e, font: t });
|
|
3113
3402
|
return i.path = function() {
|
|
@@ -3117,7 +3406,7 @@ function as(t, e, r, n, a, s) {
|
|
|
3117
3406
|
}, at(i, "xMin", "_xMin"), at(i, "xMax", "_xMax"), at(i, "yMin", "_yMin"), at(i, "yMax", "_yMax"), i;
|
|
3118
3407
|
};
|
|
3119
3408
|
}
|
|
3120
|
-
function
|
|
3409
|
+
function ys(t, e, r, n) {
|
|
3121
3410
|
return function() {
|
|
3122
3411
|
var a = new ae({ index: e, font: t });
|
|
3123
3412
|
return a.path = function() {
|
|
@@ -3126,21 +3415,21 @@ function ss(t, e, r, n) {
|
|
|
3126
3415
|
}, a;
|
|
3127
3416
|
};
|
|
3128
3417
|
}
|
|
3129
|
-
var de = { GlyphSet: nr, glyphLoader:
|
|
3130
|
-
function
|
|
3418
|
+
var de = { GlyphSet: nr, glyphLoader: vs, ttfGlyphLoader: gs, cffGlyphLoader: ys };
|
|
3419
|
+
function Rn(t, e) {
|
|
3131
3420
|
if (t === e)
|
|
3132
3421
|
return !0;
|
|
3133
3422
|
if (Array.isArray(t) && Array.isArray(e)) {
|
|
3134
3423
|
if (t.length !== e.length)
|
|
3135
3424
|
return !1;
|
|
3136
3425
|
for (var r = 0; r < t.length; r += 1)
|
|
3137
|
-
if (!
|
|
3426
|
+
if (!Rn(t[r], e[r]))
|
|
3138
3427
|
return !1;
|
|
3139
3428
|
return !0;
|
|
3140
3429
|
} else
|
|
3141
3430
|
return !1;
|
|
3142
3431
|
}
|
|
3143
|
-
function
|
|
3432
|
+
function Yt(t) {
|
|
3144
3433
|
var e;
|
|
3145
3434
|
return t.length < 1240 ? e = 107 : t.length < 33900 ? e = 1131 : e = 32768, e;
|
|
3146
3435
|
}
|
|
@@ -3160,7 +3449,7 @@ function xe(t, e, r) {
|
|
|
3160
3449
|
}
|
|
3161
3450
|
return { objects: a, startOffset: e, endOffset: u };
|
|
3162
3451
|
}
|
|
3163
|
-
function
|
|
3452
|
+
function ms(t, e) {
|
|
3164
3453
|
var r = [], n = F.getCard16(t, e), a, s;
|
|
3165
3454
|
if (n !== 0) {
|
|
3166
3455
|
var i = F.getByte(t, e + 2);
|
|
@@ -3172,7 +3461,7 @@ function is(t, e) {
|
|
|
3172
3461
|
s = e + 2;
|
|
3173
3462
|
return { offsets: r, startOffset: e, endOffset: s };
|
|
3174
3463
|
}
|
|
3175
|
-
function
|
|
3464
|
+
function xs(t, e, r, n, a) {
|
|
3176
3465
|
var s = F.getCard16(r, n), i = 0;
|
|
3177
3466
|
if (s !== 0) {
|
|
3178
3467
|
var u = F.getByte(r, n + 2);
|
|
@@ -3181,7 +3470,7 @@ function os(t, e, r, n, a) {
|
|
|
3181
3470
|
var o = F.getBytes(r, i + e[t], i + e[t + 1]);
|
|
3182
3471
|
return o;
|
|
3183
3472
|
}
|
|
3184
|
-
function
|
|
3473
|
+
function bs(t) {
|
|
3185
3474
|
for (var e = "", r = 15, n = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"]; ; ) {
|
|
3186
3475
|
var a = t.parseByte(), s = a >> 4, i = a & 15;
|
|
3187
3476
|
if (s === r || (e += n[s], i === r))
|
|
@@ -3190,14 +3479,14 @@ function us(t) {
|
|
|
3190
3479
|
}
|
|
3191
3480
|
return parseFloat(e);
|
|
3192
3481
|
}
|
|
3193
|
-
function
|
|
3482
|
+
function Ss(t, e) {
|
|
3194
3483
|
var r, n, a, s;
|
|
3195
3484
|
if (e === 28)
|
|
3196
3485
|
return r = t.parseByte(), n = t.parseByte(), r << 8 | n;
|
|
3197
3486
|
if (e === 29)
|
|
3198
3487
|
return r = t.parseByte(), n = t.parseByte(), a = t.parseByte(), s = t.parseByte(), r << 24 | n << 16 | a << 8 | s;
|
|
3199
3488
|
if (e === 30)
|
|
3200
|
-
return
|
|
3489
|
+
return bs(t);
|
|
3201
3490
|
if (e >= 32 && e <= 246)
|
|
3202
3491
|
return e - 139;
|
|
3203
3492
|
if (e >= 247 && e <= 250)
|
|
@@ -3206,7 +3495,7 @@ function ls(t, e) {
|
|
|
3206
3495
|
return r = t.parseByte(), -(e - 251) * 256 - r - 108;
|
|
3207
3496
|
throw new Error("Invalid b0 " + e);
|
|
3208
3497
|
}
|
|
3209
|
-
function
|
|
3498
|
+
function ks(t) {
|
|
3210
3499
|
for (var e = {}, r = 0; r < t.length; r += 1) {
|
|
3211
3500
|
var n = t[r][0], a = t[r][1], s = void 0;
|
|
3212
3501
|
if (a.length === 1 ? s = a[0] : s = a, e.hasOwnProperty(n) && !isNaN(e[n]))
|
|
@@ -3215,37 +3504,37 @@ function cs(t) {
|
|
|
3215
3504
|
}
|
|
3216
3505
|
return e;
|
|
3217
3506
|
}
|
|
3218
|
-
function
|
|
3507
|
+
function An(t, e, r) {
|
|
3219
3508
|
e = e !== void 0 ? e : 0;
|
|
3220
3509
|
var n = new F.Parser(t, e), a = [], s = [];
|
|
3221
3510
|
for (r = r !== void 0 ? r : t.length; n.relativeOffset < r; ) {
|
|
3222
3511
|
var i = n.parseByte();
|
|
3223
|
-
i <= 21 ? (i === 12 && (i = 1200 + n.parseByte()), a.push([i, s]), s = []) : s.push(
|
|
3512
|
+
i <= 21 ? (i === 12 && (i = 1200 + n.parseByte()), a.push([i, s]), s = []) : s.push(Ss(n, i));
|
|
3224
3513
|
}
|
|
3225
|
-
return
|
|
3514
|
+
return ks(a);
|
|
3226
3515
|
}
|
|
3227
|
-
function
|
|
3516
|
+
function ze(t, e) {
|
|
3228
3517
|
return e <= 390 ? e = it[e] : e = t[e - 391], e;
|
|
3229
3518
|
}
|
|
3230
|
-
function
|
|
3519
|
+
function Dn(t, e, r) {
|
|
3231
3520
|
for (var n = {}, a, s = 0; s < e.length; s += 1) {
|
|
3232
3521
|
var i = e[s];
|
|
3233
3522
|
if (Array.isArray(i.type)) {
|
|
3234
3523
|
var u = [];
|
|
3235
3524
|
u.length = i.type.length;
|
|
3236
3525
|
for (var o = 0; o < i.type.length; o++)
|
|
3237
|
-
a = t[i.op] !== void 0 ? t[i.op][o] : void 0, a === void 0 && (a = i.value !== void 0 && i.value[o] !== void 0 ? i.value[o] : null), i.type[o] === "SID" && (a =
|
|
3526
|
+
a = t[i.op] !== void 0 ? t[i.op][o] : void 0, a === void 0 && (a = i.value !== void 0 && i.value[o] !== void 0 ? i.value[o] : null), i.type[o] === "SID" && (a = ze(r, a)), u[o] = a;
|
|
3238
3527
|
n[i.name] = u;
|
|
3239
3528
|
} else
|
|
3240
|
-
a = t[i.op], a === void 0 && (a = i.value !== void 0 ? i.value : null), i.type === "SID" && (a =
|
|
3529
|
+
a = t[i.op], a === void 0 && (a = i.value !== void 0 ? i.value : null), i.type === "SID" && (a = ze(r, a)), n[i.name] = a;
|
|
3241
3530
|
}
|
|
3242
3531
|
return n;
|
|
3243
3532
|
}
|
|
3244
|
-
function
|
|
3533
|
+
function Ts(t, e) {
|
|
3245
3534
|
var r = {};
|
|
3246
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;
|
|
3247
3536
|
}
|
|
3248
|
-
var
|
|
3537
|
+
var Mn = [
|
|
3249
3538
|
{ name: "version", op: 0, type: "SID" },
|
|
3250
3539
|
{ name: "notice", op: 1, type: "SID" },
|
|
3251
3540
|
{ name: "copyright", op: 1200, type: "SID" },
|
|
@@ -3281,29 +3570,29 @@ var An = [
|
|
|
3281
3570
|
{ name: "fdArray", op: 1236, type: "offset" },
|
|
3282
3571
|
{ name: "fdSelect", op: 1237, type: "offset" },
|
|
3283
3572
|
{ name: "fontName", op: 1238, type: "SID" }
|
|
3284
|
-
],
|
|
3573
|
+
], Bn = [
|
|
3285
3574
|
{ name: "subrs", op: 19, type: "offset", value: 0 },
|
|
3286
3575
|
{ name: "defaultWidthX", op: 20, type: "number", value: 0 },
|
|
3287
3576
|
{ name: "nominalWidthX", op: 21, type: "number", value: 0 }
|
|
3288
3577
|
];
|
|
3289
|
-
function
|
|
3290
|
-
var r =
|
|
3291
|
-
return
|
|
3578
|
+
function Fs(t, e) {
|
|
3579
|
+
var r = An(t, 0, t.byteLength);
|
|
3580
|
+
return Dn(r, Mn, e);
|
|
3292
3581
|
}
|
|
3293
|
-
function
|
|
3294
|
-
var a =
|
|
3295
|
-
return
|
|
3582
|
+
function Pn(t, e, r, n) {
|
|
3583
|
+
var a = An(t, e, r);
|
|
3584
|
+
return Dn(a, Bn, n);
|
|
3296
3585
|
}
|
|
3297
|
-
function
|
|
3586
|
+
function Or(t, e, r, n) {
|
|
3298
3587
|
for (var a = [], s = 0; s < r.length; s += 1) {
|
|
3299
|
-
var i = new DataView(new Uint8Array(r[s]).buffer), u =
|
|
3588
|
+
var i = new DataView(new Uint8Array(r[s]).buffer), u = Fs(i, n);
|
|
3300
3589
|
u._subrs = [], u._subrsBias = 0, u._defaultWidthX = 0, u._nominalWidthX = 0;
|
|
3301
3590
|
var o = u.private[0], l = u.private[1];
|
|
3302
3591
|
if (o !== 0 && l !== 0) {
|
|
3303
|
-
var c =
|
|
3592
|
+
var c = Pn(t, l + e, o, n);
|
|
3304
3593
|
if (u._defaultWidthX = c.defaultWidthX, u._nominalWidthX = c.nominalWidthX, c.subrs !== 0) {
|
|
3305
3594
|
var p = l + c.subrs, h = xe(t, p + e);
|
|
3306
|
-
u._subrs = h.objects, u._subrsBias =
|
|
3595
|
+
u._subrs = h.objects, u._subrsBias = Yt(u._subrs);
|
|
3307
3596
|
}
|
|
3308
3597
|
u._privateDict = c;
|
|
3309
3598
|
}
|
|
@@ -3311,30 +3600,30 @@ function Tr(t, e, r, n) {
|
|
|
3311
3600
|
}
|
|
3312
3601
|
return a;
|
|
3313
3602
|
}
|
|
3314
|
-
function
|
|
3603
|
+
function ws(t, e, r, n) {
|
|
3315
3604
|
var a, s, i = new F.Parser(t, e);
|
|
3316
3605
|
r -= 1;
|
|
3317
3606
|
var u = [".notdef"], o = i.parseCard8();
|
|
3318
3607
|
if (o === 0)
|
|
3319
3608
|
for (var l = 0; l < r; l += 1)
|
|
3320
|
-
a = i.parseSID(), u.push(
|
|
3609
|
+
a = i.parseSID(), u.push(ze(n, a));
|
|
3321
3610
|
else if (o === 1)
|
|
3322
3611
|
for (; u.length <= r; ) {
|
|
3323
3612
|
a = i.parseSID(), s = i.parseCard8();
|
|
3324
3613
|
for (var c = 0; c <= s; c += 1)
|
|
3325
|
-
u.push(
|
|
3614
|
+
u.push(ze(n, a)), a += 1;
|
|
3326
3615
|
}
|
|
3327
3616
|
else if (o === 2)
|
|
3328
3617
|
for (; u.length <= r; ) {
|
|
3329
3618
|
a = i.parseSID(), s = i.parseCard16();
|
|
3330
3619
|
for (var p = 0; p <= s; p += 1)
|
|
3331
|
-
u.push(
|
|
3620
|
+
u.push(ze(n, a)), a += 1;
|
|
3332
3621
|
}
|
|
3333
3622
|
else
|
|
3334
3623
|
throw new Error("Unknown charset format " + o);
|
|
3335
3624
|
return u;
|
|
3336
3625
|
}
|
|
3337
|
-
function
|
|
3626
|
+
function Cs(t, e, r) {
|
|
3338
3627
|
var n, a = {}, s = new F.Parser(t, e), i = s.parseCard8();
|
|
3339
3628
|
if (i === 0)
|
|
3340
3629
|
for (var u = s.parseCard8(), o = 0; o < u; o += 1)
|
|
@@ -3349,7 +3638,7 @@ function ds(t, e, r) {
|
|
|
3349
3638
|
throw new Error("Unknown encoding format " + i);
|
|
3350
3639
|
return new pt(a, r);
|
|
3351
3640
|
}
|
|
3352
|
-
function
|
|
3641
|
+
function Ur(t, e, r) {
|
|
3353
3642
|
var n, a, s, i, u = new _(), o = [], l = 0, c = !1, p = !1, h = 0, f = 0, v, g, y, m;
|
|
3354
3643
|
if (t.isCIDFont) {
|
|
3355
3644
|
var S = t.tables.cff.topDict._fdSelect[e.index], x = t.tables.cff.topDict._fdArray[S];
|
|
@@ -3365,7 +3654,7 @@ function Fr(t, e, r) {
|
|
|
3365
3654
|
C = o.length % 2 !== 0, C && !c && (O = o.shift() + m), l += o.length >> 1, o.length = 0, c = !0;
|
|
3366
3655
|
}
|
|
3367
3656
|
function L(C) {
|
|
3368
|
-
for (var N,
|
|
3657
|
+
for (var N, j, K, re, ne, G, H, V, q, X, z, Z, M = 0; M < C.length; ) {
|
|
3369
3658
|
var Y = C[M];
|
|
3370
3659
|
switch (M += 1, Y) {
|
|
3371
3660
|
case 1:
|
|
@@ -3454,7 +3743,7 @@ function Fr(t, e, r) {
|
|
|
3454
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);
|
|
3455
3744
|
break;
|
|
3456
3745
|
case 28:
|
|
3457
|
-
N = C[M],
|
|
3746
|
+
N = C[M], j = C[M + 1], o.push((N << 24 | j << 16) >> 16), M += 2;
|
|
3458
3747
|
break;
|
|
3459
3748
|
case 29:
|
|
3460
3749
|
ne = o.pop() + t.gsubrsBias, G = t.gsubrs[ne], G && L(G);
|
|
@@ -3468,13 +3757,13 @@ function Fr(t, e, r) {
|
|
|
3468
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);
|
|
3469
3758
|
break;
|
|
3470
3759
|
default:
|
|
3471
|
-
Y < 32 ? console.log("Glyph " + e.index + ": unknown operator " + Y) : Y < 247 ? o.push(Y - 139) : Y < 251 ? (N = C[M], M += 1, o.push((Y - 247) * 256 + N + 108)) : Y < 255 ? (N = C[M], M += 1, o.push(-(Y - 251) * 256 - N - 108)) : (N = C[M],
|
|
3760
|
+
Y < 32 ? console.log("Glyph " + e.index + ": unknown operator " + Y) : Y < 247 ? o.push(Y - 139) : Y < 251 ? (N = C[M], M += 1, o.push((Y - 247) * 256 + N + 108)) : Y < 255 ? (N = C[M], M += 1, o.push(-(Y - 251) * 256 - N - 108)) : (N = C[M], j = C[M + 1], K = C[M + 2], re = C[M + 3], M += 4, o.push((N << 24 | j << 16 | K << 8 | re) / 65536));
|
|
3472
3761
|
}
|
|
3473
3762
|
}
|
|
3474
3763
|
}
|
|
3475
3764
|
return L(r), e.advanceWidth = O, u;
|
|
3476
3765
|
}
|
|
3477
|
-
function
|
|
3766
|
+
function Es(t, e, r, n) {
|
|
3478
3767
|
var a = [], s, i = new F.Parser(t, e), u = i.parseCard8();
|
|
3479
3768
|
if (u === 0)
|
|
3480
3769
|
for (var o = 0; o < r; o++) {
|
|
@@ -3501,11 +3790,11 @@ function vs(t, e, r, n) {
|
|
|
3501
3790
|
throw new Error("CFF Table CID Font FDSelect table has unsupported format " + u);
|
|
3502
3791
|
return a;
|
|
3503
3792
|
}
|
|
3504
|
-
function
|
|
3793
|
+
function Os(t, e, r, n) {
|
|
3505
3794
|
r.tables.cff = {};
|
|
3506
|
-
var a =
|
|
3507
|
-
r.gsubrs = o.objects, r.gsubrsBias =
|
|
3508
|
-
var l =
|
|
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
|
+
r.gsubrs = o.objects, r.gsubrsBias = Yt(r.gsubrs);
|
|
3797
|
+
var l = Or(t, e, i.objects, u.objects);
|
|
3509
3798
|
if (l.length !== 1)
|
|
3510
3799
|
throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " + l.length);
|
|
3511
3800
|
var c = l[0];
|
|
@@ -3514,34 +3803,34 @@ function gs(t, e, r, n) {
|
|
|
3514
3803
|
if (p === 0 || h === 0)
|
|
3515
3804
|
throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
|
|
3516
3805
|
p += e;
|
|
3517
|
-
var f = xe(t, p), v =
|
|
3518
|
-
c._fdArray = v, h += e, c._fdSelect =
|
|
3806
|
+
var f = xe(t, p), v = Or(t, e, f.objects, u.objects);
|
|
3807
|
+
c._fdArray = v, h += e, c._fdSelect = Es(t, h, r.numGlyphs, v.length);
|
|
3519
3808
|
}
|
|
3520
|
-
var g = e + c.private[1], y =
|
|
3809
|
+
var g = e + c.private[1], y = Pn(t, g, c.private[0], u.objects);
|
|
3521
3810
|
if (r.defaultWidthX = y.defaultWidthX, r.nominalWidthX = y.nominalWidthX, y.subrs !== 0) {
|
|
3522
3811
|
var m = g + y.subrs, S = xe(t, m);
|
|
3523
|
-
r.subrs = S.objects, r.subrsBias =
|
|
3812
|
+
r.subrs = S.objects, r.subrsBias = Yt(r.subrs);
|
|
3524
3813
|
} else
|
|
3525
3814
|
r.subrs = [], r.subrsBias = 0;
|
|
3526
3815
|
var x;
|
|
3527
|
-
n.lowMemory ? (x =
|
|
3528
|
-
var O =
|
|
3529
|
-
if (c.encoding === 0 ? r.cffEncoding = new pt(
|
|
3816
|
+
n.lowMemory ? (x = ms(t, e + c.charStrings), r.nGlyphs = x.offsets.length) : (x = xe(t, e + c.charStrings), r.nGlyphs = x.objects.length);
|
|
3817
|
+
var O = ws(t, e + c.charset, r.nGlyphs, u.objects);
|
|
3818
|
+
if (c.encoding === 0 ? r.cffEncoding = new pt(us, O) : c.encoding === 1 ? r.cffEncoding = new pt(ls, O) : r.cffEncoding = Cs(t, e + c.encoding, O), r.encoding = r.encoding || r.cffEncoding, r.glyphs = new de.GlyphSet(r), n.lowMemory)
|
|
3530
3819
|
r._push = function(L) {
|
|
3531
|
-
var C =
|
|
3532
|
-
r.glyphs.push(L, de.cffGlyphLoader(r, L,
|
|
3820
|
+
var C = xs(L, x.offsets, t, e + c.charStrings);
|
|
3821
|
+
r.glyphs.push(L, de.cffGlyphLoader(r, L, Ur, C));
|
|
3533
3822
|
};
|
|
3534
3823
|
else
|
|
3535
3824
|
for (var w = 0; w < r.nGlyphs; w += 1) {
|
|
3536
3825
|
var D = x.objects[w];
|
|
3537
|
-
r.glyphs.push(w, de.cffGlyphLoader(r, w,
|
|
3826
|
+
r.glyphs.push(w, de.cffGlyphLoader(r, w, Ur, D));
|
|
3538
3827
|
}
|
|
3539
3828
|
}
|
|
3540
|
-
function
|
|
3829
|
+
function In(t, e) {
|
|
3541
3830
|
var r, n = it.indexOf(t);
|
|
3542
3831
|
return n >= 0 && (r = n), n = e.indexOf(t), n >= 0 ? r = n + it.length : (r = it.length + e.length, e.push(t)), r;
|
|
3543
3832
|
}
|
|
3544
|
-
function
|
|
3833
|
+
function Us() {
|
|
3545
3834
|
return new k.Record("Header", [
|
|
3546
3835
|
{ name: "major", type: "Card8", value: 1 },
|
|
3547
3836
|
{ name: "minor", type: "Card8", value: 0 },
|
|
@@ -3549,7 +3838,7 @@ function ys() {
|
|
|
3549
3838
|
{ name: "major", type: "Card8", value: 1 }
|
|
3550
3839
|
]);
|
|
3551
3840
|
}
|
|
3552
|
-
function
|
|
3841
|
+
function Ls(t) {
|
|
3553
3842
|
var e = new k.Record("Name INDEX", [
|
|
3554
3843
|
{ name: "names", type: "INDEX", value: [] }
|
|
3555
3844
|
]);
|
|
@@ -3558,26 +3847,26 @@ function ms(t) {
|
|
|
3558
3847
|
e.names.push({ name: "name_" + r, type: "NAME", value: t[r] });
|
|
3559
3848
|
return e;
|
|
3560
3849
|
}
|
|
3561
|
-
function
|
|
3850
|
+
function Gn(t, e, r) {
|
|
3562
3851
|
for (var n = {}, a = 0; a < t.length; a += 1) {
|
|
3563
3852
|
var s = t[a], i = e[s.name];
|
|
3564
|
-
i !== void 0 && !
|
|
3853
|
+
i !== void 0 && !Rn(i, s.value) && (s.type === "SID" && (i = In(i, r)), n[s.op] = { name: s.name, type: s.type, value: i });
|
|
3565
3854
|
}
|
|
3566
3855
|
return n;
|
|
3567
3856
|
}
|
|
3568
|
-
function
|
|
3857
|
+
function Lr(t, e) {
|
|
3569
3858
|
var r = new k.Record("Top DICT", [
|
|
3570
3859
|
{ name: "dict", type: "DICT", value: {} }
|
|
3571
3860
|
]);
|
|
3572
|
-
return r.dict =
|
|
3861
|
+
return r.dict = Gn(Mn, t, e), r;
|
|
3573
3862
|
}
|
|
3574
|
-
function
|
|
3863
|
+
function Rr(t) {
|
|
3575
3864
|
var e = new k.Record("Top DICT INDEX", [
|
|
3576
3865
|
{ name: "topDicts", type: "INDEX", value: [] }
|
|
3577
3866
|
]);
|
|
3578
3867
|
return e.topDicts = [{ name: "topDict_0", type: "TABLE", value: t }], e;
|
|
3579
3868
|
}
|
|
3580
|
-
function
|
|
3869
|
+
function Rs(t) {
|
|
3581
3870
|
var e = new k.Record("String INDEX", [
|
|
3582
3871
|
{ name: "strings", type: "INDEX", value: [] }
|
|
3583
3872
|
]);
|
|
@@ -3586,21 +3875,21 @@ function xs(t) {
|
|
|
3586
3875
|
e.strings.push({ name: "string_" + r, type: "STRING", value: t[r] });
|
|
3587
3876
|
return e;
|
|
3588
3877
|
}
|
|
3589
|
-
function
|
|
3878
|
+
function As() {
|
|
3590
3879
|
return new k.Record("Global Subr INDEX", [
|
|
3591
3880
|
{ name: "subrs", type: "INDEX", value: [] }
|
|
3592
3881
|
]);
|
|
3593
3882
|
}
|
|
3594
|
-
function
|
|
3883
|
+
function Ds(t, e) {
|
|
3595
3884
|
for (var r = new k.Record("Charsets", [
|
|
3596
3885
|
{ name: "format", type: "Card8", value: 0 }
|
|
3597
3886
|
]), n = 0; n < t.length; n += 1) {
|
|
3598
|
-
var a = t[n], s =
|
|
3887
|
+
var a = t[n], s = In(a, e);
|
|
3599
3888
|
r.fields.push({ name: "glyph_" + n, type: "SID", value: s });
|
|
3600
3889
|
}
|
|
3601
3890
|
return r;
|
|
3602
3891
|
}
|
|
3603
|
-
function
|
|
3892
|
+
function Ms(t) {
|
|
3604
3893
|
var e = [], r = t.path;
|
|
3605
3894
|
e.push({ name: "width", type: "NUMBER", value: t.advanceWidth });
|
|
3606
3895
|
for (var n = 0, a = 0, s = 0; s < r.commands.length; s += 1) {
|
|
@@ -3628,22 +3917,22 @@ function ks(t) {
|
|
|
3628
3917
|
}
|
|
3629
3918
|
return e.push({ name: "endchar", type: "OP", value: 14 }), e;
|
|
3630
3919
|
}
|
|
3631
|
-
function
|
|
3920
|
+
function Bs(t) {
|
|
3632
3921
|
for (var e = new k.Record("CharStrings INDEX", [
|
|
3633
3922
|
{ name: "charStrings", type: "INDEX", value: [] }
|
|
3634
3923
|
]), r = 0; r < t.length; r += 1) {
|
|
3635
|
-
var n = t.get(r), a =
|
|
3924
|
+
var n = t.get(r), a = Ms(n);
|
|
3636
3925
|
e.charStrings.push({ name: n.name, type: "CHARSTRING", value: a });
|
|
3637
3926
|
}
|
|
3638
3927
|
return e;
|
|
3639
3928
|
}
|
|
3640
|
-
function
|
|
3929
|
+
function Ps(t, e) {
|
|
3641
3930
|
var r = new k.Record("Private DICT", [
|
|
3642
3931
|
{ name: "dict", type: "DICT", value: {} }
|
|
3643
3932
|
]);
|
|
3644
|
-
return r.dict =
|
|
3933
|
+
return r.dict = Gn(Bn, t, e), r;
|
|
3645
3934
|
}
|
|
3646
|
-
function
|
|
3935
|
+
function Is(t, e) {
|
|
3647
3936
|
for (var r = new k.Table("CFF ", [
|
|
3648
3937
|
{ name: "header", type: "RECORD" },
|
|
3649
3938
|
{ name: "nameIndex", type: "RECORD" },
|
|
@@ -3667,18 +3956,18 @@ function ws(t, e) {
|
|
|
3667
3956
|
}, s = {}, i = [], u, o = 1; o < t.length; o += 1)
|
|
3668
3957
|
u = t.get(o), i.push(u.name);
|
|
3669
3958
|
var l = [];
|
|
3670
|
-
r.header =
|
|
3671
|
-
var c =
|
|
3672
|
-
r.topDictIndex =
|
|
3959
|
+
r.header = Us(), r.nameIndex = Ls([e.postScriptName]);
|
|
3960
|
+
var c = Lr(a, l);
|
|
3961
|
+
r.topDictIndex = Rr(c), r.globalSubrIndex = As(), r.charsets = Ds(i, l), r.charStringsIndex = Bs(t), r.privateDict = Ps(s, l), r.stringIndex = Rs(l);
|
|
3673
3962
|
var p = r.header.sizeOf() + r.nameIndex.sizeOf() + r.topDictIndex.sizeOf() + r.stringIndex.sizeOf() + r.globalSubrIndex.sizeOf();
|
|
3674
|
-
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 = Lr(a, l), r.topDictIndex = Rr(c), r;
|
|
3675
3964
|
}
|
|
3676
|
-
var
|
|
3677
|
-
function
|
|
3965
|
+
var Nn = { parse: Os, make: Is };
|
|
3966
|
+
function Gs(t, e) {
|
|
3678
3967
|
var r = {}, n = new F.Parser(t, e);
|
|
3679
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;
|
|
3680
3969
|
}
|
|
3681
|
-
function
|
|
3970
|
+
function Ns(t) {
|
|
3682
3971
|
var e = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3) + 2082844800, r = e;
|
|
3683
3972
|
return t.createdTimestamp && (r = t.createdTimestamp + 2082844800), new k.Table("head", [
|
|
3684
3973
|
{ name: "version", type: "FIXED", value: 65536 },
|
|
@@ -3700,12 +3989,12 @@ function Es(t) {
|
|
|
3700
3989
|
{ name: "glyphDataFormat", type: "SHORT", value: 0 }
|
|
3701
3990
|
], t);
|
|
3702
3991
|
}
|
|
3703
|
-
var
|
|
3704
|
-
function
|
|
3992
|
+
var _n = { parse: Gs, make: Ns };
|
|
3993
|
+
function _s(t, e) {
|
|
3705
3994
|
var r = {}, n = new F.Parser(t, e);
|
|
3706
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;
|
|
3707
3996
|
}
|
|
3708
|
-
function
|
|
3997
|
+
function Hs(t) {
|
|
3709
3998
|
return new k.Table("hhea", [
|
|
3710
3999
|
{ name: "version", type: "FIXED", value: 65536 },
|
|
3711
4000
|
{ name: "ascender", type: "FWORD", value: 0 },
|
|
@@ -3726,15 +4015,15 @@ function Us(t) {
|
|
|
3726
4015
|
{ name: "numberOfHMetrics", type: "USHORT", value: 0 }
|
|
3727
4016
|
], t);
|
|
3728
4017
|
}
|
|
3729
|
-
var
|
|
3730
|
-
function
|
|
4018
|
+
var Hn = { parse: _s, make: Hs };
|
|
4019
|
+
function zs(t, e, r, n, a) {
|
|
3731
4020
|
for (var s, i, u = new F.Parser(t, e), o = 0; o < n; o += 1) {
|
|
3732
4021
|
o < r && (s = u.parseUShort(), i = u.parseShort());
|
|
3733
4022
|
var l = a.get(o);
|
|
3734
4023
|
l.advanceWidth = s, l.leftSideBearing = i;
|
|
3735
4024
|
}
|
|
3736
4025
|
}
|
|
3737
|
-
function
|
|
4026
|
+
function Ws(t, e, r, n, a) {
|
|
3738
4027
|
t._hmtxTableData = {};
|
|
3739
4028
|
for (var s, i, u = new F.Parser(e, r), o = 0; o < a; o += 1)
|
|
3740
4029
|
o < n && (s = u.parseUShort(), i = u.parseShort()), t._hmtxTableData[o] = {
|
|
@@ -3742,18 +4031,18 @@ function Rs(t, e, r, n, a) {
|
|
|
3742
4031
|
leftSideBearing: i
|
|
3743
4032
|
};
|
|
3744
4033
|
}
|
|
3745
|
-
function
|
|
3746
|
-
i.lowMemory ?
|
|
4034
|
+
function Vs(t, e, r, n, a, s, i) {
|
|
4035
|
+
i.lowMemory ? Ws(t, e, r, n, a) : zs(e, r, n, a, s);
|
|
3747
4036
|
}
|
|
3748
|
-
function
|
|
4037
|
+
function qs(t) {
|
|
3749
4038
|
for (var e = new k.Table("hmtx", []), r = 0; r < t.length; r += 1) {
|
|
3750
4039
|
var n = t.get(r), a = n.advanceWidth || 0, s = n.leftSideBearing || 0;
|
|
3751
4040
|
e.fields.push({ name: "advanceWidth_" + r, type: "USHORT", value: a }), e.fields.push({ name: "leftSideBearing_" + r, type: "SHORT", value: s });
|
|
3752
4041
|
}
|
|
3753
4042
|
return e;
|
|
3754
4043
|
}
|
|
3755
|
-
var
|
|
3756
|
-
function
|
|
4044
|
+
var zn = { parse: Vs, make: qs };
|
|
4045
|
+
function Xs(t) {
|
|
3757
4046
|
for (var e = new k.Table("ltag", [
|
|
3758
4047
|
{ name: "version", type: "ULONG", value: 1 },
|
|
3759
4048
|
{ name: "flags", type: "ULONG", value: 0 },
|
|
@@ -3764,7 +4053,7 @@ function Ms(t) {
|
|
|
3764
4053
|
}
|
|
3765
4054
|
return e.fields.push({ name: "stringPool", type: "CHARARRAY", value: r }), e;
|
|
3766
4055
|
}
|
|
3767
|
-
function
|
|
4056
|
+
function Ys(t, e) {
|
|
3768
4057
|
var r = new F.Parser(t, e), n = r.parseULong();
|
|
3769
4058
|
E.argument(n === 1, "Unsupported ltag table version."), r.skip("uLong", 1);
|
|
3770
4059
|
for (var a = r.parseULong(), s = [], i = 0; i < a; i++) {
|
|
@@ -3774,18 +4063,18 @@ function Bs(t, e) {
|
|
|
3774
4063
|
}
|
|
3775
4064
|
return s;
|
|
3776
4065
|
}
|
|
3777
|
-
var
|
|
3778
|
-
function
|
|
4066
|
+
var Wn = { make: Xs, parse: Ys };
|
|
4067
|
+
function Zs(t, e) {
|
|
3779
4068
|
var r = {}, n = new F.Parser(t, e);
|
|
3780
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;
|
|
3781
4070
|
}
|
|
3782
|
-
function
|
|
4071
|
+
function js(t) {
|
|
3783
4072
|
return new k.Table("maxp", [
|
|
3784
4073
|
{ name: "version", type: "FIXED", value: 20480 },
|
|
3785
4074
|
{ name: "numGlyphs", type: "USHORT", value: t }
|
|
3786
4075
|
]);
|
|
3787
4076
|
}
|
|
3788
|
-
var
|
|
4077
|
+
var Vn = { parse: Zs, make: js }, qn = [
|
|
3789
4078
|
"copyright",
|
|
3790
4079
|
// 0
|
|
3791
4080
|
"fontFamily",
|
|
@@ -3832,7 +4121,7 @@ var zn = { parse: Ps, make: Is }, Wn = [
|
|
|
3832
4121
|
// 21
|
|
3833
4122
|
"wwsSubfamily"
|
|
3834
4123
|
// 22
|
|
3835
|
-
],
|
|
4124
|
+
], Xn = {
|
|
3836
4125
|
0: "en",
|
|
3837
4126
|
1: "fr",
|
|
3838
4127
|
2: "de",
|
|
@@ -3952,7 +4241,7 @@ var zn = { parse: Ps, make: Is }, Wn = [
|
|
|
3952
4241
|
149: "kl",
|
|
3953
4242
|
150: "az",
|
|
3954
4243
|
151: "nn"
|
|
3955
|
-
},
|
|
4244
|
+
}, Ks = {
|
|
3956
4245
|
0: 0,
|
|
3957
4246
|
// langEnglish → smRoman
|
|
3958
4247
|
1: 0,
|
|
@@ -4191,7 +4480,7 @@ var zn = { parse: Ps, make: Is }, Wn = [
|
|
|
4191
4480
|
// langAzerbaijanRoman → smRoman
|
|
4192
4481
|
151: 0
|
|
4193
4482
|
// langNynorsk → smRoman
|
|
4194
|
-
},
|
|
4483
|
+
}, Yn = {
|
|
4195
4484
|
1078: "af",
|
|
4196
4485
|
1052: "sq",
|
|
4197
4486
|
1156: "gsw",
|
|
@@ -4405,7 +4694,7 @@ var zn = { parse: Ps, make: Is }, Wn = [
|
|
|
4405
4694
|
1144: "ii",
|
|
4406
4695
|
1130: "yo"
|
|
4407
4696
|
};
|
|
4408
|
-
function
|
|
4697
|
+
function Qs(t, e, r) {
|
|
4409
4698
|
switch (t) {
|
|
4410
4699
|
case 0:
|
|
4411
4700
|
if (e === 65535)
|
|
@@ -4414,12 +4703,12 @@ function Ns(t, e, r) {
|
|
|
4414
4703
|
return r[e];
|
|
4415
4704
|
break;
|
|
4416
4705
|
case 1:
|
|
4417
|
-
return
|
|
4706
|
+
return Xn[e];
|
|
4418
4707
|
case 3:
|
|
4419
|
-
return
|
|
4708
|
+
return Yn[e];
|
|
4420
4709
|
}
|
|
4421
4710
|
}
|
|
4422
|
-
var
|
|
4711
|
+
var Zt = "utf-16", Js = {
|
|
4423
4712
|
0: "macintosh",
|
|
4424
4713
|
// smRoman
|
|
4425
4714
|
1: "x-mac-japanese",
|
|
@@ -4478,7 +4767,7 @@ var Wt = "utf-16", _s = {
|
|
|
4478
4767
|
// smVietnamese
|
|
4479
4768
|
31: "x-mac-extarabic"
|
|
4480
4769
|
// smExtArabic
|
|
4481
|
-
},
|
|
4770
|
+
}, $s = {
|
|
4482
4771
|
15: "x-mac-icelandic",
|
|
4483
4772
|
// langIcelandic
|
|
4484
4773
|
17: "x-mac-turkish",
|
|
@@ -4510,24 +4799,24 @@ var Wt = "utf-16", _s = {
|
|
|
4510
4799
|
146: "x-mac-gaelic"
|
|
4511
4800
|
// langIrishGaelicScript
|
|
4512
4801
|
};
|
|
4513
|
-
function
|
|
4802
|
+
function Zn(t, e, r) {
|
|
4514
4803
|
switch (t) {
|
|
4515
4804
|
case 0:
|
|
4516
|
-
return
|
|
4805
|
+
return Zt;
|
|
4517
4806
|
case 1:
|
|
4518
|
-
return
|
|
4807
|
+
return $s[r] || Js[e];
|
|
4519
4808
|
case 3:
|
|
4520
4809
|
if (e === 1 || e === 10)
|
|
4521
|
-
return
|
|
4810
|
+
return Zt;
|
|
4522
4811
|
break;
|
|
4523
4812
|
}
|
|
4524
4813
|
}
|
|
4525
|
-
function
|
|
4814
|
+
function ei(t, e, r) {
|
|
4526
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++) {
|
|
4527
|
-
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 = qn[h] || h, v = a.parseUShort(), g = a.parseUShort(), y = Qs(l, p, r), m = Zn(l, c, p);
|
|
4528
4817
|
if (m !== void 0 && y !== void 0) {
|
|
4529
4818
|
var S = void 0;
|
|
4530
|
-
if (m ===
|
|
4819
|
+
if (m === Zt ? S = Pe.UTF16(t, u + g, v) : S = Pe.MACSTRING(t, u + g, v, m), S) {
|
|
4531
4820
|
var x = n[f];
|
|
4532
4821
|
x === void 0 && (x = n[f] = {}), x[y] = S;
|
|
4533
4822
|
}
|
|
@@ -4535,13 +4824,13 @@ function zs(t, e, r) {
|
|
|
4535
4824
|
}
|
|
4536
4825
|
return s === 1 && a.parseUShort(), n;
|
|
4537
4826
|
}
|
|
4538
|
-
function
|
|
4827
|
+
function Ft(t) {
|
|
4539
4828
|
var e = {};
|
|
4540
4829
|
for (var r in t)
|
|
4541
4830
|
e[t[r]] = parseInt(r);
|
|
4542
4831
|
return e;
|
|
4543
4832
|
}
|
|
4544
|
-
function
|
|
4833
|
+
function Ar(t, e, r, n, a, s) {
|
|
4545
4834
|
return new k.Record("NameRecord", [
|
|
4546
4835
|
{ name: "platformID", type: "USHORT", value: t },
|
|
4547
4836
|
{ name: "encodingID", type: "USHORT", value: e },
|
|
@@ -4551,7 +4840,7 @@ function Er(t, e, r, n, a, s) {
|
|
|
4551
4840
|
{ name: "offset", type: "USHORT", value: s }
|
|
4552
4841
|
]);
|
|
4553
4842
|
}
|
|
4554
|
-
function
|
|
4843
|
+
function ti(t, e) {
|
|
4555
4844
|
var r = t.length, n = e.length - r + 1;
|
|
4556
4845
|
e:
|
|
4557
4846
|
for (var a = 0; a < n; a++)
|
|
@@ -4563,8 +4852,8 @@ function Ws(t, e) {
|
|
|
4563
4852
|
}
|
|
4564
4853
|
return -1;
|
|
4565
4854
|
}
|
|
4566
|
-
function
|
|
4567
|
-
var r =
|
|
4855
|
+
function Dr(t, e) {
|
|
4856
|
+
var r = ti(t, e);
|
|
4568
4857
|
if (r < 0) {
|
|
4569
4858
|
r = e.length;
|
|
4570
4859
|
for (var n = 0, a = t.length; n < a; ++n)
|
|
@@ -4572,22 +4861,22 @@ function Or(t, e) {
|
|
|
4572
4861
|
}
|
|
4573
4862
|
return r;
|
|
4574
4863
|
}
|
|
4575
|
-
function
|
|
4576
|
-
var r, n = [], a = {}, s =
|
|
4864
|
+
function ri(t, e) {
|
|
4865
|
+
var r, n = [], a = {}, s = Ft(qn);
|
|
4577
4866
|
for (var i in t) {
|
|
4578
4867
|
var u = s[i];
|
|
4579
4868
|
if (u === void 0 && (u = i), r = parseInt(u), isNaN(r))
|
|
4580
4869
|
throw new Error('Name table entry "' + i + '" does not exist, see nameTableNames for complete list.');
|
|
4581
4870
|
a[r] = t[i], n.push(r);
|
|
4582
4871
|
}
|
|
4583
|
-
for (var o =
|
|
4872
|
+
for (var o = Ft(Xn), l = Ft(Yn), c = [], p = [], h = 0; h < n.length; h++) {
|
|
4584
4873
|
r = n[h];
|
|
4585
4874
|
var f = a[r];
|
|
4586
4875
|
for (var v in f) {
|
|
4587
|
-
var g = f[v], y = 1, m = o[v], S =
|
|
4876
|
+
var g = f[v], y = 1, m = o[v], S = Ks[m], x = Zn(y, S, m), O = b.MACSTRING(g, x);
|
|
4588
4877
|
O === void 0 && (y = 0, m = e.indexOf(v), m < 0 && (m = e.length, e.push(v)), S = 4, O = b.UTF16(g));
|
|
4589
|
-
var w =
|
|
4590
|
-
c.push(
|
|
4878
|
+
var w = Dr(O, p);
|
|
4879
|
+
c.push(Ar(
|
|
4591
4880
|
y,
|
|
4592
4881
|
S,
|
|
4593
4882
|
m,
|
|
@@ -4597,8 +4886,8 @@ function Vs(t, e) {
|
|
|
4597
4886
|
));
|
|
4598
4887
|
var D = l[v];
|
|
4599
4888
|
if (D !== void 0) {
|
|
4600
|
-
var L = b.UTF16(g), C =
|
|
4601
|
-
c.push(
|
|
4889
|
+
var L = b.UTF16(g), C = Dr(L, p);
|
|
4890
|
+
c.push(Ar(
|
|
4602
4891
|
3,
|
|
4603
4892
|
1,
|
|
4604
4893
|
D,
|
|
@@ -4609,18 +4898,18 @@ function Vs(t, e) {
|
|
|
4609
4898
|
}
|
|
4610
4899
|
}
|
|
4611
4900
|
}
|
|
4612
|
-
c.sort(function(
|
|
4613
|
-
return
|
|
4901
|
+
c.sort(function(K, re) {
|
|
4902
|
+
return K.platformID - re.platformID || K.encodingID - re.encodingID || K.languageID - re.languageID || K.nameID - re.nameID;
|
|
4614
4903
|
});
|
|
4615
4904
|
for (var N = new k.Table("name", [
|
|
4616
4905
|
{ name: "format", type: "USHORT", value: 0 },
|
|
4617
4906
|
{ name: "count", type: "USHORT", value: c.length },
|
|
4618
4907
|
{ name: "stringOffset", type: "USHORT", value: 6 + c.length * 12 }
|
|
4619
|
-
]),
|
|
4620
|
-
N.fields.push({ name: "record_" +
|
|
4908
|
+
]), j = 0; j < c.length; j++)
|
|
4909
|
+
N.fields.push({ name: "record_" + j, type: "RECORD", value: c[j] });
|
|
4621
4910
|
return N.fields.push({ name: "strings", type: "LITERAL", value: p }), N;
|
|
4622
4911
|
}
|
|
4623
|
-
var
|
|
4912
|
+
var jn = { parse: ei, make: ri }, jt = [
|
|
4624
4913
|
{ begin: 0, end: 127 },
|
|
4625
4914
|
// Basic Latin
|
|
4626
4915
|
{ begin: 128, end: 255 },
|
|
@@ -4868,22 +5157,22 @@ var Yn = { parse: zs, make: Vs }, Vt = [
|
|
|
4868
5157
|
{ begin: 127024, end: 127135 }
|
|
4869
5158
|
// Domino Tiles
|
|
4870
5159
|
];
|
|
4871
|
-
function
|
|
4872
|
-
for (var e = 0; e <
|
|
4873
|
-
var r =
|
|
5160
|
+
function ni(t) {
|
|
5161
|
+
for (var e = 0; e < jt.length; e += 1) {
|
|
5162
|
+
var r = jt[e];
|
|
4874
5163
|
if (t >= r.begin && t < r.end)
|
|
4875
5164
|
return e;
|
|
4876
5165
|
}
|
|
4877
5166
|
return -1;
|
|
4878
5167
|
}
|
|
4879
|
-
function
|
|
5168
|
+
function ai(t, e) {
|
|
4880
5169
|
var r = {}, n = new F.Parser(t, e);
|
|
4881
5170
|
r.version = n.parseUShort(), r.xAvgCharWidth = n.parseShort(), r.usWeightClass = n.parseUShort(), r.usWidthClass = n.parseUShort(), r.fsType = n.parseUShort(), r.ySubscriptXSize = n.parseShort(), r.ySubscriptYSize = n.parseShort(), r.ySubscriptXOffset = n.parseShort(), r.ySubscriptYOffset = n.parseShort(), r.ySuperscriptXSize = n.parseShort(), r.ySuperscriptYSize = n.parseShort(), r.ySuperscriptXOffset = n.parseShort(), r.ySuperscriptYOffset = n.parseShort(), r.yStrikeoutSize = n.parseShort(), r.yStrikeoutPosition = n.parseShort(), r.sFamilyClass = n.parseShort(), r.panose = [];
|
|
4882
5171
|
for (var a = 0; a < 10; a++)
|
|
4883
5172
|
r.panose[a] = n.parseByte();
|
|
4884
5173
|
return r.ulUnicodeRange1 = n.parseULong(), r.ulUnicodeRange2 = n.parseULong(), r.ulUnicodeRange3 = n.parseULong(), r.ulUnicodeRange4 = n.parseULong(), r.achVendID = String.fromCharCode(n.parseByte(), n.parseByte(), n.parseByte(), n.parseByte()), r.fsSelection = n.parseUShort(), r.usFirstCharIndex = n.parseUShort(), r.usLastCharIndex = n.parseUShort(), r.sTypoAscender = n.parseShort(), r.sTypoDescender = n.parseShort(), r.sTypoLineGap = n.parseShort(), r.usWinAscent = n.parseUShort(), r.usWinDescent = n.parseUShort(), r.version >= 1 && (r.ulCodePageRange1 = n.parseULong(), r.ulCodePageRange2 = n.parseULong()), r.version >= 2 && (r.sxHeight = n.parseShort(), r.sCapHeight = n.parseShort(), r.usDefaultChar = n.parseUShort(), r.usBreakChar = n.parseUShort(), r.usMaxContent = n.parseUShort()), r;
|
|
4885
5174
|
}
|
|
4886
|
-
function
|
|
5175
|
+
function si(t) {
|
|
4887
5176
|
return new k.Table("OS/2", [
|
|
4888
5177
|
{ name: "version", type: "USHORT", value: 3 },
|
|
4889
5178
|
{ name: "xAvgCharWidth", type: "SHORT", value: 0 },
|
|
@@ -4933,8 +5222,8 @@ function Ys(t) {
|
|
|
4933
5222
|
{ name: "usMaxContext", type: "USHORT", value: 0 }
|
|
4934
5223
|
], t);
|
|
4935
5224
|
}
|
|
4936
|
-
var
|
|
4937
|
-
function
|
|
5225
|
+
var Kt = { parse: ai, make: si, unicodeRanges: jt, getUnicodeRange: ni };
|
|
5226
|
+
function ii(t, e) {
|
|
4938
5227
|
var r = {}, n = new F.Parser(t, e);
|
|
4939
5228
|
switch (r.version = n.parseVersion(), r.italicAngle = n.parseFixed(), r.underlinePosition = n.parseShort(), r.underlineThickness = n.parseShort(), r.isFixedPitch = n.parseULong(), r.minMemType42 = n.parseULong(), r.maxMemType42 = n.parseULong(), r.minMemType1 = n.parseULong(), r.maxMemType1 = n.parseULong(), r.version) {
|
|
4940
5229
|
case 1:
|
|
@@ -4959,7 +5248,7 @@ function Zs(t, e) {
|
|
|
4959
5248
|
}
|
|
4960
5249
|
return r;
|
|
4961
5250
|
}
|
|
4962
|
-
function
|
|
5251
|
+
function oi() {
|
|
4963
5252
|
return new k.Table("post", [
|
|
4964
5253
|
{ name: "version", type: "FIXED", value: 196608 },
|
|
4965
5254
|
{ name: "italicAngle", type: "FIXED", value: 0 },
|
|
@@ -4972,7 +5261,7 @@ function Ks() {
|
|
|
4972
5261
|
{ name: "maxMemType1", type: "ULONG", value: 0 }
|
|
4973
5262
|
]);
|
|
4974
5263
|
}
|
|
4975
|
-
var
|
|
5264
|
+
var Kn = { parse: ii, make: oi }, se = new Array(9);
|
|
4976
5265
|
se[1] = function() {
|
|
4977
5266
|
var e = this.offset + this.relativeOffset, r = this.parseUShort();
|
|
4978
5267
|
if (r === 1)
|
|
@@ -5018,7 +5307,7 @@ se[4] = function() {
|
|
|
5018
5307
|
})
|
|
5019
5308
|
};
|
|
5020
5309
|
};
|
|
5021
|
-
var
|
|
5310
|
+
var Be = {
|
|
5022
5311
|
sequenceIndex: d.uShort,
|
|
5023
5312
|
lookupListIndex: d.uShort
|
|
5024
5313
|
};
|
|
@@ -5032,7 +5321,7 @@ se[5] = function() {
|
|
|
5032
5321
|
var s = this.parseUShort(), i = this.parseUShort();
|
|
5033
5322
|
return {
|
|
5034
5323
|
input: this.parseUShortList(s - 1),
|
|
5035
|
-
lookupRecords: this.parseRecordList(i,
|
|
5324
|
+
lookupRecords: this.parseRecordList(i, Be)
|
|
5036
5325
|
};
|
|
5037
5326
|
})
|
|
5038
5327
|
};
|
|
@@ -5045,7 +5334,7 @@ se[5] = function() {
|
|
|
5045
5334
|
var s = this.parseUShort(), i = this.parseUShort();
|
|
5046
5335
|
return {
|
|
5047
5336
|
classes: this.parseUShortList(s - 1),
|
|
5048
|
-
lookupRecords: this.parseRecordList(i,
|
|
5337
|
+
lookupRecords: this.parseRecordList(i, Be)
|
|
5049
5338
|
};
|
|
5050
5339
|
})
|
|
5051
5340
|
};
|
|
@@ -5054,7 +5343,7 @@ se[5] = function() {
|
|
|
5054
5343
|
return {
|
|
5055
5344
|
substFormat: r,
|
|
5056
5345
|
coverages: this.parseList(n, d.pointer(d.coverage)),
|
|
5057
|
-
lookupRecords: this.parseRecordList(a,
|
|
5346
|
+
lookupRecords: this.parseRecordList(a, Be)
|
|
5058
5347
|
};
|
|
5059
5348
|
}
|
|
5060
5349
|
E.assert(!1, "0x" + e.toString(16) + ": lookup type 5 format must be 1, 2 or 3.");
|
|
@@ -5070,7 +5359,7 @@ se[6] = function() {
|
|
|
5070
5359
|
backtrack: this.parseUShortList(),
|
|
5071
5360
|
input: this.parseUShortList(this.parseShort() - 1),
|
|
5072
5361
|
lookahead: this.parseUShortList(),
|
|
5073
|
-
lookupRecords: this.parseRecordList(
|
|
5362
|
+
lookupRecords: this.parseRecordList(Be)
|
|
5074
5363
|
};
|
|
5075
5364
|
})
|
|
5076
5365
|
};
|
|
@@ -5086,7 +5375,7 @@ se[6] = function() {
|
|
|
5086
5375
|
backtrack: this.parseUShortList(),
|
|
5087
5376
|
input: this.parseUShortList(this.parseShort() - 1),
|
|
5088
5377
|
lookahead: this.parseUShortList(),
|
|
5089
|
-
lookupRecords: this.parseRecordList(
|
|
5378
|
+
lookupRecords: this.parseRecordList(Be)
|
|
5090
5379
|
};
|
|
5091
5380
|
})
|
|
5092
5381
|
};
|
|
@@ -5096,7 +5385,7 @@ se[6] = function() {
|
|
|
5096
5385
|
backtrackCoverage: this.parseList(d.pointer(d.coverage)),
|
|
5097
5386
|
inputCoverage: this.parseList(d.pointer(d.coverage)),
|
|
5098
5387
|
lookaheadCoverage: this.parseList(d.pointer(d.coverage)),
|
|
5099
|
-
lookupRecords: this.parseRecordList(
|
|
5388
|
+
lookupRecords: this.parseRecordList(Be)
|
|
5100
5389
|
};
|
|
5101
5390
|
E.assert(!1, "0x" + e.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
|
|
5102
5391
|
};
|
|
@@ -5120,7 +5409,7 @@ se[8] = function() {
|
|
|
5120
5409
|
substitutes: this.parseUShortList()
|
|
5121
5410
|
};
|
|
5122
5411
|
};
|
|
5123
|
-
function
|
|
5412
|
+
function ui(t, e) {
|
|
5124
5413
|
e = e || 0;
|
|
5125
5414
|
var r = new d(t, e), n = r.parseVersion(1);
|
|
5126
5415
|
return E.argument(n === 1 || n === 1.1, "Unsupported GSUB table version."), n === 1 ? {
|
|
@@ -5136,8 +5425,8 @@ function js(t, e) {
|
|
|
5136
5425
|
variations: r.parseFeatureVariationsList()
|
|
5137
5426
|
};
|
|
5138
5427
|
}
|
|
5139
|
-
var
|
|
5140
|
-
|
|
5428
|
+
var Ie = new Array(9);
|
|
5429
|
+
Ie[1] = function(e) {
|
|
5141
5430
|
return e.substFormat === 1 ? new k.Table("substitutionTable", [
|
|
5142
5431
|
{ name: "substFormat", type: "USHORT", value: 1 },
|
|
5143
5432
|
{ name: "coverage", type: "TABLE", value: new k.Coverage(e.coverage) },
|
|
@@ -5147,7 +5436,7 @@ Pe[1] = function(e) {
|
|
|
5147
5436
|
{ name: "coverage", type: "TABLE", value: new k.Coverage(e.coverage) }
|
|
5148
5437
|
].concat(k.ushortList("substitute", e.substitute)));
|
|
5149
5438
|
};
|
|
5150
|
-
|
|
5439
|
+
Ie[2] = function(e) {
|
|
5151
5440
|
return E.assert(e.substFormat === 1, "Lookup type 2 substFormat must be 1."), new k.Table("substitutionTable", [
|
|
5152
5441
|
{ name: "substFormat", type: "USHORT", value: 1 },
|
|
5153
5442
|
{ name: "coverage", type: "TABLE", value: new k.Coverage(e.coverage) }
|
|
@@ -5155,7 +5444,7 @@ Pe[2] = function(e) {
|
|
|
5155
5444
|
return new k.Table("sequenceSetTable", k.ushortList("sequence", r));
|
|
5156
5445
|
})));
|
|
5157
5446
|
};
|
|
5158
|
-
|
|
5447
|
+
Ie[3] = function(e) {
|
|
5159
5448
|
return E.assert(e.substFormat === 1, "Lookup type 3 substFormat must be 1."), new k.Table("substitutionTable", [
|
|
5160
5449
|
{ name: "substFormat", type: "USHORT", value: 1 },
|
|
5161
5450
|
{ name: "coverage", type: "TABLE", value: new k.Coverage(e.coverage) }
|
|
@@ -5163,7 +5452,7 @@ Pe[3] = function(e) {
|
|
|
5163
5452
|
return new k.Table("alternateSetTable", k.ushortList("alternate", r));
|
|
5164
5453
|
})));
|
|
5165
5454
|
};
|
|
5166
|
-
|
|
5455
|
+
Ie[4] = function(e) {
|
|
5167
5456
|
return E.assert(e.substFormat === 1, "Lookup type 4 substFormat must be 1."), new k.Table("substitutionTable", [
|
|
5168
5457
|
{ name: "substFormat", type: "USHORT", value: 1 },
|
|
5169
5458
|
{ name: "coverage", type: "TABLE", value: new k.Coverage(e.coverage) }
|
|
@@ -5176,7 +5465,7 @@ Pe[4] = function(e) {
|
|
|
5176
5465
|
}));
|
|
5177
5466
|
})));
|
|
5178
5467
|
};
|
|
5179
|
-
|
|
5468
|
+
Ie[6] = function(e) {
|
|
5180
5469
|
if (e.substFormat === 1) {
|
|
5181
5470
|
var r = new k.Table("chainContextTable", [
|
|
5182
5471
|
{ name: "substFormat", type: "USHORT", value: e.substFormat },
|
|
@@ -5210,25 +5499,25 @@ Pe[6] = function(e) {
|
|
|
5210
5499
|
}
|
|
5211
5500
|
E.assert(!1, "lookup type 6 format must be 1, 2 or 3.");
|
|
5212
5501
|
};
|
|
5213
|
-
function
|
|
5502
|
+
function li(t) {
|
|
5214
5503
|
return new k.Table("GSUB", [
|
|
5215
5504
|
{ name: "version", type: "ULONG", value: 65536 },
|
|
5216
5505
|
{ name: "scripts", type: "TABLE", value: new k.ScriptList(t.scripts) },
|
|
5217
5506
|
{ name: "features", type: "TABLE", value: new k.FeatureList(t.features) },
|
|
5218
|
-
{ name: "lookups", type: "TABLE", value: new k.LookupList(t.lookups,
|
|
5507
|
+
{ name: "lookups", type: "TABLE", value: new k.LookupList(t.lookups, Ie) }
|
|
5219
5508
|
]);
|
|
5220
5509
|
}
|
|
5221
|
-
var
|
|
5222
|
-
function
|
|
5510
|
+
var Qn = { parse: ui, make: li };
|
|
5511
|
+
function ci(t, e) {
|
|
5223
5512
|
var r = new F.Parser(t, e), n = r.parseULong();
|
|
5224
5513
|
E.argument(n === 1, "Unsupported META table version."), r.parseULong(), r.parseULong();
|
|
5225
5514
|
for (var a = r.parseULong(), s = {}, i = 0; i < a; i++) {
|
|
5226
|
-
var u = r.parseTag(), o = r.parseULong(), l = r.parseULong(), c =
|
|
5515
|
+
var u = r.parseTag(), o = r.parseULong(), l = r.parseULong(), c = Pe.UTF8(t, e + o, l);
|
|
5227
5516
|
s[u] = c;
|
|
5228
5517
|
}
|
|
5229
5518
|
return s;
|
|
5230
5519
|
}
|
|
5231
|
-
function
|
|
5520
|
+
function hi(t) {
|
|
5232
5521
|
var e = Object.keys(t).length, r = "", n = 16 + e * 12, a = new k.Table("meta", [
|
|
5233
5522
|
{ name: "version", type: "ULONG", value: 1 },
|
|
5234
5523
|
{ name: "flags", type: "ULONG", value: 0 },
|
|
@@ -5241,8 +5530,8 @@ function $s(t) {
|
|
|
5241
5530
|
}
|
|
5242
5531
|
return a.fields.push({ name: "stringPool", type: "CHARARRAY", value: r }), a;
|
|
5243
5532
|
}
|
|
5244
|
-
var
|
|
5245
|
-
function
|
|
5533
|
+
var Jn = { parse: ci, make: hi };
|
|
5534
|
+
function Mr(t) {
|
|
5246
5535
|
return Math.log(t) / Math.log(2) | 0;
|
|
5247
5536
|
}
|
|
5248
5537
|
function ar(t) {
|
|
@@ -5252,7 +5541,7 @@ function ar(t) {
|
|
|
5252
5541
|
e += (t[r] << 24) + (t[r + 1] << 16) + (t[r + 2] << 8) + t[r + 3];
|
|
5253
5542
|
return e %= Math.pow(2, 32), e;
|
|
5254
5543
|
}
|
|
5255
|
-
function
|
|
5544
|
+
function Br(t, e, r, n) {
|
|
5256
5545
|
return new k.Record("Table Record", [
|
|
5257
5546
|
{ name: "tag", type: "TAG", value: t !== void 0 ? t : "" },
|
|
5258
5547
|
{ name: "checkSum", type: "ULONG", value: e !== void 0 ? e : 0 },
|
|
@@ -5260,7 +5549,7 @@ function Lr(t, e, r, n) {
|
|
|
5260
5549
|
{ name: "length", type: "ULONG", value: n !== void 0 ? n : 0 }
|
|
5261
5550
|
]);
|
|
5262
5551
|
}
|
|
5263
|
-
function
|
|
5552
|
+
function $n(t) {
|
|
5264
5553
|
var e = new k.Table("sfnt", [
|
|
5265
5554
|
{ name: "version", type: "TAG", value: "OTTO" },
|
|
5266
5555
|
{ name: "numTables", type: "USHORT", value: 0 },
|
|
@@ -5269,14 +5558,14 @@ function Qn(t) {
|
|
|
5269
5558
|
{ name: "rangeShift", type: "USHORT", value: 0 }
|
|
5270
5559
|
]);
|
|
5271
5560
|
e.tables = t, e.numTables = t.length;
|
|
5272
|
-
var r = Math.pow(2,
|
|
5273
|
-
e.searchRange = 16 * r, e.entrySelector =
|
|
5274
|
-
for (var n = [], a = [], s = e.sizeOf() +
|
|
5561
|
+
var r = Math.pow(2, Mr(e.numTables));
|
|
5562
|
+
e.searchRange = 16 * r, e.entrySelector = Mr(r), e.rangeShift = e.numTables * 16 - e.searchRange;
|
|
5563
|
+
for (var n = [], a = [], s = e.sizeOf() + Br().sizeOf() * e.numTables; s % 4 !== 0; )
|
|
5275
5564
|
s += 1, a.push({ name: "padding", type: "BYTE", value: 0 });
|
|
5276
5565
|
for (var i = 0; i < t.length; i += 1) {
|
|
5277
5566
|
var u = t[i];
|
|
5278
5567
|
E.argument(u.tableName.length === 4, "Table name" + u.tableName + " is invalid.");
|
|
5279
|
-
var o = u.sizeOf(), l =
|
|
5568
|
+
var o = u.sizeOf(), l = Br(u.tableName, ar(u.encode()), s, o);
|
|
5280
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; )
|
|
5281
5570
|
s += 1, a.push({ name: "padding", type: "BYTE", value: 0 });
|
|
5282
5571
|
}
|
|
@@ -5284,7 +5573,7 @@ function Qn(t) {
|
|
|
5284
5573
|
return c.value.tag > p.value.tag ? 1 : -1;
|
|
5285
5574
|
}), e.fields = e.fields.concat(n), e.fields = e.fields.concat(a), e;
|
|
5286
5575
|
}
|
|
5287
|
-
function
|
|
5576
|
+
function Pr(t, e, r) {
|
|
5288
5577
|
for (var n = 0; n < e.length; n += 1) {
|
|
5289
5578
|
var a = t.charToGlyphIndex(e[n]);
|
|
5290
5579
|
if (a > 0) {
|
|
@@ -5294,18 +5583,18 @@ function Rr(t, e, r) {
|
|
|
5294
5583
|
}
|
|
5295
5584
|
return r;
|
|
5296
5585
|
}
|
|
5297
|
-
function
|
|
5586
|
+
function fi(t) {
|
|
5298
5587
|
for (var e = 0, r = 0; r < t.length; r += 1)
|
|
5299
5588
|
e += t[r];
|
|
5300
5589
|
return e / t.length;
|
|
5301
5590
|
}
|
|
5302
|
-
function
|
|
5591
|
+
function pi(t) {
|
|
5303
5592
|
for (var e = [], r = [], n = [], a = [], s = [], i = [], u = [], o, l = 0, c = 0, p = 0, h = 0, f = 0, v = 0; v < t.glyphs.length; v += 1) {
|
|
5304
5593
|
var g = t.glyphs.get(v), y = g.unicode | 0;
|
|
5305
5594
|
if (isNaN(g.advanceWidth))
|
|
5306
5595
|
throw new Error("Glyph " + g.name + " (" + v + "): advanceWidth is not a number.");
|
|
5307
5596
|
(o > y || o === void 0) && y > 0 && (o = y), l < y && (l = y);
|
|
5308
|
-
var m =
|
|
5597
|
+
var m = Kt.getUnicodeRange(y);
|
|
5309
5598
|
if (m < 32)
|
|
5310
5599
|
c |= 1 << m;
|
|
5311
5600
|
else if (m < 64)
|
|
@@ -5327,13 +5616,13 @@ function ti(t) {
|
|
|
5327
5616
|
xMax: Math.max.apply(null, n),
|
|
5328
5617
|
yMax: Math.max.apply(null, a),
|
|
5329
5618
|
advanceWidthMax: Math.max.apply(null, s),
|
|
5330
|
-
advanceWidthAvg:
|
|
5619
|
+
advanceWidthAvg: fi(s),
|
|
5331
5620
|
minLeftSideBearing: Math.min.apply(null, i),
|
|
5332
5621
|
maxLeftSideBearing: Math.max.apply(null, i),
|
|
5333
5622
|
minRightSideBearing: Math.min.apply(null, u)
|
|
5334
5623
|
};
|
|
5335
5624
|
x.ascender = t.ascender, x.descender = t.descender;
|
|
5336
|
-
var O =
|
|
5625
|
+
var O = _n.make({
|
|
5337
5626
|
flags: 3,
|
|
5338
5627
|
// 00000011 (baseline for font at y=0; left sidebearing point at x=0)
|
|
5339
5628
|
unitsPerEm: t.unitsPerEm,
|
|
@@ -5343,7 +5632,7 @@ function ti(t) {
|
|
|
5343
5632
|
yMax: x.yMax,
|
|
5344
5633
|
lowestRecPPEM: 3,
|
|
5345
5634
|
createdTimestamp: t.createdTimestamp
|
|
5346
|
-
}), w =
|
|
5635
|
+
}), w = Hn.make({
|
|
5347
5636
|
ascender: x.ascender,
|
|
5348
5637
|
descender: x.descender,
|
|
5349
5638
|
advanceWidthMax: x.advanceWidthMax,
|
|
@@ -5351,7 +5640,7 @@ function ti(t) {
|
|
|
5351
5640
|
minRightSideBearing: x.minRightSideBearing,
|
|
5352
5641
|
xMaxExtent: x.maxLeftSideBearing + (x.xMax - x.xMin),
|
|
5353
5642
|
numberOfHMetrics: t.glyphs.length
|
|
5354
|
-
}), D =
|
|
5643
|
+
}), D = Vn.make(t.glyphs.length), L = Kt.make(Object.assign({
|
|
5355
5644
|
xAvgCharWidth: Math.round(x.advanceWidthAvg),
|
|
5356
5645
|
usFirstCharIndex: o,
|
|
5357
5646
|
usLastCharIndex: l,
|
|
@@ -5370,29 +5659,29 @@ function ti(t) {
|
|
|
5370
5659
|
usWinDescent: Math.abs(x.yMin),
|
|
5371
5660
|
ulCodePageRange1: 1,
|
|
5372
5661
|
// FIXME: hard-code Latin 1 support for now
|
|
5373
|
-
sxHeight:
|
|
5374
|
-
sCapHeight:
|
|
5662
|
+
sxHeight: Pr(t, "xyvw", { yMax: Math.round(x.ascender / 2) }).yMax,
|
|
5663
|
+
sCapHeight: Pr(t, "HIKLEFJMNTZBDPRAGOQSUVWXY", x).yMax,
|
|
5375
5664
|
usDefaultChar: t.hasChar(" ") ? 32 : 0,
|
|
5376
5665
|
// Use space as the default character, if available.
|
|
5377
5666
|
usBreakChar: t.hasChar(" ") ? 32 : 0
|
|
5378
5667
|
// Use space as the break character, if available.
|
|
5379
|
-
}, t.tables.os2)), C =
|
|
5380
|
-
ne || (ne =
|
|
5668
|
+
}, t.tables.os2)), C = zn.make(t.glyphs), N = On.make(t.glyphs), j = t.getEnglishName("fontFamily"), K = t.getEnglishName("fontSubfamily"), re = j + " " + K, ne = t.getEnglishName("postScriptName");
|
|
5669
|
+
ne || (ne = j.replace(/\s/g, "") + "-" + K);
|
|
5381
5670
|
var G = {};
|
|
5382
5671
|
for (var H in t.names)
|
|
5383
5672
|
G[H] = t.names[H];
|
|
5384
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);
|
|
5385
|
-
var V = [], q =
|
|
5674
|
+
var V = [], q = jn.make(G, V), X = V.length > 0 ? Wn.make(V) : void 0, z = Kn.make(), Z = Nn.make(t.glyphs, {
|
|
5386
5675
|
version: t.getEnglishName("version"),
|
|
5387
5676
|
fullName: re,
|
|
5388
|
-
familyName:
|
|
5389
|
-
weightName:
|
|
5677
|
+
familyName: j,
|
|
5678
|
+
weightName: K,
|
|
5390
5679
|
postScriptName: ne,
|
|
5391
5680
|
unitsPerEm: t.unitsPerEm,
|
|
5392
5681
|
fontBBox: [0, x.yMin, x.ascender, x.advanceWidthMax]
|
|
5393
|
-
}), M = t.metas && Object.keys(t.metas).length > 0 ?
|
|
5394
|
-
X && Y.push(X), t.tables.gsub && Y.push(
|
|
5395
|
-
for (var mt =
|
|
5682
|
+
}), M = t.metas && Object.keys(t.metas).length > 0 ? Jn.make(t.metas) : void 0, Y = [O, w, D, L, q, N, z, Z, C];
|
|
5683
|
+
X && Y.push(X), t.tables.gsub && Y.push(Qn.make(t.tables.gsub)), M && Y.push(M);
|
|
5684
|
+
for (var mt = $n(Y), pa = mt.encode(), da = ar(pa), xt = mt.fields, hr = !1, et = 0; et < xt.length; et += 1)
|
|
5396
5685
|
if (xt[et].name === "head table") {
|
|
5397
5686
|
xt[et].value.checkSumAdjustment = 2981146554 - da, hr = !0;
|
|
5398
5687
|
break;
|
|
@@ -5401,8 +5690,8 @@ function ti(t) {
|
|
|
5401
5690
|
throw new Error("Could not find head table with checkSum to adjust.");
|
|
5402
5691
|
return mt;
|
|
5403
5692
|
}
|
|
5404
|
-
var
|
|
5405
|
-
function
|
|
5693
|
+
var di = { make: $n, fontToTable: pi, computeCheckSum: ar };
|
|
5694
|
+
function wt(t, e) {
|
|
5406
5695
|
for (var r = 0, n = t.length - 1; r <= n; ) {
|
|
5407
5696
|
var a = r + n >>> 1, s = t[a].tag;
|
|
5408
5697
|
if (s === e)
|
|
@@ -5411,7 +5700,7 @@ function kt(t, e) {
|
|
|
5411
5700
|
}
|
|
5412
5701
|
return -r - 1;
|
|
5413
5702
|
}
|
|
5414
|
-
function
|
|
5703
|
+
function Ir(t, e) {
|
|
5415
5704
|
for (var r = 0, n = t.length - 1; r <= n; ) {
|
|
5416
5705
|
var a = r + n >>> 1, s = t[a];
|
|
5417
5706
|
if (s === e)
|
|
@@ -5420,7 +5709,7 @@ function Ar(t, e) {
|
|
|
5420
5709
|
}
|
|
5421
5710
|
return -r - 1;
|
|
5422
5711
|
}
|
|
5423
|
-
function
|
|
5712
|
+
function Gr(t, e) {
|
|
5424
5713
|
for (var r, n = 0, a = t.length - 1; n <= a; ) {
|
|
5425
5714
|
var s = n + a >>> 1;
|
|
5426
5715
|
r = t[s];
|
|
@@ -5432,10 +5721,10 @@ function Dr(t, e) {
|
|
|
5432
5721
|
if (n > 0)
|
|
5433
5722
|
return r = t[n - 1], e > r.end ? 0 : r;
|
|
5434
5723
|
}
|
|
5435
|
-
function
|
|
5724
|
+
function je(t, e) {
|
|
5436
5725
|
this.font = t, this.tableName = e;
|
|
5437
5726
|
}
|
|
5438
|
-
|
|
5727
|
+
je.prototype = {
|
|
5439
5728
|
/**
|
|
5440
5729
|
* Binary search an object by "tag" property
|
|
5441
5730
|
* @instance
|
|
@@ -5445,7 +5734,7 @@ Ke.prototype = {
|
|
|
5445
5734
|
* @param {string} tag
|
|
5446
5735
|
* @return {number}
|
|
5447
5736
|
*/
|
|
5448
|
-
searchTag:
|
|
5737
|
+
searchTag: wt,
|
|
5449
5738
|
/**
|
|
5450
5739
|
* Binary search in a list of numbers
|
|
5451
5740
|
* @instance
|
|
@@ -5455,7 +5744,7 @@ Ke.prototype = {
|
|
|
5455
5744
|
* @param {number} value
|
|
5456
5745
|
* @return {number}
|
|
5457
5746
|
*/
|
|
5458
|
-
binSearch:
|
|
5747
|
+
binSearch: Ir,
|
|
5459
5748
|
/**
|
|
5460
5749
|
* Get or create the Layout table (GSUB, GPOS etc).
|
|
5461
5750
|
* @param {boolean} create - Whether to create a new one.
|
|
@@ -5506,7 +5795,7 @@ Ke.prototype = {
|
|
|
5506
5795
|
var r = this.getTable(e);
|
|
5507
5796
|
if (r) {
|
|
5508
5797
|
t = t || "DFLT";
|
|
5509
|
-
var n = r.scripts, a =
|
|
5798
|
+
var n = r.scripts, a = wt(r.scripts, t);
|
|
5510
5799
|
if (a >= 0)
|
|
5511
5800
|
return n[a].script;
|
|
5512
5801
|
if (e) {
|
|
@@ -5534,7 +5823,7 @@ Ke.prototype = {
|
|
|
5534
5823
|
if (n) {
|
|
5535
5824
|
if (!e || e === "dflt" || e === "DFLT")
|
|
5536
5825
|
return n.defaultLangSys;
|
|
5537
|
-
var a =
|
|
5826
|
+
var a = wt(n.langSysRecords, e);
|
|
5538
5827
|
if (a >= 0)
|
|
5539
5828
|
return n.langSysRecords[a].langSys;
|
|
5540
5829
|
if (r) {
|
|
@@ -5610,7 +5899,7 @@ Ke.prototype = {
|
|
|
5610
5899
|
case 1:
|
|
5611
5900
|
return t.startGlyph <= e && e < t.startGlyph + t.classes.length ? t.classes[e - t.startGlyph] : 0;
|
|
5612
5901
|
case 2:
|
|
5613
|
-
var r =
|
|
5902
|
+
var r = Gr(t.ranges, e);
|
|
5614
5903
|
return r ? r.classId : 0;
|
|
5615
5904
|
}
|
|
5616
5905
|
},
|
|
@@ -5624,10 +5913,10 @@ Ke.prototype = {
|
|
|
5624
5913
|
getCoverageIndex: function(t, e) {
|
|
5625
5914
|
switch (t.format) {
|
|
5626
5915
|
case 1:
|
|
5627
|
-
var r =
|
|
5916
|
+
var r = Ir(t.glyphs, e);
|
|
5628
5917
|
return r >= 0 ? r : -1;
|
|
5629
5918
|
case 2:
|
|
5630
|
-
var n =
|
|
5919
|
+
var n = Gr(t.ranges, e);
|
|
5631
5920
|
return n ? n.index + e - n.start : -1;
|
|
5632
5921
|
}
|
|
5633
5922
|
},
|
|
@@ -5648,15 +5937,15 @@ Ke.prototype = {
|
|
|
5648
5937
|
return e;
|
|
5649
5938
|
}
|
|
5650
5939
|
};
|
|
5651
|
-
function
|
|
5652
|
-
|
|
5940
|
+
function Ke(t) {
|
|
5941
|
+
je.call(this, t, "gpos");
|
|
5653
5942
|
}
|
|
5654
|
-
|
|
5655
|
-
|
|
5943
|
+
Ke.prototype = je.prototype;
|
|
5944
|
+
Ke.prototype.init = function() {
|
|
5656
5945
|
var t = this.getDefaultScriptName();
|
|
5657
5946
|
this.defaultKerningTables = this.getKerningTables(t);
|
|
5658
5947
|
};
|
|
5659
|
-
|
|
5948
|
+
Ke.prototype.getKerningValue = function(t, e, r) {
|
|
5660
5949
|
for (var n = 0; n < t.length; n++)
|
|
5661
5950
|
for (var a = t[n].subtables, s = 0; s < a.length; s++) {
|
|
5662
5951
|
var i = a[s], u = this.getCoverageIndex(i.coverage, e);
|
|
@@ -5676,14 +5965,14 @@ je.prototype.getKerningValue = function(t, e, r) {
|
|
|
5676
5965
|
}
|
|
5677
5966
|
return 0;
|
|
5678
5967
|
};
|
|
5679
|
-
|
|
5968
|
+
Ke.prototype.getKerningTables = function(t, e) {
|
|
5680
5969
|
if (this.font.tables.gpos)
|
|
5681
5970
|
return this.getLookupTables(t, e, "kern", 2);
|
|
5682
5971
|
};
|
|
5683
5972
|
function ee(t) {
|
|
5684
|
-
|
|
5973
|
+
je.call(this, t, "gsub");
|
|
5685
5974
|
}
|
|
5686
|
-
function
|
|
5975
|
+
function vi(t, e) {
|
|
5687
5976
|
var r = t.length;
|
|
5688
5977
|
if (r !== e.length)
|
|
5689
5978
|
return !1;
|
|
@@ -5701,7 +5990,7 @@ function sr(t, e, r) {
|
|
|
5701
5990
|
if (r)
|
|
5702
5991
|
return n.push(r), r;
|
|
5703
5992
|
}
|
|
5704
|
-
ee.prototype =
|
|
5993
|
+
ee.prototype = je.prototype;
|
|
5705
5994
|
ee.prototype.createDefaultTable = function() {
|
|
5706
5995
|
return {
|
|
5707
5996
|
version: 1,
|
|
@@ -5813,7 +6102,7 @@ ee.prototype.addLigature = function(t, e, r, n) {
|
|
|
5813
6102
|
}, l = this.binSearch(s.coverage.glyphs, i);
|
|
5814
6103
|
if (l >= 0) {
|
|
5815
6104
|
for (var c = s.ligatureSets[l], p = 0; p < c.length; p++)
|
|
5816
|
-
if (
|
|
6105
|
+
if (vi(c[p].components, u))
|
|
5817
6106
|
return;
|
|
5818
6107
|
c.push(o);
|
|
5819
6108
|
} else
|
|
@@ -5851,23 +6140,23 @@ ee.prototype.add = function(t, e, r, n) {
|
|
|
5851
6140
|
return e.by instanceof Array ? this.addMultiple(t, e, r, n) : this.addLigature(t, e, r, n);
|
|
5852
6141
|
}
|
|
5853
6142
|
};
|
|
5854
|
-
function
|
|
6143
|
+
function gi() {
|
|
5855
6144
|
return typeof window < "u";
|
|
5856
6145
|
}
|
|
5857
|
-
function
|
|
6146
|
+
function yi(t) {
|
|
5858
6147
|
for (var e = new Buffer(t.byteLength), r = new Uint8Array(t), n = 0; n < e.length; ++n)
|
|
5859
6148
|
e[n] = r[n];
|
|
5860
6149
|
return e;
|
|
5861
6150
|
}
|
|
5862
|
-
function
|
|
6151
|
+
function Ne(t, e) {
|
|
5863
6152
|
if (!t)
|
|
5864
6153
|
throw e;
|
|
5865
6154
|
}
|
|
5866
|
-
function
|
|
6155
|
+
function Nr(t, e, r, n, a) {
|
|
5867
6156
|
var s;
|
|
5868
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;
|
|
5869
6158
|
}
|
|
5870
|
-
function
|
|
6159
|
+
function ea(t, e, r) {
|
|
5871
6160
|
var n = new F.Parser(e, r);
|
|
5872
6161
|
t.numberOfContours = n.parseShort(), t._xMin = n.parseShort(), t._yMin = n.parseShort(), t._xMax = n.parseShort(), t._yMax = n.parseShort();
|
|
5873
6162
|
var a, s;
|
|
@@ -5889,9 +6178,9 @@ function Jn(t, e, r) {
|
|
|
5889
6178
|
for (var g = 0; g < l; g += 1)
|
|
5890
6179
|
s = a[g], v = {}, v.onCurve = !!(s & 1), v.lastPointOfContour = i.indexOf(g) >= 0, f.push(v);
|
|
5891
6180
|
for (var y = 0, m = 0; m < l; m += 1)
|
|
5892
|
-
s = a[m], v = f[m], v.x =
|
|
6181
|
+
s = a[m], v = f[m], v.x = Nr(n, s, y, 2, 16), y = v.x;
|
|
5893
6182
|
for (var S = 0, x = 0; x < l; x += 1)
|
|
5894
|
-
s = a[x], v = f[x], v.y =
|
|
6183
|
+
s = a[x], v = f[x], v.y = Nr(n, s, S, 4, 32), S = v.y;
|
|
5895
6184
|
}
|
|
5896
6185
|
t.points = f;
|
|
5897
6186
|
} else
|
|
@@ -5920,7 +6209,7 @@ function Jn(t, e, r) {
|
|
|
5920
6209
|
}
|
|
5921
6210
|
}
|
|
5922
6211
|
}
|
|
5923
|
-
function
|
|
6212
|
+
function Ct(t, e) {
|
|
5924
6213
|
for (var r = [], n = 0; n < t.length; n += 1) {
|
|
5925
6214
|
var a = t[n], s = {
|
|
5926
6215
|
x: e.xScale * a.x + e.scale01 * a.y + e.dx,
|
|
@@ -5932,18 +6221,18 @@ function Tt(t, e) {
|
|
|
5932
6221
|
}
|
|
5933
6222
|
return r;
|
|
5934
6223
|
}
|
|
5935
|
-
function
|
|
6224
|
+
function mi(t) {
|
|
5936
6225
|
for (var e = [], r = [], n = 0; n < t.length; n += 1) {
|
|
5937
6226
|
var a = t[n];
|
|
5938
6227
|
r.push(a), a.lastPointOfContour && (e.push(r), r = []);
|
|
5939
6228
|
}
|
|
5940
6229
|
return E.argument(r.length === 0, "There are still points left in the current contour."), e;
|
|
5941
6230
|
}
|
|
5942
|
-
function
|
|
6231
|
+
function ta(t) {
|
|
5943
6232
|
var e = new _();
|
|
5944
6233
|
if (!t)
|
|
5945
6234
|
return e;
|
|
5946
|
-
for (var r =
|
|
6235
|
+
for (var r = mi(t), n = 0; n < r.length; ++n) {
|
|
5947
6236
|
var a = r[n], s = null, i = a[a.length - 1], u = a[0];
|
|
5948
6237
|
if (i.onCurve)
|
|
5949
6238
|
e.moveTo(i.x, i.y);
|
|
@@ -5964,14 +6253,14 @@ function $n(t) {
|
|
|
5964
6253
|
}
|
|
5965
6254
|
return e;
|
|
5966
6255
|
}
|
|
5967
|
-
function
|
|
6256
|
+
function ra(t, e) {
|
|
5968
6257
|
if (e.isComposite)
|
|
5969
6258
|
for (var r = 0; r < e.components.length; r += 1) {
|
|
5970
6259
|
var n = e.components[r], a = t.get(n.glyphIndex);
|
|
5971
6260
|
if (a.getPath(), a.points) {
|
|
5972
6261
|
var s = void 0;
|
|
5973
6262
|
if (n.matchedPoints === void 0)
|
|
5974
|
-
s =
|
|
6263
|
+
s = Ct(a.points, n);
|
|
5975
6264
|
else {
|
|
5976
6265
|
if (n.matchedPoints[0] > e.points.length - 1 || n.matchedPoints[1] > a.points.length - 1)
|
|
5977
6266
|
throw Error("Matched points out of range in " + e.name);
|
|
@@ -5983,55 +6272,55 @@ function ea(t, e) {
|
|
|
5983
6272
|
dx: 0,
|
|
5984
6273
|
dy: 0
|
|
5985
6274
|
};
|
|
5986
|
-
u =
|
|
6275
|
+
u = Ct([u], o)[0], o.dx = i.x - u.x, o.dy = i.y - u.y, s = Ct(a.points, o);
|
|
5987
6276
|
}
|
|
5988
6277
|
e.points = e.points.concat(s);
|
|
5989
6278
|
}
|
|
5990
6279
|
}
|
|
5991
|
-
return
|
|
6280
|
+
return ta(e.points);
|
|
5992
6281
|
}
|
|
5993
|
-
function
|
|
6282
|
+
function xi(t, e, r, n) {
|
|
5994
6283
|
for (var a = new de.GlyphSet(n), s = 0; s < r.length - 1; s += 1) {
|
|
5995
6284
|
var i = r[s], u = r[s + 1];
|
|
5996
|
-
i !== u ? a.push(s, de.ttfGlyphLoader(n, s,
|
|
6285
|
+
i !== u ? a.push(s, de.ttfGlyphLoader(n, s, ea, t, e + i, ra)) : a.push(s, de.glyphLoader(n, s));
|
|
5997
6286
|
}
|
|
5998
6287
|
return a;
|
|
5999
6288
|
}
|
|
6000
|
-
function
|
|
6289
|
+
function bi(t, e, r, n) {
|
|
6001
6290
|
var a = new de.GlyphSet(n);
|
|
6002
6291
|
return n._push = function(s) {
|
|
6003
6292
|
var i = r[s], u = r[s + 1];
|
|
6004
|
-
i !== u ? a.push(s, de.ttfGlyphLoader(n, s,
|
|
6293
|
+
i !== u ? a.push(s, de.ttfGlyphLoader(n, s, ea, t, e + i, ra)) : a.push(s, de.glyphLoader(n, s));
|
|
6005
6294
|
}, a;
|
|
6006
6295
|
}
|
|
6007
|
-
function
|
|
6008
|
-
return a.lowMemory ?
|
|
6296
|
+
function Si(t, e, r, n, a) {
|
|
6297
|
+
return a.lowMemory ? bi(t, e, r, n) : xi(t, e, r, n);
|
|
6009
6298
|
}
|
|
6010
|
-
var
|
|
6011
|
-
function
|
|
6299
|
+
var na = { getPath: ta, parse: Si }, aa, Le, sa, Qt;
|
|
6300
|
+
function ia(t) {
|
|
6012
6301
|
this.font = t, this.getCommands = function(e) {
|
|
6013
|
-
return
|
|
6302
|
+
return na.getPath(e).commands;
|
|
6014
6303
|
}, this._fpgmState = this._prepState = void 0, this._errorState = 0;
|
|
6015
6304
|
}
|
|
6016
|
-
function
|
|
6305
|
+
function ki(t) {
|
|
6017
6306
|
return t;
|
|
6018
6307
|
}
|
|
6019
|
-
function
|
|
6308
|
+
function oa(t) {
|
|
6020
6309
|
return Math.sign(t) * Math.round(Math.abs(t));
|
|
6021
6310
|
}
|
|
6022
|
-
function
|
|
6311
|
+
function Ti(t) {
|
|
6023
6312
|
return Math.sign(t) * Math.round(Math.abs(t * 2)) / 2;
|
|
6024
6313
|
}
|
|
6025
|
-
function
|
|
6314
|
+
function Fi(t) {
|
|
6026
6315
|
return Math.sign(t) * (Math.round(Math.abs(t) + 0.5) - 0.5);
|
|
6027
6316
|
}
|
|
6028
|
-
function
|
|
6317
|
+
function wi(t) {
|
|
6029
6318
|
return Math.sign(t) * Math.ceil(Math.abs(t));
|
|
6030
6319
|
}
|
|
6031
|
-
function
|
|
6320
|
+
function Ci(t) {
|
|
6032
6321
|
return Math.sign(t) * Math.floor(Math.abs(t));
|
|
6033
6322
|
}
|
|
6034
|
-
var
|
|
6323
|
+
var ua = function(t) {
|
|
6035
6324
|
var e = this.srPeriod, r = this.srPhase, n = this.srThreshold, a = 1;
|
|
6036
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;
|
|
6037
6326
|
}, pe = {
|
|
@@ -6204,7 +6493,7 @@ ge.prototype.prevTouched = function(t) {
|
|
|
6204
6493
|
e = e.prevPointOnContour;
|
|
6205
6494
|
return e;
|
|
6206
6495
|
};
|
|
6207
|
-
var Xe = Object.freeze(new ge(0, 0)),
|
|
6496
|
+
var Xe = Object.freeze(new ge(0, 0)), Ei = {
|
|
6208
6497
|
cvCutIn: 17 / 16,
|
|
6209
6498
|
// control value cut in
|
|
6210
6499
|
deltaBase: 9,
|
|
@@ -6220,10 +6509,10 @@ function be(t, e) {
|
|
|
6220
6509
|
case "glyf":
|
|
6221
6510
|
this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
|
|
6222
6511
|
case "prep":
|
|
6223
|
-
this.fv = this.pv = this.dpv = pe, this.round =
|
|
6512
|
+
this.fv = this.pv = this.dpv = pe, this.round = oa;
|
|
6224
6513
|
}
|
|
6225
6514
|
}
|
|
6226
|
-
|
|
6515
|
+
ia.prototype.exec = function(t, e) {
|
|
6227
6516
|
if (typeof e != "number")
|
|
6228
6517
|
throw new Error("Point size is not a number!");
|
|
6229
6518
|
if (!(this._errorState > 2)) {
|
|
@@ -6231,7 +6520,7 @@ aa.prototype.exec = function(t, e) {
|
|
|
6231
6520
|
if (!n || n.ppem !== e) {
|
|
6232
6521
|
var a = this._fpgmState;
|
|
6233
6522
|
if (!a) {
|
|
6234
|
-
be.prototype =
|
|
6523
|
+
be.prototype = Ei, a = this._fpgmState = new be("fpgm", r.tables.fpgm), a.funcs = [], a.font = r, exports.DEBUG && (console.log("---EXEC FPGM---"), a.step = -1);
|
|
6235
6524
|
try {
|
|
6236
6525
|
Le(a);
|
|
6237
6526
|
} catch (l) {
|
|
@@ -6255,23 +6544,23 @@ aa.prototype.exec = function(t, e) {
|
|
|
6255
6544
|
}
|
|
6256
6545
|
if (!(this._errorState > 1))
|
|
6257
6546
|
try {
|
|
6258
|
-
return
|
|
6547
|
+
return sa(t, n);
|
|
6259
6548
|
} catch (l) {
|
|
6260
6549
|
this._errorState < 1 && (console.log("Hinting error:" + l), console.log("Note: further hinting errors are silenced")), this._errorState = 1;
|
|
6261
6550
|
return;
|
|
6262
6551
|
}
|
|
6263
6552
|
}
|
|
6264
6553
|
};
|
|
6265
|
-
|
|
6554
|
+
sa = function(t, e) {
|
|
6266
6555
|
var r = e.ppem / e.font.unitsPerEm, n = r, a = t.components, s, i, u;
|
|
6267
6556
|
if (be.prototype = e, !a)
|
|
6268
|
-
u = new be("glyf", t.instructions), exports.DEBUG && (console.log("---EXEC GLYPH---"), u.step = -1),
|
|
6557
|
+
u = new be("glyf", t.instructions), exports.DEBUG && (console.log("---EXEC GLYPH---"), u.step = -1), Qt(t, u, r, n), i = u.gZone;
|
|
6269
6558
|
else {
|
|
6270
6559
|
var o = e.font;
|
|
6271
6560
|
i = [], s = [];
|
|
6272
6561
|
for (var l = 0; l < a.length; l++) {
|
|
6273
6562
|
var c = a[l], p = o.glyphs.get(c.glyphIndex);
|
|
6274
|
-
u = new be("glyf", p.instructions), exports.DEBUG && (console.log("---EXEC COMP " + l + "---"), u.step = -1),
|
|
6563
|
+
u = new be("glyf", p.instructions), exports.DEBUG && (console.log("---EXEC COMP " + l + "---"), u.step = -1), Qt(p, u, r, n);
|
|
6275
6564
|
for (var h = Math.round(c.dx * r), f = Math.round(c.dy * n), v = u.gZone, g = u.contours, y = 0; y < v.length; y++) {
|
|
6276
6565
|
var m = v[y];
|
|
6277
6566
|
m.xTouched = m.yTouched = !1, m.xo = m.x = m.x + h, m.yo = m.y = m.y + f;
|
|
@@ -6288,7 +6577,7 @@ na = function(t, e) {
|
|
|
6288
6577
|
}
|
|
6289
6578
|
return i;
|
|
6290
6579
|
};
|
|
6291
|
-
|
|
6580
|
+
Qt = function(t, e, r, n) {
|
|
6292
6581
|
for (var a = t.points || [], s = a.length, i = e.gZone = e.z0 = e.z1 = e.z2 = [], u = e.contours = [], o, l = 0; l < s; l++)
|
|
6293
6582
|
o = a[l], i[l] = new ge(
|
|
6294
6583
|
o.x * r,
|
|
@@ -6319,7 +6608,7 @@ Le = function(t) {
|
|
|
6319
6608
|
if (e) {
|
|
6320
6609
|
var r = e.length, n;
|
|
6321
6610
|
for (t.ip = 0; t.ip < r; t.ip++) {
|
|
6322
|
-
if (exports.DEBUG && t.step++, n =
|
|
6611
|
+
if (exports.DEBUG && t.step++, n = aa[e[t.ip]], !n)
|
|
6323
6612
|
throw new Error(
|
|
6324
6613
|
"unknown instruction: 0x" + Number(e[t.ip]).toString(16)
|
|
6325
6614
|
);
|
|
@@ -6327,11 +6616,11 @@ Le = function(t) {
|
|
|
6327
6616
|
}
|
|
6328
6617
|
}
|
|
6329
6618
|
};
|
|
6330
|
-
function
|
|
6619
|
+
function vt(t) {
|
|
6331
6620
|
for (var e = t.tZone = new Array(t.gZone.length), r = 0; r < e.length; r++)
|
|
6332
6621
|
e[r] = new ge(0, 0);
|
|
6333
6622
|
}
|
|
6334
|
-
function
|
|
6623
|
+
function la(t, e) {
|
|
6335
6624
|
var r = t.prog, n = t.ip, a = 1, s;
|
|
6336
6625
|
do
|
|
6337
6626
|
if (s = r[++n], s === 88)
|
|
@@ -6351,66 +6640,66 @@ function oa(t, e) {
|
|
|
6351
6640
|
while (a > 0);
|
|
6352
6641
|
t.ip = n;
|
|
6353
6642
|
}
|
|
6354
|
-
function
|
|
6643
|
+
function _r(t, e) {
|
|
6355
6644
|
exports.DEBUG && console.log(e.step, "SVTCA[" + t.axis + "]"), e.fv = e.pv = e.dpv = t;
|
|
6356
6645
|
}
|
|
6357
|
-
function
|
|
6646
|
+
function Hr(t, e) {
|
|
6358
6647
|
exports.DEBUG && console.log(e.step, "SPVTCA[" + t.axis + "]"), e.pv = e.dpv = t;
|
|
6359
6648
|
}
|
|
6360
|
-
function
|
|
6649
|
+
function zr(t, e) {
|
|
6361
6650
|
exports.DEBUG && console.log(e.step, "SFVTCA[" + t.axis + "]"), e.fv = t;
|
|
6362
6651
|
}
|
|
6363
|
-
function
|
|
6652
|
+
function Wr(t, e) {
|
|
6364
6653
|
var r = e.stack, n = r.pop(), a = r.pop(), s = e.z2[n], i = e.z1[a];
|
|
6365
6654
|
exports.DEBUG && console.log("SPVTL[" + t + "]", n, a);
|
|
6366
6655
|
var u, o;
|
|
6367
6656
|
t ? (u = s.y - i.y, o = i.x - s.x) : (u = i.x - s.x, o = i.y - s.y), e.pv = e.dpv = Je(u, o);
|
|
6368
6657
|
}
|
|
6369
|
-
function
|
|
6658
|
+
function Vr(t, e) {
|
|
6370
6659
|
var r = e.stack, n = r.pop(), a = r.pop(), s = e.z2[n], i = e.z1[a];
|
|
6371
6660
|
exports.DEBUG && console.log("SFVTL[" + t + "]", n, a);
|
|
6372
6661
|
var u, o;
|
|
6373
6662
|
t ? (u = s.y - i.y, o = i.x - s.x) : (u = i.x - s.x, o = i.y - s.y), e.fv = Je(u, o);
|
|
6374
6663
|
}
|
|
6375
|
-
function
|
|
6664
|
+
function Oi(t) {
|
|
6376
6665
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6377
6666
|
exports.DEBUG && console.log(t.step, "SPVFS[]", r, n), t.pv = t.dpv = Je(n, r);
|
|
6378
6667
|
}
|
|
6379
|
-
function
|
|
6668
|
+
function Ui(t) {
|
|
6380
6669
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6381
6670
|
exports.DEBUG && console.log(t.step, "SPVFS[]", r, n), t.fv = Je(n, r);
|
|
6382
6671
|
}
|
|
6383
|
-
function
|
|
6672
|
+
function Li(t) {
|
|
6384
6673
|
var e = t.stack, r = t.pv;
|
|
6385
6674
|
exports.DEBUG && console.log(t.step, "GPV[]"), e.push(r.x * 16384), e.push(r.y * 16384);
|
|
6386
6675
|
}
|
|
6387
|
-
function
|
|
6676
|
+
function Ri(t) {
|
|
6388
6677
|
var e = t.stack, r = t.fv;
|
|
6389
6678
|
exports.DEBUG && console.log(t.step, "GFV[]"), e.push(r.x * 16384), e.push(r.y * 16384);
|
|
6390
6679
|
}
|
|
6391
|
-
function
|
|
6680
|
+
function Ai(t) {
|
|
6392
6681
|
t.fv = t.pv, exports.DEBUG && console.log(t.step, "SFVTPV[]");
|
|
6393
6682
|
}
|
|
6394
|
-
function
|
|
6683
|
+
function Di(t) {
|
|
6395
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];
|
|
6396
6685
|
exports.DEBUG && console.log("ISECT[], ", r, n, a, s, i);
|
|
6397
6686
|
var v = l.x, g = l.y, y = c.x, m = c.y, S = p.x, x = p.y, O = h.x, w = h.y, D = (v - y) * (x - w) - (g - m) * (S - O), L = v * m - g * y, C = S * w - x * O;
|
|
6398
6687
|
f.x = (L * (S - O) - C * (v - y)) / D, f.y = (L * (x - w) - C * (g - m)) / D;
|
|
6399
6688
|
}
|
|
6400
|
-
function
|
|
6689
|
+
function Mi(t) {
|
|
6401
6690
|
t.rp0 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP0[]", t.rp0);
|
|
6402
6691
|
}
|
|
6403
|
-
function
|
|
6692
|
+
function Bi(t) {
|
|
6404
6693
|
t.rp1 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP1[]", t.rp1);
|
|
6405
6694
|
}
|
|
6406
|
-
function
|
|
6695
|
+
function Pi(t) {
|
|
6407
6696
|
t.rp2 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP2[]", t.rp2);
|
|
6408
6697
|
}
|
|
6409
|
-
function
|
|
6698
|
+
function Ii(t) {
|
|
6410
6699
|
var e = t.stack.pop();
|
|
6411
6700
|
switch (exports.DEBUG && console.log(t.step, "SZP0[]", e), t.zp0 = e, e) {
|
|
6412
6701
|
case 0:
|
|
6413
|
-
t.tZone ||
|
|
6702
|
+
t.tZone || vt(t), t.z0 = t.tZone;
|
|
6414
6703
|
break;
|
|
6415
6704
|
case 1:
|
|
6416
6705
|
t.z0 = t.gZone;
|
|
@@ -6419,11 +6708,11 @@ function wi(t) {
|
|
|
6419
6708
|
throw new Error("Invalid zone pointer");
|
|
6420
6709
|
}
|
|
6421
6710
|
}
|
|
6422
|
-
function
|
|
6711
|
+
function Gi(t) {
|
|
6423
6712
|
var e = t.stack.pop();
|
|
6424
6713
|
switch (exports.DEBUG && console.log(t.step, "SZP1[]", e), t.zp1 = e, e) {
|
|
6425
6714
|
case 0:
|
|
6426
|
-
t.tZone ||
|
|
6715
|
+
t.tZone || vt(t), t.z1 = t.tZone;
|
|
6427
6716
|
break;
|
|
6428
6717
|
case 1:
|
|
6429
6718
|
t.z1 = t.gZone;
|
|
@@ -6432,11 +6721,11 @@ function Ci(t) {
|
|
|
6432
6721
|
throw new Error("Invalid zone pointer");
|
|
6433
6722
|
}
|
|
6434
6723
|
}
|
|
6435
|
-
function
|
|
6724
|
+
function Ni(t) {
|
|
6436
6725
|
var e = t.stack.pop();
|
|
6437
6726
|
switch (exports.DEBUG && console.log(t.step, "SZP2[]", e), t.zp2 = e, e) {
|
|
6438
6727
|
case 0:
|
|
6439
|
-
t.tZone ||
|
|
6728
|
+
t.tZone || vt(t), t.z2 = t.tZone;
|
|
6440
6729
|
break;
|
|
6441
6730
|
case 1:
|
|
6442
6731
|
t.z2 = t.gZone;
|
|
@@ -6445,11 +6734,11 @@ function Ei(t) {
|
|
|
6445
6734
|
throw new Error("Invalid zone pointer");
|
|
6446
6735
|
}
|
|
6447
6736
|
}
|
|
6448
|
-
function
|
|
6737
|
+
function _i(t) {
|
|
6449
6738
|
var e = t.stack.pop();
|
|
6450
6739
|
switch (exports.DEBUG && console.log(t.step, "SZPS[]", e), t.zp0 = t.zp1 = t.zp2 = e, e) {
|
|
6451
6740
|
case 0:
|
|
6452
|
-
t.tZone ||
|
|
6741
|
+
t.tZone || vt(t), t.z0 = t.z1 = t.z2 = t.tZone;
|
|
6453
6742
|
break;
|
|
6454
6743
|
case 1:
|
|
6455
6744
|
t.z0 = t.z1 = t.z2 = t.gZone;
|
|
@@ -6458,49 +6747,49 @@ function Oi(t) {
|
|
|
6458
6747
|
throw new Error("Invalid zone pointer");
|
|
6459
6748
|
}
|
|
6460
6749
|
}
|
|
6461
|
-
function
|
|
6750
|
+
function Hi(t) {
|
|
6462
6751
|
t.loop = t.stack.pop(), exports.DEBUG && console.log(t.step, "SLOOP[]", t.loop);
|
|
6463
6752
|
}
|
|
6464
|
-
function
|
|
6465
|
-
exports.DEBUG && console.log(t.step, "RTG[]"), t.round =
|
|
6753
|
+
function zi(t) {
|
|
6754
|
+
exports.DEBUG && console.log(t.step, "RTG[]"), t.round = oa;
|
|
6466
6755
|
}
|
|
6467
|
-
function
|
|
6468
|
-
exports.DEBUG && console.log(t.step, "RTHG[]"), t.round =
|
|
6756
|
+
function Wi(t) {
|
|
6757
|
+
exports.DEBUG && console.log(t.step, "RTHG[]"), t.round = Fi;
|
|
6469
6758
|
}
|
|
6470
|
-
function
|
|
6759
|
+
function Vi(t) {
|
|
6471
6760
|
var e = t.stack.pop();
|
|
6472
6761
|
exports.DEBUG && console.log(t.step, "SMD[]", e), t.minDis = e / 64;
|
|
6473
6762
|
}
|
|
6474
|
-
function
|
|
6475
|
-
exports.DEBUG && console.log(t.step, "ELSE[]"),
|
|
6763
|
+
function qi(t) {
|
|
6764
|
+
exports.DEBUG && console.log(t.step, "ELSE[]"), la(t, !1);
|
|
6476
6765
|
}
|
|
6477
|
-
function
|
|
6766
|
+
function Xi(t) {
|
|
6478
6767
|
var e = t.stack.pop();
|
|
6479
6768
|
exports.DEBUG && console.log(t.step, "JMPR[]", e), t.ip += e - 1;
|
|
6480
6769
|
}
|
|
6481
|
-
function
|
|
6770
|
+
function Yi(t) {
|
|
6482
6771
|
var e = t.stack.pop();
|
|
6483
6772
|
exports.DEBUG && console.log(t.step, "SCVTCI[]", e), t.cvCutIn = e / 64;
|
|
6484
6773
|
}
|
|
6485
|
-
function
|
|
6774
|
+
function Zi(t) {
|
|
6486
6775
|
var e = t.stack;
|
|
6487
6776
|
exports.DEBUG && console.log(t.step, "DUP[]"), e.push(e[e.length - 1]);
|
|
6488
6777
|
}
|
|
6489
|
-
function
|
|
6778
|
+
function Et(t) {
|
|
6490
6779
|
exports.DEBUG && console.log(t.step, "POP[]"), t.stack.pop();
|
|
6491
6780
|
}
|
|
6492
|
-
function
|
|
6781
|
+
function ji(t) {
|
|
6493
6782
|
exports.DEBUG && console.log(t.step, "CLEAR[]"), t.stack.length = 0;
|
|
6494
6783
|
}
|
|
6495
|
-
function
|
|
6784
|
+
function Ki(t) {
|
|
6496
6785
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6497
6786
|
exports.DEBUG && console.log(t.step, "SWAP[]"), e.push(r), e.push(n);
|
|
6498
6787
|
}
|
|
6499
|
-
function
|
|
6788
|
+
function Qi(t) {
|
|
6500
6789
|
var e = t.stack;
|
|
6501
6790
|
exports.DEBUG && console.log(t.step, "DEPTH[]"), e.push(e.length);
|
|
6502
6791
|
}
|
|
6503
|
-
function
|
|
6792
|
+
function Ji(t) {
|
|
6504
6793
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6505
6794
|
exports.DEBUG && console.log(t.step, "LOOPCALL[]", r, n);
|
|
6506
6795
|
var a = t.ip, s = t.prog;
|
|
@@ -6513,21 +6802,21 @@ function _i(t) {
|
|
|
6513
6802
|
);
|
|
6514
6803
|
t.ip = a, t.prog = s;
|
|
6515
6804
|
}
|
|
6516
|
-
function
|
|
6805
|
+
function $i(t) {
|
|
6517
6806
|
var e = t.stack.pop();
|
|
6518
6807
|
exports.DEBUG && console.log(t.step, "CALL[]", e);
|
|
6519
6808
|
var r = t.ip, n = t.prog;
|
|
6520
6809
|
t.prog = t.funcs[e], Le(t), t.ip = r, t.prog = n, exports.DEBUG && console.log(++t.step, "returning from", e);
|
|
6521
6810
|
}
|
|
6522
|
-
function
|
|
6811
|
+
function eo(t) {
|
|
6523
6812
|
var e = t.stack, r = e.pop();
|
|
6524
6813
|
exports.DEBUG && console.log(t.step, "CINDEX[]", r), e.push(e[e.length - r]);
|
|
6525
6814
|
}
|
|
6526
|
-
function
|
|
6815
|
+
function to(t) {
|
|
6527
6816
|
var e = t.stack, r = e.pop();
|
|
6528
6817
|
exports.DEBUG && console.log(t.step, "MINDEX[]", r), e.push(e.splice(e.length - r, 1)[0]);
|
|
6529
6818
|
}
|
|
6530
|
-
function
|
|
6819
|
+
function ro(t) {
|
|
6531
6820
|
if (t.env !== "fpgm")
|
|
6532
6821
|
throw new Error("FDEF not allowed here");
|
|
6533
6822
|
var e = t.stack, r = t.prog, n = t.ip, a = e.pop(), s = n;
|
|
@@ -6535,19 +6824,19 @@ function Vi(t) {
|
|
|
6535
6824
|
;
|
|
6536
6825
|
t.ip = n, t.funcs[a] = r.slice(s + 1, n);
|
|
6537
6826
|
}
|
|
6538
|
-
function
|
|
6827
|
+
function qr(t, e) {
|
|
6539
6828
|
var r = e.stack.pop(), n = e.z0[r], a = e.fv, s = e.pv;
|
|
6540
6829
|
exports.DEBUG && console.log(e.step, "MDAP[" + t + "]", r);
|
|
6541
6830
|
var i = s.distance(n, Xe);
|
|
6542
6831
|
t && (i = e.round(i)), a.setRelative(n, Xe, i, s), a.touch(n), e.rp0 = e.rp1 = r;
|
|
6543
6832
|
}
|
|
6544
|
-
function
|
|
6833
|
+
function Xr(t, e) {
|
|
6545
6834
|
var r = e.z2, n = r.length - 2, a, s, i;
|
|
6546
6835
|
exports.DEBUG && console.log(e.step, "IUP[" + t.axis + "]");
|
|
6547
6836
|
for (var u = 0; u < n; u++)
|
|
6548
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)));
|
|
6549
6838
|
}
|
|
6550
|
-
function
|
|
6839
|
+
function Yr(t, e) {
|
|
6551
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--; ) {
|
|
6552
6841
|
var l = r.pop(), c = o[l], p = i.distance(a, a, !1, !0);
|
|
6553
6842
|
s.setRelative(c, c, p, i), s.touch(c), exports.DEBUG && console.log(
|
|
@@ -6558,7 +6847,7 @@ function zr(t, e) {
|
|
|
6558
6847
|
}
|
|
6559
6848
|
e.loop = 1;
|
|
6560
6849
|
}
|
|
6561
|
-
function
|
|
6850
|
+
function Zr(t, e) {
|
|
6562
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;
|
|
6563
6852
|
exports.DEBUG && console.log(e.step, "SHC[" + t + "]", u);
|
|
6564
6853
|
var c = i.distance(a, a, !1, !0);
|
|
@@ -6566,7 +6855,7 @@ function Wr(t, e) {
|
|
|
6566
6855
|
l !== a && s.setRelative(l, l, c, i), l = l.nextPointOnContour;
|
|
6567
6856
|
while (l !== o);
|
|
6568
6857
|
}
|
|
6569
|
-
function
|
|
6858
|
+
function jr(t, e) {
|
|
6570
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();
|
|
6571
6860
|
exports.DEBUG && console.log(e.step, "SHZ[" + t + "]", u);
|
|
6572
6861
|
var o;
|
|
@@ -6583,7 +6872,7 @@ function Vr(t, e) {
|
|
|
6583
6872
|
for (var l, c = i.distance(a, a, !1, !0), p = o.length - 2, h = 0; h < p; h++)
|
|
6584
6873
|
l = o[h], s.setRelative(l, l, c, i);
|
|
6585
6874
|
}
|
|
6586
|
-
function
|
|
6875
|
+
function no(t) {
|
|
6587
6876
|
for (var e = t.stack, r = t.loop, n = t.fv, a = e.pop() / 64, s = t.z2; r--; ) {
|
|
6588
6877
|
var i = e.pop(), u = s[i];
|
|
6589
6878
|
exports.DEBUG && console.log(
|
|
@@ -6595,7 +6884,7 @@ function qi(t) {
|
|
|
6595
6884
|
}
|
|
6596
6885
|
t.loop = 1;
|
|
6597
6886
|
}
|
|
6598
|
-
function
|
|
6887
|
+
function ao(t) {
|
|
6599
6888
|
for (var e = t.stack, r = t.rp1, n = t.rp2, a = t.loop, s = t.z0[r], i = t.z1[n], u = t.fv, o = t.dpv, l = t.z2; a--; ) {
|
|
6600
6889
|
var c = e.pop(), p = l[c];
|
|
6601
6890
|
exports.DEBUG && console.log(
|
|
@@ -6609,11 +6898,11 @@ function Xi(t) {
|
|
|
6609
6898
|
}
|
|
6610
6899
|
t.loop = 1;
|
|
6611
6900
|
}
|
|
6612
|
-
function
|
|
6901
|
+
function Kr(t, e) {
|
|
6613
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;
|
|
6614
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);
|
|
6615
6904
|
}
|
|
6616
|
-
function
|
|
6905
|
+
function so(t) {
|
|
6617
6906
|
for (var e = t.stack, r = t.rp0, n = t.z0[r], a = t.loop, s = t.fv, i = t.pv, u = t.z1; a--; ) {
|
|
6618
6907
|
var o = e.pop(), l = u[o];
|
|
6619
6908
|
exports.DEBUG && console.log(
|
|
@@ -6624,10 +6913,10 @@ function Yi(t) {
|
|
|
6624
6913
|
}
|
|
6625
6914
|
t.loop = 1;
|
|
6626
6915
|
}
|
|
6627
|
-
function
|
|
6628
|
-
exports.DEBUG && console.log(t.step, "RTDG[]"), t.round =
|
|
6916
|
+
function io(t) {
|
|
6917
|
+
exports.DEBUG && console.log(t.step, "RTDG[]"), t.round = Ti;
|
|
6629
6918
|
}
|
|
6630
|
-
function
|
|
6919
|
+
function Qr(t, e) {
|
|
6631
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];
|
|
6632
6921
|
exports.DEBUG && console.log(
|
|
6633
6922
|
e.step,
|
|
@@ -6641,14 +6930,14 @@ function Xr(t, e) {
|
|
|
6641
6930
|
var l = u.distance(s, Xe);
|
|
6642
6931
|
t && (Math.abs(l - o) < e.cvCutIn && (l = o), l = e.round(l)), i.setRelative(s, Xe, l, u), e.zp0 === 0 && (s.xo = s.x, s.yo = s.y), i.touch(s), e.rp0 = e.rp1 = a;
|
|
6643
6932
|
}
|
|
6644
|
-
function
|
|
6933
|
+
function oo(t) {
|
|
6645
6934
|
var e = t.prog, r = t.ip, n = t.stack, a = e[++r];
|
|
6646
6935
|
exports.DEBUG && console.log(t.step, "NPUSHB[]", a);
|
|
6647
6936
|
for (var s = 0; s < a; s++)
|
|
6648
6937
|
n.push(e[++r]);
|
|
6649
6938
|
t.ip = r;
|
|
6650
6939
|
}
|
|
6651
|
-
function
|
|
6940
|
+
function uo(t) {
|
|
6652
6941
|
var e = t.ip, r = t.prog, n = t.stack, a = r[++e];
|
|
6653
6942
|
exports.DEBUG && console.log(t.step, "NPUSHW[]", a);
|
|
6654
6943
|
for (var s = 0; s < a; s++) {
|
|
@@ -6657,92 +6946,92 @@ function ji(t) {
|
|
|
6657
6946
|
}
|
|
6658
6947
|
t.ip = e;
|
|
6659
6948
|
}
|
|
6660
|
-
function
|
|
6949
|
+
function lo(t) {
|
|
6661
6950
|
var e = t.stack, r = t.store;
|
|
6662
6951
|
r || (r = t.store = []);
|
|
6663
6952
|
var n = e.pop(), a = e.pop();
|
|
6664
6953
|
exports.DEBUG && console.log(t.step, "WS", n, a), r[a] = n;
|
|
6665
6954
|
}
|
|
6666
|
-
function
|
|
6955
|
+
function co(t) {
|
|
6667
6956
|
var e = t.stack, r = t.store, n = e.pop();
|
|
6668
6957
|
exports.DEBUG && console.log(t.step, "RS", n);
|
|
6669
6958
|
var a = r && r[n] || 0;
|
|
6670
6959
|
e.push(a);
|
|
6671
6960
|
}
|
|
6672
|
-
function
|
|
6961
|
+
function ho(t) {
|
|
6673
6962
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6674
6963
|
exports.DEBUG && console.log(t.step, "WCVTP", r, n), t.cvt[n] = r / 64;
|
|
6675
6964
|
}
|
|
6676
|
-
function
|
|
6965
|
+
function fo(t) {
|
|
6677
6966
|
var e = t.stack, r = e.pop();
|
|
6678
6967
|
exports.DEBUG && console.log(t.step, "RCVT", r), e.push(t.cvt[r] * 64);
|
|
6679
6968
|
}
|
|
6680
|
-
function
|
|
6969
|
+
function Jr(t, e) {
|
|
6681
6970
|
var r = e.stack, n = r.pop(), a = e.z2[n];
|
|
6682
6971
|
exports.DEBUG && console.log(e.step, "GC[" + t + "]", n), r.push(e.dpv.distance(a, Xe, t, !1) * 64);
|
|
6683
6972
|
}
|
|
6684
|
-
function
|
|
6973
|
+
function $r(t, e) {
|
|
6685
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);
|
|
6686
6975
|
exports.DEBUG && console.log(e.step, "MD[" + t + "]", n, a, "->", u), e.stack.push(Math.round(u * 64));
|
|
6687
6976
|
}
|
|
6688
|
-
function
|
|
6977
|
+
function po(t) {
|
|
6689
6978
|
exports.DEBUG && console.log(t.step, "MPPEM[]"), t.stack.push(t.ppem);
|
|
6690
6979
|
}
|
|
6691
|
-
function
|
|
6980
|
+
function vo(t) {
|
|
6692
6981
|
exports.DEBUG && console.log(t.step, "FLIPON[]"), t.autoFlip = !0;
|
|
6693
6982
|
}
|
|
6694
|
-
function
|
|
6983
|
+
function go(t) {
|
|
6695
6984
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6696
6985
|
exports.DEBUG && console.log(t.step, "LT[]", r, n), e.push(n < r ? 1 : 0);
|
|
6697
6986
|
}
|
|
6698
|
-
function
|
|
6987
|
+
function yo(t) {
|
|
6699
6988
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6700
6989
|
exports.DEBUG && console.log(t.step, "LTEQ[]", r, n), e.push(n <= r ? 1 : 0);
|
|
6701
6990
|
}
|
|
6702
|
-
function
|
|
6991
|
+
function mo(t) {
|
|
6703
6992
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6704
6993
|
exports.DEBUG && console.log(t.step, "GT[]", r, n), e.push(n > r ? 1 : 0);
|
|
6705
6994
|
}
|
|
6706
|
-
function
|
|
6995
|
+
function xo(t) {
|
|
6707
6996
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6708
6997
|
exports.DEBUG && console.log(t.step, "GTEQ[]", r, n), e.push(n >= r ? 1 : 0);
|
|
6709
6998
|
}
|
|
6710
|
-
function
|
|
6999
|
+
function bo(t) {
|
|
6711
7000
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6712
7001
|
exports.DEBUG && console.log(t.step, "EQ[]", r, n), e.push(r === n ? 1 : 0);
|
|
6713
7002
|
}
|
|
6714
|
-
function
|
|
7003
|
+
function So(t) {
|
|
6715
7004
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6716
7005
|
exports.DEBUG && console.log(t.step, "NEQ[]", r, n), e.push(r !== n ? 1 : 0);
|
|
6717
7006
|
}
|
|
6718
|
-
function
|
|
7007
|
+
function ko(t) {
|
|
6719
7008
|
var e = t.stack, r = e.pop();
|
|
6720
7009
|
exports.DEBUG && console.log(t.step, "ODD[]", r), e.push(Math.trunc(r) % 2 ? 1 : 0);
|
|
6721
7010
|
}
|
|
6722
|
-
function
|
|
7011
|
+
function To(t) {
|
|
6723
7012
|
var e = t.stack, r = e.pop();
|
|
6724
7013
|
exports.DEBUG && console.log(t.step, "EVEN[]", r), e.push(Math.trunc(r) % 2 ? 0 : 1);
|
|
6725
7014
|
}
|
|
6726
|
-
function
|
|
7015
|
+
function Fo(t) {
|
|
6727
7016
|
var e = t.stack.pop();
|
|
6728
|
-
exports.DEBUG && console.log(t.step, "IF[]", e), e || (
|
|
7017
|
+
exports.DEBUG && console.log(t.step, "IF[]", e), e || (la(t, !0), exports.DEBUG && console.log(t.step, "EIF[]"));
|
|
6729
7018
|
}
|
|
6730
|
-
function
|
|
7019
|
+
function wo(t) {
|
|
6731
7020
|
exports.DEBUG && console.log(t.step, "EIF[]");
|
|
6732
7021
|
}
|
|
6733
|
-
function
|
|
7022
|
+
function Co(t) {
|
|
6734
7023
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6735
7024
|
exports.DEBUG && console.log(t.step, "AND[]", r, n), e.push(r && n ? 1 : 0);
|
|
6736
7025
|
}
|
|
6737
|
-
function
|
|
7026
|
+
function Eo(t) {
|
|
6738
7027
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6739
7028
|
exports.DEBUG && console.log(t.step, "OR[]", r, n), e.push(r || n ? 1 : 0);
|
|
6740
7029
|
}
|
|
6741
|
-
function
|
|
7030
|
+
function Oo(t) {
|
|
6742
7031
|
var e = t.stack, r = e.pop();
|
|
6743
7032
|
exports.DEBUG && console.log(t.step, "NOT[]", r), e.push(r ? 0 : 1);
|
|
6744
7033
|
}
|
|
6745
|
-
function
|
|
7034
|
+
function Ot(t, e) {
|
|
6746
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;
|
|
6747
7036
|
exports.DEBUG && console.log(e.step, "DELTAP[" + t + "]", n, r);
|
|
6748
7037
|
for (var c = 0; c < n; c++) {
|
|
@@ -6755,43 +7044,43 @@ function wt(t, e) {
|
|
|
6755
7044
|
}
|
|
6756
7045
|
}
|
|
6757
7046
|
}
|
|
6758
|
-
function
|
|
7047
|
+
function Uo(t) {
|
|
6759
7048
|
var e = t.stack, r = e.pop();
|
|
6760
7049
|
exports.DEBUG && console.log(t.step, "SDB[]", r), t.deltaBase = r;
|
|
6761
7050
|
}
|
|
6762
|
-
function
|
|
7051
|
+
function Lo(t) {
|
|
6763
7052
|
var e = t.stack, r = e.pop();
|
|
6764
7053
|
exports.DEBUG && console.log(t.step, "SDS[]", r), t.deltaShift = Math.pow(0.5, r);
|
|
6765
7054
|
}
|
|
6766
|
-
function
|
|
7055
|
+
function Ro(t) {
|
|
6767
7056
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6768
7057
|
exports.DEBUG && console.log(t.step, "ADD[]", r, n), e.push(n + r);
|
|
6769
7058
|
}
|
|
6770
|
-
function
|
|
7059
|
+
function Ao(t) {
|
|
6771
7060
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6772
7061
|
exports.DEBUG && console.log(t.step, "SUB[]", r, n), e.push(n - r);
|
|
6773
7062
|
}
|
|
6774
|
-
function
|
|
7063
|
+
function Do(t) {
|
|
6775
7064
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6776
7065
|
exports.DEBUG && console.log(t.step, "DIV[]", r, n), e.push(n * 64 / r);
|
|
6777
7066
|
}
|
|
6778
|
-
function
|
|
7067
|
+
function Mo(t) {
|
|
6779
7068
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6780
7069
|
exports.DEBUG && console.log(t.step, "MUL[]", r, n), e.push(n * r / 64);
|
|
6781
7070
|
}
|
|
6782
|
-
function
|
|
7071
|
+
function Bo(t) {
|
|
6783
7072
|
var e = t.stack, r = e.pop();
|
|
6784
7073
|
exports.DEBUG && console.log(t.step, "ABS[]", r), e.push(Math.abs(r));
|
|
6785
7074
|
}
|
|
6786
|
-
function
|
|
7075
|
+
function Po(t) {
|
|
6787
7076
|
var e = t.stack, r = e.pop();
|
|
6788
7077
|
exports.DEBUG && console.log(t.step, "NEG[]", r), e.push(-r);
|
|
6789
7078
|
}
|
|
6790
|
-
function
|
|
7079
|
+
function Io(t) {
|
|
6791
7080
|
var e = t.stack, r = e.pop();
|
|
6792
7081
|
exports.DEBUG && console.log(t.step, "FLOOR[]", r), e.push(Math.floor(r / 64) * 64);
|
|
6793
7082
|
}
|
|
6794
|
-
function
|
|
7083
|
+
function Go(t) {
|
|
6795
7084
|
var e = t.stack, r = e.pop();
|
|
6796
7085
|
exports.DEBUG && console.log(t.step, "CEILING[]", r), e.push(Math.ceil(r / 64) * 64);
|
|
6797
7086
|
}
|
|
@@ -6799,11 +7088,11 @@ function st(t, e) {
|
|
|
6799
7088
|
var r = e.stack, n = r.pop();
|
|
6800
7089
|
exports.DEBUG && console.log(e.step, "ROUND[]"), r.push(e.round(n / 64) * 64);
|
|
6801
7090
|
}
|
|
6802
|
-
function
|
|
7091
|
+
function No(t) {
|
|
6803
7092
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6804
7093
|
exports.DEBUG && console.log(t.step, "WCVTF[]", r, n), t.cvt[n] = r * t.ppem / t.font.unitsPerEm;
|
|
6805
7094
|
}
|
|
6806
|
-
function
|
|
7095
|
+
function Ut(t, e) {
|
|
6807
7096
|
var r = e.stack, n = r.pop(), a = e.ppem, s = e.deltaBase + (t - 1) * 16, i = e.deltaShift;
|
|
6808
7097
|
exports.DEBUG && console.log(e.step, "DELTAC[" + t + "]", n, r);
|
|
6809
7098
|
for (var u = 0; u < n; u++) {
|
|
@@ -6816,9 +7105,9 @@ function Ct(t, e) {
|
|
|
6816
7105
|
}
|
|
6817
7106
|
}
|
|
6818
7107
|
}
|
|
6819
|
-
function
|
|
7108
|
+
function _o(t) {
|
|
6820
7109
|
var e = t.stack.pop();
|
|
6821
|
-
exports.DEBUG && console.log(t.step, "SROUND[]", e), t.round =
|
|
7110
|
+
exports.DEBUG && console.log(t.step, "SROUND[]", e), t.round = ua;
|
|
6822
7111
|
var r;
|
|
6823
7112
|
switch (e & 192) {
|
|
6824
7113
|
case 0:
|
|
@@ -6851,9 +7140,9 @@ function Oo(t) {
|
|
|
6851
7140
|
}
|
|
6852
7141
|
e &= 15, e === 0 ? t.srThreshold = 0 : t.srThreshold = (e / 8 - 0.5) * r;
|
|
6853
7142
|
}
|
|
6854
|
-
function
|
|
7143
|
+
function Ho(t) {
|
|
6855
7144
|
var e = t.stack.pop();
|
|
6856
|
-
exports.DEBUG && console.log(t.step, "S45ROUND[]", e), t.round =
|
|
7145
|
+
exports.DEBUG && console.log(t.step, "S45ROUND[]", e), t.round = ua;
|
|
6857
7146
|
var r;
|
|
6858
7147
|
switch (e & 192) {
|
|
6859
7148
|
case 0:
|
|
@@ -6886,46 +7175,46 @@ function Uo(t) {
|
|
|
6886
7175
|
}
|
|
6887
7176
|
e &= 15, e === 0 ? t.srThreshold = 0 : t.srThreshold = (e / 8 - 0.5) * r;
|
|
6888
7177
|
}
|
|
6889
|
-
function
|
|
6890
|
-
exports.DEBUG && console.log(t.step, "ROFF[]"), t.round =
|
|
7178
|
+
function zo(t) {
|
|
7179
|
+
exports.DEBUG && console.log(t.step, "ROFF[]"), t.round = ki;
|
|
6891
7180
|
}
|
|
6892
|
-
function
|
|
6893
|
-
exports.DEBUG && console.log(t.step, "RUTG[]"), t.round =
|
|
7181
|
+
function Wo(t) {
|
|
7182
|
+
exports.DEBUG && console.log(t.step, "RUTG[]"), t.round = wi;
|
|
6894
7183
|
}
|
|
6895
|
-
function
|
|
6896
|
-
exports.DEBUG && console.log(t.step, "RDTG[]"), t.round =
|
|
7184
|
+
function Vo(t) {
|
|
7185
|
+
exports.DEBUG && console.log(t.step, "RDTG[]"), t.round = Ci;
|
|
6897
7186
|
}
|
|
6898
|
-
function
|
|
7187
|
+
function qo(t) {
|
|
6899
7188
|
var e = t.stack.pop();
|
|
6900
7189
|
exports.DEBUG && console.log(t.step, "SCANCTRL[]", e);
|
|
6901
7190
|
}
|
|
6902
|
-
function
|
|
7191
|
+
function en(t, e) {
|
|
6903
7192
|
var r = e.stack, n = r.pop(), a = r.pop(), s = e.z2[n], i = e.z1[a];
|
|
6904
7193
|
exports.DEBUG && console.log(e.step, "SDPVTL[" + t + "]", n, a);
|
|
6905
7194
|
var u, o;
|
|
6906
7195
|
t ? (u = s.y - i.y, o = i.x - s.x) : (u = i.x - s.x, o = i.y - s.y), e.dpv = Je(u, o);
|
|
6907
7196
|
}
|
|
6908
|
-
function
|
|
7197
|
+
function Xo(t) {
|
|
6909
7198
|
var e = t.stack, r = e.pop(), n = 0;
|
|
6910
7199
|
exports.DEBUG && console.log(t.step, "GETINFO[]", r), r & 1 && (n = 35), r & 32 && (n |= 4096), e.push(n);
|
|
6911
7200
|
}
|
|
6912
|
-
function
|
|
7201
|
+
function Yo(t) {
|
|
6913
7202
|
var e = t.stack, r = e.pop(), n = e.pop(), a = e.pop();
|
|
6914
7203
|
exports.DEBUG && console.log(t.step, "ROLL[]"), e.push(n), e.push(r), e.push(a);
|
|
6915
7204
|
}
|
|
6916
|
-
function
|
|
7205
|
+
function Zo(t) {
|
|
6917
7206
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6918
7207
|
exports.DEBUG && console.log(t.step, "MAX[]", r, n), e.push(Math.max(n, r));
|
|
6919
7208
|
}
|
|
6920
|
-
function
|
|
7209
|
+
function jo(t) {
|
|
6921
7210
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6922
7211
|
exports.DEBUG && console.log(t.step, "MIN[]", r, n), e.push(Math.min(n, r));
|
|
6923
7212
|
}
|
|
6924
|
-
function
|
|
7213
|
+
function Ko(t) {
|
|
6925
7214
|
var e = t.stack.pop();
|
|
6926
7215
|
exports.DEBUG && console.log(t.step, "SCANTYPE[]", e);
|
|
6927
7216
|
}
|
|
6928
|
-
function
|
|
7217
|
+
function Qo(t) {
|
|
6929
7218
|
var e = t.stack.pop(), r = t.stack.pop();
|
|
6930
7219
|
switch (exports.DEBUG && console.log(t.step, "INSTCTRL[]", e, r), e) {
|
|
6931
7220
|
case 1:
|
|
@@ -6968,67 +7257,67 @@ function T(t, e, r, n, a, s) {
|
|
|
6968
7257
|
")"
|
|
6969
7258
|
), s.rp1 = s.rp0, s.rp2 = o, e && (s.rp0 = o);
|
|
6970
7259
|
}
|
|
6971
|
-
|
|
7260
|
+
aa = [
|
|
6972
7261
|
/* 0x00 */
|
|
6973
|
-
|
|
7262
|
+
_r.bind(void 0, ve),
|
|
6974
7263
|
/* 0x01 */
|
|
6975
|
-
|
|
7264
|
+
_r.bind(void 0, pe),
|
|
6976
7265
|
/* 0x02 */
|
|
6977
|
-
|
|
7266
|
+
Hr.bind(void 0, ve),
|
|
6978
7267
|
/* 0x03 */
|
|
6979
|
-
|
|
7268
|
+
Hr.bind(void 0, pe),
|
|
6980
7269
|
/* 0x04 */
|
|
6981
|
-
|
|
7270
|
+
zr.bind(void 0, ve),
|
|
6982
7271
|
/* 0x05 */
|
|
6983
|
-
|
|
7272
|
+
zr.bind(void 0, pe),
|
|
6984
7273
|
/* 0x06 */
|
|
6985
|
-
|
|
7274
|
+
Wr.bind(void 0, 0),
|
|
6986
7275
|
/* 0x07 */
|
|
6987
|
-
|
|
7276
|
+
Wr.bind(void 0, 1),
|
|
6988
7277
|
/* 0x08 */
|
|
6989
|
-
|
|
7278
|
+
Vr.bind(void 0, 0),
|
|
6990
7279
|
/* 0x09 */
|
|
6991
|
-
|
|
7280
|
+
Vr.bind(void 0, 1),
|
|
6992
7281
|
/* 0x0A */
|
|
6993
|
-
|
|
7282
|
+
Oi,
|
|
6994
7283
|
/* 0x0B */
|
|
6995
|
-
|
|
7284
|
+
Ui,
|
|
6996
7285
|
/* 0x0C */
|
|
6997
|
-
|
|
7286
|
+
Li,
|
|
6998
7287
|
/* 0x0D */
|
|
6999
|
-
|
|
7288
|
+
Ri,
|
|
7000
7289
|
/* 0x0E */
|
|
7001
|
-
|
|
7290
|
+
Ai,
|
|
7002
7291
|
/* 0x0F */
|
|
7003
|
-
|
|
7292
|
+
Di,
|
|
7004
7293
|
/* 0x10 */
|
|
7005
|
-
|
|
7294
|
+
Mi,
|
|
7006
7295
|
/* 0x11 */
|
|
7007
|
-
|
|
7296
|
+
Bi,
|
|
7008
7297
|
/* 0x12 */
|
|
7009
|
-
|
|
7298
|
+
Pi,
|
|
7010
7299
|
/* 0x13 */
|
|
7011
|
-
|
|
7300
|
+
Ii,
|
|
7012
7301
|
/* 0x14 */
|
|
7013
|
-
|
|
7302
|
+
Gi,
|
|
7014
7303
|
/* 0x15 */
|
|
7015
|
-
|
|
7304
|
+
Ni,
|
|
7016
7305
|
/* 0x16 */
|
|
7017
|
-
|
|
7306
|
+
_i,
|
|
7018
7307
|
/* 0x17 */
|
|
7019
|
-
|
|
7308
|
+
Hi,
|
|
7020
7309
|
/* 0x18 */
|
|
7021
|
-
|
|
7310
|
+
zi,
|
|
7022
7311
|
/* 0x19 */
|
|
7023
|
-
|
|
7312
|
+
Wi,
|
|
7024
7313
|
/* 0x1A */
|
|
7025
|
-
|
|
7314
|
+
Vi,
|
|
7026
7315
|
/* 0x1B */
|
|
7027
|
-
|
|
7316
|
+
qi,
|
|
7028
7317
|
/* 0x1C */
|
|
7029
|
-
|
|
7318
|
+
Xi,
|
|
7030
7319
|
/* 0x1D */
|
|
7031
|
-
|
|
7320
|
+
Yi,
|
|
7032
7321
|
/* 0x1E */
|
|
7033
7322
|
void 0,
|
|
7034
7323
|
// TODO SSWCI
|
|
@@ -7036,19 +7325,19 @@ ra = [
|
|
|
7036
7325
|
void 0,
|
|
7037
7326
|
// TODO SSW
|
|
7038
7327
|
/* 0x20 */
|
|
7039
|
-
|
|
7328
|
+
Zi,
|
|
7040
7329
|
/* 0x21 */
|
|
7041
|
-
|
|
7330
|
+
Et,
|
|
7042
7331
|
/* 0x22 */
|
|
7043
|
-
|
|
7332
|
+
ji,
|
|
7044
7333
|
/* 0x23 */
|
|
7045
|
-
|
|
7334
|
+
Ki,
|
|
7046
7335
|
/* 0x24 */
|
|
7047
|
-
|
|
7336
|
+
Qi,
|
|
7048
7337
|
/* 0x25 */
|
|
7049
|
-
|
|
7338
|
+
eo,
|
|
7050
7339
|
/* 0x26 */
|
|
7051
|
-
|
|
7340
|
+
to,
|
|
7052
7341
|
/* 0x27 */
|
|
7053
7342
|
void 0,
|
|
7054
7343
|
// TODO ALIGNPTS
|
|
@@ -7058,80 +7347,80 @@ ra = [
|
|
|
7058
7347
|
void 0,
|
|
7059
7348
|
// TODO UTP
|
|
7060
7349
|
/* 0x2A */
|
|
7061
|
-
|
|
7350
|
+
Ji,
|
|
7062
7351
|
/* 0x2B */
|
|
7063
|
-
|
|
7352
|
+
$i,
|
|
7064
7353
|
/* 0x2C */
|
|
7065
|
-
|
|
7354
|
+
ro,
|
|
7066
7355
|
/* 0x2D */
|
|
7067
7356
|
void 0,
|
|
7068
7357
|
// ENDF (eaten by FDEF)
|
|
7069
7358
|
/* 0x2E */
|
|
7070
|
-
|
|
7359
|
+
qr.bind(void 0, 0),
|
|
7071
7360
|
/* 0x2F */
|
|
7072
|
-
|
|
7361
|
+
qr.bind(void 0, 1),
|
|
7073
7362
|
/* 0x30 */
|
|
7074
|
-
|
|
7363
|
+
Xr.bind(void 0, ve),
|
|
7075
7364
|
/* 0x31 */
|
|
7076
|
-
|
|
7365
|
+
Xr.bind(void 0, pe),
|
|
7077
7366
|
/* 0x32 */
|
|
7078
|
-
|
|
7367
|
+
Yr.bind(void 0, 0),
|
|
7079
7368
|
/* 0x33 */
|
|
7080
|
-
|
|
7369
|
+
Yr.bind(void 0, 1),
|
|
7081
7370
|
/* 0x34 */
|
|
7082
|
-
|
|
7371
|
+
Zr.bind(void 0, 0),
|
|
7083
7372
|
/* 0x35 */
|
|
7084
|
-
|
|
7373
|
+
Zr.bind(void 0, 1),
|
|
7085
7374
|
/* 0x36 */
|
|
7086
|
-
|
|
7375
|
+
jr.bind(void 0, 0),
|
|
7087
7376
|
/* 0x37 */
|
|
7088
|
-
|
|
7377
|
+
jr.bind(void 0, 1),
|
|
7089
7378
|
/* 0x38 */
|
|
7090
|
-
|
|
7379
|
+
no,
|
|
7091
7380
|
/* 0x39 */
|
|
7092
|
-
|
|
7381
|
+
ao,
|
|
7093
7382
|
/* 0x3A */
|
|
7094
|
-
|
|
7383
|
+
Kr.bind(void 0, 0),
|
|
7095
7384
|
/* 0x3B */
|
|
7096
|
-
|
|
7385
|
+
Kr.bind(void 0, 1),
|
|
7097
7386
|
/* 0x3C */
|
|
7098
|
-
|
|
7387
|
+
so,
|
|
7099
7388
|
/* 0x3D */
|
|
7100
|
-
|
|
7389
|
+
io,
|
|
7101
7390
|
/* 0x3E */
|
|
7102
|
-
|
|
7391
|
+
Qr.bind(void 0, 0),
|
|
7103
7392
|
/* 0x3F */
|
|
7104
|
-
|
|
7393
|
+
Qr.bind(void 0, 1),
|
|
7105
7394
|
/* 0x40 */
|
|
7106
|
-
|
|
7395
|
+
oo,
|
|
7107
7396
|
/* 0x41 */
|
|
7108
|
-
|
|
7397
|
+
uo,
|
|
7109
7398
|
/* 0x42 */
|
|
7110
|
-
|
|
7399
|
+
lo,
|
|
7111
7400
|
/* 0x43 */
|
|
7112
|
-
|
|
7401
|
+
co,
|
|
7113
7402
|
/* 0x44 */
|
|
7114
|
-
|
|
7403
|
+
ho,
|
|
7115
7404
|
/* 0x45 */
|
|
7116
|
-
|
|
7405
|
+
fo,
|
|
7117
7406
|
/* 0x46 */
|
|
7118
|
-
|
|
7407
|
+
Jr.bind(void 0, 0),
|
|
7119
7408
|
/* 0x47 */
|
|
7120
|
-
|
|
7409
|
+
Jr.bind(void 0, 1),
|
|
7121
7410
|
/* 0x48 */
|
|
7122
7411
|
void 0,
|
|
7123
7412
|
// TODO SCFS
|
|
7124
7413
|
/* 0x49 */
|
|
7125
|
-
|
|
7414
|
+
$r.bind(void 0, 0),
|
|
7126
7415
|
/* 0x4A */
|
|
7127
|
-
|
|
7416
|
+
$r.bind(void 0, 1),
|
|
7128
7417
|
/* 0x4B */
|
|
7129
|
-
|
|
7418
|
+
po,
|
|
7130
7419
|
/* 0x4C */
|
|
7131
7420
|
void 0,
|
|
7132
7421
|
// TODO MPS
|
|
7133
7422
|
/* 0x4D */
|
|
7134
|
-
|
|
7423
|
+
vo,
|
|
7135
7424
|
/* 0x4E */
|
|
7136
7425
|
void 0,
|
|
7137
7426
|
// TODO FLIPOFF
|
|
@@ -7139,53 +7428,53 @@ ra = [
|
|
|
7139
7428
|
void 0,
|
|
7140
7429
|
// TODO DEBUG
|
|
7141
7430
|
/* 0x50 */
|
|
7142
|
-
|
|
7431
|
+
go,
|
|
7143
7432
|
/* 0x51 */
|
|
7144
|
-
|
|
7433
|
+
yo,
|
|
7145
7434
|
/* 0x52 */
|
|
7146
|
-
|
|
7435
|
+
mo,
|
|
7147
7436
|
/* 0x53 */
|
|
7148
|
-
|
|
7437
|
+
xo,
|
|
7149
7438
|
/* 0x54 */
|
|
7150
|
-
|
|
7439
|
+
bo,
|
|
7151
7440
|
/* 0x55 */
|
|
7152
|
-
|
|
7441
|
+
So,
|
|
7153
7442
|
/* 0x56 */
|
|
7154
|
-
|
|
7443
|
+
ko,
|
|
7155
7444
|
/* 0x57 */
|
|
7156
|
-
|
|
7445
|
+
To,
|
|
7157
7446
|
/* 0x58 */
|
|
7158
|
-
|
|
7447
|
+
Fo,
|
|
7159
7448
|
/* 0x59 */
|
|
7160
|
-
|
|
7449
|
+
wo,
|
|
7161
7450
|
/* 0x5A */
|
|
7162
|
-
|
|
7451
|
+
Co,
|
|
7163
7452
|
/* 0x5B */
|
|
7164
|
-
|
|
7453
|
+
Eo,
|
|
7165
7454
|
/* 0x5C */
|
|
7166
|
-
|
|
7455
|
+
Oo,
|
|
7167
7456
|
/* 0x5D */
|
|
7168
|
-
|
|
7457
|
+
Ot.bind(void 0, 1),
|
|
7169
7458
|
/* 0x5E */
|
|
7170
|
-
|
|
7459
|
+
Uo,
|
|
7171
7460
|
/* 0x5F */
|
|
7172
|
-
|
|
7461
|
+
Lo,
|
|
7173
7462
|
/* 0x60 */
|
|
7174
|
-
|
|
7463
|
+
Ro,
|
|
7175
7464
|
/* 0x61 */
|
|
7176
|
-
|
|
7465
|
+
Ao,
|
|
7177
7466
|
/* 0x62 */
|
|
7178
|
-
|
|
7467
|
+
Do,
|
|
7179
7468
|
/* 0x63 */
|
|
7180
|
-
|
|
7469
|
+
Mo,
|
|
7181
7470
|
/* 0x64 */
|
|
7182
|
-
|
|
7471
|
+
Bo,
|
|
7183
7472
|
/* 0x65 */
|
|
7184
|
-
|
|
7473
|
+
Po,
|
|
7185
7474
|
/* 0x66 */
|
|
7186
|
-
|
|
7475
|
+
Io,
|
|
7187
7476
|
/* 0x67 */
|
|
7188
|
-
|
|
7477
|
+
Go,
|
|
7189
7478
|
/* 0x68 */
|
|
7190
7479
|
st.bind(void 0, 0),
|
|
7191
7480
|
/* 0x69 */
|
|
@@ -7207,21 +7496,21 @@ ra = [
|
|
|
7207
7496
|
void 0,
|
|
7208
7497
|
// TODO NROUND[ab]
|
|
7209
7498
|
/* 0x70 */
|
|
7210
|
-
|
|
7499
|
+
No,
|
|
7211
7500
|
/* 0x71 */
|
|
7212
|
-
|
|
7501
|
+
Ot.bind(void 0, 2),
|
|
7213
7502
|
/* 0x72 */
|
|
7214
|
-
|
|
7503
|
+
Ot.bind(void 0, 3),
|
|
7215
7504
|
/* 0x73 */
|
|
7216
|
-
|
|
7505
|
+
Ut.bind(void 0, 1),
|
|
7217
7506
|
/* 0x74 */
|
|
7218
|
-
|
|
7507
|
+
Ut.bind(void 0, 2),
|
|
7219
7508
|
/* 0x75 */
|
|
7220
|
-
|
|
7509
|
+
Ut.bind(void 0, 3),
|
|
7221
7510
|
/* 0x76 */
|
|
7222
|
-
|
|
7511
|
+
_o,
|
|
7223
7512
|
/* 0x77 */
|
|
7224
|
-
|
|
7513
|
+
Ho,
|
|
7225
7514
|
/* 0x78 */
|
|
7226
7515
|
void 0,
|
|
7227
7516
|
// TODO JROT[]
|
|
@@ -7229,18 +7518,18 @@ ra = [
|
|
|
7229
7518
|
void 0,
|
|
7230
7519
|
// TODO JROF[]
|
|
7231
7520
|
/* 0x7A */
|
|
7232
|
-
|
|
7521
|
+
zo,
|
|
7233
7522
|
/* 0x7B */
|
|
7234
7523
|
void 0,
|
|
7235
7524
|
/* 0x7C */
|
|
7236
|
-
|
|
7525
|
+
Wo,
|
|
7237
7526
|
/* 0x7D */
|
|
7238
|
-
|
|
7527
|
+
Vo,
|
|
7239
7528
|
/* 0x7E */
|
|
7240
|
-
|
|
7529
|
+
Et,
|
|
7241
7530
|
// actually SANGW, supposed to do only a pop though
|
|
7242
7531
|
/* 0x7F */
|
|
7243
|
-
|
|
7532
|
+
Et,
|
|
7244
7533
|
// actually AA, supposed to do only a pop though
|
|
7245
7534
|
/* 0x80 */
|
|
7246
7535
|
void 0,
|
|
@@ -7256,26 +7545,26 @@ ra = [
|
|
|
7256
7545
|
/* 0x84 */
|
|
7257
7546
|
void 0,
|
|
7258
7547
|
/* 0x85 */
|
|
7259
|
-
|
|
7548
|
+
qo,
|
|
7260
7549
|
/* 0x86 */
|
|
7261
|
-
|
|
7550
|
+
en.bind(void 0, 0),
|
|
7262
7551
|
/* 0x87 */
|
|
7263
|
-
|
|
7552
|
+
en.bind(void 0, 1),
|
|
7264
7553
|
/* 0x88 */
|
|
7265
|
-
|
|
7554
|
+
Xo,
|
|
7266
7555
|
/* 0x89 */
|
|
7267
7556
|
void 0,
|
|
7268
7557
|
// TODO IDEF
|
|
7269
7558
|
/* 0x8A */
|
|
7270
|
-
|
|
7559
|
+
Yo,
|
|
7271
7560
|
/* 0x8B */
|
|
7272
|
-
|
|
7561
|
+
Zo,
|
|
7273
7562
|
/* 0x8C */
|
|
7274
|
-
|
|
7563
|
+
jo,
|
|
7275
7564
|
/* 0x8D */
|
|
7276
|
-
|
|
7565
|
+
Ko,
|
|
7277
7566
|
/* 0x8E */
|
|
7278
|
-
|
|
7567
|
+
Qo,
|
|
7279
7568
|
/* 0x8F */
|
|
7280
7569
|
void 0,
|
|
7281
7570
|
/* 0x90 */
|
|
@@ -7503,22 +7792,22 @@ ra = [
|
|
|
7503
7792
|
/* 0xFF */
|
|
7504
7793
|
T.bind(void 0, 1, 1, 1, 1, 3)
|
|
7505
7794
|
];
|
|
7506
|
-
function
|
|
7795
|
+
function Ge(t) {
|
|
7507
7796
|
this.char = t, this.state = {}, this.activeState = null;
|
|
7508
7797
|
}
|
|
7509
7798
|
function ir(t, e, r) {
|
|
7510
7799
|
this.contextName = r, this.startIndex = t, this.endOffset = e;
|
|
7511
7800
|
}
|
|
7512
|
-
function
|
|
7801
|
+
function Jo(t, e, r) {
|
|
7513
7802
|
this.contextName = t, this.openRange = null, this.ranges = [], this.checkStart = e, this.checkEnd = r;
|
|
7514
7803
|
}
|
|
7515
7804
|
function ie(t, e) {
|
|
7516
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);
|
|
7517
7806
|
}
|
|
7518
|
-
function
|
|
7807
|
+
function gt(t) {
|
|
7519
7808
|
this.eventId = t, this.subscribers = [];
|
|
7520
7809
|
}
|
|
7521
|
-
function
|
|
7810
|
+
function $o(t) {
|
|
7522
7811
|
var e = this, r = [
|
|
7523
7812
|
"start",
|
|
7524
7813
|
"end",
|
|
@@ -7536,7 +7825,7 @@ function Ho(t) {
|
|
|
7536
7825
|
];
|
|
7537
7826
|
r.forEach(function(a) {
|
|
7538
7827
|
Object.defineProperty(e.events, a, {
|
|
7539
|
-
value: new
|
|
7828
|
+
value: new gt(a)
|
|
7540
7829
|
});
|
|
7541
7830
|
}), t && r.forEach(function(a) {
|
|
7542
7831
|
var s = t[a];
|
|
@@ -7557,12 +7846,12 @@ function Ho(t) {
|
|
|
7557
7846
|
});
|
|
7558
7847
|
}
|
|
7559
7848
|
function B(t) {
|
|
7560
|
-
this.tokens = [], this.registeredContexts = {}, this.contextCheckers = [], this.events = {}, this.registeredModifiers = [],
|
|
7849
|
+
this.tokens = [], this.registeredContexts = {}, this.contextCheckers = [], this.events = {}, this.registeredModifiers = [], $o.call(this, t);
|
|
7561
7850
|
}
|
|
7562
|
-
|
|
7851
|
+
Ge.prototype.setState = function(t, e) {
|
|
7563
7852
|
return this.state[t] = e, this.activeState = { key: t, value: this.state[t] }, this.activeState;
|
|
7564
7853
|
};
|
|
7565
|
-
|
|
7854
|
+
Ge.prototype.getState = function(t) {
|
|
7566
7855
|
return this.state[t] || null;
|
|
7567
7856
|
};
|
|
7568
7857
|
B.prototype.inboundIndex = function(t) {
|
|
@@ -7586,7 +7875,7 @@ B.prototype.composeRUD = function(t) {
|
|
|
7586
7875
|
B.prototype.replaceRange = function(t, e, r, n) {
|
|
7587
7876
|
e = e !== null ? e : this.tokens.length;
|
|
7588
7877
|
var a = r.every(function(i) {
|
|
7589
|
-
return i instanceof
|
|
7878
|
+
return i instanceof Ge;
|
|
7590
7879
|
});
|
|
7591
7880
|
if (!isNaN(t) && this.inboundIndex(t) && a) {
|
|
7592
7881
|
var s = this.tokens.splice.apply(
|
|
@@ -7598,7 +7887,7 @@ B.prototype.replaceRange = function(t, e, r, n) {
|
|
|
7598
7887
|
return { FAIL: "replaceRange: invalid tokens or startIndex." };
|
|
7599
7888
|
};
|
|
7600
7889
|
B.prototype.replaceToken = function(t, e, r) {
|
|
7601
|
-
if (!isNaN(t) && this.inboundIndex(t) && e instanceof
|
|
7890
|
+
if (!isNaN(t) && this.inboundIndex(t) && e instanceof Ge) {
|
|
7602
7891
|
var n = this.tokens.splice(t, 1, e);
|
|
7603
7892
|
return r || this.dispatch("replaceToken", [t, e]), [n[0], e];
|
|
7604
7893
|
} else
|
|
@@ -7619,7 +7908,7 @@ B.prototype.removeToken = function(t, e) {
|
|
|
7619
7908
|
B.prototype.insertToken = function(t, e, r) {
|
|
7620
7909
|
var n = t.every(
|
|
7621
7910
|
function(a) {
|
|
7622
|
-
return a instanceof
|
|
7911
|
+
return a instanceof Ge;
|
|
7623
7912
|
}
|
|
7624
7913
|
);
|
|
7625
7914
|
return n ? (this.tokens.splice.apply(
|
|
@@ -7636,10 +7925,10 @@ B.prototype.registerModifier = function(t, e, r) {
|
|
|
7636
7925
|
}
|
|
7637
7926
|
}), this.registeredModifiers.push(t);
|
|
7638
7927
|
};
|
|
7639
|
-
|
|
7928
|
+
gt.prototype.subscribe = function(t) {
|
|
7640
7929
|
return typeof t == "function" ? this.subscribers.push(t) - 1 : { FAIL: "invalid '" + this.eventId + "' event handler" };
|
|
7641
7930
|
};
|
|
7642
|
-
|
|
7931
|
+
gt.prototype.unsubscribe = function(t) {
|
|
7643
7932
|
this.subscribers.splice(t, 1);
|
|
7644
7933
|
};
|
|
7645
7934
|
ie.prototype.setCurrentIndex = function(t) {
|
|
@@ -7678,7 +7967,7 @@ B.prototype.on = function(t, e) {
|
|
|
7678
7967
|
};
|
|
7679
7968
|
B.prototype.dispatch = function(t, e) {
|
|
7680
7969
|
var r = this, n = this.events[t];
|
|
7681
|
-
n instanceof
|
|
7970
|
+
n instanceof gt && n.subscribers.forEach(function(a) {
|
|
7682
7971
|
a.apply(r, e || []);
|
|
7683
7972
|
});
|
|
7684
7973
|
};
|
|
@@ -7695,7 +7984,7 @@ B.prototype.registerContextChecker = function(t, e, r) {
|
|
|
7695
7984
|
return {
|
|
7696
7985
|
FAIL: "missing context end check."
|
|
7697
7986
|
};
|
|
7698
|
-
var n = new
|
|
7987
|
+
var n = new Jo(
|
|
7699
7988
|
t,
|
|
7700
7989
|
e,
|
|
7701
7990
|
r
|
|
@@ -7751,7 +8040,7 @@ B.prototype.tokenize = function(t) {
|
|
|
7751
8040
|
for (var r = 0; r < e.length; r++) {
|
|
7752
8041
|
var n = e[r], a = new ie(e, r);
|
|
7753
8042
|
this.dispatch("next", [a]), this.runContextCheck(a);
|
|
7754
|
-
var s = new
|
|
8043
|
+
var s = new Ge(n);
|
|
7755
8044
|
this.tokens.push(s), this.dispatch("newToken", [s, a]);
|
|
7756
8045
|
}
|
|
7757
8046
|
return this.dispatch("end", [this.tokens]), this.tokens;
|
|
@@ -7759,7 +8048,7 @@ B.prototype.tokenize = function(t) {
|
|
|
7759
8048
|
function ke(t) {
|
|
7760
8049
|
return /[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(t);
|
|
7761
8050
|
}
|
|
7762
|
-
function
|
|
8051
|
+
function ca(t) {
|
|
7763
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);
|
|
7764
8053
|
}
|
|
7765
8054
|
function Te(t) {
|
|
@@ -7768,7 +8057,7 @@ function Te(t) {
|
|
|
7768
8057
|
function ot(t) {
|
|
7769
8058
|
return /[A-z]/.test(t);
|
|
7770
8059
|
}
|
|
7771
|
-
function
|
|
8060
|
+
function eu(t) {
|
|
7772
8061
|
return /\s/.test(t);
|
|
7773
8062
|
}
|
|
7774
8063
|
function te(t) {
|
|
@@ -7797,15 +8086,15 @@ function $e(t, e) {
|
|
|
7797
8086
|
}
|
|
7798
8087
|
return -1;
|
|
7799
8088
|
}
|
|
7800
|
-
function
|
|
8089
|
+
function tu(t, e) {
|
|
7801
8090
|
var r = $e(t, e.coverage);
|
|
7802
8091
|
return r === -1 ? null : t + e.deltaGlyphId;
|
|
7803
8092
|
}
|
|
7804
|
-
function
|
|
8093
|
+
function ru(t, e) {
|
|
7805
8094
|
var r = $e(t, e.coverage);
|
|
7806
8095
|
return r === -1 ? null : e.substitute[r];
|
|
7807
8096
|
}
|
|
7808
|
-
function
|
|
8097
|
+
function Lt(t, e) {
|
|
7809
8098
|
for (var r = [], n = 0; n < t.length; n++) {
|
|
7810
8099
|
var a = t[n], s = e.current;
|
|
7811
8100
|
s = Array.isArray(s) ? s[0] : s;
|
|
@@ -7814,11 +8103,11 @@ function Et(t, e) {
|
|
|
7814
8103
|
}
|
|
7815
8104
|
return r.length !== t.length ? -1 : r;
|
|
7816
8105
|
}
|
|
7817
|
-
function
|
|
8106
|
+
function nu(t, e) {
|
|
7818
8107
|
var r = e.inputCoverage.length + e.lookaheadCoverage.length + e.backtrackCoverage.length;
|
|
7819
8108
|
if (t.context.length < r)
|
|
7820
8109
|
return [];
|
|
7821
|
-
var n =
|
|
8110
|
+
var n = Lt(
|
|
7822
8111
|
e.inputCoverage,
|
|
7823
8112
|
t
|
|
7824
8113
|
);
|
|
@@ -7829,7 +8118,7 @@ function qo(t, e) {
|
|
|
7829
8118
|
return [];
|
|
7830
8119
|
for (var s = t.lookahead.slice(a); s.length && Te(s[0].char); )
|
|
7831
8120
|
s.shift();
|
|
7832
|
-
var i = new ie(s, 0), u =
|
|
8121
|
+
var i = new ie(s, 0), u = Lt(
|
|
7833
8122
|
e.lookaheadCoverage,
|
|
7834
8123
|
i
|
|
7835
8124
|
), o = [].concat(t.backtrack);
|
|
@@ -7837,7 +8126,7 @@ function qo(t, e) {
|
|
|
7837
8126
|
o.shift();
|
|
7838
8127
|
if (o.length < e.backtrackCoverage.length)
|
|
7839
8128
|
return [];
|
|
7840
|
-
var l = new ie(o, 0), c =
|
|
8129
|
+
var l = new ie(o, 0), c = Lt(
|
|
7841
8130
|
e.backtrackCoverage,
|
|
7842
8131
|
l
|
|
7843
8132
|
), p = n.length === e.inputCoverage.length && u.length === e.lookaheadCoverage.length && c.length === e.backtrackCoverage.length, h = [];
|
|
@@ -7853,7 +8142,7 @@ function qo(t, e) {
|
|
|
7853
8142
|
}
|
|
7854
8143
|
return h;
|
|
7855
8144
|
}
|
|
7856
|
-
function
|
|
8145
|
+
function au(t, e) {
|
|
7857
8146
|
var r = t.current, n = $e(r, e.coverage);
|
|
7858
8147
|
if (n === -1)
|
|
7859
8148
|
return null;
|
|
@@ -7869,7 +8158,7 @@ function Xo(t, e) {
|
|
|
7869
8158
|
}
|
|
7870
8159
|
return null;
|
|
7871
8160
|
}
|
|
7872
|
-
function
|
|
8161
|
+
function su(t, e) {
|
|
7873
8162
|
var r = $e(t, e.coverage);
|
|
7874
8163
|
return r === -1 ? null : e.sequences[r];
|
|
7875
8164
|
}
|
|
@@ -7931,35 +8220,35 @@ te.prototype.getLookupMethod = function(t, e) {
|
|
|
7931
8220
|
switch (n) {
|
|
7932
8221
|
case "11":
|
|
7933
8222
|
return function(a) {
|
|
7934
|
-
return
|
|
8223
|
+
return tu.apply(
|
|
7935
8224
|
r,
|
|
7936
8225
|
[a, e]
|
|
7937
8226
|
);
|
|
7938
8227
|
};
|
|
7939
8228
|
case "12":
|
|
7940
8229
|
return function(a) {
|
|
7941
|
-
return
|
|
8230
|
+
return ru.apply(
|
|
7942
8231
|
r,
|
|
7943
8232
|
[a, e]
|
|
7944
8233
|
);
|
|
7945
8234
|
};
|
|
7946
8235
|
case "63":
|
|
7947
8236
|
return function(a) {
|
|
7948
|
-
return
|
|
8237
|
+
return nu.apply(
|
|
7949
8238
|
r,
|
|
7950
8239
|
[a, e]
|
|
7951
8240
|
);
|
|
7952
8241
|
};
|
|
7953
8242
|
case "41":
|
|
7954
8243
|
return function(a) {
|
|
7955
|
-
return
|
|
8244
|
+
return au.apply(
|
|
7956
8245
|
r,
|
|
7957
8246
|
[a, e]
|
|
7958
8247
|
);
|
|
7959
8248
|
};
|
|
7960
8249
|
case "21":
|
|
7961
8250
|
return function(a) {
|
|
7962
|
-
return
|
|
8251
|
+
return su.apply(
|
|
7963
8252
|
r,
|
|
7964
8253
|
[a, e]
|
|
7965
8254
|
);
|
|
@@ -8052,7 +8341,7 @@ te.prototype.getFeature = function(e) {
|
|
|
8052
8341
|
var r = this.features[e.script];
|
|
8053
8342
|
return r ? r.tags[e.tag] ? this.features[e.script].tags[e.tag] : null : { FAIL: "No feature for script " + e.script };
|
|
8054
8343
|
};
|
|
8055
|
-
function
|
|
8344
|
+
function iu(t) {
|
|
8056
8345
|
var e = t.current, r = t.get(-1);
|
|
8057
8346
|
return (
|
|
8058
8347
|
// ? arabic first char
|
|
@@ -8060,7 +8349,7 @@ function Zo(t) {
|
|
|
8060
8349
|
!ke(r) && ke(e)
|
|
8061
8350
|
);
|
|
8062
8351
|
}
|
|
8063
|
-
function
|
|
8352
|
+
function ou(t) {
|
|
8064
8353
|
var e = t.get(1);
|
|
8065
8354
|
return (
|
|
8066
8355
|
// ? last arabic char
|
|
@@ -8068,24 +8357,24 @@ function Ko(t) {
|
|
|
8068
8357
|
!ke(e)
|
|
8069
8358
|
);
|
|
8070
8359
|
}
|
|
8071
|
-
var
|
|
8072
|
-
startCheck:
|
|
8073
|
-
endCheck:
|
|
8360
|
+
var uu = {
|
|
8361
|
+
startCheck: iu,
|
|
8362
|
+
endCheck: ou
|
|
8074
8363
|
};
|
|
8075
|
-
function
|
|
8364
|
+
function lu(t) {
|
|
8076
8365
|
var e = t.current, r = t.get(-1);
|
|
8077
8366
|
return (
|
|
8078
8367
|
// ? an arabic char preceded with a non arabic char
|
|
8079
8368
|
(ke(e) || Te(e)) && !ke(r)
|
|
8080
8369
|
);
|
|
8081
8370
|
}
|
|
8082
|
-
function
|
|
8371
|
+
function cu(t) {
|
|
8083
8372
|
var e = t.get(1);
|
|
8084
8373
|
switch (!0) {
|
|
8085
8374
|
case e === null:
|
|
8086
8375
|
return !0;
|
|
8087
8376
|
case (!ke(e) && !Te(e)):
|
|
8088
|
-
var r =
|
|
8377
|
+
var r = eu(e);
|
|
8089
8378
|
if (!r)
|
|
8090
8379
|
return !0;
|
|
8091
8380
|
if (r) {
|
|
@@ -8102,40 +8391,40 @@ function Jo(t) {
|
|
|
8102
8391
|
return !1;
|
|
8103
8392
|
}
|
|
8104
8393
|
}
|
|
8105
|
-
var
|
|
8106
|
-
startCheck:
|
|
8107
|
-
endCheck:
|
|
8394
|
+
var hu = {
|
|
8395
|
+
startCheck: lu,
|
|
8396
|
+
endCheck: cu
|
|
8108
8397
|
};
|
|
8109
|
-
function
|
|
8398
|
+
function fu(t, e, r) {
|
|
8110
8399
|
e[r].setState(t.tag, t.substitution);
|
|
8111
8400
|
}
|
|
8112
|
-
function
|
|
8401
|
+
function pu(t, e, r) {
|
|
8113
8402
|
e[r].setState(t.tag, t.substitution);
|
|
8114
8403
|
}
|
|
8115
|
-
function
|
|
8404
|
+
function du(t, e, r) {
|
|
8116
8405
|
t.substitution.forEach(function(n, a) {
|
|
8117
8406
|
var s = e[r + a];
|
|
8118
8407
|
s.setState(t.tag, n);
|
|
8119
8408
|
});
|
|
8120
8409
|
}
|
|
8121
|
-
function
|
|
8410
|
+
function vu(t, e, r) {
|
|
8122
8411
|
var n = e[r];
|
|
8123
8412
|
n.setState(t.tag, t.substitution.ligGlyph);
|
|
8124
8413
|
for (var a = t.substitution.components.length, s = 0; s < a; s++)
|
|
8125
8414
|
n = e[r + s + 1], n.setState("deleted", !0);
|
|
8126
8415
|
}
|
|
8127
|
-
var
|
|
8128
|
-
11:
|
|
8129
|
-
12:
|
|
8130
|
-
63:
|
|
8131
|
-
41:
|
|
8416
|
+
var tn = {
|
|
8417
|
+
11: fu,
|
|
8418
|
+
12: pu,
|
|
8419
|
+
63: du,
|
|
8420
|
+
41: vu
|
|
8132
8421
|
};
|
|
8133
8422
|
function or(t, e, r) {
|
|
8134
|
-
t instanceof Oe &&
|
|
8423
|
+
t instanceof Oe && tn[t.id] && tn[t.id](t, e, r);
|
|
8135
8424
|
}
|
|
8136
|
-
function
|
|
8425
|
+
function gu(t) {
|
|
8137
8426
|
for (var e = [].concat(t.backtrack), r = e.length - 1; r >= 0; r--) {
|
|
8138
|
-
var n = e[r], a =
|
|
8427
|
+
var n = e[r], a = ca(n), s = Te(n);
|
|
8139
8428
|
if (!a && !s)
|
|
8140
8429
|
return !0;
|
|
8141
8430
|
if (a)
|
|
@@ -8143,8 +8432,8 @@ function au(t) {
|
|
|
8143
8432
|
}
|
|
8144
8433
|
return !1;
|
|
8145
8434
|
}
|
|
8146
|
-
function
|
|
8147
|
-
if (
|
|
8435
|
+
function yu(t) {
|
|
8436
|
+
if (ca(t.current))
|
|
8148
8437
|
return !1;
|
|
8149
8438
|
for (var e = 0; e < t.lookahead.length; e++) {
|
|
8150
8439
|
var r = t.lookahead[e], n = Te(r);
|
|
@@ -8153,7 +8442,7 @@ function su(t) {
|
|
|
8153
8442
|
}
|
|
8154
8443
|
return !1;
|
|
8155
8444
|
}
|
|
8156
|
-
function
|
|
8445
|
+
function mu(t) {
|
|
8157
8446
|
var e = this, r = "arab", n = this.featuresTags[r], a = this.tokenizer.getRangeTokens(t);
|
|
8158
8447
|
if (a.length !== 1) {
|
|
8159
8448
|
var s = new ie(
|
|
@@ -8175,7 +8464,7 @@ function iu(t) {
|
|
|
8175
8464
|
if (!Te(u.char)) {
|
|
8176
8465
|
s.setCurrentIndex(o), i.setCurrentIndex(o);
|
|
8177
8466
|
var l = 0;
|
|
8178
|
-
|
|
8467
|
+
gu(i) && (l |= 1), yu(i) && (l |= 2);
|
|
8179
8468
|
var c;
|
|
8180
8469
|
switch (l) {
|
|
8181
8470
|
case 1:
|
|
@@ -8204,14 +8493,14 @@ function iu(t) {
|
|
|
8204
8493
|
});
|
|
8205
8494
|
}
|
|
8206
8495
|
}
|
|
8207
|
-
function
|
|
8496
|
+
function rn(t, e) {
|
|
8208
8497
|
var r = t.map(function(n) {
|
|
8209
8498
|
return n.activeState.value;
|
|
8210
8499
|
});
|
|
8211
8500
|
return new ie(r, 0);
|
|
8212
8501
|
}
|
|
8213
|
-
function
|
|
8214
|
-
var e = this, r = "arab", n = this.tokenizer.getRangeTokens(t), a =
|
|
8502
|
+
function xu(t) {
|
|
8503
|
+
var e = this, r = "arab", n = this.tokenizer.getRangeTokens(t), a = rn(n);
|
|
8215
8504
|
a.context.forEach(function(s, i) {
|
|
8216
8505
|
a.setCurrentIndex(i);
|
|
8217
8506
|
var u = e.query.lookupFeature({
|
|
@@ -8223,10 +8512,10 @@ function ou(t) {
|
|
|
8223
8512
|
function(o) {
|
|
8224
8513
|
return or(o, n, i);
|
|
8225
8514
|
}
|
|
8226
|
-
), a =
|
|
8515
|
+
), a = rn(n));
|
|
8227
8516
|
});
|
|
8228
8517
|
}
|
|
8229
|
-
function
|
|
8518
|
+
function bu(t) {
|
|
8230
8519
|
var e = t.current, r = t.get(-1);
|
|
8231
8520
|
return (
|
|
8232
8521
|
// ? latin first char
|
|
@@ -8234,7 +8523,7 @@ function uu(t) {
|
|
|
8234
8523
|
!ot(r) && ot(e)
|
|
8235
8524
|
);
|
|
8236
8525
|
}
|
|
8237
|
-
function
|
|
8526
|
+
function Su(t) {
|
|
8238
8527
|
var e = t.get(1);
|
|
8239
8528
|
return (
|
|
8240
8529
|
// ? last latin char
|
|
@@ -8242,18 +8531,18 @@ function lu(t) {
|
|
|
8242
8531
|
!ot(e)
|
|
8243
8532
|
);
|
|
8244
8533
|
}
|
|
8245
|
-
var
|
|
8246
|
-
startCheck:
|
|
8247
|
-
endCheck:
|
|
8534
|
+
var ku = {
|
|
8535
|
+
startCheck: bu,
|
|
8536
|
+
endCheck: Su
|
|
8248
8537
|
};
|
|
8249
|
-
function
|
|
8538
|
+
function nn(t, e) {
|
|
8250
8539
|
var r = t.map(function(n) {
|
|
8251
8540
|
return n.activeState.value;
|
|
8252
8541
|
});
|
|
8253
8542
|
return new ie(r, 0);
|
|
8254
8543
|
}
|
|
8255
|
-
function
|
|
8256
|
-
var e = this, r = "latn", n = this.tokenizer.getRangeTokens(t), a =
|
|
8544
|
+
function Tu(t) {
|
|
8545
|
+
var e = this, r = "latn", n = this.tokenizer.getRangeTokens(t), a = nn(n);
|
|
8257
8546
|
a.context.forEach(function(s, i) {
|
|
8258
8547
|
a.setCurrentIndex(i);
|
|
8259
8548
|
var u = e.query.lookupFeature({
|
|
@@ -8265,7 +8554,7 @@ function hu(t) {
|
|
|
8265
8554
|
function(o) {
|
|
8266
8555
|
return or(o, n, i);
|
|
8267
8556
|
}
|
|
8268
|
-
), a =
|
|
8557
|
+
), a = nn(n));
|
|
8269
8558
|
});
|
|
8270
8559
|
}
|
|
8271
8560
|
function le(t) {
|
|
@@ -8275,11 +8564,11 @@ le.prototype.setText = function(t) {
|
|
|
8275
8564
|
this.text = t;
|
|
8276
8565
|
};
|
|
8277
8566
|
le.prototype.contextChecks = {
|
|
8278
|
-
latinWordCheck:
|
|
8279
|
-
arabicWordCheck:
|
|
8280
|
-
arabicSentenceCheck:
|
|
8567
|
+
latinWordCheck: ku,
|
|
8568
|
+
arabicWordCheck: uu,
|
|
8569
|
+
arabicSentenceCheck: hu
|
|
8281
8570
|
};
|
|
8282
|
-
function
|
|
8571
|
+
function Rt(t) {
|
|
8283
8572
|
var e = this.contextChecks[t + "Check"];
|
|
8284
8573
|
return this.tokenizer.registerContextChecker(
|
|
8285
8574
|
t,
|
|
@@ -8287,10 +8576,10 @@ function Ot(t) {
|
|
|
8287
8576
|
e.endCheck
|
|
8288
8577
|
);
|
|
8289
8578
|
}
|
|
8290
|
-
function
|
|
8291
|
-
return
|
|
8579
|
+
function Fu() {
|
|
8580
|
+
return Rt.call(this, "latinWord"), Rt.call(this, "arabicWord"), Rt.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
|
|
8292
8581
|
}
|
|
8293
|
-
function
|
|
8582
|
+
function wu() {
|
|
8294
8583
|
var t = this, e = this.tokenizer.getContextRanges("arabicSentence");
|
|
8295
8584
|
e.forEach(function(r) {
|
|
8296
8585
|
var n = t.tokenizer.getRangeTokens(r);
|
|
@@ -8329,17 +8618,17 @@ function ur() {
|
|
|
8329
8618
|
"glyphIndex modifier is required to apply arabic presentation features."
|
|
8330
8619
|
);
|
|
8331
8620
|
}
|
|
8332
|
-
function
|
|
8621
|
+
function Cu() {
|
|
8333
8622
|
var t = this, e = "arab";
|
|
8334
8623
|
if (this.featuresTags.hasOwnProperty(e)) {
|
|
8335
8624
|
ur.call(this);
|
|
8336
8625
|
var r = this.tokenizer.getContextRanges("arabicWord");
|
|
8337
8626
|
r.forEach(function(n) {
|
|
8338
|
-
|
|
8627
|
+
mu.call(t, n);
|
|
8339
8628
|
});
|
|
8340
8629
|
}
|
|
8341
8630
|
}
|
|
8342
|
-
function
|
|
8631
|
+
function Eu() {
|
|
8343
8632
|
var t = this, e = "arab";
|
|
8344
8633
|
if (this.featuresTags.hasOwnProperty(e)) {
|
|
8345
8634
|
var r = this.featuresTags[e];
|
|
@@ -8347,12 +8636,12 @@ function vu() {
|
|
|
8347
8636
|
ur.call(this);
|
|
8348
8637
|
var n = this.tokenizer.getContextRanges("arabicWord");
|
|
8349
8638
|
n.forEach(function(a) {
|
|
8350
|
-
|
|
8639
|
+
xu.call(t, a);
|
|
8351
8640
|
});
|
|
8352
8641
|
}
|
|
8353
8642
|
}
|
|
8354
8643
|
}
|
|
8355
|
-
function
|
|
8644
|
+
function Ou() {
|
|
8356
8645
|
var t = this, e = "latn";
|
|
8357
8646
|
if (this.featuresTags.hasOwnProperty(e)) {
|
|
8358
8647
|
var r = this.featuresTags[e];
|
|
@@ -8360,7 +8649,7 @@ function gu() {
|
|
|
8360
8649
|
ur.call(this);
|
|
8361
8650
|
var n = this.tokenizer.getContextRanges("latinWord");
|
|
8362
8651
|
n.forEach(function(a) {
|
|
8363
|
-
|
|
8652
|
+
Tu.call(t, a);
|
|
8364
8653
|
});
|
|
8365
8654
|
}
|
|
8366
8655
|
}
|
|
@@ -8369,10 +8658,10 @@ le.prototype.checkContextReady = function(t) {
|
|
|
8369
8658
|
return !!this.tokenizer.getContext(t);
|
|
8370
8659
|
};
|
|
8371
8660
|
le.prototype.applyFeaturesToContexts = function() {
|
|
8372
|
-
this.checkContextReady("arabicWord") && (
|
|
8661
|
+
this.checkContextReady("arabicWord") && (Cu.call(this), Eu.call(this)), this.checkContextReady("latinWord") && Ou.call(this), this.checkContextReady("arabicSentence") && wu.call(this);
|
|
8373
8662
|
};
|
|
8374
8663
|
le.prototype.processText = function(t) {
|
|
8375
|
-
(!this.text || this.text !== t) && (this.setText(t),
|
|
8664
|
+
(!this.text || this.text !== t) && (this.setText(t), Fu.call(this), this.applyFeaturesToContexts());
|
|
8376
8665
|
};
|
|
8377
8666
|
le.prototype.getBidiText = function(t) {
|
|
8378
8667
|
return this.processText(t), this.tokenizer.getText();
|
|
@@ -8389,7 +8678,7 @@ le.prototype.getTextGlyphs = function(t) {
|
|
|
8389
8678
|
return e;
|
|
8390
8679
|
};
|
|
8391
8680
|
function A(t) {
|
|
8392
|
-
t = t || {}, t.tables = t.tables || {}, t.empty || (
|
|
8681
|
+
t = t || {}, t.tables = t.tables || {}, t.empty || (Ne(t.familyName, "When creating a new Font object, familyName is required."), Ne(t.styleName, "When creating a new Font object, styleName is required."), Ne(t.unitsPerEm, "When creating a new Font object, unitsPerEm is required."), Ne(t.ascender, "When creating a new Font object, ascender is required."), Ne(t.descender <= 0, "When creating a new Font object, negative descender value is required."), this.names = {
|
|
8393
8682
|
fontFamily: { en: t.familyName || " " },
|
|
8394
8683
|
fontSubfamily: { en: t.styleName || " " },
|
|
8395
8684
|
fullName: { en: t.fullName || t.familyName + " " + t.styleName },
|
|
@@ -8411,12 +8700,12 @@ function A(t) {
|
|
|
8411
8700
|
usWidthClass: t.widthClass || this.usWidthClasses.MEDIUM,
|
|
8412
8701
|
fsSelection: t.fsSelection || this.fsSelectionValues.REGULAR
|
|
8413
8702
|
}, t.tables.os2)
|
|
8414
|
-
})), 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 Un(this), this.position = new Ke(this), this.substitution = new ee(this), this.tables = this.tables || {}, this._push = null, this._hmtxTableData = {}, Object.defineProperty(this, "hinting", {
|
|
8415
8704
|
get: function() {
|
|
8416
8705
|
if (this._hinting)
|
|
8417
8706
|
return this._hinting;
|
|
8418
8707
|
if (this.outlinesFormat === "truetype")
|
|
8419
|
-
return this._hinting = new
|
|
8708
|
+
return this._hinting = new ia(this);
|
|
8420
8709
|
}
|
|
8421
8710
|
});
|
|
8422
8711
|
}
|
|
@@ -8541,7 +8830,7 @@ A.prototype.validate = function() {
|
|
|
8541
8830
|
r("fontFamily"), r("weightName"), r("manufacturer"), r("copyright"), r("version"), this.unitsPerEm > 0;
|
|
8542
8831
|
};
|
|
8543
8832
|
A.prototype.toTables = function() {
|
|
8544
|
-
return
|
|
8833
|
+
return di.fontToTable(this);
|
|
8545
8834
|
};
|
|
8546
8835
|
A.prototype.toBuffer = function() {
|
|
8547
8836
|
return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."), this.toArrayBuffer();
|
|
@@ -8555,7 +8844,7 @@ A.prototype.download = function(t) {
|
|
|
8555
8844
|
var e = this.getEnglishName("fontFamily"), r = this.getEnglishName("fontSubfamily");
|
|
8556
8845
|
t = t || e.replace(/\s/g, "") + "-" + r + ".otf";
|
|
8557
8846
|
var n = this.toArrayBuffer();
|
|
8558
|
-
if (
|
|
8847
|
+
if (gi())
|
|
8559
8848
|
if (window.URL = window.URL || window.webkitURL, window.URL) {
|
|
8560
8849
|
var a = new DataView(n), s = new Blob([a], { type: "font/opentype" }), i = document.createElement("a");
|
|
8561
8850
|
i.href = window.URL.createObjectURL(s), i.download = t;
|
|
@@ -8564,7 +8853,7 @@ A.prototype.download = function(t) {
|
|
|
8564
8853
|
} else
|
|
8565
8854
|
console.warn("Font file could not be downloaded. Try using a different browser.");
|
|
8566
8855
|
else {
|
|
8567
|
-
var o = require("fs"), l =
|
|
8856
|
+
var o = require("fs"), l = yi(n);
|
|
8568
8857
|
o.writeFileSync(t, l);
|
|
8569
8858
|
}
|
|
8570
8859
|
};
|
|
@@ -8612,7 +8901,7 @@ A.prototype.usWeightClasses = {
|
|
|
8612
8901
|
EXTRA_BOLD: 800,
|
|
8613
8902
|
BLACK: 900
|
|
8614
8903
|
};
|
|
8615
|
-
function
|
|
8904
|
+
function ha(t, e) {
|
|
8616
8905
|
var r = JSON.stringify(t), n = 256;
|
|
8617
8906
|
for (var a in e) {
|
|
8618
8907
|
var s = parseInt(a);
|
|
@@ -8624,8 +8913,8 @@ function la(t, e) {
|
|
|
8624
8913
|
}
|
|
8625
8914
|
return e[n] = t, n;
|
|
8626
8915
|
}
|
|
8627
|
-
function
|
|
8628
|
-
var n =
|
|
8916
|
+
function Uu(t, e, r) {
|
|
8917
|
+
var n = ha(e.name, r);
|
|
8629
8918
|
return [
|
|
8630
8919
|
{ name: "tag_" + t, type: "TAG", value: e.tag },
|
|
8631
8920
|
{ name: "minValue_" + t, type: "FIXED", value: e.minValue << 16 },
|
|
@@ -8635,12 +8924,12 @@ function yu(t, e, r) {
|
|
|
8635
8924
|
{ name: "nameID_" + t, type: "USHORT", value: n }
|
|
8636
8925
|
];
|
|
8637
8926
|
}
|
|
8638
|
-
function
|
|
8927
|
+
function Lu(t, e, r) {
|
|
8639
8928
|
var n = {}, a = new F.Parser(t, e);
|
|
8640
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;
|
|
8641
8930
|
}
|
|
8642
|
-
function
|
|
8643
|
-
for (var a =
|
|
8931
|
+
function Ru(t, e, r, n) {
|
|
8932
|
+
for (var a = ha(e.name, n), s = [
|
|
8644
8933
|
{ name: "nameID_" + t, type: "USHORT", value: a },
|
|
8645
8934
|
{ name: "flags_" + t, type: "USHORT", value: 0 }
|
|
8646
8935
|
], i = 0; i < r.length; ++i) {
|
|
@@ -8653,14 +8942,14 @@ function xu(t, e, r, n) {
|
|
|
8653
8942
|
}
|
|
8654
8943
|
return s;
|
|
8655
8944
|
}
|
|
8656
|
-
function
|
|
8945
|
+
function Au(t, e, r, n) {
|
|
8657
8946
|
var a = {}, s = new F.Parser(t, e);
|
|
8658
8947
|
a.name = n[s.parseUShort()] || {}, s.skip("uShort", 1), a.coordinates = {};
|
|
8659
8948
|
for (var i = 0; i < r.length; ++i)
|
|
8660
8949
|
a.coordinates[r[i].tag] = s.parseFixed();
|
|
8661
8950
|
return a;
|
|
8662
8951
|
}
|
|
8663
|
-
function
|
|
8952
|
+
function Du(t, e) {
|
|
8664
8953
|
var r = new k.Table("fvar", [
|
|
8665
8954
|
{ name: "version", type: "ULONG", value: 65536 },
|
|
8666
8955
|
{ name: "offsetToData", type: "USHORT", value: 0 },
|
|
@@ -8672,28 +8961,28 @@ function Su(t, e) {
|
|
|
8672
8961
|
]);
|
|
8673
8962
|
r.offsetToData = r.sizeOf();
|
|
8674
8963
|
for (var n = 0; n < t.axes.length; n++)
|
|
8675
|
-
r.fields = r.fields.concat(
|
|
8964
|
+
r.fields = r.fields.concat(Uu(n, t.axes[n], e));
|
|
8676
8965
|
for (var a = 0; a < t.instances.length; a++)
|
|
8677
|
-
r.fields = r.fields.concat(
|
|
8966
|
+
r.fields = r.fields.concat(Ru(a, t.instances[a], t.axes, e));
|
|
8678
8967
|
return r;
|
|
8679
8968
|
}
|
|
8680
|
-
function
|
|
8969
|
+
function Mu(t, e, r) {
|
|
8681
8970
|
var n = new F.Parser(t, e), a = n.parseULong();
|
|
8682
8971
|
E.argument(a === 65536, "Unsupported fvar table version.");
|
|
8683
8972
|
var s = n.parseOffset16();
|
|
8684
8973
|
n.skip("uShort", 1);
|
|
8685
8974
|
for (var i = n.parseUShort(), u = n.parseUShort(), o = n.parseUShort(), l = n.parseUShort(), c = [], p = 0; p < i; p++)
|
|
8686
|
-
c.push(
|
|
8975
|
+
c.push(Lu(t, e + s + p * u, r));
|
|
8687
8976
|
for (var h = [], f = e + s + i * u, v = 0; v < o; v++)
|
|
8688
|
-
h.push(
|
|
8977
|
+
h.push(Au(t, f + v * l, c, r));
|
|
8689
8978
|
return { axes: c, instances: h };
|
|
8690
8979
|
}
|
|
8691
|
-
var
|
|
8980
|
+
var Bu = { make: Du, parse: Mu }, Pu = function() {
|
|
8692
8981
|
return {
|
|
8693
8982
|
coverage: this.parsePointer(d.coverage),
|
|
8694
8983
|
attachPoints: this.parseList(d.pointer(d.uShortList))
|
|
8695
8984
|
};
|
|
8696
|
-
},
|
|
8985
|
+
}, Iu = function() {
|
|
8697
8986
|
var t = this.parseUShort();
|
|
8698
8987
|
if (E.argument(
|
|
8699
8988
|
t === 1 || t === 2 || t === 3,
|
|
@@ -8704,17 +8993,17 @@ var Tu = { make: Su, parse: ku }, Fu = function() {
|
|
|
8704
8993
|
return { pointindex: this.parseShort() };
|
|
8705
8994
|
if (t === 3)
|
|
8706
8995
|
return { coordinate: this.parseShort() };
|
|
8707
|
-
},
|
|
8708
|
-
return this.parseList(d.pointer(
|
|
8709
|
-
},
|
|
8996
|
+
}, Gu = function() {
|
|
8997
|
+
return this.parseList(d.pointer(Iu));
|
|
8998
|
+
}, Nu = function() {
|
|
8710
8999
|
return {
|
|
8711
9000
|
coverage: this.parsePointer(d.coverage),
|
|
8712
|
-
ligGlyphs: this.parseList(d.pointer(
|
|
9001
|
+
ligGlyphs: this.parseList(d.pointer(Gu))
|
|
8713
9002
|
};
|
|
8714
|
-
},
|
|
9003
|
+
}, _u = function() {
|
|
8715
9004
|
return this.parseUShort(), this.parseList(d.pointer(d.coverage));
|
|
8716
9005
|
};
|
|
8717
|
-
function
|
|
9006
|
+
function Hu(t, e) {
|
|
8718
9007
|
e = e || 0;
|
|
8719
9008
|
var r = new d(t, e), n = r.parseVersion(1);
|
|
8720
9009
|
E.argument(
|
|
@@ -8724,13 +9013,13 @@ function Uu(t, e) {
|
|
|
8724
9013
|
var a = {
|
|
8725
9014
|
version: n,
|
|
8726
9015
|
classDef: r.parsePointer(d.classDef),
|
|
8727
|
-
attachList: r.parsePointer(
|
|
8728
|
-
ligCaretList: r.parsePointer(
|
|
9016
|
+
attachList: r.parsePointer(Pu),
|
|
9017
|
+
ligCaretList: r.parsePointer(Nu),
|
|
8729
9018
|
markAttachClassDef: r.parsePointer(d.classDef)
|
|
8730
9019
|
};
|
|
8731
|
-
return n >= 1.2 && (a.markGlyphSets = r.parsePointer(
|
|
9020
|
+
return n >= 1.2 && (a.markGlyphSets = r.parsePointer(_u)), a;
|
|
8732
9021
|
}
|
|
8733
|
-
var
|
|
9022
|
+
var zu = { parse: Hu }, oe = new Array(10);
|
|
8734
9023
|
oe[1] = function() {
|
|
8735
9024
|
var e = this.offset + this.relativeOffset, r = this.parseUShort();
|
|
8736
9025
|
if (r === 1)
|
|
@@ -8808,7 +9097,7 @@ oe[8] = function() {
|
|
|
8808
9097
|
oe[9] = function() {
|
|
8809
9098
|
return { error: "GPOS Lookup 9 not supported" };
|
|
8810
9099
|
};
|
|
8811
|
-
function
|
|
9100
|
+
function Wu(t, e) {
|
|
8812
9101
|
e = e || 0;
|
|
8813
9102
|
var r = new d(t, e), n = r.parseVersion(1);
|
|
8814
9103
|
return E.argument(n === 1 || n === 1.1, "Unsupported GPOS table version " + n), n === 1 ? {
|
|
@@ -8824,17 +9113,17 @@ function Ru(t, e) {
|
|
|
8824
9113
|
variations: r.parseFeatureVariationsList()
|
|
8825
9114
|
};
|
|
8826
9115
|
}
|
|
8827
|
-
var
|
|
8828
|
-
function
|
|
9116
|
+
var Vu = new Array(10);
|
|
9117
|
+
function qu(t) {
|
|
8829
9118
|
return new k.Table("GPOS", [
|
|
8830
9119
|
{ name: "version", type: "ULONG", value: 65536 },
|
|
8831
9120
|
{ name: "scripts", type: "TABLE", value: new k.ScriptList(t.scripts) },
|
|
8832
9121
|
{ name: "features", type: "TABLE", value: new k.FeatureList(t.features) },
|
|
8833
|
-
{ name: "lookups", type: "TABLE", value: new k.LookupList(t.lookups,
|
|
9122
|
+
{ name: "lookups", type: "TABLE", value: new k.LookupList(t.lookups, Vu) }
|
|
8834
9123
|
]);
|
|
8835
9124
|
}
|
|
8836
|
-
var
|
|
8837
|
-
function
|
|
9125
|
+
var Xu = { parse: Wu, make: qu };
|
|
9126
|
+
function Yu(t) {
|
|
8838
9127
|
var e = {};
|
|
8839
9128
|
t.skip("uShort");
|
|
8840
9129
|
var r = t.parseUShort();
|
|
@@ -8847,7 +9136,7 @@ function Bu(t) {
|
|
|
8847
9136
|
}
|
|
8848
9137
|
return e;
|
|
8849
9138
|
}
|
|
8850
|
-
function
|
|
9139
|
+
function Zu(t) {
|
|
8851
9140
|
var e = {};
|
|
8852
9141
|
t.skip("uShort");
|
|
8853
9142
|
var r = t.parseULong();
|
|
@@ -8863,31 +9152,31 @@ function Pu(t) {
|
|
|
8863
9152
|
}
|
|
8864
9153
|
return e;
|
|
8865
9154
|
}
|
|
8866
|
-
function
|
|
9155
|
+
function ju(t, e) {
|
|
8867
9156
|
var r = new F.Parser(t, e), n = r.parseUShort();
|
|
8868
9157
|
if (n === 0)
|
|
8869
|
-
return
|
|
9158
|
+
return Yu(r);
|
|
8870
9159
|
if (n === 1)
|
|
8871
|
-
return
|
|
9160
|
+
return Zu(r);
|
|
8872
9161
|
throw new Error("Unsupported kern table version (" + n + ").");
|
|
8873
9162
|
}
|
|
8874
|
-
var
|
|
8875
|
-
function
|
|
9163
|
+
var Ku = { parse: ju };
|
|
9164
|
+
function Qu(t, e, r, n) {
|
|
8876
9165
|
for (var a = new F.Parser(t, e), s = n ? a.parseUShort : a.parseULong, i = [], u = 0; u < r + 1; u += 1) {
|
|
8877
9166
|
var o = s.call(a);
|
|
8878
9167
|
n && (o *= 2), i.push(o);
|
|
8879
9168
|
}
|
|
8880
9169
|
return i;
|
|
8881
9170
|
}
|
|
8882
|
-
var
|
|
8883
|
-
function
|
|
9171
|
+
var Ju = { parse: Qu };
|
|
9172
|
+
function an(t, e) {
|
|
8884
9173
|
for (var r = [], n = 12, a = 0; a < e; a += 1) {
|
|
8885
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);
|
|
8886
9175
|
r.push({ tag: s, checksum: i, offset: u, length: o, compression: !1 }), n += 16;
|
|
8887
9176
|
}
|
|
8888
9177
|
return r;
|
|
8889
9178
|
}
|
|
8890
|
-
function
|
|
9179
|
+
function $u(t, e) {
|
|
8891
9180
|
for (var r = [], n = 44, a = 0; a < e; a += 1) {
|
|
8892
9181
|
var s = F.getTag(t, n), i = F.getULong(t, n + 4), u = F.getULong(t, n + 8), o = F.getULong(t, n + 12), l = void 0;
|
|
8893
9182
|
u < o ? l = "WOFF" : l = !1, r.push({
|
|
@@ -8903,20 +9192,20 @@ function Hu(t, e) {
|
|
|
8903
9192
|
function P(t, e) {
|
|
8904
9193
|
if (e.compression === "WOFF") {
|
|
8905
9194
|
var r = new Uint8Array(t.buffer, e.offset + 2, e.compressedLength - 2), n = new Uint8Array(e.length);
|
|
8906
|
-
if (
|
|
9195
|
+
if (qa(r, n), n.byteLength !== e.length)
|
|
8907
9196
|
throw new Error("Decompression error: " + e.tag + " decompressed length doesn't match recorded length");
|
|
8908
9197
|
var a = new DataView(n.buffer, 0);
|
|
8909
9198
|
return { data: a, offset: 0 };
|
|
8910
9199
|
} else
|
|
8911
9200
|
return { data: t, offset: e.offset };
|
|
8912
9201
|
}
|
|
8913
|
-
function
|
|
9202
|
+
function el(t, e) {
|
|
8914
9203
|
e = e ?? {};
|
|
8915
9204
|
var r, n, a = new A({ empty: !0 }), s = new DataView(t, 0), i, u = [], o = F.getTag(s, 0);
|
|
8916
9205
|
if (o === "\0\0\0" || o === "true" || o === "typ1")
|
|
8917
|
-
a.outlinesFormat = "truetype", i = F.getUShort(s, 4), u =
|
|
9206
|
+
a.outlinesFormat = "truetype", i = F.getUShort(s, 4), u = an(s, i);
|
|
8918
9207
|
else if (o === "OTTO")
|
|
8919
|
-
a.outlinesFormat = "cff", i = F.getUShort(s, 4), u =
|
|
9208
|
+
a.outlinesFormat = "cff", i = F.getUShort(s, 4), u = an(s, i);
|
|
8920
9209
|
else if (o === "wOFF") {
|
|
8921
9210
|
var l = F.getTag(s, 4);
|
|
8922
9211
|
if (l === "\0\0\0")
|
|
@@ -8925,14 +9214,14 @@ function zu(t, e) {
|
|
|
8925
9214
|
a.outlinesFormat = "cff";
|
|
8926
9215
|
else
|
|
8927
9216
|
throw new Error("Unsupported OpenType flavor " + o);
|
|
8928
|
-
i = F.getUShort(s, 12), u =
|
|
9217
|
+
i = F.getUShort(s, 12), u = $u(s, i);
|
|
8929
9218
|
} else
|
|
8930
9219
|
throw new Error("Unsupported OpenType signature " + o);
|
|
8931
9220
|
for (var c, p, h, f, v, g, y, m, S, x, O, w, D = 0; D < i; D += 1) {
|
|
8932
9221
|
var L = u[D], C = void 0;
|
|
8933
9222
|
switch (L.tag) {
|
|
8934
9223
|
case "cmap":
|
|
8935
|
-
C = P(s, L), a.tables.cmap =
|
|
9224
|
+
C = P(s, L), a.tables.cmap = On.parse(C.data, C.offset), a.encoding = new Ln(a.tables.cmap);
|
|
8936
9225
|
break;
|
|
8937
9226
|
case "cvt ":
|
|
8938
9227
|
C = P(s, L), w = new F.Parser(C.data, C.offset), a.tables.cvt = w.parseShortList(L.length / 2);
|
|
@@ -8944,28 +9233,28 @@ function zu(t, e) {
|
|
|
8944
9233
|
C = P(s, L), w = new F.Parser(C.data, C.offset), a.tables.fpgm = w.parseByteList(L.length);
|
|
8945
9234
|
break;
|
|
8946
9235
|
case "head":
|
|
8947
|
-
C = P(s, L), a.tables.head =
|
|
9236
|
+
C = P(s, L), a.tables.head = _n.parse(C.data, C.offset), a.unitsPerEm = a.tables.head.unitsPerEm, r = a.tables.head.indexToLocFormat;
|
|
8948
9237
|
break;
|
|
8949
9238
|
case "hhea":
|
|
8950
|
-
C = P(s, L), a.tables.hhea =
|
|
9239
|
+
C = P(s, L), a.tables.hhea = Hn.parse(C.data, C.offset), a.ascender = a.tables.hhea.ascender, a.descender = a.tables.hhea.descender, a.numberOfHMetrics = a.tables.hhea.numberOfHMetrics;
|
|
8951
9240
|
break;
|
|
8952
9241
|
case "hmtx":
|
|
8953
9242
|
y = L;
|
|
8954
9243
|
break;
|
|
8955
9244
|
case "ltag":
|
|
8956
|
-
C = P(s, L), n =
|
|
9245
|
+
C = P(s, L), n = Wn.parse(C.data, C.offset);
|
|
8957
9246
|
break;
|
|
8958
9247
|
case "maxp":
|
|
8959
|
-
C = P(s, L), a.tables.maxp =
|
|
9248
|
+
C = P(s, L), a.tables.maxp = Vn.parse(C.data, C.offset), a.numGlyphs = a.tables.maxp.numGlyphs;
|
|
8960
9249
|
break;
|
|
8961
9250
|
case "name":
|
|
8962
9251
|
x = L;
|
|
8963
9252
|
break;
|
|
8964
9253
|
case "OS/2":
|
|
8965
|
-
C = P(s, L), a.tables.os2 =
|
|
9254
|
+
C = P(s, L), a.tables.os2 = Kt.parse(C.data, C.offset);
|
|
8966
9255
|
break;
|
|
8967
9256
|
case "post":
|
|
8968
|
-
C = P(s, L), a.tables.post =
|
|
9257
|
+
C = P(s, L), a.tables.post = Kn.parse(C.data, C.offset), a.glyphNames = new rr(a.tables.post);
|
|
8969
9258
|
break;
|
|
8970
9259
|
case "prep":
|
|
8971
9260
|
C = P(s, L), w = new F.Parser(C.data, C.offset), a.tables.prep = w.parseByteList(L.length);
|
|
@@ -8997,43 +9286,43 @@ function zu(t, e) {
|
|
|
8997
9286
|
}
|
|
8998
9287
|
}
|
|
8999
9288
|
var N = P(s, x);
|
|
9000
|
-
if (a.tables.name =
|
|
9001
|
-
var
|
|
9002
|
-
a.glyphs =
|
|
9289
|
+
if (a.tables.name = jn.parse(N.data, N.offset, n), a.names = a.tables.name, h && S) {
|
|
9290
|
+
var j = r === 0, K = P(s, S), re = Ju.parse(K.data, K.offset, a.numGlyphs, j), ne = P(s, h);
|
|
9291
|
+
a.glyphs = na.parse(ne.data, ne.offset, re, a, e);
|
|
9003
9292
|
} else if (c) {
|
|
9004
9293
|
var G = P(s, c);
|
|
9005
|
-
|
|
9294
|
+
Nn.parse(G.data, G.offset, a, e);
|
|
9006
9295
|
} else
|
|
9007
9296
|
throw new Error("Font doesn't contain TrueType or CFF outlines.");
|
|
9008
9297
|
var H = P(s, y);
|
|
9009
|
-
if (
|
|
9298
|
+
if (zn.parse(a, H.data, H.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, e), fs(a, e), m) {
|
|
9010
9299
|
var V = P(s, m);
|
|
9011
|
-
a.kerningPairs =
|
|
9300
|
+
a.kerningPairs = Ku.parse(V.data, V.offset);
|
|
9012
9301
|
} else
|
|
9013
9302
|
a.kerningPairs = {};
|
|
9014
9303
|
if (f) {
|
|
9015
9304
|
var q = P(s, f);
|
|
9016
|
-
a.tables.gdef =
|
|
9305
|
+
a.tables.gdef = zu.parse(q.data, q.offset);
|
|
9017
9306
|
}
|
|
9018
9307
|
if (v) {
|
|
9019
9308
|
var X = P(s, v);
|
|
9020
|
-
a.tables.gpos =
|
|
9309
|
+
a.tables.gpos = Xu.parse(X.data, X.offset), a.position.init();
|
|
9021
9310
|
}
|
|
9022
9311
|
if (g) {
|
|
9023
9312
|
var z = P(s, g);
|
|
9024
|
-
a.tables.gsub =
|
|
9313
|
+
a.tables.gsub = Qn.parse(z.data, z.offset);
|
|
9025
9314
|
}
|
|
9026
9315
|
if (p) {
|
|
9027
9316
|
var Z = P(s, p);
|
|
9028
|
-
a.tables.fvar =
|
|
9317
|
+
a.tables.fvar = Bu.parse(Z.data, Z.offset, a.names);
|
|
9029
9318
|
}
|
|
9030
9319
|
if (O) {
|
|
9031
9320
|
var M = P(s, O);
|
|
9032
|
-
a.tables.meta =
|
|
9321
|
+
a.tables.meta = Jn.parse(M.data, M.offset), a.metas = a.tables.meta;
|
|
9033
9322
|
}
|
|
9034
9323
|
return a;
|
|
9035
9324
|
}
|
|
9036
|
-
function
|
|
9325
|
+
function tl(t) {
|
|
9037
9326
|
return ((r, n) => {
|
|
9038
9327
|
const a = Math.round, s = {}, i = r.encoding.cmap.glyphIndexMap, u = Object.keys(i), o = r.glyphs.glyphs[i[65]];
|
|
9039
9328
|
let l = 1;
|
|
@@ -9069,15 +9358,15 @@ function Wu(t) {
|
|
|
9069
9358
|
scaleFactor: l,
|
|
9070
9359
|
original_font_information: r.tables.name
|
|
9071
9360
|
};
|
|
9072
|
-
})(
|
|
9361
|
+
})(el(t));
|
|
9073
9362
|
}
|
|
9074
|
-
class
|
|
9363
|
+
class sn extends vn {
|
|
9075
9364
|
/**
|
|
9076
9365
|
* Creates a new instance of MeshFont.
|
|
9077
9366
|
* @param data - Either a MeshFontData object containing font information or an ArrayBuffer containing raw font data
|
|
9078
9367
|
*/
|
|
9079
9368
|
constructor(e) {
|
|
9080
|
-
super(), this.type = "mesh", e instanceof ArrayBuffer ? this.data =
|
|
9369
|
+
super(), this.type = "mesh", e instanceof ArrayBuffer ? this.data = tl(e) : this.data = e, this.font = new Ma(this.data);
|
|
9081
9370
|
}
|
|
9082
9371
|
/**
|
|
9083
9372
|
* Generates shapes for a text string
|
|
@@ -9099,7 +9388,7 @@ class en extends vn {
|
|
|
9099
9388
|
this.addUnsupportedChar(e);
|
|
9100
9389
|
return;
|
|
9101
9390
|
}
|
|
9102
|
-
return new
|
|
9391
|
+
return new xr(e, r, this);
|
|
9103
9392
|
}
|
|
9104
9393
|
/**
|
|
9105
9394
|
* Gets the scale factor for this font.
|
|
@@ -9116,7 +9405,7 @@ class en extends vn {
|
|
|
9116
9405
|
* @returns The shape data for the not found indicator
|
|
9117
9406
|
*/
|
|
9118
9407
|
getNotFoundTextShape(e) {
|
|
9119
|
-
return new
|
|
9408
|
+
return new xr("?", e, this);
|
|
9120
9409
|
}
|
|
9121
9410
|
}
|
|
9122
9411
|
let Q = class {
|
|
@@ -9276,7 +9565,7 @@ let Q = class {
|
|
|
9276
9565
|
}
|
|
9277
9566
|
};
|
|
9278
9567
|
var $ = /* @__PURE__ */ ((t) => (t.SHAPES = "shapes", t.BIGFONT = "bigfont", t.UNIFONT = "unifont", t))($ || {});
|
|
9279
|
-
class
|
|
9568
|
+
class rl {
|
|
9280
9569
|
parse(e) {
|
|
9281
9570
|
const r = this.parseHeader(e).split(" "), n = r[1].toLocaleLowerCase();
|
|
9282
9571
|
if (!Object.values($).includes(n))
|
|
@@ -9303,7 +9592,7 @@ class Vu {
|
|
|
9303
9592
|
return r.trim();
|
|
9304
9593
|
}
|
|
9305
9594
|
}
|
|
9306
|
-
class
|
|
9595
|
+
class nl {
|
|
9307
9596
|
parse(e) {
|
|
9308
9597
|
try {
|
|
9309
9598
|
e.readBytes(4);
|
|
@@ -9355,7 +9644,7 @@ class qu {
|
|
|
9355
9644
|
}
|
|
9356
9645
|
}
|
|
9357
9646
|
}
|
|
9358
|
-
class
|
|
9647
|
+
class al {
|
|
9359
9648
|
parse(e) {
|
|
9360
9649
|
try {
|
|
9361
9650
|
e.readInt16();
|
|
@@ -9440,7 +9729,7 @@ class Xu {
|
|
|
9440
9729
|
return r;
|
|
9441
9730
|
}
|
|
9442
9731
|
}
|
|
9443
|
-
class
|
|
9732
|
+
class sl {
|
|
9444
9733
|
parse(e) {
|
|
9445
9734
|
try {
|
|
9446
9735
|
const r = e.readInt32();
|
|
@@ -9486,15 +9775,15 @@ class Yu {
|
|
|
9486
9775
|
}
|
|
9487
9776
|
}
|
|
9488
9777
|
}
|
|
9489
|
-
class
|
|
9778
|
+
class il {
|
|
9490
9779
|
static createParser(e) {
|
|
9491
9780
|
switch (e) {
|
|
9492
9781
|
case $.SHAPES:
|
|
9493
|
-
return new
|
|
9782
|
+
return new nl();
|
|
9494
9783
|
case $.BIGFONT:
|
|
9495
|
-
return new
|
|
9784
|
+
return new al();
|
|
9496
9785
|
case $.UNIFONT:
|
|
9497
|
-
return new
|
|
9786
|
+
return new sl();
|
|
9498
9787
|
default:
|
|
9499
9788
|
throw new Error(`Unsupported font type: ${e}`);
|
|
9500
9789
|
}
|
|
@@ -9600,7 +9889,7 @@ class I {
|
|
|
9600
9889
|
return Math.sqrt(r * r + n * n);
|
|
9601
9890
|
}
|
|
9602
9891
|
}
|
|
9603
|
-
const
|
|
9892
|
+
const on = Math.PI / 4;
|
|
9604
9893
|
class Ye {
|
|
9605
9894
|
/**
|
|
9606
9895
|
* Creates a bulge-defined arc
|
|
@@ -9646,8 +9935,8 @@ class Ye {
|
|
|
9646
9935
|
const s = this.start.clone().add(r.clone().divide(2)), i = new I(-r.y, r.x);
|
|
9647
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);
|
|
9648
9937
|
} else if (e.center && e.radius !== void 0 && e.startOctant !== void 0 && e.octantCount !== void 0 && e.isClockwise !== void 0) {
|
|
9649
|
-
this.center = e.center.clone(), this.radius = e.radius, this.isClockwise = e.isClockwise, this.startAngle = e.startOctant *
|
|
9650
|
-
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 * on;
|
|
9939
|
+
const r = (e.octantCount === 0 ? 8 : e.octantCount) * on;
|
|
9651
9940
|
this.endAngle = this.startAngle + (this.isClockwise ? -r : r), this.start = this.center.clone().add(
|
|
9652
9941
|
new I(
|
|
9653
9942
|
this.radius * Math.cos(this.startAngle),
|
|
@@ -9684,7 +9973,7 @@ class Ye {
|
|
|
9684
9973
|
), r;
|
|
9685
9974
|
}
|
|
9686
9975
|
}
|
|
9687
|
-
let
|
|
9976
|
+
let At = class fa {
|
|
9688
9977
|
constructor(e, r = []) {
|
|
9689
9978
|
this.lastPoint = e, this.polylines = r;
|
|
9690
9979
|
}
|
|
@@ -9708,7 +9997,7 @@ let Ut = class ca {
|
|
|
9708
9997
|
*/
|
|
9709
9998
|
offset(e, r = !0) {
|
|
9710
9999
|
var n, a;
|
|
9711
|
-
return r ? new
|
|
10000
|
+
return r ? new fa(
|
|
9712
10001
|
(n = this.lastPoint) == null ? void 0 : n.clone().add(e),
|
|
9713
10002
|
this.polylines.map((s) => s.map((i) => i.clone().add(e)))
|
|
9714
10003
|
) : ((a = this.lastPoint) == null || a.add(e), this.polylines.forEach((s) => s.forEach((i) => i.add(e))), this);
|
|
@@ -9741,8 +10030,8 @@ let Ut = class ca {
|
|
|
9741
10030
|
return `<svg width="100%" height="100%" viewBox="${s}" preserveAspectRatio="xMidYMid meet">${i}</svg>`;
|
|
9742
10031
|
}
|
|
9743
10032
|
};
|
|
9744
|
-
const
|
|
9745
|
-
class
|
|
10033
|
+
const ol = Math.PI / 18, un = 12;
|
|
10034
|
+
class ul {
|
|
9746
10035
|
constructor(e) {
|
|
9747
10036
|
this.shapeCache = /* @__PURE__ */ new Map(), this.shapeData = /* @__PURE__ */ new Map(), this.fontData = e;
|
|
9748
10037
|
}
|
|
@@ -9768,12 +10057,12 @@ class ju {
|
|
|
9768
10057
|
const s = this.fontData.content.data;
|
|
9769
10058
|
let i;
|
|
9770
10059
|
if (!this.shapeData.has(e) && s[e]) {
|
|
9771
|
-
const u = s[e], o =
|
|
10060
|
+
const u = s[e], o = un / this.fontData.content.baseUp;
|
|
9772
10061
|
i = this.parseShape(u, o), this.shapeData.set(e, i);
|
|
9773
10062
|
}
|
|
9774
10063
|
if (this.shapeData.has(e)) {
|
|
9775
|
-
const u = r /
|
|
9776
|
-
i = new
|
|
10064
|
+
const u = r / un, o = this.shapeData.get(e);
|
|
10065
|
+
i = new At(
|
|
9777
10066
|
(n = o.lastPoint) == null ? void 0 : n.clone().multiply(u),
|
|
9778
10067
|
o.polylines.map((l) => l.map((c) => c.clone().multiply(u)))
|
|
9779
10068
|
);
|
|
@@ -9799,7 +10088,7 @@ class ju {
|
|
|
9799
10088
|
const s = e[a];
|
|
9800
10089
|
s <= 15 ? a = this.handleSpecialCommand(s, e, a, n) : this.handleVectorCommand(s, n);
|
|
9801
10090
|
}
|
|
9802
|
-
return new
|
|
10091
|
+
return new At(n.currentPoint, n.polylines);
|
|
9803
10092
|
}
|
|
9804
10093
|
/**
|
|
9805
10094
|
* Please refer to special codes reference in the following link for more information.
|
|
@@ -9976,7 +10265,7 @@ class ju {
|
|
|
9976
10265
|
let h = c & 7;
|
|
9977
10266
|
h === 0 && (h = 8), i !== 0 && h--;
|
|
9978
10267
|
const f = Math.PI / 4;
|
|
9979
|
-
let v = f * h, g =
|
|
10268
|
+
let v = f * h, g = ol, y = 1;
|
|
9980
10269
|
c < 0 && (g = -g, v = -v, y = -1);
|
|
9981
10270
|
let m = f * p, S = m + v;
|
|
9982
10271
|
m += f * s / 256 * y, S += f * i / 256 * y;
|
|
@@ -10101,7 +10390,7 @@ class ju {
|
|
|
10101
10390
|
const u = (s = i.lastPoint) == null ? void 0 : s.clone();
|
|
10102
10391
|
u && (u.x *= r / n);
|
|
10103
10392
|
const o = i.polylines.map((l) => l.map((c) => c.clone()));
|
|
10104
|
-
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 At(
|
|
10105
10394
|
u == null ? void 0 : u.add(a),
|
|
10106
10395
|
o.map((l) => l.map((c) => c.add(a)))
|
|
10107
10396
|
);
|
|
@@ -10131,7 +10420,7 @@ class ju {
|
|
|
10131
10420
|
return u.add(r), u;
|
|
10132
10421
|
}
|
|
10133
10422
|
}
|
|
10134
|
-
class
|
|
10423
|
+
class ll {
|
|
10135
10424
|
/**
|
|
10136
10425
|
* Creates a new ShxFont instance.
|
|
10137
10426
|
* @param data - Either raw binary data of the SHX font file (ArrayBuffer) or pre-parsed font data (ShxFontData)
|
|
@@ -10139,14 +10428,14 @@ class Qu {
|
|
|
10139
10428
|
*/
|
|
10140
10429
|
constructor(e) {
|
|
10141
10430
|
if (e instanceof ArrayBuffer) {
|
|
10142
|
-
const r = new Q(e), n = new
|
|
10431
|
+
const r = new Q(e), n = new rl().parse(r), a = il.createParser(n.fontType).parse(r);
|
|
10143
10432
|
this.fontData = {
|
|
10144
10433
|
header: n,
|
|
10145
10434
|
content: a
|
|
10146
10435
|
};
|
|
10147
10436
|
} else
|
|
10148
10437
|
this.fontData = e;
|
|
10149
|
-
this.shapeParser = new
|
|
10438
|
+
this.shapeParser = new ul(this.fontData);
|
|
10150
10439
|
}
|
|
10151
10440
|
/**
|
|
10152
10441
|
* Gets the shape data for a specific character at a given size.
|
|
@@ -10199,9 +10488,9 @@ class lr extends gn {
|
|
|
10199
10488
|
return s.setAttribute("position", new R.Float32BufferAttribute(r, 3)), s.setIndex(n), s;
|
|
10200
10489
|
}
|
|
10201
10490
|
}
|
|
10202
|
-
class
|
|
10491
|
+
class ln extends vn {
|
|
10203
10492
|
constructor(e) {
|
|
10204
|
-
super(), this.type = "shx", this.font = new
|
|
10493
|
+
super(), this.type = "shx", this.font = new ll(e), this.data = this.font.fontData;
|
|
10205
10494
|
}
|
|
10206
10495
|
generateShapes(e, r) {
|
|
10207
10496
|
const n = [];
|
|
@@ -10272,9 +10561,9 @@ class Se {
|
|
|
10272
10561
|
*/
|
|
10273
10562
|
createFont(e) {
|
|
10274
10563
|
if (e.type === "shx")
|
|
10275
|
-
return new
|
|
10564
|
+
return new ln(e.data);
|
|
10276
10565
|
if (e.type === "mesh")
|
|
10277
|
-
return new
|
|
10566
|
+
return new sn(e.data);
|
|
10278
10567
|
throw new Error("Unsupported font data type");
|
|
10279
10568
|
}
|
|
10280
10569
|
/**
|
|
@@ -10287,304 +10576,15 @@ class Se {
|
|
|
10287
10576
|
* @throws {Error} If the file type is not supported
|
|
10288
10577
|
*/
|
|
10289
10578
|
createFontFromBuffer(e, r) {
|
|
10290
|
-
const n =
|
|
10579
|
+
const n = Ra(e).toLowerCase();
|
|
10291
10580
|
if (n === "shx")
|
|
10292
|
-
return new
|
|
10581
|
+
return new ln(r);
|
|
10293
10582
|
if (["ttf", "otf", "woff"].includes(n))
|
|
10294
|
-
return new
|
|
10583
|
+
return new sn(r);
|
|
10295
10584
|
throw new Error(`Unsupported font file type: ${n}`);
|
|
10296
10585
|
}
|
|
10297
10586
|
}
|
|
10298
|
-
|
|
10299
|
-
let an, sn;
|
|
10300
|
-
function Ju() {
|
|
10301
|
-
return an || (an = [
|
|
10302
|
-
IDBDatabase,
|
|
10303
|
-
IDBObjectStore,
|
|
10304
|
-
IDBIndex,
|
|
10305
|
-
IDBCursor,
|
|
10306
|
-
IDBTransaction
|
|
10307
|
-
]);
|
|
10308
|
-
}
|
|
10309
|
-
function $u() {
|
|
10310
|
-
return sn || (sn = [
|
|
10311
|
-
IDBCursor.prototype.advance,
|
|
10312
|
-
IDBCursor.prototype.continue,
|
|
10313
|
-
IDBCursor.prototype.continuePrimaryKey
|
|
10314
|
-
]);
|
|
10315
|
-
}
|
|
10316
|
-
const Zt = /* @__PURE__ */ new WeakMap(), Lt = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap();
|
|
10317
|
-
function el(t) {
|
|
10318
|
-
const e = new Promise((r, n) => {
|
|
10319
|
-
const a = () => {
|
|
10320
|
-
t.removeEventListener("success", s), t.removeEventListener("error", i);
|
|
10321
|
-
}, s = () => {
|
|
10322
|
-
r(Ue(t.result)), a();
|
|
10323
|
-
}, i = () => {
|
|
10324
|
-
n(t.error), a();
|
|
10325
|
-
};
|
|
10326
|
-
t.addEventListener("success", s), t.addEventListener("error", i);
|
|
10327
|
-
});
|
|
10328
|
-
return gt.set(e, t), e;
|
|
10329
|
-
}
|
|
10330
|
-
function tl(t) {
|
|
10331
|
-
if (Zt.has(t))
|
|
10332
|
-
return;
|
|
10333
|
-
const e = new Promise((r, n) => {
|
|
10334
|
-
const a = () => {
|
|
10335
|
-
t.removeEventListener("complete", s), t.removeEventListener("error", i), t.removeEventListener("abort", i);
|
|
10336
|
-
}, s = () => {
|
|
10337
|
-
r(), a();
|
|
10338
|
-
}, i = () => {
|
|
10339
|
-
n(t.error || new DOMException("AbortError", "AbortError")), a();
|
|
10340
|
-
};
|
|
10341
|
-
t.addEventListener("complete", s), t.addEventListener("error", i), t.addEventListener("abort", i);
|
|
10342
|
-
});
|
|
10343
|
-
Zt.set(t, e);
|
|
10344
|
-
}
|
|
10345
|
-
let Kt = {
|
|
10346
|
-
get(t, e, r) {
|
|
10347
|
-
if (t instanceof IDBTransaction) {
|
|
10348
|
-
if (e === "done")
|
|
10349
|
-
return Zt.get(t);
|
|
10350
|
-
if (e === "store")
|
|
10351
|
-
return r.objectStoreNames[1] ? void 0 : r.objectStore(r.objectStoreNames[0]);
|
|
10352
|
-
}
|
|
10353
|
-
return Ue(t[e]);
|
|
10354
|
-
},
|
|
10355
|
-
set(t, e, r) {
|
|
10356
|
-
return t[e] = r, !0;
|
|
10357
|
-
},
|
|
10358
|
-
has(t, e) {
|
|
10359
|
-
return t instanceof IDBTransaction && (e === "done" || e === "store") ? !0 : e in t;
|
|
10360
|
-
}
|
|
10361
|
-
};
|
|
10362
|
-
function ha(t) {
|
|
10363
|
-
Kt = t(Kt);
|
|
10364
|
-
}
|
|
10365
|
-
function rl(t) {
|
|
10366
|
-
return $u().includes(t) ? function(...e) {
|
|
10367
|
-
return t.apply(jt(this), e), Ue(this.request);
|
|
10368
|
-
} : function(...e) {
|
|
10369
|
-
return Ue(t.apply(jt(this), e));
|
|
10370
|
-
};
|
|
10371
|
-
}
|
|
10372
|
-
function nl(t) {
|
|
10373
|
-
return typeof t == "function" ? rl(t) : (t instanceof IDBTransaction && tl(t), Yt(t, Ju()) ? new Proxy(t, Kt) : t);
|
|
10374
|
-
}
|
|
10375
|
-
function Ue(t) {
|
|
10376
|
-
if (t instanceof IDBRequest)
|
|
10377
|
-
return el(t);
|
|
10378
|
-
if (Lt.has(t))
|
|
10379
|
-
return Lt.get(t);
|
|
10380
|
-
const e = nl(t);
|
|
10381
|
-
return e !== t && (Lt.set(t, e), gt.set(e, t)), e;
|
|
10382
|
-
}
|
|
10383
|
-
const jt = (t) => gt.get(t);
|
|
10384
|
-
function al(t, e, { blocked: r, upgrade: n, blocking: a, terminated: s } = {}) {
|
|
10385
|
-
const i = indexedDB.open(t, e), u = Ue(i);
|
|
10386
|
-
return n && i.addEventListener("upgradeneeded", (o) => {
|
|
10387
|
-
n(Ue(i.result), o.oldVersion, o.newVersion, Ue(i.transaction), o);
|
|
10388
|
-
}), r && i.addEventListener("blocked", (o) => r(
|
|
10389
|
-
// Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
|
|
10390
|
-
o.oldVersion,
|
|
10391
|
-
o.newVersion,
|
|
10392
|
-
o
|
|
10393
|
-
)), u.then((o) => {
|
|
10394
|
-
s && o.addEventListener("close", () => s()), a && o.addEventListener("versionchange", (l) => a(l.oldVersion, l.newVersion, l));
|
|
10395
|
-
}).catch(() => {
|
|
10396
|
-
}), u;
|
|
10397
|
-
}
|
|
10398
|
-
const sl = ["get", "getKey", "getAll", "getAllKeys", "count"], il = ["put", "add", "delete", "clear"], Rt = /* @__PURE__ */ new Map();
|
|
10399
|
-
function on(t, e) {
|
|
10400
|
-
if (!(t instanceof IDBDatabase && !(e in t) && typeof e == "string"))
|
|
10401
|
-
return;
|
|
10402
|
-
if (Rt.get(e))
|
|
10403
|
-
return Rt.get(e);
|
|
10404
|
-
const r = e.replace(/FromIndex$/, ""), n = e !== r, a = il.includes(r);
|
|
10405
|
-
if (
|
|
10406
|
-
// Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
|
|
10407
|
-
!(r in (n ? IDBIndex : IDBObjectStore).prototype) || !(a || sl.includes(r))
|
|
10408
|
-
)
|
|
10409
|
-
return;
|
|
10410
|
-
const s = async function(i, ...u) {
|
|
10411
|
-
const o = this.transaction(i, a ? "readwrite" : "readonly");
|
|
10412
|
-
let l = o.store;
|
|
10413
|
-
return n && (l = l.index(u.shift())), (await Promise.all([
|
|
10414
|
-
l[r](...u),
|
|
10415
|
-
a && o.done
|
|
10416
|
-
]))[0];
|
|
10417
|
-
};
|
|
10418
|
-
return Rt.set(e, s), s;
|
|
10419
|
-
}
|
|
10420
|
-
ha((t) => ({
|
|
10421
|
-
...t,
|
|
10422
|
-
get: (e, r, n) => on(e, r) || t.get(e, r, n),
|
|
10423
|
-
has: (e, r) => !!on(e, r) || t.has(e, r)
|
|
10424
|
-
}));
|
|
10425
|
-
const ol = ["continue", "continuePrimaryKey", "advance"], un = {}, Qt = /* @__PURE__ */ new WeakMap(), fa = /* @__PURE__ */ new WeakMap(), ul = {
|
|
10426
|
-
get(t, e) {
|
|
10427
|
-
if (!ol.includes(e))
|
|
10428
|
-
return t[e];
|
|
10429
|
-
let r = un[e];
|
|
10430
|
-
return r || (r = un[e] = function(...n) {
|
|
10431
|
-
Qt.set(this, fa.get(this)[e](...n));
|
|
10432
|
-
}), r;
|
|
10433
|
-
}
|
|
10434
|
-
};
|
|
10435
|
-
async function* ll(...t) {
|
|
10436
|
-
let e = this;
|
|
10437
|
-
if (e instanceof IDBCursor || (e = await e.openCursor(...t)), !e)
|
|
10438
|
-
return;
|
|
10439
|
-
e = e;
|
|
10440
|
-
const r = new Proxy(e, ul);
|
|
10441
|
-
for (fa.set(r, e), gt.set(r, jt(e)); e; )
|
|
10442
|
-
yield r, e = await (Qt.get(r) || e.continue()), Qt.delete(r);
|
|
10443
|
-
}
|
|
10444
|
-
function ln(t, e) {
|
|
10445
|
-
return e === Symbol.asyncIterator && Yt(t, [IDBIndex, IDBObjectStore, IDBCursor]) || e === "iterate" && Yt(t, [IDBIndex, IDBObjectStore]);
|
|
10446
|
-
}
|
|
10447
|
-
ha((t) => ({
|
|
10448
|
-
...t,
|
|
10449
|
-
get(e, r, n) {
|
|
10450
|
-
return ln(e, r) ? ll : t.get(e, r, n);
|
|
10451
|
-
},
|
|
10452
|
-
has(e, r) {
|
|
10453
|
-
return ln(e, r) || t.has(e, r);
|
|
10454
|
-
}
|
|
10455
|
-
}));
|
|
10456
|
-
const Ae = {
|
|
10457
|
-
fonts: "fonts"
|
|
10458
|
-
}, At = [
|
|
10459
|
-
{
|
|
10460
|
-
version: 1,
|
|
10461
|
-
stores: [
|
|
10462
|
-
{
|
|
10463
|
-
name: Ae.fonts,
|
|
10464
|
-
keyPath: "name"
|
|
10465
|
-
}
|
|
10466
|
-
]
|
|
10467
|
-
}
|
|
10468
|
-
], J = class J {
|
|
10469
|
-
constructor() {
|
|
10470
|
-
this.isClosing = !1, typeof window < "u" && window.addEventListener("unload", () => {
|
|
10471
|
-
this.close();
|
|
10472
|
-
});
|
|
10473
|
-
}
|
|
10474
|
-
/**
|
|
10475
|
-
* Returns the singleton instance of the FontCacheManager
|
|
10476
|
-
*/
|
|
10477
|
-
static get instance() {
|
|
10478
|
-
return J._instance || (J._instance = new J()), J._instance;
|
|
10479
|
-
}
|
|
10480
|
-
/**
|
|
10481
|
-
* Sets a font in the cache
|
|
10482
|
-
* @param fileName The font file name (key)
|
|
10483
|
-
* @param fontData The font data to store
|
|
10484
|
-
*/
|
|
10485
|
-
async set(e, r) {
|
|
10486
|
-
await (await this.getDatabase()).put(Ae.fonts, { ...r, name: e });
|
|
10487
|
-
}
|
|
10488
|
-
/**
|
|
10489
|
-
* Gets a font from the cache
|
|
10490
|
-
* @param fileName The font file name (key)
|
|
10491
|
-
* @returns The font data if found, undefined otherwise
|
|
10492
|
-
*/
|
|
10493
|
-
async get(e) {
|
|
10494
|
-
return await (await this.getDatabase()).get(Ae.fonts, e);
|
|
10495
|
-
}
|
|
10496
|
-
/**
|
|
10497
|
-
* Deletes a font from the cache
|
|
10498
|
-
* @param fileName The font file name (key)
|
|
10499
|
-
*/
|
|
10500
|
-
async delete(e) {
|
|
10501
|
-
await (await this.getDatabase()).delete(Ae.fonts, e);
|
|
10502
|
-
}
|
|
10503
|
-
/**
|
|
10504
|
-
* Gets all fonts from the cache
|
|
10505
|
-
* @returns An array of all font data in the cache
|
|
10506
|
-
*/
|
|
10507
|
-
async getAll() {
|
|
10508
|
-
return await (await this.getDatabase()).getAll(Ae.fonts);
|
|
10509
|
-
}
|
|
10510
|
-
/**
|
|
10511
|
-
* Clears all fonts from the cache
|
|
10512
|
-
*/
|
|
10513
|
-
async clear() {
|
|
10514
|
-
await (await this.getDatabase()).clear(Ae.fonts);
|
|
10515
|
-
}
|
|
10516
|
-
/**
|
|
10517
|
-
* Checks if a font exists in the cache
|
|
10518
|
-
* @param fileName The font file name (key)
|
|
10519
|
-
*/
|
|
10520
|
-
async has(e) {
|
|
10521
|
-
return await this.get(e) !== void 0;
|
|
10522
|
-
}
|
|
10523
|
-
/**
|
|
10524
|
-
* Closes the database connection and cleans up resources.
|
|
10525
|
-
* After calling this, any further operations will require reopening the database.
|
|
10526
|
-
*/
|
|
10527
|
-
close() {
|
|
10528
|
-
if (!this.isClosing) {
|
|
10529
|
-
this.isClosing = !0;
|
|
10530
|
-
try {
|
|
10531
|
-
this.db && (this.db.close(), this.db = void 0);
|
|
10532
|
-
} finally {
|
|
10533
|
-
this.isClosing = !1;
|
|
10534
|
-
}
|
|
10535
|
-
}
|
|
10536
|
-
}
|
|
10537
|
-
/**
|
|
10538
|
-
* Destroys the database instance and deletes all data.
|
|
10539
|
-
* Use with caution as this operation cannot be undone.
|
|
10540
|
-
*/
|
|
10541
|
-
async destroy() {
|
|
10542
|
-
this.close(), await indexedDB.deleteDatabase(J.DATABASE_NAME), J._instance = void 0;
|
|
10543
|
-
}
|
|
10544
|
-
// Private methods for database management
|
|
10545
|
-
async getDatabase() {
|
|
10546
|
-
if (this.isClosing)
|
|
10547
|
-
throw new Error("Cannot perform operation while database is closing");
|
|
10548
|
-
return this.db ? this.db : (this.db = await al(
|
|
10549
|
-
J.DATABASE_NAME,
|
|
10550
|
-
J.DATABASE_VERSION,
|
|
10551
|
-
{
|
|
10552
|
-
upgrade: (e, r, n) => this.handleUpgrade(e, r, n),
|
|
10553
|
-
blocked() {
|
|
10554
|
-
console.warn("Database upgrade blocked - please close other tabs using the application");
|
|
10555
|
-
},
|
|
10556
|
-
blocking() {
|
|
10557
|
-
console.warn("Database blocking newer version - closing connection"), J.instance.close();
|
|
10558
|
-
}
|
|
10559
|
-
}
|
|
10560
|
-
), this.db);
|
|
10561
|
-
}
|
|
10562
|
-
/**
|
|
10563
|
-
* Applies all schema versions that are greater than the old version and less than or equal to the new version
|
|
10564
|
-
* @param db The database instance
|
|
10565
|
-
* @param oldVersion The old version of the database
|
|
10566
|
-
* @param newVersion The new version of the database
|
|
10567
|
-
*/
|
|
10568
|
-
handleUpgrade(e, r, n) {
|
|
10569
|
-
const a = At.filter(
|
|
10570
|
-
(s) => s.version > r && (!n || s.version <= n)
|
|
10571
|
-
);
|
|
10572
|
-
for (const s of a)
|
|
10573
|
-
this.applySchemaVersion(e, s);
|
|
10574
|
-
}
|
|
10575
|
-
/**
|
|
10576
|
-
* Applies a single schema version's changes to the database
|
|
10577
|
-
* @param db The database instance
|
|
10578
|
-
* @param schema The schema version to apply
|
|
10579
|
-
*/
|
|
10580
|
-
applySchemaVersion(e, r) {
|
|
10581
|
-
for (const n of r.stores)
|
|
10582
|
-
e.objectStoreNames.contains(n.name) || e.createObjectStore(n.name, { keyPath: n.keyPath });
|
|
10583
|
-
}
|
|
10584
|
-
};
|
|
10585
|
-
J.DATABASE_NAME = "mlightcad", J.DATABASE_VERSION = At[At.length - 1].version;
|
|
10586
|
-
let ze = J;
|
|
10587
|
-
class Ne {
|
|
10587
|
+
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 */
|
|
@@ -10598,7 +10598,7 @@ class Ne {
|
|
|
10598
10598
|
* @returns The FontManager instance
|
|
10599
10599
|
*/
|
|
10600
10600
|
static get instance() {
|
|
10601
|
-
return
|
|
10601
|
+
return Me._instance || (Me._instance = new Me()), Me._instance;
|
|
10602
10602
|
}
|
|
10603
10603
|
/**
|
|
10604
10604
|
* Sets the font mapping configuration
|
|
@@ -10622,7 +10622,7 @@ class Ne {
|
|
|
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 = mr(o.toLowerCase());
|
|
10626
10626
|
n.push({
|
|
10627
10627
|
fontName: l,
|
|
10628
10628
|
url: o,
|
|
@@ -10711,16 +10711,16 @@ class Ne {
|
|
|
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 = xn(e);
|
|
10715
10715
|
if (!r)
|
|
10716
10716
|
throw new Error(`Invalid font url: ${e}`);
|
|
10717
|
-
const n =
|
|
10717
|
+
const n = mr(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);
|
|
10721
10721
|
} else {
|
|
10722
10722
|
const s = await this.loader.loadAsync(e), i = Se.instance.createFontFromBuffer(r, s);
|
|
10723
|
-
i && (this.fontMap.set(n, i), this.enableFontCache && await
|
|
10723
|
+
i && (this.fontMap.set(n, i), this.enableFontCache && await He.instance.set(n, {
|
|
10724
10724
|
name: n,
|
|
10725
10725
|
type: i.type,
|
|
10726
10726
|
data: i.data
|
|
@@ -10736,7 +10736,7 @@ class Ne {
|
|
|
10736
10736
|
async getAllFontsFromCache() {
|
|
10737
10737
|
if (this.fontMap.size !== 0)
|
|
10738
10738
|
return;
|
|
10739
|
-
const e = await
|
|
10739
|
+
const e = await He.instance.getAll();
|
|
10740
10740
|
for (const r of e) {
|
|
10741
10741
|
const { name: n } = r;
|
|
10742
10742
|
if (this.fileNames && !this.fileNames.includes(n))
|
|
@@ -10761,6 +10761,56 @@ class Ne {
|
|
|
10761
10761
|
this.fontMap.clear();
|
|
10762
10762
|
}
|
|
10763
10763
|
}
|
|
10764
|
+
class bl {
|
|
10765
|
+
/**
|
|
10766
|
+
* Creates a new instance of DefaultFontLoader
|
|
10767
|
+
*/
|
|
10768
|
+
constructor() {
|
|
10769
|
+
this._avaiableFonts = [];
|
|
10770
|
+
}
|
|
10771
|
+
/**
|
|
10772
|
+
* Gets the list of available fonts
|
|
10773
|
+
* @returns Array of FontInfo objects describing available fonts
|
|
10774
|
+
*/
|
|
10775
|
+
get avaiableFonts() {
|
|
10776
|
+
return this._avaiableFonts;
|
|
10777
|
+
}
|
|
10778
|
+
/**
|
|
10779
|
+
* Retrieves information about all available fonts in the system.
|
|
10780
|
+
* Loads font metadata from a CDN if not already loaded.
|
|
10781
|
+
* @returns Promise that resolves to an array of FontInfo objects
|
|
10782
|
+
* @throws {Error} If font metadata cannot be loaded from the CDN
|
|
10783
|
+
*/
|
|
10784
|
+
async getAvaiableFonts() {
|
|
10785
|
+
if (this._avaiableFonts.length == 0) {
|
|
10786
|
+
const e = "https://cdn.jsdelivr.net/gh/mlight-lee/cad-data/fonts/", r = e + "fonts.json";
|
|
10787
|
+
try {
|
|
10788
|
+
const n = await fetch(r);
|
|
10789
|
+
this._avaiableFonts = await n.json();
|
|
10790
|
+
} catch {
|
|
10791
|
+
throw new Error(`Filed to get avaiable font from '${r}'`);
|
|
10792
|
+
}
|
|
10793
|
+
this._avaiableFonts.forEach((n) => {
|
|
10794
|
+
n.url = e + n.file;
|
|
10795
|
+
});
|
|
10796
|
+
}
|
|
10797
|
+
return this._avaiableFonts;
|
|
10798
|
+
}
|
|
10799
|
+
/**
|
|
10800
|
+
* Loads the specified fonts into the system.
|
|
10801
|
+
* If no font names are provided, loads all available fonts.
|
|
10802
|
+
* @param fontNames - Array of font names to load
|
|
10803
|
+
* @returns Promise that resolves to an array of FontLoadStatus objects
|
|
10804
|
+
*/
|
|
10805
|
+
async load(e) {
|
|
10806
|
+
e.length == 0 && await this.getAvaiableFonts();
|
|
10807
|
+
const r = [];
|
|
10808
|
+
return e.forEach((n) => {
|
|
10809
|
+
const a = n.toLowerCase(), s = this._avaiableFonts.find((i) => i.name.findIndex((u) => u.toLowerCase() === a) >= 0);
|
|
10810
|
+
s && r.push(s.url);
|
|
10811
|
+
}), await Me.instance.loadFonts(r);
|
|
10812
|
+
}
|
|
10813
|
+
}
|
|
10764
10814
|
var Ze = /* @__PURE__ */ ((t) => (t[t.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", t[t.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", t[t.TOP_TO_BOTTOM = 3] = "TOP_TO_BOTTOM", t[t.BOTTOM_TO_TOP = 4] = "BOTTOM_TO_TOP", t[t.BY_STYLE = 5] = "BY_STYLE", t))(Ze || {}), cl = /* @__PURE__ */ ((t) => (t[t.TopLeft = 1] = "TopLeft", t[t.TopCenter = 2] = "TopCenter", t[t.TopRight = 3] = "TopRight", t[t.MiddleLeft = 4] = "MiddleLeft", t[t.MiddleCenter = 5] = "MiddleCenter", t[t.MiddleRight = 6] = "MiddleRight", t[t.BottomLeft = 7] = "BottomLeft", t[t.BottomCenter = 8] = "BottomCenter", t[t.BottomRight = 9] = "BottomRight", t))(cl || {}), De = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.WORD = 1] = "WORD", t[t.STACK = 2] = "STACK", t[t.SPACE = 3] = "SPACE", t[t.NBSP = 4] = "NBSP", t[t.TABULATOR = 5] = "TABULATOR", t[t.NEW_PARAGRAPH = 6] = "NEW_PARAGRAPH", t[t.NEW_COLUMN = 7] = "NEW_COLUMN", t[t.WRAP_AT_DIMLINE = 8] = "WRAP_AT_DIMLINE", t[t.PROPERTIES_CHANGED = 9] = "PROPERTIES_CHANGED", t))(De || {}), _e = /* @__PURE__ */ ((t) => (t[t.BOTTOM = 0] = "BOTTOM", t[t.MIDDLE = 1] = "MIDDLE", t[t.TOP = 2] = "TOP", t))(_e || {}), fe = /* @__PURE__ */ ((t) => (t[t.DEFAULT = 0] = "DEFAULT", t[t.LEFT = 1] = "LEFT", t[t.RIGHT = 2] = "RIGHT", t[t.CENTER = 3] = "CENTER", t[t.JUSTIFIED = 4] = "JUSTIFIED", t[t.DISTRIBUTED = 5] = "DISTRIBUTED", t))(fe || {});
|
|
10765
10815
|
const hl = {
|
|
10766
10816
|
c: "Ø",
|
|
@@ -11916,7 +11966,7 @@ class gl {
|
|
|
11916
11966
|
break;
|
|
11917
11967
|
}
|
|
11918
11968
|
case "C":
|
|
11919
|
-
e.changes.aci ? e.changes.aci === 0 ? this._currentColor = this._options.byBlockColor : e.changes.aci === 256 ? this._currentColor = this._options.byLayerColor : this._currentColor =
|
|
11969
|
+
e.changes.aci ? e.changes.aci === 0 ? this._currentColor = this._options.byBlockColor : e.changes.aci === 256 ? this._currentColor = this._options.byLayerColor : this._currentColor = Da(e.changes.aci) : e.changes.rgb && (this._currentColor = (e.changes.rgb[0] << 16) + (e.changes.rgb[1] << 8) + e.changes.rgb[2]);
|
|
11920
11970
|
break;
|
|
11921
11971
|
case "W":
|
|
11922
11972
|
e.changes.widthFactor && (e.changes.widthFactor.isRelative ? this._currentWidthFactor = e.changes.widthFactor.value * this.maxWidth : this._currentWidthFactor = e.changes.widthFactor.value * 0.93);
|
|
@@ -12188,7 +12238,7 @@ class gl {
|
|
|
12188
12238
|
}
|
|
12189
12239
|
}
|
|
12190
12240
|
const Mt = /* @__PURE__ */ new R.Vector3(), Ce = /* @__PURE__ */ new R.Vector3(), Bt = /* @__PURE__ */ new R.Vector3(), Pt = /* @__PURE__ */ new R.Quaternion(), It = /* @__PURE__ */ new R.Matrix4(), pn = /* @__PURE__ */ new R.Matrix4(), dn = /* @__PURE__ */ new R.Vector3(1, 0, 0);
|
|
12191
|
-
class
|
|
12241
|
+
class Sl extends R.Object3D {
|
|
12192
12242
|
/**
|
|
12193
12243
|
* Creates a new instance of MText.
|
|
12194
12244
|
* @param text - The MText data containing text content and properties
|
|
@@ -12385,7 +12435,7 @@ class bl extends R.Object3D {
|
|
|
12385
12435
|
this.getBoxes(n[a], r);
|
|
12386
12436
|
}
|
|
12387
12437
|
}
|
|
12388
|
-
class
|
|
12438
|
+
class kl {
|
|
12389
12439
|
constructor() {
|
|
12390
12440
|
this.lineBasicMaterials = {}, this.meshBasicMaterials = {}, this.unsupportedTextStyles = {};
|
|
12391
12441
|
}
|
|
@@ -12403,11 +12453,12 @@ class Sl {
|
|
|
12403
12453
|
export {
|
|
12404
12454
|
vn as BaseFont,
|
|
12405
12455
|
gn as BaseTextShape,
|
|
12456
|
+
bl as DefaultFontLoader,
|
|
12406
12457
|
fr as EventManager,
|
|
12407
12458
|
Se as FontFactory,
|
|
12408
|
-
|
|
12409
|
-
|
|
12459
|
+
Me as FontManager,
|
|
12460
|
+
Sl as MText,
|
|
12410
12461
|
cl as MTextAttachmentPoint,
|
|
12411
12462
|
Ze as MTextFlowDirection,
|
|
12412
|
-
|
|
12463
|
+
kl as StyleManager
|
|
12413
12464
|
};
|