@unmade/text-renderer 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ce-adapter/ce-types.d.ts +4 -2
- package/dist/ce-adapter/index.cjs +1 -1
- package/dist/ce-adapter/index.js +3 -2
- package/dist/index.cjs +5 -5
- package/dist/index.d.ts +11 -0
- package/dist/index.js +929 -922
- package/dist/node/index.cjs +5 -5
- package/dist/node/index.d.ts +11 -0
- package/dist/node/index.js +930 -923
- package/dist/worker/index.cjs +15 -15
- package/dist/worker/index.d.ts +11 -0
- package/dist/worker/index.js +1553 -1546
- package/package.json +15 -15
package/dist/node/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { svgPathProperties as
|
|
2
|
-
import { DOMParser as
|
|
1
|
+
import { svgPathProperties as zn } from "svg-path-properties";
|
|
2
|
+
import { DOMParser as _n } from "linkedom";
|
|
3
3
|
import "node:path";
|
|
4
|
-
import
|
|
4
|
+
import Vn from "@thednp/dommatrix";
|
|
5
5
|
String.prototype.codePointAt || (function() {
|
|
6
6
|
var e = (function() {
|
|
7
7
|
try {
|
|
@@ -28,14 +28,14 @@ String.prototype.codePointAt || (function() {
|
|
|
28
28
|
writable: !0
|
|
29
29
|
}) : String.prototype.codePointAt = r;
|
|
30
30
|
})();
|
|
31
|
-
var Gr = 0,
|
|
31
|
+
var Gr = 0, Ht = -3;
|
|
32
32
|
function Ne() {
|
|
33
33
|
this.table = new Uint16Array(16), this.trans = new Uint16Array(288);
|
|
34
34
|
}
|
|
35
|
-
function
|
|
35
|
+
function qn(e, r) {
|
|
36
36
|
this.source = e, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = r, this.destLen = 0, this.ltree = new Ne(), this.dtree = new Ne();
|
|
37
37
|
}
|
|
38
|
-
var
|
|
38
|
+
var Wt = new Ne(), zt = new Ne(), Nr = new Uint8Array(30), Hr = new Uint16Array(30), _t = new Uint8Array(30), Vt = new Uint16Array(30), Xn = new Uint8Array([
|
|
39
39
|
16,
|
|
40
40
|
17,
|
|
41
41
|
18,
|
|
@@ -56,7 +56,7 @@ var Ht = new Ne(), Wt = new Ne(), Nr = new Uint8Array(30), Hr = new Uint16Array(
|
|
|
56
56
|
1,
|
|
57
57
|
15
|
|
58
58
|
]), Qr = new Ne(), oe = new Uint8Array(320);
|
|
59
|
-
function
|
|
59
|
+
function qt(e, r, t, n) {
|
|
60
60
|
var a, s;
|
|
61
61
|
for (a = 0; a < t; ++a)
|
|
62
62
|
e[a] = 0;
|
|
@@ -65,7 +65,7 @@ function Vt(e, r, t, n) {
|
|
|
65
65
|
for (s = n, a = 0; a < 30; ++a)
|
|
66
66
|
r[a] = s, s += 1 << e[a];
|
|
67
67
|
}
|
|
68
|
-
function
|
|
68
|
+
function Yn(e, r) {
|
|
69
69
|
var t;
|
|
70
70
|
for (t = 0; t < 7; ++t)
|
|
71
71
|
e.table[t] = 0;
|
|
@@ -94,7 +94,7 @@ function dr(e, r, t, n) {
|
|
|
94
94
|
for (a = 0; a < n; ++a)
|
|
95
95
|
r[t + a] && (e.trans[Kr[r[t + a]]++] = a);
|
|
96
96
|
}
|
|
97
|
-
function
|
|
97
|
+
function $n(e) {
|
|
98
98
|
e.bitcount-- || (e.tag = e.source[e.sourceIndex++], e.bitcount = 7);
|
|
99
99
|
var r = e.tag & 1;
|
|
100
100
|
return e.tag >>>= 1, r;
|
|
@@ -116,13 +116,13 @@ function wr(e, r) {
|
|
|
116
116
|
while (n >= 0);
|
|
117
117
|
return e.tag = s, e.bitcount -= a, r.trans[t + n];
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function Zn(e, r, t) {
|
|
120
120
|
var n, a, s, o, u, i;
|
|
121
121
|
for (n = ie(e, 5, 257), a = ie(e, 5, 1), s = ie(e, 4, 4), o = 0; o < 19; ++o)
|
|
122
122
|
oe[o] = 0;
|
|
123
123
|
for (o = 0; o < s; ++o) {
|
|
124
124
|
var l = ie(e, 3, 0);
|
|
125
|
-
oe[
|
|
125
|
+
oe[Xn[o]] = l;
|
|
126
126
|
}
|
|
127
127
|
for (dr(Qr, oe, 0, 19), u = 0; u < n + a; ) {
|
|
128
128
|
var f = wr(e, Qr);
|
|
@@ -156,47 +156,47 @@ function jr(e, r, t) {
|
|
|
156
156
|
e.dest[e.destLen++] = n;
|
|
157
157
|
else {
|
|
158
158
|
var a, s, o, u;
|
|
159
|
-
for (n -= 257, a = ie(e, Nr[n], Hr[n]), s = wr(e, t), o = e.destLen - ie(e,
|
|
159
|
+
for (n -= 257, a = ie(e, Nr[n], Hr[n]), s = wr(e, t), o = e.destLen - ie(e, _t[s], Vt[s]), u = o; u < o + a; ++u)
|
|
160
160
|
e.dest[e.destLen++] = e.dest[u];
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
}
|
|
164
|
-
function
|
|
164
|
+
function Qn(e) {
|
|
165
165
|
for (var r, t, n; e.bitcount > 8; )
|
|
166
166
|
e.sourceIndex--, e.bitcount -= 8;
|
|
167
167
|
if (r = e.source[e.sourceIndex + 1], r = 256 * r + e.source[e.sourceIndex], t = e.source[e.sourceIndex + 3], t = 256 * t + e.source[e.sourceIndex + 2], r !== (~t & 65535))
|
|
168
|
-
return
|
|
168
|
+
return Ht;
|
|
169
169
|
for (e.sourceIndex += 4, n = r; n; --n)
|
|
170
170
|
e.dest[e.destLen++] = e.source[e.sourceIndex++];
|
|
171
171
|
return e.bitcount = 0, Gr;
|
|
172
172
|
}
|
|
173
|
-
function
|
|
174
|
-
var t = new
|
|
173
|
+
function Kn(e, r) {
|
|
174
|
+
var t = new qn(e, r), n, a, s;
|
|
175
175
|
do {
|
|
176
|
-
switch (n =
|
|
176
|
+
switch (n = $n(t), a = ie(t, 2, 0), a) {
|
|
177
177
|
case 0:
|
|
178
|
-
s =
|
|
178
|
+
s = Qn(t);
|
|
179
179
|
break;
|
|
180
180
|
case 1:
|
|
181
|
-
s = jr(t,
|
|
181
|
+
s = jr(t, Wt, zt);
|
|
182
182
|
break;
|
|
183
183
|
case 2:
|
|
184
|
-
|
|
184
|
+
Zn(t, t.ltree, t.dtree), s = jr(t, t.ltree, t.dtree);
|
|
185
185
|
break;
|
|
186
186
|
default:
|
|
187
|
-
s =
|
|
187
|
+
s = Ht;
|
|
188
188
|
}
|
|
189
189
|
if (s !== Gr)
|
|
190
190
|
throw new Error("Data error");
|
|
191
191
|
} while (!n);
|
|
192
192
|
return t.destLen < t.dest.length ? typeof t.dest.slice == "function" ? t.dest.slice(0, t.destLen) : t.dest.subarray(0, t.destLen) : t.dest;
|
|
193
193
|
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
194
|
+
Yn(Wt, zt);
|
|
195
|
+
qt(Nr, Hr, 4, 3);
|
|
196
|
+
qt(_t, Vt, 2, 1);
|
|
197
197
|
Nr[28] = 0;
|
|
198
198
|
Hr[28] = 258;
|
|
199
|
-
var
|
|
199
|
+
var jn = Kn;
|
|
200
200
|
function we(e, r, t, n, a) {
|
|
201
201
|
return Math.pow(1 - a, 3) * e + 3 * Math.pow(1 - a, 2) * a * r + 3 * (1 - a) * Math.pow(a, 2) * t + Math.pow(a, 3) * n;
|
|
202
202
|
}
|
|
@@ -227,12 +227,12 @@ he.prototype.addBezier = function(e, r, t, n, a, s, o, u) {
|
|
|
227
227
|
0 < m && m < 1 && (p === 0 && this.addX(we(i[p], l[p], f[p], c[p], m)), p === 1 && this.addY(we(i[p], l[p], f[p], c[p], m)));
|
|
228
228
|
continue;
|
|
229
229
|
}
|
|
230
|
-
var
|
|
231
|
-
if (!(
|
|
232
|
-
var
|
|
233
|
-
0 <
|
|
234
|
-
var
|
|
235
|
-
0 <
|
|
230
|
+
var x = Math.pow(h, 2) - 4 * g * d;
|
|
231
|
+
if (!(x < 0)) {
|
|
232
|
+
var U = (-h + Math.sqrt(x)) / (2 * d);
|
|
233
|
+
0 < U && U < 1 && (p === 0 && this.addX(we(i[p], l[p], f[p], c[p], U)), p === 1 && this.addY(we(i[p], l[p], f[p], c[p], U)));
|
|
234
|
+
var y = (-h - Math.sqrt(x)) / (2 * d);
|
|
235
|
+
0 < y && y < 1 && (p === 0 && this.addX(we(i[p], l[p], f[p], c[p], y)), p === 1 && this.addY(we(i[p], l[p], f[p], c[p], y)));
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
};
|
|
@@ -240,24 +240,24 @@ he.prototype.addQuad = function(e, r, t, n, a, s) {
|
|
|
240
240
|
var o = e + 0.6666666666666666 * (t - e), u = r + 2 / 3 * (n - r), i = o + 1 / 3 * (a - e), l = u + 1 / 3 * (s - r);
|
|
241
241
|
this.addBezier(e, r, o, u, i, l, a, s);
|
|
242
242
|
};
|
|
243
|
-
function
|
|
243
|
+
function X() {
|
|
244
244
|
this.commands = [], this.fill = "black", this.stroke = null, this.strokeWidth = 1;
|
|
245
245
|
}
|
|
246
|
-
|
|
246
|
+
X.prototype.moveTo = function(e, r) {
|
|
247
247
|
this.commands.push({
|
|
248
248
|
type: "M",
|
|
249
249
|
x: e,
|
|
250
250
|
y: r
|
|
251
251
|
});
|
|
252
252
|
};
|
|
253
|
-
|
|
253
|
+
X.prototype.lineTo = function(e, r) {
|
|
254
254
|
this.commands.push({
|
|
255
255
|
type: "L",
|
|
256
256
|
x: e,
|
|
257
257
|
y: r
|
|
258
258
|
});
|
|
259
259
|
};
|
|
260
|
-
|
|
260
|
+
X.prototype.curveTo = X.prototype.bezierCurveTo = function(e, r, t, n, a, s) {
|
|
261
261
|
this.commands.push({
|
|
262
262
|
type: "C",
|
|
263
263
|
x1: e,
|
|
@@ -268,7 +268,7 @@ q.prototype.curveTo = q.prototype.bezierCurveTo = function(e, r, t, n, a, s) {
|
|
|
268
268
|
y: s
|
|
269
269
|
});
|
|
270
270
|
};
|
|
271
|
-
|
|
271
|
+
X.prototype.quadTo = X.prototype.quadraticCurveTo = function(e, r, t, n) {
|
|
272
272
|
this.commands.push({
|
|
273
273
|
type: "Q",
|
|
274
274
|
x1: e,
|
|
@@ -277,12 +277,12 @@ q.prototype.quadTo = q.prototype.quadraticCurveTo = function(e, r, t, n) {
|
|
|
277
277
|
y: n
|
|
278
278
|
});
|
|
279
279
|
};
|
|
280
|
-
|
|
280
|
+
X.prototype.close = X.prototype.closePath = function() {
|
|
281
281
|
this.commands.push({
|
|
282
282
|
type: "Z"
|
|
283
283
|
});
|
|
284
284
|
};
|
|
285
|
-
|
|
285
|
+
X.prototype.extend = function(e) {
|
|
286
286
|
if (e.commands)
|
|
287
287
|
e = e.commands;
|
|
288
288
|
else if (e instanceof he) {
|
|
@@ -292,7 +292,7 @@ q.prototype.extend = function(e) {
|
|
|
292
292
|
}
|
|
293
293
|
Array.prototype.push.apply(this.commands, e);
|
|
294
294
|
};
|
|
295
|
-
|
|
295
|
+
X.prototype.getBoundingBox = function() {
|
|
296
296
|
for (var e = new he(), r = 0, t = 0, n = 0, a = 0, s = 0; s < this.commands.length; s++) {
|
|
297
297
|
var o = this.commands[s];
|
|
298
298
|
switch (o.type) {
|
|
@@ -317,7 +317,7 @@ q.prototype.getBoundingBox = function() {
|
|
|
317
317
|
}
|
|
318
318
|
return e.isEmpty() && e.addPoint(0, 0), e;
|
|
319
319
|
};
|
|
320
|
-
|
|
320
|
+
X.prototype.draw = function(e) {
|
|
321
321
|
e.beginPath();
|
|
322
322
|
for (var r = 0; r < this.commands.length; r += 1) {
|
|
323
323
|
var t = this.commands[r];
|
|
@@ -325,7 +325,7 @@ q.prototype.draw = function(e) {
|
|
|
325
325
|
}
|
|
326
326
|
this.fill && (e.fillStyle = this.fill, e.fill()), this.stroke && (e.strokeStyle = this.stroke, e.lineWidth = this.strokeWidth, e.stroke());
|
|
327
327
|
};
|
|
328
|
-
|
|
328
|
+
X.prototype.toPathData = function(e) {
|
|
329
329
|
e = e !== void 0 ? e : 2;
|
|
330
330
|
function r(o) {
|
|
331
331
|
return Math.round(o) === o ? "" + Math.round(o) : o.toFixed(e);
|
|
@@ -343,21 +343,21 @@ q.prototype.toPathData = function(e) {
|
|
|
343
343
|
}
|
|
344
344
|
return n;
|
|
345
345
|
};
|
|
346
|
-
|
|
346
|
+
X.prototype.toSVG = function(e) {
|
|
347
347
|
var r = '<path d="';
|
|
348
348
|
return r += this.toPathData(e), r += '"', this.fill && this.fill !== "black" && (this.fill === null ? r += ' fill="none"' : r += ' fill="' + this.fill + '"'), this.stroke && (r += ' stroke="' + this.stroke + '" stroke-width="' + this.strokeWidth + '"'), r += "/>", r;
|
|
349
349
|
};
|
|
350
|
-
|
|
350
|
+
X.prototype.toDOMElement = function(e) {
|
|
351
351
|
var r = this.toPathData(e), t = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
352
352
|
return t.setAttribute("d", r), t;
|
|
353
353
|
};
|
|
354
|
-
function
|
|
354
|
+
function Xt(e) {
|
|
355
355
|
throw new Error(e);
|
|
356
356
|
}
|
|
357
357
|
function Jr(e, r) {
|
|
358
|
-
e ||
|
|
358
|
+
e || Xt(r);
|
|
359
359
|
}
|
|
360
|
-
var E = { fail:
|
|
360
|
+
var E = { fail: Xt, argument: Jr, assert: Jr }, et = 32768, rt = 2147483648, Oe = {}, b = {}, O = {};
|
|
361
361
|
function ne(e) {
|
|
362
362
|
return function() {
|
|
363
363
|
return e;
|
|
@@ -366,50 +366,50 @@ function ne(e) {
|
|
|
366
366
|
b.BYTE = function(e) {
|
|
367
367
|
return E.argument(e >= 0 && e <= 255, "Byte value should be between 0 and 255."), [e];
|
|
368
368
|
};
|
|
369
|
-
|
|
369
|
+
O.BYTE = ne(1);
|
|
370
370
|
b.CHAR = function(e) {
|
|
371
371
|
return [e.charCodeAt(0)];
|
|
372
372
|
};
|
|
373
|
-
|
|
373
|
+
O.CHAR = ne(1);
|
|
374
374
|
b.CHARARRAY = function(e) {
|
|
375
375
|
typeof e > "u" && (e = "", console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));
|
|
376
376
|
for (var r = [], t = 0; t < e.length; t += 1)
|
|
377
377
|
r[t] = e.charCodeAt(t);
|
|
378
378
|
return r;
|
|
379
379
|
};
|
|
380
|
-
|
|
380
|
+
O.CHARARRAY = function(e) {
|
|
381
381
|
return typeof e > "u" ? 0 : e.length;
|
|
382
382
|
};
|
|
383
383
|
b.USHORT = function(e) {
|
|
384
384
|
return [e >> 8 & 255, e & 255];
|
|
385
385
|
};
|
|
386
|
-
|
|
386
|
+
O.USHORT = ne(2);
|
|
387
387
|
b.SHORT = function(e) {
|
|
388
388
|
return e >= et && (e = -(2 * et - e)), [e >> 8 & 255, e & 255];
|
|
389
389
|
};
|
|
390
|
-
|
|
390
|
+
O.SHORT = ne(2);
|
|
391
391
|
b.UINT24 = function(e) {
|
|
392
392
|
return [e >> 16 & 255, e >> 8 & 255, e & 255];
|
|
393
393
|
};
|
|
394
|
-
|
|
394
|
+
O.UINT24 = ne(3);
|
|
395
395
|
b.ULONG = function(e) {
|
|
396
396
|
return [e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
|
|
397
397
|
};
|
|
398
|
-
|
|
398
|
+
O.ULONG = ne(4);
|
|
399
399
|
b.LONG = function(e) {
|
|
400
400
|
return e >= rt && (e = -(2 * rt - e)), [e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
|
|
401
401
|
};
|
|
402
|
-
|
|
402
|
+
O.LONG = ne(4);
|
|
403
403
|
b.FIXED = b.ULONG;
|
|
404
|
-
|
|
404
|
+
O.FIXED = O.ULONG;
|
|
405
405
|
b.FWORD = b.SHORT;
|
|
406
|
-
|
|
406
|
+
O.FWORD = O.SHORT;
|
|
407
407
|
b.UFWORD = b.USHORT;
|
|
408
|
-
|
|
408
|
+
O.UFWORD = O.USHORT;
|
|
409
409
|
b.LONGDATETIME = function(e) {
|
|
410
410
|
return [0, 0, 0, 0, e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
|
|
411
411
|
};
|
|
412
|
-
|
|
412
|
+
O.LONGDATETIME = ne(8);
|
|
413
413
|
b.TAG = function(e) {
|
|
414
414
|
return E.argument(e.length === 4, "Tag should be exactly 4 ASCII characters."), [
|
|
415
415
|
e.charCodeAt(0),
|
|
@@ -418,29 +418,29 @@ b.TAG = function(e) {
|
|
|
418
418
|
e.charCodeAt(3)
|
|
419
419
|
];
|
|
420
420
|
};
|
|
421
|
-
|
|
421
|
+
O.TAG = ne(4);
|
|
422
422
|
b.Card8 = b.BYTE;
|
|
423
|
-
|
|
423
|
+
O.Card8 = O.BYTE;
|
|
424
424
|
b.Card16 = b.USHORT;
|
|
425
|
-
|
|
425
|
+
O.Card16 = O.USHORT;
|
|
426
426
|
b.OffSize = b.BYTE;
|
|
427
|
-
|
|
427
|
+
O.OffSize = O.BYTE;
|
|
428
428
|
b.SID = b.USHORT;
|
|
429
|
-
|
|
429
|
+
O.SID = O.USHORT;
|
|
430
430
|
b.NUMBER = function(e) {
|
|
431
431
|
return e >= -107 && e <= 107 ? [e + 139] : e >= 108 && e <= 1131 ? (e = e - 108, [(e >> 8) + 247, e & 255]) : e >= -1131 && e <= -108 ? (e = -e - 108, [(e >> 8) + 251, e & 255]) : e >= -32768 && e <= 32767 ? b.NUMBER16(e) : b.NUMBER32(e);
|
|
432
432
|
};
|
|
433
|
-
|
|
433
|
+
O.NUMBER = function(e) {
|
|
434
434
|
return b.NUMBER(e).length;
|
|
435
435
|
};
|
|
436
436
|
b.NUMBER16 = function(e) {
|
|
437
437
|
return [28, e >> 8 & 255, e & 255];
|
|
438
438
|
};
|
|
439
|
-
|
|
439
|
+
O.NUMBER16 = ne(3);
|
|
440
440
|
b.NUMBER32 = function(e) {
|
|
441
441
|
return [29, e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
|
|
442
442
|
};
|
|
443
|
-
|
|
443
|
+
O.NUMBER32 = ne(5);
|
|
444
444
|
b.REAL = function(e) {
|
|
445
445
|
var r = e.toString(), t = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(r);
|
|
446
446
|
if (t) {
|
|
@@ -456,13 +456,13 @@ b.REAL = function(e) {
|
|
|
456
456
|
i.push(parseInt(a.substr(l, 2), 16));
|
|
457
457
|
return i;
|
|
458
458
|
};
|
|
459
|
-
|
|
459
|
+
O.REAL = function(e) {
|
|
460
460
|
return b.REAL(e).length;
|
|
461
461
|
};
|
|
462
462
|
b.NAME = b.CHARARRAY;
|
|
463
|
-
|
|
463
|
+
O.NAME = O.CHARARRAY;
|
|
464
464
|
b.STRING = b.CHARARRAY;
|
|
465
|
-
|
|
465
|
+
O.STRING = O.CHARARRAY;
|
|
466
466
|
Oe.UTF8 = function(e, r, t) {
|
|
467
467
|
for (var n = [], a = t, s = 0; s < a; s++, r += 1)
|
|
468
468
|
n[s] = e.getUint8(r);
|
|
@@ -480,7 +480,7 @@ b.UTF16 = function(e) {
|
|
|
480
480
|
}
|
|
481
481
|
return r;
|
|
482
482
|
};
|
|
483
|
-
|
|
483
|
+
O.UTF16 = function(e) {
|
|
484
484
|
return e.length * 2;
|
|
485
485
|
};
|
|
486
486
|
var Er = {
|
|
@@ -535,7 +535,7 @@ Oe.MACSTRING = function(e, r, t, n) {
|
|
|
535
535
|
return s;
|
|
536
536
|
}
|
|
537
537
|
};
|
|
538
|
-
var Ze = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), Qe,
|
|
538
|
+
var Ze = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), Qe, Jn = function(e) {
|
|
539
539
|
if (!Qe) {
|
|
540
540
|
Qe = {};
|
|
541
541
|
for (var r in Er)
|
|
@@ -557,7 +557,7 @@ var Ze = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), Qe, Kn =
|
|
|
557
557
|
}
|
|
558
558
|
};
|
|
559
559
|
b.MACSTRING = function(e, r) {
|
|
560
|
-
var t =
|
|
560
|
+
var t = Jn(r);
|
|
561
561
|
if (t !== void 0) {
|
|
562
562
|
for (var n = [], a = 0; a < e.length; a++) {
|
|
563
563
|
var s = e.charCodeAt(a);
|
|
@@ -568,19 +568,19 @@ b.MACSTRING = function(e, r) {
|
|
|
568
568
|
return n;
|
|
569
569
|
}
|
|
570
570
|
};
|
|
571
|
-
|
|
571
|
+
O.MACSTRING = function(e, r) {
|
|
572
572
|
var t = b.MACSTRING(e, r);
|
|
573
573
|
return t !== void 0 ? t.length : 0;
|
|
574
574
|
};
|
|
575
575
|
function Or(e) {
|
|
576
576
|
return e >= -128 && e <= 127;
|
|
577
577
|
}
|
|
578
|
-
function
|
|
578
|
+
function ea(e, r, t) {
|
|
579
579
|
for (var n = 0, a = e.length; r < a && n < 64 && e[r] === 0; )
|
|
580
580
|
++r, ++n;
|
|
581
581
|
return t.push(128 | n - 1), r;
|
|
582
582
|
}
|
|
583
|
-
function
|
|
583
|
+
function ra(e, r, t) {
|
|
584
584
|
for (var n = 0, a = e.length, s = r; s < a && n < 64; ) {
|
|
585
585
|
var o = e[s];
|
|
586
586
|
if (!Or(o) || o === 0 && s + 1 < a && e[s + 1] === 0)
|
|
@@ -592,7 +592,7 @@ function Jn(e, r, t) {
|
|
|
592
592
|
t.push(e[u] + 256 & 255);
|
|
593
593
|
return s;
|
|
594
594
|
}
|
|
595
|
-
function
|
|
595
|
+
function ta(e, r, t) {
|
|
596
596
|
for (var n = 0, a = e.length, s = r; s < a && n < 64; ) {
|
|
597
597
|
var o = e[s];
|
|
598
598
|
if (o === 0 || Or(o) && s + 1 < a && Or(e[s + 1]))
|
|
@@ -609,7 +609,7 @@ function ea(e, r, t) {
|
|
|
609
609
|
b.VARDELTAS = function(e) {
|
|
610
610
|
for (var r = 0, t = []; r < e.length; ) {
|
|
611
611
|
var n = e[r];
|
|
612
|
-
n === 0 ? r =
|
|
612
|
+
n === 0 ? r = ea(e, r, t) : n >= -128 && n <= 127 ? r = ra(e, r, t) : r = ta(e, r, t);
|
|
613
613
|
}
|
|
614
614
|
return t;
|
|
615
615
|
};
|
|
@@ -631,7 +631,7 @@ b.INDEX = function(e) {
|
|
|
631
631
|
n
|
|
632
632
|
);
|
|
633
633
|
};
|
|
634
|
-
|
|
634
|
+
O.INDEX = function(e) {
|
|
635
635
|
return b.INDEX(e).length;
|
|
636
636
|
};
|
|
637
637
|
b.DICT = function(e) {
|
|
@@ -641,7 +641,7 @@ b.DICT = function(e) {
|
|
|
641
641
|
}
|
|
642
642
|
return r;
|
|
643
643
|
};
|
|
644
|
-
|
|
644
|
+
O.DICT = function(e) {
|
|
645
645
|
return b.DICT(e).length;
|
|
646
646
|
};
|
|
647
647
|
b.OPERATOR = function(e) {
|
|
@@ -665,7 +665,7 @@ b.OPERAND = function(e, r) {
|
|
|
665
665
|
return t;
|
|
666
666
|
};
|
|
667
667
|
b.OP = b.BYTE;
|
|
668
|
-
|
|
668
|
+
O.OP = O.BYTE;
|
|
669
669
|
var Ke = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap();
|
|
670
670
|
b.CHARSTRING = function(e) {
|
|
671
671
|
if (Ke) {
|
|
@@ -679,15 +679,15 @@ b.CHARSTRING = function(e) {
|
|
|
679
679
|
}
|
|
680
680
|
return Ke && Ke.set(e, t), t;
|
|
681
681
|
};
|
|
682
|
-
|
|
682
|
+
O.CHARSTRING = function(e) {
|
|
683
683
|
return b.CHARSTRING(e).length;
|
|
684
684
|
};
|
|
685
685
|
b.OBJECT = function(e) {
|
|
686
686
|
var r = b[e.type];
|
|
687
687
|
return E.argument(r !== void 0, "No encoding function for type " + e.type), r(e.value);
|
|
688
688
|
};
|
|
689
|
-
|
|
690
|
-
var r =
|
|
689
|
+
O.OBJECT = function(e) {
|
|
690
|
+
var r = O[e.type];
|
|
691
691
|
return E.argument(r !== void 0, "No sizeOf function for type " + e.type), r(e.value);
|
|
692
692
|
};
|
|
693
693
|
b.TABLE = function(e) {
|
|
@@ -705,9 +705,9 @@ b.TABLE = function(e) {
|
|
|
705
705
|
}
|
|
706
706
|
return r;
|
|
707
707
|
};
|
|
708
|
-
|
|
708
|
+
O.TABLE = function(e) {
|
|
709
709
|
for (var r = 0, t = e.fields.length, n = 0; n < t; n += 1) {
|
|
710
|
-
var a = e.fields[n], s =
|
|
710
|
+
var a = e.fields[n], s = O[a.type];
|
|
711
711
|
E.argument(s !== void 0, "No sizeOf function for field type " + a.type + " (" + a.name + ")");
|
|
712
712
|
var o = e[a.name];
|
|
713
713
|
o === void 0 && (o = a.value), r += s(o), a.type === "TABLE" && (r += 2);
|
|
@@ -715,11 +715,11 @@ L.TABLE = function(e) {
|
|
|
715
715
|
return r;
|
|
716
716
|
};
|
|
717
717
|
b.RECORD = b.TABLE;
|
|
718
|
-
|
|
718
|
+
O.RECORD = O.TABLE;
|
|
719
719
|
b.LITERAL = function(e) {
|
|
720
720
|
return e;
|
|
721
721
|
};
|
|
722
|
-
|
|
722
|
+
O.LITERAL = function(e) {
|
|
723
723
|
return e.length;
|
|
724
724
|
};
|
|
725
725
|
function Z(e, r, t) {
|
|
@@ -738,7 +738,7 @@ Z.prototype.encode = function() {
|
|
|
738
738
|
return b.TABLE(this);
|
|
739
739
|
};
|
|
740
740
|
Z.prototype.sizeOf = function() {
|
|
741
|
-
return
|
|
741
|
+
return O.TABLE(this);
|
|
742
742
|
};
|
|
743
743
|
function He(e, r, t) {
|
|
744
744
|
t === void 0 && (t = r.length);
|
|
@@ -855,37 +855,37 @@ function tt(e, r) {
|
|
|
855
855
|
function or(e, r) {
|
|
856
856
|
return e.getUint16(r, !1);
|
|
857
857
|
}
|
|
858
|
-
function
|
|
858
|
+
function na(e, r) {
|
|
859
859
|
return e.getInt16(r, !1);
|
|
860
860
|
}
|
|
861
861
|
function Wr(e, r) {
|
|
862
862
|
return e.getUint32(r, !1);
|
|
863
863
|
}
|
|
864
|
-
function
|
|
864
|
+
function Yt(e, r) {
|
|
865
865
|
var t = e.getInt16(r, !1), n = e.getUint16(r + 2, !1);
|
|
866
866
|
return t + n / 65535;
|
|
867
867
|
}
|
|
868
|
-
function
|
|
868
|
+
function aa(e, r) {
|
|
869
869
|
for (var t = "", n = r; n < r + 4; n += 1)
|
|
870
870
|
t += String.fromCharCode(e.getInt8(n));
|
|
871
871
|
return t;
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function sa(e, r, t) {
|
|
874
874
|
for (var n = 0, a = 0; a < t; a += 1)
|
|
875
875
|
n <<= 8, n += e.getUint8(r + a);
|
|
876
876
|
return n;
|
|
877
877
|
}
|
|
878
|
-
function
|
|
878
|
+
function oa(e, r, t) {
|
|
879
879
|
for (var n = [], a = r; a < t; a += 1)
|
|
880
880
|
n.push(e.getUint8(a));
|
|
881
881
|
return n;
|
|
882
882
|
}
|
|
883
|
-
function
|
|
883
|
+
function ia(e) {
|
|
884
884
|
for (var r = "", t = 0; t < e.length; t += 1)
|
|
885
885
|
r += String.fromCharCode(e[t]);
|
|
886
886
|
return r;
|
|
887
887
|
}
|
|
888
|
-
var
|
|
888
|
+
var ua = {
|
|
889
889
|
byte: 1,
|
|
890
890
|
uShort: 2,
|
|
891
891
|
short: 2,
|
|
@@ -927,7 +927,7 @@ v.prototype.parseULong = function() {
|
|
|
927
927
|
};
|
|
928
928
|
v.prototype.parseOffset32 = v.prototype.parseULong;
|
|
929
929
|
v.prototype.parseFixed = function() {
|
|
930
|
-
var e =
|
|
930
|
+
var e = Yt(this.data, this.offset + this.relativeOffset);
|
|
931
931
|
return this.relativeOffset += 4, e;
|
|
932
932
|
};
|
|
933
933
|
v.prototype.parseString = function(e) {
|
|
@@ -949,7 +949,7 @@ v.prototype.parseVersion = function(e) {
|
|
|
949
949
|
return this.relativeOffset += 4, e === void 0 && (e = 4096), r + t / e / 10;
|
|
950
950
|
};
|
|
951
951
|
v.prototype.skip = function(e, r) {
|
|
952
|
-
r === void 0 && (r = 1), this.relativeOffset +=
|
|
952
|
+
r === void 0 && (r = 1), this.relativeOffset += ua[e] * r;
|
|
953
953
|
};
|
|
954
954
|
v.prototype.parseULongList = function(e) {
|
|
955
955
|
e === void 0 && (e = this.parseULong());
|
|
@@ -1187,16 +1187,16 @@ var k = {
|
|
|
1187
1187
|
getCard8: tt,
|
|
1188
1188
|
getUShort: or,
|
|
1189
1189
|
getCard16: or,
|
|
1190
|
-
getShort:
|
|
1190
|
+
getShort: na,
|
|
1191
1191
|
getULong: Wr,
|
|
1192
|
-
getFixed:
|
|
1193
|
-
getTag:
|
|
1194
|
-
getOffset:
|
|
1195
|
-
getBytes:
|
|
1196
|
-
bytesToString:
|
|
1192
|
+
getFixed: Yt,
|
|
1193
|
+
getTag: aa,
|
|
1194
|
+
getOffset: sa,
|
|
1195
|
+
getBytes: oa,
|
|
1196
|
+
bytesToString: ia,
|
|
1197
1197
|
Parser: v
|
|
1198
1198
|
};
|
|
1199
|
-
function
|
|
1199
|
+
function la(e, r) {
|
|
1200
1200
|
r.parseUShort(), e.length = r.parseULong(), e.language = r.parseULong();
|
|
1201
1201
|
var t;
|
|
1202
1202
|
e.groupCount = t = r.parseULong(), e.glyphIndexMap = {};
|
|
@@ -1204,15 +1204,15 @@ function ia(e, r) {
|
|
|
1204
1204
|
for (var a = r.parseULong(), s = r.parseULong(), o = r.parseULong(), u = a; u <= s; u += 1)
|
|
1205
1205
|
e.glyphIndexMap[u] = o, o++;
|
|
1206
1206
|
}
|
|
1207
|
-
function
|
|
1207
|
+
function fa(e, r, t, n, a) {
|
|
1208
1208
|
e.length = r.parseUShort(), e.language = r.parseUShort();
|
|
1209
1209
|
var s;
|
|
1210
1210
|
e.segCount = s = r.parseUShort() >> 1, r.skip("uShort", 3), e.glyphIndexMap = {};
|
|
1211
1211
|
for (var o = new k.Parser(t, n + a + 14), u = new k.Parser(t, n + a + 16 + s * 2), i = new k.Parser(t, n + a + 16 + s * 4), l = new k.Parser(t, n + a + 16 + s * 6), f = n + a + 16 + s * 8, c = 0; c < s - 1; c += 1)
|
|
1212
|
-
for (var p = void 0, h = o.parseUShort(), d = u.parseUShort(), g = i.parseShort(), m = l.parseUShort(),
|
|
1213
|
-
m !== 0 ? (f = l.offset + l.relativeOffset - 2, f += m, f += (
|
|
1212
|
+
for (var p = void 0, h = o.parseUShort(), d = u.parseUShort(), g = i.parseShort(), m = l.parseUShort(), x = d; x <= h; x += 1)
|
|
1213
|
+
m !== 0 ? (f = l.offset + l.relativeOffset - 2, f += m, f += (x - d) * 2, p = k.getUShort(t, f), p !== 0 && (p = p + g & 65535)) : p = x + g & 65535, e.glyphIndexMap[x] = p;
|
|
1214
1214
|
}
|
|
1215
|
-
function
|
|
1215
|
+
function pa(e, r) {
|
|
1216
1216
|
var t = {};
|
|
1217
1217
|
t.version = k.getUShort(e, r), E.argument(t.version === 0, "cmap table version should be 0."), t.numTables = k.getUShort(e, r + 2);
|
|
1218
1218
|
for (var n = -1, a = t.numTables - 1; a >= 0; a -= 1) {
|
|
@@ -1226,14 +1226,14 @@ function la(e, r) {
|
|
|
1226
1226
|
throw new Error("No valid cmap sub-tables found.");
|
|
1227
1227
|
var u = new k.Parser(e, r + n);
|
|
1228
1228
|
if (t.format = u.parseUShort(), t.format === 12)
|
|
1229
|
-
|
|
1229
|
+
la(t, u);
|
|
1230
1230
|
else if (t.format === 4)
|
|
1231
|
-
|
|
1231
|
+
fa(t, u, e, r, n);
|
|
1232
1232
|
else
|
|
1233
1233
|
throw new Error("Only format 4 and 12 cmap tables are supported (found format " + t.format + ").");
|
|
1234
1234
|
return t;
|
|
1235
1235
|
}
|
|
1236
|
-
function
|
|
1236
|
+
function ca(e, r, t) {
|
|
1237
1237
|
e.segments.push({
|
|
1238
1238
|
end: r,
|
|
1239
1239
|
start: r,
|
|
@@ -1242,7 +1242,7 @@ function fa(e, r, t) {
|
|
|
1242
1242
|
glyphIndex: t
|
|
1243
1243
|
});
|
|
1244
1244
|
}
|
|
1245
|
-
function
|
|
1245
|
+
function ha(e) {
|
|
1246
1246
|
e.segments.push({
|
|
1247
1247
|
end: 65535,
|
|
1248
1248
|
start: 65535,
|
|
@@ -1250,7 +1250,7 @@ function pa(e) {
|
|
|
1250
1250
|
offset: 0
|
|
1251
1251
|
});
|
|
1252
1252
|
}
|
|
1253
|
-
function
|
|
1253
|
+
function va(e) {
|
|
1254
1254
|
var r = !0, t;
|
|
1255
1255
|
for (t = e.length - 1; t > 0; t -= 1) {
|
|
1256
1256
|
var n = e.get(t);
|
|
@@ -1286,12 +1286,12 @@ function ca(e) {
|
|
|
1286
1286
|
var s = new S.Table("cmap", a);
|
|
1287
1287
|
for (s.segments = [], t = 0; t < e.length; t += 1) {
|
|
1288
1288
|
for (var o = e.get(t), u = 0; u < o.unicodes.length; u += 1)
|
|
1289
|
-
|
|
1290
|
-
s.segments = s.segments.sort(function(
|
|
1291
|
-
return
|
|
1289
|
+
ca(s, o.unicodes[u], t);
|
|
1290
|
+
s.segments = s.segments.sort(function(U, y) {
|
|
1291
|
+
return U.start - y.start;
|
|
1292
1292
|
});
|
|
1293
1293
|
}
|
|
1294
|
-
|
|
1294
|
+
ha(s);
|
|
1295
1295
|
var i = s.segments.length, l = 0, f = [], c = [], p = [], h = [], d = [], g = [];
|
|
1296
1296
|
for (t = 0; t < i; t += 1) {
|
|
1297
1297
|
var m = s.segments[t];
|
|
@@ -1300,19 +1300,19 @@ function ca(e) {
|
|
|
1300
1300
|
if (s.segCountX2 = (i - l) * 2, s.searchRange = Math.pow(2, Math.floor(Math.log(i - l) / Math.log(2))) * 2, s.entrySelector = Math.log(s.searchRange / 2) / Math.log(2), s.rangeShift = s.segCountX2 - s.searchRange, s.fields = s.fields.concat(f), s.fields.push({ name: "reservedPad", type: "USHORT", value: 0 }), s.fields = s.fields.concat(c), s.fields = s.fields.concat(p), s.fields = s.fields.concat(h), s.fields = s.fields.concat(d), s.cmap4Length = 14 + // Subtable header
|
|
1301
1301
|
f.length * 2 + 2 + // reservedPad
|
|
1302
1302
|
c.length * 2 + p.length * 2 + h.length * 2 + d.length * 2, !r) {
|
|
1303
|
-
var
|
|
1303
|
+
var x = 16 + // Subtable header
|
|
1304
1304
|
g.length * 4;
|
|
1305
1305
|
s.cmap12Offset = 20 + s.cmap4Length, s.fields = s.fields.concat([
|
|
1306
1306
|
{ name: "cmap12Format", type: "USHORT", value: 12 },
|
|
1307
1307
|
{ name: "cmap12Reserved", type: "USHORT", value: 0 },
|
|
1308
|
-
{ name: "cmap12Length", type: "ULONG", value:
|
|
1308
|
+
{ name: "cmap12Length", type: "ULONG", value: x },
|
|
1309
1309
|
{ name: "cmap12Language", type: "ULONG", value: 0 },
|
|
1310
1310
|
{ name: "cmap12nGroups", type: "ULONG", value: g.length / 3 }
|
|
1311
1311
|
]), s.fields = s.fields.concat(g);
|
|
1312
1312
|
}
|
|
1313
1313
|
return s;
|
|
1314
1314
|
}
|
|
1315
|
-
var
|
|
1315
|
+
var $t = { parse: pa, make: va }, er = [
|
|
1316
1316
|
".notdef",
|
|
1317
1317
|
"space",
|
|
1318
1318
|
"exclam",
|
|
@@ -1704,7 +1704,7 @@ var Yt = { parse: la, make: ca }, er = [
|
|
|
1704
1704
|
"Regular",
|
|
1705
1705
|
"Roman",
|
|
1706
1706
|
"Semibold"
|
|
1707
|
-
],
|
|
1707
|
+
], da = [
|
|
1708
1708
|
"",
|
|
1709
1709
|
"",
|
|
1710
1710
|
"",
|
|
@@ -1957,7 +1957,7 @@ var Yt = { parse: la, make: ca }, er = [
|
|
|
1957
1957
|
"oslash",
|
|
1958
1958
|
"oe",
|
|
1959
1959
|
"germandbls"
|
|
1960
|
-
],
|
|
1960
|
+
], ga = [
|
|
1961
1961
|
"",
|
|
1962
1962
|
"",
|
|
1963
1963
|
"",
|
|
@@ -2473,10 +2473,10 @@ var Yt = { parse: la, make: ca }, er = [
|
|
|
2473
2473
|
"ccaron",
|
|
2474
2474
|
"dcroat"
|
|
2475
2475
|
];
|
|
2476
|
-
function
|
|
2476
|
+
function Zt(e) {
|
|
2477
2477
|
this.font = e;
|
|
2478
2478
|
}
|
|
2479
|
-
|
|
2479
|
+
Zt.prototype.charToGlyphIndex = function(e) {
|
|
2480
2480
|
var r = e.codePointAt(0), t = this.font.glyphs;
|
|
2481
2481
|
if (t) {
|
|
2482
2482
|
for (var n = 0; n < t.length; n += 1)
|
|
@@ -2486,10 +2486,10 @@ $t.prototype.charToGlyphIndex = function(e) {
|
|
|
2486
2486
|
}
|
|
2487
2487
|
return null;
|
|
2488
2488
|
};
|
|
2489
|
-
function
|
|
2489
|
+
function Qt(e) {
|
|
2490
2490
|
this.cmap = e;
|
|
2491
2491
|
}
|
|
2492
|
-
|
|
2492
|
+
Qt.prototype.charToGlyphIndex = function(e) {
|
|
2493
2493
|
return this.cmap.glyphIndexMap[e.codePointAt(0)] || 0;
|
|
2494
2494
|
};
|
|
2495
2495
|
function ir(e, r) {
|
|
@@ -2528,7 +2528,7 @@ zr.prototype.nameToGlyphIndex = function(e) {
|
|
|
2528
2528
|
zr.prototype.glyphIndexToName = function(e) {
|
|
2529
2529
|
return this.names[e];
|
|
2530
2530
|
};
|
|
2531
|
-
function
|
|
2531
|
+
function ma(e) {
|
|
2532
2532
|
for (var r, t = e.tables.cmap.glyphIndexMap, n = Object.keys(t), a = 0; a < n.length; a += 1) {
|
|
2533
2533
|
var s = n[a], o = t[s];
|
|
2534
2534
|
r = e.glyphs.get(o), r.addUnicode(parseInt(s));
|
|
@@ -2536,7 +2536,7 @@ function da(e) {
|
|
|
2536
2536
|
for (var u = 0; u < e.glyphs.length; u += 1)
|
|
2537
2537
|
r = e.glyphs.get(u), e.cffEncoding ? e.isCIDFont ? r.name = "gid" + u : r.name = e.cffEncoding.charset[u] : e.glyphNames.names && (r.name = e.glyphNames.glyphIndexToName(u));
|
|
2538
2538
|
}
|
|
2539
|
-
function
|
|
2539
|
+
function ya(e) {
|
|
2540
2540
|
e._IndexToUnicodeMap = {};
|
|
2541
2541
|
for (var r = e.tables.cmap.glyphIndexMap, t = Object.keys(r), n = 0; n < t.length; n += 1) {
|
|
2542
2542
|
var a = t[n], s = r[a];
|
|
@@ -2545,15 +2545,15 @@ function ga(e) {
|
|
|
2545
2545
|
} : e._IndexToUnicodeMap[s].unicodes.push(parseInt(a));
|
|
2546
2546
|
}
|
|
2547
2547
|
}
|
|
2548
|
-
function
|
|
2549
|
-
r.lowMemory ?
|
|
2548
|
+
function xa(e, r) {
|
|
2549
|
+
r.lowMemory ? ya(e) : ma(e);
|
|
2550
2550
|
}
|
|
2551
|
-
function
|
|
2551
|
+
function ba(e, r, t, n, a) {
|
|
2552
2552
|
e.beginPath(), e.moveTo(r, t), e.lineTo(n, a), e.stroke();
|
|
2553
2553
|
}
|
|
2554
|
-
var Te = { line:
|
|
2555
|
-
function
|
|
2556
|
-
var t = r || new
|
|
2554
|
+
var Te = { line: ba };
|
|
2555
|
+
function Sa(e, r) {
|
|
2556
|
+
var t = r || new X();
|
|
2557
2557
|
return {
|
|
2558
2558
|
configurable: !0,
|
|
2559
2559
|
get: function() {
|
|
@@ -2568,7 +2568,7 @@ function K(e) {
|
|
|
2568
2568
|
this.bindConstructorValues(e);
|
|
2569
2569
|
}
|
|
2570
2570
|
K.prototype.bindConstructorValues = function(e) {
|
|
2571
|
-
this.index = e.index || 0, this.name = e.name || null, this.unicode = e.unicode || void 0, this.unicodes = e.unicodes || e.unicode !== void 0 ? [e.unicode] : [], "xMin" in e && (this.xMin = e.xMin), "yMin" in e && (this.yMin = e.yMin), "xMax" in e && (this.xMax = e.xMax), "yMax" in e && (this.yMax = e.yMax), "advanceWidth" in e && (this.advanceWidth = e.advanceWidth), Object.defineProperty(this, "path",
|
|
2571
|
+
this.index = e.index || 0, this.name = e.name || null, this.unicode = e.unicode || void 0, this.unicodes = e.unicodes || e.unicode !== void 0 ? [e.unicode] : [], "xMin" in e && (this.xMin = e.xMin), "yMin" in e && (this.yMin = e.yMin), "xMax" in e && (this.xMax = e.xMax), "yMax" in e && (this.yMax = e.yMax), "advanceWidth" in e && (this.advanceWidth = e.advanceWidth), Object.defineProperty(this, "path", Sa(this, e.path));
|
|
2572
2572
|
};
|
|
2573
2573
|
K.prototype.addUnicode = function(e) {
|
|
2574
2574
|
this.unicodes.length === 0 && (this.unicode = e), this.unicodes.push(e);
|
|
@@ -2588,7 +2588,7 @@ K.prototype.getPath = function(e, r, t, n, a) {
|
|
|
2588
2588
|
var l = 1 / (this.path.unitsPerEm || 1e3) * t;
|
|
2589
2589
|
u === void 0 && (u = l), i === void 0 && (i = l);
|
|
2590
2590
|
}
|
|
2591
|
-
for (var f = new
|
|
2591
|
+
for (var f = new X(), c = 0; c < s.length; c += 1) {
|
|
2592
2592
|
var p = s[c];
|
|
2593
2593
|
p.type === "M" ? f.moveTo(e + p.x * u, r + -p.y * i) : p.type === "L" ? f.lineTo(e + p.x * u, r + -p.y * i) : p.type === "Q" ? f.quadraticCurveTo(
|
|
2594
2594
|
e + p.x1 * u,
|
|
@@ -2687,10 +2687,10 @@ _r.prototype.get = function(e) {
|
|
|
2687
2687
|
_r.prototype.push = function(e, r) {
|
|
2688
2688
|
this.glyphs[e] = r, this.length++;
|
|
2689
2689
|
};
|
|
2690
|
-
function
|
|
2690
|
+
function Ta(e, r) {
|
|
2691
2691
|
return new K({ index: r, font: e });
|
|
2692
2692
|
}
|
|
2693
|
-
function
|
|
2693
|
+
function ka(e, r, t, n, a, s) {
|
|
2694
2694
|
return function() {
|
|
2695
2695
|
var o = new K({ index: r, font: e });
|
|
2696
2696
|
return o.path = function() {
|
|
@@ -2700,7 +2700,7 @@ function Sa(e, r, t, n, a, s) {
|
|
|
2700
2700
|
}, je(o, "xMin", "_xMin"), je(o, "xMax", "_xMax"), je(o, "yMin", "_yMin"), je(o, "yMax", "_yMax"), o;
|
|
2701
2701
|
};
|
|
2702
2702
|
}
|
|
2703
|
-
function
|
|
2703
|
+
function Fa(e, r, t, n) {
|
|
2704
2704
|
return function() {
|
|
2705
2705
|
var a = new K({ index: r, font: e });
|
|
2706
2706
|
return a.path = function() {
|
|
@@ -2709,15 +2709,15 @@ function Ta(e, r, t, n) {
|
|
|
2709
2709
|
}, a;
|
|
2710
2710
|
};
|
|
2711
2711
|
}
|
|
2712
|
-
var le = { GlyphSet: _r, glyphLoader:
|
|
2713
|
-
function
|
|
2712
|
+
var le = { GlyphSet: _r, glyphLoader: Ta, ttfGlyphLoader: ka, cffGlyphLoader: Fa };
|
|
2713
|
+
function Kt(e, r) {
|
|
2714
2714
|
if (e === r)
|
|
2715
2715
|
return !0;
|
|
2716
2716
|
if (Array.isArray(e) && Array.isArray(r)) {
|
|
2717
2717
|
if (e.length !== r.length)
|
|
2718
2718
|
return !1;
|
|
2719
2719
|
for (var t = 0; t < e.length; t += 1)
|
|
2720
|
-
if (!
|
|
2720
|
+
if (!Kt(e[t], r[t]))
|
|
2721
2721
|
return !1;
|
|
2722
2722
|
return !0;
|
|
2723
2723
|
} else
|
|
@@ -2743,7 +2743,7 @@ function ye(e, r, t) {
|
|
|
2743
2743
|
}
|
|
2744
2744
|
return { objects: a, startOffset: r, endOffset: u };
|
|
2745
2745
|
}
|
|
2746
|
-
function
|
|
2746
|
+
function Ua(e, r) {
|
|
2747
2747
|
var t = [], n = k.getCard16(e, r), a, s;
|
|
2748
2748
|
if (n !== 0) {
|
|
2749
2749
|
var o = k.getByte(e, r + 2);
|
|
@@ -2755,7 +2755,7 @@ function ka(e, r) {
|
|
|
2755
2755
|
s = r + 2;
|
|
2756
2756
|
return { offsets: t, startOffset: r, endOffset: s };
|
|
2757
2757
|
}
|
|
2758
|
-
function
|
|
2758
|
+
function Ca(e, r, t, n, a) {
|
|
2759
2759
|
var s = k.getCard16(t, n), o = 0;
|
|
2760
2760
|
if (s !== 0) {
|
|
2761
2761
|
var u = k.getByte(t, n + 2);
|
|
@@ -2764,7 +2764,7 @@ function Fa(e, r, t, n, a) {
|
|
|
2764
2764
|
var i = k.getBytes(t, o + r[e], o + r[e + 1]);
|
|
2765
2765
|
return i;
|
|
2766
2766
|
}
|
|
2767
|
-
function
|
|
2767
|
+
function wa(e) {
|
|
2768
2768
|
for (var r = "", t = 15, n = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"]; ; ) {
|
|
2769
2769
|
var a = e.parseByte(), s = a >> 4, o = a & 15;
|
|
2770
2770
|
if (s === t || (r += n[s], o === t))
|
|
@@ -2773,14 +2773,14 @@ function Ua(e) {
|
|
|
2773
2773
|
}
|
|
2774
2774
|
return parseFloat(r);
|
|
2775
2775
|
}
|
|
2776
|
-
function
|
|
2776
|
+
function Ea(e, r) {
|
|
2777
2777
|
var t, n, a, s;
|
|
2778
2778
|
if (r === 28)
|
|
2779
2779
|
return t = e.parseByte(), n = e.parseByte(), t << 8 | n;
|
|
2780
2780
|
if (r === 29)
|
|
2781
2781
|
return t = e.parseByte(), n = e.parseByte(), a = e.parseByte(), s = e.parseByte(), t << 24 | n << 16 | a << 8 | s;
|
|
2782
2782
|
if (r === 30)
|
|
2783
|
-
return
|
|
2783
|
+
return wa(e);
|
|
2784
2784
|
if (r >= 32 && r <= 246)
|
|
2785
2785
|
return r - 139;
|
|
2786
2786
|
if (r >= 247 && r <= 250)
|
|
@@ -2789,7 +2789,7 @@ function Ca(e, r) {
|
|
|
2789
2789
|
return t = e.parseByte(), -(r - 251) * 256 - t - 108;
|
|
2790
2790
|
throw new Error("Invalid b0 " + r);
|
|
2791
2791
|
}
|
|
2792
|
-
function
|
|
2792
|
+
function Oa(e) {
|
|
2793
2793
|
for (var r = {}, t = 0; t < e.length; t += 1) {
|
|
2794
2794
|
var n = e[t][0], a = e[t][1], s = void 0;
|
|
2795
2795
|
if (a.length === 1 ? s = a[0] : s = a, r.hasOwnProperty(n) && !isNaN(r[n]))
|
|
@@ -2798,19 +2798,19 @@ function wa(e) {
|
|
|
2798
2798
|
}
|
|
2799
2799
|
return r;
|
|
2800
2800
|
}
|
|
2801
|
-
function
|
|
2801
|
+
function jt(e, r, t) {
|
|
2802
2802
|
r = r !== void 0 ? r : 0;
|
|
2803
2803
|
var n = new k.Parser(e, r), a = [], s = [];
|
|
2804
2804
|
for (t = t !== void 0 ? t : e.length; n.relativeOffset < t; ) {
|
|
2805
2805
|
var o = n.parseByte();
|
|
2806
|
-
o <= 21 ? (o === 12 && (o = 1200 + n.parseByte()), a.push([o, s]), s = []) : s.push(
|
|
2806
|
+
o <= 21 ? (o === 12 && (o = 1200 + n.parseByte()), a.push([o, s]), s = []) : s.push(Ea(n, o));
|
|
2807
2807
|
}
|
|
2808
|
-
return
|
|
2808
|
+
return Oa(a);
|
|
2809
2809
|
}
|
|
2810
2810
|
function Ge(e, r) {
|
|
2811
2811
|
return r <= 390 ? r = er[r] : r = e[r - 391], r;
|
|
2812
2812
|
}
|
|
2813
|
-
function
|
|
2813
|
+
function Jt(e, r, t) {
|
|
2814
2814
|
for (var n = {}, a, s = 0; s < r.length; s += 1) {
|
|
2815
2815
|
var o = r[s];
|
|
2816
2816
|
if (Array.isArray(o.type)) {
|
|
@@ -2824,11 +2824,11 @@ function jt(e, r, t) {
|
|
|
2824
2824
|
}
|
|
2825
2825
|
return n;
|
|
2826
2826
|
}
|
|
2827
|
-
function
|
|
2827
|
+
function La(e, r) {
|
|
2828
2828
|
var t = {};
|
|
2829
2829
|
return t.formatMajor = k.getCard8(e, r), t.formatMinor = k.getCard8(e, r + 1), t.size = k.getCard8(e, r + 2), t.offsetSize = k.getCard8(e, r + 3), t.startOffset = r, t.endOffset = r + 4, t;
|
|
2830
2830
|
}
|
|
2831
|
-
var
|
|
2831
|
+
var en = [
|
|
2832
2832
|
{ name: "version", op: 0, type: "SID" },
|
|
2833
2833
|
{ name: "notice", op: 1, type: "SID" },
|
|
2834
2834
|
{ name: "copyright", op: 1200, type: "SID" },
|
|
@@ -2864,26 +2864,26 @@ var Jt = [
|
|
|
2864
2864
|
{ name: "fdArray", op: 1236, type: "offset" },
|
|
2865
2865
|
{ name: "fdSelect", op: 1237, type: "offset" },
|
|
2866
2866
|
{ name: "fontName", op: 1238, type: "SID" }
|
|
2867
|
-
],
|
|
2867
|
+
], rn = [
|
|
2868
2868
|
{ name: "subrs", op: 19, type: "offset", value: 0 },
|
|
2869
2869
|
{ name: "defaultWidthX", op: 20, type: "number", value: 0 },
|
|
2870
2870
|
{ name: "nominalWidthX", op: 21, type: "number", value: 0 }
|
|
2871
2871
|
];
|
|
2872
|
-
function
|
|
2873
|
-
var t =
|
|
2874
|
-
return
|
|
2872
|
+
function Ra(e, r) {
|
|
2873
|
+
var t = jt(e, 0, e.byteLength);
|
|
2874
|
+
return Jt(t, en, r);
|
|
2875
2875
|
}
|
|
2876
|
-
function
|
|
2877
|
-
var a =
|
|
2878
|
-
return
|
|
2876
|
+
function tn(e, r, t, n) {
|
|
2877
|
+
var a = jt(e, r, t);
|
|
2878
|
+
return Jt(a, rn, n);
|
|
2879
2879
|
}
|
|
2880
2880
|
function at(e, r, t, n) {
|
|
2881
2881
|
for (var a = [], s = 0; s < t.length; s += 1) {
|
|
2882
|
-
var o = new DataView(new Uint8Array(t[s]).buffer), u =
|
|
2882
|
+
var o = new DataView(new Uint8Array(t[s]).buffer), u = Ra(o, n);
|
|
2883
2883
|
u._subrs = [], u._subrsBias = 0, u._defaultWidthX = 0, u._nominalWidthX = 0;
|
|
2884
2884
|
var i = u.private[0], l = u.private[1];
|
|
2885
2885
|
if (i !== 0 && l !== 0) {
|
|
2886
|
-
var f =
|
|
2886
|
+
var f = tn(e, l + r, i, n);
|
|
2887
2887
|
if (u._defaultWidthX = f.defaultWidthX, u._nominalWidthX = f.nominalWidthX, f.subrs !== 0) {
|
|
2888
2888
|
var c = l + f.subrs, p = ye(e, c + r);
|
|
2889
2889
|
u._subrs = p.objects, u._subrsBias = Rr(u._subrs);
|
|
@@ -2894,7 +2894,7 @@ function at(e, r, t, n) {
|
|
|
2894
2894
|
}
|
|
2895
2895
|
return a;
|
|
2896
2896
|
}
|
|
2897
|
-
function
|
|
2897
|
+
function Da(e, r, t, n) {
|
|
2898
2898
|
var a, s, o = new k.Parser(e, r);
|
|
2899
2899
|
t -= 1;
|
|
2900
2900
|
var u = [".notdef"], i = o.parseCard8();
|
|
@@ -2917,7 +2917,7 @@ function La(e, r, t, n) {
|
|
|
2917
2917
|
throw new Error("Unknown charset format " + i);
|
|
2918
2918
|
return u;
|
|
2919
2919
|
}
|
|
2920
|
-
function
|
|
2920
|
+
function Aa(e, r, t) {
|
|
2921
2921
|
var n, a = {}, s = new k.Parser(e, r), o = s.parseCard8();
|
|
2922
2922
|
if (o === 0)
|
|
2923
2923
|
for (var u = s.parseCard8(), i = 0; i < u; i += 1)
|
|
@@ -2933,32 +2933,32 @@ function Ra(e, r, t) {
|
|
|
2933
2933
|
return new ir(a, t);
|
|
2934
2934
|
}
|
|
2935
2935
|
function st(e, r, t) {
|
|
2936
|
-
var n, a, s, o, u = new
|
|
2936
|
+
var n, a, s, o, u = new X(), i = [], l = 0, f = !1, c = !1, p = 0, h = 0, d, g, m, x;
|
|
2937
2937
|
if (e.isCIDFont) {
|
|
2938
|
-
var
|
|
2939
|
-
d =
|
|
2938
|
+
var U = e.tables.cff.topDict._fdSelect[r.index], y = e.tables.cff.topDict._fdArray[U];
|
|
2939
|
+
d = y._subrs, g = y._subrsBias, m = y._defaultWidthX, x = y._nominalWidthX;
|
|
2940
2940
|
} else
|
|
2941
|
-
d = e.tables.cff.topDict._subrs, g = e.tables.cff.topDict._subrsBias, m = e.tables.cff.topDict._defaultWidthX,
|
|
2942
|
-
var
|
|
2943
|
-
function w(
|
|
2944
|
-
c && u.closePath(), u.moveTo(
|
|
2945
|
-
}
|
|
2946
|
-
function
|
|
2947
|
-
var
|
|
2948
|
-
|
|
2949
|
-
}
|
|
2950
|
-
function C(
|
|
2951
|
-
for (var
|
|
2952
|
-
var
|
|
2953
|
-
switch (
|
|
2941
|
+
d = e.tables.cff.topDict._subrs, g = e.tables.cff.topDict._subrsBias, m = e.tables.cff.topDict._defaultWidthX, x = e.tables.cff.topDict._nominalWidthX;
|
|
2942
|
+
var L = m;
|
|
2943
|
+
function w(F, D) {
|
|
2944
|
+
c && u.closePath(), u.moveTo(F, D), c = !0;
|
|
2945
|
+
}
|
|
2946
|
+
function B() {
|
|
2947
|
+
var F;
|
|
2948
|
+
F = i.length % 2 !== 0, F && !f && (L = i.shift() + x), l += i.length >> 1, i.length = 0, f = !0;
|
|
2949
|
+
}
|
|
2950
|
+
function C(F) {
|
|
2951
|
+
for (var D, R, A, H, Q, G, z, Y, _, P, V, $, M = 0; M < F.length; ) {
|
|
2952
|
+
var q = F[M];
|
|
2953
|
+
switch (M += 1, q) {
|
|
2954
2954
|
case 1:
|
|
2955
|
-
|
|
2955
|
+
B();
|
|
2956
2956
|
break;
|
|
2957
2957
|
case 3:
|
|
2958
|
-
|
|
2958
|
+
B();
|
|
2959
2959
|
break;
|
|
2960
2960
|
case 4:
|
|
2961
|
-
i.length > 1 && !f && (
|
|
2961
|
+
i.length > 1 && !f && (L = i.shift() + x, f = !0), h += i.pop(), w(p, h);
|
|
2962
2962
|
break;
|
|
2963
2963
|
case 5:
|
|
2964
2964
|
for (; i.length > 0; )
|
|
@@ -2982,42 +2982,42 @@ function st(e, r, t) {
|
|
|
2982
2982
|
case 11:
|
|
2983
2983
|
return;
|
|
2984
2984
|
case 12:
|
|
2985
|
-
switch (
|
|
2985
|
+
switch (q = F[M], M += 1, q) {
|
|
2986
2986
|
case 35:
|
|
2987
|
-
n = p + i.shift(), a = h + i.shift(), s = n + i.shift(), o = a + i.shift(),
|
|
2987
|
+
n = p + i.shift(), a = h + i.shift(), s = n + i.shift(), o = a + i.shift(), z = s + i.shift(), Y = o + i.shift(), _ = z + i.shift(), P = Y + i.shift(), V = _ + i.shift(), $ = P + i.shift(), p = V + i.shift(), h = $ + i.shift(), i.shift(), u.curveTo(n, a, s, o, z, Y), u.curveTo(_, P, V, $, p, h);
|
|
2988
2988
|
break;
|
|
2989
2989
|
case 34:
|
|
2990
|
-
n = p + i.shift(), a = h, s = n + i.shift(), o = a + i.shift(),
|
|
2990
|
+
n = p + i.shift(), a = h, s = n + i.shift(), o = a + i.shift(), z = s + i.shift(), Y = o, _ = z + i.shift(), P = o, V = _ + i.shift(), $ = h, p = V + i.shift(), u.curveTo(n, a, s, o, z, Y), u.curveTo(_, P, V, $, p, h);
|
|
2991
2991
|
break;
|
|
2992
2992
|
case 36:
|
|
2993
|
-
n = p + i.shift(), a = h + i.shift(), s = n + i.shift(), o = a + i.shift(),
|
|
2993
|
+
n = p + i.shift(), a = h + i.shift(), s = n + i.shift(), o = a + i.shift(), z = s + i.shift(), Y = o, _ = z + i.shift(), P = o, V = _ + i.shift(), $ = P + i.shift(), p = V + i.shift(), u.curveTo(n, a, s, o, z, Y), u.curveTo(_, P, V, $, p, h);
|
|
2994
2994
|
break;
|
|
2995
2995
|
case 37:
|
|
2996
|
-
n = p + i.shift(), a = h + i.shift(), s = n + i.shift(), o = a + i.shift(),
|
|
2996
|
+
n = p + i.shift(), a = h + i.shift(), s = n + i.shift(), o = a + i.shift(), z = s + i.shift(), Y = o + i.shift(), _ = z + i.shift(), P = Y + i.shift(), V = _ + i.shift(), $ = P + i.shift(), Math.abs(V - p) > Math.abs($ - h) ? p = V + i.shift() : h = $ + i.shift(), u.curveTo(n, a, s, o, z, Y), u.curveTo(_, P, V, $, p, h);
|
|
2997
2997
|
break;
|
|
2998
2998
|
default:
|
|
2999
|
-
console.log("Glyph " + r.index + ": unknown operator 1200" +
|
|
2999
|
+
console.log("Glyph " + r.index + ": unknown operator 1200" + q), i.length = 0;
|
|
3000
3000
|
}
|
|
3001
3001
|
break;
|
|
3002
3002
|
case 14:
|
|
3003
|
-
i.length > 0 && !f && (
|
|
3003
|
+
i.length > 0 && !f && (L = i.shift() + x, f = !0), c && (u.closePath(), c = !1);
|
|
3004
3004
|
break;
|
|
3005
3005
|
case 18:
|
|
3006
|
-
|
|
3006
|
+
B();
|
|
3007
3007
|
break;
|
|
3008
3008
|
case 19:
|
|
3009
3009
|
// hintmask
|
|
3010
3010
|
case 20:
|
|
3011
|
-
|
|
3011
|
+
B(), M += l + 7 >> 3;
|
|
3012
3012
|
break;
|
|
3013
3013
|
case 21:
|
|
3014
|
-
i.length > 2 && !f && (
|
|
3014
|
+
i.length > 2 && !f && (L = i.shift() + x, f = !0), h += i.pop(), p += i.pop(), w(p, h);
|
|
3015
3015
|
break;
|
|
3016
3016
|
case 22:
|
|
3017
|
-
i.length > 1 && !f && (
|
|
3017
|
+
i.length > 1 && !f && (L = i.shift() + x, f = !0), p += i.pop(), w(p, h);
|
|
3018
3018
|
break;
|
|
3019
3019
|
case 23:
|
|
3020
|
-
|
|
3020
|
+
B();
|
|
3021
3021
|
break;
|
|
3022
3022
|
case 24:
|
|
3023
3023
|
for (; i.length > 2; )
|
|
@@ -3038,7 +3038,7 @@ function st(e, r, t) {
|
|
|
3038
3038
|
n = p + i.shift(), a = h, s = n + i.shift(), o = a + i.shift(), p = s + i.shift(), h = o, u.curveTo(n, a, s, o, p, h);
|
|
3039
3039
|
break;
|
|
3040
3040
|
case 28:
|
|
3041
|
-
|
|
3041
|
+
D = F[M], R = F[M + 1], i.push((D << 24 | R << 16) >> 16), M += 2;
|
|
3042
3042
|
break;
|
|
3043
3043
|
case 29:
|
|
3044
3044
|
Q = i.pop() + e.gsubrsBias, G = e.gsubrs[Q], G && C(G);
|
|
@@ -3052,13 +3052,13 @@ function st(e, r, t) {
|
|
|
3052
3052
|
n = p, a = h + i.shift(), s = n + i.shift(), o = a + i.shift(), p = s + i.shift(), h = o + (i.length === 1 ? i.shift() : 0), u.curveTo(n, a, s, o, p, h);
|
|
3053
3053
|
break;
|
|
3054
3054
|
default:
|
|
3055
|
-
|
|
3055
|
+
q < 32 ? console.log("Glyph " + r.index + ": unknown operator " + q) : q < 247 ? i.push(q - 139) : q < 251 ? (D = F[M], M += 1, i.push((q - 247) * 256 + D + 108)) : q < 255 ? (D = F[M], M += 1, i.push(-(q - 251) * 256 - D - 108)) : (D = F[M], R = F[M + 1], A = F[M + 2], H = F[M + 3], M += 4, i.push((D << 24 | R << 16 | A << 8 | H) / 65536));
|
|
3056
3056
|
}
|
|
3057
3057
|
}
|
|
3058
3058
|
}
|
|
3059
|
-
return C(t), r.advanceWidth =
|
|
3059
|
+
return C(t), r.advanceWidth = L, u;
|
|
3060
3060
|
}
|
|
3061
|
-
function
|
|
3061
|
+
function Ba(e, r, t, n) {
|
|
3062
3062
|
var a = [], s, o = new k.Parser(e, r), u = o.parseCard8();
|
|
3063
3063
|
if (u === 0)
|
|
3064
3064
|
for (var i = 0; i < t; i++) {
|
|
@@ -3085,9 +3085,9 @@ function Da(e, r, t, n) {
|
|
|
3085
3085
|
throw new Error("CFF Table CID Font FDSelect table has unsupported format " + u);
|
|
3086
3086
|
return a;
|
|
3087
3087
|
}
|
|
3088
|
-
function
|
|
3088
|
+
function Ma(e, r, t, n) {
|
|
3089
3089
|
t.tables.cff = {};
|
|
3090
|
-
var a =
|
|
3090
|
+
var a = La(e, r), s = ye(e, a.endOffset, k.bytesToString), o = ye(e, s.endOffset), u = ye(e, o.endOffset, k.bytesToString), i = ye(e, u.endOffset);
|
|
3091
3091
|
t.gsubrs = i.objects, t.gsubrsBias = Rr(t.gsubrs);
|
|
3092
3092
|
var l = at(e, r, o.objects, u.objects);
|
|
3093
3093
|
if (l.length !== 1)
|
|
@@ -3099,33 +3099,33 @@ function Aa(e, r, t, n) {
|
|
|
3099
3099
|
throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
|
|
3100
3100
|
c += r;
|
|
3101
3101
|
var h = ye(e, c), d = at(e, r, h.objects, u.objects);
|
|
3102
|
-
f._fdArray = d, p += r, f._fdSelect =
|
|
3102
|
+
f._fdArray = d, p += r, f._fdSelect = Ba(e, p, t.numGlyphs, d.length);
|
|
3103
3103
|
}
|
|
3104
|
-
var g = r + f.private[1], m =
|
|
3104
|
+
var g = r + f.private[1], m = tn(e, g, f.private[0], u.objects);
|
|
3105
3105
|
if (t.defaultWidthX = m.defaultWidthX, t.nominalWidthX = m.nominalWidthX, m.subrs !== 0) {
|
|
3106
|
-
var
|
|
3107
|
-
t.subrs =
|
|
3106
|
+
var x = g + m.subrs, U = ye(e, x);
|
|
3107
|
+
t.subrs = U.objects, t.subrsBias = Rr(t.subrs);
|
|
3108
3108
|
} else
|
|
3109
3109
|
t.subrs = [], t.subrsBias = 0;
|
|
3110
|
-
var
|
|
3111
|
-
n.lowMemory ? (
|
|
3112
|
-
var
|
|
3113
|
-
if (f.encoding === 0 ? t.cffEncoding = new ir(
|
|
3110
|
+
var y;
|
|
3111
|
+
n.lowMemory ? (y = Ua(e, r + f.charStrings), t.nGlyphs = y.offsets.length) : (y = ye(e, r + f.charStrings), t.nGlyphs = y.objects.length);
|
|
3112
|
+
var L = Da(e, r + f.charset, t.nGlyphs, u.objects);
|
|
3113
|
+
if (f.encoding === 0 ? t.cffEncoding = new ir(da, L) : f.encoding === 1 ? t.cffEncoding = new ir(ga, L) : t.cffEncoding = Aa(e, r + f.encoding, L), t.encoding = t.encoding || t.cffEncoding, t.glyphs = new le.GlyphSet(t), n.lowMemory)
|
|
3114
3114
|
t._push = function(C) {
|
|
3115
|
-
var
|
|
3116
|
-
t.glyphs.push(C, le.cffGlyphLoader(t, C, st,
|
|
3115
|
+
var F = Ca(C, y.offsets, e, r + f.charStrings);
|
|
3116
|
+
t.glyphs.push(C, le.cffGlyphLoader(t, C, st, F));
|
|
3117
3117
|
};
|
|
3118
3118
|
else
|
|
3119
3119
|
for (var w = 0; w < t.nGlyphs; w += 1) {
|
|
3120
|
-
var
|
|
3121
|
-
t.glyphs.push(w, le.cffGlyphLoader(t, w, st,
|
|
3120
|
+
var B = y.objects[w];
|
|
3121
|
+
t.glyphs.push(w, le.cffGlyphLoader(t, w, st, B));
|
|
3122
3122
|
}
|
|
3123
3123
|
}
|
|
3124
|
-
function
|
|
3124
|
+
function nn(e, r) {
|
|
3125
3125
|
var t, n = er.indexOf(e);
|
|
3126
3126
|
return n >= 0 && (t = n), n = r.indexOf(e), n >= 0 ? t = n + er.length : (t = er.length + r.length, r.push(e)), t;
|
|
3127
3127
|
}
|
|
3128
|
-
function
|
|
3128
|
+
function Ia() {
|
|
3129
3129
|
return new S.Record("Header", [
|
|
3130
3130
|
{ name: "major", type: "Card8", value: 1 },
|
|
3131
3131
|
{ name: "minor", type: "Card8", value: 0 },
|
|
@@ -3133,7 +3133,7 @@ function Ba() {
|
|
|
3133
3133
|
{ name: "major", type: "Card8", value: 1 }
|
|
3134
3134
|
]);
|
|
3135
3135
|
}
|
|
3136
|
-
function
|
|
3136
|
+
function Pa(e) {
|
|
3137
3137
|
var r = new S.Record("Name INDEX", [
|
|
3138
3138
|
{ name: "names", type: "INDEX", value: [] }
|
|
3139
3139
|
]);
|
|
@@ -3142,10 +3142,10 @@ function Ma(e) {
|
|
|
3142
3142
|
r.names.push({ name: "name_" + t, type: "NAME", value: e[t] });
|
|
3143
3143
|
return r;
|
|
3144
3144
|
}
|
|
3145
|
-
function
|
|
3145
|
+
function an(e, r, t) {
|
|
3146
3146
|
for (var n = {}, a = 0; a < e.length; a += 1) {
|
|
3147
3147
|
var s = e[a], o = r[s.name];
|
|
3148
|
-
o !== void 0 && !
|
|
3148
|
+
o !== void 0 && !Kt(o, s.value) && (s.type === "SID" && (o = nn(o, t)), n[s.op] = { name: s.name, type: s.type, value: o });
|
|
3149
3149
|
}
|
|
3150
3150
|
return n;
|
|
3151
3151
|
}
|
|
@@ -3153,7 +3153,7 @@ function ot(e, r) {
|
|
|
3153
3153
|
var t = new S.Record("Top DICT", [
|
|
3154
3154
|
{ name: "dict", type: "DICT", value: {} }
|
|
3155
3155
|
]);
|
|
3156
|
-
return t.dict =
|
|
3156
|
+
return t.dict = an(en, e, r), t;
|
|
3157
3157
|
}
|
|
3158
3158
|
function it(e) {
|
|
3159
3159
|
var r = new S.Record("Top DICT INDEX", [
|
|
@@ -3161,7 +3161,7 @@ function it(e) {
|
|
|
3161
3161
|
]);
|
|
3162
3162
|
return r.topDicts = [{ name: "topDict_0", type: "TABLE", value: e }], r;
|
|
3163
3163
|
}
|
|
3164
|
-
function
|
|
3164
|
+
function Ga(e) {
|
|
3165
3165
|
var r = new S.Record("String INDEX", [
|
|
3166
3166
|
{ name: "strings", type: "INDEX", value: [] }
|
|
3167
3167
|
]);
|
|
@@ -3170,21 +3170,21 @@ function Ia(e) {
|
|
|
3170
3170
|
r.strings.push({ name: "string_" + t, type: "STRING", value: e[t] });
|
|
3171
3171
|
return r;
|
|
3172
3172
|
}
|
|
3173
|
-
function
|
|
3173
|
+
function Na() {
|
|
3174
3174
|
return new S.Record("Global Subr INDEX", [
|
|
3175
3175
|
{ name: "subrs", type: "INDEX", value: [] }
|
|
3176
3176
|
]);
|
|
3177
3177
|
}
|
|
3178
|
-
function
|
|
3178
|
+
function Ha(e, r) {
|
|
3179
3179
|
for (var t = new S.Record("Charsets", [
|
|
3180
3180
|
{ name: "format", type: "Card8", value: 0 }
|
|
3181
3181
|
]), n = 0; n < e.length; n += 1) {
|
|
3182
|
-
var a = e[n], s =
|
|
3182
|
+
var a = e[n], s = nn(a, r);
|
|
3183
3183
|
t.fields.push({ name: "glyph_" + n, type: "SID", value: s });
|
|
3184
3184
|
}
|
|
3185
3185
|
return t;
|
|
3186
3186
|
}
|
|
3187
|
-
function
|
|
3187
|
+
function Wa(e) {
|
|
3188
3188
|
var r = [], t = e.path;
|
|
3189
3189
|
r.push({ name: "width", type: "NUMBER", value: e.advanceWidth });
|
|
3190
3190
|
for (var n = 0, a = 0, s = 0; s < t.commands.length; s += 1) {
|
|
@@ -3212,22 +3212,22 @@ function Na(e) {
|
|
|
3212
3212
|
}
|
|
3213
3213
|
return r.push({ name: "endchar", type: "OP", value: 14 }), r;
|
|
3214
3214
|
}
|
|
3215
|
-
function
|
|
3215
|
+
function za(e) {
|
|
3216
3216
|
for (var r = new S.Record("CharStrings INDEX", [
|
|
3217
3217
|
{ name: "charStrings", type: "INDEX", value: [] }
|
|
3218
3218
|
]), t = 0; t < e.length; t += 1) {
|
|
3219
|
-
var n = e.get(t), a =
|
|
3219
|
+
var n = e.get(t), a = Wa(n);
|
|
3220
3220
|
r.charStrings.push({ name: n.name, type: "CHARSTRING", value: a });
|
|
3221
3221
|
}
|
|
3222
3222
|
return r;
|
|
3223
3223
|
}
|
|
3224
|
-
function
|
|
3224
|
+
function _a(e, r) {
|
|
3225
3225
|
var t = new S.Record("Private DICT", [
|
|
3226
3226
|
{ name: "dict", type: "DICT", value: {} }
|
|
3227
3227
|
]);
|
|
3228
|
-
return t.dict =
|
|
3228
|
+
return t.dict = an(rn, e, r), t;
|
|
3229
3229
|
}
|
|
3230
|
-
function
|
|
3230
|
+
function Va(e, r) {
|
|
3231
3231
|
for (var t = new S.Table("CFF ", [
|
|
3232
3232
|
{ name: "header", type: "RECORD" },
|
|
3233
3233
|
{ name: "nameIndex", type: "RECORD" },
|
|
@@ -3251,18 +3251,18 @@ function za(e, r) {
|
|
|
3251
3251
|
}, s = {}, o = [], u, i = 1; i < e.length; i += 1)
|
|
3252
3252
|
u = e.get(i), o.push(u.name);
|
|
3253
3253
|
var l = [];
|
|
3254
|
-
t.header =
|
|
3254
|
+
t.header = Ia(), t.nameIndex = Pa([r.postScriptName]);
|
|
3255
3255
|
var f = ot(a, l);
|
|
3256
|
-
t.topDictIndex = it(f), t.globalSubrIndex =
|
|
3256
|
+
t.topDictIndex = it(f), t.globalSubrIndex = Na(), t.charsets = Ha(o, l), t.charStringsIndex = za(e), t.privateDict = _a(s, l), t.stringIndex = Ga(l);
|
|
3257
3257
|
var c = t.header.sizeOf() + t.nameIndex.sizeOf() + t.topDictIndex.sizeOf() + t.stringIndex.sizeOf() + t.globalSubrIndex.sizeOf();
|
|
3258
3258
|
return a.charset = c, a.encoding = 0, a.charStrings = a.charset + t.charsets.sizeOf(), a.private[1] = a.charStrings + t.charStringsIndex.sizeOf(), f = ot(a, l), t.topDictIndex = it(f), t;
|
|
3259
3259
|
}
|
|
3260
|
-
var
|
|
3261
|
-
function
|
|
3260
|
+
var sn = { parse: Ma, make: Va };
|
|
3261
|
+
function qa(e, r) {
|
|
3262
3262
|
var t = {}, n = new k.Parser(e, r);
|
|
3263
3263
|
return t.version = n.parseVersion(), t.fontRevision = Math.round(n.parseFixed() * 1e3) / 1e3, t.checkSumAdjustment = n.parseULong(), t.magicNumber = n.parseULong(), E.argument(t.magicNumber === 1594834165, "Font header has wrong magic number."), t.flags = n.parseUShort(), t.unitsPerEm = n.parseUShort(), t.created = n.parseLongDateTime(), t.modified = n.parseLongDateTime(), t.xMin = n.parseShort(), t.yMin = n.parseShort(), t.xMax = n.parseShort(), t.yMax = n.parseShort(), t.macStyle = n.parseUShort(), t.lowestRecPPEM = n.parseUShort(), t.fontDirectionHint = n.parseShort(), t.indexToLocFormat = n.parseShort(), t.glyphDataFormat = n.parseShort(), t;
|
|
3264
3264
|
}
|
|
3265
|
-
function
|
|
3265
|
+
function Xa(e) {
|
|
3266
3266
|
var r = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3) + 2082844800, t = r;
|
|
3267
3267
|
return e.createdTimestamp && (t = e.createdTimestamp + 2082844800), new S.Table("head", [
|
|
3268
3268
|
{ name: "version", type: "FIXED", value: 65536 },
|
|
@@ -3284,12 +3284,12 @@ function Va(e) {
|
|
|
3284
3284
|
{ name: "glyphDataFormat", type: "SHORT", value: 0 }
|
|
3285
3285
|
], e);
|
|
3286
3286
|
}
|
|
3287
|
-
var
|
|
3288
|
-
function
|
|
3287
|
+
var on = { parse: qa, make: Xa };
|
|
3288
|
+
function Ya(e, r) {
|
|
3289
3289
|
var t = {}, n = new k.Parser(e, r);
|
|
3290
3290
|
return t.version = n.parseVersion(), t.ascender = n.parseShort(), t.descender = n.parseShort(), t.lineGap = n.parseShort(), t.advanceWidthMax = n.parseUShort(), t.minLeftSideBearing = n.parseShort(), t.minRightSideBearing = n.parseShort(), t.xMaxExtent = n.parseShort(), t.caretSlopeRise = n.parseShort(), t.caretSlopeRun = n.parseShort(), t.caretOffset = n.parseShort(), n.relativeOffset += 8, t.metricDataFormat = n.parseShort(), t.numberOfHMetrics = n.parseUShort(), t;
|
|
3291
3291
|
}
|
|
3292
|
-
function
|
|
3292
|
+
function $a(e) {
|
|
3293
3293
|
return new S.Table("hhea", [
|
|
3294
3294
|
{ name: "version", type: "FIXED", value: 65536 },
|
|
3295
3295
|
{ name: "ascender", type: "FWORD", value: 0 },
|
|
@@ -3310,15 +3310,15 @@ function Xa(e) {
|
|
|
3310
3310
|
{ name: "numberOfHMetrics", type: "USHORT", value: 0 }
|
|
3311
3311
|
], e);
|
|
3312
3312
|
}
|
|
3313
|
-
var
|
|
3314
|
-
function
|
|
3313
|
+
var un = { parse: Ya, make: $a };
|
|
3314
|
+
function Za(e, r, t, n, a) {
|
|
3315
3315
|
for (var s, o, u = new k.Parser(e, r), i = 0; i < n; i += 1) {
|
|
3316
3316
|
i < t && (s = u.parseUShort(), o = u.parseShort());
|
|
3317
3317
|
var l = a.get(i);
|
|
3318
3318
|
l.advanceWidth = s, l.leftSideBearing = o;
|
|
3319
3319
|
}
|
|
3320
3320
|
}
|
|
3321
|
-
function
|
|
3321
|
+
function Qa(e, r, t, n, a) {
|
|
3322
3322
|
e._hmtxTableData = {};
|
|
3323
3323
|
for (var s, o, u = new k.Parser(r, t), i = 0; i < a; i += 1)
|
|
3324
3324
|
i < n && (s = u.parseUShort(), o = u.parseShort()), e._hmtxTableData[i] = {
|
|
@@ -3326,18 +3326,18 @@ function $a(e, r, t, n, a) {
|
|
|
3326
3326
|
leftSideBearing: o
|
|
3327
3327
|
};
|
|
3328
3328
|
}
|
|
3329
|
-
function
|
|
3330
|
-
o.lowMemory ?
|
|
3329
|
+
function Ka(e, r, t, n, a, s, o) {
|
|
3330
|
+
o.lowMemory ? Qa(e, r, t, n, a) : Za(r, t, n, a, s);
|
|
3331
3331
|
}
|
|
3332
|
-
function
|
|
3332
|
+
function ja(e) {
|
|
3333
3333
|
for (var r = new S.Table("hmtx", []), t = 0; t < e.length; t += 1) {
|
|
3334
3334
|
var n = e.get(t), a = n.advanceWidth || 0, s = n.leftSideBearing || 0;
|
|
3335
3335
|
r.fields.push({ name: "advanceWidth_" + t, type: "USHORT", value: a }), r.fields.push({ name: "leftSideBearing_" + t, type: "SHORT", value: s });
|
|
3336
3336
|
}
|
|
3337
3337
|
return r;
|
|
3338
3338
|
}
|
|
3339
|
-
var
|
|
3340
|
-
function
|
|
3339
|
+
var ln = { parse: Ka, make: ja };
|
|
3340
|
+
function Ja(e) {
|
|
3341
3341
|
for (var r = new S.Table("ltag", [
|
|
3342
3342
|
{ name: "version", type: "ULONG", value: 1 },
|
|
3343
3343
|
{ name: "flags", type: "ULONG", value: 0 },
|
|
@@ -3348,7 +3348,7 @@ function Ka(e) {
|
|
|
3348
3348
|
}
|
|
3349
3349
|
return r.fields.push({ name: "stringPool", type: "CHARARRAY", value: t }), r;
|
|
3350
3350
|
}
|
|
3351
|
-
function
|
|
3351
|
+
function es(e, r) {
|
|
3352
3352
|
var t = new k.Parser(e, r), n = t.parseULong();
|
|
3353
3353
|
E.argument(n === 1, "Unsupported ltag table version."), t.skip("uLong", 1);
|
|
3354
3354
|
for (var a = t.parseULong(), s = [], o = 0; o < a; o++) {
|
|
@@ -3358,18 +3358,18 @@ function ja(e, r) {
|
|
|
3358
3358
|
}
|
|
3359
3359
|
return s;
|
|
3360
3360
|
}
|
|
3361
|
-
var
|
|
3362
|
-
function
|
|
3361
|
+
var fn = { make: Ja, parse: es };
|
|
3362
|
+
function rs(e, r) {
|
|
3363
3363
|
var t = {}, n = new k.Parser(e, r);
|
|
3364
3364
|
return t.version = n.parseVersion(), t.numGlyphs = n.parseUShort(), t.version === 1 && (t.maxPoints = n.parseUShort(), t.maxContours = n.parseUShort(), t.maxCompositePoints = n.parseUShort(), t.maxCompositeContours = n.parseUShort(), t.maxZones = n.parseUShort(), t.maxTwilightPoints = n.parseUShort(), t.maxStorage = n.parseUShort(), t.maxFunctionDefs = n.parseUShort(), t.maxInstructionDefs = n.parseUShort(), t.maxStackElements = n.parseUShort(), t.maxSizeOfInstructions = n.parseUShort(), t.maxComponentElements = n.parseUShort(), t.maxComponentDepth = n.parseUShort()), t;
|
|
3365
3365
|
}
|
|
3366
|
-
function
|
|
3366
|
+
function ts(e) {
|
|
3367
3367
|
return new S.Table("maxp", [
|
|
3368
3368
|
{ name: "version", type: "FIXED", value: 20480 },
|
|
3369
3369
|
{ name: "numGlyphs", type: "USHORT", value: e }
|
|
3370
3370
|
]);
|
|
3371
3371
|
}
|
|
3372
|
-
var
|
|
3372
|
+
var pn = { parse: rs, make: ts }, cn = [
|
|
3373
3373
|
"copyright",
|
|
3374
3374
|
// 0
|
|
3375
3375
|
"fontFamily",
|
|
@@ -3416,7 +3416,7 @@ var fn = { parse: Ja, make: es }, pn = [
|
|
|
3416
3416
|
// 21
|
|
3417
3417
|
"wwsSubfamily"
|
|
3418
3418
|
// 22
|
|
3419
|
-
],
|
|
3419
|
+
], hn = {
|
|
3420
3420
|
0: "en",
|
|
3421
3421
|
1: "fr",
|
|
3422
3422
|
2: "de",
|
|
@@ -3536,7 +3536,7 @@ var fn = { parse: Ja, make: es }, pn = [
|
|
|
3536
3536
|
149: "kl",
|
|
3537
3537
|
150: "az",
|
|
3538
3538
|
151: "nn"
|
|
3539
|
-
},
|
|
3539
|
+
}, ns = {
|
|
3540
3540
|
0: 0,
|
|
3541
3541
|
// langEnglish → smRoman
|
|
3542
3542
|
1: 0,
|
|
@@ -3775,7 +3775,7 @@ var fn = { parse: Ja, make: es }, pn = [
|
|
|
3775
3775
|
// langAzerbaijanRoman → smRoman
|
|
3776
3776
|
151: 0
|
|
3777
3777
|
// langNynorsk → smRoman
|
|
3778
|
-
},
|
|
3778
|
+
}, vn = {
|
|
3779
3779
|
1078: "af",
|
|
3780
3780
|
1052: "sq",
|
|
3781
3781
|
1156: "gsw",
|
|
@@ -3989,7 +3989,7 @@ var fn = { parse: Ja, make: es }, pn = [
|
|
|
3989
3989
|
1144: "ii",
|
|
3990
3990
|
1130: "yo"
|
|
3991
3991
|
};
|
|
3992
|
-
function
|
|
3992
|
+
function as(e, r, t) {
|
|
3993
3993
|
switch (e) {
|
|
3994
3994
|
case 0:
|
|
3995
3995
|
if (r === 65535)
|
|
@@ -3998,12 +3998,12 @@ function ts(e, r, t) {
|
|
|
3998
3998
|
return t[r];
|
|
3999
3999
|
break;
|
|
4000
4000
|
case 1:
|
|
4001
|
-
return cn[r];
|
|
4002
|
-
case 3:
|
|
4003
4001
|
return hn[r];
|
|
4002
|
+
case 3:
|
|
4003
|
+
return vn[r];
|
|
4004
4004
|
}
|
|
4005
4005
|
}
|
|
4006
|
-
var Dr = "utf-16",
|
|
4006
|
+
var Dr = "utf-16", ss = {
|
|
4007
4007
|
0: "macintosh",
|
|
4008
4008
|
// smRoman
|
|
4009
4009
|
1: "x-mac-japanese",
|
|
@@ -4062,7 +4062,7 @@ var Dr = "utf-16", ns = {
|
|
|
4062
4062
|
// smVietnamese
|
|
4063
4063
|
31: "x-mac-extarabic"
|
|
4064
4064
|
// smExtArabic
|
|
4065
|
-
},
|
|
4065
|
+
}, os = {
|
|
4066
4066
|
15: "x-mac-icelandic",
|
|
4067
4067
|
// langIcelandic
|
|
4068
4068
|
17: "x-mac-turkish",
|
|
@@ -4094,26 +4094,26 @@ var Dr = "utf-16", ns = {
|
|
|
4094
4094
|
146: "x-mac-gaelic"
|
|
4095
4095
|
// langIrishGaelicScript
|
|
4096
4096
|
};
|
|
4097
|
-
function
|
|
4097
|
+
function dn(e, r, t) {
|
|
4098
4098
|
switch (e) {
|
|
4099
4099
|
case 0:
|
|
4100
4100
|
return Dr;
|
|
4101
4101
|
case 1:
|
|
4102
|
-
return
|
|
4102
|
+
return os[t] || ss[r];
|
|
4103
4103
|
case 3:
|
|
4104
4104
|
if (r === 1 || r === 10)
|
|
4105
4105
|
return Dr;
|
|
4106
4106
|
break;
|
|
4107
4107
|
}
|
|
4108
4108
|
}
|
|
4109
|
-
function
|
|
4109
|
+
function is(e, r, t) {
|
|
4110
4110
|
for (var n = {}, a = new k.Parser(e, r), s = a.parseUShort(), o = a.parseUShort(), u = a.offset + a.parseUShort(), i = 0; i < o; i++) {
|
|
4111
|
-
var l = a.parseUShort(), f = a.parseUShort(), c = a.parseUShort(), p = a.parseUShort(), h =
|
|
4112
|
-
if (
|
|
4113
|
-
var
|
|
4114
|
-
if (
|
|
4115
|
-
var
|
|
4116
|
-
|
|
4111
|
+
var l = a.parseUShort(), f = a.parseUShort(), c = a.parseUShort(), p = a.parseUShort(), h = cn[p] || p, d = a.parseUShort(), g = a.parseUShort(), m = as(l, c, t), x = dn(l, f, c);
|
|
4112
|
+
if (x !== void 0 && m !== void 0) {
|
|
4113
|
+
var U = void 0;
|
|
4114
|
+
if (x === Dr ? U = Oe.UTF16(e, u + g, d) : U = Oe.MACSTRING(e, u + g, d, x), U) {
|
|
4115
|
+
var y = n[h];
|
|
4116
|
+
y === void 0 && (y = n[h] = {}), y[m] = U;
|
|
4117
4117
|
}
|
|
4118
4118
|
}
|
|
4119
4119
|
}
|
|
@@ -4135,7 +4135,7 @@ function ut(e, r, t, n, a, s) {
|
|
|
4135
4135
|
{ name: "offset", type: "USHORT", value: s }
|
|
4136
4136
|
]);
|
|
4137
4137
|
}
|
|
4138
|
-
function
|
|
4138
|
+
function us(e, r) {
|
|
4139
4139
|
var t = e.length, n = r.length - t + 1;
|
|
4140
4140
|
e:
|
|
4141
4141
|
for (var a = 0; a < n; a++)
|
|
@@ -4148,7 +4148,7 @@ function os(e, r) {
|
|
|
4148
4148
|
return -1;
|
|
4149
4149
|
}
|
|
4150
4150
|
function lt(e, r) {
|
|
4151
|
-
var t =
|
|
4151
|
+
var t = us(e, r);
|
|
4152
4152
|
if (t < 0) {
|
|
4153
4153
|
t = r.length;
|
|
4154
4154
|
for (var n = 0, a = e.length; n < a; ++n)
|
|
@@ -4156,55 +4156,55 @@ function lt(e, r) {
|
|
|
4156
4156
|
}
|
|
4157
4157
|
return t;
|
|
4158
4158
|
}
|
|
4159
|
-
function
|
|
4160
|
-
var t, n = [], a = {}, s = gr(
|
|
4159
|
+
function ls(e, r) {
|
|
4160
|
+
var t, n = [], a = {}, s = gr(cn);
|
|
4161
4161
|
for (var o in e) {
|
|
4162
4162
|
var u = s[o];
|
|
4163
4163
|
if (u === void 0 && (u = o), t = parseInt(u), isNaN(t))
|
|
4164
4164
|
throw new Error('Name table entry "' + o + '" does not exist, see nameTableNames for complete list.');
|
|
4165
4165
|
a[t] = e[o], n.push(t);
|
|
4166
4166
|
}
|
|
4167
|
-
for (var i = gr(
|
|
4167
|
+
for (var i = gr(hn), l = gr(vn), f = [], c = [], p = 0; p < n.length; p++) {
|
|
4168
4168
|
t = n[p];
|
|
4169
4169
|
var h = a[t];
|
|
4170
4170
|
for (var d in h) {
|
|
4171
|
-
var g = h[d], m = 1,
|
|
4172
|
-
|
|
4173
|
-
var w = lt(
|
|
4171
|
+
var g = h[d], m = 1, x = i[d], U = ns[x], y = dn(m, U, x), L = b.MACSTRING(g, y);
|
|
4172
|
+
L === void 0 && (m = 0, x = r.indexOf(d), x < 0 && (x = r.length, r.push(d)), U = 4, L = b.UTF16(g));
|
|
4173
|
+
var w = lt(L, c);
|
|
4174
4174
|
f.push(ut(
|
|
4175
4175
|
m,
|
|
4176
|
-
|
|
4177
|
-
|
|
4176
|
+
U,
|
|
4177
|
+
x,
|
|
4178
4178
|
t,
|
|
4179
|
-
|
|
4179
|
+
L.length,
|
|
4180
4180
|
w
|
|
4181
4181
|
));
|
|
4182
|
-
var
|
|
4183
|
-
if (
|
|
4184
|
-
var C = b.UTF16(g),
|
|
4182
|
+
var B = l[d];
|
|
4183
|
+
if (B !== void 0) {
|
|
4184
|
+
var C = b.UTF16(g), F = lt(C, c);
|
|
4185
4185
|
f.push(ut(
|
|
4186
4186
|
3,
|
|
4187
4187
|
1,
|
|
4188
|
-
|
|
4188
|
+
B,
|
|
4189
4189
|
t,
|
|
4190
4190
|
C.length,
|
|
4191
|
-
|
|
4191
|
+
F
|
|
4192
4192
|
));
|
|
4193
4193
|
}
|
|
4194
4194
|
}
|
|
4195
4195
|
}
|
|
4196
|
-
f.sort(function(A,
|
|
4197
|
-
return A.platformID -
|
|
4196
|
+
f.sort(function(A, H) {
|
|
4197
|
+
return A.platformID - H.platformID || A.encodingID - H.encodingID || A.languageID - H.languageID || A.nameID - H.nameID;
|
|
4198
4198
|
});
|
|
4199
|
-
for (var
|
|
4199
|
+
for (var D = new S.Table("name", [
|
|
4200
4200
|
{ name: "format", type: "USHORT", value: 0 },
|
|
4201
4201
|
{ name: "count", type: "USHORT", value: f.length },
|
|
4202
4202
|
{ name: "stringOffset", type: "USHORT", value: 6 + f.length * 12 }
|
|
4203
|
-
]),
|
|
4204
|
-
|
|
4205
|
-
return
|
|
4203
|
+
]), R = 0; R < f.length; R++)
|
|
4204
|
+
D.fields.push({ name: "record_" + R, type: "RECORD", value: f[R] });
|
|
4205
|
+
return D.fields.push({ name: "strings", type: "LITERAL", value: c }), D;
|
|
4206
4206
|
}
|
|
4207
|
-
var
|
|
4207
|
+
var gn = { parse: is, make: ls }, Ar = [
|
|
4208
4208
|
{ begin: 0, end: 127 },
|
|
4209
4209
|
// Basic Latin
|
|
4210
4210
|
{ begin: 128, end: 255 },
|
|
@@ -4452,7 +4452,7 @@ var dn = { parse: ss, make: is }, Ar = [
|
|
|
4452
4452
|
{ begin: 127024, end: 127135 }
|
|
4453
4453
|
// Domino Tiles
|
|
4454
4454
|
];
|
|
4455
|
-
function
|
|
4455
|
+
function fs(e) {
|
|
4456
4456
|
for (var r = 0; r < Ar.length; r += 1) {
|
|
4457
4457
|
var t = Ar[r];
|
|
4458
4458
|
if (e >= t.begin && e < t.end)
|
|
@@ -4460,14 +4460,14 @@ function us(e) {
|
|
|
4460
4460
|
}
|
|
4461
4461
|
return -1;
|
|
4462
4462
|
}
|
|
4463
|
-
function
|
|
4463
|
+
function ps(e, r) {
|
|
4464
4464
|
var t = {}, n = new k.Parser(e, r);
|
|
4465
4465
|
t.version = n.parseUShort(), t.xAvgCharWidth = n.parseShort(), t.usWeightClass = n.parseUShort(), t.usWidthClass = n.parseUShort(), t.fsType = n.parseUShort(), t.ySubscriptXSize = n.parseShort(), t.ySubscriptYSize = n.parseShort(), t.ySubscriptXOffset = n.parseShort(), t.ySubscriptYOffset = n.parseShort(), t.ySuperscriptXSize = n.parseShort(), t.ySuperscriptYSize = n.parseShort(), t.ySuperscriptXOffset = n.parseShort(), t.ySuperscriptYOffset = n.parseShort(), t.yStrikeoutSize = n.parseShort(), t.yStrikeoutPosition = n.parseShort(), t.sFamilyClass = n.parseShort(), t.panose = [];
|
|
4466
4466
|
for (var a = 0; a < 10; a++)
|
|
4467
4467
|
t.panose[a] = n.parseByte();
|
|
4468
4468
|
return t.ulUnicodeRange1 = n.parseULong(), t.ulUnicodeRange2 = n.parseULong(), t.ulUnicodeRange3 = n.parseULong(), t.ulUnicodeRange4 = n.parseULong(), t.achVendID = String.fromCharCode(n.parseByte(), n.parseByte(), n.parseByte(), n.parseByte()), t.fsSelection = n.parseUShort(), t.usFirstCharIndex = n.parseUShort(), t.usLastCharIndex = n.parseUShort(), t.sTypoAscender = n.parseShort(), t.sTypoDescender = n.parseShort(), t.sTypoLineGap = n.parseShort(), t.usWinAscent = n.parseUShort(), t.usWinDescent = n.parseUShort(), t.version >= 1 && (t.ulCodePageRange1 = n.parseULong(), t.ulCodePageRange2 = n.parseULong()), t.version >= 2 && (t.sxHeight = n.parseShort(), t.sCapHeight = n.parseShort(), t.usDefaultChar = n.parseUShort(), t.usBreakChar = n.parseUShort(), t.usMaxContent = n.parseUShort()), t;
|
|
4469
4469
|
}
|
|
4470
|
-
function
|
|
4470
|
+
function cs(e) {
|
|
4471
4471
|
return new S.Table("OS/2", [
|
|
4472
4472
|
{ name: "version", type: "USHORT", value: 3 },
|
|
4473
4473
|
{ name: "xAvgCharWidth", type: "SHORT", value: 0 },
|
|
@@ -4517,8 +4517,8 @@ function fs(e) {
|
|
|
4517
4517
|
{ name: "usMaxContext", type: "USHORT", value: 0 }
|
|
4518
4518
|
], e);
|
|
4519
4519
|
}
|
|
4520
|
-
var Br = { parse:
|
|
4521
|
-
function
|
|
4520
|
+
var Br = { parse: ps, make: cs, unicodeRanges: Ar, getUnicodeRange: fs };
|
|
4521
|
+
function hs(e, r) {
|
|
4522
4522
|
var t = {}, n = new k.Parser(e, r);
|
|
4523
4523
|
switch (t.version = n.parseVersion(), t.italicAngle = n.parseFixed(), t.underlinePosition = n.parseShort(), t.underlineThickness = n.parseShort(), t.isFixedPitch = n.parseULong(), t.minMemType42 = n.parseULong(), t.maxMemType42 = n.parseULong(), t.minMemType1 = n.parseULong(), t.maxMemType1 = n.parseULong(), t.version) {
|
|
4524
4524
|
case 1:
|
|
@@ -4543,7 +4543,7 @@ function ps(e, r) {
|
|
|
4543
4543
|
}
|
|
4544
4544
|
return t;
|
|
4545
4545
|
}
|
|
4546
|
-
function
|
|
4546
|
+
function vs() {
|
|
4547
4547
|
return new S.Table("post", [
|
|
4548
4548
|
{ name: "version", type: "FIXED", value: 196608 },
|
|
4549
4549
|
{ name: "italicAngle", type: "FIXED", value: 0 },
|
|
@@ -4556,7 +4556,7 @@ function cs() {
|
|
|
4556
4556
|
{ name: "maxMemType1", type: "ULONG", value: 0 }
|
|
4557
4557
|
]);
|
|
4558
4558
|
}
|
|
4559
|
-
var
|
|
4559
|
+
var mn = { parse: hs, make: vs }, ee = new Array(9);
|
|
4560
4560
|
ee[1] = function() {
|
|
4561
4561
|
var r = this.offset + this.relativeOffset, t = this.parseUShort();
|
|
4562
4562
|
if (t === 1)
|
|
@@ -4704,7 +4704,7 @@ ee[8] = function() {
|
|
|
4704
4704
|
substitutes: this.parseUShortList()
|
|
4705
4705
|
};
|
|
4706
4706
|
};
|
|
4707
|
-
function
|
|
4707
|
+
function ds(e, r) {
|
|
4708
4708
|
r = r || 0;
|
|
4709
4709
|
var t = new v(e, r), n = t.parseVersion(1);
|
|
4710
4710
|
return E.argument(n === 1 || n === 1.1, "Unsupported GSUB table version."), n === 1 ? {
|
|
@@ -4794,7 +4794,7 @@ Le[6] = function(r) {
|
|
|
4794
4794
|
}
|
|
4795
4795
|
E.assert(!1, "lookup type 6 format must be 1, 2 or 3.");
|
|
4796
4796
|
};
|
|
4797
|
-
function
|
|
4797
|
+
function gs(e) {
|
|
4798
4798
|
return new S.Table("GSUB", [
|
|
4799
4799
|
{ name: "version", type: "ULONG", value: 65536 },
|
|
4800
4800
|
{ name: "scripts", type: "TABLE", value: new S.ScriptList(e.scripts) },
|
|
@@ -4802,8 +4802,8 @@ function vs(e) {
|
|
|
4802
4802
|
{ name: "lookups", type: "TABLE", value: new S.LookupList(e.lookups, Le) }
|
|
4803
4803
|
]);
|
|
4804
4804
|
}
|
|
4805
|
-
var
|
|
4806
|
-
function
|
|
4805
|
+
var yn = { parse: ds, make: gs };
|
|
4806
|
+
function ms(e, r) {
|
|
4807
4807
|
var t = new k.Parser(e, r), n = t.parseULong();
|
|
4808
4808
|
E.argument(n === 1, "Unsupported META table version."), t.parseULong(), t.parseULong();
|
|
4809
4809
|
for (var a = t.parseULong(), s = {}, o = 0; o < a; o++) {
|
|
@@ -4812,7 +4812,7 @@ function ds(e, r) {
|
|
|
4812
4812
|
}
|
|
4813
4813
|
return s;
|
|
4814
4814
|
}
|
|
4815
|
-
function
|
|
4815
|
+
function ys(e) {
|
|
4816
4816
|
var r = Object.keys(e).length, t = "", n = 16 + r * 12, a = new S.Table("meta", [
|
|
4817
4817
|
{ name: "version", type: "ULONG", value: 1 },
|
|
4818
4818
|
{ name: "flags", type: "ULONG", value: 0 },
|
|
@@ -4825,7 +4825,7 @@ function gs(e) {
|
|
|
4825
4825
|
}
|
|
4826
4826
|
return a.fields.push({ name: "stringPool", type: "CHARARRAY", value: t }), a;
|
|
4827
4827
|
}
|
|
4828
|
-
var
|
|
4828
|
+
var xn = { parse: ms, make: ys };
|
|
4829
4829
|
function ft(e) {
|
|
4830
4830
|
return Math.log(e) / Math.log(2) | 0;
|
|
4831
4831
|
}
|
|
@@ -4844,7 +4844,7 @@ function pt(e, r, t, n) {
|
|
|
4844
4844
|
{ name: "length", type: "ULONG", value: n !== void 0 ? n : 0 }
|
|
4845
4845
|
]);
|
|
4846
4846
|
}
|
|
4847
|
-
function
|
|
4847
|
+
function bn(e) {
|
|
4848
4848
|
var r = new S.Table("sfnt", [
|
|
4849
4849
|
{ name: "version", type: "TAG", value: "OTTO" },
|
|
4850
4850
|
{ name: "numTables", type: "USHORT", value: 0 },
|
|
@@ -4878,65 +4878,65 @@ function ct(e, r, t) {
|
|
|
4878
4878
|
}
|
|
4879
4879
|
return t;
|
|
4880
4880
|
}
|
|
4881
|
-
function
|
|
4881
|
+
function xs(e) {
|
|
4882
4882
|
for (var r = 0, t = 0; t < e.length; t += 1)
|
|
4883
4883
|
r += e[t];
|
|
4884
4884
|
return r / e.length;
|
|
4885
4885
|
}
|
|
4886
|
-
function
|
|
4886
|
+
function bs(e) {
|
|
4887
4887
|
for (var r = [], t = [], n = [], a = [], s = [], o = [], u = [], i, l = 0, f = 0, c = 0, p = 0, h = 0, d = 0; d < e.glyphs.length; d += 1) {
|
|
4888
4888
|
var g = e.glyphs.get(d), m = g.unicode | 0;
|
|
4889
4889
|
if (isNaN(g.advanceWidth))
|
|
4890
4890
|
throw new Error("Glyph " + g.name + " (" + d + "): advanceWidth is not a number.");
|
|
4891
4891
|
(i > m || i === void 0) && m > 0 && (i = m), l < m && (l = m);
|
|
4892
|
-
var
|
|
4893
|
-
if (
|
|
4894
|
-
f |= 1 <<
|
|
4895
|
-
else if (
|
|
4896
|
-
c |= 1 <<
|
|
4897
|
-
else if (
|
|
4898
|
-
p |= 1 <<
|
|
4899
|
-
else if (
|
|
4900
|
-
h |= 1 <<
|
|
4892
|
+
var x = Br.getUnicodeRange(m);
|
|
4893
|
+
if (x < 32)
|
|
4894
|
+
f |= 1 << x;
|
|
4895
|
+
else if (x < 64)
|
|
4896
|
+
c |= 1 << x - 32;
|
|
4897
|
+
else if (x < 96)
|
|
4898
|
+
p |= 1 << x - 64;
|
|
4899
|
+
else if (x < 123)
|
|
4900
|
+
h |= 1 << x - 96;
|
|
4901
4901
|
else
|
|
4902
4902
|
throw new Error("Unicode ranges bits > 123 are reserved for internal usage");
|
|
4903
4903
|
if (g.name !== ".notdef") {
|
|
4904
|
-
var
|
|
4905
|
-
r.push(
|
|
4904
|
+
var U = g.getMetrics();
|
|
4905
|
+
r.push(U.xMin), t.push(U.yMin), n.push(U.xMax), a.push(U.yMax), o.push(U.leftSideBearing), u.push(U.rightSideBearing), s.push(g.advanceWidth);
|
|
4906
4906
|
}
|
|
4907
4907
|
}
|
|
4908
|
-
var
|
|
4908
|
+
var y = {
|
|
4909
4909
|
xMin: Math.min.apply(null, r),
|
|
4910
4910
|
yMin: Math.min.apply(null, t),
|
|
4911
4911
|
xMax: Math.max.apply(null, n),
|
|
4912
4912
|
yMax: Math.max.apply(null, a),
|
|
4913
4913
|
advanceWidthMax: Math.max.apply(null, s),
|
|
4914
|
-
advanceWidthAvg:
|
|
4914
|
+
advanceWidthAvg: xs(s),
|
|
4915
4915
|
minLeftSideBearing: Math.min.apply(null, o),
|
|
4916
4916
|
maxLeftSideBearing: Math.max.apply(null, o),
|
|
4917
4917
|
minRightSideBearing: Math.min.apply(null, u)
|
|
4918
4918
|
};
|
|
4919
|
-
|
|
4920
|
-
var
|
|
4919
|
+
y.ascender = e.ascender, y.descender = e.descender;
|
|
4920
|
+
var L = on.make({
|
|
4921
4921
|
flags: 3,
|
|
4922
4922
|
// 00000011 (baseline for font at y=0; left sidebearing point at x=0)
|
|
4923
4923
|
unitsPerEm: e.unitsPerEm,
|
|
4924
|
-
xMin:
|
|
4925
|
-
yMin:
|
|
4926
|
-
xMax:
|
|
4927
|
-
yMax:
|
|
4924
|
+
xMin: y.xMin,
|
|
4925
|
+
yMin: y.yMin,
|
|
4926
|
+
xMax: y.xMax,
|
|
4927
|
+
yMax: y.yMax,
|
|
4928
4928
|
lowestRecPPEM: 3,
|
|
4929
4929
|
createdTimestamp: e.createdTimestamp
|
|
4930
|
-
}), w =
|
|
4931
|
-
ascender:
|
|
4932
|
-
descender:
|
|
4933
|
-
advanceWidthMax:
|
|
4934
|
-
minLeftSideBearing:
|
|
4935
|
-
minRightSideBearing:
|
|
4936
|
-
xMaxExtent:
|
|
4930
|
+
}), w = un.make({
|
|
4931
|
+
ascender: y.ascender,
|
|
4932
|
+
descender: y.descender,
|
|
4933
|
+
advanceWidthMax: y.advanceWidthMax,
|
|
4934
|
+
minLeftSideBearing: y.minLeftSideBearing,
|
|
4935
|
+
minRightSideBearing: y.minRightSideBearing,
|
|
4936
|
+
xMaxExtent: y.maxLeftSideBearing + (y.xMax - y.xMin),
|
|
4937
4937
|
numberOfHMetrics: e.glyphs.length
|
|
4938
|
-
}),
|
|
4939
|
-
xAvgCharWidth: Math.round(
|
|
4938
|
+
}), B = pn.make(e.glyphs.length), C = Br.make(Object.assign({
|
|
4939
|
+
xAvgCharWidth: Math.round(y.advanceWidthAvg),
|
|
4940
4940
|
usFirstCharIndex: i,
|
|
4941
4941
|
usLastCharIndex: l,
|
|
4942
4942
|
ulUnicodeRange1: f,
|
|
@@ -4947,36 +4947,36 @@ function ys(e) {
|
|
|
4947
4947
|
// We get metrics for typical characters (such as "x" for xHeight).
|
|
4948
4948
|
// We provide some fallback characters if characters are unavailable: their
|
|
4949
4949
|
// ordering was chosen experimentally.
|
|
4950
|
-
sTypoAscender:
|
|
4951
|
-
sTypoDescender:
|
|
4950
|
+
sTypoAscender: y.ascender,
|
|
4951
|
+
sTypoDescender: y.descender,
|
|
4952
4952
|
sTypoLineGap: 0,
|
|
4953
|
-
usWinAscent:
|
|
4954
|
-
usWinDescent: Math.abs(
|
|
4953
|
+
usWinAscent: y.yMax,
|
|
4954
|
+
usWinDescent: Math.abs(y.yMin),
|
|
4955
4955
|
ulCodePageRange1: 1,
|
|
4956
4956
|
// FIXME: hard-code Latin 1 support for now
|
|
4957
|
-
sxHeight: ct(e, "xyvw", { yMax: Math.round(
|
|
4958
|
-
sCapHeight: ct(e, "HIKLEFJMNTZBDPRAGOQSUVWXY",
|
|
4957
|
+
sxHeight: ct(e, "xyvw", { yMax: Math.round(y.ascender / 2) }).yMax,
|
|
4958
|
+
sCapHeight: ct(e, "HIKLEFJMNTZBDPRAGOQSUVWXY", y).yMax,
|
|
4959
4959
|
usDefaultChar: e.hasChar(" ") ? 32 : 0,
|
|
4960
4960
|
// Use space as the default character, if available.
|
|
4961
4961
|
usBreakChar: e.hasChar(" ") ? 32 : 0
|
|
4962
4962
|
// Use space as the break character, if available.
|
|
4963
|
-
}, e.tables.os2)),
|
|
4964
|
-
Q || (Q =
|
|
4963
|
+
}, e.tables.os2)), F = ln.make(e.glyphs), D = $t.make(e.glyphs), R = e.getEnglishName("fontFamily"), A = e.getEnglishName("fontSubfamily"), H = R + " " + A, Q = e.getEnglishName("postScriptName");
|
|
4964
|
+
Q || (Q = R.replace(/\s/g, "") + "-" + A);
|
|
4965
4965
|
var G = {};
|
|
4966
|
-
for (var
|
|
4967
|
-
G[
|
|
4968
|
-
G.uniqueID || (G.uniqueID = { en: e.getEnglishName("manufacturer") + ":" +
|
|
4969
|
-
var Y = [],
|
|
4966
|
+
for (var z in e.names)
|
|
4967
|
+
G[z] = e.names[z];
|
|
4968
|
+
G.uniqueID || (G.uniqueID = { en: e.getEnglishName("manufacturer") + ":" + H }), G.postScriptName || (G.postScriptName = { en: Q }), G.preferredFamily || (G.preferredFamily = e.names.fontFamily), G.preferredSubfamily || (G.preferredSubfamily = e.names.fontSubfamily);
|
|
4969
|
+
var Y = [], _ = gn.make(G, Y), P = Y.length > 0 ? fn.make(Y) : void 0, V = mn.make(), $ = sn.make(e.glyphs, {
|
|
4970
4970
|
version: e.getEnglishName("version"),
|
|
4971
|
-
fullName:
|
|
4972
|
-
familyName:
|
|
4971
|
+
fullName: H,
|
|
4972
|
+
familyName: R,
|
|
4973
4973
|
weightName: A,
|
|
4974
4974
|
postScriptName: Q,
|
|
4975
4975
|
unitsPerEm: e.unitsPerEm,
|
|
4976
|
-
fontBBox: [0,
|
|
4977
|
-
}),
|
|
4978
|
-
P &&
|
|
4979
|
-
for (var De =
|
|
4976
|
+
fontBBox: [0, y.yMin, y.ascender, y.advanceWidthMax]
|
|
4977
|
+
}), M = e.metas && Object.keys(e.metas).length > 0 ? xn.make(e.metas) : void 0, q = [L, w, B, C, _, D, V, $, F];
|
|
4978
|
+
P && q.push(P), e.tables.gsub && q.push(yn.make(e.tables.gsub)), M && q.push(M);
|
|
4979
|
+
for (var De = bn(q), cr = De.encode(), Ae = Vr(cr), Be = De.fields, Me = !1, Ce = 0; Ce < Be.length; Ce += 1)
|
|
4980
4980
|
if (Be[Ce].name === "head table") {
|
|
4981
4981
|
Be[Ce].value.checkSumAdjustment = 2981146554 - Ae, Me = !0;
|
|
4982
4982
|
break;
|
|
@@ -4985,7 +4985,7 @@ function ys(e) {
|
|
|
4985
4985
|
throw new Error("Could not find head table with checkSum to adjust.");
|
|
4986
4986
|
return De;
|
|
4987
4987
|
}
|
|
4988
|
-
var
|
|
4988
|
+
var Ss = { make: bn, fontToTable: bs, computeCheckSum: Vr };
|
|
4989
4989
|
function mr(e, r) {
|
|
4990
4990
|
for (var t = 0, n = e.length - 1; t <= n; ) {
|
|
4991
4991
|
var a = t + n >>> 1, s = e[a].tag;
|
|
@@ -5268,7 +5268,7 @@ Ve.prototype.getKerningTables = function(e, r) {
|
|
|
5268
5268
|
function j(e) {
|
|
5269
5269
|
_e.call(this, e, "gsub");
|
|
5270
5270
|
}
|
|
5271
|
-
function
|
|
5271
|
+
function Ts(e, r) {
|
|
5272
5272
|
var t = e.length;
|
|
5273
5273
|
if (t !== r.length)
|
|
5274
5274
|
return !1;
|
|
@@ -5398,7 +5398,7 @@ j.prototype.addLigature = function(e, r, t, n) {
|
|
|
5398
5398
|
}, l = this.binSearch(s.coverage.glyphs, o);
|
|
5399
5399
|
if (l >= 0) {
|
|
5400
5400
|
for (var f = s.ligatureSets[l], c = 0; c < f.length; c++)
|
|
5401
|
-
if (
|
|
5401
|
+
if (Ts(f[c].components, u))
|
|
5402
5402
|
return;
|
|
5403
5403
|
f.push(i);
|
|
5404
5404
|
} else
|
|
@@ -5436,15 +5436,15 @@ j.prototype.add = function(e, r, t, n) {
|
|
|
5436
5436
|
return r.by instanceof Array ? this.addMultiple(e, r, t, n) : this.addLigature(e, r, t, n);
|
|
5437
5437
|
}
|
|
5438
5438
|
};
|
|
5439
|
-
function
|
|
5439
|
+
function ks() {
|
|
5440
5440
|
return typeof window < "u";
|
|
5441
5441
|
}
|
|
5442
|
-
function
|
|
5442
|
+
function Sn(e) {
|
|
5443
5443
|
for (var r = new ArrayBuffer(e.length), t = new Uint8Array(r), n = 0; n < e.length; ++n)
|
|
5444
5444
|
t[n] = e[n];
|
|
5445
5445
|
return r;
|
|
5446
5446
|
}
|
|
5447
|
-
function
|
|
5447
|
+
function Fs(e) {
|
|
5448
5448
|
for (var r = new Buffer(e.byteLength), t = new Uint8Array(e), n = 0; n < r.length; ++n)
|
|
5449
5449
|
r[n] = t[n];
|
|
5450
5450
|
return r;
|
|
@@ -5457,7 +5457,7 @@ function dt(e, r, t, n, a) {
|
|
|
5457
5457
|
var s;
|
|
5458
5458
|
return (r & n) > 0 ? (s = e.parseByte(), (r & a) === 0 && (s = -s), s = t + s) : (r & a) > 0 ? s = t : s = t + e.parseShort(), s;
|
|
5459
5459
|
}
|
|
5460
|
-
function
|
|
5460
|
+
function Tn(e, r, t) {
|
|
5461
5461
|
var n = new k.Parser(r, t);
|
|
5462
5462
|
e.numberOfContours = n.parseShort(), e._xMin = n.parseShort(), e._yMin = n.parseShort(), e._xMax = n.parseShort(), e._yMax = n.parseShort();
|
|
5463
5463
|
var a, s;
|
|
@@ -5478,10 +5478,10 @@ function Sn(e, r, t) {
|
|
|
5478
5478
|
if (l > 0) {
|
|
5479
5479
|
for (var g = 0; g < l; g += 1)
|
|
5480
5480
|
s = a[g], d = {}, d.onCurve = !!(s & 1), d.lastPointOfContour = o.indexOf(g) >= 0, h.push(d);
|
|
5481
|
-
for (var m = 0,
|
|
5482
|
-
s = a[
|
|
5483
|
-
for (var
|
|
5484
|
-
s = a[
|
|
5481
|
+
for (var m = 0, x = 0; x < l; x += 1)
|
|
5482
|
+
s = a[x], d = h[x], d.x = dt(n, s, m, 2, 16), m = d.x;
|
|
5483
|
+
for (var U = 0, y = 0; y < l; y += 1)
|
|
5484
|
+
s = a[y], d = h[y], d.y = dt(n, s, U, 4, 32), U = d.y;
|
|
5485
5485
|
}
|
|
5486
5486
|
e.points = h;
|
|
5487
5487
|
} else
|
|
@@ -5490,7 +5490,7 @@ function Sn(e, r, t) {
|
|
|
5490
5490
|
e.points = [];
|
|
5491
5491
|
else {
|
|
5492
5492
|
e.isComposite = !0, e.points = [], e.components = [];
|
|
5493
|
-
for (var
|
|
5493
|
+
for (var L = !0; L; ) {
|
|
5494
5494
|
a = n.parseUShort();
|
|
5495
5495
|
var w = {
|
|
5496
5496
|
glyphIndex: n.parseUShort(),
|
|
@@ -5501,11 +5501,11 @@ function Sn(e, r, t) {
|
|
|
5501
5501
|
dx: 0,
|
|
5502
5502
|
dy: 0
|
|
5503
5503
|
};
|
|
5504
|
-
(a & 1) > 0 ? (a & 2) > 0 ? (w.dx = n.parseShort(), w.dy = n.parseShort()) : w.matchedPoints = [n.parseUShort(), n.parseUShort()] : (a & 2) > 0 ? (w.dx = n.parseChar(), w.dy = n.parseChar()) : w.matchedPoints = [n.parseByte(), n.parseByte()], (a & 8) > 0 ? w.xScale = w.yScale = n.parseF2Dot14() : (a & 64) > 0 ? (w.xScale = n.parseF2Dot14(), w.yScale = n.parseF2Dot14()) : (a & 128) > 0 && (w.xScale = n.parseF2Dot14(), w.scale01 = n.parseF2Dot14(), w.scale10 = n.parseF2Dot14(), w.yScale = n.parseF2Dot14()), e.components.push(w),
|
|
5504
|
+
(a & 1) > 0 ? (a & 2) > 0 ? (w.dx = n.parseShort(), w.dy = n.parseShort()) : w.matchedPoints = [n.parseUShort(), n.parseUShort()] : (a & 2) > 0 ? (w.dx = n.parseChar(), w.dy = n.parseChar()) : w.matchedPoints = [n.parseByte(), n.parseByte()], (a & 8) > 0 ? w.xScale = w.yScale = n.parseF2Dot14() : (a & 64) > 0 ? (w.xScale = n.parseF2Dot14(), w.yScale = n.parseF2Dot14()) : (a & 128) > 0 && (w.xScale = n.parseF2Dot14(), w.scale01 = n.parseF2Dot14(), w.scale10 = n.parseF2Dot14(), w.yScale = n.parseF2Dot14()), e.components.push(w), L = !!(a & 32);
|
|
5505
5505
|
}
|
|
5506
5506
|
if (a & 256) {
|
|
5507
5507
|
e.instructionLength = n.parseUShort(), e.instructions = [];
|
|
5508
|
-
for (var
|
|
5508
|
+
for (var B = 0; B < e.instructionLength; B += 1)
|
|
5509
5509
|
e.instructions.push(n.parseByte());
|
|
5510
5510
|
}
|
|
5511
5511
|
}
|
|
@@ -5522,18 +5522,18 @@ function yr(e, r) {
|
|
|
5522
5522
|
}
|
|
5523
5523
|
return t;
|
|
5524
5524
|
}
|
|
5525
|
-
function
|
|
5525
|
+
function Us(e) {
|
|
5526
5526
|
for (var r = [], t = [], n = 0; n < e.length; n += 1) {
|
|
5527
5527
|
var a = e[n];
|
|
5528
5528
|
t.push(a), a.lastPointOfContour && (r.push(t), t = []);
|
|
5529
5529
|
}
|
|
5530
5530
|
return E.argument(t.length === 0, "There are still points left in the current contour."), r;
|
|
5531
5531
|
}
|
|
5532
|
-
function
|
|
5533
|
-
var r = new
|
|
5532
|
+
function kn(e) {
|
|
5533
|
+
var r = new X();
|
|
5534
5534
|
if (!e)
|
|
5535
5535
|
return r;
|
|
5536
|
-
for (var t =
|
|
5536
|
+
for (var t = Us(e), n = 0; n < t.length; ++n) {
|
|
5537
5537
|
var a = t[n], s = null, o = a[a.length - 1], u = a[0];
|
|
5538
5538
|
if (o.onCurve)
|
|
5539
5539
|
r.moveTo(o.x, o.y);
|
|
@@ -5554,7 +5554,7 @@ function Tn(e) {
|
|
|
5554
5554
|
}
|
|
5555
5555
|
return r;
|
|
5556
5556
|
}
|
|
5557
|
-
function
|
|
5557
|
+
function Fn(e, r) {
|
|
5558
5558
|
if (r.isComposite)
|
|
5559
5559
|
for (var t = 0; t < r.components.length; t += 1) {
|
|
5560
5560
|
var n = r.components[t], a = e.get(n.glyphIndex);
|
|
@@ -5578,50 +5578,50 @@ function kn(e, r) {
|
|
|
5578
5578
|
r.points = r.points.concat(s);
|
|
5579
5579
|
}
|
|
5580
5580
|
}
|
|
5581
|
-
return
|
|
5581
|
+
return kn(r.points);
|
|
5582
5582
|
}
|
|
5583
|
-
function
|
|
5583
|
+
function Cs(e, r, t, n) {
|
|
5584
5584
|
for (var a = new le.GlyphSet(n), s = 0; s < t.length - 1; s += 1) {
|
|
5585
5585
|
var o = t[s], u = t[s + 1];
|
|
5586
|
-
o !== u ? a.push(s, le.ttfGlyphLoader(n, s,
|
|
5586
|
+
o !== u ? a.push(s, le.ttfGlyphLoader(n, s, Tn, e, r + o, Fn)) : a.push(s, le.glyphLoader(n, s));
|
|
5587
5587
|
}
|
|
5588
5588
|
return a;
|
|
5589
5589
|
}
|
|
5590
|
-
function
|
|
5590
|
+
function ws(e, r, t, n) {
|
|
5591
5591
|
var a = new le.GlyphSet(n);
|
|
5592
5592
|
return n._push = function(s) {
|
|
5593
5593
|
var o = t[s], u = t[s + 1];
|
|
5594
|
-
o !== u ? a.push(s, le.ttfGlyphLoader(n, s,
|
|
5594
|
+
o !== u ? a.push(s, le.ttfGlyphLoader(n, s, Tn, e, r + o, Fn)) : a.push(s, le.glyphLoader(n, s));
|
|
5595
5595
|
}, a;
|
|
5596
5596
|
}
|
|
5597
|
-
function
|
|
5598
|
-
return a.lowMemory ?
|
|
5597
|
+
function Es(e, r, t, n, a) {
|
|
5598
|
+
return a.lowMemory ? ws(e, r, t, n) : Cs(e, r, t, n);
|
|
5599
5599
|
}
|
|
5600
|
-
var
|
|
5601
|
-
function
|
|
5600
|
+
var Un = { getPath: kn, parse: Es }, Cn, Ue, wn, Mr;
|
|
5601
|
+
function En(e) {
|
|
5602
5602
|
this.font = e, this.getCommands = function(r) {
|
|
5603
|
-
return
|
|
5603
|
+
return Un.getPath(r).commands;
|
|
5604
5604
|
}, this._fpgmState = this._prepState = void 0, this._errorState = 0;
|
|
5605
5605
|
}
|
|
5606
|
-
function
|
|
5606
|
+
function Os(e) {
|
|
5607
5607
|
return e;
|
|
5608
5608
|
}
|
|
5609
|
-
function
|
|
5609
|
+
function On(e) {
|
|
5610
5610
|
return Math.sign(e) * Math.round(Math.abs(e));
|
|
5611
5611
|
}
|
|
5612
|
-
function
|
|
5612
|
+
function Ls(e) {
|
|
5613
5613
|
return Math.sign(e) * Math.round(Math.abs(e * 2)) / 2;
|
|
5614
5614
|
}
|
|
5615
|
-
function
|
|
5615
|
+
function Rs(e) {
|
|
5616
5616
|
return Math.sign(e) * (Math.round(Math.abs(e) + 0.5) - 0.5);
|
|
5617
5617
|
}
|
|
5618
|
-
function
|
|
5618
|
+
function Ds(e) {
|
|
5619
5619
|
return Math.sign(e) * Math.ceil(Math.abs(e));
|
|
5620
5620
|
}
|
|
5621
|
-
function
|
|
5621
|
+
function As(e) {
|
|
5622
5622
|
return Math.sign(e) * Math.floor(Math.abs(e));
|
|
5623
5623
|
}
|
|
5624
|
-
var
|
|
5624
|
+
var Ln = function(e) {
|
|
5625
5625
|
var r = this.srPeriod, t = this.srPhase, n = this.srThreshold, a = 1;
|
|
5626
5626
|
return e < 0 && (e = -e, a = -1), e += n - t, e = Math.trunc(e / r) * r, e += t, e < 0 ? t * a : e * a;
|
|
5627
5627
|
}, ue = {
|
|
@@ -5794,7 +5794,7 @@ ce.prototype.prevTouched = function(e) {
|
|
|
5794
5794
|
r = r.prevPointOnContour;
|
|
5795
5795
|
return r;
|
|
5796
5796
|
};
|
|
5797
|
-
var ze = Object.freeze(new ce(0, 0)),
|
|
5797
|
+
var ze = Object.freeze(new ce(0, 0)), Bs = {
|
|
5798
5798
|
cvCutIn: 17 / 16,
|
|
5799
5799
|
// control value cut in
|
|
5800
5800
|
deltaBase: 9,
|
|
@@ -5811,10 +5811,10 @@ function xe(e, r) {
|
|
|
5811
5811
|
this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
|
|
5812
5812
|
/* fall through */
|
|
5813
5813
|
case "prep":
|
|
5814
|
-
this.fv = this.pv = this.dpv = ue, this.round =
|
|
5814
|
+
this.fv = this.pv = this.dpv = ue, this.round = On;
|
|
5815
5815
|
}
|
|
5816
5816
|
}
|
|
5817
|
-
|
|
5817
|
+
En.prototype.exec = function(e, r) {
|
|
5818
5818
|
if (typeof r != "number")
|
|
5819
5819
|
throw new Error("Point size is not a number!");
|
|
5820
5820
|
if (!(this._errorState > 2)) {
|
|
@@ -5822,7 +5822,7 @@ wn.prototype.exec = function(e, r) {
|
|
|
5822
5822
|
if (!n || n.ppem !== r) {
|
|
5823
5823
|
var a = this._fpgmState;
|
|
5824
5824
|
if (!a) {
|
|
5825
|
-
xe.prototype =
|
|
5825
|
+
xe.prototype = Bs, a = this._fpgmState = new xe("fpgm", t.tables.fpgm), a.funcs = [], a.font = t, exports.DEBUG && (console.log("---EXEC FPGM---"), a.step = -1);
|
|
5826
5826
|
try {
|
|
5827
5827
|
Ue(a);
|
|
5828
5828
|
} catch (l) {
|
|
@@ -5846,14 +5846,14 @@ wn.prototype.exec = function(e, r) {
|
|
|
5846
5846
|
}
|
|
5847
5847
|
if (!(this._errorState > 1))
|
|
5848
5848
|
try {
|
|
5849
|
-
return
|
|
5849
|
+
return wn(e, n);
|
|
5850
5850
|
} catch (l) {
|
|
5851
5851
|
this._errorState < 1 && (console.log("Hinting error:" + l), console.log("Note: further hinting errors are silenced")), this._errorState = 1;
|
|
5852
5852
|
return;
|
|
5853
5853
|
}
|
|
5854
5854
|
}
|
|
5855
5855
|
};
|
|
5856
|
-
|
|
5856
|
+
wn = function(e, r) {
|
|
5857
5857
|
var t = r.ppem / r.font.unitsPerEm, n = t, a = e.components, s, o, u;
|
|
5858
5858
|
if (xe.prototype = r, !a)
|
|
5859
5859
|
u = new xe("glyf", e.instructions), exports.DEBUG && (console.log("---EXEC GLYPH---"), u.step = -1), Mr(e, u, t, n), o = u.gZone;
|
|
@@ -5864,13 +5864,13 @@ Cn = function(e, r) {
|
|
|
5864
5864
|
var f = a[l], c = i.glyphs.get(f.glyphIndex);
|
|
5865
5865
|
u = new xe("glyf", c.instructions), exports.DEBUG && (console.log("---EXEC COMP " + l + "---"), u.step = -1), Mr(c, u, t, n);
|
|
5866
5866
|
for (var p = Math.round(f.dx * t), h = Math.round(f.dy * n), d = u.gZone, g = u.contours, m = 0; m < d.length; m++) {
|
|
5867
|
-
var
|
|
5868
|
-
|
|
5867
|
+
var x = d[m];
|
|
5868
|
+
x.xTouched = x.yTouched = !1, x.xo = x.x = x.x + p, x.yo = x.y = x.y + h;
|
|
5869
5869
|
}
|
|
5870
|
-
var
|
|
5870
|
+
var U = o.length;
|
|
5871
5871
|
o.push.apply(o, d);
|
|
5872
|
-
for (var
|
|
5873
|
-
s.push(g[
|
|
5872
|
+
for (var y = 0; y < g.length; y++)
|
|
5873
|
+
s.push(g[y] + U);
|
|
5874
5874
|
}
|
|
5875
5875
|
e.instructions && !u.inhibitGridFit && (u = new xe("glyf", e.instructions), u.gZone = u.z0 = u.z1 = u.z2 = o, u.contours = s, o.push(
|
|
5876
5876
|
new ce(0, 0),
|
|
@@ -5910,7 +5910,7 @@ Ue = function(e) {
|
|
|
5910
5910
|
if (r) {
|
|
5911
5911
|
var t = r.length, n;
|
|
5912
5912
|
for (e.ip = 0; e.ip < t; e.ip++) {
|
|
5913
|
-
if (exports.DEBUG && e.step++, n =
|
|
5913
|
+
if (exports.DEBUG && e.step++, n = Cn[r[e.ip]], !n)
|
|
5914
5914
|
throw new Error(
|
|
5915
5915
|
"unknown instruction: 0x" + Number(r[e.ip]).toString(16)
|
|
5916
5916
|
);
|
|
@@ -5922,7 +5922,7 @@ function lr(e) {
|
|
|
5922
5922
|
for (var r = e.tZone = new Array(e.gZone.length), t = 0; t < r.length; t++)
|
|
5923
5923
|
r[t] = new ce(0, 0);
|
|
5924
5924
|
}
|
|
5925
|
-
function
|
|
5925
|
+
function Rn(e, r) {
|
|
5926
5926
|
var t = e.prog, n = e.ip, a = 1, s;
|
|
5927
5927
|
do
|
|
5928
5928
|
if (s = t[++n], s === 88)
|
|
@@ -5963,41 +5963,41 @@ function bt(e, r) {
|
|
|
5963
5963
|
var u, i;
|
|
5964
5964
|
e ? (u = s.y - o.y, i = o.x - s.x) : (u = o.x - s.x, i = o.y - s.y), r.fv = Xe(u, i);
|
|
5965
5965
|
}
|
|
5966
|
-
function
|
|
5966
|
+
function Ms(e) {
|
|
5967
5967
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
5968
5968
|
exports.DEBUG && console.log(e.step, "SPVFS[]", t, n), e.pv = e.dpv = Xe(n, t);
|
|
5969
5969
|
}
|
|
5970
|
-
function
|
|
5970
|
+
function Is(e) {
|
|
5971
5971
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
5972
5972
|
exports.DEBUG && console.log(e.step, "SPVFS[]", t, n), e.fv = Xe(n, t);
|
|
5973
5973
|
}
|
|
5974
|
-
function
|
|
5974
|
+
function Ps(e) {
|
|
5975
5975
|
var r = e.stack, t = e.pv;
|
|
5976
5976
|
exports.DEBUG && console.log(e.step, "GPV[]"), r.push(t.x * 16384), r.push(t.y * 16384);
|
|
5977
5977
|
}
|
|
5978
|
-
function
|
|
5978
|
+
function Gs(e) {
|
|
5979
5979
|
var r = e.stack, t = e.fv;
|
|
5980
5980
|
exports.DEBUG && console.log(e.step, "GFV[]"), r.push(t.x * 16384), r.push(t.y * 16384);
|
|
5981
5981
|
}
|
|
5982
|
-
function
|
|
5982
|
+
function Ns(e) {
|
|
5983
5983
|
e.fv = e.pv, exports.DEBUG && console.log(e.step, "SFVTPV[]");
|
|
5984
5984
|
}
|
|
5985
|
-
function
|
|
5985
|
+
function Hs(e) {
|
|
5986
5986
|
var r = e.stack, t = r.pop(), n = r.pop(), a = r.pop(), s = r.pop(), o = r.pop(), u = e.z0, i = e.z1, l = u[t], f = u[n], c = i[a], p = i[s], h = e.z2[o];
|
|
5987
5987
|
exports.DEBUG && console.log("ISECT[], ", t, n, a, s, o);
|
|
5988
|
-
var d = l.x, g = l.y, m = f.x,
|
|
5989
|
-
h.x = (C * (
|
|
5988
|
+
var d = l.x, g = l.y, m = f.x, x = f.y, U = c.x, y = c.y, L = p.x, w = p.y, B = (d - m) * (y - w) - (g - x) * (U - L), C = d * x - g * m, F = U * w - y * L;
|
|
5989
|
+
h.x = (C * (U - L) - F * (d - m)) / B, h.y = (C * (y - w) - F * (g - x)) / B;
|
|
5990
5990
|
}
|
|
5991
|
-
function
|
|
5991
|
+
function Ws(e) {
|
|
5992
5992
|
e.rp0 = e.stack.pop(), exports.DEBUG && console.log(e.step, "SRP0[]", e.rp0);
|
|
5993
5993
|
}
|
|
5994
|
-
function
|
|
5994
|
+
function zs(e) {
|
|
5995
5995
|
e.rp1 = e.stack.pop(), exports.DEBUG && console.log(e.step, "SRP1[]", e.rp1);
|
|
5996
5996
|
}
|
|
5997
|
-
function
|
|
5997
|
+
function _s(e) {
|
|
5998
5998
|
e.rp2 = e.stack.pop(), exports.DEBUG && console.log(e.step, "SRP2[]", e.rp2);
|
|
5999
5999
|
}
|
|
6000
|
-
function
|
|
6000
|
+
function Vs(e) {
|
|
6001
6001
|
var r = e.stack.pop();
|
|
6002
6002
|
switch (exports.DEBUG && console.log(e.step, "SZP0[]", r), e.zp0 = r, r) {
|
|
6003
6003
|
case 0:
|
|
@@ -6010,7 +6010,7 @@ function zs(e) {
|
|
|
6010
6010
|
throw new Error("Invalid zone pointer");
|
|
6011
6011
|
}
|
|
6012
6012
|
}
|
|
6013
|
-
function
|
|
6013
|
+
function qs(e) {
|
|
6014
6014
|
var r = e.stack.pop();
|
|
6015
6015
|
switch (exports.DEBUG && console.log(e.step, "SZP1[]", r), e.zp1 = r, r) {
|
|
6016
6016
|
case 0:
|
|
@@ -6023,7 +6023,7 @@ function _s(e) {
|
|
|
6023
6023
|
throw new Error("Invalid zone pointer");
|
|
6024
6024
|
}
|
|
6025
6025
|
}
|
|
6026
|
-
function
|
|
6026
|
+
function Xs(e) {
|
|
6027
6027
|
var r = e.stack.pop();
|
|
6028
6028
|
switch (exports.DEBUG && console.log(e.step, "SZP2[]", r), e.zp2 = r, r) {
|
|
6029
6029
|
case 0:
|
|
@@ -6036,7 +6036,7 @@ function Vs(e) {
|
|
|
6036
6036
|
throw new Error("Invalid zone pointer");
|
|
6037
6037
|
}
|
|
6038
6038
|
}
|
|
6039
|
-
function
|
|
6039
|
+
function Ys(e) {
|
|
6040
6040
|
var r = e.stack.pop();
|
|
6041
6041
|
switch (exports.DEBUG && console.log(e.step, "SZPS[]", r), e.zp0 = e.zp1 = e.zp2 = r, r) {
|
|
6042
6042
|
case 0:
|
|
@@ -6049,49 +6049,49 @@ function qs(e) {
|
|
|
6049
6049
|
throw new Error("Invalid zone pointer");
|
|
6050
6050
|
}
|
|
6051
6051
|
}
|
|
6052
|
-
function
|
|
6052
|
+
function $s(e) {
|
|
6053
6053
|
e.loop = e.stack.pop(), exports.DEBUG && console.log(e.step, "SLOOP[]", e.loop);
|
|
6054
6054
|
}
|
|
6055
|
-
function
|
|
6056
|
-
exports.DEBUG && console.log(e.step, "RTG[]"), e.round =
|
|
6055
|
+
function Zs(e) {
|
|
6056
|
+
exports.DEBUG && console.log(e.step, "RTG[]"), e.round = On;
|
|
6057
6057
|
}
|
|
6058
|
-
function
|
|
6059
|
-
exports.DEBUG && console.log(e.step, "RTHG[]"), e.round =
|
|
6058
|
+
function Qs(e) {
|
|
6059
|
+
exports.DEBUG && console.log(e.step, "RTHG[]"), e.round = Rs;
|
|
6060
6060
|
}
|
|
6061
|
-
function
|
|
6061
|
+
function Ks(e) {
|
|
6062
6062
|
var r = e.stack.pop();
|
|
6063
6063
|
exports.DEBUG && console.log(e.step, "SMD[]", r), e.minDis = r / 64;
|
|
6064
6064
|
}
|
|
6065
|
-
function
|
|
6066
|
-
exports.DEBUG && console.log(e.step, "ELSE[]"),
|
|
6065
|
+
function js(e) {
|
|
6066
|
+
exports.DEBUG && console.log(e.step, "ELSE[]"), Rn(e, !1);
|
|
6067
6067
|
}
|
|
6068
|
-
function
|
|
6068
|
+
function Js(e) {
|
|
6069
6069
|
var r = e.stack.pop();
|
|
6070
6070
|
exports.DEBUG && console.log(e.step, "JMPR[]", r), e.ip += r - 1;
|
|
6071
6071
|
}
|
|
6072
|
-
function
|
|
6072
|
+
function eo(e) {
|
|
6073
6073
|
var r = e.stack.pop();
|
|
6074
6074
|
exports.DEBUG && console.log(e.step, "SCVTCI[]", r), e.cvCutIn = r / 64;
|
|
6075
6075
|
}
|
|
6076
|
-
function
|
|
6076
|
+
function ro(e) {
|
|
6077
6077
|
var r = e.stack;
|
|
6078
6078
|
exports.DEBUG && console.log(e.step, "DUP[]"), r.push(r[r.length - 1]);
|
|
6079
6079
|
}
|
|
6080
6080
|
function xr(e) {
|
|
6081
6081
|
exports.DEBUG && console.log(e.step, "POP[]"), e.stack.pop();
|
|
6082
6082
|
}
|
|
6083
|
-
function
|
|
6083
|
+
function to(e) {
|
|
6084
6084
|
exports.DEBUG && console.log(e.step, "CLEAR[]"), e.stack.length = 0;
|
|
6085
6085
|
}
|
|
6086
|
-
function
|
|
6086
|
+
function no(e) {
|
|
6087
6087
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6088
6088
|
exports.DEBUG && console.log(e.step, "SWAP[]"), r.push(t), r.push(n);
|
|
6089
6089
|
}
|
|
6090
|
-
function
|
|
6090
|
+
function ao(e) {
|
|
6091
6091
|
var r = e.stack;
|
|
6092
6092
|
exports.DEBUG && console.log(e.step, "DEPTH[]"), r.push(r.length);
|
|
6093
6093
|
}
|
|
6094
|
-
function
|
|
6094
|
+
function so(e) {
|
|
6095
6095
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6096
6096
|
exports.DEBUG && console.log(e.step, "LOOPCALL[]", t, n);
|
|
6097
6097
|
var a = e.ip, s = e.prog;
|
|
@@ -6104,21 +6104,21 @@ function no(e) {
|
|
|
6104
6104
|
);
|
|
6105
6105
|
e.ip = a, e.prog = s;
|
|
6106
6106
|
}
|
|
6107
|
-
function
|
|
6107
|
+
function oo(e) {
|
|
6108
6108
|
var r = e.stack.pop();
|
|
6109
6109
|
exports.DEBUG && console.log(e.step, "CALL[]", r);
|
|
6110
6110
|
var t = e.ip, n = e.prog;
|
|
6111
6111
|
e.prog = e.funcs[r], Ue(e), e.ip = t, e.prog = n, exports.DEBUG && console.log(++e.step, "returning from", r);
|
|
6112
6112
|
}
|
|
6113
|
-
function
|
|
6113
|
+
function io(e) {
|
|
6114
6114
|
var r = e.stack, t = r.pop();
|
|
6115
6115
|
exports.DEBUG && console.log(e.step, "CINDEX[]", t), r.push(r[r.length - t]);
|
|
6116
6116
|
}
|
|
6117
|
-
function
|
|
6117
|
+
function uo(e) {
|
|
6118
6118
|
var r = e.stack, t = r.pop();
|
|
6119
6119
|
exports.DEBUG && console.log(e.step, "MINDEX[]", t), r.push(r.splice(r.length - t, 1)[0]);
|
|
6120
6120
|
}
|
|
6121
|
-
function
|
|
6121
|
+
function lo(e) {
|
|
6122
6122
|
if (e.env !== "fpgm")
|
|
6123
6123
|
throw new Error("FDEF not allowed here");
|
|
6124
6124
|
var r = e.stack, t = e.prog, n = e.ip, a = r.pop(), s = n;
|
|
@@ -6174,7 +6174,7 @@ function Ut(e, r) {
|
|
|
6174
6174
|
for (var l, f = o.distance(a, a, !1, !0), c = i.length - 2, p = 0; p < c; p++)
|
|
6175
6175
|
l = i[p], s.setRelative(l, l, f, o);
|
|
6176
6176
|
}
|
|
6177
|
-
function
|
|
6177
|
+
function fo(e) {
|
|
6178
6178
|
for (var r = e.stack, t = e.loop, n = e.fv, a = r.pop() / 64, s = e.z2; t--; ) {
|
|
6179
6179
|
var o = r.pop(), u = s[o];
|
|
6180
6180
|
exports.DEBUG && console.log(
|
|
@@ -6186,7 +6186,7 @@ function uo(e) {
|
|
|
6186
6186
|
}
|
|
6187
6187
|
e.loop = 1;
|
|
6188
6188
|
}
|
|
6189
|
-
function
|
|
6189
|
+
function po(e) {
|
|
6190
6190
|
for (var r = e.stack, t = e.rp1, n = e.rp2, a = e.loop, s = e.z0[t], o = e.z1[n], u = e.fv, i = e.dpv, l = e.z2; a--; ) {
|
|
6191
6191
|
var f = r.pop(), c = l[f];
|
|
6192
6192
|
exports.DEBUG && console.log(
|
|
@@ -6204,7 +6204,7 @@ function Ct(e, r) {
|
|
|
6204
6204
|
var t = r.stack, n = t.pop() / 64, a = t.pop(), s = r.z1[a], o = r.z0[r.rp0], u = r.fv, i = r.pv;
|
|
6205
6205
|
u.setRelative(s, o, n, i), u.touch(s), exports.DEBUG && console.log(r.step, "MSIRP[" + e + "]", n, a), r.rp1 = r.rp0, r.rp2 = a, e && (r.rp0 = a);
|
|
6206
6206
|
}
|
|
6207
|
-
function
|
|
6207
|
+
function co(e) {
|
|
6208
6208
|
for (var r = e.stack, t = e.rp0, n = e.z0[t], a = e.loop, s = e.fv, o = e.pv, u = e.z1; a--; ) {
|
|
6209
6209
|
var i = r.pop(), l = u[i];
|
|
6210
6210
|
exports.DEBUG && console.log(
|
|
@@ -6215,8 +6215,8 @@ function fo(e) {
|
|
|
6215
6215
|
}
|
|
6216
6216
|
e.loop = 1;
|
|
6217
6217
|
}
|
|
6218
|
-
function
|
|
6219
|
-
exports.DEBUG && console.log(e.step, "RTDG[]"), e.round =
|
|
6218
|
+
function ho(e) {
|
|
6219
|
+
exports.DEBUG && console.log(e.step, "RTDG[]"), e.round = Ls;
|
|
6220
6220
|
}
|
|
6221
6221
|
function wt(e, r) {
|
|
6222
6222
|
var t = r.stack, n = t.pop(), a = t.pop(), s = r.z0[a], o = r.fv, u = r.pv, i = r.cvt[n];
|
|
@@ -6232,14 +6232,14 @@ function wt(e, r) {
|
|
|
6232
6232
|
var l = u.distance(s, ze);
|
|
6233
6233
|
e && (Math.abs(l - i) < r.cvCutIn && (l = i), l = r.round(l)), o.setRelative(s, ze, l, u), r.zp0 === 0 && (s.xo = s.x, s.yo = s.y), o.touch(s), r.rp0 = r.rp1 = a;
|
|
6234
6234
|
}
|
|
6235
|
-
function
|
|
6235
|
+
function vo(e) {
|
|
6236
6236
|
var r = e.prog, t = e.ip, n = e.stack, a = r[++t];
|
|
6237
6237
|
exports.DEBUG && console.log(e.step, "NPUSHB[]", a);
|
|
6238
6238
|
for (var s = 0; s < a; s++)
|
|
6239
6239
|
n.push(r[++t]);
|
|
6240
6240
|
e.ip = t;
|
|
6241
6241
|
}
|
|
6242
|
-
function
|
|
6242
|
+
function go(e) {
|
|
6243
6243
|
var r = e.ip, t = e.prog, n = e.stack, a = t[++r];
|
|
6244
6244
|
exports.DEBUG && console.log(e.step, "NPUSHW[]", a);
|
|
6245
6245
|
for (var s = 0; s < a; s++) {
|
|
@@ -6248,23 +6248,23 @@ function ho(e) {
|
|
|
6248
6248
|
}
|
|
6249
6249
|
e.ip = r;
|
|
6250
6250
|
}
|
|
6251
|
-
function
|
|
6251
|
+
function mo(e) {
|
|
6252
6252
|
var r = e.stack, t = e.store;
|
|
6253
6253
|
t || (t = e.store = []);
|
|
6254
6254
|
var n = r.pop(), a = r.pop();
|
|
6255
6255
|
exports.DEBUG && console.log(e.step, "WS", n, a), t[a] = n;
|
|
6256
6256
|
}
|
|
6257
|
-
function
|
|
6257
|
+
function yo(e) {
|
|
6258
6258
|
var r = e.stack, t = e.store, n = r.pop();
|
|
6259
6259
|
exports.DEBUG && console.log(e.step, "RS", n);
|
|
6260
6260
|
var a = t && t[n] || 0;
|
|
6261
6261
|
r.push(a);
|
|
6262
6262
|
}
|
|
6263
|
-
function
|
|
6263
|
+
function xo(e) {
|
|
6264
6264
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6265
6265
|
exports.DEBUG && console.log(e.step, "WCVTP", t, n), e.cvt[n] = t / 64;
|
|
6266
6266
|
}
|
|
6267
|
-
function
|
|
6267
|
+
function bo(e) {
|
|
6268
6268
|
var r = e.stack, t = r.pop();
|
|
6269
6269
|
exports.DEBUG && console.log(e.step, "RCVT", t), r.push(e.cvt[t] * 64);
|
|
6270
6270
|
}
|
|
@@ -6276,60 +6276,60 @@ function Ot(e, r) {
|
|
|
6276
6276
|
var t = r.stack, n = t.pop(), a = t.pop(), s = r.z1[n], o = r.z0[a], u = r.dpv.distance(o, s, e, e);
|
|
6277
6277
|
exports.DEBUG && console.log(r.step, "MD[" + e + "]", n, a, "->", u), r.stack.push(Math.round(u * 64));
|
|
6278
6278
|
}
|
|
6279
|
-
function
|
|
6279
|
+
function So(e) {
|
|
6280
6280
|
exports.DEBUG && console.log(e.step, "MPPEM[]"), e.stack.push(e.ppem);
|
|
6281
6281
|
}
|
|
6282
|
-
function
|
|
6282
|
+
function To(e) {
|
|
6283
6283
|
exports.DEBUG && console.log(e.step, "FLIPON[]"), e.autoFlip = !0;
|
|
6284
6284
|
}
|
|
6285
|
-
function
|
|
6285
|
+
function ko(e) {
|
|
6286
6286
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6287
6287
|
exports.DEBUG && console.log(e.step, "LT[]", t, n), r.push(n < t ? 1 : 0);
|
|
6288
6288
|
}
|
|
6289
|
-
function
|
|
6289
|
+
function Fo(e) {
|
|
6290
6290
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6291
6291
|
exports.DEBUG && console.log(e.step, "LTEQ[]", t, n), r.push(n <= t ? 1 : 0);
|
|
6292
6292
|
}
|
|
6293
|
-
function
|
|
6293
|
+
function Uo(e) {
|
|
6294
6294
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6295
6295
|
exports.DEBUG && console.log(e.step, "GT[]", t, n), r.push(n > t ? 1 : 0);
|
|
6296
6296
|
}
|
|
6297
|
-
function
|
|
6297
|
+
function Co(e) {
|
|
6298
6298
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6299
6299
|
exports.DEBUG && console.log(e.step, "GTEQ[]", t, n), r.push(n >= t ? 1 : 0);
|
|
6300
6300
|
}
|
|
6301
|
-
function
|
|
6301
|
+
function wo(e) {
|
|
6302
6302
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6303
6303
|
exports.DEBUG && console.log(e.step, "EQ[]", t, n), r.push(t === n ? 1 : 0);
|
|
6304
6304
|
}
|
|
6305
|
-
function
|
|
6305
|
+
function Eo(e) {
|
|
6306
6306
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6307
6307
|
exports.DEBUG && console.log(e.step, "NEQ[]", t, n), r.push(t !== n ? 1 : 0);
|
|
6308
6308
|
}
|
|
6309
|
-
function
|
|
6309
|
+
function Oo(e) {
|
|
6310
6310
|
var r = e.stack, t = r.pop();
|
|
6311
6311
|
exports.DEBUG && console.log(e.step, "ODD[]", t), r.push(Math.trunc(t) % 2 ? 1 : 0);
|
|
6312
6312
|
}
|
|
6313
|
-
function
|
|
6313
|
+
function Lo(e) {
|
|
6314
6314
|
var r = e.stack, t = r.pop();
|
|
6315
6315
|
exports.DEBUG && console.log(e.step, "EVEN[]", t), r.push(Math.trunc(t) % 2 ? 0 : 1);
|
|
6316
6316
|
}
|
|
6317
|
-
function
|
|
6317
|
+
function Ro(e) {
|
|
6318
6318
|
var r = e.stack.pop();
|
|
6319
|
-
exports.DEBUG && console.log(e.step, "IF[]", r), r || (
|
|
6319
|
+
exports.DEBUG && console.log(e.step, "IF[]", r), r || (Rn(e, !0), exports.DEBUG && console.log(e.step, "EIF[]"));
|
|
6320
6320
|
}
|
|
6321
|
-
function
|
|
6321
|
+
function Do(e) {
|
|
6322
6322
|
exports.DEBUG && console.log(e.step, "EIF[]");
|
|
6323
6323
|
}
|
|
6324
|
-
function
|
|
6324
|
+
function Ao(e) {
|
|
6325
6325
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6326
6326
|
exports.DEBUG && console.log(e.step, "AND[]", t, n), r.push(t && n ? 1 : 0);
|
|
6327
6327
|
}
|
|
6328
|
-
function
|
|
6328
|
+
function Bo(e) {
|
|
6329
6329
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6330
6330
|
exports.DEBUG && console.log(e.step, "OR[]", t, n), r.push(t || n ? 1 : 0);
|
|
6331
6331
|
}
|
|
6332
|
-
function
|
|
6332
|
+
function Mo(e) {
|
|
6333
6333
|
var r = e.stack, t = r.pop();
|
|
6334
6334
|
exports.DEBUG && console.log(e.step, "NOT[]", t), r.push(t ? 0 : 1);
|
|
6335
6335
|
}
|
|
@@ -6346,43 +6346,43 @@ function br(e, r) {
|
|
|
6346
6346
|
}
|
|
6347
6347
|
}
|
|
6348
6348
|
}
|
|
6349
|
-
function
|
|
6349
|
+
function Io(e) {
|
|
6350
6350
|
var r = e.stack, t = r.pop();
|
|
6351
6351
|
exports.DEBUG && console.log(e.step, "SDB[]", t), e.deltaBase = t;
|
|
6352
6352
|
}
|
|
6353
|
-
function
|
|
6353
|
+
function Po(e) {
|
|
6354
6354
|
var r = e.stack, t = r.pop();
|
|
6355
6355
|
exports.DEBUG && console.log(e.step, "SDS[]", t), e.deltaShift = Math.pow(0.5, t);
|
|
6356
6356
|
}
|
|
6357
|
-
function
|
|
6357
|
+
function Go(e) {
|
|
6358
6358
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6359
6359
|
exports.DEBUG && console.log(e.step, "ADD[]", t, n), r.push(n + t);
|
|
6360
6360
|
}
|
|
6361
|
-
function
|
|
6361
|
+
function No(e) {
|
|
6362
6362
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6363
6363
|
exports.DEBUG && console.log(e.step, "SUB[]", t, n), r.push(n - t);
|
|
6364
6364
|
}
|
|
6365
|
-
function
|
|
6365
|
+
function Ho(e) {
|
|
6366
6366
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6367
6367
|
exports.DEBUG && console.log(e.step, "DIV[]", t, n), r.push(n * 64 / t);
|
|
6368
6368
|
}
|
|
6369
|
-
function
|
|
6369
|
+
function Wo(e) {
|
|
6370
6370
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6371
6371
|
exports.DEBUG && console.log(e.step, "MUL[]", t, n), r.push(n * t / 64);
|
|
6372
6372
|
}
|
|
6373
|
-
function
|
|
6373
|
+
function zo(e) {
|
|
6374
6374
|
var r = e.stack, t = r.pop();
|
|
6375
6375
|
exports.DEBUG && console.log(e.step, "ABS[]", t), r.push(Math.abs(t));
|
|
6376
6376
|
}
|
|
6377
|
-
function
|
|
6377
|
+
function _o(e) {
|
|
6378
6378
|
var r = e.stack, t = r.pop();
|
|
6379
6379
|
exports.DEBUG && console.log(e.step, "NEG[]", t), r.push(-t);
|
|
6380
6380
|
}
|
|
6381
|
-
function
|
|
6381
|
+
function Vo(e) {
|
|
6382
6382
|
var r = e.stack, t = r.pop();
|
|
6383
6383
|
exports.DEBUG && console.log(e.step, "FLOOR[]", t), r.push(Math.floor(t / 64) * 64);
|
|
6384
6384
|
}
|
|
6385
|
-
function
|
|
6385
|
+
function qo(e) {
|
|
6386
6386
|
var r = e.stack, t = r.pop();
|
|
6387
6387
|
exports.DEBUG && console.log(e.step, "CEILING[]", t), r.push(Math.ceil(t / 64) * 64);
|
|
6388
6388
|
}
|
|
@@ -6390,7 +6390,7 @@ function Je(e, r) {
|
|
|
6390
6390
|
var t = r.stack, n = t.pop();
|
|
6391
6391
|
exports.DEBUG && console.log(r.step, "ROUND[]"), t.push(r.round(n / 64) * 64);
|
|
6392
6392
|
}
|
|
6393
|
-
function
|
|
6393
|
+
function Xo(e) {
|
|
6394
6394
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6395
6395
|
exports.DEBUG && console.log(e.step, "WCVTF[]", t, n), e.cvt[n] = t * e.ppem / e.font.unitsPerEm;
|
|
6396
6396
|
}
|
|
@@ -6407,9 +6407,9 @@ function Sr(e, r) {
|
|
|
6407
6407
|
}
|
|
6408
6408
|
}
|
|
6409
6409
|
}
|
|
6410
|
-
function
|
|
6410
|
+
function Yo(e) {
|
|
6411
6411
|
var r = e.stack.pop();
|
|
6412
|
-
exports.DEBUG && console.log(e.step, "SROUND[]", r), e.round =
|
|
6412
|
+
exports.DEBUG && console.log(e.step, "SROUND[]", r), e.round = Ln;
|
|
6413
6413
|
var t;
|
|
6414
6414
|
switch (r & 192) {
|
|
6415
6415
|
case 0:
|
|
@@ -6442,9 +6442,9 @@ function qo(e) {
|
|
|
6442
6442
|
}
|
|
6443
6443
|
r &= 15, r === 0 ? e.srThreshold = 0 : e.srThreshold = (r / 8 - 0.5) * t;
|
|
6444
6444
|
}
|
|
6445
|
-
function
|
|
6445
|
+
function $o(e) {
|
|
6446
6446
|
var r = e.stack.pop();
|
|
6447
|
-
exports.DEBUG && console.log(e.step, "S45ROUND[]", r), e.round =
|
|
6447
|
+
exports.DEBUG && console.log(e.step, "S45ROUND[]", r), e.round = Ln;
|
|
6448
6448
|
var t;
|
|
6449
6449
|
switch (r & 192) {
|
|
6450
6450
|
case 0:
|
|
@@ -6477,16 +6477,16 @@ function Xo(e) {
|
|
|
6477
6477
|
}
|
|
6478
6478
|
r &= 15, r === 0 ? e.srThreshold = 0 : e.srThreshold = (r / 8 - 0.5) * t;
|
|
6479
6479
|
}
|
|
6480
|
-
function Yo(e) {
|
|
6481
|
-
exports.DEBUG && console.log(e.step, "ROFF[]"), e.round = ws;
|
|
6482
|
-
}
|
|
6483
|
-
function $o(e) {
|
|
6484
|
-
exports.DEBUG && console.log(e.step, "RUTG[]"), e.round = Ls;
|
|
6485
|
-
}
|
|
6486
6480
|
function Zo(e) {
|
|
6487
|
-
exports.DEBUG && console.log(e.step, "
|
|
6481
|
+
exports.DEBUG && console.log(e.step, "ROFF[]"), e.round = Os;
|
|
6488
6482
|
}
|
|
6489
6483
|
function Qo(e) {
|
|
6484
|
+
exports.DEBUG && console.log(e.step, "RUTG[]"), e.round = Ds;
|
|
6485
|
+
}
|
|
6486
|
+
function Ko(e) {
|
|
6487
|
+
exports.DEBUG && console.log(e.step, "RDTG[]"), e.round = As;
|
|
6488
|
+
}
|
|
6489
|
+
function jo(e) {
|
|
6490
6490
|
var r = e.stack.pop();
|
|
6491
6491
|
exports.DEBUG && console.log(e.step, "SCANCTRL[]", r);
|
|
6492
6492
|
}
|
|
@@ -6496,27 +6496,27 @@ function Lt(e, r) {
|
|
|
6496
6496
|
var u, i;
|
|
6497
6497
|
e ? (u = s.y - o.y, i = o.x - s.x) : (u = o.x - s.x, i = o.y - s.y), r.dpv = Xe(u, i);
|
|
6498
6498
|
}
|
|
6499
|
-
function
|
|
6499
|
+
function Jo(e) {
|
|
6500
6500
|
var r = e.stack, t = r.pop(), n = 0;
|
|
6501
6501
|
exports.DEBUG && console.log(e.step, "GETINFO[]", t), t & 1 && (n = 35), t & 32 && (n |= 4096), r.push(n);
|
|
6502
6502
|
}
|
|
6503
|
-
function
|
|
6503
|
+
function ei(e) {
|
|
6504
6504
|
var r = e.stack, t = r.pop(), n = r.pop(), a = r.pop();
|
|
6505
6505
|
exports.DEBUG && console.log(e.step, "ROLL[]"), r.push(n), r.push(t), r.push(a);
|
|
6506
6506
|
}
|
|
6507
|
-
function
|
|
6507
|
+
function ri(e) {
|
|
6508
6508
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6509
6509
|
exports.DEBUG && console.log(e.step, "MAX[]", t, n), r.push(Math.max(n, t));
|
|
6510
6510
|
}
|
|
6511
|
-
function
|
|
6511
|
+
function ti(e) {
|
|
6512
6512
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6513
6513
|
exports.DEBUG && console.log(e.step, "MIN[]", t, n), r.push(Math.min(n, t));
|
|
6514
6514
|
}
|
|
6515
|
-
function
|
|
6515
|
+
function ni(e) {
|
|
6516
6516
|
var r = e.stack.pop();
|
|
6517
6517
|
exports.DEBUG && console.log(e.step, "SCANTYPE[]", r);
|
|
6518
6518
|
}
|
|
6519
|
-
function
|
|
6519
|
+
function ai(e) {
|
|
6520
6520
|
var r = e.stack.pop(), t = e.stack.pop();
|
|
6521
6521
|
switch (exports.DEBUG && console.log(e.step, "INSTCTRL[]", r, t), r) {
|
|
6522
6522
|
case 1:
|
|
@@ -6546,20 +6546,20 @@ function ge(e, r) {
|
|
|
6546
6546
|
r.ip = t;
|
|
6547
6547
|
}
|
|
6548
6548
|
function T(e, r, t, n, a, s) {
|
|
6549
|
-
var o = s.stack, u = e && o.pop(), i = o.pop(), l = s.rp0, f = s.z0[l], c = s.z1[i], p = s.minDis, h = s.fv, d = s.dpv, g, m,
|
|
6550
|
-
m = g = d.distance(c, f, !0, !0),
|
|
6549
|
+
var o = s.stack, u = e && o.pop(), i = o.pop(), l = s.rp0, f = s.z0[l], c = s.z1[i], p = s.minDis, h = s.fv, d = s.dpv, g, m, x, U;
|
|
6550
|
+
m = g = d.distance(c, f, !0, !0), x = m >= 0 ? 1 : -1, m = Math.abs(m), e && (U = s.cvt[u], n && Math.abs(m - U) < s.cvCutIn && (m = U)), t && m < p && (m = p), n && (m = s.round(m)), h.setRelative(c, f, x * m, d), h.touch(c), exports.DEBUG && console.log(
|
|
6551
6551
|
s.step,
|
|
6552
6552
|
(e ? "MIRP[" : "MDRP[") + (r ? "M" : "m") + (t ? ">" : "_") + (n ? "R" : "_") + (a === 0 ? "Gr" : a === 1 ? "Bl" : a === 2 ? "Wh" : "") + "]",
|
|
6553
|
-
e ? u + "(" + s.cvt[u] + "," +
|
|
6553
|
+
e ? u + "(" + s.cvt[u] + "," + U + ")" : "",
|
|
6554
6554
|
i,
|
|
6555
6555
|
"(d =",
|
|
6556
6556
|
g,
|
|
6557
6557
|
"->",
|
|
6558
|
-
|
|
6558
|
+
x * m,
|
|
6559
6559
|
")"
|
|
6560
6560
|
), s.rp1 = s.rp0, s.rp2 = i, r && (s.rp0 = i);
|
|
6561
6561
|
}
|
|
6562
|
-
|
|
6562
|
+
Cn = [
|
|
6563
6563
|
/* 0x00 */
|
|
6564
6564
|
gt.bind(void 0, pe),
|
|
6565
6565
|
/* 0x01 */
|
|
@@ -6581,45 +6581,45 @@ Un = [
|
|
|
6581
6581
|
/* 0x09 */
|
|
6582
6582
|
bt.bind(void 0, 1),
|
|
6583
6583
|
/* 0x0A */
|
|
6584
|
-
|
|
6584
|
+
Ms,
|
|
6585
6585
|
/* 0x0B */
|
|
6586
|
-
|
|
6586
|
+
Is,
|
|
6587
6587
|
/* 0x0C */
|
|
6588
|
-
|
|
6588
|
+
Ps,
|
|
6589
6589
|
/* 0x0D */
|
|
6590
|
-
|
|
6590
|
+
Gs,
|
|
6591
6591
|
/* 0x0E */
|
|
6592
|
-
|
|
6592
|
+
Ns,
|
|
6593
6593
|
/* 0x0F */
|
|
6594
|
-
|
|
6594
|
+
Hs,
|
|
6595
6595
|
/* 0x10 */
|
|
6596
|
-
|
|
6596
|
+
Ws,
|
|
6597
6597
|
/* 0x11 */
|
|
6598
|
-
|
|
6598
|
+
zs,
|
|
6599
6599
|
/* 0x12 */
|
|
6600
|
-
|
|
6600
|
+
_s,
|
|
6601
6601
|
/* 0x13 */
|
|
6602
|
-
|
|
6602
|
+
Vs,
|
|
6603
6603
|
/* 0x14 */
|
|
6604
|
-
|
|
6604
|
+
qs,
|
|
6605
6605
|
/* 0x15 */
|
|
6606
|
-
|
|
6606
|
+
Xs,
|
|
6607
6607
|
/* 0x16 */
|
|
6608
|
-
|
|
6608
|
+
Ys,
|
|
6609
6609
|
/* 0x17 */
|
|
6610
|
-
|
|
6610
|
+
$s,
|
|
6611
6611
|
/* 0x18 */
|
|
6612
|
-
|
|
6612
|
+
Zs,
|
|
6613
6613
|
/* 0x19 */
|
|
6614
|
-
|
|
6614
|
+
Qs,
|
|
6615
6615
|
/* 0x1A */
|
|
6616
|
-
|
|
6616
|
+
Ks,
|
|
6617
6617
|
/* 0x1B */
|
|
6618
|
-
|
|
6618
|
+
js,
|
|
6619
6619
|
/* 0x1C */
|
|
6620
|
-
|
|
6620
|
+
Js,
|
|
6621
6621
|
/* 0x1D */
|
|
6622
|
-
|
|
6622
|
+
eo,
|
|
6623
6623
|
/* 0x1E */
|
|
6624
6624
|
void 0,
|
|
6625
6625
|
// TODO SSWCI
|
|
@@ -6627,19 +6627,19 @@ Un = [
|
|
|
6627
6627
|
void 0,
|
|
6628
6628
|
// TODO SSW
|
|
6629
6629
|
/* 0x20 */
|
|
6630
|
-
|
|
6630
|
+
ro,
|
|
6631
6631
|
/* 0x21 */
|
|
6632
6632
|
xr,
|
|
6633
6633
|
/* 0x22 */
|
|
6634
|
-
|
|
6634
|
+
to,
|
|
6635
6635
|
/* 0x23 */
|
|
6636
|
-
|
|
6636
|
+
no,
|
|
6637
6637
|
/* 0x24 */
|
|
6638
|
-
|
|
6638
|
+
ao,
|
|
6639
6639
|
/* 0x25 */
|
|
6640
|
-
|
|
6640
|
+
io,
|
|
6641
6641
|
/* 0x26 */
|
|
6642
|
-
|
|
6642
|
+
uo,
|
|
6643
6643
|
/* 0x27 */
|
|
6644
6644
|
void 0,
|
|
6645
6645
|
// TODO ALIGNPTS
|
|
@@ -6649,11 +6649,11 @@ Un = [
|
|
|
6649
6649
|
void 0,
|
|
6650
6650
|
// TODO UTP
|
|
6651
6651
|
/* 0x2A */
|
|
6652
|
-
|
|
6652
|
+
so,
|
|
6653
6653
|
/* 0x2B */
|
|
6654
|
-
|
|
6654
|
+
oo,
|
|
6655
6655
|
/* 0x2C */
|
|
6656
|
-
|
|
6656
|
+
lo,
|
|
6657
6657
|
/* 0x2D */
|
|
6658
6658
|
void 0,
|
|
6659
6659
|
// ENDF (eaten by FDEF)
|
|
@@ -6678,33 +6678,33 @@ Un = [
|
|
|
6678
6678
|
/* 0x37 */
|
|
6679
6679
|
Ut.bind(void 0, 1),
|
|
6680
6680
|
/* 0x38 */
|
|
6681
|
-
|
|
6681
|
+
fo,
|
|
6682
6682
|
/* 0x39 */
|
|
6683
|
-
|
|
6683
|
+
po,
|
|
6684
6684
|
/* 0x3A */
|
|
6685
6685
|
Ct.bind(void 0, 0),
|
|
6686
6686
|
/* 0x3B */
|
|
6687
6687
|
Ct.bind(void 0, 1),
|
|
6688
6688
|
/* 0x3C */
|
|
6689
|
-
|
|
6689
|
+
co,
|
|
6690
6690
|
/* 0x3D */
|
|
6691
|
-
|
|
6691
|
+
ho,
|
|
6692
6692
|
/* 0x3E */
|
|
6693
6693
|
wt.bind(void 0, 0),
|
|
6694
6694
|
/* 0x3F */
|
|
6695
6695
|
wt.bind(void 0, 1),
|
|
6696
6696
|
/* 0x40 */
|
|
6697
|
-
|
|
6697
|
+
vo,
|
|
6698
6698
|
/* 0x41 */
|
|
6699
|
-
|
|
6699
|
+
go,
|
|
6700
6700
|
/* 0x42 */
|
|
6701
|
-
|
|
6701
|
+
mo,
|
|
6702
6702
|
/* 0x43 */
|
|
6703
|
-
|
|
6703
|
+
yo,
|
|
6704
6704
|
/* 0x44 */
|
|
6705
|
-
|
|
6705
|
+
xo,
|
|
6706
6706
|
/* 0x45 */
|
|
6707
|
-
|
|
6707
|
+
bo,
|
|
6708
6708
|
/* 0x46 */
|
|
6709
6709
|
Et.bind(void 0, 0),
|
|
6710
6710
|
/* 0x47 */
|
|
@@ -6717,12 +6717,12 @@ Un = [
|
|
|
6717
6717
|
/* 0x4A */
|
|
6718
6718
|
Ot.bind(void 0, 1),
|
|
6719
6719
|
/* 0x4B */
|
|
6720
|
-
|
|
6720
|
+
So,
|
|
6721
6721
|
/* 0x4C */
|
|
6722
6722
|
void 0,
|
|
6723
6723
|
// TODO MPS
|
|
6724
6724
|
/* 0x4D */
|
|
6725
|
-
|
|
6725
|
+
To,
|
|
6726
6726
|
/* 0x4E */
|
|
6727
6727
|
void 0,
|
|
6728
6728
|
// TODO FLIPOFF
|
|
@@ -6730,53 +6730,53 @@ Un = [
|
|
|
6730
6730
|
void 0,
|
|
6731
6731
|
// TODO DEBUG
|
|
6732
6732
|
/* 0x50 */
|
|
6733
|
-
|
|
6733
|
+
ko,
|
|
6734
6734
|
/* 0x51 */
|
|
6735
|
-
|
|
6735
|
+
Fo,
|
|
6736
6736
|
/* 0x52 */
|
|
6737
|
-
|
|
6737
|
+
Uo,
|
|
6738
6738
|
/* 0x53 */
|
|
6739
|
-
|
|
6739
|
+
Co,
|
|
6740
6740
|
/* 0x54 */
|
|
6741
|
-
|
|
6741
|
+
wo,
|
|
6742
6742
|
/* 0x55 */
|
|
6743
|
-
|
|
6743
|
+
Eo,
|
|
6744
6744
|
/* 0x56 */
|
|
6745
|
-
|
|
6745
|
+
Oo,
|
|
6746
6746
|
/* 0x57 */
|
|
6747
|
-
|
|
6747
|
+
Lo,
|
|
6748
6748
|
/* 0x58 */
|
|
6749
|
-
|
|
6749
|
+
Ro,
|
|
6750
6750
|
/* 0x59 */
|
|
6751
|
-
|
|
6751
|
+
Do,
|
|
6752
6752
|
/* 0x5A */
|
|
6753
|
-
|
|
6753
|
+
Ao,
|
|
6754
6754
|
/* 0x5B */
|
|
6755
|
-
|
|
6755
|
+
Bo,
|
|
6756
6756
|
/* 0x5C */
|
|
6757
|
-
|
|
6757
|
+
Mo,
|
|
6758
6758
|
/* 0x5D */
|
|
6759
6759
|
br.bind(void 0, 1),
|
|
6760
6760
|
/* 0x5E */
|
|
6761
|
-
|
|
6761
|
+
Io,
|
|
6762
6762
|
/* 0x5F */
|
|
6763
|
-
|
|
6763
|
+
Po,
|
|
6764
6764
|
/* 0x60 */
|
|
6765
|
-
|
|
6765
|
+
Go,
|
|
6766
6766
|
/* 0x61 */
|
|
6767
|
-
|
|
6767
|
+
No,
|
|
6768
6768
|
/* 0x62 */
|
|
6769
|
-
|
|
6769
|
+
Ho,
|
|
6770
6770
|
/* 0x63 */
|
|
6771
|
-
|
|
6771
|
+
Wo,
|
|
6772
6772
|
/* 0x64 */
|
|
6773
|
-
|
|
6773
|
+
zo,
|
|
6774
6774
|
/* 0x65 */
|
|
6775
|
-
|
|
6775
|
+
_o,
|
|
6776
6776
|
/* 0x66 */
|
|
6777
|
-
|
|
6777
|
+
Vo,
|
|
6778
6778
|
/* 0x67 */
|
|
6779
|
-
|
|
6779
|
+
qo,
|
|
6780
6780
|
/* 0x68 */
|
|
6781
6781
|
Je.bind(void 0, 0),
|
|
6782
6782
|
/* 0x69 */
|
|
@@ -6798,7 +6798,7 @@ Un = [
|
|
|
6798
6798
|
void 0,
|
|
6799
6799
|
// TODO NROUND[ab]
|
|
6800
6800
|
/* 0x70 */
|
|
6801
|
-
|
|
6801
|
+
Xo,
|
|
6802
6802
|
/* 0x71 */
|
|
6803
6803
|
br.bind(void 0, 2),
|
|
6804
6804
|
/* 0x72 */
|
|
@@ -6810,9 +6810,9 @@ Un = [
|
|
|
6810
6810
|
/* 0x75 */
|
|
6811
6811
|
Sr.bind(void 0, 3),
|
|
6812
6812
|
/* 0x76 */
|
|
6813
|
-
|
|
6813
|
+
Yo,
|
|
6814
6814
|
/* 0x77 */
|
|
6815
|
-
|
|
6815
|
+
$o,
|
|
6816
6816
|
/* 0x78 */
|
|
6817
6817
|
void 0,
|
|
6818
6818
|
// TODO JROT[]
|
|
@@ -6820,13 +6820,13 @@ Un = [
|
|
|
6820
6820
|
void 0,
|
|
6821
6821
|
// TODO JROF[]
|
|
6822
6822
|
/* 0x7A */
|
|
6823
|
-
|
|
6823
|
+
Zo,
|
|
6824
6824
|
/* 0x7B */
|
|
6825
6825
|
void 0,
|
|
6826
6826
|
/* 0x7C */
|
|
6827
|
-
|
|
6827
|
+
Qo,
|
|
6828
6828
|
/* 0x7D */
|
|
6829
|
-
|
|
6829
|
+
Ko,
|
|
6830
6830
|
/* 0x7E */
|
|
6831
6831
|
xr,
|
|
6832
6832
|
// actually SANGW, supposed to do only a pop though
|
|
@@ -6847,26 +6847,26 @@ Un = [
|
|
|
6847
6847
|
/* 0x84 */
|
|
6848
6848
|
void 0,
|
|
6849
6849
|
/* 0x85 */
|
|
6850
|
-
|
|
6850
|
+
jo,
|
|
6851
6851
|
/* 0x86 */
|
|
6852
6852
|
Lt.bind(void 0, 0),
|
|
6853
6853
|
/* 0x87 */
|
|
6854
6854
|
Lt.bind(void 0, 1),
|
|
6855
6855
|
/* 0x88 */
|
|
6856
|
-
|
|
6856
|
+
Jo,
|
|
6857
6857
|
/* 0x89 */
|
|
6858
6858
|
void 0,
|
|
6859
6859
|
// TODO IDEF
|
|
6860
6860
|
/* 0x8A */
|
|
6861
|
-
|
|
6861
|
+
ei,
|
|
6862
6862
|
/* 0x8B */
|
|
6863
|
-
|
|
6863
|
+
ri,
|
|
6864
6864
|
/* 0x8C */
|
|
6865
|
-
|
|
6865
|
+
ti,
|
|
6866
6866
|
/* 0x8D */
|
|
6867
|
-
|
|
6867
|
+
ni,
|
|
6868
6868
|
/* 0x8E */
|
|
6869
|
-
|
|
6869
|
+
ai,
|
|
6870
6870
|
/* 0x8F */
|
|
6871
6871
|
void 0,
|
|
6872
6872
|
/* 0x90 */
|
|
@@ -7100,7 +7100,7 @@ function Re(e) {
|
|
|
7100
7100
|
function Xr(e, r, t) {
|
|
7101
7101
|
this.contextName = t, this.startIndex = e, this.endOffset = r;
|
|
7102
7102
|
}
|
|
7103
|
-
function
|
|
7103
|
+
function si(e, r, t) {
|
|
7104
7104
|
this.contextName = e, this.openRange = null, this.ranges = [], this.checkStart = r, this.checkEnd = t;
|
|
7105
7105
|
}
|
|
7106
7106
|
function re(e, r) {
|
|
@@ -7109,7 +7109,7 @@ function re(e, r) {
|
|
|
7109
7109
|
function fr(e) {
|
|
7110
7110
|
this.eventId = e, this.subscribers = [];
|
|
7111
7111
|
}
|
|
7112
|
-
function
|
|
7112
|
+
function oi(e) {
|
|
7113
7113
|
var r = this, t = [
|
|
7114
7114
|
"start",
|
|
7115
7115
|
"end",
|
|
@@ -7148,7 +7148,7 @@ function ai(e) {
|
|
|
7148
7148
|
});
|
|
7149
7149
|
}
|
|
7150
7150
|
function N(e) {
|
|
7151
|
-
this.tokens = [], this.registeredContexts = {}, this.contextCheckers = [], this.events = {}, this.registeredModifiers = [],
|
|
7151
|
+
this.tokens = [], this.registeredContexts = {}, this.contextCheckers = [], this.events = {}, this.registeredModifiers = [], oi.call(this, e);
|
|
7152
7152
|
}
|
|
7153
7153
|
Re.prototype.setState = function(e, r) {
|
|
7154
7154
|
return this.state[e] = r, this.activeState = { key: e, value: this.state[e] }, this.activeState;
|
|
@@ -7286,7 +7286,7 @@ N.prototype.registerContextChecker = function(e, r, t) {
|
|
|
7286
7286
|
return {
|
|
7287
7287
|
FAIL: "missing context end check."
|
|
7288
7288
|
};
|
|
7289
|
-
var n = new
|
|
7289
|
+
var n = new si(
|
|
7290
7290
|
e,
|
|
7291
7291
|
r,
|
|
7292
7292
|
t
|
|
@@ -7350,7 +7350,7 @@ N.prototype.tokenize = function(e) {
|
|
|
7350
7350
|
function be(e) {
|
|
7351
7351
|
return /[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e);
|
|
7352
7352
|
}
|
|
7353
|
-
function
|
|
7353
|
+
function Dn(e) {
|
|
7354
7354
|
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(e);
|
|
7355
7355
|
}
|
|
7356
7356
|
function Se(e) {
|
|
@@ -7359,7 +7359,7 @@ function Se(e) {
|
|
|
7359
7359
|
function rr(e) {
|
|
7360
7360
|
return /[A-z]/.test(e);
|
|
7361
7361
|
}
|
|
7362
|
-
function
|
|
7362
|
+
function ii(e) {
|
|
7363
7363
|
return /\s/.test(e);
|
|
7364
7364
|
}
|
|
7365
7365
|
function J(e) {
|
|
@@ -7388,11 +7388,11 @@ function Ye(e, r) {
|
|
|
7388
7388
|
}
|
|
7389
7389
|
return -1;
|
|
7390
7390
|
}
|
|
7391
|
-
function
|
|
7391
|
+
function ui(e, r) {
|
|
7392
7392
|
var t = Ye(e, r.coverage);
|
|
7393
7393
|
return t === -1 ? null : e + r.deltaGlyphId;
|
|
7394
7394
|
}
|
|
7395
|
-
function
|
|
7395
|
+
function li(e, r) {
|
|
7396
7396
|
var t = Ye(e, r.coverage);
|
|
7397
7397
|
return t === -1 ? null : r.substitute[t];
|
|
7398
7398
|
}
|
|
@@ -7405,7 +7405,7 @@ function Tr(e, r) {
|
|
|
7405
7405
|
}
|
|
7406
7406
|
return t.length !== e.length ? -1 : t;
|
|
7407
7407
|
}
|
|
7408
|
-
function
|
|
7408
|
+
function fi(e, r) {
|
|
7409
7409
|
var t = r.inputCoverage.length + r.lookaheadCoverage.length + r.backtrackCoverage.length;
|
|
7410
7410
|
if (e.context.length < t)
|
|
7411
7411
|
return [];
|
|
@@ -7434,17 +7434,17 @@ function ui(e, r) {
|
|
|
7434
7434
|
), c = n.length === r.inputCoverage.length && u.length === r.lookaheadCoverage.length && f.length === r.backtrackCoverage.length, p = [];
|
|
7435
7435
|
if (c)
|
|
7436
7436
|
for (var h = 0; h < r.lookupRecords.length; h++)
|
|
7437
|
-
for (var d = r.lookupRecords[h], g = d.lookupListIndex, m = this.getLookupByIndex(g),
|
|
7438
|
-
var
|
|
7439
|
-
if (
|
|
7437
|
+
for (var d = r.lookupRecords[h], g = d.lookupListIndex, m = this.getLookupByIndex(g), x = 0; x < m.subtables.length; x++) {
|
|
7438
|
+
var U = m.subtables[x], y = this.getLookupMethod(m, U), L = this.getSubstitutionType(m, U);
|
|
7439
|
+
if (L === "12")
|
|
7440
7440
|
for (var w = 0; w < n.length; w++) {
|
|
7441
|
-
var
|
|
7441
|
+
var B = e.get(w), C = y(B);
|
|
7442
7442
|
C && p.push(C);
|
|
7443
7443
|
}
|
|
7444
7444
|
}
|
|
7445
7445
|
return p;
|
|
7446
7446
|
}
|
|
7447
|
-
function
|
|
7447
|
+
function pi(e, r) {
|
|
7448
7448
|
var t = e.current, n = Ye(t, r.coverage);
|
|
7449
7449
|
if (n === -1)
|
|
7450
7450
|
return null;
|
|
@@ -7460,7 +7460,7 @@ function li(e, r) {
|
|
|
7460
7460
|
}
|
|
7461
7461
|
return null;
|
|
7462
7462
|
}
|
|
7463
|
-
function
|
|
7463
|
+
function ci(e, r) {
|
|
7464
7464
|
var t = Ye(e, r.coverage);
|
|
7465
7465
|
return t === -1 ? null : r.sequences[t];
|
|
7466
7466
|
}
|
|
@@ -7522,35 +7522,35 @@ J.prototype.getLookupMethod = function(e, r) {
|
|
|
7522
7522
|
switch (n) {
|
|
7523
7523
|
case "11":
|
|
7524
7524
|
return function(a) {
|
|
7525
|
-
return
|
|
7525
|
+
return ui.apply(
|
|
7526
7526
|
t,
|
|
7527
7527
|
[a, r]
|
|
7528
7528
|
);
|
|
7529
7529
|
};
|
|
7530
7530
|
case "12":
|
|
7531
7531
|
return function(a) {
|
|
7532
|
-
return
|
|
7532
|
+
return li.apply(
|
|
7533
7533
|
t,
|
|
7534
7534
|
[a, r]
|
|
7535
7535
|
);
|
|
7536
7536
|
};
|
|
7537
7537
|
case "63":
|
|
7538
7538
|
return function(a) {
|
|
7539
|
-
return
|
|
7539
|
+
return fi.apply(
|
|
7540
7540
|
t,
|
|
7541
7541
|
[a, r]
|
|
7542
7542
|
);
|
|
7543
7543
|
};
|
|
7544
7544
|
case "41":
|
|
7545
7545
|
return function(a) {
|
|
7546
|
-
return
|
|
7546
|
+
return pi.apply(
|
|
7547
7547
|
t,
|
|
7548
7548
|
[a, r]
|
|
7549
7549
|
);
|
|
7550
7550
|
};
|
|
7551
7551
|
case "21":
|
|
7552
7552
|
return function(a) {
|
|
7553
|
-
return
|
|
7553
|
+
return ci.apply(
|
|
7554
7554
|
t,
|
|
7555
7555
|
[a, r]
|
|
7556
7556
|
);
|
|
@@ -7643,7 +7643,7 @@ J.prototype.getFeature = function(r) {
|
|
|
7643
7643
|
var t = this.features[r.script];
|
|
7644
7644
|
return t ? t.tags[r.tag] ? this.features[r.script].tags[r.tag] : null : { FAIL: "No feature for script " + r.script };
|
|
7645
7645
|
};
|
|
7646
|
-
function
|
|
7646
|
+
function hi(e) {
|
|
7647
7647
|
var r = e.current, t = e.get(-1);
|
|
7648
7648
|
return (
|
|
7649
7649
|
// ? arabic first char
|
|
@@ -7651,7 +7651,7 @@ function pi(e) {
|
|
|
7651
7651
|
!be(t) && be(r)
|
|
7652
7652
|
);
|
|
7653
7653
|
}
|
|
7654
|
-
function
|
|
7654
|
+
function vi(e) {
|
|
7655
7655
|
var r = e.get(1);
|
|
7656
7656
|
return (
|
|
7657
7657
|
// ? last arabic char
|
|
@@ -7659,24 +7659,24 @@ function ci(e) {
|
|
|
7659
7659
|
!be(r)
|
|
7660
7660
|
);
|
|
7661
7661
|
}
|
|
7662
|
-
var
|
|
7663
|
-
startCheck:
|
|
7664
|
-
endCheck:
|
|
7662
|
+
var di = {
|
|
7663
|
+
startCheck: hi,
|
|
7664
|
+
endCheck: vi
|
|
7665
7665
|
};
|
|
7666
|
-
function
|
|
7666
|
+
function gi(e) {
|
|
7667
7667
|
var r = e.current, t = e.get(-1);
|
|
7668
7668
|
return (
|
|
7669
7669
|
// ? an arabic char preceded with a non arabic char
|
|
7670
7670
|
(be(r) || Se(r)) && !be(t)
|
|
7671
7671
|
);
|
|
7672
7672
|
}
|
|
7673
|
-
function
|
|
7673
|
+
function mi(e) {
|
|
7674
7674
|
var r = e.get(1);
|
|
7675
7675
|
switch (!0) {
|
|
7676
7676
|
case r === null:
|
|
7677
7677
|
return !0;
|
|
7678
7678
|
case (!be(r) && !Se(r)):
|
|
7679
|
-
var t =
|
|
7679
|
+
var t = ii(r);
|
|
7680
7680
|
if (!t)
|
|
7681
7681
|
return !0;
|
|
7682
7682
|
if (t) {
|
|
@@ -7693,40 +7693,40 @@ function di(e) {
|
|
|
7693
7693
|
return !1;
|
|
7694
7694
|
}
|
|
7695
7695
|
}
|
|
7696
|
-
var
|
|
7697
|
-
startCheck:
|
|
7698
|
-
endCheck:
|
|
7696
|
+
var yi = {
|
|
7697
|
+
startCheck: gi,
|
|
7698
|
+
endCheck: mi
|
|
7699
7699
|
};
|
|
7700
|
-
function
|
|
7700
|
+
function xi(e, r, t) {
|
|
7701
7701
|
r[t].setState(e.tag, e.substitution);
|
|
7702
7702
|
}
|
|
7703
|
-
function
|
|
7703
|
+
function bi(e, r, t) {
|
|
7704
7704
|
r[t].setState(e.tag, e.substitution);
|
|
7705
7705
|
}
|
|
7706
|
-
function
|
|
7706
|
+
function Si(e, r, t) {
|
|
7707
7707
|
e.substitution.forEach(function(n, a) {
|
|
7708
7708
|
var s = r[t + a];
|
|
7709
7709
|
s.setState(e.tag, n);
|
|
7710
7710
|
});
|
|
7711
7711
|
}
|
|
7712
|
-
function
|
|
7712
|
+
function Ti(e, r, t) {
|
|
7713
7713
|
var n = r[t];
|
|
7714
7714
|
n.setState(e.tag, e.substitution.ligGlyph);
|
|
7715
7715
|
for (var a = e.substitution.components.length, s = 0; s < a; s++)
|
|
7716
7716
|
n = r[t + s + 1], n.setState("deleted", !0);
|
|
7717
7717
|
}
|
|
7718
7718
|
var Rt = {
|
|
7719
|
-
11:
|
|
7720
|
-
12:
|
|
7721
|
-
63:
|
|
7722
|
-
41:
|
|
7719
|
+
11: xi,
|
|
7720
|
+
12: bi,
|
|
7721
|
+
63: Si,
|
|
7722
|
+
41: Ti
|
|
7723
7723
|
};
|
|
7724
7724
|
function Yr(e, r, t) {
|
|
7725
7725
|
e instanceof Fe && Rt[e.id] && Rt[e.id](e, r, t);
|
|
7726
7726
|
}
|
|
7727
|
-
function
|
|
7727
|
+
function ki(e) {
|
|
7728
7728
|
for (var r = [].concat(e.backtrack), t = r.length - 1; t >= 0; t--) {
|
|
7729
|
-
var n = r[t], a =
|
|
7729
|
+
var n = r[t], a = Dn(n), s = Se(n);
|
|
7730
7730
|
if (!a && !s)
|
|
7731
7731
|
return !0;
|
|
7732
7732
|
if (a)
|
|
@@ -7734,8 +7734,8 @@ function Si(e) {
|
|
|
7734
7734
|
}
|
|
7735
7735
|
return !1;
|
|
7736
7736
|
}
|
|
7737
|
-
function
|
|
7738
|
-
if (
|
|
7737
|
+
function Fi(e) {
|
|
7738
|
+
if (Dn(e.current))
|
|
7739
7739
|
return !1;
|
|
7740
7740
|
for (var r = 0; r < e.lookahead.length; r++) {
|
|
7741
7741
|
var t = e.lookahead[r], n = Se(t);
|
|
@@ -7744,7 +7744,7 @@ function Ti(e) {
|
|
|
7744
7744
|
}
|
|
7745
7745
|
return !1;
|
|
7746
7746
|
}
|
|
7747
|
-
function
|
|
7747
|
+
function Ui(e) {
|
|
7748
7748
|
var r = this, t = "arab", n = this.featuresTags[t], a = this.tokenizer.getRangeTokens(e);
|
|
7749
7749
|
if (a.length !== 1) {
|
|
7750
7750
|
var s = new re(
|
|
@@ -7766,7 +7766,7 @@ function ki(e) {
|
|
|
7766
7766
|
if (!Se(u.char)) {
|
|
7767
7767
|
s.setCurrentIndex(i), o.setCurrentIndex(i);
|
|
7768
7768
|
var l = 0;
|
|
7769
|
-
|
|
7769
|
+
ki(o) && (l |= 1), Fi(o) && (l |= 2);
|
|
7770
7770
|
var f;
|
|
7771
7771
|
switch (l) {
|
|
7772
7772
|
case 1:
|
|
@@ -7801,7 +7801,7 @@ function Dt(e, r) {
|
|
|
7801
7801
|
});
|
|
7802
7802
|
return new re(t, 0);
|
|
7803
7803
|
}
|
|
7804
|
-
function
|
|
7804
|
+
function Ci(e) {
|
|
7805
7805
|
var r = this, t = "arab", n = this.tokenizer.getRangeTokens(e), a = Dt(n);
|
|
7806
7806
|
a.context.forEach(function(s, o) {
|
|
7807
7807
|
a.setCurrentIndex(o);
|
|
@@ -7817,7 +7817,7 @@ function Fi(e) {
|
|
|
7817
7817
|
), a = Dt(n));
|
|
7818
7818
|
});
|
|
7819
7819
|
}
|
|
7820
|
-
function
|
|
7820
|
+
function wi(e) {
|
|
7821
7821
|
var r = e.current, t = e.get(-1);
|
|
7822
7822
|
return (
|
|
7823
7823
|
// ? latin first char
|
|
@@ -7825,7 +7825,7 @@ function Ui(e) {
|
|
|
7825
7825
|
!rr(t) && rr(r)
|
|
7826
7826
|
);
|
|
7827
7827
|
}
|
|
7828
|
-
function
|
|
7828
|
+
function Ei(e) {
|
|
7829
7829
|
var r = e.get(1);
|
|
7830
7830
|
return (
|
|
7831
7831
|
// ? last latin char
|
|
@@ -7833,9 +7833,9 @@ function Ci(e) {
|
|
|
7833
7833
|
!rr(r)
|
|
7834
7834
|
);
|
|
7835
7835
|
}
|
|
7836
|
-
var
|
|
7837
|
-
startCheck:
|
|
7838
|
-
endCheck:
|
|
7836
|
+
var Oi = {
|
|
7837
|
+
startCheck: wi,
|
|
7838
|
+
endCheck: Ei
|
|
7839
7839
|
};
|
|
7840
7840
|
function At(e, r) {
|
|
7841
7841
|
var t = e.map(function(n) {
|
|
@@ -7843,7 +7843,7 @@ function At(e, r) {
|
|
|
7843
7843
|
});
|
|
7844
7844
|
return new re(t, 0);
|
|
7845
7845
|
}
|
|
7846
|
-
function
|
|
7846
|
+
function Li(e) {
|
|
7847
7847
|
var r = this, t = "latn", n = this.tokenizer.getRangeTokens(e), a = At(n);
|
|
7848
7848
|
a.context.forEach(function(s, o) {
|
|
7849
7849
|
a.setCurrentIndex(o);
|
|
@@ -7866,9 +7866,9 @@ ae.prototype.setText = function(e) {
|
|
|
7866
7866
|
this.text = e;
|
|
7867
7867
|
};
|
|
7868
7868
|
ae.prototype.contextChecks = {
|
|
7869
|
-
latinWordCheck:
|
|
7870
|
-
arabicWordCheck:
|
|
7871
|
-
arabicSentenceCheck:
|
|
7869
|
+
latinWordCheck: Oi,
|
|
7870
|
+
arabicWordCheck: di,
|
|
7871
|
+
arabicSentenceCheck: yi
|
|
7872
7872
|
};
|
|
7873
7873
|
function kr(e) {
|
|
7874
7874
|
var r = this.contextChecks[e + "Check"];
|
|
@@ -7878,10 +7878,10 @@ function kr(e) {
|
|
|
7878
7878
|
r.endCheck
|
|
7879
7879
|
);
|
|
7880
7880
|
}
|
|
7881
|
-
function
|
|
7881
|
+
function Ri() {
|
|
7882
7882
|
return kr.call(this, "latinWord"), kr.call(this, "arabicWord"), kr.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
|
|
7883
7883
|
}
|
|
7884
|
-
function
|
|
7884
|
+
function Di() {
|
|
7885
7885
|
var e = this, r = this.tokenizer.getContextRanges("arabicSentence");
|
|
7886
7886
|
r.forEach(function(t) {
|
|
7887
7887
|
var n = e.tokenizer.getRangeTokens(t);
|
|
@@ -7920,17 +7920,17 @@ function $r() {
|
|
|
7920
7920
|
"glyphIndex modifier is required to apply arabic presentation features."
|
|
7921
7921
|
);
|
|
7922
7922
|
}
|
|
7923
|
-
function
|
|
7923
|
+
function Ai() {
|
|
7924
7924
|
var e = this, r = "arab";
|
|
7925
7925
|
if (this.featuresTags.hasOwnProperty(r)) {
|
|
7926
7926
|
$r.call(this);
|
|
7927
7927
|
var t = this.tokenizer.getContextRanges("arabicWord");
|
|
7928
7928
|
t.forEach(function(n) {
|
|
7929
|
-
|
|
7929
|
+
Ui.call(e, n);
|
|
7930
7930
|
});
|
|
7931
7931
|
}
|
|
7932
7932
|
}
|
|
7933
|
-
function
|
|
7933
|
+
function Bi() {
|
|
7934
7934
|
var e = this, r = "arab";
|
|
7935
7935
|
if (this.featuresTags.hasOwnProperty(r)) {
|
|
7936
7936
|
var t = this.featuresTags[r];
|
|
@@ -7938,12 +7938,12 @@ function Di() {
|
|
|
7938
7938
|
$r.call(this);
|
|
7939
7939
|
var n = this.tokenizer.getContextRanges("arabicWord");
|
|
7940
7940
|
n.forEach(function(a) {
|
|
7941
|
-
|
|
7941
|
+
Ci.call(e, a);
|
|
7942
7942
|
});
|
|
7943
7943
|
}
|
|
7944
7944
|
}
|
|
7945
7945
|
}
|
|
7946
|
-
function
|
|
7946
|
+
function Mi() {
|
|
7947
7947
|
var e = this, r = "latn";
|
|
7948
7948
|
if (this.featuresTags.hasOwnProperty(r)) {
|
|
7949
7949
|
var t = this.featuresTags[r];
|
|
@@ -7951,7 +7951,7 @@ function Ai() {
|
|
|
7951
7951
|
$r.call(this);
|
|
7952
7952
|
var n = this.tokenizer.getContextRanges("latinWord");
|
|
7953
7953
|
n.forEach(function(a) {
|
|
7954
|
-
|
|
7954
|
+
Li.call(e, a);
|
|
7955
7955
|
});
|
|
7956
7956
|
}
|
|
7957
7957
|
}
|
|
@@ -7960,10 +7960,10 @@ ae.prototype.checkContextReady = function(e) {
|
|
|
7960
7960
|
return !!this.tokenizer.getContext(e);
|
|
7961
7961
|
};
|
|
7962
7962
|
ae.prototype.applyFeaturesToContexts = function() {
|
|
7963
|
-
this.checkContextReady("arabicWord") && (
|
|
7963
|
+
this.checkContextReady("arabicWord") && (Ai.call(this), Bi.call(this)), this.checkContextReady("latinWord") && Mi.call(this), this.checkContextReady("arabicSentence") && Di.call(this);
|
|
7964
7964
|
};
|
|
7965
7965
|
ae.prototype.processText = function(e) {
|
|
7966
|
-
(!this.text || this.text !== e) && (this.setText(e),
|
|
7966
|
+
(!this.text || this.text !== e) && (this.setText(e), Ri.call(this), this.applyFeaturesToContexts());
|
|
7967
7967
|
};
|
|
7968
7968
|
ae.prototype.getBidiText = function(e) {
|
|
7969
7969
|
return this.processText(e), this.tokenizer.getText();
|
|
@@ -7979,7 +7979,7 @@ ae.prototype.getTextGlyphs = function(e) {
|
|
|
7979
7979
|
}
|
|
7980
7980
|
return r;
|
|
7981
7981
|
};
|
|
7982
|
-
function
|
|
7982
|
+
function I(e) {
|
|
7983
7983
|
e = e || {}, e.tables = e.tables || {}, e.empty || (Pe(e.familyName, "When creating a new Font object, familyName is required."), Pe(e.styleName, "When creating a new Font object, styleName is required."), Pe(e.unitsPerEm, "When creating a new Font object, unitsPerEm is required."), Pe(e.ascender, "When creating a new Font object, ascender is required."), Pe(e.descender <= 0, "When creating a new Font object, negative descender value is required."), this.names = {
|
|
7984
7984
|
fontFamily: { en: e.familyName || " " },
|
|
7985
7985
|
fontSubfamily: { en: e.styleName || " " },
|
|
@@ -8002,26 +8002,26 @@ function M(e) {
|
|
|
8002
8002
|
usWidthClass: e.widthClass || this.usWidthClasses.MEDIUM,
|
|
8003
8003
|
fsSelection: e.fsSelection || this.fsSelectionValues.REGULAR
|
|
8004
8004
|
}, e.tables.os2)
|
|
8005
|
-
})), this.supported = !0, this.glyphs = new le.GlyphSet(this, e.glyphs || []), this.encoding = new
|
|
8005
|
+
})), this.supported = !0, this.glyphs = new le.GlyphSet(this, e.glyphs || []), this.encoding = new Zt(this), this.position = new Ve(this), this.substitution = new j(this), this.tables = this.tables || {}, this._push = null, this._hmtxTableData = {}, Object.defineProperty(this, "hinting", {
|
|
8006
8006
|
get: function() {
|
|
8007
8007
|
if (this._hinting)
|
|
8008
8008
|
return this._hinting;
|
|
8009
8009
|
if (this.outlinesFormat === "truetype")
|
|
8010
|
-
return this._hinting = new
|
|
8010
|
+
return this._hinting = new En(this);
|
|
8011
8011
|
}
|
|
8012
8012
|
});
|
|
8013
8013
|
}
|
|
8014
|
-
|
|
8014
|
+
I.prototype.hasChar = function(e) {
|
|
8015
8015
|
return this.encoding.charToGlyphIndex(e) !== null;
|
|
8016
8016
|
};
|
|
8017
|
-
|
|
8017
|
+
I.prototype.charToGlyphIndex = function(e) {
|
|
8018
8018
|
return this.encoding.charToGlyphIndex(e);
|
|
8019
8019
|
};
|
|
8020
|
-
|
|
8020
|
+
I.prototype.charToGlyph = function(e) {
|
|
8021
8021
|
var r = this.charToGlyphIndex(e), t = this.glyphs.get(r);
|
|
8022
8022
|
return t || (t = this.glyphs.get(0)), t;
|
|
8023
8023
|
};
|
|
8024
|
-
|
|
8024
|
+
I.prototype.updateFeatures = function(e) {
|
|
8025
8025
|
return this.defaultRenderOptions.features.map(function(r) {
|
|
8026
8026
|
return r.script === "latn" ? {
|
|
8027
8027
|
script: "latn",
|
|
@@ -8031,7 +8031,7 @@ M.prototype.updateFeatures = function(e) {
|
|
|
8031
8031
|
} : r;
|
|
8032
8032
|
});
|
|
8033
8033
|
};
|
|
8034
|
-
|
|
8034
|
+
I.prototype.stringToGlyphs = function(e, r) {
|
|
8035
8035
|
var t = this, n = new ae(), a = function(c) {
|
|
8036
8036
|
return t.charToGlyphIndex(c.char);
|
|
8037
8037
|
};
|
|
@@ -8042,22 +8042,22 @@ M.prototype.stringToGlyphs = function(e, r) {
|
|
|
8042
8042
|
i[f] = this.glyphs.get(o[f]) || l;
|
|
8043
8043
|
return i;
|
|
8044
8044
|
};
|
|
8045
|
-
|
|
8045
|
+
I.prototype.nameToGlyphIndex = function(e) {
|
|
8046
8046
|
return this.glyphNames.nameToGlyphIndex(e);
|
|
8047
8047
|
};
|
|
8048
|
-
|
|
8048
|
+
I.prototype.nameToGlyph = function(e) {
|
|
8049
8049
|
var r = this.nameToGlyphIndex(e), t = this.glyphs.get(r);
|
|
8050
8050
|
return t || (t = this.glyphs.get(0)), t;
|
|
8051
8051
|
};
|
|
8052
|
-
|
|
8052
|
+
I.prototype.glyphIndexToName = function(e) {
|
|
8053
8053
|
return this.glyphNames.glyphIndexToName ? this.glyphNames.glyphIndexToName(e) : "";
|
|
8054
8054
|
};
|
|
8055
|
-
|
|
8055
|
+
I.prototype.getKerningValue = function(e, r) {
|
|
8056
8056
|
e = e.index || e, r = r.index || r;
|
|
8057
8057
|
var t = this.position.defaultKerningTables;
|
|
8058
8058
|
return t ? this.position.getKerningValue(t, e, r) : this.kerningPairs[e + "," + r] || 0;
|
|
8059
8059
|
};
|
|
8060
|
-
|
|
8060
|
+
I.prototype.defaultRenderOptions = {
|
|
8061
8061
|
kerning: !0,
|
|
8062
8062
|
features: [
|
|
8063
8063
|
/**
|
|
@@ -8068,7 +8068,7 @@ M.prototype.defaultRenderOptions = {
|
|
|
8068
8068
|
{ script: "latn", tags: ["liga", "rlig"] }
|
|
8069
8069
|
]
|
|
8070
8070
|
};
|
|
8071
|
-
|
|
8071
|
+
I.prototype.forEachGlyph = function(e, r, t, n, a, s) {
|
|
8072
8072
|
r = r !== void 0 ? r : 0, t = t !== void 0 ? t : 0, n = n !== void 0 ? n : 72, a = Object.assign({}, this.defaultRenderOptions, a);
|
|
8073
8073
|
var o = 1 / this.unitsPerEm * n, u = this.stringToGlyphs(e, a), i;
|
|
8074
8074
|
if (a.kerning) {
|
|
@@ -8085,43 +8085,43 @@ M.prototype.forEachGlyph = function(e, r, t, n, a, s) {
|
|
|
8085
8085
|
}
|
|
8086
8086
|
return r;
|
|
8087
8087
|
};
|
|
8088
|
-
|
|
8089
|
-
var s = new
|
|
8088
|
+
I.prototype.getPath = function(e, r, t, n, a) {
|
|
8089
|
+
var s = new X();
|
|
8090
8090
|
return this.forEachGlyph(e, r, t, n, a, function(o, u, i, l) {
|
|
8091
8091
|
var f = o.getPath(u, i, l, a, this);
|
|
8092
8092
|
s.extend(f);
|
|
8093
8093
|
}), s;
|
|
8094
8094
|
};
|
|
8095
|
-
|
|
8095
|
+
I.prototype.getPaths = function(e, r, t, n, a) {
|
|
8096
8096
|
var s = [];
|
|
8097
8097
|
return this.forEachGlyph(e, r, t, n, a, function(o, u, i, l) {
|
|
8098
8098
|
var f = o.getPath(u, i, l, a, this);
|
|
8099
8099
|
s.push(f);
|
|
8100
8100
|
}), s;
|
|
8101
8101
|
};
|
|
8102
|
-
|
|
8102
|
+
I.prototype.getAdvanceWidth = function(e, r, t) {
|
|
8103
8103
|
return this.forEachGlyph(e, 0, 0, r, t, function() {
|
|
8104
8104
|
});
|
|
8105
8105
|
};
|
|
8106
|
-
|
|
8106
|
+
I.prototype.draw = function(e, r, t, n, a, s) {
|
|
8107
8107
|
this.getPath(r, t, n, a, s).draw(e);
|
|
8108
8108
|
};
|
|
8109
|
-
|
|
8109
|
+
I.prototype.drawPoints = function(e, r, t, n, a, s) {
|
|
8110
8110
|
this.forEachGlyph(r, t, n, a, s, function(o, u, i, l) {
|
|
8111
8111
|
o.drawPoints(e, u, i, l);
|
|
8112
8112
|
});
|
|
8113
8113
|
};
|
|
8114
|
-
|
|
8114
|
+
I.prototype.drawMetrics = function(e, r, t, n, a, s) {
|
|
8115
8115
|
this.forEachGlyph(r, t, n, a, s, function(o, u, i, l) {
|
|
8116
8116
|
o.drawMetrics(e, u, i, l);
|
|
8117
8117
|
});
|
|
8118
8118
|
};
|
|
8119
|
-
|
|
8119
|
+
I.prototype.getEnglishName = function(e) {
|
|
8120
8120
|
var r = this.names[e];
|
|
8121
8121
|
if (r)
|
|
8122
8122
|
return r.en;
|
|
8123
8123
|
};
|
|
8124
|
-
|
|
8124
|
+
I.prototype.validate = function() {
|
|
8125
8125
|
var e = this;
|
|
8126
8126
|
function r(n, a) {
|
|
8127
8127
|
}
|
|
@@ -8131,22 +8131,22 @@ M.prototype.validate = function() {
|
|
|
8131
8131
|
}
|
|
8132
8132
|
t("fontFamily"), t("weightName"), t("manufacturer"), t("copyright"), t("version"), this.unitsPerEm > 0;
|
|
8133
8133
|
};
|
|
8134
|
-
|
|
8135
|
-
return
|
|
8134
|
+
I.prototype.toTables = function() {
|
|
8135
|
+
return Ss.fontToTable(this);
|
|
8136
8136
|
};
|
|
8137
|
-
|
|
8137
|
+
I.prototype.toBuffer = function() {
|
|
8138
8138
|
return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."), this.toArrayBuffer();
|
|
8139
8139
|
};
|
|
8140
|
-
|
|
8140
|
+
I.prototype.toArrayBuffer = function() {
|
|
8141
8141
|
for (var e = this.toTables(), r = e.encode(), t = new ArrayBuffer(r.length), n = new Uint8Array(t), a = 0; a < r.length; a++)
|
|
8142
8142
|
n[a] = r[a];
|
|
8143
8143
|
return t;
|
|
8144
8144
|
};
|
|
8145
|
-
|
|
8145
|
+
I.prototype.download = function(e) {
|
|
8146
8146
|
var r = this.getEnglishName("fontFamily"), t = this.getEnglishName("fontSubfamily");
|
|
8147
8147
|
e = e || r.replace(/\s/g, "") + "-" + t + ".otf";
|
|
8148
8148
|
var n = this.toArrayBuffer();
|
|
8149
|
-
if (
|
|
8149
|
+
if (ks())
|
|
8150
8150
|
if (window.URL = window.URL || window.webkitURL, window.URL) {
|
|
8151
8151
|
var a = new DataView(n), s = new Blob([a], { type: "font/opentype" }), o = document.createElement("a");
|
|
8152
8152
|
o.href = window.URL.createObjectURL(s), o.download = e;
|
|
@@ -8155,11 +8155,11 @@ M.prototype.download = function(e) {
|
|
|
8155
8155
|
} else
|
|
8156
8156
|
console.warn("Font file could not be downloaded. Try using a different browser.");
|
|
8157
8157
|
else {
|
|
8158
|
-
var i = require("fs"), l =
|
|
8158
|
+
var i = require("fs"), l = Fs(n);
|
|
8159
8159
|
i.writeFileSync(e, l);
|
|
8160
8160
|
}
|
|
8161
8161
|
};
|
|
8162
|
-
|
|
8162
|
+
I.prototype.fsSelectionValues = {
|
|
8163
8163
|
ITALIC: 1,
|
|
8164
8164
|
//1
|
|
8165
8165
|
UNDERSCORE: 2,
|
|
@@ -8181,7 +8181,7 @@ M.prototype.fsSelectionValues = {
|
|
|
8181
8181
|
OBLIQUE: 512
|
|
8182
8182
|
//512
|
|
8183
8183
|
};
|
|
8184
|
-
|
|
8184
|
+
I.prototype.usWidthClasses = {
|
|
8185
8185
|
ULTRA_CONDENSED: 1,
|
|
8186
8186
|
EXTRA_CONDENSED: 2,
|
|
8187
8187
|
CONDENSED: 3,
|
|
@@ -8192,7 +8192,7 @@ M.prototype.usWidthClasses = {
|
|
|
8192
8192
|
EXTRA_EXPANDED: 8,
|
|
8193
8193
|
ULTRA_EXPANDED: 9
|
|
8194
8194
|
};
|
|
8195
|
-
|
|
8195
|
+
I.prototype.usWeightClasses = {
|
|
8196
8196
|
THIN: 100,
|
|
8197
8197
|
EXTRA_LIGHT: 200,
|
|
8198
8198
|
LIGHT: 300,
|
|
@@ -8203,7 +8203,7 @@ M.prototype.usWeightClasses = {
|
|
|
8203
8203
|
EXTRA_BOLD: 800,
|
|
8204
8204
|
BLACK: 900
|
|
8205
8205
|
};
|
|
8206
|
-
function
|
|
8206
|
+
function An(e, r) {
|
|
8207
8207
|
var t = JSON.stringify(e), n = 256;
|
|
8208
8208
|
for (var a in r) {
|
|
8209
8209
|
var s = parseInt(a);
|
|
@@ -8215,8 +8215,8 @@ function Dn(e, r) {
|
|
|
8215
8215
|
}
|
|
8216
8216
|
return r[n] = e, n;
|
|
8217
8217
|
}
|
|
8218
|
-
function
|
|
8219
|
-
var n =
|
|
8218
|
+
function Ii(e, r, t) {
|
|
8219
|
+
var n = An(r.name, t);
|
|
8220
8220
|
return [
|
|
8221
8221
|
{ name: "tag_" + e, type: "TAG", value: r.tag },
|
|
8222
8222
|
{ name: "minValue_" + e, type: "FIXED", value: r.minValue << 16 },
|
|
@@ -8226,12 +8226,12 @@ function Bi(e, r, t) {
|
|
|
8226
8226
|
{ name: "nameID_" + e, type: "USHORT", value: n }
|
|
8227
8227
|
];
|
|
8228
8228
|
}
|
|
8229
|
-
function
|
|
8229
|
+
function Pi(e, r, t) {
|
|
8230
8230
|
var n = {}, a = new k.Parser(e, r);
|
|
8231
8231
|
return n.tag = a.parseTag(), n.minValue = a.parseFixed(), n.defaultValue = a.parseFixed(), n.maxValue = a.parseFixed(), a.skip("uShort", 1), n.name = t[a.parseUShort()] || {}, n;
|
|
8232
8232
|
}
|
|
8233
|
-
function
|
|
8234
|
-
for (var a =
|
|
8233
|
+
function Gi(e, r, t, n) {
|
|
8234
|
+
for (var a = An(r.name, n), s = [
|
|
8235
8235
|
{ name: "nameID_" + e, type: "USHORT", value: a },
|
|
8236
8236
|
{ name: "flags_" + e, type: "USHORT", value: 0 }
|
|
8237
8237
|
], o = 0; o < t.length; ++o) {
|
|
@@ -8244,14 +8244,14 @@ function Ii(e, r, t, n) {
|
|
|
8244
8244
|
}
|
|
8245
8245
|
return s;
|
|
8246
8246
|
}
|
|
8247
|
-
function
|
|
8247
|
+
function Ni(e, r, t, n) {
|
|
8248
8248
|
var a = {}, s = new k.Parser(e, r);
|
|
8249
8249
|
a.name = n[s.parseUShort()] || {}, s.skip("uShort", 1), a.coordinates = {};
|
|
8250
8250
|
for (var o = 0; o < t.length; ++o)
|
|
8251
8251
|
a.coordinates[t[o].tag] = s.parseFixed();
|
|
8252
8252
|
return a;
|
|
8253
8253
|
}
|
|
8254
|
-
function
|
|
8254
|
+
function Hi(e, r) {
|
|
8255
8255
|
var t = new S.Table("fvar", [
|
|
8256
8256
|
{ name: "version", type: "ULONG", value: 65536 },
|
|
8257
8257
|
{ name: "offsetToData", type: "USHORT", value: 0 },
|
|
@@ -8263,28 +8263,28 @@ function Gi(e, r) {
|
|
|
8263
8263
|
]);
|
|
8264
8264
|
t.offsetToData = t.sizeOf();
|
|
8265
8265
|
for (var n = 0; n < e.axes.length; n++)
|
|
8266
|
-
t.fields = t.fields.concat(
|
|
8266
|
+
t.fields = t.fields.concat(Ii(n, e.axes[n], r));
|
|
8267
8267
|
for (var a = 0; a < e.instances.length; a++)
|
|
8268
|
-
t.fields = t.fields.concat(
|
|
8268
|
+
t.fields = t.fields.concat(Gi(a, e.instances[a], e.axes, r));
|
|
8269
8269
|
return t;
|
|
8270
8270
|
}
|
|
8271
|
-
function
|
|
8271
|
+
function Wi(e, r, t) {
|
|
8272
8272
|
var n = new k.Parser(e, r), a = n.parseULong();
|
|
8273
8273
|
E.argument(a === 65536, "Unsupported fvar table version.");
|
|
8274
8274
|
var s = n.parseOffset16();
|
|
8275
8275
|
n.skip("uShort", 1);
|
|
8276
8276
|
for (var o = n.parseUShort(), u = n.parseUShort(), i = n.parseUShort(), l = n.parseUShort(), f = [], c = 0; c < o; c++)
|
|
8277
|
-
f.push(
|
|
8277
|
+
f.push(Pi(e, r + s + c * u, t));
|
|
8278
8278
|
for (var p = [], h = r + s + o * u, d = 0; d < i; d++)
|
|
8279
|
-
p.push(
|
|
8279
|
+
p.push(Ni(e, h + d * l, f, t));
|
|
8280
8280
|
return { axes: f, instances: p };
|
|
8281
8281
|
}
|
|
8282
|
-
var
|
|
8282
|
+
var zi = { make: Hi, parse: Wi }, _i = function() {
|
|
8283
8283
|
return {
|
|
8284
8284
|
coverage: this.parsePointer(v.coverage),
|
|
8285
8285
|
attachPoints: this.parseList(v.pointer(v.uShortList))
|
|
8286
8286
|
};
|
|
8287
|
-
},
|
|
8287
|
+
}, Vi = function() {
|
|
8288
8288
|
var e = this.parseUShort();
|
|
8289
8289
|
if (E.argument(
|
|
8290
8290
|
e === 1 || e === 2 || e === 3,
|
|
@@ -8295,17 +8295,17 @@ var Hi = { make: Gi, parse: Ni }, Wi = function() {
|
|
|
8295
8295
|
return { pointindex: this.parseShort() };
|
|
8296
8296
|
if (e === 3)
|
|
8297
8297
|
return { coordinate: this.parseShort() };
|
|
8298
|
-
},
|
|
8299
|
-
return this.parseList(v.pointer(
|
|
8300
|
-
},
|
|
8298
|
+
}, qi = function() {
|
|
8299
|
+
return this.parseList(v.pointer(Vi));
|
|
8300
|
+
}, Xi = function() {
|
|
8301
8301
|
return {
|
|
8302
8302
|
coverage: this.parsePointer(v.coverage),
|
|
8303
|
-
ligGlyphs: this.parseList(v.pointer(
|
|
8303
|
+
ligGlyphs: this.parseList(v.pointer(qi))
|
|
8304
8304
|
};
|
|
8305
|
-
},
|
|
8305
|
+
}, Yi = function() {
|
|
8306
8306
|
return this.parseUShort(), this.parseList(v.pointer(v.coverage));
|
|
8307
8307
|
};
|
|
8308
|
-
function
|
|
8308
|
+
function $i(e, r) {
|
|
8309
8309
|
r = r || 0;
|
|
8310
8310
|
var t = new v(e, r), n = t.parseVersion(1);
|
|
8311
8311
|
E.argument(
|
|
@@ -8315,13 +8315,13 @@ function Xi(e, r) {
|
|
|
8315
8315
|
var a = {
|
|
8316
8316
|
version: n,
|
|
8317
8317
|
classDef: t.parsePointer(v.classDef),
|
|
8318
|
-
attachList: t.parsePointer(
|
|
8319
|
-
ligCaretList: t.parsePointer(
|
|
8318
|
+
attachList: t.parsePointer(_i),
|
|
8319
|
+
ligCaretList: t.parsePointer(Xi),
|
|
8320
8320
|
markAttachClassDef: t.parsePointer(v.classDef)
|
|
8321
8321
|
};
|
|
8322
|
-
return n >= 1.2 && (a.markGlyphSets = t.parsePointer(
|
|
8322
|
+
return n >= 1.2 && (a.markGlyphSets = t.parsePointer(Yi)), a;
|
|
8323
8323
|
}
|
|
8324
|
-
var
|
|
8324
|
+
var Zi = { parse: $i }, te = new Array(10);
|
|
8325
8325
|
te[1] = function() {
|
|
8326
8326
|
var r = this.offset + this.relativeOffset, t = this.parseUShort();
|
|
8327
8327
|
if (t === 1)
|
|
@@ -8399,7 +8399,7 @@ te[8] = function() {
|
|
|
8399
8399
|
te[9] = function() {
|
|
8400
8400
|
return { error: "GPOS Lookup 9 not supported" };
|
|
8401
8401
|
};
|
|
8402
|
-
function
|
|
8402
|
+
function Qi(e, r) {
|
|
8403
8403
|
r = r || 0;
|
|
8404
8404
|
var t = new v(e, r), n = t.parseVersion(1);
|
|
8405
8405
|
return E.argument(n === 1 || n === 1.1, "Unsupported GPOS table version " + n), n === 1 ? {
|
|
@@ -8415,17 +8415,17 @@ function $i(e, r) {
|
|
|
8415
8415
|
variations: t.parseFeatureVariationsList()
|
|
8416
8416
|
};
|
|
8417
8417
|
}
|
|
8418
|
-
var
|
|
8419
|
-
function
|
|
8418
|
+
var Ki = new Array(10);
|
|
8419
|
+
function ji(e) {
|
|
8420
8420
|
return new S.Table("GPOS", [
|
|
8421
8421
|
{ name: "version", type: "ULONG", value: 65536 },
|
|
8422
8422
|
{ name: "scripts", type: "TABLE", value: new S.ScriptList(e.scripts) },
|
|
8423
8423
|
{ name: "features", type: "TABLE", value: new S.FeatureList(e.features) },
|
|
8424
|
-
{ name: "lookups", type: "TABLE", value: new S.LookupList(e.lookups,
|
|
8424
|
+
{ name: "lookups", type: "TABLE", value: new S.LookupList(e.lookups, Ki) }
|
|
8425
8425
|
]);
|
|
8426
8426
|
}
|
|
8427
|
-
var
|
|
8428
|
-
function
|
|
8427
|
+
var Ji = { parse: Qi, make: ji };
|
|
8428
|
+
function eu(e) {
|
|
8429
8429
|
var r = {};
|
|
8430
8430
|
e.skip("uShort");
|
|
8431
8431
|
var t = e.parseUShort();
|
|
@@ -8438,7 +8438,7 @@ function ji(e) {
|
|
|
8438
8438
|
}
|
|
8439
8439
|
return r;
|
|
8440
8440
|
}
|
|
8441
|
-
function
|
|
8441
|
+
function ru(e) {
|
|
8442
8442
|
var r = {};
|
|
8443
8443
|
e.skip("uShort");
|
|
8444
8444
|
var t = e.parseULong();
|
|
@@ -8454,32 +8454,32 @@ function Ji(e) {
|
|
|
8454
8454
|
}
|
|
8455
8455
|
return r;
|
|
8456
8456
|
}
|
|
8457
|
-
function
|
|
8457
|
+
function tu(e, r) {
|
|
8458
8458
|
var t = new k.Parser(e, r), n = t.parseUShort();
|
|
8459
8459
|
if (n === 0)
|
|
8460
|
-
return
|
|
8460
|
+
return eu(t);
|
|
8461
8461
|
if (n === 1)
|
|
8462
|
-
return
|
|
8462
|
+
return ru(t);
|
|
8463
8463
|
throw new Error("Unsupported kern table version (" + n + ").");
|
|
8464
8464
|
}
|
|
8465
|
-
var
|
|
8466
|
-
function
|
|
8465
|
+
var nu = { parse: tu };
|
|
8466
|
+
function au(e, r, t, n) {
|
|
8467
8467
|
for (var a = new k.Parser(e, r), s = n ? a.parseUShort : a.parseULong, o = [], u = 0; u < t + 1; u += 1) {
|
|
8468
8468
|
var i = s.call(a);
|
|
8469
8469
|
n && (i *= 2), o.push(i);
|
|
8470
8470
|
}
|
|
8471
8471
|
return o;
|
|
8472
8472
|
}
|
|
8473
|
-
var
|
|
8474
|
-
function
|
|
8473
|
+
var su = { parse: au };
|
|
8474
|
+
function ou(e, r) {
|
|
8475
8475
|
var t = require("fs");
|
|
8476
8476
|
t.readFile(e, function(n, a) {
|
|
8477
8477
|
if (n)
|
|
8478
8478
|
return r(n.message);
|
|
8479
|
-
r(null,
|
|
8479
|
+
r(null, Sn(a));
|
|
8480
8480
|
});
|
|
8481
8481
|
}
|
|
8482
|
-
function
|
|
8482
|
+
function iu(e, r) {
|
|
8483
8483
|
var t = new XMLHttpRequest();
|
|
8484
8484
|
t.open("get", e, !0), t.responseType = "arraybuffer", t.onload = function() {
|
|
8485
8485
|
return t.response ? r(null, t.response) : r("Font could not be loaded: " + t.statusText);
|
|
@@ -8494,7 +8494,7 @@ function Bt(e, r) {
|
|
|
8494
8494
|
}
|
|
8495
8495
|
return t;
|
|
8496
8496
|
}
|
|
8497
|
-
function
|
|
8497
|
+
function uu(e, r) {
|
|
8498
8498
|
for (var t = [], n = 44, a = 0; a < r; a += 1) {
|
|
8499
8499
|
var s = k.getTag(e, n), o = k.getULong(e, n + 4), u = k.getULong(e, n + 8), i = k.getULong(e, n + 12), l = void 0;
|
|
8500
8500
|
u < i ? l = "WOFF" : l = !1, t.push({
|
|
@@ -8507,10 +8507,10 @@ function ou(e, r) {
|
|
|
8507
8507
|
}
|
|
8508
8508
|
return t;
|
|
8509
8509
|
}
|
|
8510
|
-
function
|
|
8510
|
+
function W(e, r) {
|
|
8511
8511
|
if (r.compression === "WOFF") {
|
|
8512
8512
|
var t = new Uint8Array(e.buffer, r.offset + 2, r.compressedLength - 2), n = new Uint8Array(r.length);
|
|
8513
|
-
if (
|
|
8513
|
+
if (jn(t, n), n.byteLength !== r.length)
|
|
8514
8514
|
throw new Error("Decompression error: " + r.tag + " decompressed length doesn't match recorded length");
|
|
8515
8515
|
var a = new DataView(n.buffer, 0);
|
|
8516
8516
|
return { data: a, offset: 0 };
|
|
@@ -8519,7 +8519,7 @@ function H(e, r) {
|
|
|
8519
8519
|
}
|
|
8520
8520
|
function Zr(e, r) {
|
|
8521
8521
|
r = r ?? {};
|
|
8522
|
-
var t, n, a = new
|
|
8522
|
+
var t, n, a = new I({ empty: !0 }), s = new DataView(e, 0), o, u = [], i = k.getTag(s, 0);
|
|
8523
8523
|
if (i === "\0\0\0" || i === "true" || i === "typ1")
|
|
8524
8524
|
a.outlinesFormat = "truetype", o = k.getUShort(s, 4), u = Bt(s, o);
|
|
8525
8525
|
else if (i === "OTTO")
|
|
@@ -8532,62 +8532,62 @@ function Zr(e, r) {
|
|
|
8532
8532
|
a.outlinesFormat = "cff";
|
|
8533
8533
|
else
|
|
8534
8534
|
throw new Error("Unsupported OpenType flavor " + i);
|
|
8535
|
-
o = k.getUShort(s, 12), u =
|
|
8535
|
+
o = k.getUShort(s, 12), u = uu(s, o);
|
|
8536
8536
|
} else
|
|
8537
8537
|
throw new Error("Unsupported OpenType signature " + i);
|
|
8538
|
-
for (var f, c, p, h, d, g, m,
|
|
8539
|
-
var C = u[
|
|
8538
|
+
for (var f, c, p, h, d, g, m, x, U, y, L, w, B = 0; B < o; B += 1) {
|
|
8539
|
+
var C = u[B], F = void 0;
|
|
8540
8540
|
switch (C.tag) {
|
|
8541
8541
|
case "cmap":
|
|
8542
|
-
|
|
8542
|
+
F = W(s, C), a.tables.cmap = $t.parse(F.data, F.offset), a.encoding = new Qt(a.tables.cmap);
|
|
8543
8543
|
break;
|
|
8544
8544
|
case "cvt ":
|
|
8545
|
-
|
|
8545
|
+
F = W(s, C), w = new k.Parser(F.data, F.offset), a.tables.cvt = w.parseShortList(C.length / 2);
|
|
8546
8546
|
break;
|
|
8547
8547
|
case "fvar":
|
|
8548
8548
|
c = C;
|
|
8549
8549
|
break;
|
|
8550
8550
|
case "fpgm":
|
|
8551
|
-
|
|
8551
|
+
F = W(s, C), w = new k.Parser(F.data, F.offset), a.tables.fpgm = w.parseByteList(C.length);
|
|
8552
8552
|
break;
|
|
8553
8553
|
case "head":
|
|
8554
|
-
|
|
8554
|
+
F = W(s, C), a.tables.head = on.parse(F.data, F.offset), a.unitsPerEm = a.tables.head.unitsPerEm, t = a.tables.head.indexToLocFormat;
|
|
8555
8555
|
break;
|
|
8556
8556
|
case "hhea":
|
|
8557
|
-
|
|
8557
|
+
F = W(s, C), a.tables.hhea = un.parse(F.data, F.offset), a.ascender = a.tables.hhea.ascender, a.descender = a.tables.hhea.descender, a.numberOfHMetrics = a.tables.hhea.numberOfHMetrics;
|
|
8558
8558
|
break;
|
|
8559
8559
|
case "hmtx":
|
|
8560
8560
|
m = C;
|
|
8561
8561
|
break;
|
|
8562
8562
|
case "ltag":
|
|
8563
|
-
|
|
8563
|
+
F = W(s, C), n = fn.parse(F.data, F.offset);
|
|
8564
8564
|
break;
|
|
8565
8565
|
case "maxp":
|
|
8566
|
-
|
|
8566
|
+
F = W(s, C), a.tables.maxp = pn.parse(F.data, F.offset), a.numGlyphs = a.tables.maxp.numGlyphs;
|
|
8567
8567
|
break;
|
|
8568
8568
|
case "name":
|
|
8569
|
-
|
|
8569
|
+
y = C;
|
|
8570
8570
|
break;
|
|
8571
8571
|
case "OS/2":
|
|
8572
|
-
|
|
8572
|
+
F = W(s, C), a.tables.os2 = Br.parse(F.data, F.offset);
|
|
8573
8573
|
break;
|
|
8574
8574
|
case "post":
|
|
8575
|
-
|
|
8575
|
+
F = W(s, C), a.tables.post = mn.parse(F.data, F.offset), a.glyphNames = new zr(a.tables.post);
|
|
8576
8576
|
break;
|
|
8577
8577
|
case "prep":
|
|
8578
|
-
|
|
8578
|
+
F = W(s, C), w = new k.Parser(F.data, F.offset), a.tables.prep = w.parseByteList(C.length);
|
|
8579
8579
|
break;
|
|
8580
8580
|
case "glyf":
|
|
8581
8581
|
p = C;
|
|
8582
8582
|
break;
|
|
8583
8583
|
case "loca":
|
|
8584
|
-
|
|
8584
|
+
U = C;
|
|
8585
8585
|
break;
|
|
8586
8586
|
case "CFF ":
|
|
8587
8587
|
f = C;
|
|
8588
8588
|
break;
|
|
8589
8589
|
case "kern":
|
|
8590
|
-
|
|
8590
|
+
x = C;
|
|
8591
8591
|
break;
|
|
8592
8592
|
case "GDEF":
|
|
8593
8593
|
h = C;
|
|
@@ -8599,50 +8599,50 @@ function Zr(e, r) {
|
|
|
8599
8599
|
g = C;
|
|
8600
8600
|
break;
|
|
8601
8601
|
case "meta":
|
|
8602
|
-
|
|
8602
|
+
L = C;
|
|
8603
8603
|
break;
|
|
8604
8604
|
}
|
|
8605
8605
|
}
|
|
8606
|
-
var
|
|
8607
|
-
if (a.tables.name =
|
|
8608
|
-
var
|
|
8609
|
-
a.glyphs =
|
|
8606
|
+
var D = W(s, y);
|
|
8607
|
+
if (a.tables.name = gn.parse(D.data, D.offset, n), a.names = a.tables.name, p && U) {
|
|
8608
|
+
var R = t === 0, A = W(s, U), H = su.parse(A.data, A.offset, a.numGlyphs, R), Q = W(s, p);
|
|
8609
|
+
a.glyphs = Un.parse(Q.data, Q.offset, H, a, r);
|
|
8610
8610
|
} else if (f) {
|
|
8611
|
-
var G =
|
|
8612
|
-
|
|
8611
|
+
var G = W(s, f);
|
|
8612
|
+
sn.parse(G.data, G.offset, a, r);
|
|
8613
8613
|
} else
|
|
8614
8614
|
throw new Error("Font doesn't contain TrueType or CFF outlines.");
|
|
8615
|
-
var
|
|
8616
|
-
if (
|
|
8617
|
-
var Y =
|
|
8618
|
-
a.kerningPairs =
|
|
8615
|
+
var z = W(s, m);
|
|
8616
|
+
if (ln.parse(a, z.data, z.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, r), xa(a, r), x) {
|
|
8617
|
+
var Y = W(s, x);
|
|
8618
|
+
a.kerningPairs = nu.parse(Y.data, Y.offset);
|
|
8619
8619
|
} else
|
|
8620
8620
|
a.kerningPairs = {};
|
|
8621
8621
|
if (h) {
|
|
8622
|
-
var
|
|
8623
|
-
a.tables.gdef =
|
|
8622
|
+
var _ = W(s, h);
|
|
8623
|
+
a.tables.gdef = Zi.parse(_.data, _.offset);
|
|
8624
8624
|
}
|
|
8625
8625
|
if (d) {
|
|
8626
|
-
var P =
|
|
8627
|
-
a.tables.gpos =
|
|
8626
|
+
var P = W(s, d);
|
|
8627
|
+
a.tables.gpos = Ji.parse(P.data, P.offset), a.position.init();
|
|
8628
8628
|
}
|
|
8629
8629
|
if (g) {
|
|
8630
|
-
var
|
|
8631
|
-
a.tables.gsub =
|
|
8630
|
+
var V = W(s, g);
|
|
8631
|
+
a.tables.gsub = yn.parse(V.data, V.offset);
|
|
8632
8632
|
}
|
|
8633
8633
|
if (c) {
|
|
8634
|
-
var $ =
|
|
8635
|
-
a.tables.fvar =
|
|
8634
|
+
var $ = W(s, c);
|
|
8635
|
+
a.tables.fvar = zi.parse($.data, $.offset, a.names);
|
|
8636
8636
|
}
|
|
8637
|
-
if (
|
|
8638
|
-
var
|
|
8639
|
-
a.tables.meta =
|
|
8637
|
+
if (L) {
|
|
8638
|
+
var M = W(s, L);
|
|
8639
|
+
a.tables.meta = xn.parse(M.data, M.offset), a.metas = a.tables.meta;
|
|
8640
8640
|
}
|
|
8641
8641
|
return a;
|
|
8642
8642
|
}
|
|
8643
|
-
function
|
|
8643
|
+
function lu(e, r, t) {
|
|
8644
8644
|
t = t ?? {};
|
|
8645
|
-
var n = typeof window > "u", a = n && !t.isUrl ?
|
|
8645
|
+
var n = typeof window > "u", a = n && !t.isUrl ? ou : iu;
|
|
8646
8646
|
return new Promise(function(s, o) {
|
|
8647
8647
|
a(e, function(u, i) {
|
|
8648
8648
|
if (u) {
|
|
@@ -8664,22 +8664,22 @@ function iu(e, r, t) {
|
|
|
8664
8664
|
});
|
|
8665
8665
|
});
|
|
8666
8666
|
}
|
|
8667
|
-
function
|
|
8667
|
+
function fu(e, r) {
|
|
8668
8668
|
var t = require("fs"), n = t.readFileSync(e);
|
|
8669
|
-
return Zr(
|
|
8669
|
+
return Zr(Sn(n), r);
|
|
8670
8670
|
}
|
|
8671
|
-
var
|
|
8671
|
+
var pu = /* @__PURE__ */ Object.freeze({
|
|
8672
8672
|
__proto__: null,
|
|
8673
|
-
Font:
|
|
8673
|
+
Font: I,
|
|
8674
8674
|
Glyph: K,
|
|
8675
|
-
Path:
|
|
8675
|
+
Path: X,
|
|
8676
8676
|
BoundingBox: he,
|
|
8677
8677
|
_parse: k,
|
|
8678
8678
|
parse: Zr,
|
|
8679
|
-
load:
|
|
8680
|
-
loadSync:
|
|
8679
|
+
load: lu,
|
|
8680
|
+
loadSync: fu
|
|
8681
8681
|
});
|
|
8682
|
-
function
|
|
8682
|
+
function cu(e, r) {
|
|
8683
8683
|
const t = { svgGlyphs: r };
|
|
8684
8684
|
return new Proxy(e, {
|
|
8685
8685
|
get(n, a, s) {
|
|
@@ -8696,7 +8696,7 @@ function fu(e, r) {
|
|
|
8696
8696
|
}
|
|
8697
8697
|
});
|
|
8698
8698
|
}
|
|
8699
|
-
const Ir = /* @__PURE__ */ new Map(), Zu = () => Ir,
|
|
8699
|
+
const Ir = /* @__PURE__ */ new Map(), Zu = () => Ir, hu = async (e, r = !1) => {
|
|
8700
8700
|
const t = Ir.get(e);
|
|
8701
8701
|
if (t) {
|
|
8702
8702
|
if (r && !t.svgGlyphs) {
|
|
@@ -8715,16 +8715,16 @@ const Ir = /* @__PURE__ */ new Map(), Zu = () => Ir, pu = async (e, r = !1) => {
|
|
|
8715
8715
|
throw new Error(
|
|
8716
8716
|
`Failed to load font from ${e}: ${n.status} ${n.statusText}`
|
|
8717
8717
|
);
|
|
8718
|
-
const a = await n.arrayBuffer(), s =
|
|
8718
|
+
const a = await n.arrayBuffer(), s = pu.parse(a);
|
|
8719
8719
|
let o;
|
|
8720
8720
|
if (r) {
|
|
8721
8721
|
const { extractSVGGlyphs: i } = await import("../index-F17NutRZ.js");
|
|
8722
8722
|
o = await i(a);
|
|
8723
8723
|
}
|
|
8724
|
-
const u =
|
|
8724
|
+
const u = cu(s, o);
|
|
8725
8725
|
return Ir.set(e, u), u;
|
|
8726
|
-
},
|
|
8727
|
-
outlineWidth:
|
|
8726
|
+
}, vu = 0.03125, Bn = 1.1, Mn = 0.2, $e = {
|
|
8727
|
+
outlineWidth: vu,
|
|
8728
8728
|
letterSpacing: 0,
|
|
8729
8729
|
letterSpacingOutline: 0
|
|
8730
8730
|
};
|
|
@@ -8742,18 +8742,18 @@ class fe {
|
|
|
8742
8742
|
return `${this.x} ${this.y}`;
|
|
8743
8743
|
}
|
|
8744
8744
|
}
|
|
8745
|
-
function
|
|
8745
|
+
function du(e, r, t = new fe(0, 0)) {
|
|
8746
8746
|
const n = e.X - t.X, a = e.Y - t.Y, s = r / 180 * Math.PI, o = Math.cos(s), u = Math.sin(s), i = n * o - a * u, l = n * u + a * o;
|
|
8747
8747
|
return new fe(i + t.X, l + t.Y);
|
|
8748
8748
|
}
|
|
8749
|
-
const
|
|
8749
|
+
const gu = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curved" ? { type: "curved" } : e, mu = (e) => {
|
|
8750
8750
|
if (!e || !e.trim())
|
|
8751
8751
|
throw new Error("Custom baseline path must be a non-empty SVG path string");
|
|
8752
8752
|
if (!e.trim().startsWith("M"))
|
|
8753
8753
|
throw new Error(
|
|
8754
8754
|
"Custom baseline path must start with an M (moveto) command"
|
|
8755
8755
|
);
|
|
8756
|
-
},
|
|
8756
|
+
}, yu = ({
|
|
8757
8757
|
boxDimensions: e,
|
|
8758
8758
|
totalTextHeight: r,
|
|
8759
8759
|
baseline: t,
|
|
@@ -8773,16 +8773,16 @@ const du = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curve
|
|
|
8773
8773
|
break;
|
|
8774
8774
|
}
|
|
8775
8775
|
}
|
|
8776
|
-
return l += s * (n *
|
|
8777
|
-
},
|
|
8776
|
+
return l += s * (n * Bn), `M 0 ${l} L ${o} ${l}`;
|
|
8777
|
+
}, In = ({
|
|
8778
8778
|
boxDimensions: e,
|
|
8779
8779
|
baseline: r,
|
|
8780
8780
|
textHeight: t,
|
|
8781
8781
|
verticalAlignment: n
|
|
8782
8782
|
}) => {
|
|
8783
|
-
const { width: a, height: s } = e, o = t *
|
|
8783
|
+
const { width: a, height: s } = e, o = t * Mn, u = t + o, i = n === "top" ? 0 : s / 2 - u / 2, l = r + i, f = l + o;
|
|
8784
8784
|
if (n !== "top" && (f > s || l - t < 0))
|
|
8785
|
-
return
|
|
8785
|
+
return In({
|
|
8786
8786
|
boxDimensions: e,
|
|
8787
8787
|
baseline: r,
|
|
8788
8788
|
textHeight: t,
|
|
@@ -8791,12 +8791,12 @@ const du = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curve
|
|
|
8791
8791
|
const c = t / 4, p = new fe(c, f), h = new fe(a / 2, l), d = new fe(a - c, f), g = a * 0.2, m = new fe(
|
|
8792
8792
|
g,
|
|
8793
8793
|
r + i
|
|
8794
|
-
),
|
|
8794
|
+
), x = new fe(
|
|
8795
8795
|
a - g,
|
|
8796
8796
|
r + i
|
|
8797
|
-
),
|
|
8798
|
-
return `${
|
|
8799
|
-
},
|
|
8797
|
+
), U = `M ${p.toSVGString()}`, y = `Q ${m.toSVGString()} ${h.toSVGString()}`, L = `Q ${x.toSVGString()} ${d.toSVGString()}`;
|
|
8798
|
+
return `${U} ${y} ${L}`;
|
|
8799
|
+
}, xu = (e) => {
|
|
8800
8800
|
const r = ["I", "l", "1"];
|
|
8801
8801
|
for (const t of r) {
|
|
8802
8802
|
const n = e.charToGlyph(t);
|
|
@@ -8806,7 +8806,7 @@ const du = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curve
|
|
|
8806
8806
|
return console.error(
|
|
8807
8807
|
'No standard character found for fixed height calculation. Using "I" as default.'
|
|
8808
8808
|
), "I";
|
|
8809
|
-
}, Fr = 100,
|
|
8809
|
+
}, Fr = 100, bu = ({
|
|
8810
8810
|
font: e,
|
|
8811
8811
|
boxDimensions: r,
|
|
8812
8812
|
physicalSize: t,
|
|
@@ -8817,7 +8817,7 @@ const du = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curve
|
|
|
8817
8817
|
throw new Error(
|
|
8818
8818
|
`Mismatched units between physicalFontSize (${a[1]}) and boxDimensions (${r.physicalUnits})`
|
|
8819
8819
|
);
|
|
8820
|
-
const { outlineWidth: s } = n, o =
|
|
8820
|
+
const { outlineWidth: s } = n, o = xu(e), i = e.getPath(
|
|
8821
8821
|
o,
|
|
8822
8822
|
0,
|
|
8823
8823
|
0,
|
|
@@ -8830,7 +8830,7 @@ const du = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curve
|
|
|
8830
8830
|
}
|
|
8831
8831
|
const c = l / r.height * r.physicalHeight, p = a[0] / c;
|
|
8832
8832
|
return Fr * p;
|
|
8833
|
-
},
|
|
8833
|
+
}, Su = ({
|
|
8834
8834
|
font: e,
|
|
8835
8835
|
text: r,
|
|
8836
8836
|
fontSize: t,
|
|
@@ -8842,9 +8842,9 @@ const du = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curve
|
|
|
8842
8842
|
height: h,
|
|
8843
8843
|
baseline: d
|
|
8844
8844
|
};
|
|
8845
|
-
}, pr =
|
|
8846
|
-
|
|
8847
|
-
const
|
|
8845
|
+
}, pr = _n, Tu = Vn, ku = () => new pr().parseFromString("<svg></svg>", "image/svg+xml"), Fu = ku();
|
|
8846
|
+
Fu.readyState = "complete";
|
|
8847
|
+
const Uu = {
|
|
8848
8848
|
aliceblue: "#f0f8ff",
|
|
8849
8849
|
antiquewhite: "#faebd7",
|
|
8850
8850
|
aqua: "#00ffff",
|
|
@@ -8993,7 +8993,7 @@ const Fu = {
|
|
|
8993
8993
|
whitesmoke: "#f5f5f5",
|
|
8994
8994
|
yellow: "#ffff00",
|
|
8995
8995
|
yellowgreen: "#9acd32"
|
|
8996
|
-
},
|
|
8996
|
+
}, Cu = (e) => {
|
|
8997
8997
|
let r = Array.from(e), t = !1;
|
|
8998
8998
|
return r[0] === "#" && (r.shift(), t = !0), r.length === 3 && (r = r.map((n) => `${n}${n}`)), `${t ? "#" : ""}${r.join("").toLowerCase()}`;
|
|
8999
8999
|
}, Ur = (e) => {
|
|
@@ -9002,7 +9002,7 @@ const Fu = {
|
|
|
9002
9002
|
}, Mt = (...e) => {
|
|
9003
9003
|
const [r, t, n] = Array.isArray(e[0]) ? e[0] : e;
|
|
9004
9004
|
return `#${Ur(r)}${Ur(t)}${Ur(n)}`;
|
|
9005
|
-
},
|
|
9005
|
+
}, wu = (e, r, t) => {
|
|
9006
9006
|
if (r === 0) {
|
|
9007
9007
|
const f = Math.round(t * 255);
|
|
9008
9008
|
return [f, f, f];
|
|
@@ -9014,10 +9014,10 @@ const Fu = {
|
|
|
9014
9014
|
Math.round((i + o) * 255),
|
|
9015
9015
|
Math.round((l + o) * 255)
|
|
9016
9016
|
];
|
|
9017
|
-
},
|
|
9017
|
+
}, Eu = (e) => /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e), Pn = (e) => {
|
|
9018
9018
|
const r = e.trim().toLowerCase();
|
|
9019
9019
|
if (r.startsWith("#") || /^[0-9a-f]{3}([0-9a-f]{3})?$/.test(r))
|
|
9020
|
-
return
|
|
9020
|
+
return Eu(r) ? Cu(r) : void 0;
|
|
9021
9021
|
if (r.startsWith("rgb")) {
|
|
9022
9022
|
const n = r.match(
|
|
9023
9023
|
/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*[\d.]+\s*)?\)/
|
|
@@ -9033,10 +9033,10 @@ const Fu = {
|
|
|
9033
9033
|
/hsla?\(\s*(\d+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*[\d.]+\s*)?\)/
|
|
9034
9034
|
);
|
|
9035
9035
|
if (!n) return;
|
|
9036
|
-
const a = Number.parseInt(n[1], 10), s = Number.parseFloat(n[2]) / 100, o = Number.parseFloat(n[3]) / 100, [u, i, l] =
|
|
9036
|
+
const a = Number.parseInt(n[1], 10), s = Number.parseFloat(n[2]) / 100, o = Number.parseFloat(n[3]) / 100, [u, i, l] = wu(a, s, o);
|
|
9037
9037
|
return Mt(u, i, l);
|
|
9038
9038
|
}
|
|
9039
|
-
const t =
|
|
9039
|
+
const t = Uu[r];
|
|
9040
9040
|
if (t) return t;
|
|
9041
9041
|
}, me = {
|
|
9042
9042
|
circle: "circle",
|
|
@@ -9050,7 +9050,7 @@ const Fu = {
|
|
|
9050
9050
|
}, ur = {
|
|
9051
9051
|
fill: "fill",
|
|
9052
9052
|
stroke: "stroke"
|
|
9053
|
-
},
|
|
9053
|
+
}, Ou = {
|
|
9054
9054
|
tiling: [
|
|
9055
9055
|
me.circle,
|
|
9056
9056
|
me.ellipse,
|
|
@@ -9063,20 +9063,20 @@ const Fu = {
|
|
|
9063
9063
|
`[${ur.fill}]`,
|
|
9064
9064
|
`[${ur.stroke}]`
|
|
9065
9065
|
]
|
|
9066
|
-
},
|
|
9066
|
+
}, Lu = (e) => Array.from(
|
|
9067
9067
|
e.querySelectorAll(
|
|
9068
|
-
|
|
9068
|
+
Ou.tiling.map((r) => `*:not(clipPath) > ${r}`).join(", ")
|
|
9069
9069
|
)
|
|
9070
|
-
),
|
|
9070
|
+
), Ru = (e) => {
|
|
9071
9071
|
const r = e.getAttribute(ur.stroke);
|
|
9072
9072
|
return r === "none" || !r ? !1 : r;
|
|
9073
9073
|
}, Cr = (e) => {
|
|
9074
9074
|
if (!(e === "none" || e === "transparent" || e.startsWith("url(")))
|
|
9075
|
-
return
|
|
9076
|
-
},
|
|
9077
|
-
const r =
|
|
9075
|
+
return Pn(e);
|
|
9076
|
+
}, Du = (e) => {
|
|
9077
|
+
const r = Lu(e).reduce(
|
|
9078
9078
|
(t, n) => {
|
|
9079
|
-
const a = n.getAttribute("stop-color"), s = n.getAttribute(ur.fill) || "#000", o =
|
|
9079
|
+
const a = n.getAttribute("stop-color"), s = n.getAttribute(ur.fill) || "#000", o = Ru(n);
|
|
9080
9080
|
if (!a) {
|
|
9081
9081
|
const u = Cr(s);
|
|
9082
9082
|
u && t.add(u);
|
|
@@ -9094,15 +9094,15 @@ const Fu = {
|
|
|
9094
9094
|
/* @__PURE__ */ new Set()
|
|
9095
9095
|
);
|
|
9096
9096
|
return Array.from(r);
|
|
9097
|
-
},
|
|
9097
|
+
}, Au = (e) => {
|
|
9098
9098
|
const r = new pr().parseFromString(e, "image/svg+xml").querySelector("svg");
|
|
9099
|
-
return r ?
|
|
9099
|
+
return r ? Du(r) : [];
|
|
9100
9100
|
};
|
|
9101
|
-
function
|
|
9101
|
+
function Gn(e) {
|
|
9102
9102
|
const r = e.trim(), t = r.startsWith("<svg") || r.startsWith("<?xml"), n = t ? r : `<svg>${r}</svg>`;
|
|
9103
9103
|
return { doc: new pr().parseFromString(n, "image/svg+xml"), wasWrapped: !t };
|
|
9104
9104
|
}
|
|
9105
|
-
function
|
|
9105
|
+
function Nn(e, r) {
|
|
9106
9106
|
const t = e.querySelector("svg");
|
|
9107
9107
|
return t ? r ? t.innerHTML : t.outerHTML : "";
|
|
9108
9108
|
}
|
|
@@ -9112,20 +9112,20 @@ function Qu(e) {
|
|
|
9112
9112
|
return [];
|
|
9113
9113
|
const t = /* @__PURE__ */ new Set();
|
|
9114
9114
|
for (const [, n] of r)
|
|
9115
|
-
for (const a of
|
|
9115
|
+
for (const a of Au(n.svg))
|
|
9116
9116
|
t.add(a);
|
|
9117
9117
|
return Array.from(t);
|
|
9118
9118
|
}
|
|
9119
|
-
function
|
|
9119
|
+
function Bu(e) {
|
|
9120
9120
|
return !!e && e !== "none" && e !== "transparent" && !e.startsWith("url(");
|
|
9121
9121
|
}
|
|
9122
|
-
function
|
|
9122
|
+
function Mu(e) {
|
|
9123
9123
|
const t = new pr().parseFromString(e, "image/svg+xml").querySelector("svg");
|
|
9124
9124
|
return t ? t.innerHTML.trim() : "";
|
|
9125
9125
|
}
|
|
9126
|
-
const
|
|
9127
|
-
function
|
|
9128
|
-
const { doc: t, wasWrapped: n } =
|
|
9126
|
+
const Iu = ["fill", "stroke", "clip-path", "mask", "filter"];
|
|
9127
|
+
function Pu(e, r) {
|
|
9128
|
+
const { doc: t, wasWrapped: n } = Gn(e), a = /* @__PURE__ */ new Map();
|
|
9129
9129
|
for (const s of t.querySelectorAll("[id]")) {
|
|
9130
9130
|
const o = s.getAttribute("id");
|
|
9131
9131
|
if (!o) continue;
|
|
@@ -9134,7 +9134,7 @@ function Iu(e, r) {
|
|
|
9134
9134
|
}
|
|
9135
9135
|
if (a.size === 0)
|
|
9136
9136
|
return e;
|
|
9137
|
-
for (const s of
|
|
9137
|
+
for (const s of Iu)
|
|
9138
9138
|
for (const o of t.querySelectorAll(`[${s}]`)) {
|
|
9139
9139
|
const u = o.getAttribute(s);
|
|
9140
9140
|
if (u) {
|
|
@@ -9153,36 +9153,36 @@ function Iu(e, r) {
|
|
|
9153
9153
|
l && s.setAttribute(o, `#${l}`);
|
|
9154
9154
|
}
|
|
9155
9155
|
}
|
|
9156
|
-
return
|
|
9156
|
+
return Nn(t, n);
|
|
9157
9157
|
}
|
|
9158
|
-
const
|
|
9159
|
-
function
|
|
9160
|
-
const { doc: t, wasWrapped: n } =
|
|
9161
|
-
for (const s of
|
|
9158
|
+
const Gu = ["fill", "stroke", "stop-color"], Nu = ["path", "rect", "circle", "ellipse", "polygon", "polyline", "text"];
|
|
9159
|
+
function Hu(e, r) {
|
|
9160
|
+
const { doc: t, wasWrapped: n } = Gn(e);
|
|
9161
|
+
for (const s of Gu)
|
|
9162
9162
|
for (const o of t.querySelectorAll(`[${s}]`)) {
|
|
9163
9163
|
const u = o.getAttribute(s);
|
|
9164
|
-
if (!u || !
|
|
9165
|
-
const i =
|
|
9164
|
+
if (!u || !Bu(u)) continue;
|
|
9165
|
+
const i = Pn(u), l = i ? r[i] : void 0;
|
|
9166
9166
|
l && o.setAttribute(s, l.hex);
|
|
9167
9167
|
}
|
|
9168
9168
|
const a = r["#000000"];
|
|
9169
9169
|
if (a) {
|
|
9170
|
-
const s =
|
|
9170
|
+
const s = Nu.map((o) => `${o}:not([fill])`).join(", ");
|
|
9171
9171
|
for (const o of t.querySelectorAll(s))
|
|
9172
9172
|
o.setAttribute("fill", a.hex);
|
|
9173
9173
|
}
|
|
9174
|
-
return
|
|
9174
|
+
return Nn(t, n);
|
|
9175
9175
|
}
|
|
9176
|
-
const
|
|
9177
|
-
const r = `matrix(${e.join(",")})`, t = new
|
|
9176
|
+
const Wu = (e = [1, 0, 0, 1, 0, 0]) => {
|
|
9177
|
+
const r = `matrix(${e.join(",")})`, t = new Tu(r);
|
|
9178
9178
|
if (!t)
|
|
9179
9179
|
throw new Error("Your browser does not support matrices");
|
|
9180
9180
|
return t;
|
|
9181
9181
|
};
|
|
9182
|
-
function
|
|
9182
|
+
function zu(e) {
|
|
9183
9183
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">");
|
|
9184
9184
|
}
|
|
9185
|
-
const It = (e, r, t) => e / t * r,
|
|
9185
|
+
const It = (e, r, t) => e / t * r, _u = ({
|
|
9186
9186
|
font: e,
|
|
9187
9187
|
baselinePath: r,
|
|
9188
9188
|
text: t,
|
|
@@ -9191,78 +9191,78 @@ const It = (e, r, t) => e / t * r, zu = ({
|
|
|
9191
9191
|
horizontalAlignment: s = "centre",
|
|
9192
9192
|
colourMap: o
|
|
9193
9193
|
}) => {
|
|
9194
|
-
const { outlineWidth: u, letterSpacing: i, letterSpacingOutline: l } = a, f = new
|
|
9195
|
-
let
|
|
9196
|
-
s === "distributed" && (
|
|
9197
|
-
const w =
|
|
9194
|
+
const { outlineWidth: u, letterSpacing: i, letterSpacingOutline: l } = a, f = new zn(r), c = u ? n * u * 2 : 0, p = f.getTotalLength(), h = e.getPaths(t, 0, 0, n, { drawSVG: !1 }), g = e.getPath(t, 0, 0, n, { drawSVG: !1 }).getBoundingBox(), m = g.x1 - c / 2, U = g.x2 + c / 2 - m, y = u > 0 ? l : i;
|
|
9195
|
+
let L = y ? y * n : 0;
|
|
9196
|
+
s === "distributed" && (L = t.length === 1 ? 0 : (p - U) / (t.length - 1));
|
|
9197
|
+
const w = L * (t.length - 1), B = U + w;
|
|
9198
9198
|
let C = 0 - m;
|
|
9199
|
-
s === "centre" ? C = (p -
|
|
9200
|
-
const
|
|
9201
|
-
for (let
|
|
9202
|
-
const
|
|
9199
|
+
s === "centre" ? C = (p - B) / 2 - m : s === "right" && (C = p - U - m - w);
|
|
9200
|
+
const F = [];
|
|
9201
|
+
for (let D = 0; D < h.length; D++) {
|
|
9202
|
+
const R = h[D], A = R.getBoundingBox(), H = e.charToGlyph(t[D]), { advanceWidth: Q } = H;
|
|
9203
9203
|
if (!Q)
|
|
9204
9204
|
throw new Error(
|
|
9205
|
-
`No advance width for character: ${t[
|
|
9205
|
+
`No advance width for character: ${t[D]} in font ${e.names.fontFamily}`
|
|
9206
9206
|
);
|
|
9207
|
-
const { x1: G, x2:
|
|
9207
|
+
const { x1: G, x2: z } = H.getBoundingBox(), Y = It(
|
|
9208
9208
|
Q,
|
|
9209
9209
|
n,
|
|
9210
9210
|
e.unitsPerEm
|
|
9211
|
-
),
|
|
9211
|
+
), _ = It(z - G, n, e.unitsPerEm);
|
|
9212
9212
|
let P = C + A.x1;
|
|
9213
|
-
if (
|
|
9213
|
+
if (D > 0 && (P += L * D), P + _ > p)
|
|
9214
9214
|
throw new Error(
|
|
9215
|
-
`TOO_WIDE: character "${t[
|
|
9215
|
+
`TOO_WIDE: character "${t[D]}" at index ${D} exceeds baseline path length (${Math.round(P + _)} > ${Math.round(p)})`
|
|
9216
9216
|
);
|
|
9217
|
-
const
|
|
9217
|
+
const V = P + Y / 2, $ = f.getTangentAtLength(V), M = Math.atan2($.y, $.x) * 180 / Math.PI, q = f.getPointAtLength(P), De = q.x, cr = q.y, Ae = A.x2 - A.x1, Be = new fe(A.x1 + Ae / 2, 0), Me = du(
|
|
9218
9218
|
new fe(A.x1, 0),
|
|
9219
|
-
|
|
9219
|
+
M,
|
|
9220
9220
|
Be
|
|
9221
|
-
), Ce = De - Me.X,
|
|
9222
|
-
let se =
|
|
9223
|
-
se = se.translate(Ce,
|
|
9224
|
-
const
|
|
9225
|
-
let ve =
|
|
9221
|
+
), Ce = De - Me.X, Hn = cr - Me.Y;
|
|
9222
|
+
let se = Wu();
|
|
9223
|
+
se = se.translate(Ce, Hn), M && (se = se.translate(A.x1 + Ae / 2, 0), se = se.rotate(M), se = se.translate(-A.x1 - Ae / 2, 0));
|
|
9224
|
+
const Wn = se.toString();
|
|
9225
|
+
let ve = R.toPathData(2);
|
|
9226
9226
|
ve.length && !ve.endsWith("Z") && (ve += "Z", ve = ve.replace(/M/g, "ZM"), ve = ve.substring(1));
|
|
9227
9227
|
let hr;
|
|
9228
9228
|
if (e.svgGlyphs) {
|
|
9229
|
-
const vr = e.svgGlyphs.get(
|
|
9229
|
+
const vr = e.svgGlyphs.get(H.index);
|
|
9230
9230
|
if (vr) {
|
|
9231
|
-
let Ie =
|
|
9232
|
-
Ie =
|
|
9231
|
+
let Ie = Mu(vr.svg);
|
|
9232
|
+
Ie = Pu(Ie, `g${H.index}-${D}`), o && (Ie = Hu(Ie, o)), hr = {
|
|
9233
9233
|
content: Ie,
|
|
9234
9234
|
viewBox: vr.viewbox,
|
|
9235
9235
|
x: A.x1,
|
|
9236
9236
|
y: A.y1,
|
|
9237
9237
|
width: A.x2 - A.x1,
|
|
9238
9238
|
height: A.y2 - A.y1,
|
|
9239
|
-
glyphIndex:
|
|
9239
|
+
glyphIndex: H.index
|
|
9240
9240
|
};
|
|
9241
9241
|
}
|
|
9242
9242
|
}
|
|
9243
|
-
|
|
9244
|
-
path:
|
|
9243
|
+
F.push({
|
|
9244
|
+
path: R,
|
|
9245
9245
|
matrix: se,
|
|
9246
9246
|
attributes: {
|
|
9247
9247
|
d: ve,
|
|
9248
|
-
"data-character":
|
|
9249
|
-
transform:
|
|
9248
|
+
"data-character": zu(t[D]),
|
|
9249
|
+
transform: Wn
|
|
9250
9250
|
},
|
|
9251
9251
|
glyphData: {
|
|
9252
|
-
index:
|
|
9252
|
+
index: H.index,
|
|
9253
9253
|
bbox: A
|
|
9254
9254
|
},
|
|
9255
9255
|
...hr ? { svgGlyph: hr } : {}
|
|
9256
9256
|
});
|
|
9257
9257
|
}
|
|
9258
|
-
return
|
|
9258
|
+
return F;
|
|
9259
9259
|
}, Pt = { hex: "#FFFFFF" }, Pr = (e, r) => {
|
|
9260
9260
|
const t = `data-${e}-colour-url`, n = [`${e}="${r.hex}"`];
|
|
9261
9261
|
return r.reference && n.push(`${t}="${r.reference}"`), n.join(" ");
|
|
9262
9262
|
}, Gt = (e, r) => {
|
|
9263
9263
|
const { attributes: t, svgGlyph: n } = e;
|
|
9264
9264
|
return n ? `<g transform="${t.transform}" data-character="${t["data-character"]}"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="${n.viewBox}" width="${n.width}" height="${n.height}" x="${n.x}" y="${n.y}" data-glyph-index="${n.glyphIndex}">${n.content}</svg></g>` : `<path d="${t.d}" ${Pr("fill", r)} transform="${t.transform}" data-character="${t["data-character"]}"/>`;
|
|
9265
|
-
},
|
|
9265
|
+
}, Vu = ({
|
|
9266
9266
|
boxDimensions: e,
|
|
9267
9267
|
paths: r,
|
|
9268
9268
|
spacing: t = $e,
|
|
@@ -9287,105 +9287,112 @@ const It = (e, r, t) => e / t * r, zu = ({
|
|
|
9287
9287
|
${f}
|
|
9288
9288
|
` : "";
|
|
9289
9289
|
return `<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${u}" viewBox="0 0 ${o} ${u}">${c}</svg>`;
|
|
9290
|
-
},
|
|
9290
|
+
}, Nt = (e) => {
|
|
9291
9291
|
const {
|
|
9292
9292
|
text: r,
|
|
9293
9293
|
font: t,
|
|
9294
9294
|
physicalSize: n,
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9304
|
-
|
|
9295
|
+
fontSize: a,
|
|
9296
|
+
boxDimensions: s,
|
|
9297
|
+
spacing: o = $e,
|
|
9298
|
+
verticalAlignment: u = "centre",
|
|
9299
|
+
baseline: i = "flat",
|
|
9300
|
+
horizontalAlignment: l = "left",
|
|
9301
|
+
fillColour: f = { hex: "#FFFFFF" },
|
|
9302
|
+
strokeColour: c = { hex: "#FFFFFF" },
|
|
9303
|
+
colourMap: p
|
|
9304
|
+
} = e, { width: h, height: d, physicalWidth: g, physicalHeight: m } = s;
|
|
9305
|
+
if (h <= 0 || d <= 0)
|
|
9305
9306
|
throw new Error(
|
|
9306
|
-
`boxDimensions width and height must be positive (got ${
|
|
9307
|
+
`boxDimensions width and height must be positive (got ${h}x${d})`
|
|
9307
9308
|
);
|
|
9308
|
-
if (
|
|
9309
|
+
if (g <= 0 || m <= 0)
|
|
9309
9310
|
throw new Error(
|
|
9310
|
-
`boxDimensions physicalWidth and physicalHeight must be positive (got ${
|
|
9311
|
+
`boxDimensions physicalWidth and physicalHeight must be positive (got ${g}x${m})`
|
|
9311
9312
|
);
|
|
9312
9313
|
if (n[0] <= 0)
|
|
9313
9314
|
throw new Error(
|
|
9314
9315
|
`physicalSize height must be positive (got ${n[0]})`
|
|
9315
9316
|
);
|
|
9316
|
-
const
|
|
9317
|
+
const x = a ?? bu({
|
|
9317
9318
|
font: t,
|
|
9318
|
-
boxDimensions:
|
|
9319
|
+
boxDimensions: s,
|
|
9319
9320
|
physicalSize: n,
|
|
9320
|
-
spacing:
|
|
9321
|
-
}),
|
|
9322
|
-
let
|
|
9323
|
-
`).filter((
|
|
9324
|
-
|
|
9325
|
-
const
|
|
9326
|
-
(
|
|
9327
|
-
),
|
|
9328
|
-
for (let
|
|
9329
|
-
let
|
|
9330
|
-
switch (
|
|
9321
|
+
spacing: o
|
|
9322
|
+
}), U = gu(i);
|
|
9323
|
+
let y = r.split(`
|
|
9324
|
+
`).filter((R) => R.length > 0);
|
|
9325
|
+
y.length || (y = [""]), (U.type === "curved" || U.type === "custom") && (y = [y.join("")]);
|
|
9326
|
+
const L = y.map(
|
|
9327
|
+
(R) => Su({ font: t, text: R, fontSize: x, spacing: o })
|
|
9328
|
+
), w = Math.max(...L.map((R) => R.baseline)), B = Math.max(...L.map((R) => R.height - R.baseline)), C = w + B, F = y.length === 1 ? C : C + C * (y.length - 1) * Bn, D = [];
|
|
9329
|
+
for (let R = 0; R < y.length; R++) {
|
|
9330
|
+
let A;
|
|
9331
|
+
switch (U.type) {
|
|
9331
9332
|
case "custom":
|
|
9332
|
-
|
|
9333
|
+
mu(U.path), A = U.path;
|
|
9333
9334
|
break;
|
|
9334
9335
|
case "curved":
|
|
9335
|
-
|
|
9336
|
-
boxDimensions:
|
|
9337
|
-
baseline:
|
|
9338
|
-
textHeight:
|
|
9339
|
-
verticalAlignment:
|
|
9336
|
+
A = In({
|
|
9337
|
+
boxDimensions: s,
|
|
9338
|
+
baseline: L[R].baseline,
|
|
9339
|
+
textHeight: L[R].height * (1 + Mn),
|
|
9340
|
+
verticalAlignment: u
|
|
9340
9341
|
});
|
|
9341
9342
|
break;
|
|
9342
9343
|
case "flat":
|
|
9343
|
-
|
|
9344
|
-
boxDimensions:
|
|
9345
|
-
totalTextHeight:
|
|
9346
|
-
baseline:
|
|
9347
|
-
lineHeight:
|
|
9348
|
-
verticalAlignment:
|
|
9349
|
-
lineNumber:
|
|
9344
|
+
A = yu({
|
|
9345
|
+
boxDimensions: s,
|
|
9346
|
+
totalTextHeight: F,
|
|
9347
|
+
baseline: w,
|
|
9348
|
+
lineHeight: C,
|
|
9349
|
+
verticalAlignment: u,
|
|
9350
|
+
lineNumber: R
|
|
9350
9351
|
});
|
|
9351
9352
|
break;
|
|
9352
9353
|
}
|
|
9353
|
-
const
|
|
9354
|
+
const H = _u({
|
|
9354
9355
|
font: t,
|
|
9355
|
-
baselinePath:
|
|
9356
|
-
text:
|
|
9357
|
-
fontSize:
|
|
9358
|
-
spacing:
|
|
9359
|
-
horizontalAlignment:
|
|
9360
|
-
colourMap:
|
|
9356
|
+
baselinePath: A,
|
|
9357
|
+
text: y[R],
|
|
9358
|
+
fontSize: x,
|
|
9359
|
+
spacing: o,
|
|
9360
|
+
horizontalAlignment: l,
|
|
9361
|
+
colourMap: p
|
|
9361
9362
|
});
|
|
9362
|
-
|
|
9363
|
-
}
|
|
9364
|
-
return
|
|
9365
|
-
boxDimensions:
|
|
9366
|
-
paths:
|
|
9367
|
-
spacing:
|
|
9368
|
-
fontSize:
|
|
9369
|
-
fillColour:
|
|
9370
|
-
strokeColour:
|
|
9363
|
+
D.push(...H);
|
|
9364
|
+
}
|
|
9365
|
+
return Vu({
|
|
9366
|
+
boxDimensions: s,
|
|
9367
|
+
paths: D,
|
|
9368
|
+
spacing: o,
|
|
9369
|
+
fontSize: x,
|
|
9370
|
+
fillColour: f,
|
|
9371
|
+
strokeColour: c
|
|
9371
9372
|
});
|
|
9372
9373
|
}, Ku = async (e) => {
|
|
9373
|
-
const { fontUrl: r,
|
|
9374
|
-
|
|
9374
|
+
const { fontUrl: r, fontSizeFallback: t, ...n } = e, a = !!n.colourMap, s = await hu(r, a);
|
|
9375
|
+
try {
|
|
9376
|
+
return Nt({ ...n, font: s });
|
|
9377
|
+
} catch (o) {
|
|
9378
|
+
if (t != null && o instanceof Error && o.message.startsWith("TOO_WIDE"))
|
|
9379
|
+
return Nt({ ...n, font: s, fontSize: t });
|
|
9380
|
+
throw o;
|
|
9381
|
+
}
|
|
9375
9382
|
};
|
|
9376
9383
|
export {
|
|
9377
|
-
|
|
9384
|
+
vu as DEFAULT_OUTLINE_FACTOR,
|
|
9378
9385
|
$e as DEFAULT_SPACING,
|
|
9379
|
-
|
|
9380
|
-
|
|
9381
|
-
|
|
9386
|
+
Bn as LINE_HEIGHT,
|
|
9387
|
+
In as generateCurvedBaseline,
|
|
9388
|
+
yu as generateFlatBaseline,
|
|
9382
9389
|
Zu as getFontCache,
|
|
9383
9390
|
Qu as getFontColours,
|
|
9384
|
-
|
|
9391
|
+
bu as getFontSizeFromPhysicalSize,
|
|
9385
9392
|
Ku as getRenderedText,
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9390
|
-
|
|
9393
|
+
Su as getTextMetricsAtFontSize,
|
|
9394
|
+
hu as loadOpentypeFont,
|
|
9395
|
+
gu as normaliseBaselineOption,
|
|
9396
|
+
Nt as renderText,
|
|
9397
|
+
mu as validateCustomBaselinePath
|
|
9391
9398
|
};
|