@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/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { svgPathProperties as
|
|
1
|
+
import { svgPathProperties as _n } from "svg-path-properties";
|
|
2
2
|
String.prototype.codePointAt || (function() {
|
|
3
3
|
var e = (function() {
|
|
4
4
|
try {
|
|
@@ -25,14 +25,14 @@ String.prototype.codePointAt || (function() {
|
|
|
25
25
|
writable: !0
|
|
26
26
|
}) : String.prototype.codePointAt = r;
|
|
27
27
|
})();
|
|
28
|
-
var Pr = 0,
|
|
28
|
+
var Pr = 0, Ht = -3;
|
|
29
29
|
function Ne() {
|
|
30
30
|
this.table = new Uint16Array(16), this.trans = new Uint16Array(288);
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function Vn(e, r) {
|
|
33
33
|
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();
|
|
34
34
|
}
|
|
35
|
-
var
|
|
35
|
+
var Wt = new Ne(), zt = new Ne(), Gr = new Uint8Array(30), Nr = new Uint16Array(30), _t = new Uint8Array(30), Vt = new Uint16Array(30), qn = new Uint8Array([
|
|
36
36
|
16,
|
|
37
37
|
17,
|
|
38
38
|
18,
|
|
@@ -53,7 +53,7 @@ var Ht = new Ne(), Wt = new Ne(), Gr = new Uint8Array(30), Nr = new Uint16Array(
|
|
|
53
53
|
1,
|
|
54
54
|
15
|
|
55
55
|
]), Qr = new Ne(), oe = new Uint8Array(320);
|
|
56
|
-
function
|
|
56
|
+
function qt(e, r, t, n) {
|
|
57
57
|
var a, s;
|
|
58
58
|
for (a = 0; a < t; ++a)
|
|
59
59
|
e[a] = 0;
|
|
@@ -62,7 +62,7 @@ function Vt(e, r, t, n) {
|
|
|
62
62
|
for (s = n, a = 0; a < 30; ++a)
|
|
63
63
|
r[a] = s, s += 1 << e[a];
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function Xn(e, r) {
|
|
66
66
|
var t;
|
|
67
67
|
for (t = 0; t < 7; ++t)
|
|
68
68
|
e.table[t] = 0;
|
|
@@ -91,7 +91,7 @@ function vr(e, r, t, n) {
|
|
|
91
91
|
for (a = 0; a < n; ++a)
|
|
92
92
|
r[t + a] && (e.trans[Kr[r[t + a]]++] = a);
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function Yn(e) {
|
|
95
95
|
e.bitcount-- || (e.tag = e.source[e.sourceIndex++], e.bitcount = 7);
|
|
96
96
|
var r = e.tag & 1;
|
|
97
97
|
return e.tag >>>= 1, r;
|
|
@@ -113,13 +113,13 @@ function Cr(e, r) {
|
|
|
113
113
|
while (n >= 0);
|
|
114
114
|
return e.tag = s, e.bitcount -= a, r.trans[t + n];
|
|
115
115
|
}
|
|
116
|
-
function
|
|
116
|
+
function $n(e, r, t) {
|
|
117
117
|
var n, a, s, o, u, i;
|
|
118
118
|
for (n = ie(e, 5, 257), a = ie(e, 5, 1), s = ie(e, 4, 4), o = 0; o < 19; ++o)
|
|
119
119
|
oe[o] = 0;
|
|
120
120
|
for (o = 0; o < s; ++o) {
|
|
121
121
|
var l = ie(e, 3, 0);
|
|
122
|
-
oe[
|
|
122
|
+
oe[qn[o]] = l;
|
|
123
123
|
}
|
|
124
124
|
for (vr(Qr, oe, 0, 19), u = 0; u < n + a; ) {
|
|
125
125
|
var f = Cr(e, Qr);
|
|
@@ -153,47 +153,47 @@ function jr(e, r, t) {
|
|
|
153
153
|
e.dest[e.destLen++] = n;
|
|
154
154
|
else {
|
|
155
155
|
var a, s, o, u;
|
|
156
|
-
for (n -= 257, a = ie(e, Gr[n], Nr[n]), s = Cr(e, t), o = e.destLen - ie(e,
|
|
156
|
+
for (n -= 257, a = ie(e, Gr[n], Nr[n]), s = Cr(e, t), o = e.destLen - ie(e, _t[s], Vt[s]), u = o; u < o + a; ++u)
|
|
157
157
|
e.dest[e.destLen++] = e.dest[u];
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
function
|
|
161
|
+
function Zn(e) {
|
|
162
162
|
for (var r, t, n; e.bitcount > 8; )
|
|
163
163
|
e.sourceIndex--, e.bitcount -= 8;
|
|
164
164
|
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))
|
|
165
|
-
return
|
|
165
|
+
return Ht;
|
|
166
166
|
for (e.sourceIndex += 4, n = r; n; --n)
|
|
167
167
|
e.dest[e.destLen++] = e.source[e.sourceIndex++];
|
|
168
168
|
return e.bitcount = 0, Pr;
|
|
169
169
|
}
|
|
170
|
-
function
|
|
171
|
-
var t = new
|
|
170
|
+
function Qn(e, r) {
|
|
171
|
+
var t = new Vn(e, r), n, a, s;
|
|
172
172
|
do {
|
|
173
|
-
switch (n =
|
|
173
|
+
switch (n = Yn(t), a = ie(t, 2, 0), a) {
|
|
174
174
|
case 0:
|
|
175
|
-
s =
|
|
175
|
+
s = Zn(t);
|
|
176
176
|
break;
|
|
177
177
|
case 1:
|
|
178
|
-
s = jr(t,
|
|
178
|
+
s = jr(t, Wt, zt);
|
|
179
179
|
break;
|
|
180
180
|
case 2:
|
|
181
|
-
|
|
181
|
+
$n(t, t.ltree, t.dtree), s = jr(t, t.ltree, t.dtree);
|
|
182
182
|
break;
|
|
183
183
|
default:
|
|
184
|
-
s =
|
|
184
|
+
s = Ht;
|
|
185
185
|
}
|
|
186
186
|
if (s !== Pr)
|
|
187
187
|
throw new Error("Data error");
|
|
188
188
|
} while (!n);
|
|
189
189
|
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;
|
|
190
190
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
191
|
+
Xn(Wt, zt);
|
|
192
|
+
qt(Gr, Nr, 4, 3);
|
|
193
|
+
qt(_t, Vt, 2, 1);
|
|
194
194
|
Gr[28] = 0;
|
|
195
195
|
Nr[28] = 258;
|
|
196
|
-
var
|
|
196
|
+
var Kn = Qn;
|
|
197
197
|
function we(e, r, t, n, a) {
|
|
198
198
|
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;
|
|
199
199
|
}
|
|
@@ -224,12 +224,12 @@ he.prototype.addBezier = function(e, r, t, n, a, s, o, u) {
|
|
|
224
224
|
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)));
|
|
225
225
|
continue;
|
|
226
226
|
}
|
|
227
|
-
var
|
|
228
|
-
if (!(
|
|
229
|
-
var
|
|
230
|
-
0 <
|
|
231
|
-
var
|
|
232
|
-
0 <
|
|
227
|
+
var x = Math.pow(h, 2) - 4 * g * d;
|
|
228
|
+
if (!(x < 0)) {
|
|
229
|
+
var U = (-h + Math.sqrt(x)) / (2 * d);
|
|
230
|
+
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)));
|
|
231
|
+
var y = (-h - Math.sqrt(x)) / (2 * d);
|
|
232
|
+
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)));
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
};
|
|
@@ -237,24 +237,24 @@ he.prototype.addQuad = function(e, r, t, n, a, s) {
|
|
|
237
237
|
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);
|
|
238
238
|
this.addBezier(e, r, o, u, i, l, a, s);
|
|
239
239
|
};
|
|
240
|
-
function
|
|
240
|
+
function X() {
|
|
241
241
|
this.commands = [], this.fill = "black", this.stroke = null, this.strokeWidth = 1;
|
|
242
242
|
}
|
|
243
|
-
|
|
243
|
+
X.prototype.moveTo = function(e, r) {
|
|
244
244
|
this.commands.push({
|
|
245
245
|
type: "M",
|
|
246
246
|
x: e,
|
|
247
247
|
y: r
|
|
248
248
|
});
|
|
249
249
|
};
|
|
250
|
-
|
|
250
|
+
X.prototype.lineTo = function(e, r) {
|
|
251
251
|
this.commands.push({
|
|
252
252
|
type: "L",
|
|
253
253
|
x: e,
|
|
254
254
|
y: r
|
|
255
255
|
});
|
|
256
256
|
};
|
|
257
|
-
|
|
257
|
+
X.prototype.curveTo = X.prototype.bezierCurveTo = function(e, r, t, n, a, s) {
|
|
258
258
|
this.commands.push({
|
|
259
259
|
type: "C",
|
|
260
260
|
x1: e,
|
|
@@ -265,7 +265,7 @@ q.prototype.curveTo = q.prototype.bezierCurveTo = function(e, r, t, n, a, s) {
|
|
|
265
265
|
y: s
|
|
266
266
|
});
|
|
267
267
|
};
|
|
268
|
-
|
|
268
|
+
X.prototype.quadTo = X.prototype.quadraticCurveTo = function(e, r, t, n) {
|
|
269
269
|
this.commands.push({
|
|
270
270
|
type: "Q",
|
|
271
271
|
x1: e,
|
|
@@ -274,12 +274,12 @@ q.prototype.quadTo = q.prototype.quadraticCurveTo = function(e, r, t, n) {
|
|
|
274
274
|
y: n
|
|
275
275
|
});
|
|
276
276
|
};
|
|
277
|
-
|
|
277
|
+
X.prototype.close = X.prototype.closePath = function() {
|
|
278
278
|
this.commands.push({
|
|
279
279
|
type: "Z"
|
|
280
280
|
});
|
|
281
281
|
};
|
|
282
|
-
|
|
282
|
+
X.prototype.extend = function(e) {
|
|
283
283
|
if (e.commands)
|
|
284
284
|
e = e.commands;
|
|
285
285
|
else if (e instanceof he) {
|
|
@@ -289,7 +289,7 @@ q.prototype.extend = function(e) {
|
|
|
289
289
|
}
|
|
290
290
|
Array.prototype.push.apply(this.commands, e);
|
|
291
291
|
};
|
|
292
|
-
|
|
292
|
+
X.prototype.getBoundingBox = function() {
|
|
293
293
|
for (var e = new he(), r = 0, t = 0, n = 0, a = 0, s = 0; s < this.commands.length; s++) {
|
|
294
294
|
var o = this.commands[s];
|
|
295
295
|
switch (o.type) {
|
|
@@ -314,7 +314,7 @@ q.prototype.getBoundingBox = function() {
|
|
|
314
314
|
}
|
|
315
315
|
return e.isEmpty() && e.addPoint(0, 0), e;
|
|
316
316
|
};
|
|
317
|
-
|
|
317
|
+
X.prototype.draw = function(e) {
|
|
318
318
|
e.beginPath();
|
|
319
319
|
for (var r = 0; r < this.commands.length; r += 1) {
|
|
320
320
|
var t = this.commands[r];
|
|
@@ -322,7 +322,7 @@ q.prototype.draw = function(e) {
|
|
|
322
322
|
}
|
|
323
323
|
this.fill && (e.fillStyle = this.fill, e.fill()), this.stroke && (e.strokeStyle = this.stroke, e.lineWidth = this.strokeWidth, e.stroke());
|
|
324
324
|
};
|
|
325
|
-
|
|
325
|
+
X.prototype.toPathData = function(e) {
|
|
326
326
|
e = e !== void 0 ? e : 2;
|
|
327
327
|
function r(o) {
|
|
328
328
|
return Math.round(o) === o ? "" + Math.round(o) : o.toFixed(e);
|
|
@@ -340,21 +340,21 @@ q.prototype.toPathData = function(e) {
|
|
|
340
340
|
}
|
|
341
341
|
return n;
|
|
342
342
|
};
|
|
343
|
-
|
|
343
|
+
X.prototype.toSVG = function(e) {
|
|
344
344
|
var r = '<path d="';
|
|
345
345
|
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;
|
|
346
346
|
};
|
|
347
|
-
|
|
347
|
+
X.prototype.toDOMElement = function(e) {
|
|
348
348
|
var r = this.toPathData(e), t = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
349
349
|
return t.setAttribute("d", r), t;
|
|
350
350
|
};
|
|
351
|
-
function
|
|
351
|
+
function Xt(e) {
|
|
352
352
|
throw new Error(e);
|
|
353
353
|
}
|
|
354
354
|
function Jr(e, r) {
|
|
355
|
-
e ||
|
|
355
|
+
e || Xt(r);
|
|
356
356
|
}
|
|
357
|
-
var E = { fail:
|
|
357
|
+
var E = { fail: Xt, argument: Jr, assert: Jr }, et = 32768, rt = 2147483648, Oe = {}, b = {}, O = {};
|
|
358
358
|
function ne(e) {
|
|
359
359
|
return function() {
|
|
360
360
|
return e;
|
|
@@ -363,50 +363,50 @@ function ne(e) {
|
|
|
363
363
|
b.BYTE = function(e) {
|
|
364
364
|
return E.argument(e >= 0 && e <= 255, "Byte value should be between 0 and 255."), [e];
|
|
365
365
|
};
|
|
366
|
-
|
|
366
|
+
O.BYTE = ne(1);
|
|
367
367
|
b.CHAR = function(e) {
|
|
368
368
|
return [e.charCodeAt(0)];
|
|
369
369
|
};
|
|
370
|
-
|
|
370
|
+
O.CHAR = ne(1);
|
|
371
371
|
b.CHARARRAY = function(e) {
|
|
372
372
|
typeof e > "u" && (e = "", console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));
|
|
373
373
|
for (var r = [], t = 0; t < e.length; t += 1)
|
|
374
374
|
r[t] = e.charCodeAt(t);
|
|
375
375
|
return r;
|
|
376
376
|
};
|
|
377
|
-
|
|
377
|
+
O.CHARARRAY = function(e) {
|
|
378
378
|
return typeof e > "u" ? 0 : e.length;
|
|
379
379
|
};
|
|
380
380
|
b.USHORT = function(e) {
|
|
381
381
|
return [e >> 8 & 255, e & 255];
|
|
382
382
|
};
|
|
383
|
-
|
|
383
|
+
O.USHORT = ne(2);
|
|
384
384
|
b.SHORT = function(e) {
|
|
385
385
|
return e >= et && (e = -(2 * et - e)), [e >> 8 & 255, e & 255];
|
|
386
386
|
};
|
|
387
|
-
|
|
387
|
+
O.SHORT = ne(2);
|
|
388
388
|
b.UINT24 = function(e) {
|
|
389
389
|
return [e >> 16 & 255, e >> 8 & 255, e & 255];
|
|
390
390
|
};
|
|
391
|
-
|
|
391
|
+
O.UINT24 = ne(3);
|
|
392
392
|
b.ULONG = function(e) {
|
|
393
393
|
return [e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
|
|
394
394
|
};
|
|
395
|
-
|
|
395
|
+
O.ULONG = ne(4);
|
|
396
396
|
b.LONG = function(e) {
|
|
397
397
|
return e >= rt && (e = -(2 * rt - e)), [e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
|
|
398
398
|
};
|
|
399
|
-
|
|
399
|
+
O.LONG = ne(4);
|
|
400
400
|
b.FIXED = b.ULONG;
|
|
401
|
-
|
|
401
|
+
O.FIXED = O.ULONG;
|
|
402
402
|
b.FWORD = b.SHORT;
|
|
403
|
-
|
|
403
|
+
O.FWORD = O.SHORT;
|
|
404
404
|
b.UFWORD = b.USHORT;
|
|
405
|
-
|
|
405
|
+
O.UFWORD = O.USHORT;
|
|
406
406
|
b.LONGDATETIME = function(e) {
|
|
407
407
|
return [0, 0, 0, 0, e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
|
|
408
408
|
};
|
|
409
|
-
|
|
409
|
+
O.LONGDATETIME = ne(8);
|
|
410
410
|
b.TAG = function(e) {
|
|
411
411
|
return E.argument(e.length === 4, "Tag should be exactly 4 ASCII characters."), [
|
|
412
412
|
e.charCodeAt(0),
|
|
@@ -415,29 +415,29 @@ b.TAG = function(e) {
|
|
|
415
415
|
e.charCodeAt(3)
|
|
416
416
|
];
|
|
417
417
|
};
|
|
418
|
-
|
|
418
|
+
O.TAG = ne(4);
|
|
419
419
|
b.Card8 = b.BYTE;
|
|
420
|
-
|
|
420
|
+
O.Card8 = O.BYTE;
|
|
421
421
|
b.Card16 = b.USHORT;
|
|
422
|
-
|
|
422
|
+
O.Card16 = O.USHORT;
|
|
423
423
|
b.OffSize = b.BYTE;
|
|
424
|
-
|
|
424
|
+
O.OffSize = O.BYTE;
|
|
425
425
|
b.SID = b.USHORT;
|
|
426
|
-
|
|
426
|
+
O.SID = O.USHORT;
|
|
427
427
|
b.NUMBER = function(e) {
|
|
428
428
|
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);
|
|
429
429
|
};
|
|
430
|
-
|
|
430
|
+
O.NUMBER = function(e) {
|
|
431
431
|
return b.NUMBER(e).length;
|
|
432
432
|
};
|
|
433
433
|
b.NUMBER16 = function(e) {
|
|
434
434
|
return [28, e >> 8 & 255, e & 255];
|
|
435
435
|
};
|
|
436
|
-
|
|
436
|
+
O.NUMBER16 = ne(3);
|
|
437
437
|
b.NUMBER32 = function(e) {
|
|
438
438
|
return [29, e >> 24 & 255, e >> 16 & 255, e >> 8 & 255, e & 255];
|
|
439
439
|
};
|
|
440
|
-
|
|
440
|
+
O.NUMBER32 = ne(5);
|
|
441
441
|
b.REAL = function(e) {
|
|
442
442
|
var r = e.toString(), t = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(r);
|
|
443
443
|
if (t) {
|
|
@@ -453,13 +453,13 @@ b.REAL = function(e) {
|
|
|
453
453
|
i.push(parseInt(a.substr(l, 2), 16));
|
|
454
454
|
return i;
|
|
455
455
|
};
|
|
456
|
-
|
|
456
|
+
O.REAL = function(e) {
|
|
457
457
|
return b.REAL(e).length;
|
|
458
458
|
};
|
|
459
459
|
b.NAME = b.CHARARRAY;
|
|
460
|
-
|
|
460
|
+
O.NAME = O.CHARARRAY;
|
|
461
461
|
b.STRING = b.CHARARRAY;
|
|
462
|
-
|
|
462
|
+
O.STRING = O.CHARARRAY;
|
|
463
463
|
Oe.UTF8 = function(e, r, t) {
|
|
464
464
|
for (var n = [], a = t, s = 0; s < a; s++, r += 1)
|
|
465
465
|
n[s] = e.getUint8(r);
|
|
@@ -477,7 +477,7 @@ b.UTF16 = function(e) {
|
|
|
477
477
|
}
|
|
478
478
|
return r;
|
|
479
479
|
};
|
|
480
|
-
|
|
480
|
+
O.UTF16 = function(e) {
|
|
481
481
|
return e.length * 2;
|
|
482
482
|
};
|
|
483
483
|
var wr = {
|
|
@@ -532,7 +532,7 @@ Oe.MACSTRING = function(e, r, t, n) {
|
|
|
532
532
|
return s;
|
|
533
533
|
}
|
|
534
534
|
};
|
|
535
|
-
var Ze = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), Qe,
|
|
535
|
+
var Ze = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), Qe, jn = function(e) {
|
|
536
536
|
if (!Qe) {
|
|
537
537
|
Qe = {};
|
|
538
538
|
for (var r in wr)
|
|
@@ -554,7 +554,7 @@ var Ze = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), Qe, Qn =
|
|
|
554
554
|
}
|
|
555
555
|
};
|
|
556
556
|
b.MACSTRING = function(e, r) {
|
|
557
|
-
var t =
|
|
557
|
+
var t = jn(r);
|
|
558
558
|
if (t !== void 0) {
|
|
559
559
|
for (var n = [], a = 0; a < e.length; a++) {
|
|
560
560
|
var s = e.charCodeAt(a);
|
|
@@ -565,19 +565,19 @@ b.MACSTRING = function(e, r) {
|
|
|
565
565
|
return n;
|
|
566
566
|
}
|
|
567
567
|
};
|
|
568
|
-
|
|
568
|
+
O.MACSTRING = function(e, r) {
|
|
569
569
|
var t = b.MACSTRING(e, r);
|
|
570
570
|
return t !== void 0 ? t.length : 0;
|
|
571
571
|
};
|
|
572
572
|
function Er(e) {
|
|
573
573
|
return e >= -128 && e <= 127;
|
|
574
574
|
}
|
|
575
|
-
function
|
|
575
|
+
function Jn(e, r, t) {
|
|
576
576
|
for (var n = 0, a = e.length; r < a && n < 64 && e[r] === 0; )
|
|
577
577
|
++r, ++n;
|
|
578
578
|
return t.push(128 | n - 1), r;
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function ea(e, r, t) {
|
|
581
581
|
for (var n = 0, a = e.length, s = r; s < a && n < 64; ) {
|
|
582
582
|
var o = e[s];
|
|
583
583
|
if (!Er(o) || o === 0 && s + 1 < a && e[s + 1] === 0)
|
|
@@ -589,7 +589,7 @@ function jn(e, r, t) {
|
|
|
589
589
|
t.push(e[u] + 256 & 255);
|
|
590
590
|
return s;
|
|
591
591
|
}
|
|
592
|
-
function
|
|
592
|
+
function ra(e, r, t) {
|
|
593
593
|
for (var n = 0, a = e.length, s = r; s < a && n < 64; ) {
|
|
594
594
|
var o = e[s];
|
|
595
595
|
if (o === 0 || Er(o) && s + 1 < a && Er(e[s + 1]))
|
|
@@ -606,7 +606,7 @@ function Jn(e, r, t) {
|
|
|
606
606
|
b.VARDELTAS = function(e) {
|
|
607
607
|
for (var r = 0, t = []; r < e.length; ) {
|
|
608
608
|
var n = e[r];
|
|
609
|
-
n === 0 ? r =
|
|
609
|
+
n === 0 ? r = Jn(e, r, t) : n >= -128 && n <= 127 ? r = ea(e, r, t) : r = ra(e, r, t);
|
|
610
610
|
}
|
|
611
611
|
return t;
|
|
612
612
|
};
|
|
@@ -628,7 +628,7 @@ b.INDEX = function(e) {
|
|
|
628
628
|
n
|
|
629
629
|
);
|
|
630
630
|
};
|
|
631
|
-
|
|
631
|
+
O.INDEX = function(e) {
|
|
632
632
|
return b.INDEX(e).length;
|
|
633
633
|
};
|
|
634
634
|
b.DICT = function(e) {
|
|
@@ -638,7 +638,7 @@ b.DICT = function(e) {
|
|
|
638
638
|
}
|
|
639
639
|
return r;
|
|
640
640
|
};
|
|
641
|
-
|
|
641
|
+
O.DICT = function(e) {
|
|
642
642
|
return b.DICT(e).length;
|
|
643
643
|
};
|
|
644
644
|
b.OPERATOR = function(e) {
|
|
@@ -662,7 +662,7 @@ b.OPERAND = function(e, r) {
|
|
|
662
662
|
return t;
|
|
663
663
|
};
|
|
664
664
|
b.OP = b.BYTE;
|
|
665
|
-
|
|
665
|
+
O.OP = O.BYTE;
|
|
666
666
|
var Ke = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap();
|
|
667
667
|
b.CHARSTRING = function(e) {
|
|
668
668
|
if (Ke) {
|
|
@@ -676,15 +676,15 @@ b.CHARSTRING = function(e) {
|
|
|
676
676
|
}
|
|
677
677
|
return Ke && Ke.set(e, t), t;
|
|
678
678
|
};
|
|
679
|
-
|
|
679
|
+
O.CHARSTRING = function(e) {
|
|
680
680
|
return b.CHARSTRING(e).length;
|
|
681
681
|
};
|
|
682
682
|
b.OBJECT = function(e) {
|
|
683
683
|
var r = b[e.type];
|
|
684
684
|
return E.argument(r !== void 0, "No encoding function for type " + e.type), r(e.value);
|
|
685
685
|
};
|
|
686
|
-
|
|
687
|
-
var r =
|
|
686
|
+
O.OBJECT = function(e) {
|
|
687
|
+
var r = O[e.type];
|
|
688
688
|
return E.argument(r !== void 0, "No sizeOf function for type " + e.type), r(e.value);
|
|
689
689
|
};
|
|
690
690
|
b.TABLE = function(e) {
|
|
@@ -702,9 +702,9 @@ b.TABLE = function(e) {
|
|
|
702
702
|
}
|
|
703
703
|
return r;
|
|
704
704
|
};
|
|
705
|
-
|
|
705
|
+
O.TABLE = function(e) {
|
|
706
706
|
for (var r = 0, t = e.fields.length, n = 0; n < t; n += 1) {
|
|
707
|
-
var a = e.fields[n], s =
|
|
707
|
+
var a = e.fields[n], s = O[a.type];
|
|
708
708
|
E.argument(s !== void 0, "No sizeOf function for field type " + a.type + " (" + a.name + ")");
|
|
709
709
|
var o = e[a.name];
|
|
710
710
|
o === void 0 && (o = a.value), r += s(o), a.type === "TABLE" && (r += 2);
|
|
@@ -712,11 +712,11 @@ L.TABLE = function(e) {
|
|
|
712
712
|
return r;
|
|
713
713
|
};
|
|
714
714
|
b.RECORD = b.TABLE;
|
|
715
|
-
|
|
715
|
+
O.RECORD = O.TABLE;
|
|
716
716
|
b.LITERAL = function(e) {
|
|
717
717
|
return e;
|
|
718
718
|
};
|
|
719
|
-
|
|
719
|
+
O.LITERAL = function(e) {
|
|
720
720
|
return e.length;
|
|
721
721
|
};
|
|
722
722
|
function Z(e, r, t) {
|
|
@@ -735,7 +735,7 @@ Z.prototype.encode = function() {
|
|
|
735
735
|
return b.TABLE(this);
|
|
736
736
|
};
|
|
737
737
|
Z.prototype.sizeOf = function() {
|
|
738
|
-
return
|
|
738
|
+
return O.TABLE(this);
|
|
739
739
|
};
|
|
740
740
|
function He(e, r, t) {
|
|
741
741
|
t === void 0 && (t = r.length);
|
|
@@ -852,37 +852,37 @@ function tt(e, r) {
|
|
|
852
852
|
function or(e, r) {
|
|
853
853
|
return e.getUint16(r, !1);
|
|
854
854
|
}
|
|
855
|
-
function
|
|
855
|
+
function ta(e, r) {
|
|
856
856
|
return e.getInt16(r, !1);
|
|
857
857
|
}
|
|
858
858
|
function Hr(e, r) {
|
|
859
859
|
return e.getUint32(r, !1);
|
|
860
860
|
}
|
|
861
|
-
function
|
|
861
|
+
function Yt(e, r) {
|
|
862
862
|
var t = e.getInt16(r, !1), n = e.getUint16(r + 2, !1);
|
|
863
863
|
return t + n / 65535;
|
|
864
864
|
}
|
|
865
|
-
function
|
|
865
|
+
function na(e, r) {
|
|
866
866
|
for (var t = "", n = r; n < r + 4; n += 1)
|
|
867
867
|
t += String.fromCharCode(e.getInt8(n));
|
|
868
868
|
return t;
|
|
869
869
|
}
|
|
870
|
-
function
|
|
870
|
+
function aa(e, r, t) {
|
|
871
871
|
for (var n = 0, a = 0; a < t; a += 1)
|
|
872
872
|
n <<= 8, n += e.getUint8(r + a);
|
|
873
873
|
return n;
|
|
874
874
|
}
|
|
875
|
-
function
|
|
875
|
+
function sa(e, r, t) {
|
|
876
876
|
for (var n = [], a = r; a < t; a += 1)
|
|
877
877
|
n.push(e.getUint8(a));
|
|
878
878
|
return n;
|
|
879
879
|
}
|
|
880
|
-
function
|
|
880
|
+
function oa(e) {
|
|
881
881
|
for (var r = "", t = 0; t < e.length; t += 1)
|
|
882
882
|
r += String.fromCharCode(e[t]);
|
|
883
883
|
return r;
|
|
884
884
|
}
|
|
885
|
-
var
|
|
885
|
+
var ia = {
|
|
886
886
|
byte: 1,
|
|
887
887
|
uShort: 2,
|
|
888
888
|
short: 2,
|
|
@@ -924,7 +924,7 @@ v.prototype.parseULong = function() {
|
|
|
924
924
|
};
|
|
925
925
|
v.prototype.parseOffset32 = v.prototype.parseULong;
|
|
926
926
|
v.prototype.parseFixed = function() {
|
|
927
|
-
var e =
|
|
927
|
+
var e = Yt(this.data, this.offset + this.relativeOffset);
|
|
928
928
|
return this.relativeOffset += 4, e;
|
|
929
929
|
};
|
|
930
930
|
v.prototype.parseString = function(e) {
|
|
@@ -946,7 +946,7 @@ v.prototype.parseVersion = function(e) {
|
|
|
946
946
|
return this.relativeOffset += 4, e === void 0 && (e = 4096), r + t / e / 10;
|
|
947
947
|
};
|
|
948
948
|
v.prototype.skip = function(e, r) {
|
|
949
|
-
r === void 0 && (r = 1), this.relativeOffset +=
|
|
949
|
+
r === void 0 && (r = 1), this.relativeOffset += ia[e] * r;
|
|
950
950
|
};
|
|
951
951
|
v.prototype.parseULongList = function(e) {
|
|
952
952
|
e === void 0 && (e = this.parseULong());
|
|
@@ -1184,16 +1184,16 @@ var k = {
|
|
|
1184
1184
|
getCard8: tt,
|
|
1185
1185
|
getUShort: or,
|
|
1186
1186
|
getCard16: or,
|
|
1187
|
-
getShort:
|
|
1187
|
+
getShort: ta,
|
|
1188
1188
|
getULong: Hr,
|
|
1189
|
-
getFixed:
|
|
1190
|
-
getTag:
|
|
1191
|
-
getOffset:
|
|
1192
|
-
getBytes:
|
|
1193
|
-
bytesToString:
|
|
1189
|
+
getFixed: Yt,
|
|
1190
|
+
getTag: na,
|
|
1191
|
+
getOffset: aa,
|
|
1192
|
+
getBytes: sa,
|
|
1193
|
+
bytesToString: oa,
|
|
1194
1194
|
Parser: v
|
|
1195
1195
|
};
|
|
1196
|
-
function
|
|
1196
|
+
function ua(e, r) {
|
|
1197
1197
|
r.parseUShort(), e.length = r.parseULong(), e.language = r.parseULong();
|
|
1198
1198
|
var t;
|
|
1199
1199
|
e.groupCount = t = r.parseULong(), e.glyphIndexMap = {};
|
|
@@ -1201,15 +1201,15 @@ function oa(e, r) {
|
|
|
1201
1201
|
for (var a = r.parseULong(), s = r.parseULong(), o = r.parseULong(), u = a; u <= s; u += 1)
|
|
1202
1202
|
e.glyphIndexMap[u] = o, o++;
|
|
1203
1203
|
}
|
|
1204
|
-
function
|
|
1204
|
+
function la(e, r, t, n, a) {
|
|
1205
1205
|
e.length = r.parseUShort(), e.language = r.parseUShort();
|
|
1206
1206
|
var s;
|
|
1207
1207
|
e.segCount = s = r.parseUShort() >> 1, r.skip("uShort", 3), e.glyphIndexMap = {};
|
|
1208
1208
|
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)
|
|
1209
|
-
for (var p = void 0, h = o.parseUShort(), d = u.parseUShort(), g = i.parseShort(), m = l.parseUShort(),
|
|
1210
|
-
m !== 0 ? (f = l.offset + l.relativeOffset - 2, f += m, f += (
|
|
1209
|
+
for (var p = void 0, h = o.parseUShort(), d = u.parseUShort(), g = i.parseShort(), m = l.parseUShort(), x = d; x <= h; x += 1)
|
|
1210
|
+
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;
|
|
1211
1211
|
}
|
|
1212
|
-
function
|
|
1212
|
+
function fa(e, r) {
|
|
1213
1213
|
var t = {};
|
|
1214
1214
|
t.version = k.getUShort(e, r), E.argument(t.version === 0, "cmap table version should be 0."), t.numTables = k.getUShort(e, r + 2);
|
|
1215
1215
|
for (var n = -1, a = t.numTables - 1; a >= 0; a -= 1) {
|
|
@@ -1223,14 +1223,14 @@ function ua(e, r) {
|
|
|
1223
1223
|
throw new Error("No valid cmap sub-tables found.");
|
|
1224
1224
|
var u = new k.Parser(e, r + n);
|
|
1225
1225
|
if (t.format = u.parseUShort(), t.format === 12)
|
|
1226
|
-
|
|
1226
|
+
ua(t, u);
|
|
1227
1227
|
else if (t.format === 4)
|
|
1228
|
-
|
|
1228
|
+
la(t, u, e, r, n);
|
|
1229
1229
|
else
|
|
1230
1230
|
throw new Error("Only format 4 and 12 cmap tables are supported (found format " + t.format + ").");
|
|
1231
1231
|
return t;
|
|
1232
1232
|
}
|
|
1233
|
-
function
|
|
1233
|
+
function pa(e, r, t) {
|
|
1234
1234
|
e.segments.push({
|
|
1235
1235
|
end: r,
|
|
1236
1236
|
start: r,
|
|
@@ -1239,7 +1239,7 @@ function la(e, r, t) {
|
|
|
1239
1239
|
glyphIndex: t
|
|
1240
1240
|
});
|
|
1241
1241
|
}
|
|
1242
|
-
function
|
|
1242
|
+
function ca(e) {
|
|
1243
1243
|
e.segments.push({
|
|
1244
1244
|
end: 65535,
|
|
1245
1245
|
start: 65535,
|
|
@@ -1247,7 +1247,7 @@ function fa(e) {
|
|
|
1247
1247
|
offset: 0
|
|
1248
1248
|
});
|
|
1249
1249
|
}
|
|
1250
|
-
function
|
|
1250
|
+
function ha(e) {
|
|
1251
1251
|
var r = !0, t;
|
|
1252
1252
|
for (t = e.length - 1; t > 0; t -= 1) {
|
|
1253
1253
|
var n = e.get(t);
|
|
@@ -1283,12 +1283,12 @@ function pa(e) {
|
|
|
1283
1283
|
var s = new S.Table("cmap", a);
|
|
1284
1284
|
for (s.segments = [], t = 0; t < e.length; t += 1) {
|
|
1285
1285
|
for (var o = e.get(t), u = 0; u < o.unicodes.length; u += 1)
|
|
1286
|
-
|
|
1287
|
-
s.segments = s.segments.sort(function(
|
|
1288
|
-
return
|
|
1286
|
+
pa(s, o.unicodes[u], t);
|
|
1287
|
+
s.segments = s.segments.sort(function(U, y) {
|
|
1288
|
+
return U.start - y.start;
|
|
1289
1289
|
});
|
|
1290
1290
|
}
|
|
1291
|
-
|
|
1291
|
+
ca(s);
|
|
1292
1292
|
var i = s.segments.length, l = 0, f = [], c = [], p = [], h = [], d = [], g = [];
|
|
1293
1293
|
for (t = 0; t < i; t += 1) {
|
|
1294
1294
|
var m = s.segments[t];
|
|
@@ -1297,19 +1297,19 @@ function pa(e) {
|
|
|
1297
1297
|
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
|
|
1298
1298
|
f.length * 2 + 2 + // reservedPad
|
|
1299
1299
|
c.length * 2 + p.length * 2 + h.length * 2 + d.length * 2, !r) {
|
|
1300
|
-
var
|
|
1300
|
+
var x = 16 + // Subtable header
|
|
1301
1301
|
g.length * 4;
|
|
1302
1302
|
s.cmap12Offset = 20 + s.cmap4Length, s.fields = s.fields.concat([
|
|
1303
1303
|
{ name: "cmap12Format", type: "USHORT", value: 12 },
|
|
1304
1304
|
{ name: "cmap12Reserved", type: "USHORT", value: 0 },
|
|
1305
|
-
{ name: "cmap12Length", type: "ULONG", value:
|
|
1305
|
+
{ name: "cmap12Length", type: "ULONG", value: x },
|
|
1306
1306
|
{ name: "cmap12Language", type: "ULONG", value: 0 },
|
|
1307
1307
|
{ name: "cmap12nGroups", type: "ULONG", value: g.length / 3 }
|
|
1308
1308
|
]), s.fields = s.fields.concat(g);
|
|
1309
1309
|
}
|
|
1310
1310
|
return s;
|
|
1311
1311
|
}
|
|
1312
|
-
var
|
|
1312
|
+
var $t = { parse: fa, make: ha }, er = [
|
|
1313
1313
|
".notdef",
|
|
1314
1314
|
"space",
|
|
1315
1315
|
"exclam",
|
|
@@ -1701,7 +1701,7 @@ var Yt = { parse: ua, make: pa }, er = [
|
|
|
1701
1701
|
"Regular",
|
|
1702
1702
|
"Roman",
|
|
1703
1703
|
"Semibold"
|
|
1704
|
-
],
|
|
1704
|
+
], va = [
|
|
1705
1705
|
"",
|
|
1706
1706
|
"",
|
|
1707
1707
|
"",
|
|
@@ -1954,7 +1954,7 @@ var Yt = { parse: ua, make: pa }, er = [
|
|
|
1954
1954
|
"oslash",
|
|
1955
1955
|
"oe",
|
|
1956
1956
|
"germandbls"
|
|
1957
|
-
],
|
|
1957
|
+
], da = [
|
|
1958
1958
|
"",
|
|
1959
1959
|
"",
|
|
1960
1960
|
"",
|
|
@@ -2470,10 +2470,10 @@ var Yt = { parse: ua, make: pa }, er = [
|
|
|
2470
2470
|
"ccaron",
|
|
2471
2471
|
"dcroat"
|
|
2472
2472
|
];
|
|
2473
|
-
function
|
|
2473
|
+
function Zt(e) {
|
|
2474
2474
|
this.font = e;
|
|
2475
2475
|
}
|
|
2476
|
-
|
|
2476
|
+
Zt.prototype.charToGlyphIndex = function(e) {
|
|
2477
2477
|
var r = e.codePointAt(0), t = this.font.glyphs;
|
|
2478
2478
|
if (t) {
|
|
2479
2479
|
for (var n = 0; n < t.length; n += 1)
|
|
@@ -2483,10 +2483,10 @@ $t.prototype.charToGlyphIndex = function(e) {
|
|
|
2483
2483
|
}
|
|
2484
2484
|
return null;
|
|
2485
2485
|
};
|
|
2486
|
-
function
|
|
2486
|
+
function Qt(e) {
|
|
2487
2487
|
this.cmap = e;
|
|
2488
2488
|
}
|
|
2489
|
-
|
|
2489
|
+
Qt.prototype.charToGlyphIndex = function(e) {
|
|
2490
2490
|
return this.cmap.glyphIndexMap[e.codePointAt(0)] || 0;
|
|
2491
2491
|
};
|
|
2492
2492
|
function ir(e, r) {
|
|
@@ -2525,7 +2525,7 @@ Wr.prototype.nameToGlyphIndex = function(e) {
|
|
|
2525
2525
|
Wr.prototype.glyphIndexToName = function(e) {
|
|
2526
2526
|
return this.names[e];
|
|
2527
2527
|
};
|
|
2528
|
-
function
|
|
2528
|
+
function ga(e) {
|
|
2529
2529
|
for (var r, t = e.tables.cmap.glyphIndexMap, n = Object.keys(t), a = 0; a < n.length; a += 1) {
|
|
2530
2530
|
var s = n[a], o = t[s];
|
|
2531
2531
|
r = e.glyphs.get(o), r.addUnicode(parseInt(s));
|
|
@@ -2533,7 +2533,7 @@ function va(e) {
|
|
|
2533
2533
|
for (var u = 0; u < e.glyphs.length; u += 1)
|
|
2534
2534
|
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));
|
|
2535
2535
|
}
|
|
2536
|
-
function
|
|
2536
|
+
function ma(e) {
|
|
2537
2537
|
e._IndexToUnicodeMap = {};
|
|
2538
2538
|
for (var r = e.tables.cmap.glyphIndexMap, t = Object.keys(r), n = 0; n < t.length; n += 1) {
|
|
2539
2539
|
var a = t[n], s = r[a];
|
|
@@ -2542,15 +2542,15 @@ function da(e) {
|
|
|
2542
2542
|
} : e._IndexToUnicodeMap[s].unicodes.push(parseInt(a));
|
|
2543
2543
|
}
|
|
2544
2544
|
}
|
|
2545
|
-
function
|
|
2546
|
-
r.lowMemory ?
|
|
2545
|
+
function ya(e, r) {
|
|
2546
|
+
r.lowMemory ? ma(e) : ga(e);
|
|
2547
2547
|
}
|
|
2548
|
-
function
|
|
2548
|
+
function xa(e, r, t, n, a) {
|
|
2549
2549
|
e.beginPath(), e.moveTo(r, t), e.lineTo(n, a), e.stroke();
|
|
2550
2550
|
}
|
|
2551
|
-
var Te = { line:
|
|
2552
|
-
function
|
|
2553
|
-
var t = r || new
|
|
2551
|
+
var Te = { line: xa };
|
|
2552
|
+
function ba(e, r) {
|
|
2553
|
+
var t = r || new X();
|
|
2554
2554
|
return {
|
|
2555
2555
|
configurable: !0,
|
|
2556
2556
|
get: function() {
|
|
@@ -2565,7 +2565,7 @@ function K(e) {
|
|
|
2565
2565
|
this.bindConstructorValues(e);
|
|
2566
2566
|
}
|
|
2567
2567
|
K.prototype.bindConstructorValues = function(e) {
|
|
2568
|
-
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",
|
|
2568
|
+
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", ba(this, e.path));
|
|
2569
2569
|
};
|
|
2570
2570
|
K.prototype.addUnicode = function(e) {
|
|
2571
2571
|
this.unicodes.length === 0 && (this.unicode = e), this.unicodes.push(e);
|
|
@@ -2585,7 +2585,7 @@ K.prototype.getPath = function(e, r, t, n, a) {
|
|
|
2585
2585
|
var l = 1 / (this.path.unitsPerEm || 1e3) * t;
|
|
2586
2586
|
u === void 0 && (u = l), i === void 0 && (i = l);
|
|
2587
2587
|
}
|
|
2588
|
-
for (var f = new
|
|
2588
|
+
for (var f = new X(), c = 0; c < s.length; c += 1) {
|
|
2589
2589
|
var p = s[c];
|
|
2590
2590
|
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(
|
|
2591
2591
|
e + p.x1 * u,
|
|
@@ -2684,10 +2684,10 @@ zr.prototype.get = function(e) {
|
|
|
2684
2684
|
zr.prototype.push = function(e, r) {
|
|
2685
2685
|
this.glyphs[e] = r, this.length++;
|
|
2686
2686
|
};
|
|
2687
|
-
function
|
|
2687
|
+
function Sa(e, r) {
|
|
2688
2688
|
return new K({ index: r, font: e });
|
|
2689
2689
|
}
|
|
2690
|
-
function
|
|
2690
|
+
function Ta(e, r, t, n, a, s) {
|
|
2691
2691
|
return function() {
|
|
2692
2692
|
var o = new K({ index: r, font: e });
|
|
2693
2693
|
return o.path = function() {
|
|
@@ -2697,7 +2697,7 @@ function ba(e, r, t, n, a, s) {
|
|
|
2697
2697
|
}, je(o, "xMin", "_xMin"), je(o, "xMax", "_xMax"), je(o, "yMin", "_yMin"), je(o, "yMax", "_yMax"), o;
|
|
2698
2698
|
};
|
|
2699
2699
|
}
|
|
2700
|
-
function
|
|
2700
|
+
function ka(e, r, t, n) {
|
|
2701
2701
|
return function() {
|
|
2702
2702
|
var a = new K({ index: r, font: e });
|
|
2703
2703
|
return a.path = function() {
|
|
@@ -2706,15 +2706,15 @@ function Sa(e, r, t, n) {
|
|
|
2706
2706
|
}, a;
|
|
2707
2707
|
};
|
|
2708
2708
|
}
|
|
2709
|
-
var le = { GlyphSet: zr, glyphLoader:
|
|
2710
|
-
function
|
|
2709
|
+
var le = { GlyphSet: zr, glyphLoader: Sa, ttfGlyphLoader: Ta, cffGlyphLoader: ka };
|
|
2710
|
+
function Kt(e, r) {
|
|
2711
2711
|
if (e === r)
|
|
2712
2712
|
return !0;
|
|
2713
2713
|
if (Array.isArray(e) && Array.isArray(r)) {
|
|
2714
2714
|
if (e.length !== r.length)
|
|
2715
2715
|
return !1;
|
|
2716
2716
|
for (var t = 0; t < e.length; t += 1)
|
|
2717
|
-
if (!
|
|
2717
|
+
if (!Kt(e[t], r[t]))
|
|
2718
2718
|
return !1;
|
|
2719
2719
|
return !0;
|
|
2720
2720
|
} else
|
|
@@ -2740,7 +2740,7 @@ function ye(e, r, t) {
|
|
|
2740
2740
|
}
|
|
2741
2741
|
return { objects: a, startOffset: r, endOffset: u };
|
|
2742
2742
|
}
|
|
2743
|
-
function
|
|
2743
|
+
function Fa(e, r) {
|
|
2744
2744
|
var t = [], n = k.getCard16(e, r), a, s;
|
|
2745
2745
|
if (n !== 0) {
|
|
2746
2746
|
var o = k.getByte(e, r + 2);
|
|
@@ -2752,7 +2752,7 @@ function Ta(e, r) {
|
|
|
2752
2752
|
s = r + 2;
|
|
2753
2753
|
return { offsets: t, startOffset: r, endOffset: s };
|
|
2754
2754
|
}
|
|
2755
|
-
function
|
|
2755
|
+
function Ua(e, r, t, n, a) {
|
|
2756
2756
|
var s = k.getCard16(t, n), o = 0;
|
|
2757
2757
|
if (s !== 0) {
|
|
2758
2758
|
var u = k.getByte(t, n + 2);
|
|
@@ -2761,7 +2761,7 @@ function ka(e, r, t, n, a) {
|
|
|
2761
2761
|
var i = k.getBytes(t, o + r[e], o + r[e + 1]);
|
|
2762
2762
|
return i;
|
|
2763
2763
|
}
|
|
2764
|
-
function
|
|
2764
|
+
function Ca(e) {
|
|
2765
2765
|
for (var r = "", t = 15, n = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"]; ; ) {
|
|
2766
2766
|
var a = e.parseByte(), s = a >> 4, o = a & 15;
|
|
2767
2767
|
if (s === t || (r += n[s], o === t))
|
|
@@ -2770,14 +2770,14 @@ function Fa(e) {
|
|
|
2770
2770
|
}
|
|
2771
2771
|
return parseFloat(r);
|
|
2772
2772
|
}
|
|
2773
|
-
function
|
|
2773
|
+
function wa(e, r) {
|
|
2774
2774
|
var t, n, a, s;
|
|
2775
2775
|
if (r === 28)
|
|
2776
2776
|
return t = e.parseByte(), n = e.parseByte(), t << 8 | n;
|
|
2777
2777
|
if (r === 29)
|
|
2778
2778
|
return t = e.parseByte(), n = e.parseByte(), a = e.parseByte(), s = e.parseByte(), t << 24 | n << 16 | a << 8 | s;
|
|
2779
2779
|
if (r === 30)
|
|
2780
|
-
return
|
|
2780
|
+
return Ca(e);
|
|
2781
2781
|
if (r >= 32 && r <= 246)
|
|
2782
2782
|
return r - 139;
|
|
2783
2783
|
if (r >= 247 && r <= 250)
|
|
@@ -2786,7 +2786,7 @@ function Ua(e, r) {
|
|
|
2786
2786
|
return t = e.parseByte(), -(r - 251) * 256 - t - 108;
|
|
2787
2787
|
throw new Error("Invalid b0 " + r);
|
|
2788
2788
|
}
|
|
2789
|
-
function
|
|
2789
|
+
function Ea(e) {
|
|
2790
2790
|
for (var r = {}, t = 0; t < e.length; t += 1) {
|
|
2791
2791
|
var n = e[t][0], a = e[t][1], s = void 0;
|
|
2792
2792
|
if (a.length === 1 ? s = a[0] : s = a, r.hasOwnProperty(n) && !isNaN(r[n]))
|
|
@@ -2795,19 +2795,19 @@ function Ca(e) {
|
|
|
2795
2795
|
}
|
|
2796
2796
|
return r;
|
|
2797
2797
|
}
|
|
2798
|
-
function
|
|
2798
|
+
function jt(e, r, t) {
|
|
2799
2799
|
r = r !== void 0 ? r : 0;
|
|
2800
2800
|
var n = new k.Parser(e, r), a = [], s = [];
|
|
2801
2801
|
for (t = t !== void 0 ? t : e.length; n.relativeOffset < t; ) {
|
|
2802
2802
|
var o = n.parseByte();
|
|
2803
|
-
o <= 21 ? (o === 12 && (o = 1200 + n.parseByte()), a.push([o, s]), s = []) : s.push(
|
|
2803
|
+
o <= 21 ? (o === 12 && (o = 1200 + n.parseByte()), a.push([o, s]), s = []) : s.push(wa(n, o));
|
|
2804
2804
|
}
|
|
2805
|
-
return
|
|
2805
|
+
return Ea(a);
|
|
2806
2806
|
}
|
|
2807
2807
|
function Ge(e, r) {
|
|
2808
2808
|
return r <= 390 ? r = er[r] : r = e[r - 391], r;
|
|
2809
2809
|
}
|
|
2810
|
-
function
|
|
2810
|
+
function Jt(e, r, t) {
|
|
2811
2811
|
for (var n = {}, a, s = 0; s < r.length; s += 1) {
|
|
2812
2812
|
var o = r[s];
|
|
2813
2813
|
if (Array.isArray(o.type)) {
|
|
@@ -2821,11 +2821,11 @@ function jt(e, r, t) {
|
|
|
2821
2821
|
}
|
|
2822
2822
|
return n;
|
|
2823
2823
|
}
|
|
2824
|
-
function
|
|
2824
|
+
function Oa(e, r) {
|
|
2825
2825
|
var t = {};
|
|
2826
2826
|
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;
|
|
2827
2827
|
}
|
|
2828
|
-
var
|
|
2828
|
+
var en = [
|
|
2829
2829
|
{ name: "version", op: 0, type: "SID" },
|
|
2830
2830
|
{ name: "notice", op: 1, type: "SID" },
|
|
2831
2831
|
{ name: "copyright", op: 1200, type: "SID" },
|
|
@@ -2861,26 +2861,26 @@ var Jt = [
|
|
|
2861
2861
|
{ name: "fdArray", op: 1236, type: "offset" },
|
|
2862
2862
|
{ name: "fdSelect", op: 1237, type: "offset" },
|
|
2863
2863
|
{ name: "fontName", op: 1238, type: "SID" }
|
|
2864
|
-
],
|
|
2864
|
+
], rn = [
|
|
2865
2865
|
{ name: "subrs", op: 19, type: "offset", value: 0 },
|
|
2866
2866
|
{ name: "defaultWidthX", op: 20, type: "number", value: 0 },
|
|
2867
2867
|
{ name: "nominalWidthX", op: 21, type: "number", value: 0 }
|
|
2868
2868
|
];
|
|
2869
|
-
function
|
|
2870
|
-
var t =
|
|
2871
|
-
return
|
|
2869
|
+
function La(e, r) {
|
|
2870
|
+
var t = jt(e, 0, e.byteLength);
|
|
2871
|
+
return Jt(t, en, r);
|
|
2872
2872
|
}
|
|
2873
|
-
function
|
|
2874
|
-
var a =
|
|
2875
|
-
return
|
|
2873
|
+
function tn(e, r, t, n) {
|
|
2874
|
+
var a = jt(e, r, t);
|
|
2875
|
+
return Jt(a, rn, n);
|
|
2876
2876
|
}
|
|
2877
2877
|
function at(e, r, t, n) {
|
|
2878
2878
|
for (var a = [], s = 0; s < t.length; s += 1) {
|
|
2879
|
-
var o = new DataView(new Uint8Array(t[s]).buffer), u =
|
|
2879
|
+
var o = new DataView(new Uint8Array(t[s]).buffer), u = La(o, n);
|
|
2880
2880
|
u._subrs = [], u._subrsBias = 0, u._defaultWidthX = 0, u._nominalWidthX = 0;
|
|
2881
2881
|
var i = u.private[0], l = u.private[1];
|
|
2882
2882
|
if (i !== 0 && l !== 0) {
|
|
2883
|
-
var f =
|
|
2883
|
+
var f = tn(e, l + r, i, n);
|
|
2884
2884
|
if (u._defaultWidthX = f.defaultWidthX, u._nominalWidthX = f.nominalWidthX, f.subrs !== 0) {
|
|
2885
2885
|
var c = l + f.subrs, p = ye(e, c + r);
|
|
2886
2886
|
u._subrs = p.objects, u._subrsBias = Lr(u._subrs);
|
|
@@ -2891,7 +2891,7 @@ function at(e, r, t, n) {
|
|
|
2891
2891
|
}
|
|
2892
2892
|
return a;
|
|
2893
2893
|
}
|
|
2894
|
-
function
|
|
2894
|
+
function Ra(e, r, t, n) {
|
|
2895
2895
|
var a, s, o = new k.Parser(e, r);
|
|
2896
2896
|
t -= 1;
|
|
2897
2897
|
var u = [".notdef"], i = o.parseCard8();
|
|
@@ -2914,7 +2914,7 @@ function Oa(e, r, t, n) {
|
|
|
2914
2914
|
throw new Error("Unknown charset format " + i);
|
|
2915
2915
|
return u;
|
|
2916
2916
|
}
|
|
2917
|
-
function
|
|
2917
|
+
function Da(e, r, t) {
|
|
2918
2918
|
var n, a = {}, s = new k.Parser(e, r), o = s.parseCard8();
|
|
2919
2919
|
if (o === 0)
|
|
2920
2920
|
for (var u = s.parseCard8(), i = 0; i < u; i += 1)
|
|
@@ -2930,32 +2930,32 @@ function La(e, r, t) {
|
|
|
2930
2930
|
return new ir(a, t);
|
|
2931
2931
|
}
|
|
2932
2932
|
function st(e, r, t) {
|
|
2933
|
-
var n, a, s, o, u = new
|
|
2933
|
+
var n, a, s, o, u = new X(), i = [], l = 0, f = !1, c = !1, p = 0, h = 0, d, g, m, x;
|
|
2934
2934
|
if (e.isCIDFont) {
|
|
2935
|
-
var
|
|
2936
|
-
d =
|
|
2935
|
+
var U = e.tables.cff.topDict._fdSelect[r.index], y = e.tables.cff.topDict._fdArray[U];
|
|
2936
|
+
d = y._subrs, g = y._subrsBias, m = y._defaultWidthX, x = y._nominalWidthX;
|
|
2937
2937
|
} else
|
|
2938
|
-
d = e.tables.cff.topDict._subrs, g = e.tables.cff.topDict._subrsBias, m = e.tables.cff.topDict._defaultWidthX,
|
|
2939
|
-
var
|
|
2940
|
-
function w(
|
|
2941
|
-
c && u.closePath(), u.moveTo(
|
|
2942
|
-
}
|
|
2943
|
-
function
|
|
2944
|
-
var
|
|
2945
|
-
|
|
2946
|
-
}
|
|
2947
|
-
function C(
|
|
2948
|
-
for (var
|
|
2949
|
-
var
|
|
2950
|
-
switch (
|
|
2938
|
+
d = e.tables.cff.topDict._subrs, g = e.tables.cff.topDict._subrsBias, m = e.tables.cff.topDict._defaultWidthX, x = e.tables.cff.topDict._nominalWidthX;
|
|
2939
|
+
var L = m;
|
|
2940
|
+
function w(F, D) {
|
|
2941
|
+
c && u.closePath(), u.moveTo(F, D), c = !0;
|
|
2942
|
+
}
|
|
2943
|
+
function B() {
|
|
2944
|
+
var F;
|
|
2945
|
+
F = i.length % 2 !== 0, F && !f && (L = i.shift() + x), l += i.length >> 1, i.length = 0, f = !0;
|
|
2946
|
+
}
|
|
2947
|
+
function C(F) {
|
|
2948
|
+
for (var D, R, A, H, Q, G, z, Y, _, P, V, $, M = 0; M < F.length; ) {
|
|
2949
|
+
var q = F[M];
|
|
2950
|
+
switch (M += 1, q) {
|
|
2951
2951
|
case 1:
|
|
2952
|
-
|
|
2952
|
+
B();
|
|
2953
2953
|
break;
|
|
2954
2954
|
case 3:
|
|
2955
|
-
|
|
2955
|
+
B();
|
|
2956
2956
|
break;
|
|
2957
2957
|
case 4:
|
|
2958
|
-
i.length > 1 && !f && (
|
|
2958
|
+
i.length > 1 && !f && (L = i.shift() + x, f = !0), h += i.pop(), w(p, h);
|
|
2959
2959
|
break;
|
|
2960
2960
|
case 5:
|
|
2961
2961
|
for (; i.length > 0; )
|
|
@@ -2979,42 +2979,42 @@ function st(e, r, t) {
|
|
|
2979
2979
|
case 11:
|
|
2980
2980
|
return;
|
|
2981
2981
|
case 12:
|
|
2982
|
-
switch (
|
|
2982
|
+
switch (q = F[M], M += 1, q) {
|
|
2983
2983
|
case 35:
|
|
2984
|
-
n = p + i.shift(), a = h + i.shift(), s = n + i.shift(), o = a + i.shift(),
|
|
2984
|
+
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);
|
|
2985
2985
|
break;
|
|
2986
2986
|
case 34:
|
|
2987
|
-
n = p + i.shift(), a = h, s = n + i.shift(), o = a + i.shift(),
|
|
2987
|
+
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);
|
|
2988
2988
|
break;
|
|
2989
2989
|
case 36:
|
|
2990
|
-
n = p + i.shift(), a = h + i.shift(), s = n + i.shift(), o = a + i.shift(),
|
|
2990
|
+
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);
|
|
2991
2991
|
break;
|
|
2992
2992
|
case 37:
|
|
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 + 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);
|
|
2994
2994
|
break;
|
|
2995
2995
|
default:
|
|
2996
|
-
console.log("Glyph " + r.index + ": unknown operator 1200" +
|
|
2996
|
+
console.log("Glyph " + r.index + ": unknown operator 1200" + q), i.length = 0;
|
|
2997
2997
|
}
|
|
2998
2998
|
break;
|
|
2999
2999
|
case 14:
|
|
3000
|
-
i.length > 0 && !f && (
|
|
3000
|
+
i.length > 0 && !f && (L = i.shift() + x, f = !0), c && (u.closePath(), c = !1);
|
|
3001
3001
|
break;
|
|
3002
3002
|
case 18:
|
|
3003
|
-
|
|
3003
|
+
B();
|
|
3004
3004
|
break;
|
|
3005
3005
|
case 19:
|
|
3006
3006
|
// hintmask
|
|
3007
3007
|
case 20:
|
|
3008
|
-
|
|
3008
|
+
B(), M += l + 7 >> 3;
|
|
3009
3009
|
break;
|
|
3010
3010
|
case 21:
|
|
3011
|
-
i.length > 2 && !f && (
|
|
3011
|
+
i.length > 2 && !f && (L = i.shift() + x, f = !0), h += i.pop(), p += i.pop(), w(p, h);
|
|
3012
3012
|
break;
|
|
3013
3013
|
case 22:
|
|
3014
|
-
i.length > 1 && !f && (
|
|
3014
|
+
i.length > 1 && !f && (L = i.shift() + x, f = !0), p += i.pop(), w(p, h);
|
|
3015
3015
|
break;
|
|
3016
3016
|
case 23:
|
|
3017
|
-
|
|
3017
|
+
B();
|
|
3018
3018
|
break;
|
|
3019
3019
|
case 24:
|
|
3020
3020
|
for (; i.length > 2; )
|
|
@@ -3035,7 +3035,7 @@ function st(e, r, t) {
|
|
|
3035
3035
|
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);
|
|
3036
3036
|
break;
|
|
3037
3037
|
case 28:
|
|
3038
|
-
|
|
3038
|
+
D = F[M], R = F[M + 1], i.push((D << 24 | R << 16) >> 16), M += 2;
|
|
3039
3039
|
break;
|
|
3040
3040
|
case 29:
|
|
3041
3041
|
Q = i.pop() + e.gsubrsBias, G = e.gsubrs[Q], G && C(G);
|
|
@@ -3049,13 +3049,13 @@ function st(e, r, t) {
|
|
|
3049
3049
|
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);
|
|
3050
3050
|
break;
|
|
3051
3051
|
default:
|
|
3052
|
-
|
|
3052
|
+
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));
|
|
3053
3053
|
}
|
|
3054
3054
|
}
|
|
3055
3055
|
}
|
|
3056
|
-
return C(t), r.advanceWidth =
|
|
3056
|
+
return C(t), r.advanceWidth = L, u;
|
|
3057
3057
|
}
|
|
3058
|
-
function
|
|
3058
|
+
function Aa(e, r, t, n) {
|
|
3059
3059
|
var a = [], s, o = new k.Parser(e, r), u = o.parseCard8();
|
|
3060
3060
|
if (u === 0)
|
|
3061
3061
|
for (var i = 0; i < t; i++) {
|
|
@@ -3082,9 +3082,9 @@ function Ra(e, r, t, n) {
|
|
|
3082
3082
|
throw new Error("CFF Table CID Font FDSelect table has unsupported format " + u);
|
|
3083
3083
|
return a;
|
|
3084
3084
|
}
|
|
3085
|
-
function
|
|
3085
|
+
function Ba(e, r, t, n) {
|
|
3086
3086
|
t.tables.cff = {};
|
|
3087
|
-
var a =
|
|
3087
|
+
var a = Oa(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);
|
|
3088
3088
|
t.gsubrs = i.objects, t.gsubrsBias = Lr(t.gsubrs);
|
|
3089
3089
|
var l = at(e, r, o.objects, u.objects);
|
|
3090
3090
|
if (l.length !== 1)
|
|
@@ -3096,33 +3096,33 @@ function Da(e, r, t, n) {
|
|
|
3096
3096
|
throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
|
|
3097
3097
|
c += r;
|
|
3098
3098
|
var h = ye(e, c), d = at(e, r, h.objects, u.objects);
|
|
3099
|
-
f._fdArray = d, p += r, f._fdSelect =
|
|
3099
|
+
f._fdArray = d, p += r, f._fdSelect = Aa(e, p, t.numGlyphs, d.length);
|
|
3100
3100
|
}
|
|
3101
|
-
var g = r + f.private[1], m =
|
|
3101
|
+
var g = r + f.private[1], m = tn(e, g, f.private[0], u.objects);
|
|
3102
3102
|
if (t.defaultWidthX = m.defaultWidthX, t.nominalWidthX = m.nominalWidthX, m.subrs !== 0) {
|
|
3103
|
-
var
|
|
3104
|
-
t.subrs =
|
|
3103
|
+
var x = g + m.subrs, U = ye(e, x);
|
|
3104
|
+
t.subrs = U.objects, t.subrsBias = Lr(t.subrs);
|
|
3105
3105
|
} else
|
|
3106
3106
|
t.subrs = [], t.subrsBias = 0;
|
|
3107
|
-
var
|
|
3108
|
-
n.lowMemory ? (
|
|
3109
|
-
var
|
|
3110
|
-
if (f.encoding === 0 ? t.cffEncoding = new ir(
|
|
3107
|
+
var y;
|
|
3108
|
+
n.lowMemory ? (y = Fa(e, r + f.charStrings), t.nGlyphs = y.offsets.length) : (y = ye(e, r + f.charStrings), t.nGlyphs = y.objects.length);
|
|
3109
|
+
var L = Ra(e, r + f.charset, t.nGlyphs, u.objects);
|
|
3110
|
+
if (f.encoding === 0 ? t.cffEncoding = new ir(va, L) : f.encoding === 1 ? t.cffEncoding = new ir(da, L) : t.cffEncoding = Da(e, r + f.encoding, L), t.encoding = t.encoding || t.cffEncoding, t.glyphs = new le.GlyphSet(t), n.lowMemory)
|
|
3111
3111
|
t._push = function(C) {
|
|
3112
|
-
var
|
|
3113
|
-
t.glyphs.push(C, le.cffGlyphLoader(t, C, st,
|
|
3112
|
+
var F = Ua(C, y.offsets, e, r + f.charStrings);
|
|
3113
|
+
t.glyphs.push(C, le.cffGlyphLoader(t, C, st, F));
|
|
3114
3114
|
};
|
|
3115
3115
|
else
|
|
3116
3116
|
for (var w = 0; w < t.nGlyphs; w += 1) {
|
|
3117
|
-
var
|
|
3118
|
-
t.glyphs.push(w, le.cffGlyphLoader(t, w, st,
|
|
3117
|
+
var B = y.objects[w];
|
|
3118
|
+
t.glyphs.push(w, le.cffGlyphLoader(t, w, st, B));
|
|
3119
3119
|
}
|
|
3120
3120
|
}
|
|
3121
|
-
function
|
|
3121
|
+
function nn(e, r) {
|
|
3122
3122
|
var t, n = er.indexOf(e);
|
|
3123
3123
|
return n >= 0 && (t = n), n = r.indexOf(e), n >= 0 ? t = n + er.length : (t = er.length + r.length, r.push(e)), t;
|
|
3124
3124
|
}
|
|
3125
|
-
function
|
|
3125
|
+
function Ma() {
|
|
3126
3126
|
return new S.Record("Header", [
|
|
3127
3127
|
{ name: "major", type: "Card8", value: 1 },
|
|
3128
3128
|
{ name: "minor", type: "Card8", value: 0 },
|
|
@@ -3130,7 +3130,7 @@ function Aa() {
|
|
|
3130
3130
|
{ name: "major", type: "Card8", value: 1 }
|
|
3131
3131
|
]);
|
|
3132
3132
|
}
|
|
3133
|
-
function
|
|
3133
|
+
function Ia(e) {
|
|
3134
3134
|
var r = new S.Record("Name INDEX", [
|
|
3135
3135
|
{ name: "names", type: "INDEX", value: [] }
|
|
3136
3136
|
]);
|
|
@@ -3139,10 +3139,10 @@ function Ba(e) {
|
|
|
3139
3139
|
r.names.push({ name: "name_" + t, type: "NAME", value: e[t] });
|
|
3140
3140
|
return r;
|
|
3141
3141
|
}
|
|
3142
|
-
function
|
|
3142
|
+
function an(e, r, t) {
|
|
3143
3143
|
for (var n = {}, a = 0; a < e.length; a += 1) {
|
|
3144
3144
|
var s = e[a], o = r[s.name];
|
|
3145
|
-
o !== void 0 && !
|
|
3145
|
+
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 });
|
|
3146
3146
|
}
|
|
3147
3147
|
return n;
|
|
3148
3148
|
}
|
|
@@ -3150,7 +3150,7 @@ function ot(e, r) {
|
|
|
3150
3150
|
var t = new S.Record("Top DICT", [
|
|
3151
3151
|
{ name: "dict", type: "DICT", value: {} }
|
|
3152
3152
|
]);
|
|
3153
|
-
return t.dict =
|
|
3153
|
+
return t.dict = an(en, e, r), t;
|
|
3154
3154
|
}
|
|
3155
3155
|
function it(e) {
|
|
3156
3156
|
var r = new S.Record("Top DICT INDEX", [
|
|
@@ -3158,7 +3158,7 @@ function it(e) {
|
|
|
3158
3158
|
]);
|
|
3159
3159
|
return r.topDicts = [{ name: "topDict_0", type: "TABLE", value: e }], r;
|
|
3160
3160
|
}
|
|
3161
|
-
function
|
|
3161
|
+
function Pa(e) {
|
|
3162
3162
|
var r = new S.Record("String INDEX", [
|
|
3163
3163
|
{ name: "strings", type: "INDEX", value: [] }
|
|
3164
3164
|
]);
|
|
@@ -3167,21 +3167,21 @@ function Ma(e) {
|
|
|
3167
3167
|
r.strings.push({ name: "string_" + t, type: "STRING", value: e[t] });
|
|
3168
3168
|
return r;
|
|
3169
3169
|
}
|
|
3170
|
-
function
|
|
3170
|
+
function Ga() {
|
|
3171
3171
|
return new S.Record("Global Subr INDEX", [
|
|
3172
3172
|
{ name: "subrs", type: "INDEX", value: [] }
|
|
3173
3173
|
]);
|
|
3174
3174
|
}
|
|
3175
|
-
function
|
|
3175
|
+
function Na(e, r) {
|
|
3176
3176
|
for (var t = new S.Record("Charsets", [
|
|
3177
3177
|
{ name: "format", type: "Card8", value: 0 }
|
|
3178
3178
|
]), n = 0; n < e.length; n += 1) {
|
|
3179
|
-
var a = e[n], s =
|
|
3179
|
+
var a = e[n], s = nn(a, r);
|
|
3180
3180
|
t.fields.push({ name: "glyph_" + n, type: "SID", value: s });
|
|
3181
3181
|
}
|
|
3182
3182
|
return t;
|
|
3183
3183
|
}
|
|
3184
|
-
function
|
|
3184
|
+
function Ha(e) {
|
|
3185
3185
|
var r = [], t = e.path;
|
|
3186
3186
|
r.push({ name: "width", type: "NUMBER", value: e.advanceWidth });
|
|
3187
3187
|
for (var n = 0, a = 0, s = 0; s < t.commands.length; s += 1) {
|
|
@@ -3209,22 +3209,22 @@ function Ga(e) {
|
|
|
3209
3209
|
}
|
|
3210
3210
|
return r.push({ name: "endchar", type: "OP", value: 14 }), r;
|
|
3211
3211
|
}
|
|
3212
|
-
function
|
|
3212
|
+
function Wa(e) {
|
|
3213
3213
|
for (var r = new S.Record("CharStrings INDEX", [
|
|
3214
3214
|
{ name: "charStrings", type: "INDEX", value: [] }
|
|
3215
3215
|
]), t = 0; t < e.length; t += 1) {
|
|
3216
|
-
var n = e.get(t), a =
|
|
3216
|
+
var n = e.get(t), a = Ha(n);
|
|
3217
3217
|
r.charStrings.push({ name: n.name, type: "CHARSTRING", value: a });
|
|
3218
3218
|
}
|
|
3219
3219
|
return r;
|
|
3220
3220
|
}
|
|
3221
|
-
function
|
|
3221
|
+
function za(e, r) {
|
|
3222
3222
|
var t = new S.Record("Private DICT", [
|
|
3223
3223
|
{ name: "dict", type: "DICT", value: {} }
|
|
3224
3224
|
]);
|
|
3225
|
-
return t.dict =
|
|
3225
|
+
return t.dict = an(rn, e, r), t;
|
|
3226
3226
|
}
|
|
3227
|
-
function
|
|
3227
|
+
function _a(e, r) {
|
|
3228
3228
|
for (var t = new S.Table("CFF ", [
|
|
3229
3229
|
{ name: "header", type: "RECORD" },
|
|
3230
3230
|
{ name: "nameIndex", type: "RECORD" },
|
|
@@ -3248,18 +3248,18 @@ function Wa(e, r) {
|
|
|
3248
3248
|
}, s = {}, o = [], u, i = 1; i < e.length; i += 1)
|
|
3249
3249
|
u = e.get(i), o.push(u.name);
|
|
3250
3250
|
var l = [];
|
|
3251
|
-
t.header =
|
|
3251
|
+
t.header = Ma(), t.nameIndex = Ia([r.postScriptName]);
|
|
3252
3252
|
var f = ot(a, l);
|
|
3253
|
-
t.topDictIndex = it(f), t.globalSubrIndex =
|
|
3253
|
+
t.topDictIndex = it(f), t.globalSubrIndex = Ga(), t.charsets = Na(o, l), t.charStringsIndex = Wa(e), t.privateDict = za(s, l), t.stringIndex = Pa(l);
|
|
3254
3254
|
var c = t.header.sizeOf() + t.nameIndex.sizeOf() + t.topDictIndex.sizeOf() + t.stringIndex.sizeOf() + t.globalSubrIndex.sizeOf();
|
|
3255
3255
|
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;
|
|
3256
3256
|
}
|
|
3257
|
-
var
|
|
3258
|
-
function
|
|
3257
|
+
var sn = { parse: Ba, make: _a };
|
|
3258
|
+
function Va(e, r) {
|
|
3259
3259
|
var t = {}, n = new k.Parser(e, r);
|
|
3260
3260
|
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;
|
|
3261
3261
|
}
|
|
3262
|
-
function
|
|
3262
|
+
function qa(e) {
|
|
3263
3263
|
var r = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3) + 2082844800, t = r;
|
|
3264
3264
|
return e.createdTimestamp && (t = e.createdTimestamp + 2082844800), new S.Table("head", [
|
|
3265
3265
|
{ name: "version", type: "FIXED", value: 65536 },
|
|
@@ -3281,12 +3281,12 @@ function _a(e) {
|
|
|
3281
3281
|
{ name: "glyphDataFormat", type: "SHORT", value: 0 }
|
|
3282
3282
|
], e);
|
|
3283
3283
|
}
|
|
3284
|
-
var
|
|
3285
|
-
function
|
|
3284
|
+
var on = { parse: Va, make: qa };
|
|
3285
|
+
function Xa(e, r) {
|
|
3286
3286
|
var t = {}, n = new k.Parser(e, r);
|
|
3287
3287
|
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;
|
|
3288
3288
|
}
|
|
3289
|
-
function
|
|
3289
|
+
function Ya(e) {
|
|
3290
3290
|
return new S.Table("hhea", [
|
|
3291
3291
|
{ name: "version", type: "FIXED", value: 65536 },
|
|
3292
3292
|
{ name: "ascender", type: "FWORD", value: 0 },
|
|
@@ -3307,15 +3307,15 @@ function qa(e) {
|
|
|
3307
3307
|
{ name: "numberOfHMetrics", type: "USHORT", value: 0 }
|
|
3308
3308
|
], e);
|
|
3309
3309
|
}
|
|
3310
|
-
var
|
|
3311
|
-
function
|
|
3310
|
+
var un = { parse: Xa, make: Ya };
|
|
3311
|
+
function $a(e, r, t, n, a) {
|
|
3312
3312
|
for (var s, o, u = new k.Parser(e, r), i = 0; i < n; i += 1) {
|
|
3313
3313
|
i < t && (s = u.parseUShort(), o = u.parseShort());
|
|
3314
3314
|
var l = a.get(i);
|
|
3315
3315
|
l.advanceWidth = s, l.leftSideBearing = o;
|
|
3316
3316
|
}
|
|
3317
3317
|
}
|
|
3318
|
-
function
|
|
3318
|
+
function Za(e, r, t, n, a) {
|
|
3319
3319
|
e._hmtxTableData = {};
|
|
3320
3320
|
for (var s, o, u = new k.Parser(r, t), i = 0; i < a; i += 1)
|
|
3321
3321
|
i < n && (s = u.parseUShort(), o = u.parseShort()), e._hmtxTableData[i] = {
|
|
@@ -3323,18 +3323,18 @@ function Ya(e, r, t, n, a) {
|
|
|
3323
3323
|
leftSideBearing: o
|
|
3324
3324
|
};
|
|
3325
3325
|
}
|
|
3326
|
-
function
|
|
3327
|
-
o.lowMemory ?
|
|
3326
|
+
function Qa(e, r, t, n, a, s, o) {
|
|
3327
|
+
o.lowMemory ? Za(e, r, t, n, a) : $a(r, t, n, a, s);
|
|
3328
3328
|
}
|
|
3329
|
-
function
|
|
3329
|
+
function Ka(e) {
|
|
3330
3330
|
for (var r = new S.Table("hmtx", []), t = 0; t < e.length; t += 1) {
|
|
3331
3331
|
var n = e.get(t), a = n.advanceWidth || 0, s = n.leftSideBearing || 0;
|
|
3332
3332
|
r.fields.push({ name: "advanceWidth_" + t, type: "USHORT", value: a }), r.fields.push({ name: "leftSideBearing_" + t, type: "SHORT", value: s });
|
|
3333
3333
|
}
|
|
3334
3334
|
return r;
|
|
3335
3335
|
}
|
|
3336
|
-
var
|
|
3337
|
-
function
|
|
3336
|
+
var ln = { parse: Qa, make: Ka };
|
|
3337
|
+
function ja(e) {
|
|
3338
3338
|
for (var r = new S.Table("ltag", [
|
|
3339
3339
|
{ name: "version", type: "ULONG", value: 1 },
|
|
3340
3340
|
{ name: "flags", type: "ULONG", value: 0 },
|
|
@@ -3345,7 +3345,7 @@ function Qa(e) {
|
|
|
3345
3345
|
}
|
|
3346
3346
|
return r.fields.push({ name: "stringPool", type: "CHARARRAY", value: t }), r;
|
|
3347
3347
|
}
|
|
3348
|
-
function
|
|
3348
|
+
function Ja(e, r) {
|
|
3349
3349
|
var t = new k.Parser(e, r), n = t.parseULong();
|
|
3350
3350
|
E.argument(n === 1, "Unsupported ltag table version."), t.skip("uLong", 1);
|
|
3351
3351
|
for (var a = t.parseULong(), s = [], o = 0; o < a; o++) {
|
|
@@ -3355,18 +3355,18 @@ function Ka(e, r) {
|
|
|
3355
3355
|
}
|
|
3356
3356
|
return s;
|
|
3357
3357
|
}
|
|
3358
|
-
var
|
|
3359
|
-
function
|
|
3358
|
+
var fn = { make: ja, parse: Ja };
|
|
3359
|
+
function es(e, r) {
|
|
3360
3360
|
var t = {}, n = new k.Parser(e, r);
|
|
3361
3361
|
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;
|
|
3362
3362
|
}
|
|
3363
|
-
function
|
|
3363
|
+
function rs(e) {
|
|
3364
3364
|
return new S.Table("maxp", [
|
|
3365
3365
|
{ name: "version", type: "FIXED", value: 20480 },
|
|
3366
3366
|
{ name: "numGlyphs", type: "USHORT", value: e }
|
|
3367
3367
|
]);
|
|
3368
3368
|
}
|
|
3369
|
-
var
|
|
3369
|
+
var pn = { parse: es, make: rs }, cn = [
|
|
3370
3370
|
"copyright",
|
|
3371
3371
|
// 0
|
|
3372
3372
|
"fontFamily",
|
|
@@ -3413,7 +3413,7 @@ var fn = { parse: ja, make: Ja }, pn = [
|
|
|
3413
3413
|
// 21
|
|
3414
3414
|
"wwsSubfamily"
|
|
3415
3415
|
// 22
|
|
3416
|
-
],
|
|
3416
|
+
], hn = {
|
|
3417
3417
|
0: "en",
|
|
3418
3418
|
1: "fr",
|
|
3419
3419
|
2: "de",
|
|
@@ -3533,7 +3533,7 @@ var fn = { parse: ja, make: Ja }, pn = [
|
|
|
3533
3533
|
149: "kl",
|
|
3534
3534
|
150: "az",
|
|
3535
3535
|
151: "nn"
|
|
3536
|
-
},
|
|
3536
|
+
}, ts = {
|
|
3537
3537
|
0: 0,
|
|
3538
3538
|
// langEnglish → smRoman
|
|
3539
3539
|
1: 0,
|
|
@@ -3772,7 +3772,7 @@ var fn = { parse: ja, make: Ja }, pn = [
|
|
|
3772
3772
|
// langAzerbaijanRoman → smRoman
|
|
3773
3773
|
151: 0
|
|
3774
3774
|
// langNynorsk → smRoman
|
|
3775
|
-
},
|
|
3775
|
+
}, vn = {
|
|
3776
3776
|
1078: "af",
|
|
3777
3777
|
1052: "sq",
|
|
3778
3778
|
1156: "gsw",
|
|
@@ -3986,7 +3986,7 @@ var fn = { parse: ja, make: Ja }, pn = [
|
|
|
3986
3986
|
1144: "ii",
|
|
3987
3987
|
1130: "yo"
|
|
3988
3988
|
};
|
|
3989
|
-
function
|
|
3989
|
+
function ns(e, r, t) {
|
|
3990
3990
|
switch (e) {
|
|
3991
3991
|
case 0:
|
|
3992
3992
|
if (r === 65535)
|
|
@@ -3995,12 +3995,12 @@ function rs(e, r, t) {
|
|
|
3995
3995
|
return t[r];
|
|
3996
3996
|
break;
|
|
3997
3997
|
case 1:
|
|
3998
|
-
return cn[r];
|
|
3999
|
-
case 3:
|
|
4000
3998
|
return hn[r];
|
|
3999
|
+
case 3:
|
|
4000
|
+
return vn[r];
|
|
4001
4001
|
}
|
|
4002
4002
|
}
|
|
4003
|
-
var Rr = "utf-16",
|
|
4003
|
+
var Rr = "utf-16", as = {
|
|
4004
4004
|
0: "macintosh",
|
|
4005
4005
|
// smRoman
|
|
4006
4006
|
1: "x-mac-japanese",
|
|
@@ -4059,7 +4059,7 @@ var Rr = "utf-16", ts = {
|
|
|
4059
4059
|
// smVietnamese
|
|
4060
4060
|
31: "x-mac-extarabic"
|
|
4061
4061
|
// smExtArabic
|
|
4062
|
-
},
|
|
4062
|
+
}, ss = {
|
|
4063
4063
|
15: "x-mac-icelandic",
|
|
4064
4064
|
// langIcelandic
|
|
4065
4065
|
17: "x-mac-turkish",
|
|
@@ -4091,26 +4091,26 @@ var Rr = "utf-16", ts = {
|
|
|
4091
4091
|
146: "x-mac-gaelic"
|
|
4092
4092
|
// langIrishGaelicScript
|
|
4093
4093
|
};
|
|
4094
|
-
function
|
|
4094
|
+
function dn(e, r, t) {
|
|
4095
4095
|
switch (e) {
|
|
4096
4096
|
case 0:
|
|
4097
4097
|
return Rr;
|
|
4098
4098
|
case 1:
|
|
4099
|
-
return
|
|
4099
|
+
return ss[t] || as[r];
|
|
4100
4100
|
case 3:
|
|
4101
4101
|
if (r === 1 || r === 10)
|
|
4102
4102
|
return Rr;
|
|
4103
4103
|
break;
|
|
4104
4104
|
}
|
|
4105
4105
|
}
|
|
4106
|
-
function
|
|
4106
|
+
function os(e, r, t) {
|
|
4107
4107
|
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++) {
|
|
4108
|
-
var l = a.parseUShort(), f = a.parseUShort(), c = a.parseUShort(), p = a.parseUShort(), h =
|
|
4109
|
-
if (
|
|
4110
|
-
var
|
|
4111
|
-
if (
|
|
4112
|
-
var
|
|
4113
|
-
|
|
4108
|
+
var l = a.parseUShort(), f = a.parseUShort(), c = a.parseUShort(), p = a.parseUShort(), h = cn[p] || p, d = a.parseUShort(), g = a.parseUShort(), m = ns(l, c, t), x = dn(l, f, c);
|
|
4109
|
+
if (x !== void 0 && m !== void 0) {
|
|
4110
|
+
var U = void 0;
|
|
4111
|
+
if (x === Rr ? U = Oe.UTF16(e, u + g, d) : U = Oe.MACSTRING(e, u + g, d, x), U) {
|
|
4112
|
+
var y = n[h];
|
|
4113
|
+
y === void 0 && (y = n[h] = {}), y[m] = U;
|
|
4114
4114
|
}
|
|
4115
4115
|
}
|
|
4116
4116
|
}
|
|
@@ -4132,7 +4132,7 @@ function ut(e, r, t, n, a, s) {
|
|
|
4132
4132
|
{ name: "offset", type: "USHORT", value: s }
|
|
4133
4133
|
]);
|
|
4134
4134
|
}
|
|
4135
|
-
function
|
|
4135
|
+
function is(e, r) {
|
|
4136
4136
|
var t = e.length, n = r.length - t + 1;
|
|
4137
4137
|
e:
|
|
4138
4138
|
for (var a = 0; a < n; a++)
|
|
@@ -4145,7 +4145,7 @@ function ss(e, r) {
|
|
|
4145
4145
|
return -1;
|
|
4146
4146
|
}
|
|
4147
4147
|
function lt(e, r) {
|
|
4148
|
-
var t =
|
|
4148
|
+
var t = is(e, r);
|
|
4149
4149
|
if (t < 0) {
|
|
4150
4150
|
t = r.length;
|
|
4151
4151
|
for (var n = 0, a = e.length; n < a; ++n)
|
|
@@ -4153,55 +4153,55 @@ function lt(e, r) {
|
|
|
4153
4153
|
}
|
|
4154
4154
|
return t;
|
|
4155
4155
|
}
|
|
4156
|
-
function
|
|
4157
|
-
var t, n = [], a = {}, s = dr(
|
|
4156
|
+
function us(e, r) {
|
|
4157
|
+
var t, n = [], a = {}, s = dr(cn);
|
|
4158
4158
|
for (var o in e) {
|
|
4159
4159
|
var u = s[o];
|
|
4160
4160
|
if (u === void 0 && (u = o), t = parseInt(u), isNaN(t))
|
|
4161
4161
|
throw new Error('Name table entry "' + o + '" does not exist, see nameTableNames for complete list.');
|
|
4162
4162
|
a[t] = e[o], n.push(t);
|
|
4163
4163
|
}
|
|
4164
|
-
for (var i = dr(
|
|
4164
|
+
for (var i = dr(hn), l = dr(vn), f = [], c = [], p = 0; p < n.length; p++) {
|
|
4165
4165
|
t = n[p];
|
|
4166
4166
|
var h = a[t];
|
|
4167
4167
|
for (var d in h) {
|
|
4168
|
-
var g = h[d], m = 1,
|
|
4169
|
-
|
|
4170
|
-
var w = lt(
|
|
4168
|
+
var g = h[d], m = 1, x = i[d], U = ts[x], y = dn(m, U, x), L = b.MACSTRING(g, y);
|
|
4169
|
+
L === void 0 && (m = 0, x = r.indexOf(d), x < 0 && (x = r.length, r.push(d)), U = 4, L = b.UTF16(g));
|
|
4170
|
+
var w = lt(L, c);
|
|
4171
4171
|
f.push(ut(
|
|
4172
4172
|
m,
|
|
4173
|
-
|
|
4174
|
-
|
|
4173
|
+
U,
|
|
4174
|
+
x,
|
|
4175
4175
|
t,
|
|
4176
|
-
|
|
4176
|
+
L.length,
|
|
4177
4177
|
w
|
|
4178
4178
|
));
|
|
4179
|
-
var
|
|
4180
|
-
if (
|
|
4181
|
-
var C = b.UTF16(g),
|
|
4179
|
+
var B = l[d];
|
|
4180
|
+
if (B !== void 0) {
|
|
4181
|
+
var C = b.UTF16(g), F = lt(C, c);
|
|
4182
4182
|
f.push(ut(
|
|
4183
4183
|
3,
|
|
4184
4184
|
1,
|
|
4185
|
-
|
|
4185
|
+
B,
|
|
4186
4186
|
t,
|
|
4187
4187
|
C.length,
|
|
4188
|
-
|
|
4188
|
+
F
|
|
4189
4189
|
));
|
|
4190
4190
|
}
|
|
4191
4191
|
}
|
|
4192
4192
|
}
|
|
4193
|
-
f.sort(function(A,
|
|
4194
|
-
return A.platformID -
|
|
4193
|
+
f.sort(function(A, H) {
|
|
4194
|
+
return A.platformID - H.platformID || A.encodingID - H.encodingID || A.languageID - H.languageID || A.nameID - H.nameID;
|
|
4195
4195
|
});
|
|
4196
|
-
for (var
|
|
4196
|
+
for (var D = new S.Table("name", [
|
|
4197
4197
|
{ name: "format", type: "USHORT", value: 0 },
|
|
4198
4198
|
{ name: "count", type: "USHORT", value: f.length },
|
|
4199
4199
|
{ name: "stringOffset", type: "USHORT", value: 6 + f.length * 12 }
|
|
4200
|
-
]),
|
|
4201
|
-
|
|
4202
|
-
return
|
|
4200
|
+
]), R = 0; R < f.length; R++)
|
|
4201
|
+
D.fields.push({ name: "record_" + R, type: "RECORD", value: f[R] });
|
|
4202
|
+
return D.fields.push({ name: "strings", type: "LITERAL", value: c }), D;
|
|
4203
4203
|
}
|
|
4204
|
-
var
|
|
4204
|
+
var gn = { parse: os, make: us }, Dr = [
|
|
4205
4205
|
{ begin: 0, end: 127 },
|
|
4206
4206
|
// Basic Latin
|
|
4207
4207
|
{ begin: 128, end: 255 },
|
|
@@ -4449,7 +4449,7 @@ var dn = { parse: as, make: os }, Dr = [
|
|
|
4449
4449
|
{ begin: 127024, end: 127135 }
|
|
4450
4450
|
// Domino Tiles
|
|
4451
4451
|
];
|
|
4452
|
-
function
|
|
4452
|
+
function ls(e) {
|
|
4453
4453
|
for (var r = 0; r < Dr.length; r += 1) {
|
|
4454
4454
|
var t = Dr[r];
|
|
4455
4455
|
if (e >= t.begin && e < t.end)
|
|
@@ -4457,14 +4457,14 @@ function is(e) {
|
|
|
4457
4457
|
}
|
|
4458
4458
|
return -1;
|
|
4459
4459
|
}
|
|
4460
|
-
function
|
|
4460
|
+
function fs(e, r) {
|
|
4461
4461
|
var t = {}, n = new k.Parser(e, r);
|
|
4462
4462
|
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 = [];
|
|
4463
4463
|
for (var a = 0; a < 10; a++)
|
|
4464
4464
|
t.panose[a] = n.parseByte();
|
|
4465
4465
|
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;
|
|
4466
4466
|
}
|
|
4467
|
-
function
|
|
4467
|
+
function ps(e) {
|
|
4468
4468
|
return new S.Table("OS/2", [
|
|
4469
4469
|
{ name: "version", type: "USHORT", value: 3 },
|
|
4470
4470
|
{ name: "xAvgCharWidth", type: "SHORT", value: 0 },
|
|
@@ -4514,8 +4514,8 @@ function ls(e) {
|
|
|
4514
4514
|
{ name: "usMaxContext", type: "USHORT", value: 0 }
|
|
4515
4515
|
], e);
|
|
4516
4516
|
}
|
|
4517
|
-
var Ar = { parse:
|
|
4518
|
-
function
|
|
4517
|
+
var Ar = { parse: fs, make: ps, unicodeRanges: Dr, getUnicodeRange: ls };
|
|
4518
|
+
function cs(e, r) {
|
|
4519
4519
|
var t = {}, n = new k.Parser(e, r);
|
|
4520
4520
|
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) {
|
|
4521
4521
|
case 1:
|
|
@@ -4540,7 +4540,7 @@ function fs(e, r) {
|
|
|
4540
4540
|
}
|
|
4541
4541
|
return t;
|
|
4542
4542
|
}
|
|
4543
|
-
function
|
|
4543
|
+
function hs() {
|
|
4544
4544
|
return new S.Table("post", [
|
|
4545
4545
|
{ name: "version", type: "FIXED", value: 196608 },
|
|
4546
4546
|
{ name: "italicAngle", type: "FIXED", value: 0 },
|
|
@@ -4553,7 +4553,7 @@ function ps() {
|
|
|
4553
4553
|
{ name: "maxMemType1", type: "ULONG", value: 0 }
|
|
4554
4554
|
]);
|
|
4555
4555
|
}
|
|
4556
|
-
var
|
|
4556
|
+
var mn = { parse: cs, make: hs }, ee = new Array(9);
|
|
4557
4557
|
ee[1] = function() {
|
|
4558
4558
|
var r = this.offset + this.relativeOffset, t = this.parseUShort();
|
|
4559
4559
|
if (t === 1)
|
|
@@ -4701,7 +4701,7 @@ ee[8] = function() {
|
|
|
4701
4701
|
substitutes: this.parseUShortList()
|
|
4702
4702
|
};
|
|
4703
4703
|
};
|
|
4704
|
-
function
|
|
4704
|
+
function vs(e, r) {
|
|
4705
4705
|
r = r || 0;
|
|
4706
4706
|
var t = new v(e, r), n = t.parseVersion(1);
|
|
4707
4707
|
return E.argument(n === 1 || n === 1.1, "Unsupported GSUB table version."), n === 1 ? {
|
|
@@ -4791,7 +4791,7 @@ Le[6] = function(r) {
|
|
|
4791
4791
|
}
|
|
4792
4792
|
E.assert(!1, "lookup type 6 format must be 1, 2 or 3.");
|
|
4793
4793
|
};
|
|
4794
|
-
function
|
|
4794
|
+
function ds(e) {
|
|
4795
4795
|
return new S.Table("GSUB", [
|
|
4796
4796
|
{ name: "version", type: "ULONG", value: 65536 },
|
|
4797
4797
|
{ name: "scripts", type: "TABLE", value: new S.ScriptList(e.scripts) },
|
|
@@ -4799,8 +4799,8 @@ function hs(e) {
|
|
|
4799
4799
|
{ name: "lookups", type: "TABLE", value: new S.LookupList(e.lookups, Le) }
|
|
4800
4800
|
]);
|
|
4801
4801
|
}
|
|
4802
|
-
var
|
|
4803
|
-
function
|
|
4802
|
+
var yn = { parse: vs, make: ds };
|
|
4803
|
+
function gs(e, r) {
|
|
4804
4804
|
var t = new k.Parser(e, r), n = t.parseULong();
|
|
4805
4805
|
E.argument(n === 1, "Unsupported META table version."), t.parseULong(), t.parseULong();
|
|
4806
4806
|
for (var a = t.parseULong(), s = {}, o = 0; o < a; o++) {
|
|
@@ -4809,7 +4809,7 @@ function vs(e, r) {
|
|
|
4809
4809
|
}
|
|
4810
4810
|
return s;
|
|
4811
4811
|
}
|
|
4812
|
-
function
|
|
4812
|
+
function ms(e) {
|
|
4813
4813
|
var r = Object.keys(e).length, t = "", n = 16 + r * 12, a = new S.Table("meta", [
|
|
4814
4814
|
{ name: "version", type: "ULONG", value: 1 },
|
|
4815
4815
|
{ name: "flags", type: "ULONG", value: 0 },
|
|
@@ -4822,7 +4822,7 @@ function ds(e) {
|
|
|
4822
4822
|
}
|
|
4823
4823
|
return a.fields.push({ name: "stringPool", type: "CHARARRAY", value: t }), a;
|
|
4824
4824
|
}
|
|
4825
|
-
var
|
|
4825
|
+
var xn = { parse: gs, make: ms };
|
|
4826
4826
|
function ft(e) {
|
|
4827
4827
|
return Math.log(e) / Math.log(2) | 0;
|
|
4828
4828
|
}
|
|
@@ -4841,7 +4841,7 @@ function pt(e, r, t, n) {
|
|
|
4841
4841
|
{ name: "length", type: "ULONG", value: n !== void 0 ? n : 0 }
|
|
4842
4842
|
]);
|
|
4843
4843
|
}
|
|
4844
|
-
function
|
|
4844
|
+
function bn(e) {
|
|
4845
4845
|
var r = new S.Table("sfnt", [
|
|
4846
4846
|
{ name: "version", type: "TAG", value: "OTTO" },
|
|
4847
4847
|
{ name: "numTables", type: "USHORT", value: 0 },
|
|
@@ -4875,65 +4875,65 @@ function ct(e, r, t) {
|
|
|
4875
4875
|
}
|
|
4876
4876
|
return t;
|
|
4877
4877
|
}
|
|
4878
|
-
function
|
|
4878
|
+
function ys(e) {
|
|
4879
4879
|
for (var r = 0, t = 0; t < e.length; t += 1)
|
|
4880
4880
|
r += e[t];
|
|
4881
4881
|
return r / e.length;
|
|
4882
4882
|
}
|
|
4883
|
-
function
|
|
4883
|
+
function xs(e) {
|
|
4884
4884
|
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) {
|
|
4885
4885
|
var g = e.glyphs.get(d), m = g.unicode | 0;
|
|
4886
4886
|
if (isNaN(g.advanceWidth))
|
|
4887
4887
|
throw new Error("Glyph " + g.name + " (" + d + "): advanceWidth is not a number.");
|
|
4888
4888
|
(i > m || i === void 0) && m > 0 && (i = m), l < m && (l = m);
|
|
4889
|
-
var
|
|
4890
|
-
if (
|
|
4891
|
-
f |= 1 <<
|
|
4892
|
-
else if (
|
|
4893
|
-
c |= 1 <<
|
|
4894
|
-
else if (
|
|
4895
|
-
p |= 1 <<
|
|
4896
|
-
else if (
|
|
4897
|
-
h |= 1 <<
|
|
4889
|
+
var x = Ar.getUnicodeRange(m);
|
|
4890
|
+
if (x < 32)
|
|
4891
|
+
f |= 1 << x;
|
|
4892
|
+
else if (x < 64)
|
|
4893
|
+
c |= 1 << x - 32;
|
|
4894
|
+
else if (x < 96)
|
|
4895
|
+
p |= 1 << x - 64;
|
|
4896
|
+
else if (x < 123)
|
|
4897
|
+
h |= 1 << x - 96;
|
|
4898
4898
|
else
|
|
4899
4899
|
throw new Error("Unicode ranges bits > 123 are reserved for internal usage");
|
|
4900
4900
|
if (g.name !== ".notdef") {
|
|
4901
|
-
var
|
|
4902
|
-
r.push(
|
|
4901
|
+
var U = g.getMetrics();
|
|
4902
|
+
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);
|
|
4903
4903
|
}
|
|
4904
4904
|
}
|
|
4905
|
-
var
|
|
4905
|
+
var y = {
|
|
4906
4906
|
xMin: Math.min.apply(null, r),
|
|
4907
4907
|
yMin: Math.min.apply(null, t),
|
|
4908
4908
|
xMax: Math.max.apply(null, n),
|
|
4909
4909
|
yMax: Math.max.apply(null, a),
|
|
4910
4910
|
advanceWidthMax: Math.max.apply(null, s),
|
|
4911
|
-
advanceWidthAvg:
|
|
4911
|
+
advanceWidthAvg: ys(s),
|
|
4912
4912
|
minLeftSideBearing: Math.min.apply(null, o),
|
|
4913
4913
|
maxLeftSideBearing: Math.max.apply(null, o),
|
|
4914
4914
|
minRightSideBearing: Math.min.apply(null, u)
|
|
4915
4915
|
};
|
|
4916
|
-
|
|
4917
|
-
var
|
|
4916
|
+
y.ascender = e.ascender, y.descender = e.descender;
|
|
4917
|
+
var L = on.make({
|
|
4918
4918
|
flags: 3,
|
|
4919
4919
|
// 00000011 (baseline for font at y=0; left sidebearing point at x=0)
|
|
4920
4920
|
unitsPerEm: e.unitsPerEm,
|
|
4921
|
-
xMin:
|
|
4922
|
-
yMin:
|
|
4923
|
-
xMax:
|
|
4924
|
-
yMax:
|
|
4921
|
+
xMin: y.xMin,
|
|
4922
|
+
yMin: y.yMin,
|
|
4923
|
+
xMax: y.xMax,
|
|
4924
|
+
yMax: y.yMax,
|
|
4925
4925
|
lowestRecPPEM: 3,
|
|
4926
4926
|
createdTimestamp: e.createdTimestamp
|
|
4927
|
-
}), w =
|
|
4928
|
-
ascender:
|
|
4929
|
-
descender:
|
|
4930
|
-
advanceWidthMax:
|
|
4931
|
-
minLeftSideBearing:
|
|
4932
|
-
minRightSideBearing:
|
|
4933
|
-
xMaxExtent:
|
|
4927
|
+
}), w = un.make({
|
|
4928
|
+
ascender: y.ascender,
|
|
4929
|
+
descender: y.descender,
|
|
4930
|
+
advanceWidthMax: y.advanceWidthMax,
|
|
4931
|
+
minLeftSideBearing: y.minLeftSideBearing,
|
|
4932
|
+
minRightSideBearing: y.minRightSideBearing,
|
|
4933
|
+
xMaxExtent: y.maxLeftSideBearing + (y.xMax - y.xMin),
|
|
4934
4934
|
numberOfHMetrics: e.glyphs.length
|
|
4935
|
-
}),
|
|
4936
|
-
xAvgCharWidth: Math.round(
|
|
4935
|
+
}), B = pn.make(e.glyphs.length), C = Ar.make(Object.assign({
|
|
4936
|
+
xAvgCharWidth: Math.round(y.advanceWidthAvg),
|
|
4937
4937
|
usFirstCharIndex: i,
|
|
4938
4938
|
usLastCharIndex: l,
|
|
4939
4939
|
ulUnicodeRange1: f,
|
|
@@ -4944,36 +4944,36 @@ function ms(e) {
|
|
|
4944
4944
|
// We get metrics for typical characters (such as "x" for xHeight).
|
|
4945
4945
|
// We provide some fallback characters if characters are unavailable: their
|
|
4946
4946
|
// ordering was chosen experimentally.
|
|
4947
|
-
sTypoAscender:
|
|
4948
|
-
sTypoDescender:
|
|
4947
|
+
sTypoAscender: y.ascender,
|
|
4948
|
+
sTypoDescender: y.descender,
|
|
4949
4949
|
sTypoLineGap: 0,
|
|
4950
|
-
usWinAscent:
|
|
4951
|
-
usWinDescent: Math.abs(
|
|
4950
|
+
usWinAscent: y.yMax,
|
|
4951
|
+
usWinDescent: Math.abs(y.yMin),
|
|
4952
4952
|
ulCodePageRange1: 1,
|
|
4953
4953
|
// FIXME: hard-code Latin 1 support for now
|
|
4954
|
-
sxHeight: ct(e, "xyvw", { yMax: Math.round(
|
|
4955
|
-
sCapHeight: ct(e, "HIKLEFJMNTZBDPRAGOQSUVWXY",
|
|
4954
|
+
sxHeight: ct(e, "xyvw", { yMax: Math.round(y.ascender / 2) }).yMax,
|
|
4955
|
+
sCapHeight: ct(e, "HIKLEFJMNTZBDPRAGOQSUVWXY", y).yMax,
|
|
4956
4956
|
usDefaultChar: e.hasChar(" ") ? 32 : 0,
|
|
4957
4957
|
// Use space as the default character, if available.
|
|
4958
4958
|
usBreakChar: e.hasChar(" ") ? 32 : 0
|
|
4959
4959
|
// Use space as the break character, if available.
|
|
4960
|
-
}, e.tables.os2)),
|
|
4961
|
-
Q || (Q =
|
|
4960
|
+
}, 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");
|
|
4961
|
+
Q || (Q = R.replace(/\s/g, "") + "-" + A);
|
|
4962
4962
|
var G = {};
|
|
4963
|
-
for (var
|
|
4964
|
-
G[
|
|
4965
|
-
G.uniqueID || (G.uniqueID = { en: e.getEnglishName("manufacturer") + ":" +
|
|
4966
|
-
var Y = [],
|
|
4963
|
+
for (var z in e.names)
|
|
4964
|
+
G[z] = e.names[z];
|
|
4965
|
+
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);
|
|
4966
|
+
var Y = [], _ = gn.make(G, Y), P = Y.length > 0 ? fn.make(Y) : void 0, V = mn.make(), $ = sn.make(e.glyphs, {
|
|
4967
4967
|
version: e.getEnglishName("version"),
|
|
4968
|
-
fullName:
|
|
4969
|
-
familyName:
|
|
4968
|
+
fullName: H,
|
|
4969
|
+
familyName: R,
|
|
4970
4970
|
weightName: A,
|
|
4971
4971
|
postScriptName: Q,
|
|
4972
4972
|
unitsPerEm: e.unitsPerEm,
|
|
4973
|
-
fontBBox: [0,
|
|
4974
|
-
}),
|
|
4975
|
-
P &&
|
|
4976
|
-
for (var De =
|
|
4973
|
+
fontBBox: [0, y.yMin, y.ascender, y.advanceWidthMax]
|
|
4974
|
+
}), M = e.metas && Object.keys(e.metas).length > 0 ? xn.make(e.metas) : void 0, q = [L, w, B, C, _, D, V, $, F];
|
|
4975
|
+
P && q.push(P), e.tables.gsub && q.push(yn.make(e.tables.gsub)), M && q.push(M);
|
|
4976
|
+
for (var De = bn(q), pr = De.encode(), Ae = _r(pr), Be = De.fields, Me = !1, Ce = 0; Ce < Be.length; Ce += 1)
|
|
4977
4977
|
if (Be[Ce].name === "head table") {
|
|
4978
4978
|
Be[Ce].value.checkSumAdjustment = 2981146554 - Ae, Me = !0;
|
|
4979
4979
|
break;
|
|
@@ -4982,7 +4982,7 @@ function ms(e) {
|
|
|
4982
4982
|
throw new Error("Could not find head table with checkSum to adjust.");
|
|
4983
4983
|
return De;
|
|
4984
4984
|
}
|
|
4985
|
-
var
|
|
4985
|
+
var bs = { make: bn, fontToTable: xs, computeCheckSum: _r };
|
|
4986
4986
|
function gr(e, r) {
|
|
4987
4987
|
for (var t = 0, n = e.length - 1; t <= n; ) {
|
|
4988
4988
|
var a = t + n >>> 1, s = e[a].tag;
|
|
@@ -5265,7 +5265,7 @@ Ve.prototype.getKerningTables = function(e, r) {
|
|
|
5265
5265
|
function j(e) {
|
|
5266
5266
|
_e.call(this, e, "gsub");
|
|
5267
5267
|
}
|
|
5268
|
-
function
|
|
5268
|
+
function Ss(e, r) {
|
|
5269
5269
|
var t = e.length;
|
|
5270
5270
|
if (t !== r.length)
|
|
5271
5271
|
return !1;
|
|
@@ -5395,7 +5395,7 @@ j.prototype.addLigature = function(e, r, t, n) {
|
|
|
5395
5395
|
}, l = this.binSearch(s.coverage.glyphs, o);
|
|
5396
5396
|
if (l >= 0) {
|
|
5397
5397
|
for (var f = s.ligatureSets[l], c = 0; c < f.length; c++)
|
|
5398
|
-
if (
|
|
5398
|
+
if (Ss(f[c].components, u))
|
|
5399
5399
|
return;
|
|
5400
5400
|
f.push(i);
|
|
5401
5401
|
} else
|
|
@@ -5433,15 +5433,15 @@ j.prototype.add = function(e, r, t, n) {
|
|
|
5433
5433
|
return r.by instanceof Array ? this.addMultiple(e, r, t, n) : this.addLigature(e, r, t, n);
|
|
5434
5434
|
}
|
|
5435
5435
|
};
|
|
5436
|
-
function
|
|
5436
|
+
function Ts() {
|
|
5437
5437
|
return typeof window < "u";
|
|
5438
5438
|
}
|
|
5439
|
-
function
|
|
5439
|
+
function Sn(e) {
|
|
5440
5440
|
for (var r = new ArrayBuffer(e.length), t = new Uint8Array(r), n = 0; n < e.length; ++n)
|
|
5441
5441
|
t[n] = e[n];
|
|
5442
5442
|
return r;
|
|
5443
5443
|
}
|
|
5444
|
-
function
|
|
5444
|
+
function ks(e) {
|
|
5445
5445
|
for (var r = new Buffer(e.byteLength), t = new Uint8Array(e), n = 0; n < r.length; ++n)
|
|
5446
5446
|
r[n] = t[n];
|
|
5447
5447
|
return r;
|
|
@@ -5454,7 +5454,7 @@ function dt(e, r, t, n, a) {
|
|
|
5454
5454
|
var s;
|
|
5455
5455
|
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;
|
|
5456
5456
|
}
|
|
5457
|
-
function
|
|
5457
|
+
function Tn(e, r, t) {
|
|
5458
5458
|
var n = new k.Parser(r, t);
|
|
5459
5459
|
e.numberOfContours = n.parseShort(), e._xMin = n.parseShort(), e._yMin = n.parseShort(), e._xMax = n.parseShort(), e._yMax = n.parseShort();
|
|
5460
5460
|
var a, s;
|
|
@@ -5475,10 +5475,10 @@ function Sn(e, r, t) {
|
|
|
5475
5475
|
if (l > 0) {
|
|
5476
5476
|
for (var g = 0; g < l; g += 1)
|
|
5477
5477
|
s = a[g], d = {}, d.onCurve = !!(s & 1), d.lastPointOfContour = o.indexOf(g) >= 0, h.push(d);
|
|
5478
|
-
for (var m = 0,
|
|
5479
|
-
s = a[
|
|
5480
|
-
for (var
|
|
5481
|
-
s = a[
|
|
5478
|
+
for (var m = 0, x = 0; x < l; x += 1)
|
|
5479
|
+
s = a[x], d = h[x], d.x = dt(n, s, m, 2, 16), m = d.x;
|
|
5480
|
+
for (var U = 0, y = 0; y < l; y += 1)
|
|
5481
|
+
s = a[y], d = h[y], d.y = dt(n, s, U, 4, 32), U = d.y;
|
|
5482
5482
|
}
|
|
5483
5483
|
e.points = h;
|
|
5484
5484
|
} else
|
|
@@ -5487,7 +5487,7 @@ function Sn(e, r, t) {
|
|
|
5487
5487
|
e.points = [];
|
|
5488
5488
|
else {
|
|
5489
5489
|
e.isComposite = !0, e.points = [], e.components = [];
|
|
5490
|
-
for (var
|
|
5490
|
+
for (var L = !0; L; ) {
|
|
5491
5491
|
a = n.parseUShort();
|
|
5492
5492
|
var w = {
|
|
5493
5493
|
glyphIndex: n.parseUShort(),
|
|
@@ -5498,11 +5498,11 @@ function Sn(e, r, t) {
|
|
|
5498
5498
|
dx: 0,
|
|
5499
5499
|
dy: 0
|
|
5500
5500
|
};
|
|
5501
|
-
(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),
|
|
5501
|
+
(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);
|
|
5502
5502
|
}
|
|
5503
5503
|
if (a & 256) {
|
|
5504
5504
|
e.instructionLength = n.parseUShort(), e.instructions = [];
|
|
5505
|
-
for (var
|
|
5505
|
+
for (var B = 0; B < e.instructionLength; B += 1)
|
|
5506
5506
|
e.instructions.push(n.parseByte());
|
|
5507
5507
|
}
|
|
5508
5508
|
}
|
|
@@ -5519,18 +5519,18 @@ function mr(e, r) {
|
|
|
5519
5519
|
}
|
|
5520
5520
|
return t;
|
|
5521
5521
|
}
|
|
5522
|
-
function
|
|
5522
|
+
function Fs(e) {
|
|
5523
5523
|
for (var r = [], t = [], n = 0; n < e.length; n += 1) {
|
|
5524
5524
|
var a = e[n];
|
|
5525
5525
|
t.push(a), a.lastPointOfContour && (r.push(t), t = []);
|
|
5526
5526
|
}
|
|
5527
5527
|
return E.argument(t.length === 0, "There are still points left in the current contour."), r;
|
|
5528
5528
|
}
|
|
5529
|
-
function
|
|
5530
|
-
var r = new
|
|
5529
|
+
function kn(e) {
|
|
5530
|
+
var r = new X();
|
|
5531
5531
|
if (!e)
|
|
5532
5532
|
return r;
|
|
5533
|
-
for (var t =
|
|
5533
|
+
for (var t = Fs(e), n = 0; n < t.length; ++n) {
|
|
5534
5534
|
var a = t[n], s = null, o = a[a.length - 1], u = a[0];
|
|
5535
5535
|
if (o.onCurve)
|
|
5536
5536
|
r.moveTo(o.x, o.y);
|
|
@@ -5551,7 +5551,7 @@ function Tn(e) {
|
|
|
5551
5551
|
}
|
|
5552
5552
|
return r;
|
|
5553
5553
|
}
|
|
5554
|
-
function
|
|
5554
|
+
function Fn(e, r) {
|
|
5555
5555
|
if (r.isComposite)
|
|
5556
5556
|
for (var t = 0; t < r.components.length; t += 1) {
|
|
5557
5557
|
var n = r.components[t], a = e.get(n.glyphIndex);
|
|
@@ -5575,50 +5575,50 @@ function kn(e, r) {
|
|
|
5575
5575
|
r.points = r.points.concat(s);
|
|
5576
5576
|
}
|
|
5577
5577
|
}
|
|
5578
|
-
return
|
|
5578
|
+
return kn(r.points);
|
|
5579
5579
|
}
|
|
5580
|
-
function
|
|
5580
|
+
function Us(e, r, t, n) {
|
|
5581
5581
|
for (var a = new le.GlyphSet(n), s = 0; s < t.length - 1; s += 1) {
|
|
5582
5582
|
var o = t[s], u = t[s + 1];
|
|
5583
|
-
o !== u ? a.push(s, le.ttfGlyphLoader(n, s,
|
|
5583
|
+
o !== u ? a.push(s, le.ttfGlyphLoader(n, s, Tn, e, r + o, Fn)) : a.push(s, le.glyphLoader(n, s));
|
|
5584
5584
|
}
|
|
5585
5585
|
return a;
|
|
5586
5586
|
}
|
|
5587
|
-
function
|
|
5587
|
+
function Cs(e, r, t, n) {
|
|
5588
5588
|
var a = new le.GlyphSet(n);
|
|
5589
5589
|
return n._push = function(s) {
|
|
5590
5590
|
var o = t[s], u = t[s + 1];
|
|
5591
|
-
o !== u ? a.push(s, le.ttfGlyphLoader(n, s,
|
|
5591
|
+
o !== u ? a.push(s, le.ttfGlyphLoader(n, s, Tn, e, r + o, Fn)) : a.push(s, le.glyphLoader(n, s));
|
|
5592
5592
|
}, a;
|
|
5593
5593
|
}
|
|
5594
|
-
function
|
|
5595
|
-
return a.lowMemory ?
|
|
5594
|
+
function ws(e, r, t, n, a) {
|
|
5595
|
+
return a.lowMemory ? Cs(e, r, t, n) : Us(e, r, t, n);
|
|
5596
5596
|
}
|
|
5597
|
-
var
|
|
5598
|
-
function
|
|
5597
|
+
var Un = { getPath: kn, parse: ws }, Cn, Ue, wn, Br;
|
|
5598
|
+
function En(e) {
|
|
5599
5599
|
this.font = e, this.getCommands = function(r) {
|
|
5600
|
-
return
|
|
5600
|
+
return Un.getPath(r).commands;
|
|
5601
5601
|
}, this._fpgmState = this._prepState = void 0, this._errorState = 0;
|
|
5602
5602
|
}
|
|
5603
|
-
function
|
|
5603
|
+
function Es(e) {
|
|
5604
5604
|
return e;
|
|
5605
5605
|
}
|
|
5606
|
-
function
|
|
5606
|
+
function On(e) {
|
|
5607
5607
|
return Math.sign(e) * Math.round(Math.abs(e));
|
|
5608
5608
|
}
|
|
5609
|
-
function
|
|
5609
|
+
function Os(e) {
|
|
5610
5610
|
return Math.sign(e) * Math.round(Math.abs(e * 2)) / 2;
|
|
5611
5611
|
}
|
|
5612
|
-
function
|
|
5612
|
+
function Ls(e) {
|
|
5613
5613
|
return Math.sign(e) * (Math.round(Math.abs(e) + 0.5) - 0.5);
|
|
5614
5614
|
}
|
|
5615
|
-
function
|
|
5615
|
+
function Rs(e) {
|
|
5616
5616
|
return Math.sign(e) * Math.ceil(Math.abs(e));
|
|
5617
5617
|
}
|
|
5618
|
-
function
|
|
5618
|
+
function Ds(e) {
|
|
5619
5619
|
return Math.sign(e) * Math.floor(Math.abs(e));
|
|
5620
5620
|
}
|
|
5621
|
-
var
|
|
5621
|
+
var Ln = function(e) {
|
|
5622
5622
|
var r = this.srPeriod, t = this.srPhase, n = this.srThreshold, a = 1;
|
|
5623
5623
|
return e < 0 && (e = -e, a = -1), e += n - t, e = Math.trunc(e / r) * r, e += t, e < 0 ? t * a : e * a;
|
|
5624
5624
|
}, ue = {
|
|
@@ -5791,7 +5791,7 @@ ce.prototype.prevTouched = function(e) {
|
|
|
5791
5791
|
r = r.prevPointOnContour;
|
|
5792
5792
|
return r;
|
|
5793
5793
|
};
|
|
5794
|
-
var ze = Object.freeze(new ce(0, 0)),
|
|
5794
|
+
var ze = Object.freeze(new ce(0, 0)), As = {
|
|
5795
5795
|
cvCutIn: 17 / 16,
|
|
5796
5796
|
// control value cut in
|
|
5797
5797
|
deltaBase: 9,
|
|
@@ -5808,10 +5808,10 @@ function xe(e, r) {
|
|
|
5808
5808
|
this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
|
|
5809
5809
|
/* fall through */
|
|
5810
5810
|
case "prep":
|
|
5811
|
-
this.fv = this.pv = this.dpv = ue, this.round =
|
|
5811
|
+
this.fv = this.pv = this.dpv = ue, this.round = On;
|
|
5812
5812
|
}
|
|
5813
5813
|
}
|
|
5814
|
-
|
|
5814
|
+
En.prototype.exec = function(e, r) {
|
|
5815
5815
|
if (typeof r != "number")
|
|
5816
5816
|
throw new Error("Point size is not a number!");
|
|
5817
5817
|
if (!(this._errorState > 2)) {
|
|
@@ -5819,7 +5819,7 @@ wn.prototype.exec = function(e, r) {
|
|
|
5819
5819
|
if (!n || n.ppem !== r) {
|
|
5820
5820
|
var a = this._fpgmState;
|
|
5821
5821
|
if (!a) {
|
|
5822
|
-
xe.prototype =
|
|
5822
|
+
xe.prototype = As, a = this._fpgmState = new xe("fpgm", t.tables.fpgm), a.funcs = [], a.font = t, exports.DEBUG && (console.log("---EXEC FPGM---"), a.step = -1);
|
|
5823
5823
|
try {
|
|
5824
5824
|
Ue(a);
|
|
5825
5825
|
} catch (l) {
|
|
@@ -5843,14 +5843,14 @@ wn.prototype.exec = function(e, r) {
|
|
|
5843
5843
|
}
|
|
5844
5844
|
if (!(this._errorState > 1))
|
|
5845
5845
|
try {
|
|
5846
|
-
return
|
|
5846
|
+
return wn(e, n);
|
|
5847
5847
|
} catch (l) {
|
|
5848
5848
|
this._errorState < 1 && (console.log("Hinting error:" + l), console.log("Note: further hinting errors are silenced")), this._errorState = 1;
|
|
5849
5849
|
return;
|
|
5850
5850
|
}
|
|
5851
5851
|
}
|
|
5852
5852
|
};
|
|
5853
|
-
|
|
5853
|
+
wn = function(e, r) {
|
|
5854
5854
|
var t = r.ppem / r.font.unitsPerEm, n = t, a = e.components, s, o, u;
|
|
5855
5855
|
if (xe.prototype = r, !a)
|
|
5856
5856
|
u = new xe("glyf", e.instructions), exports.DEBUG && (console.log("---EXEC GLYPH---"), u.step = -1), Br(e, u, t, n), o = u.gZone;
|
|
@@ -5861,13 +5861,13 @@ Cn = function(e, r) {
|
|
|
5861
5861
|
var f = a[l], c = i.glyphs.get(f.glyphIndex);
|
|
5862
5862
|
u = new xe("glyf", c.instructions), exports.DEBUG && (console.log("---EXEC COMP " + l + "---"), u.step = -1), Br(c, u, t, n);
|
|
5863
5863
|
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++) {
|
|
5864
|
-
var
|
|
5865
|
-
|
|
5864
|
+
var x = d[m];
|
|
5865
|
+
x.xTouched = x.yTouched = !1, x.xo = x.x = x.x + p, x.yo = x.y = x.y + h;
|
|
5866
5866
|
}
|
|
5867
|
-
var
|
|
5867
|
+
var U = o.length;
|
|
5868
5868
|
o.push.apply(o, d);
|
|
5869
|
-
for (var
|
|
5870
|
-
s.push(g[
|
|
5869
|
+
for (var y = 0; y < g.length; y++)
|
|
5870
|
+
s.push(g[y] + U);
|
|
5871
5871
|
}
|
|
5872
5872
|
e.instructions && !u.inhibitGridFit && (u = new xe("glyf", e.instructions), u.gZone = u.z0 = u.z1 = u.z2 = o, u.contours = s, o.push(
|
|
5873
5873
|
new ce(0, 0),
|
|
@@ -5907,7 +5907,7 @@ Ue = function(e) {
|
|
|
5907
5907
|
if (r) {
|
|
5908
5908
|
var t = r.length, n;
|
|
5909
5909
|
for (e.ip = 0; e.ip < t; e.ip++) {
|
|
5910
|
-
if (exports.DEBUG && e.step++, n =
|
|
5910
|
+
if (exports.DEBUG && e.step++, n = Cn[r[e.ip]], !n)
|
|
5911
5911
|
throw new Error(
|
|
5912
5912
|
"unknown instruction: 0x" + Number(r[e.ip]).toString(16)
|
|
5913
5913
|
);
|
|
@@ -5919,7 +5919,7 @@ function lr(e) {
|
|
|
5919
5919
|
for (var r = e.tZone = new Array(e.gZone.length), t = 0; t < r.length; t++)
|
|
5920
5920
|
r[t] = new ce(0, 0);
|
|
5921
5921
|
}
|
|
5922
|
-
function
|
|
5922
|
+
function Rn(e, r) {
|
|
5923
5923
|
var t = e.prog, n = e.ip, a = 1, s;
|
|
5924
5924
|
do
|
|
5925
5925
|
if (s = t[++n], s === 88)
|
|
@@ -5960,41 +5960,41 @@ function bt(e, r) {
|
|
|
5960
5960
|
var u, i;
|
|
5961
5961
|
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);
|
|
5962
5962
|
}
|
|
5963
|
-
function
|
|
5963
|
+
function Bs(e) {
|
|
5964
5964
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
5965
5965
|
exports.DEBUG && console.log(e.step, "SPVFS[]", t, n), e.pv = e.dpv = Xe(n, t);
|
|
5966
5966
|
}
|
|
5967
|
-
function
|
|
5967
|
+
function Ms(e) {
|
|
5968
5968
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
5969
5969
|
exports.DEBUG && console.log(e.step, "SPVFS[]", t, n), e.fv = Xe(n, t);
|
|
5970
5970
|
}
|
|
5971
|
-
function
|
|
5971
|
+
function Is(e) {
|
|
5972
5972
|
var r = e.stack, t = e.pv;
|
|
5973
5973
|
exports.DEBUG && console.log(e.step, "GPV[]"), r.push(t.x * 16384), r.push(t.y * 16384);
|
|
5974
5974
|
}
|
|
5975
|
-
function
|
|
5975
|
+
function Ps(e) {
|
|
5976
5976
|
var r = e.stack, t = e.fv;
|
|
5977
5977
|
exports.DEBUG && console.log(e.step, "GFV[]"), r.push(t.x * 16384), r.push(t.y * 16384);
|
|
5978
5978
|
}
|
|
5979
|
-
function
|
|
5979
|
+
function Gs(e) {
|
|
5980
5980
|
e.fv = e.pv, exports.DEBUG && console.log(e.step, "SFVTPV[]");
|
|
5981
5981
|
}
|
|
5982
|
-
function
|
|
5982
|
+
function Ns(e) {
|
|
5983
5983
|
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];
|
|
5984
5984
|
exports.DEBUG && console.log("ISECT[], ", t, n, a, s, o);
|
|
5985
|
-
var d = l.x, g = l.y, m = f.x,
|
|
5986
|
-
h.x = (C * (
|
|
5985
|
+
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;
|
|
5986
|
+
h.x = (C * (U - L) - F * (d - m)) / B, h.y = (C * (y - w) - F * (g - x)) / B;
|
|
5987
5987
|
}
|
|
5988
|
-
function
|
|
5988
|
+
function Hs(e) {
|
|
5989
5989
|
e.rp0 = e.stack.pop(), exports.DEBUG && console.log(e.step, "SRP0[]", e.rp0);
|
|
5990
5990
|
}
|
|
5991
|
-
function
|
|
5991
|
+
function Ws(e) {
|
|
5992
5992
|
e.rp1 = e.stack.pop(), exports.DEBUG && console.log(e.step, "SRP1[]", e.rp1);
|
|
5993
5993
|
}
|
|
5994
|
-
function
|
|
5994
|
+
function zs(e) {
|
|
5995
5995
|
e.rp2 = e.stack.pop(), exports.DEBUG && console.log(e.step, "SRP2[]", e.rp2);
|
|
5996
5996
|
}
|
|
5997
|
-
function
|
|
5997
|
+
function _s(e) {
|
|
5998
5998
|
var r = e.stack.pop();
|
|
5999
5999
|
switch (exports.DEBUG && console.log(e.step, "SZP0[]", r), e.zp0 = r, r) {
|
|
6000
6000
|
case 0:
|
|
@@ -6007,7 +6007,7 @@ function Ws(e) {
|
|
|
6007
6007
|
throw new Error("Invalid zone pointer");
|
|
6008
6008
|
}
|
|
6009
6009
|
}
|
|
6010
|
-
function
|
|
6010
|
+
function Vs(e) {
|
|
6011
6011
|
var r = e.stack.pop();
|
|
6012
6012
|
switch (exports.DEBUG && console.log(e.step, "SZP1[]", r), e.zp1 = r, r) {
|
|
6013
6013
|
case 0:
|
|
@@ -6020,7 +6020,7 @@ function zs(e) {
|
|
|
6020
6020
|
throw new Error("Invalid zone pointer");
|
|
6021
6021
|
}
|
|
6022
6022
|
}
|
|
6023
|
-
function
|
|
6023
|
+
function qs(e) {
|
|
6024
6024
|
var r = e.stack.pop();
|
|
6025
6025
|
switch (exports.DEBUG && console.log(e.step, "SZP2[]", r), e.zp2 = r, r) {
|
|
6026
6026
|
case 0:
|
|
@@ -6033,7 +6033,7 @@ function _s(e) {
|
|
|
6033
6033
|
throw new Error("Invalid zone pointer");
|
|
6034
6034
|
}
|
|
6035
6035
|
}
|
|
6036
|
-
function
|
|
6036
|
+
function Xs(e) {
|
|
6037
6037
|
var r = e.stack.pop();
|
|
6038
6038
|
switch (exports.DEBUG && console.log(e.step, "SZPS[]", r), e.zp0 = e.zp1 = e.zp2 = r, r) {
|
|
6039
6039
|
case 0:
|
|
@@ -6046,49 +6046,49 @@ function Vs(e) {
|
|
|
6046
6046
|
throw new Error("Invalid zone pointer");
|
|
6047
6047
|
}
|
|
6048
6048
|
}
|
|
6049
|
-
function
|
|
6049
|
+
function Ys(e) {
|
|
6050
6050
|
e.loop = e.stack.pop(), exports.DEBUG && console.log(e.step, "SLOOP[]", e.loop);
|
|
6051
6051
|
}
|
|
6052
|
-
function
|
|
6053
|
-
exports.DEBUG && console.log(e.step, "RTG[]"), e.round =
|
|
6052
|
+
function $s(e) {
|
|
6053
|
+
exports.DEBUG && console.log(e.step, "RTG[]"), e.round = On;
|
|
6054
6054
|
}
|
|
6055
|
-
function
|
|
6056
|
-
exports.DEBUG && console.log(e.step, "RTHG[]"), e.round =
|
|
6055
|
+
function Zs(e) {
|
|
6056
|
+
exports.DEBUG && console.log(e.step, "RTHG[]"), e.round = Ls;
|
|
6057
6057
|
}
|
|
6058
|
-
function
|
|
6058
|
+
function Qs(e) {
|
|
6059
6059
|
var r = e.stack.pop();
|
|
6060
6060
|
exports.DEBUG && console.log(e.step, "SMD[]", r), e.minDis = r / 64;
|
|
6061
6061
|
}
|
|
6062
|
-
function
|
|
6063
|
-
exports.DEBUG && console.log(e.step, "ELSE[]"),
|
|
6062
|
+
function Ks(e) {
|
|
6063
|
+
exports.DEBUG && console.log(e.step, "ELSE[]"), Rn(e, !1);
|
|
6064
6064
|
}
|
|
6065
|
-
function
|
|
6065
|
+
function js(e) {
|
|
6066
6066
|
var r = e.stack.pop();
|
|
6067
6067
|
exports.DEBUG && console.log(e.step, "JMPR[]", r), e.ip += r - 1;
|
|
6068
6068
|
}
|
|
6069
|
-
function
|
|
6069
|
+
function Js(e) {
|
|
6070
6070
|
var r = e.stack.pop();
|
|
6071
6071
|
exports.DEBUG && console.log(e.step, "SCVTCI[]", r), e.cvCutIn = r / 64;
|
|
6072
6072
|
}
|
|
6073
|
-
function
|
|
6073
|
+
function eo(e) {
|
|
6074
6074
|
var r = e.stack;
|
|
6075
6075
|
exports.DEBUG && console.log(e.step, "DUP[]"), r.push(r[r.length - 1]);
|
|
6076
6076
|
}
|
|
6077
6077
|
function yr(e) {
|
|
6078
6078
|
exports.DEBUG && console.log(e.step, "POP[]"), e.stack.pop();
|
|
6079
6079
|
}
|
|
6080
|
-
function
|
|
6080
|
+
function ro(e) {
|
|
6081
6081
|
exports.DEBUG && console.log(e.step, "CLEAR[]"), e.stack.length = 0;
|
|
6082
6082
|
}
|
|
6083
|
-
function
|
|
6083
|
+
function to(e) {
|
|
6084
6084
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6085
6085
|
exports.DEBUG && console.log(e.step, "SWAP[]"), r.push(t), r.push(n);
|
|
6086
6086
|
}
|
|
6087
|
-
function
|
|
6087
|
+
function no(e) {
|
|
6088
6088
|
var r = e.stack;
|
|
6089
6089
|
exports.DEBUG && console.log(e.step, "DEPTH[]"), r.push(r.length);
|
|
6090
6090
|
}
|
|
6091
|
-
function
|
|
6091
|
+
function ao(e) {
|
|
6092
6092
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6093
6093
|
exports.DEBUG && console.log(e.step, "LOOPCALL[]", t, n);
|
|
6094
6094
|
var a = e.ip, s = e.prog;
|
|
@@ -6101,21 +6101,21 @@ function to(e) {
|
|
|
6101
6101
|
);
|
|
6102
6102
|
e.ip = a, e.prog = s;
|
|
6103
6103
|
}
|
|
6104
|
-
function
|
|
6104
|
+
function so(e) {
|
|
6105
6105
|
var r = e.stack.pop();
|
|
6106
6106
|
exports.DEBUG && console.log(e.step, "CALL[]", r);
|
|
6107
6107
|
var t = e.ip, n = e.prog;
|
|
6108
6108
|
e.prog = e.funcs[r], Ue(e), e.ip = t, e.prog = n, exports.DEBUG && console.log(++e.step, "returning from", r);
|
|
6109
6109
|
}
|
|
6110
|
-
function
|
|
6110
|
+
function oo(e) {
|
|
6111
6111
|
var r = e.stack, t = r.pop();
|
|
6112
6112
|
exports.DEBUG && console.log(e.step, "CINDEX[]", t), r.push(r[r.length - t]);
|
|
6113
6113
|
}
|
|
6114
|
-
function
|
|
6114
|
+
function io(e) {
|
|
6115
6115
|
var r = e.stack, t = r.pop();
|
|
6116
6116
|
exports.DEBUG && console.log(e.step, "MINDEX[]", t), r.push(r.splice(r.length - t, 1)[0]);
|
|
6117
6117
|
}
|
|
6118
|
-
function
|
|
6118
|
+
function uo(e) {
|
|
6119
6119
|
if (e.env !== "fpgm")
|
|
6120
6120
|
throw new Error("FDEF not allowed here");
|
|
6121
6121
|
var r = e.stack, t = e.prog, n = e.ip, a = r.pop(), s = n;
|
|
@@ -6171,7 +6171,7 @@ function Ut(e, r) {
|
|
|
6171
6171
|
for (var l, f = o.distance(a, a, !1, !0), c = i.length - 2, p = 0; p < c; p++)
|
|
6172
6172
|
l = i[p], s.setRelative(l, l, f, o);
|
|
6173
6173
|
}
|
|
6174
|
-
function
|
|
6174
|
+
function lo(e) {
|
|
6175
6175
|
for (var r = e.stack, t = e.loop, n = e.fv, a = r.pop() / 64, s = e.z2; t--; ) {
|
|
6176
6176
|
var o = r.pop(), u = s[o];
|
|
6177
6177
|
exports.DEBUG && console.log(
|
|
@@ -6183,7 +6183,7 @@ function io(e) {
|
|
|
6183
6183
|
}
|
|
6184
6184
|
e.loop = 1;
|
|
6185
6185
|
}
|
|
6186
|
-
function
|
|
6186
|
+
function fo(e) {
|
|
6187
6187
|
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--; ) {
|
|
6188
6188
|
var f = r.pop(), c = l[f];
|
|
6189
6189
|
exports.DEBUG && console.log(
|
|
@@ -6201,7 +6201,7 @@ function Ct(e, r) {
|
|
|
6201
6201
|
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;
|
|
6202
6202
|
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);
|
|
6203
6203
|
}
|
|
6204
|
-
function
|
|
6204
|
+
function po(e) {
|
|
6205
6205
|
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--; ) {
|
|
6206
6206
|
var i = r.pop(), l = u[i];
|
|
6207
6207
|
exports.DEBUG && console.log(
|
|
@@ -6212,8 +6212,8 @@ function lo(e) {
|
|
|
6212
6212
|
}
|
|
6213
6213
|
e.loop = 1;
|
|
6214
6214
|
}
|
|
6215
|
-
function
|
|
6216
|
-
exports.DEBUG && console.log(e.step, "RTDG[]"), e.round =
|
|
6215
|
+
function co(e) {
|
|
6216
|
+
exports.DEBUG && console.log(e.step, "RTDG[]"), e.round = Os;
|
|
6217
6217
|
}
|
|
6218
6218
|
function wt(e, r) {
|
|
6219
6219
|
var t = r.stack, n = t.pop(), a = t.pop(), s = r.z0[a], o = r.fv, u = r.pv, i = r.cvt[n];
|
|
@@ -6229,14 +6229,14 @@ function wt(e, r) {
|
|
|
6229
6229
|
var l = u.distance(s, ze);
|
|
6230
6230
|
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;
|
|
6231
6231
|
}
|
|
6232
|
-
function
|
|
6232
|
+
function ho(e) {
|
|
6233
6233
|
var r = e.prog, t = e.ip, n = e.stack, a = r[++t];
|
|
6234
6234
|
exports.DEBUG && console.log(e.step, "NPUSHB[]", a);
|
|
6235
6235
|
for (var s = 0; s < a; s++)
|
|
6236
6236
|
n.push(r[++t]);
|
|
6237
6237
|
e.ip = t;
|
|
6238
6238
|
}
|
|
6239
|
-
function
|
|
6239
|
+
function vo(e) {
|
|
6240
6240
|
var r = e.ip, t = e.prog, n = e.stack, a = t[++r];
|
|
6241
6241
|
exports.DEBUG && console.log(e.step, "NPUSHW[]", a);
|
|
6242
6242
|
for (var s = 0; s < a; s++) {
|
|
@@ -6245,23 +6245,23 @@ function co(e) {
|
|
|
6245
6245
|
}
|
|
6246
6246
|
e.ip = r;
|
|
6247
6247
|
}
|
|
6248
|
-
function
|
|
6248
|
+
function go(e) {
|
|
6249
6249
|
var r = e.stack, t = e.store;
|
|
6250
6250
|
t || (t = e.store = []);
|
|
6251
6251
|
var n = r.pop(), a = r.pop();
|
|
6252
6252
|
exports.DEBUG && console.log(e.step, "WS", n, a), t[a] = n;
|
|
6253
6253
|
}
|
|
6254
|
-
function
|
|
6254
|
+
function mo(e) {
|
|
6255
6255
|
var r = e.stack, t = e.store, n = r.pop();
|
|
6256
6256
|
exports.DEBUG && console.log(e.step, "RS", n);
|
|
6257
6257
|
var a = t && t[n] || 0;
|
|
6258
6258
|
r.push(a);
|
|
6259
6259
|
}
|
|
6260
|
-
function
|
|
6260
|
+
function yo(e) {
|
|
6261
6261
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6262
6262
|
exports.DEBUG && console.log(e.step, "WCVTP", t, n), e.cvt[n] = t / 64;
|
|
6263
6263
|
}
|
|
6264
|
-
function
|
|
6264
|
+
function xo(e) {
|
|
6265
6265
|
var r = e.stack, t = r.pop();
|
|
6266
6266
|
exports.DEBUG && console.log(e.step, "RCVT", t), r.push(e.cvt[t] * 64);
|
|
6267
6267
|
}
|
|
@@ -6273,60 +6273,60 @@ function Ot(e, r) {
|
|
|
6273
6273
|
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);
|
|
6274
6274
|
exports.DEBUG && console.log(r.step, "MD[" + e + "]", n, a, "->", u), r.stack.push(Math.round(u * 64));
|
|
6275
6275
|
}
|
|
6276
|
-
function
|
|
6276
|
+
function bo(e) {
|
|
6277
6277
|
exports.DEBUG && console.log(e.step, "MPPEM[]"), e.stack.push(e.ppem);
|
|
6278
6278
|
}
|
|
6279
|
-
function
|
|
6279
|
+
function So(e) {
|
|
6280
6280
|
exports.DEBUG && console.log(e.step, "FLIPON[]"), e.autoFlip = !0;
|
|
6281
6281
|
}
|
|
6282
|
-
function
|
|
6282
|
+
function To(e) {
|
|
6283
6283
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6284
6284
|
exports.DEBUG && console.log(e.step, "LT[]", t, n), r.push(n < t ? 1 : 0);
|
|
6285
6285
|
}
|
|
6286
|
-
function
|
|
6286
|
+
function ko(e) {
|
|
6287
6287
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6288
6288
|
exports.DEBUG && console.log(e.step, "LTEQ[]", t, n), r.push(n <= t ? 1 : 0);
|
|
6289
6289
|
}
|
|
6290
|
-
function
|
|
6290
|
+
function Fo(e) {
|
|
6291
6291
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6292
6292
|
exports.DEBUG && console.log(e.step, "GT[]", t, n), r.push(n > t ? 1 : 0);
|
|
6293
6293
|
}
|
|
6294
|
-
function
|
|
6294
|
+
function Uo(e) {
|
|
6295
6295
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6296
6296
|
exports.DEBUG && console.log(e.step, "GTEQ[]", t, n), r.push(n >= t ? 1 : 0);
|
|
6297
6297
|
}
|
|
6298
|
-
function
|
|
6298
|
+
function Co(e) {
|
|
6299
6299
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6300
6300
|
exports.DEBUG && console.log(e.step, "EQ[]", t, n), r.push(t === n ? 1 : 0);
|
|
6301
6301
|
}
|
|
6302
|
-
function
|
|
6302
|
+
function wo(e) {
|
|
6303
6303
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6304
6304
|
exports.DEBUG && console.log(e.step, "NEQ[]", t, n), r.push(t !== n ? 1 : 0);
|
|
6305
6305
|
}
|
|
6306
|
-
function
|
|
6306
|
+
function Eo(e) {
|
|
6307
6307
|
var r = e.stack, t = r.pop();
|
|
6308
6308
|
exports.DEBUG && console.log(e.step, "ODD[]", t), r.push(Math.trunc(t) % 2 ? 1 : 0);
|
|
6309
6309
|
}
|
|
6310
|
-
function
|
|
6310
|
+
function Oo(e) {
|
|
6311
6311
|
var r = e.stack, t = r.pop();
|
|
6312
6312
|
exports.DEBUG && console.log(e.step, "EVEN[]", t), r.push(Math.trunc(t) % 2 ? 0 : 1);
|
|
6313
6313
|
}
|
|
6314
|
-
function
|
|
6314
|
+
function Lo(e) {
|
|
6315
6315
|
var r = e.stack.pop();
|
|
6316
|
-
exports.DEBUG && console.log(e.step, "IF[]", r), r || (
|
|
6316
|
+
exports.DEBUG && console.log(e.step, "IF[]", r), r || (Rn(e, !0), exports.DEBUG && console.log(e.step, "EIF[]"));
|
|
6317
6317
|
}
|
|
6318
|
-
function
|
|
6318
|
+
function Ro(e) {
|
|
6319
6319
|
exports.DEBUG && console.log(e.step, "EIF[]");
|
|
6320
6320
|
}
|
|
6321
|
-
function
|
|
6321
|
+
function Do(e) {
|
|
6322
6322
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6323
6323
|
exports.DEBUG && console.log(e.step, "AND[]", t, n), r.push(t && n ? 1 : 0);
|
|
6324
6324
|
}
|
|
6325
|
-
function
|
|
6325
|
+
function Ao(e) {
|
|
6326
6326
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6327
6327
|
exports.DEBUG && console.log(e.step, "OR[]", t, n), r.push(t || n ? 1 : 0);
|
|
6328
6328
|
}
|
|
6329
|
-
function
|
|
6329
|
+
function Bo(e) {
|
|
6330
6330
|
var r = e.stack, t = r.pop();
|
|
6331
6331
|
exports.DEBUG && console.log(e.step, "NOT[]", t), r.push(t ? 0 : 1);
|
|
6332
6332
|
}
|
|
@@ -6343,43 +6343,43 @@ function xr(e, r) {
|
|
|
6343
6343
|
}
|
|
6344
6344
|
}
|
|
6345
6345
|
}
|
|
6346
|
-
function
|
|
6346
|
+
function Mo(e) {
|
|
6347
6347
|
var r = e.stack, t = r.pop();
|
|
6348
6348
|
exports.DEBUG && console.log(e.step, "SDB[]", t), e.deltaBase = t;
|
|
6349
6349
|
}
|
|
6350
|
-
function
|
|
6350
|
+
function Io(e) {
|
|
6351
6351
|
var r = e.stack, t = r.pop();
|
|
6352
6352
|
exports.DEBUG && console.log(e.step, "SDS[]", t), e.deltaShift = Math.pow(0.5, t);
|
|
6353
6353
|
}
|
|
6354
|
-
function
|
|
6354
|
+
function Po(e) {
|
|
6355
6355
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6356
6356
|
exports.DEBUG && console.log(e.step, "ADD[]", t, n), r.push(n + t);
|
|
6357
6357
|
}
|
|
6358
|
-
function
|
|
6358
|
+
function Go(e) {
|
|
6359
6359
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6360
6360
|
exports.DEBUG && console.log(e.step, "SUB[]", t, n), r.push(n - t);
|
|
6361
6361
|
}
|
|
6362
|
-
function
|
|
6362
|
+
function No(e) {
|
|
6363
6363
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6364
6364
|
exports.DEBUG && console.log(e.step, "DIV[]", t, n), r.push(n * 64 / t);
|
|
6365
6365
|
}
|
|
6366
|
-
function
|
|
6366
|
+
function Ho(e) {
|
|
6367
6367
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6368
6368
|
exports.DEBUG && console.log(e.step, "MUL[]", t, n), r.push(n * t / 64);
|
|
6369
6369
|
}
|
|
6370
|
-
function
|
|
6370
|
+
function Wo(e) {
|
|
6371
6371
|
var r = e.stack, t = r.pop();
|
|
6372
6372
|
exports.DEBUG && console.log(e.step, "ABS[]", t), r.push(Math.abs(t));
|
|
6373
6373
|
}
|
|
6374
|
-
function
|
|
6374
|
+
function zo(e) {
|
|
6375
6375
|
var r = e.stack, t = r.pop();
|
|
6376
6376
|
exports.DEBUG && console.log(e.step, "NEG[]", t), r.push(-t);
|
|
6377
6377
|
}
|
|
6378
|
-
function
|
|
6378
|
+
function _o(e) {
|
|
6379
6379
|
var r = e.stack, t = r.pop();
|
|
6380
6380
|
exports.DEBUG && console.log(e.step, "FLOOR[]", t), r.push(Math.floor(t / 64) * 64);
|
|
6381
6381
|
}
|
|
6382
|
-
function
|
|
6382
|
+
function Vo(e) {
|
|
6383
6383
|
var r = e.stack, t = r.pop();
|
|
6384
6384
|
exports.DEBUG && console.log(e.step, "CEILING[]", t), r.push(Math.ceil(t / 64) * 64);
|
|
6385
6385
|
}
|
|
@@ -6387,7 +6387,7 @@ function Je(e, r) {
|
|
|
6387
6387
|
var t = r.stack, n = t.pop();
|
|
6388
6388
|
exports.DEBUG && console.log(r.step, "ROUND[]"), t.push(r.round(n / 64) * 64);
|
|
6389
6389
|
}
|
|
6390
|
-
function
|
|
6390
|
+
function qo(e) {
|
|
6391
6391
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6392
6392
|
exports.DEBUG && console.log(e.step, "WCVTF[]", t, n), e.cvt[n] = t * e.ppem / e.font.unitsPerEm;
|
|
6393
6393
|
}
|
|
@@ -6404,9 +6404,9 @@ function br(e, r) {
|
|
|
6404
6404
|
}
|
|
6405
6405
|
}
|
|
6406
6406
|
}
|
|
6407
|
-
function
|
|
6407
|
+
function Xo(e) {
|
|
6408
6408
|
var r = e.stack.pop();
|
|
6409
|
-
exports.DEBUG && console.log(e.step, "SROUND[]", r), e.round =
|
|
6409
|
+
exports.DEBUG && console.log(e.step, "SROUND[]", r), e.round = Ln;
|
|
6410
6410
|
var t;
|
|
6411
6411
|
switch (r & 192) {
|
|
6412
6412
|
case 0:
|
|
@@ -6439,9 +6439,9 @@ function Vo(e) {
|
|
|
6439
6439
|
}
|
|
6440
6440
|
r &= 15, r === 0 ? e.srThreshold = 0 : e.srThreshold = (r / 8 - 0.5) * t;
|
|
6441
6441
|
}
|
|
6442
|
-
function
|
|
6442
|
+
function Yo(e) {
|
|
6443
6443
|
var r = e.stack.pop();
|
|
6444
|
-
exports.DEBUG && console.log(e.step, "S45ROUND[]", r), e.round =
|
|
6444
|
+
exports.DEBUG && console.log(e.step, "S45ROUND[]", r), e.round = Ln;
|
|
6445
6445
|
var t;
|
|
6446
6446
|
switch (r & 192) {
|
|
6447
6447
|
case 0:
|
|
@@ -6474,16 +6474,16 @@ function qo(e) {
|
|
|
6474
6474
|
}
|
|
6475
6475
|
r &= 15, r === 0 ? e.srThreshold = 0 : e.srThreshold = (r / 8 - 0.5) * t;
|
|
6476
6476
|
}
|
|
6477
|
-
function Xo(e) {
|
|
6478
|
-
exports.DEBUG && console.log(e.step, "ROFF[]"), e.round = Cs;
|
|
6479
|
-
}
|
|
6480
|
-
function Yo(e) {
|
|
6481
|
-
exports.DEBUG && console.log(e.step, "RUTG[]"), e.round = Os;
|
|
6482
|
-
}
|
|
6483
6477
|
function $o(e) {
|
|
6484
|
-
exports.DEBUG && console.log(e.step, "
|
|
6478
|
+
exports.DEBUG && console.log(e.step, "ROFF[]"), e.round = Es;
|
|
6485
6479
|
}
|
|
6486
6480
|
function Zo(e) {
|
|
6481
|
+
exports.DEBUG && console.log(e.step, "RUTG[]"), e.round = Rs;
|
|
6482
|
+
}
|
|
6483
|
+
function Qo(e) {
|
|
6484
|
+
exports.DEBUG && console.log(e.step, "RDTG[]"), e.round = Ds;
|
|
6485
|
+
}
|
|
6486
|
+
function Ko(e) {
|
|
6487
6487
|
var r = e.stack.pop();
|
|
6488
6488
|
exports.DEBUG && console.log(e.step, "SCANCTRL[]", r);
|
|
6489
6489
|
}
|
|
@@ -6493,27 +6493,27 @@ function Lt(e, r) {
|
|
|
6493
6493
|
var u, i;
|
|
6494
6494
|
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);
|
|
6495
6495
|
}
|
|
6496
|
-
function
|
|
6496
|
+
function jo(e) {
|
|
6497
6497
|
var r = e.stack, t = r.pop(), n = 0;
|
|
6498
6498
|
exports.DEBUG && console.log(e.step, "GETINFO[]", t), t & 1 && (n = 35), t & 32 && (n |= 4096), r.push(n);
|
|
6499
6499
|
}
|
|
6500
|
-
function
|
|
6500
|
+
function Jo(e) {
|
|
6501
6501
|
var r = e.stack, t = r.pop(), n = r.pop(), a = r.pop();
|
|
6502
6502
|
exports.DEBUG && console.log(e.step, "ROLL[]"), r.push(n), r.push(t), r.push(a);
|
|
6503
6503
|
}
|
|
6504
|
-
function
|
|
6504
|
+
function ei(e) {
|
|
6505
6505
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6506
6506
|
exports.DEBUG && console.log(e.step, "MAX[]", t, n), r.push(Math.max(n, t));
|
|
6507
6507
|
}
|
|
6508
|
-
function
|
|
6508
|
+
function ri(e) {
|
|
6509
6509
|
var r = e.stack, t = r.pop(), n = r.pop();
|
|
6510
6510
|
exports.DEBUG && console.log(e.step, "MIN[]", t, n), r.push(Math.min(n, t));
|
|
6511
6511
|
}
|
|
6512
|
-
function
|
|
6512
|
+
function ti(e) {
|
|
6513
6513
|
var r = e.stack.pop();
|
|
6514
6514
|
exports.DEBUG && console.log(e.step, "SCANTYPE[]", r);
|
|
6515
6515
|
}
|
|
6516
|
-
function
|
|
6516
|
+
function ni(e) {
|
|
6517
6517
|
var r = e.stack.pop(), t = e.stack.pop();
|
|
6518
6518
|
switch (exports.DEBUG && console.log(e.step, "INSTCTRL[]", r, t), r) {
|
|
6519
6519
|
case 1:
|
|
@@ -6543,20 +6543,20 @@ function ge(e, r) {
|
|
|
6543
6543
|
r.ip = t;
|
|
6544
6544
|
}
|
|
6545
6545
|
function T(e, r, t, n, a, s) {
|
|
6546
|
-
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,
|
|
6547
|
-
m = g = d.distance(c, f, !0, !0),
|
|
6546
|
+
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;
|
|
6547
|
+
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(
|
|
6548
6548
|
s.step,
|
|
6549
6549
|
(e ? "MIRP[" : "MDRP[") + (r ? "M" : "m") + (t ? ">" : "_") + (n ? "R" : "_") + (a === 0 ? "Gr" : a === 1 ? "Bl" : a === 2 ? "Wh" : "") + "]",
|
|
6550
|
-
e ? u + "(" + s.cvt[u] + "," +
|
|
6550
|
+
e ? u + "(" + s.cvt[u] + "," + U + ")" : "",
|
|
6551
6551
|
i,
|
|
6552
6552
|
"(d =",
|
|
6553
6553
|
g,
|
|
6554
6554
|
"->",
|
|
6555
|
-
|
|
6555
|
+
x * m,
|
|
6556
6556
|
")"
|
|
6557
6557
|
), s.rp1 = s.rp0, s.rp2 = i, r && (s.rp0 = i);
|
|
6558
6558
|
}
|
|
6559
|
-
|
|
6559
|
+
Cn = [
|
|
6560
6560
|
/* 0x00 */
|
|
6561
6561
|
gt.bind(void 0, pe),
|
|
6562
6562
|
/* 0x01 */
|
|
@@ -6578,45 +6578,45 @@ Un = [
|
|
|
6578
6578
|
/* 0x09 */
|
|
6579
6579
|
bt.bind(void 0, 1),
|
|
6580
6580
|
/* 0x0A */
|
|
6581
|
-
|
|
6581
|
+
Bs,
|
|
6582
6582
|
/* 0x0B */
|
|
6583
|
-
|
|
6583
|
+
Ms,
|
|
6584
6584
|
/* 0x0C */
|
|
6585
|
-
|
|
6585
|
+
Is,
|
|
6586
6586
|
/* 0x0D */
|
|
6587
|
-
|
|
6587
|
+
Ps,
|
|
6588
6588
|
/* 0x0E */
|
|
6589
|
-
|
|
6589
|
+
Gs,
|
|
6590
6590
|
/* 0x0F */
|
|
6591
|
-
|
|
6591
|
+
Ns,
|
|
6592
6592
|
/* 0x10 */
|
|
6593
|
-
|
|
6593
|
+
Hs,
|
|
6594
6594
|
/* 0x11 */
|
|
6595
|
-
|
|
6595
|
+
Ws,
|
|
6596
6596
|
/* 0x12 */
|
|
6597
|
-
|
|
6597
|
+
zs,
|
|
6598
6598
|
/* 0x13 */
|
|
6599
|
-
|
|
6599
|
+
_s,
|
|
6600
6600
|
/* 0x14 */
|
|
6601
|
-
|
|
6601
|
+
Vs,
|
|
6602
6602
|
/* 0x15 */
|
|
6603
|
-
|
|
6603
|
+
qs,
|
|
6604
6604
|
/* 0x16 */
|
|
6605
|
-
|
|
6605
|
+
Xs,
|
|
6606
6606
|
/* 0x17 */
|
|
6607
|
-
|
|
6607
|
+
Ys,
|
|
6608
6608
|
/* 0x18 */
|
|
6609
|
-
|
|
6609
|
+
$s,
|
|
6610
6610
|
/* 0x19 */
|
|
6611
|
-
|
|
6611
|
+
Zs,
|
|
6612
6612
|
/* 0x1A */
|
|
6613
|
-
|
|
6613
|
+
Qs,
|
|
6614
6614
|
/* 0x1B */
|
|
6615
|
-
|
|
6615
|
+
Ks,
|
|
6616
6616
|
/* 0x1C */
|
|
6617
|
-
|
|
6617
|
+
js,
|
|
6618
6618
|
/* 0x1D */
|
|
6619
|
-
|
|
6619
|
+
Js,
|
|
6620
6620
|
/* 0x1E */
|
|
6621
6621
|
void 0,
|
|
6622
6622
|
// TODO SSWCI
|
|
@@ -6624,19 +6624,19 @@ Un = [
|
|
|
6624
6624
|
void 0,
|
|
6625
6625
|
// TODO SSW
|
|
6626
6626
|
/* 0x20 */
|
|
6627
|
-
|
|
6627
|
+
eo,
|
|
6628
6628
|
/* 0x21 */
|
|
6629
6629
|
yr,
|
|
6630
6630
|
/* 0x22 */
|
|
6631
|
-
|
|
6631
|
+
ro,
|
|
6632
6632
|
/* 0x23 */
|
|
6633
|
-
|
|
6633
|
+
to,
|
|
6634
6634
|
/* 0x24 */
|
|
6635
|
-
|
|
6635
|
+
no,
|
|
6636
6636
|
/* 0x25 */
|
|
6637
|
-
|
|
6637
|
+
oo,
|
|
6638
6638
|
/* 0x26 */
|
|
6639
|
-
|
|
6639
|
+
io,
|
|
6640
6640
|
/* 0x27 */
|
|
6641
6641
|
void 0,
|
|
6642
6642
|
// TODO ALIGNPTS
|
|
@@ -6646,11 +6646,11 @@ Un = [
|
|
|
6646
6646
|
void 0,
|
|
6647
6647
|
// TODO UTP
|
|
6648
6648
|
/* 0x2A */
|
|
6649
|
-
|
|
6649
|
+
ao,
|
|
6650
6650
|
/* 0x2B */
|
|
6651
|
-
|
|
6651
|
+
so,
|
|
6652
6652
|
/* 0x2C */
|
|
6653
|
-
|
|
6653
|
+
uo,
|
|
6654
6654
|
/* 0x2D */
|
|
6655
6655
|
void 0,
|
|
6656
6656
|
// ENDF (eaten by FDEF)
|
|
@@ -6675,33 +6675,33 @@ Un = [
|
|
|
6675
6675
|
/* 0x37 */
|
|
6676
6676
|
Ut.bind(void 0, 1),
|
|
6677
6677
|
/* 0x38 */
|
|
6678
|
-
|
|
6678
|
+
lo,
|
|
6679
6679
|
/* 0x39 */
|
|
6680
|
-
|
|
6680
|
+
fo,
|
|
6681
6681
|
/* 0x3A */
|
|
6682
6682
|
Ct.bind(void 0, 0),
|
|
6683
6683
|
/* 0x3B */
|
|
6684
6684
|
Ct.bind(void 0, 1),
|
|
6685
6685
|
/* 0x3C */
|
|
6686
|
-
|
|
6686
|
+
po,
|
|
6687
6687
|
/* 0x3D */
|
|
6688
|
-
|
|
6688
|
+
co,
|
|
6689
6689
|
/* 0x3E */
|
|
6690
6690
|
wt.bind(void 0, 0),
|
|
6691
6691
|
/* 0x3F */
|
|
6692
6692
|
wt.bind(void 0, 1),
|
|
6693
6693
|
/* 0x40 */
|
|
6694
|
-
|
|
6694
|
+
ho,
|
|
6695
6695
|
/* 0x41 */
|
|
6696
|
-
|
|
6696
|
+
vo,
|
|
6697
6697
|
/* 0x42 */
|
|
6698
|
-
|
|
6698
|
+
go,
|
|
6699
6699
|
/* 0x43 */
|
|
6700
|
-
|
|
6700
|
+
mo,
|
|
6701
6701
|
/* 0x44 */
|
|
6702
|
-
|
|
6702
|
+
yo,
|
|
6703
6703
|
/* 0x45 */
|
|
6704
|
-
|
|
6704
|
+
xo,
|
|
6705
6705
|
/* 0x46 */
|
|
6706
6706
|
Et.bind(void 0, 0),
|
|
6707
6707
|
/* 0x47 */
|
|
@@ -6714,12 +6714,12 @@ Un = [
|
|
|
6714
6714
|
/* 0x4A */
|
|
6715
6715
|
Ot.bind(void 0, 1),
|
|
6716
6716
|
/* 0x4B */
|
|
6717
|
-
|
|
6717
|
+
bo,
|
|
6718
6718
|
/* 0x4C */
|
|
6719
6719
|
void 0,
|
|
6720
6720
|
// TODO MPS
|
|
6721
6721
|
/* 0x4D */
|
|
6722
|
-
|
|
6722
|
+
So,
|
|
6723
6723
|
/* 0x4E */
|
|
6724
6724
|
void 0,
|
|
6725
6725
|
// TODO FLIPOFF
|
|
@@ -6727,53 +6727,53 @@ Un = [
|
|
|
6727
6727
|
void 0,
|
|
6728
6728
|
// TODO DEBUG
|
|
6729
6729
|
/* 0x50 */
|
|
6730
|
-
|
|
6730
|
+
To,
|
|
6731
6731
|
/* 0x51 */
|
|
6732
|
-
|
|
6732
|
+
ko,
|
|
6733
6733
|
/* 0x52 */
|
|
6734
|
-
|
|
6734
|
+
Fo,
|
|
6735
6735
|
/* 0x53 */
|
|
6736
|
-
|
|
6736
|
+
Uo,
|
|
6737
6737
|
/* 0x54 */
|
|
6738
|
-
|
|
6738
|
+
Co,
|
|
6739
6739
|
/* 0x55 */
|
|
6740
|
-
|
|
6740
|
+
wo,
|
|
6741
6741
|
/* 0x56 */
|
|
6742
|
-
|
|
6742
|
+
Eo,
|
|
6743
6743
|
/* 0x57 */
|
|
6744
|
-
|
|
6744
|
+
Oo,
|
|
6745
6745
|
/* 0x58 */
|
|
6746
|
-
|
|
6746
|
+
Lo,
|
|
6747
6747
|
/* 0x59 */
|
|
6748
|
-
|
|
6748
|
+
Ro,
|
|
6749
6749
|
/* 0x5A */
|
|
6750
|
-
|
|
6750
|
+
Do,
|
|
6751
6751
|
/* 0x5B */
|
|
6752
|
-
|
|
6752
|
+
Ao,
|
|
6753
6753
|
/* 0x5C */
|
|
6754
|
-
|
|
6754
|
+
Bo,
|
|
6755
6755
|
/* 0x5D */
|
|
6756
6756
|
xr.bind(void 0, 1),
|
|
6757
6757
|
/* 0x5E */
|
|
6758
|
-
|
|
6758
|
+
Mo,
|
|
6759
6759
|
/* 0x5F */
|
|
6760
|
-
|
|
6760
|
+
Io,
|
|
6761
6761
|
/* 0x60 */
|
|
6762
|
-
|
|
6762
|
+
Po,
|
|
6763
6763
|
/* 0x61 */
|
|
6764
|
-
|
|
6764
|
+
Go,
|
|
6765
6765
|
/* 0x62 */
|
|
6766
|
-
|
|
6766
|
+
No,
|
|
6767
6767
|
/* 0x63 */
|
|
6768
|
-
|
|
6768
|
+
Ho,
|
|
6769
6769
|
/* 0x64 */
|
|
6770
|
-
|
|
6770
|
+
Wo,
|
|
6771
6771
|
/* 0x65 */
|
|
6772
|
-
|
|
6772
|
+
zo,
|
|
6773
6773
|
/* 0x66 */
|
|
6774
|
-
|
|
6774
|
+
_o,
|
|
6775
6775
|
/* 0x67 */
|
|
6776
|
-
|
|
6776
|
+
Vo,
|
|
6777
6777
|
/* 0x68 */
|
|
6778
6778
|
Je.bind(void 0, 0),
|
|
6779
6779
|
/* 0x69 */
|
|
@@ -6795,7 +6795,7 @@ Un = [
|
|
|
6795
6795
|
void 0,
|
|
6796
6796
|
// TODO NROUND[ab]
|
|
6797
6797
|
/* 0x70 */
|
|
6798
|
-
|
|
6798
|
+
qo,
|
|
6799
6799
|
/* 0x71 */
|
|
6800
6800
|
xr.bind(void 0, 2),
|
|
6801
6801
|
/* 0x72 */
|
|
@@ -6807,9 +6807,9 @@ Un = [
|
|
|
6807
6807
|
/* 0x75 */
|
|
6808
6808
|
br.bind(void 0, 3),
|
|
6809
6809
|
/* 0x76 */
|
|
6810
|
-
|
|
6810
|
+
Xo,
|
|
6811
6811
|
/* 0x77 */
|
|
6812
|
-
|
|
6812
|
+
Yo,
|
|
6813
6813
|
/* 0x78 */
|
|
6814
6814
|
void 0,
|
|
6815
6815
|
// TODO JROT[]
|
|
@@ -6817,13 +6817,13 @@ Un = [
|
|
|
6817
6817
|
void 0,
|
|
6818
6818
|
// TODO JROF[]
|
|
6819
6819
|
/* 0x7A */
|
|
6820
|
-
|
|
6820
|
+
$o,
|
|
6821
6821
|
/* 0x7B */
|
|
6822
6822
|
void 0,
|
|
6823
6823
|
/* 0x7C */
|
|
6824
|
-
|
|
6824
|
+
Zo,
|
|
6825
6825
|
/* 0x7D */
|
|
6826
|
-
|
|
6826
|
+
Qo,
|
|
6827
6827
|
/* 0x7E */
|
|
6828
6828
|
yr,
|
|
6829
6829
|
// actually SANGW, supposed to do only a pop though
|
|
@@ -6844,26 +6844,26 @@ Un = [
|
|
|
6844
6844
|
/* 0x84 */
|
|
6845
6845
|
void 0,
|
|
6846
6846
|
/* 0x85 */
|
|
6847
|
-
|
|
6847
|
+
Ko,
|
|
6848
6848
|
/* 0x86 */
|
|
6849
6849
|
Lt.bind(void 0, 0),
|
|
6850
6850
|
/* 0x87 */
|
|
6851
6851
|
Lt.bind(void 0, 1),
|
|
6852
6852
|
/* 0x88 */
|
|
6853
|
-
|
|
6853
|
+
jo,
|
|
6854
6854
|
/* 0x89 */
|
|
6855
6855
|
void 0,
|
|
6856
6856
|
// TODO IDEF
|
|
6857
6857
|
/* 0x8A */
|
|
6858
|
-
|
|
6858
|
+
Jo,
|
|
6859
6859
|
/* 0x8B */
|
|
6860
|
-
|
|
6860
|
+
ei,
|
|
6861
6861
|
/* 0x8C */
|
|
6862
|
-
|
|
6862
|
+
ri,
|
|
6863
6863
|
/* 0x8D */
|
|
6864
|
-
|
|
6864
|
+
ti,
|
|
6865
6865
|
/* 0x8E */
|
|
6866
|
-
|
|
6866
|
+
ni,
|
|
6867
6867
|
/* 0x8F */
|
|
6868
6868
|
void 0,
|
|
6869
6869
|
/* 0x90 */
|
|
@@ -7097,7 +7097,7 @@ function Re(e) {
|
|
|
7097
7097
|
function qr(e, r, t) {
|
|
7098
7098
|
this.contextName = t, this.startIndex = e, this.endOffset = r;
|
|
7099
7099
|
}
|
|
7100
|
-
function
|
|
7100
|
+
function ai(e, r, t) {
|
|
7101
7101
|
this.contextName = e, this.openRange = null, this.ranges = [], this.checkStart = r, this.checkEnd = t;
|
|
7102
7102
|
}
|
|
7103
7103
|
function re(e, r) {
|
|
@@ -7106,7 +7106,7 @@ function re(e, r) {
|
|
|
7106
7106
|
function fr(e) {
|
|
7107
7107
|
this.eventId = e, this.subscribers = [];
|
|
7108
7108
|
}
|
|
7109
|
-
function
|
|
7109
|
+
function si(e) {
|
|
7110
7110
|
var r = this, t = [
|
|
7111
7111
|
"start",
|
|
7112
7112
|
"end",
|
|
@@ -7145,7 +7145,7 @@ function ni(e) {
|
|
|
7145
7145
|
});
|
|
7146
7146
|
}
|
|
7147
7147
|
function N(e) {
|
|
7148
|
-
this.tokens = [], this.registeredContexts = {}, this.contextCheckers = [], this.events = {}, this.registeredModifiers = [],
|
|
7148
|
+
this.tokens = [], this.registeredContexts = {}, this.contextCheckers = [], this.events = {}, this.registeredModifiers = [], si.call(this, e);
|
|
7149
7149
|
}
|
|
7150
7150
|
Re.prototype.setState = function(e, r) {
|
|
7151
7151
|
return this.state[e] = r, this.activeState = { key: e, value: this.state[e] }, this.activeState;
|
|
@@ -7283,7 +7283,7 @@ N.prototype.registerContextChecker = function(e, r, t) {
|
|
|
7283
7283
|
return {
|
|
7284
7284
|
FAIL: "missing context end check."
|
|
7285
7285
|
};
|
|
7286
|
-
var n = new
|
|
7286
|
+
var n = new ai(
|
|
7287
7287
|
e,
|
|
7288
7288
|
r,
|
|
7289
7289
|
t
|
|
@@ -7347,7 +7347,7 @@ N.prototype.tokenize = function(e) {
|
|
|
7347
7347
|
function be(e) {
|
|
7348
7348
|
return /[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(e);
|
|
7349
7349
|
}
|
|
7350
|
-
function
|
|
7350
|
+
function Dn(e) {
|
|
7351
7351
|
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);
|
|
7352
7352
|
}
|
|
7353
7353
|
function Se(e) {
|
|
@@ -7356,7 +7356,7 @@ function Se(e) {
|
|
|
7356
7356
|
function rr(e) {
|
|
7357
7357
|
return /[A-z]/.test(e);
|
|
7358
7358
|
}
|
|
7359
|
-
function
|
|
7359
|
+
function oi(e) {
|
|
7360
7360
|
return /\s/.test(e);
|
|
7361
7361
|
}
|
|
7362
7362
|
function J(e) {
|
|
@@ -7385,11 +7385,11 @@ function Ye(e, r) {
|
|
|
7385
7385
|
}
|
|
7386
7386
|
return -1;
|
|
7387
7387
|
}
|
|
7388
|
-
function
|
|
7388
|
+
function ii(e, r) {
|
|
7389
7389
|
var t = Ye(e, r.coverage);
|
|
7390
7390
|
return t === -1 ? null : e + r.deltaGlyphId;
|
|
7391
7391
|
}
|
|
7392
|
-
function
|
|
7392
|
+
function ui(e, r) {
|
|
7393
7393
|
var t = Ye(e, r.coverage);
|
|
7394
7394
|
return t === -1 ? null : r.substitute[t];
|
|
7395
7395
|
}
|
|
@@ -7402,7 +7402,7 @@ function Sr(e, r) {
|
|
|
7402
7402
|
}
|
|
7403
7403
|
return t.length !== e.length ? -1 : t;
|
|
7404
7404
|
}
|
|
7405
|
-
function
|
|
7405
|
+
function li(e, r) {
|
|
7406
7406
|
var t = r.inputCoverage.length + r.lookaheadCoverage.length + r.backtrackCoverage.length;
|
|
7407
7407
|
if (e.context.length < t)
|
|
7408
7408
|
return [];
|
|
@@ -7431,17 +7431,17 @@ function ii(e, r) {
|
|
|
7431
7431
|
), c = n.length === r.inputCoverage.length && u.length === r.lookaheadCoverage.length && f.length === r.backtrackCoverage.length, p = [];
|
|
7432
7432
|
if (c)
|
|
7433
7433
|
for (var h = 0; h < r.lookupRecords.length; h++)
|
|
7434
|
-
for (var d = r.lookupRecords[h], g = d.lookupListIndex, m = this.getLookupByIndex(g),
|
|
7435
|
-
var
|
|
7436
|
-
if (
|
|
7434
|
+
for (var d = r.lookupRecords[h], g = d.lookupListIndex, m = this.getLookupByIndex(g), x = 0; x < m.subtables.length; x++) {
|
|
7435
|
+
var U = m.subtables[x], y = this.getLookupMethod(m, U), L = this.getSubstitutionType(m, U);
|
|
7436
|
+
if (L === "12")
|
|
7437
7437
|
for (var w = 0; w < n.length; w++) {
|
|
7438
|
-
var
|
|
7438
|
+
var B = e.get(w), C = y(B);
|
|
7439
7439
|
C && p.push(C);
|
|
7440
7440
|
}
|
|
7441
7441
|
}
|
|
7442
7442
|
return p;
|
|
7443
7443
|
}
|
|
7444
|
-
function
|
|
7444
|
+
function fi(e, r) {
|
|
7445
7445
|
var t = e.current, n = Ye(t, r.coverage);
|
|
7446
7446
|
if (n === -1)
|
|
7447
7447
|
return null;
|
|
@@ -7457,7 +7457,7 @@ function ui(e, r) {
|
|
|
7457
7457
|
}
|
|
7458
7458
|
return null;
|
|
7459
7459
|
}
|
|
7460
|
-
function
|
|
7460
|
+
function pi(e, r) {
|
|
7461
7461
|
var t = Ye(e, r.coverage);
|
|
7462
7462
|
return t === -1 ? null : r.sequences[t];
|
|
7463
7463
|
}
|
|
@@ -7519,35 +7519,35 @@ J.prototype.getLookupMethod = function(e, r) {
|
|
|
7519
7519
|
switch (n) {
|
|
7520
7520
|
case "11":
|
|
7521
7521
|
return function(a) {
|
|
7522
|
-
return
|
|
7522
|
+
return ii.apply(
|
|
7523
7523
|
t,
|
|
7524
7524
|
[a, r]
|
|
7525
7525
|
);
|
|
7526
7526
|
};
|
|
7527
7527
|
case "12":
|
|
7528
7528
|
return function(a) {
|
|
7529
|
-
return
|
|
7529
|
+
return ui.apply(
|
|
7530
7530
|
t,
|
|
7531
7531
|
[a, r]
|
|
7532
7532
|
);
|
|
7533
7533
|
};
|
|
7534
7534
|
case "63":
|
|
7535
7535
|
return function(a) {
|
|
7536
|
-
return
|
|
7536
|
+
return li.apply(
|
|
7537
7537
|
t,
|
|
7538
7538
|
[a, r]
|
|
7539
7539
|
);
|
|
7540
7540
|
};
|
|
7541
7541
|
case "41":
|
|
7542
7542
|
return function(a) {
|
|
7543
|
-
return
|
|
7543
|
+
return fi.apply(
|
|
7544
7544
|
t,
|
|
7545
7545
|
[a, r]
|
|
7546
7546
|
);
|
|
7547
7547
|
};
|
|
7548
7548
|
case "21":
|
|
7549
7549
|
return function(a) {
|
|
7550
|
-
return
|
|
7550
|
+
return pi.apply(
|
|
7551
7551
|
t,
|
|
7552
7552
|
[a, r]
|
|
7553
7553
|
);
|
|
@@ -7640,7 +7640,7 @@ J.prototype.getFeature = function(r) {
|
|
|
7640
7640
|
var t = this.features[r.script];
|
|
7641
7641
|
return t ? t.tags[r.tag] ? this.features[r.script].tags[r.tag] : null : { FAIL: "No feature for script " + r.script };
|
|
7642
7642
|
};
|
|
7643
|
-
function
|
|
7643
|
+
function ci(e) {
|
|
7644
7644
|
var r = e.current, t = e.get(-1);
|
|
7645
7645
|
return (
|
|
7646
7646
|
// ? arabic first char
|
|
@@ -7648,7 +7648,7 @@ function fi(e) {
|
|
|
7648
7648
|
!be(t) && be(r)
|
|
7649
7649
|
);
|
|
7650
7650
|
}
|
|
7651
|
-
function
|
|
7651
|
+
function hi(e) {
|
|
7652
7652
|
var r = e.get(1);
|
|
7653
7653
|
return (
|
|
7654
7654
|
// ? last arabic char
|
|
@@ -7656,24 +7656,24 @@ function pi(e) {
|
|
|
7656
7656
|
!be(r)
|
|
7657
7657
|
);
|
|
7658
7658
|
}
|
|
7659
|
-
var
|
|
7660
|
-
startCheck:
|
|
7661
|
-
endCheck:
|
|
7659
|
+
var vi = {
|
|
7660
|
+
startCheck: ci,
|
|
7661
|
+
endCheck: hi
|
|
7662
7662
|
};
|
|
7663
|
-
function
|
|
7663
|
+
function di(e) {
|
|
7664
7664
|
var r = e.current, t = e.get(-1);
|
|
7665
7665
|
return (
|
|
7666
7666
|
// ? an arabic char preceded with a non arabic char
|
|
7667
7667
|
(be(r) || Se(r)) && !be(t)
|
|
7668
7668
|
);
|
|
7669
7669
|
}
|
|
7670
|
-
function
|
|
7670
|
+
function gi(e) {
|
|
7671
7671
|
var r = e.get(1);
|
|
7672
7672
|
switch (!0) {
|
|
7673
7673
|
case r === null:
|
|
7674
7674
|
return !0;
|
|
7675
7675
|
case (!be(r) && !Se(r)):
|
|
7676
|
-
var t =
|
|
7676
|
+
var t = oi(r);
|
|
7677
7677
|
if (!t)
|
|
7678
7678
|
return !0;
|
|
7679
7679
|
if (t) {
|
|
@@ -7690,40 +7690,40 @@ function vi(e) {
|
|
|
7690
7690
|
return !1;
|
|
7691
7691
|
}
|
|
7692
7692
|
}
|
|
7693
|
-
var
|
|
7694
|
-
startCheck:
|
|
7695
|
-
endCheck:
|
|
7693
|
+
var mi = {
|
|
7694
|
+
startCheck: di,
|
|
7695
|
+
endCheck: gi
|
|
7696
7696
|
};
|
|
7697
|
-
function
|
|
7697
|
+
function yi(e, r, t) {
|
|
7698
7698
|
r[t].setState(e.tag, e.substitution);
|
|
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
|
e.substitution.forEach(function(n, a) {
|
|
7705
7705
|
var s = r[t + a];
|
|
7706
7706
|
s.setState(e.tag, n);
|
|
7707
7707
|
});
|
|
7708
7708
|
}
|
|
7709
|
-
function
|
|
7709
|
+
function Si(e, r, t) {
|
|
7710
7710
|
var n = r[t];
|
|
7711
7711
|
n.setState(e.tag, e.substitution.ligGlyph);
|
|
7712
7712
|
for (var a = e.substitution.components.length, s = 0; s < a; s++)
|
|
7713
7713
|
n = r[t + s + 1], n.setState("deleted", !0);
|
|
7714
7714
|
}
|
|
7715
7715
|
var Rt = {
|
|
7716
|
-
11:
|
|
7717
|
-
12:
|
|
7718
|
-
63:
|
|
7719
|
-
41:
|
|
7716
|
+
11: yi,
|
|
7717
|
+
12: xi,
|
|
7718
|
+
63: bi,
|
|
7719
|
+
41: Si
|
|
7720
7720
|
};
|
|
7721
7721
|
function Xr(e, r, t) {
|
|
7722
7722
|
e instanceof Fe && Rt[e.id] && Rt[e.id](e, r, t);
|
|
7723
7723
|
}
|
|
7724
|
-
function
|
|
7724
|
+
function Ti(e) {
|
|
7725
7725
|
for (var r = [].concat(e.backtrack), t = r.length - 1; t >= 0; t--) {
|
|
7726
|
-
var n = r[t], a =
|
|
7726
|
+
var n = r[t], a = Dn(n), s = Se(n);
|
|
7727
7727
|
if (!a && !s)
|
|
7728
7728
|
return !0;
|
|
7729
7729
|
if (a)
|
|
@@ -7731,8 +7731,8 @@ function bi(e) {
|
|
|
7731
7731
|
}
|
|
7732
7732
|
return !1;
|
|
7733
7733
|
}
|
|
7734
|
-
function
|
|
7735
|
-
if (
|
|
7734
|
+
function ki(e) {
|
|
7735
|
+
if (Dn(e.current))
|
|
7736
7736
|
return !1;
|
|
7737
7737
|
for (var r = 0; r < e.lookahead.length; r++) {
|
|
7738
7738
|
var t = e.lookahead[r], n = Se(t);
|
|
@@ -7741,7 +7741,7 @@ function Si(e) {
|
|
|
7741
7741
|
}
|
|
7742
7742
|
return !1;
|
|
7743
7743
|
}
|
|
7744
|
-
function
|
|
7744
|
+
function Fi(e) {
|
|
7745
7745
|
var r = this, t = "arab", n = this.featuresTags[t], a = this.tokenizer.getRangeTokens(e);
|
|
7746
7746
|
if (a.length !== 1) {
|
|
7747
7747
|
var s = new re(
|
|
@@ -7763,7 +7763,7 @@ function Ti(e) {
|
|
|
7763
7763
|
if (!Se(u.char)) {
|
|
7764
7764
|
s.setCurrentIndex(i), o.setCurrentIndex(i);
|
|
7765
7765
|
var l = 0;
|
|
7766
|
-
|
|
7766
|
+
Ti(o) && (l |= 1), ki(o) && (l |= 2);
|
|
7767
7767
|
var f;
|
|
7768
7768
|
switch (l) {
|
|
7769
7769
|
case 1:
|
|
@@ -7798,7 +7798,7 @@ function Dt(e, r) {
|
|
|
7798
7798
|
});
|
|
7799
7799
|
return new re(t, 0);
|
|
7800
7800
|
}
|
|
7801
|
-
function
|
|
7801
|
+
function Ui(e) {
|
|
7802
7802
|
var r = this, t = "arab", n = this.tokenizer.getRangeTokens(e), a = Dt(n);
|
|
7803
7803
|
a.context.forEach(function(s, o) {
|
|
7804
7804
|
a.setCurrentIndex(o);
|
|
@@ -7814,7 +7814,7 @@ function ki(e) {
|
|
|
7814
7814
|
), a = Dt(n));
|
|
7815
7815
|
});
|
|
7816
7816
|
}
|
|
7817
|
-
function
|
|
7817
|
+
function Ci(e) {
|
|
7818
7818
|
var r = e.current, t = e.get(-1);
|
|
7819
7819
|
return (
|
|
7820
7820
|
// ? latin first char
|
|
@@ -7822,7 +7822,7 @@ function Fi(e) {
|
|
|
7822
7822
|
!rr(t) && rr(r)
|
|
7823
7823
|
);
|
|
7824
7824
|
}
|
|
7825
|
-
function
|
|
7825
|
+
function wi(e) {
|
|
7826
7826
|
var r = e.get(1);
|
|
7827
7827
|
return (
|
|
7828
7828
|
// ? last latin char
|
|
@@ -7830,9 +7830,9 @@ function Ui(e) {
|
|
|
7830
7830
|
!rr(r)
|
|
7831
7831
|
);
|
|
7832
7832
|
}
|
|
7833
|
-
var
|
|
7834
|
-
startCheck:
|
|
7835
|
-
endCheck:
|
|
7833
|
+
var Ei = {
|
|
7834
|
+
startCheck: Ci,
|
|
7835
|
+
endCheck: wi
|
|
7836
7836
|
};
|
|
7837
7837
|
function At(e, r) {
|
|
7838
7838
|
var t = e.map(function(n) {
|
|
@@ -7840,7 +7840,7 @@ function At(e, r) {
|
|
|
7840
7840
|
});
|
|
7841
7841
|
return new re(t, 0);
|
|
7842
7842
|
}
|
|
7843
|
-
function
|
|
7843
|
+
function Oi(e) {
|
|
7844
7844
|
var r = this, t = "latn", n = this.tokenizer.getRangeTokens(e), a = At(n);
|
|
7845
7845
|
a.context.forEach(function(s, o) {
|
|
7846
7846
|
a.setCurrentIndex(o);
|
|
@@ -7863,9 +7863,9 @@ ae.prototype.setText = function(e) {
|
|
|
7863
7863
|
this.text = e;
|
|
7864
7864
|
};
|
|
7865
7865
|
ae.prototype.contextChecks = {
|
|
7866
|
-
latinWordCheck:
|
|
7867
|
-
arabicWordCheck:
|
|
7868
|
-
arabicSentenceCheck:
|
|
7866
|
+
latinWordCheck: Ei,
|
|
7867
|
+
arabicWordCheck: vi,
|
|
7868
|
+
arabicSentenceCheck: mi
|
|
7869
7869
|
};
|
|
7870
7870
|
function Tr(e) {
|
|
7871
7871
|
var r = this.contextChecks[e + "Check"];
|
|
@@ -7875,10 +7875,10 @@ function Tr(e) {
|
|
|
7875
7875
|
r.endCheck
|
|
7876
7876
|
);
|
|
7877
7877
|
}
|
|
7878
|
-
function
|
|
7878
|
+
function Li() {
|
|
7879
7879
|
return Tr.call(this, "latinWord"), Tr.call(this, "arabicWord"), Tr.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
|
|
7880
7880
|
}
|
|
7881
|
-
function
|
|
7881
|
+
function Ri() {
|
|
7882
7882
|
var e = this, r = this.tokenizer.getContextRanges("arabicSentence");
|
|
7883
7883
|
r.forEach(function(t) {
|
|
7884
7884
|
var n = e.tokenizer.getRangeTokens(t);
|
|
@@ -7917,17 +7917,17 @@ function Yr() {
|
|
|
7917
7917
|
"glyphIndex modifier is required to apply arabic presentation features."
|
|
7918
7918
|
);
|
|
7919
7919
|
}
|
|
7920
|
-
function
|
|
7920
|
+
function Di() {
|
|
7921
7921
|
var e = this, r = "arab";
|
|
7922
7922
|
if (this.featuresTags.hasOwnProperty(r)) {
|
|
7923
7923
|
Yr.call(this);
|
|
7924
7924
|
var t = this.tokenizer.getContextRanges("arabicWord");
|
|
7925
7925
|
t.forEach(function(n) {
|
|
7926
|
-
|
|
7926
|
+
Fi.call(e, n);
|
|
7927
7927
|
});
|
|
7928
7928
|
}
|
|
7929
7929
|
}
|
|
7930
|
-
function
|
|
7930
|
+
function Ai() {
|
|
7931
7931
|
var e = this, r = "arab";
|
|
7932
7932
|
if (this.featuresTags.hasOwnProperty(r)) {
|
|
7933
7933
|
var t = this.featuresTags[r];
|
|
@@ -7935,12 +7935,12 @@ function Ri() {
|
|
|
7935
7935
|
Yr.call(this);
|
|
7936
7936
|
var n = this.tokenizer.getContextRanges("arabicWord");
|
|
7937
7937
|
n.forEach(function(a) {
|
|
7938
|
-
|
|
7938
|
+
Ui.call(e, a);
|
|
7939
7939
|
});
|
|
7940
7940
|
}
|
|
7941
7941
|
}
|
|
7942
7942
|
}
|
|
7943
|
-
function
|
|
7943
|
+
function Bi() {
|
|
7944
7944
|
var e = this, r = "latn";
|
|
7945
7945
|
if (this.featuresTags.hasOwnProperty(r)) {
|
|
7946
7946
|
var t = this.featuresTags[r];
|
|
@@ -7948,7 +7948,7 @@ function Di() {
|
|
|
7948
7948
|
Yr.call(this);
|
|
7949
7949
|
var n = this.tokenizer.getContextRanges("latinWord");
|
|
7950
7950
|
n.forEach(function(a) {
|
|
7951
|
-
|
|
7951
|
+
Oi.call(e, a);
|
|
7952
7952
|
});
|
|
7953
7953
|
}
|
|
7954
7954
|
}
|
|
@@ -7957,10 +7957,10 @@ ae.prototype.checkContextReady = function(e) {
|
|
|
7957
7957
|
return !!this.tokenizer.getContext(e);
|
|
7958
7958
|
};
|
|
7959
7959
|
ae.prototype.applyFeaturesToContexts = function() {
|
|
7960
|
-
this.checkContextReady("arabicWord") && (
|
|
7960
|
+
this.checkContextReady("arabicWord") && (Di.call(this), Ai.call(this)), this.checkContextReady("latinWord") && Bi.call(this), this.checkContextReady("arabicSentence") && Ri.call(this);
|
|
7961
7961
|
};
|
|
7962
7962
|
ae.prototype.processText = function(e) {
|
|
7963
|
-
(!this.text || this.text !== e) && (this.setText(e),
|
|
7963
|
+
(!this.text || this.text !== e) && (this.setText(e), Li.call(this), this.applyFeaturesToContexts());
|
|
7964
7964
|
};
|
|
7965
7965
|
ae.prototype.getBidiText = function(e) {
|
|
7966
7966
|
return this.processText(e), this.tokenizer.getText();
|
|
@@ -7976,7 +7976,7 @@ ae.prototype.getTextGlyphs = function(e) {
|
|
|
7976
7976
|
}
|
|
7977
7977
|
return r;
|
|
7978
7978
|
};
|
|
7979
|
-
function
|
|
7979
|
+
function I(e) {
|
|
7980
7980
|
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 = {
|
|
7981
7981
|
fontFamily: { en: e.familyName || " " },
|
|
7982
7982
|
fontSubfamily: { en: e.styleName || " " },
|
|
@@ -7999,26 +7999,26 @@ function M(e) {
|
|
|
7999
7999
|
usWidthClass: e.widthClass || this.usWidthClasses.MEDIUM,
|
|
8000
8000
|
fsSelection: e.fsSelection || this.fsSelectionValues.REGULAR
|
|
8001
8001
|
}, e.tables.os2)
|
|
8002
|
-
})), this.supported = !0, this.glyphs = new le.GlyphSet(this, e.glyphs || []), this.encoding = new
|
|
8002
|
+
})), 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", {
|
|
8003
8003
|
get: function() {
|
|
8004
8004
|
if (this._hinting)
|
|
8005
8005
|
return this._hinting;
|
|
8006
8006
|
if (this.outlinesFormat === "truetype")
|
|
8007
|
-
return this._hinting = new
|
|
8007
|
+
return this._hinting = new En(this);
|
|
8008
8008
|
}
|
|
8009
8009
|
});
|
|
8010
8010
|
}
|
|
8011
|
-
|
|
8011
|
+
I.prototype.hasChar = function(e) {
|
|
8012
8012
|
return this.encoding.charToGlyphIndex(e) !== null;
|
|
8013
8013
|
};
|
|
8014
|
-
|
|
8014
|
+
I.prototype.charToGlyphIndex = function(e) {
|
|
8015
8015
|
return this.encoding.charToGlyphIndex(e);
|
|
8016
8016
|
};
|
|
8017
|
-
|
|
8017
|
+
I.prototype.charToGlyph = function(e) {
|
|
8018
8018
|
var r = this.charToGlyphIndex(e), t = this.glyphs.get(r);
|
|
8019
8019
|
return t || (t = this.glyphs.get(0)), t;
|
|
8020
8020
|
};
|
|
8021
|
-
|
|
8021
|
+
I.prototype.updateFeatures = function(e) {
|
|
8022
8022
|
return this.defaultRenderOptions.features.map(function(r) {
|
|
8023
8023
|
return r.script === "latn" ? {
|
|
8024
8024
|
script: "latn",
|
|
@@ -8028,7 +8028,7 @@ M.prototype.updateFeatures = function(e) {
|
|
|
8028
8028
|
} : r;
|
|
8029
8029
|
});
|
|
8030
8030
|
};
|
|
8031
|
-
|
|
8031
|
+
I.prototype.stringToGlyphs = function(e, r) {
|
|
8032
8032
|
var t = this, n = new ae(), a = function(c) {
|
|
8033
8033
|
return t.charToGlyphIndex(c.char);
|
|
8034
8034
|
};
|
|
@@ -8039,22 +8039,22 @@ M.prototype.stringToGlyphs = function(e, r) {
|
|
|
8039
8039
|
i[f] = this.glyphs.get(o[f]) || l;
|
|
8040
8040
|
return i;
|
|
8041
8041
|
};
|
|
8042
|
-
|
|
8042
|
+
I.prototype.nameToGlyphIndex = function(e) {
|
|
8043
8043
|
return this.glyphNames.nameToGlyphIndex(e);
|
|
8044
8044
|
};
|
|
8045
|
-
|
|
8045
|
+
I.prototype.nameToGlyph = function(e) {
|
|
8046
8046
|
var r = this.nameToGlyphIndex(e), t = this.glyphs.get(r);
|
|
8047
8047
|
return t || (t = this.glyphs.get(0)), t;
|
|
8048
8048
|
};
|
|
8049
|
-
|
|
8049
|
+
I.prototype.glyphIndexToName = function(e) {
|
|
8050
8050
|
return this.glyphNames.glyphIndexToName ? this.glyphNames.glyphIndexToName(e) : "";
|
|
8051
8051
|
};
|
|
8052
|
-
|
|
8052
|
+
I.prototype.getKerningValue = function(e, r) {
|
|
8053
8053
|
e = e.index || e, r = r.index || r;
|
|
8054
8054
|
var t = this.position.defaultKerningTables;
|
|
8055
8055
|
return t ? this.position.getKerningValue(t, e, r) : this.kerningPairs[e + "," + r] || 0;
|
|
8056
8056
|
};
|
|
8057
|
-
|
|
8057
|
+
I.prototype.defaultRenderOptions = {
|
|
8058
8058
|
kerning: !0,
|
|
8059
8059
|
features: [
|
|
8060
8060
|
/**
|
|
@@ -8065,7 +8065,7 @@ M.prototype.defaultRenderOptions = {
|
|
|
8065
8065
|
{ script: "latn", tags: ["liga", "rlig"] }
|
|
8066
8066
|
]
|
|
8067
8067
|
};
|
|
8068
|
-
|
|
8068
|
+
I.prototype.forEachGlyph = function(e, r, t, n, a, s) {
|
|
8069
8069
|
r = r !== void 0 ? r : 0, t = t !== void 0 ? t : 0, n = n !== void 0 ? n : 72, a = Object.assign({}, this.defaultRenderOptions, a);
|
|
8070
8070
|
var o = 1 / this.unitsPerEm * n, u = this.stringToGlyphs(e, a), i;
|
|
8071
8071
|
if (a.kerning) {
|
|
@@ -8082,43 +8082,43 @@ M.prototype.forEachGlyph = function(e, r, t, n, a, s) {
|
|
|
8082
8082
|
}
|
|
8083
8083
|
return r;
|
|
8084
8084
|
};
|
|
8085
|
-
|
|
8086
|
-
var s = new
|
|
8085
|
+
I.prototype.getPath = function(e, r, t, n, a) {
|
|
8086
|
+
var s = new X();
|
|
8087
8087
|
return this.forEachGlyph(e, r, t, n, a, function(o, u, i, l) {
|
|
8088
8088
|
var f = o.getPath(u, i, l, a, this);
|
|
8089
8089
|
s.extend(f);
|
|
8090
8090
|
}), s;
|
|
8091
8091
|
};
|
|
8092
|
-
|
|
8092
|
+
I.prototype.getPaths = function(e, r, t, n, a) {
|
|
8093
8093
|
var s = [];
|
|
8094
8094
|
return this.forEachGlyph(e, r, t, n, a, function(o, u, i, l) {
|
|
8095
8095
|
var f = o.getPath(u, i, l, a, this);
|
|
8096
8096
|
s.push(f);
|
|
8097
8097
|
}), s;
|
|
8098
8098
|
};
|
|
8099
|
-
|
|
8099
|
+
I.prototype.getAdvanceWidth = function(e, r, t) {
|
|
8100
8100
|
return this.forEachGlyph(e, 0, 0, r, t, function() {
|
|
8101
8101
|
});
|
|
8102
8102
|
};
|
|
8103
|
-
|
|
8103
|
+
I.prototype.draw = function(e, r, t, n, a, s) {
|
|
8104
8104
|
this.getPath(r, t, n, a, s).draw(e);
|
|
8105
8105
|
};
|
|
8106
|
-
|
|
8106
|
+
I.prototype.drawPoints = function(e, r, t, n, a, s) {
|
|
8107
8107
|
this.forEachGlyph(r, t, n, a, s, function(o, u, i, l) {
|
|
8108
8108
|
o.drawPoints(e, u, i, l);
|
|
8109
8109
|
});
|
|
8110
8110
|
};
|
|
8111
|
-
|
|
8111
|
+
I.prototype.drawMetrics = function(e, r, t, n, a, s) {
|
|
8112
8112
|
this.forEachGlyph(r, t, n, a, s, function(o, u, i, l) {
|
|
8113
8113
|
o.drawMetrics(e, u, i, l);
|
|
8114
8114
|
});
|
|
8115
8115
|
};
|
|
8116
|
-
|
|
8116
|
+
I.prototype.getEnglishName = function(e) {
|
|
8117
8117
|
var r = this.names[e];
|
|
8118
8118
|
if (r)
|
|
8119
8119
|
return r.en;
|
|
8120
8120
|
};
|
|
8121
|
-
|
|
8121
|
+
I.prototype.validate = function() {
|
|
8122
8122
|
var e = this;
|
|
8123
8123
|
function r(n, a) {
|
|
8124
8124
|
}
|
|
@@ -8128,22 +8128,22 @@ M.prototype.validate = function() {
|
|
|
8128
8128
|
}
|
|
8129
8129
|
t("fontFamily"), t("weightName"), t("manufacturer"), t("copyright"), t("version"), this.unitsPerEm > 0;
|
|
8130
8130
|
};
|
|
8131
|
-
|
|
8132
|
-
return
|
|
8131
|
+
I.prototype.toTables = function() {
|
|
8132
|
+
return bs.fontToTable(this);
|
|
8133
8133
|
};
|
|
8134
|
-
|
|
8134
|
+
I.prototype.toBuffer = function() {
|
|
8135
8135
|
return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."), this.toArrayBuffer();
|
|
8136
8136
|
};
|
|
8137
|
-
|
|
8137
|
+
I.prototype.toArrayBuffer = function() {
|
|
8138
8138
|
for (var e = this.toTables(), r = e.encode(), t = new ArrayBuffer(r.length), n = new Uint8Array(t), a = 0; a < r.length; a++)
|
|
8139
8139
|
n[a] = r[a];
|
|
8140
8140
|
return t;
|
|
8141
8141
|
};
|
|
8142
|
-
|
|
8142
|
+
I.prototype.download = function(e) {
|
|
8143
8143
|
var r = this.getEnglishName("fontFamily"), t = this.getEnglishName("fontSubfamily");
|
|
8144
8144
|
e = e || r.replace(/\s/g, "") + "-" + t + ".otf";
|
|
8145
8145
|
var n = this.toArrayBuffer();
|
|
8146
|
-
if (
|
|
8146
|
+
if (Ts())
|
|
8147
8147
|
if (window.URL = window.URL || window.webkitURL, window.URL) {
|
|
8148
8148
|
var a = new DataView(n), s = new Blob([a], { type: "font/opentype" }), o = document.createElement("a");
|
|
8149
8149
|
o.href = window.URL.createObjectURL(s), o.download = e;
|
|
@@ -8152,11 +8152,11 @@ M.prototype.download = function(e) {
|
|
|
8152
8152
|
} else
|
|
8153
8153
|
console.warn("Font file could not be downloaded. Try using a different browser.");
|
|
8154
8154
|
else {
|
|
8155
|
-
var i = require("fs"), l =
|
|
8155
|
+
var i = require("fs"), l = ks(n);
|
|
8156
8156
|
i.writeFileSync(e, l);
|
|
8157
8157
|
}
|
|
8158
8158
|
};
|
|
8159
|
-
|
|
8159
|
+
I.prototype.fsSelectionValues = {
|
|
8160
8160
|
ITALIC: 1,
|
|
8161
8161
|
//1
|
|
8162
8162
|
UNDERSCORE: 2,
|
|
@@ -8178,7 +8178,7 @@ M.prototype.fsSelectionValues = {
|
|
|
8178
8178
|
OBLIQUE: 512
|
|
8179
8179
|
//512
|
|
8180
8180
|
};
|
|
8181
|
-
|
|
8181
|
+
I.prototype.usWidthClasses = {
|
|
8182
8182
|
ULTRA_CONDENSED: 1,
|
|
8183
8183
|
EXTRA_CONDENSED: 2,
|
|
8184
8184
|
CONDENSED: 3,
|
|
@@ -8189,7 +8189,7 @@ M.prototype.usWidthClasses = {
|
|
|
8189
8189
|
EXTRA_EXPANDED: 8,
|
|
8190
8190
|
ULTRA_EXPANDED: 9
|
|
8191
8191
|
};
|
|
8192
|
-
|
|
8192
|
+
I.prototype.usWeightClasses = {
|
|
8193
8193
|
THIN: 100,
|
|
8194
8194
|
EXTRA_LIGHT: 200,
|
|
8195
8195
|
LIGHT: 300,
|
|
@@ -8200,7 +8200,7 @@ M.prototype.usWeightClasses = {
|
|
|
8200
8200
|
EXTRA_BOLD: 800,
|
|
8201
8201
|
BLACK: 900
|
|
8202
8202
|
};
|
|
8203
|
-
function
|
|
8203
|
+
function An(e, r) {
|
|
8204
8204
|
var t = JSON.stringify(e), n = 256;
|
|
8205
8205
|
for (var a in r) {
|
|
8206
8206
|
var s = parseInt(a);
|
|
@@ -8212,8 +8212,8 @@ function Dn(e, r) {
|
|
|
8212
8212
|
}
|
|
8213
8213
|
return r[n] = e, n;
|
|
8214
8214
|
}
|
|
8215
|
-
function
|
|
8216
|
-
var n =
|
|
8215
|
+
function Mi(e, r, t) {
|
|
8216
|
+
var n = An(r.name, t);
|
|
8217
8217
|
return [
|
|
8218
8218
|
{ name: "tag_" + e, type: "TAG", value: r.tag },
|
|
8219
8219
|
{ name: "minValue_" + e, type: "FIXED", value: r.minValue << 16 },
|
|
@@ -8223,12 +8223,12 @@ function Ai(e, r, t) {
|
|
|
8223
8223
|
{ name: "nameID_" + e, type: "USHORT", value: n }
|
|
8224
8224
|
];
|
|
8225
8225
|
}
|
|
8226
|
-
function
|
|
8226
|
+
function Ii(e, r, t) {
|
|
8227
8227
|
var n = {}, a = new k.Parser(e, r);
|
|
8228
8228
|
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;
|
|
8229
8229
|
}
|
|
8230
|
-
function
|
|
8231
|
-
for (var a =
|
|
8230
|
+
function Pi(e, r, t, n) {
|
|
8231
|
+
for (var a = An(r.name, n), s = [
|
|
8232
8232
|
{ name: "nameID_" + e, type: "USHORT", value: a },
|
|
8233
8233
|
{ name: "flags_" + e, type: "USHORT", value: 0 }
|
|
8234
8234
|
], o = 0; o < t.length; ++o) {
|
|
@@ -8241,14 +8241,14 @@ function Mi(e, r, t, n) {
|
|
|
8241
8241
|
}
|
|
8242
8242
|
return s;
|
|
8243
8243
|
}
|
|
8244
|
-
function
|
|
8244
|
+
function Gi(e, r, t, n) {
|
|
8245
8245
|
var a = {}, s = new k.Parser(e, r);
|
|
8246
8246
|
a.name = n[s.parseUShort()] || {}, s.skip("uShort", 1), a.coordinates = {};
|
|
8247
8247
|
for (var o = 0; o < t.length; ++o)
|
|
8248
8248
|
a.coordinates[t[o].tag] = s.parseFixed();
|
|
8249
8249
|
return a;
|
|
8250
8250
|
}
|
|
8251
|
-
function
|
|
8251
|
+
function Ni(e, r) {
|
|
8252
8252
|
var t = new S.Table("fvar", [
|
|
8253
8253
|
{ name: "version", type: "ULONG", value: 65536 },
|
|
8254
8254
|
{ name: "offsetToData", type: "USHORT", value: 0 },
|
|
@@ -8260,28 +8260,28 @@ function Pi(e, r) {
|
|
|
8260
8260
|
]);
|
|
8261
8261
|
t.offsetToData = t.sizeOf();
|
|
8262
8262
|
for (var n = 0; n < e.axes.length; n++)
|
|
8263
|
-
t.fields = t.fields.concat(
|
|
8263
|
+
t.fields = t.fields.concat(Mi(n, e.axes[n], r));
|
|
8264
8264
|
for (var a = 0; a < e.instances.length; a++)
|
|
8265
|
-
t.fields = t.fields.concat(
|
|
8265
|
+
t.fields = t.fields.concat(Pi(a, e.instances[a], e.axes, r));
|
|
8266
8266
|
return t;
|
|
8267
8267
|
}
|
|
8268
|
-
function
|
|
8268
|
+
function Hi(e, r, t) {
|
|
8269
8269
|
var n = new k.Parser(e, r), a = n.parseULong();
|
|
8270
8270
|
E.argument(a === 65536, "Unsupported fvar table version.");
|
|
8271
8271
|
var s = n.parseOffset16();
|
|
8272
8272
|
n.skip("uShort", 1);
|
|
8273
8273
|
for (var o = n.parseUShort(), u = n.parseUShort(), i = n.parseUShort(), l = n.parseUShort(), f = [], c = 0; c < o; c++)
|
|
8274
|
-
f.push(
|
|
8274
|
+
f.push(Ii(e, r + s + c * u, t));
|
|
8275
8275
|
for (var p = [], h = r + s + o * u, d = 0; d < i; d++)
|
|
8276
|
-
p.push(
|
|
8276
|
+
p.push(Gi(e, h + d * l, f, t));
|
|
8277
8277
|
return { axes: f, instances: p };
|
|
8278
8278
|
}
|
|
8279
|
-
var
|
|
8279
|
+
var Wi = { make: Ni, parse: Hi }, zi = function() {
|
|
8280
8280
|
return {
|
|
8281
8281
|
coverage: this.parsePointer(v.coverage),
|
|
8282
8282
|
attachPoints: this.parseList(v.pointer(v.uShortList))
|
|
8283
8283
|
};
|
|
8284
|
-
},
|
|
8284
|
+
}, _i = function() {
|
|
8285
8285
|
var e = this.parseUShort();
|
|
8286
8286
|
if (E.argument(
|
|
8287
8287
|
e === 1 || e === 2 || e === 3,
|
|
@@ -8292,17 +8292,17 @@ var Ni = { make: Pi, parse: Gi }, Hi = function() {
|
|
|
8292
8292
|
return { pointindex: this.parseShort() };
|
|
8293
8293
|
if (e === 3)
|
|
8294
8294
|
return { coordinate: this.parseShort() };
|
|
8295
|
-
},
|
|
8296
|
-
return this.parseList(v.pointer(
|
|
8297
|
-
},
|
|
8295
|
+
}, Vi = function() {
|
|
8296
|
+
return this.parseList(v.pointer(_i));
|
|
8297
|
+
}, qi = function() {
|
|
8298
8298
|
return {
|
|
8299
8299
|
coverage: this.parsePointer(v.coverage),
|
|
8300
|
-
ligGlyphs: this.parseList(v.pointer(
|
|
8300
|
+
ligGlyphs: this.parseList(v.pointer(Vi))
|
|
8301
8301
|
};
|
|
8302
|
-
},
|
|
8302
|
+
}, Xi = function() {
|
|
8303
8303
|
return this.parseUShort(), this.parseList(v.pointer(v.coverage));
|
|
8304
8304
|
};
|
|
8305
|
-
function
|
|
8305
|
+
function Yi(e, r) {
|
|
8306
8306
|
r = r || 0;
|
|
8307
8307
|
var t = new v(e, r), n = t.parseVersion(1);
|
|
8308
8308
|
E.argument(
|
|
@@ -8312,13 +8312,13 @@ function qi(e, r) {
|
|
|
8312
8312
|
var a = {
|
|
8313
8313
|
version: n,
|
|
8314
8314
|
classDef: t.parsePointer(v.classDef),
|
|
8315
|
-
attachList: t.parsePointer(
|
|
8316
|
-
ligCaretList: t.parsePointer(
|
|
8315
|
+
attachList: t.parsePointer(zi),
|
|
8316
|
+
ligCaretList: t.parsePointer(qi),
|
|
8317
8317
|
markAttachClassDef: t.parsePointer(v.classDef)
|
|
8318
8318
|
};
|
|
8319
|
-
return n >= 1.2 && (a.markGlyphSets = t.parsePointer(
|
|
8319
|
+
return n >= 1.2 && (a.markGlyphSets = t.parsePointer(Xi)), a;
|
|
8320
8320
|
}
|
|
8321
|
-
var
|
|
8321
|
+
var $i = { parse: Yi }, te = new Array(10);
|
|
8322
8322
|
te[1] = function() {
|
|
8323
8323
|
var r = this.offset + this.relativeOffset, t = this.parseUShort();
|
|
8324
8324
|
if (t === 1)
|
|
@@ -8396,7 +8396,7 @@ te[8] = function() {
|
|
|
8396
8396
|
te[9] = function() {
|
|
8397
8397
|
return { error: "GPOS Lookup 9 not supported" };
|
|
8398
8398
|
};
|
|
8399
|
-
function
|
|
8399
|
+
function Zi(e, r) {
|
|
8400
8400
|
r = r || 0;
|
|
8401
8401
|
var t = new v(e, r), n = t.parseVersion(1);
|
|
8402
8402
|
return E.argument(n === 1 || n === 1.1, "Unsupported GPOS table version " + n), n === 1 ? {
|
|
@@ -8412,17 +8412,17 @@ function Yi(e, r) {
|
|
|
8412
8412
|
variations: t.parseFeatureVariationsList()
|
|
8413
8413
|
};
|
|
8414
8414
|
}
|
|
8415
|
-
var
|
|
8416
|
-
function
|
|
8415
|
+
var Qi = new Array(10);
|
|
8416
|
+
function Ki(e) {
|
|
8417
8417
|
return new S.Table("GPOS", [
|
|
8418
8418
|
{ name: "version", type: "ULONG", value: 65536 },
|
|
8419
8419
|
{ name: "scripts", type: "TABLE", value: new S.ScriptList(e.scripts) },
|
|
8420
8420
|
{ name: "features", type: "TABLE", value: new S.FeatureList(e.features) },
|
|
8421
|
-
{ name: "lookups", type: "TABLE", value: new S.LookupList(e.lookups,
|
|
8421
|
+
{ name: "lookups", type: "TABLE", value: new S.LookupList(e.lookups, Qi) }
|
|
8422
8422
|
]);
|
|
8423
8423
|
}
|
|
8424
|
-
var
|
|
8425
|
-
function
|
|
8424
|
+
var ji = { parse: Zi, make: Ki };
|
|
8425
|
+
function Ji(e) {
|
|
8426
8426
|
var r = {};
|
|
8427
8427
|
e.skip("uShort");
|
|
8428
8428
|
var t = e.parseUShort();
|
|
@@ -8435,7 +8435,7 @@ function Ki(e) {
|
|
|
8435
8435
|
}
|
|
8436
8436
|
return r;
|
|
8437
8437
|
}
|
|
8438
|
-
function
|
|
8438
|
+
function eu(e) {
|
|
8439
8439
|
var r = {};
|
|
8440
8440
|
e.skip("uShort");
|
|
8441
8441
|
var t = e.parseULong();
|
|
@@ -8451,32 +8451,32 @@ function ji(e) {
|
|
|
8451
8451
|
}
|
|
8452
8452
|
return r;
|
|
8453
8453
|
}
|
|
8454
|
-
function
|
|
8454
|
+
function ru(e, r) {
|
|
8455
8455
|
var t = new k.Parser(e, r), n = t.parseUShort();
|
|
8456
8456
|
if (n === 0)
|
|
8457
|
-
return
|
|
8457
|
+
return Ji(t);
|
|
8458
8458
|
if (n === 1)
|
|
8459
|
-
return
|
|
8459
|
+
return eu(t);
|
|
8460
8460
|
throw new Error("Unsupported kern table version (" + n + ").");
|
|
8461
8461
|
}
|
|
8462
|
-
var
|
|
8463
|
-
function
|
|
8462
|
+
var tu = { parse: ru };
|
|
8463
|
+
function nu(e, r, t, n) {
|
|
8464
8464
|
for (var a = new k.Parser(e, r), s = n ? a.parseUShort : a.parseULong, o = [], u = 0; u < t + 1; u += 1) {
|
|
8465
8465
|
var i = s.call(a);
|
|
8466
8466
|
n && (i *= 2), o.push(i);
|
|
8467
8467
|
}
|
|
8468
8468
|
return o;
|
|
8469
8469
|
}
|
|
8470
|
-
var
|
|
8471
|
-
function
|
|
8470
|
+
var au = { parse: nu };
|
|
8471
|
+
function su(e, r) {
|
|
8472
8472
|
var t = require("fs");
|
|
8473
8473
|
t.readFile(e, function(n, a) {
|
|
8474
8474
|
if (n)
|
|
8475
8475
|
return r(n.message);
|
|
8476
|
-
r(null,
|
|
8476
|
+
r(null, Sn(a));
|
|
8477
8477
|
});
|
|
8478
8478
|
}
|
|
8479
|
-
function
|
|
8479
|
+
function ou(e, r) {
|
|
8480
8480
|
var t = new XMLHttpRequest();
|
|
8481
8481
|
t.open("get", e, !0), t.responseType = "arraybuffer", t.onload = function() {
|
|
8482
8482
|
return t.response ? r(null, t.response) : r("Font could not be loaded: " + t.statusText);
|
|
@@ -8491,7 +8491,7 @@ function Bt(e, r) {
|
|
|
8491
8491
|
}
|
|
8492
8492
|
return t;
|
|
8493
8493
|
}
|
|
8494
|
-
function
|
|
8494
|
+
function iu(e, r) {
|
|
8495
8495
|
for (var t = [], n = 44, a = 0; a < r; a += 1) {
|
|
8496
8496
|
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;
|
|
8497
8497
|
u < i ? l = "WOFF" : l = !1, t.push({
|
|
@@ -8504,10 +8504,10 @@ function su(e, r) {
|
|
|
8504
8504
|
}
|
|
8505
8505
|
return t;
|
|
8506
8506
|
}
|
|
8507
|
-
function
|
|
8507
|
+
function W(e, r) {
|
|
8508
8508
|
if (r.compression === "WOFF") {
|
|
8509
8509
|
var t = new Uint8Array(e.buffer, r.offset + 2, r.compressedLength - 2), n = new Uint8Array(r.length);
|
|
8510
|
-
if (
|
|
8510
|
+
if (Kn(t, n), n.byteLength !== r.length)
|
|
8511
8511
|
throw new Error("Decompression error: " + r.tag + " decompressed length doesn't match recorded length");
|
|
8512
8512
|
var a = new DataView(n.buffer, 0);
|
|
8513
8513
|
return { data: a, offset: 0 };
|
|
@@ -8516,7 +8516,7 @@ function H(e, r) {
|
|
|
8516
8516
|
}
|
|
8517
8517
|
function $r(e, r) {
|
|
8518
8518
|
r = r ?? {};
|
|
8519
|
-
var t, n, a = new
|
|
8519
|
+
var t, n, a = new I({ empty: !0 }), s = new DataView(e, 0), o, u = [], i = k.getTag(s, 0);
|
|
8520
8520
|
if (i === "\0\0\0" || i === "true" || i === "typ1")
|
|
8521
8521
|
a.outlinesFormat = "truetype", o = k.getUShort(s, 4), u = Bt(s, o);
|
|
8522
8522
|
else if (i === "OTTO")
|
|
@@ -8529,62 +8529,62 @@ function $r(e, r) {
|
|
|
8529
8529
|
a.outlinesFormat = "cff";
|
|
8530
8530
|
else
|
|
8531
8531
|
throw new Error("Unsupported OpenType flavor " + i);
|
|
8532
|
-
o = k.getUShort(s, 12), u =
|
|
8532
|
+
o = k.getUShort(s, 12), u = iu(s, o);
|
|
8533
8533
|
} else
|
|
8534
8534
|
throw new Error("Unsupported OpenType signature " + i);
|
|
8535
|
-
for (var f, c, p, h, d, g, m,
|
|
8536
|
-
var C = u[
|
|
8535
|
+
for (var f, c, p, h, d, g, m, x, U, y, L, w, B = 0; B < o; B += 1) {
|
|
8536
|
+
var C = u[B], F = void 0;
|
|
8537
8537
|
switch (C.tag) {
|
|
8538
8538
|
case "cmap":
|
|
8539
|
-
|
|
8539
|
+
F = W(s, C), a.tables.cmap = $t.parse(F.data, F.offset), a.encoding = new Qt(a.tables.cmap);
|
|
8540
8540
|
break;
|
|
8541
8541
|
case "cvt ":
|
|
8542
|
-
|
|
8542
|
+
F = W(s, C), w = new k.Parser(F.data, F.offset), a.tables.cvt = w.parseShortList(C.length / 2);
|
|
8543
8543
|
break;
|
|
8544
8544
|
case "fvar":
|
|
8545
8545
|
c = C;
|
|
8546
8546
|
break;
|
|
8547
8547
|
case "fpgm":
|
|
8548
|
-
|
|
8548
|
+
F = W(s, C), w = new k.Parser(F.data, F.offset), a.tables.fpgm = w.parseByteList(C.length);
|
|
8549
8549
|
break;
|
|
8550
8550
|
case "head":
|
|
8551
|
-
|
|
8551
|
+
F = W(s, C), a.tables.head = on.parse(F.data, F.offset), a.unitsPerEm = a.tables.head.unitsPerEm, t = a.tables.head.indexToLocFormat;
|
|
8552
8552
|
break;
|
|
8553
8553
|
case "hhea":
|
|
8554
|
-
|
|
8554
|
+
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;
|
|
8555
8555
|
break;
|
|
8556
8556
|
case "hmtx":
|
|
8557
8557
|
m = C;
|
|
8558
8558
|
break;
|
|
8559
8559
|
case "ltag":
|
|
8560
|
-
|
|
8560
|
+
F = W(s, C), n = fn.parse(F.data, F.offset);
|
|
8561
8561
|
break;
|
|
8562
8562
|
case "maxp":
|
|
8563
|
-
|
|
8563
|
+
F = W(s, C), a.tables.maxp = pn.parse(F.data, F.offset), a.numGlyphs = a.tables.maxp.numGlyphs;
|
|
8564
8564
|
break;
|
|
8565
8565
|
case "name":
|
|
8566
|
-
|
|
8566
|
+
y = C;
|
|
8567
8567
|
break;
|
|
8568
8568
|
case "OS/2":
|
|
8569
|
-
|
|
8569
|
+
F = W(s, C), a.tables.os2 = Ar.parse(F.data, F.offset);
|
|
8570
8570
|
break;
|
|
8571
8571
|
case "post":
|
|
8572
|
-
|
|
8572
|
+
F = W(s, C), a.tables.post = mn.parse(F.data, F.offset), a.glyphNames = new Wr(a.tables.post);
|
|
8573
8573
|
break;
|
|
8574
8574
|
case "prep":
|
|
8575
|
-
|
|
8575
|
+
F = W(s, C), w = new k.Parser(F.data, F.offset), a.tables.prep = w.parseByteList(C.length);
|
|
8576
8576
|
break;
|
|
8577
8577
|
case "glyf":
|
|
8578
8578
|
p = C;
|
|
8579
8579
|
break;
|
|
8580
8580
|
case "loca":
|
|
8581
|
-
|
|
8581
|
+
U = C;
|
|
8582
8582
|
break;
|
|
8583
8583
|
case "CFF ":
|
|
8584
8584
|
f = C;
|
|
8585
8585
|
break;
|
|
8586
8586
|
case "kern":
|
|
8587
|
-
|
|
8587
|
+
x = C;
|
|
8588
8588
|
break;
|
|
8589
8589
|
case "GDEF":
|
|
8590
8590
|
h = C;
|
|
@@ -8596,50 +8596,50 @@ function $r(e, r) {
|
|
|
8596
8596
|
g = C;
|
|
8597
8597
|
break;
|
|
8598
8598
|
case "meta":
|
|
8599
|
-
|
|
8599
|
+
L = C;
|
|
8600
8600
|
break;
|
|
8601
8601
|
}
|
|
8602
8602
|
}
|
|
8603
|
-
var
|
|
8604
|
-
if (a.tables.name =
|
|
8605
|
-
var
|
|
8606
|
-
a.glyphs =
|
|
8603
|
+
var D = W(s, y);
|
|
8604
|
+
if (a.tables.name = gn.parse(D.data, D.offset, n), a.names = a.tables.name, p && U) {
|
|
8605
|
+
var R = t === 0, A = W(s, U), H = au.parse(A.data, A.offset, a.numGlyphs, R), Q = W(s, p);
|
|
8606
|
+
a.glyphs = Un.parse(Q.data, Q.offset, H, a, r);
|
|
8607
8607
|
} else if (f) {
|
|
8608
|
-
var G =
|
|
8609
|
-
|
|
8608
|
+
var G = W(s, f);
|
|
8609
|
+
sn.parse(G.data, G.offset, a, r);
|
|
8610
8610
|
} else
|
|
8611
8611
|
throw new Error("Font doesn't contain TrueType or CFF outlines.");
|
|
8612
|
-
var
|
|
8613
|
-
if (
|
|
8614
|
-
var Y =
|
|
8615
|
-
a.kerningPairs =
|
|
8612
|
+
var z = W(s, m);
|
|
8613
|
+
if (ln.parse(a, z.data, z.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, r), ya(a, r), x) {
|
|
8614
|
+
var Y = W(s, x);
|
|
8615
|
+
a.kerningPairs = tu.parse(Y.data, Y.offset);
|
|
8616
8616
|
} else
|
|
8617
8617
|
a.kerningPairs = {};
|
|
8618
8618
|
if (h) {
|
|
8619
|
-
var
|
|
8620
|
-
a.tables.gdef =
|
|
8619
|
+
var _ = W(s, h);
|
|
8620
|
+
a.tables.gdef = $i.parse(_.data, _.offset);
|
|
8621
8621
|
}
|
|
8622
8622
|
if (d) {
|
|
8623
|
-
var P =
|
|
8624
|
-
a.tables.gpos =
|
|
8623
|
+
var P = W(s, d);
|
|
8624
|
+
a.tables.gpos = ji.parse(P.data, P.offset), a.position.init();
|
|
8625
8625
|
}
|
|
8626
8626
|
if (g) {
|
|
8627
|
-
var
|
|
8628
|
-
a.tables.gsub =
|
|
8627
|
+
var V = W(s, g);
|
|
8628
|
+
a.tables.gsub = yn.parse(V.data, V.offset);
|
|
8629
8629
|
}
|
|
8630
8630
|
if (c) {
|
|
8631
|
-
var $ =
|
|
8632
|
-
a.tables.fvar =
|
|
8631
|
+
var $ = W(s, c);
|
|
8632
|
+
a.tables.fvar = Wi.parse($.data, $.offset, a.names);
|
|
8633
8633
|
}
|
|
8634
|
-
if (
|
|
8635
|
-
var
|
|
8636
|
-
a.tables.meta =
|
|
8634
|
+
if (L) {
|
|
8635
|
+
var M = W(s, L);
|
|
8636
|
+
a.tables.meta = xn.parse(M.data, M.offset), a.metas = a.tables.meta;
|
|
8637
8637
|
}
|
|
8638
8638
|
return a;
|
|
8639
8639
|
}
|
|
8640
|
-
function
|
|
8640
|
+
function uu(e, r, t) {
|
|
8641
8641
|
t = t ?? {};
|
|
8642
|
-
var n = typeof window > "u", a = n && !t.isUrl ?
|
|
8642
|
+
var n = typeof window > "u", a = n && !t.isUrl ? su : ou;
|
|
8643
8643
|
return new Promise(function(s, o) {
|
|
8644
8644
|
a(e, function(u, i) {
|
|
8645
8645
|
if (u) {
|
|
@@ -8661,22 +8661,22 @@ function ou(e, r, t) {
|
|
|
8661
8661
|
});
|
|
8662
8662
|
});
|
|
8663
8663
|
}
|
|
8664
|
-
function
|
|
8664
|
+
function lu(e, r) {
|
|
8665
8665
|
var t = require("fs"), n = t.readFileSync(e);
|
|
8666
|
-
return $r(
|
|
8666
|
+
return $r(Sn(n), r);
|
|
8667
8667
|
}
|
|
8668
|
-
var
|
|
8668
|
+
var fu = /* @__PURE__ */ Object.freeze({
|
|
8669
8669
|
__proto__: null,
|
|
8670
|
-
Font:
|
|
8670
|
+
Font: I,
|
|
8671
8671
|
Glyph: K,
|
|
8672
|
-
Path:
|
|
8672
|
+
Path: X,
|
|
8673
8673
|
BoundingBox: he,
|
|
8674
8674
|
_parse: k,
|
|
8675
8675
|
parse: $r,
|
|
8676
|
-
load:
|
|
8677
|
-
loadSync:
|
|
8676
|
+
load: uu,
|
|
8677
|
+
loadSync: lu
|
|
8678
8678
|
});
|
|
8679
|
-
function
|
|
8679
|
+
function pu(e, r) {
|
|
8680
8680
|
const t = { svgGlyphs: r };
|
|
8681
8681
|
return new Proxy(e, {
|
|
8682
8682
|
get(n, a, s) {
|
|
@@ -8693,7 +8693,7 @@ function lu(e, r) {
|
|
|
8693
8693
|
}
|
|
8694
8694
|
});
|
|
8695
8695
|
}
|
|
8696
|
-
const Mr = /* @__PURE__ */ new Map(), _u = () => Mr,
|
|
8696
|
+
const Mr = /* @__PURE__ */ new Map(), _u = () => Mr, cu = async (e, r = !1) => {
|
|
8697
8697
|
const t = Mr.get(e);
|
|
8698
8698
|
if (t) {
|
|
8699
8699
|
if (r && !t.svgGlyphs) {
|
|
@@ -8712,16 +8712,16 @@ const Mr = /* @__PURE__ */ new Map(), _u = () => Mr, fu = async (e, r = !1) => {
|
|
|
8712
8712
|
throw new Error(
|
|
8713
8713
|
`Failed to load font from ${e}: ${n.status} ${n.statusText}`
|
|
8714
8714
|
);
|
|
8715
|
-
const a = await n.arrayBuffer(), s =
|
|
8715
|
+
const a = await n.arrayBuffer(), s = fu.parse(a);
|
|
8716
8716
|
let o;
|
|
8717
8717
|
if (r) {
|
|
8718
8718
|
const { extractSVGGlyphs: i } = await import("./index-F17NutRZ.js");
|
|
8719
8719
|
o = await i(a);
|
|
8720
8720
|
}
|
|
8721
|
-
const u =
|
|
8721
|
+
const u = pu(s, o);
|
|
8722
8722
|
return Mr.set(e, u), u;
|
|
8723
|
-
},
|
|
8724
|
-
outlineWidth:
|
|
8723
|
+
}, hu = 0.03125, Bn = 1.1, Mn = 0.2, $e = {
|
|
8724
|
+
outlineWidth: hu,
|
|
8725
8725
|
letterSpacing: 0,
|
|
8726
8726
|
letterSpacingOutline: 0
|
|
8727
8727
|
};
|
|
@@ -8739,18 +8739,18 @@ class fe {
|
|
|
8739
8739
|
return `${this.x} ${this.y}`;
|
|
8740
8740
|
}
|
|
8741
8741
|
}
|
|
8742
|
-
function
|
|
8742
|
+
function vu(e, r, t = new fe(0, 0)) {
|
|
8743
8743
|
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;
|
|
8744
8744
|
return new fe(i + t.X, l + t.Y);
|
|
8745
8745
|
}
|
|
8746
|
-
const
|
|
8746
|
+
const du = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curved" ? { type: "curved" } : e, gu = (e) => {
|
|
8747
8747
|
if (!e || !e.trim())
|
|
8748
8748
|
throw new Error("Custom baseline path must be a non-empty SVG path string");
|
|
8749
8749
|
if (!e.trim().startsWith("M"))
|
|
8750
8750
|
throw new Error(
|
|
8751
8751
|
"Custom baseline path must start with an M (moveto) command"
|
|
8752
8752
|
);
|
|
8753
|
-
},
|
|
8753
|
+
}, mu = ({
|
|
8754
8754
|
boxDimensions: e,
|
|
8755
8755
|
totalTextHeight: r,
|
|
8756
8756
|
baseline: t,
|
|
@@ -8770,16 +8770,16 @@ const vu = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curve
|
|
|
8770
8770
|
break;
|
|
8771
8771
|
}
|
|
8772
8772
|
}
|
|
8773
|
-
return l += s * (n *
|
|
8774
|
-
},
|
|
8773
|
+
return l += s * (n * Bn), `M 0 ${l} L ${o} ${l}`;
|
|
8774
|
+
}, In = ({
|
|
8775
8775
|
boxDimensions: e,
|
|
8776
8776
|
baseline: r,
|
|
8777
8777
|
textHeight: t,
|
|
8778
8778
|
verticalAlignment: n
|
|
8779
8779
|
}) => {
|
|
8780
|
-
const { width: a, height: s } = e, o = t *
|
|
8780
|
+
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;
|
|
8781
8781
|
if (n !== "top" && (f > s || l - t < 0))
|
|
8782
|
-
return
|
|
8782
|
+
return In({
|
|
8783
8783
|
boxDimensions: e,
|
|
8784
8784
|
baseline: r,
|
|
8785
8785
|
textHeight: t,
|
|
@@ -8788,12 +8788,12 @@ const vu = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curve
|
|
|
8788
8788
|
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(
|
|
8789
8789
|
g,
|
|
8790
8790
|
r + i
|
|
8791
|
-
),
|
|
8791
|
+
), x = new fe(
|
|
8792
8792
|
a - g,
|
|
8793
8793
|
r + i
|
|
8794
|
-
),
|
|
8795
|
-
return `${
|
|
8796
|
-
},
|
|
8794
|
+
), U = `M ${p.toSVGString()}`, y = `Q ${m.toSVGString()} ${h.toSVGString()}`, L = `Q ${x.toSVGString()} ${d.toSVGString()}`;
|
|
8795
|
+
return `${U} ${y} ${L}`;
|
|
8796
|
+
}, yu = (e) => {
|
|
8797
8797
|
const r = ["I", "l", "1"];
|
|
8798
8798
|
for (const t of r) {
|
|
8799
8799
|
const n = e.charToGlyph(t);
|
|
@@ -8803,7 +8803,7 @@ const vu = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curve
|
|
|
8803
8803
|
return console.error(
|
|
8804
8804
|
'No standard character found for fixed height calculation. Using "I" as default.'
|
|
8805
8805
|
), "I";
|
|
8806
|
-
}, kr = 100,
|
|
8806
|
+
}, kr = 100, xu = ({
|
|
8807
8807
|
font: e,
|
|
8808
8808
|
boxDimensions: r,
|
|
8809
8809
|
physicalSize: t,
|
|
@@ -8814,7 +8814,7 @@ const vu = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curve
|
|
|
8814
8814
|
throw new Error(
|
|
8815
8815
|
`Mismatched units between physicalFontSize (${a[1]}) and boxDimensions (${r.physicalUnits})`
|
|
8816
8816
|
);
|
|
8817
|
-
const { outlineWidth: s } = n, o =
|
|
8817
|
+
const { outlineWidth: s } = n, o = yu(e), i = e.getPath(
|
|
8818
8818
|
o,
|
|
8819
8819
|
0,
|
|
8820
8820
|
0,
|
|
@@ -8827,7 +8827,7 @@ const vu = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curve
|
|
|
8827
8827
|
}
|
|
8828
8828
|
const c = l / r.height * r.physicalHeight, p = a[0] / c;
|
|
8829
8829
|
return kr * p;
|
|
8830
|
-
},
|
|
8830
|
+
}, bu = ({
|
|
8831
8831
|
font: e,
|
|
8832
8832
|
text: r,
|
|
8833
8833
|
fontSize: t,
|
|
@@ -8839,11 +8839,11 @@ const vu = (e) => e === void 0 || e === "flat" ? { type: "flat" } : e === "curve
|
|
|
8839
8839
|
height: h,
|
|
8840
8840
|
baseline: d
|
|
8841
8841
|
};
|
|
8842
|
-
}, Zr = window.DOMParser,
|
|
8843
|
-
|
|
8844
|
-
|
|
8842
|
+
}, Zr = window.DOMParser, Su = globalThis.DOMMatrix, Pn = typeof window < "u" ? new URL(window.location.href) : null;
|
|
8843
|
+
Pn?.searchParams.get("mode");
|
|
8844
|
+
Pn?.searchParams.has("rasterlayplan");
|
|
8845
8845
|
typeof navigator < "u" && navigator.vendor && navigator.vendor.indexOf("Apple") > -1;
|
|
8846
|
-
const
|
|
8846
|
+
const Tu = {
|
|
8847
8847
|
aliceblue: "#f0f8ff",
|
|
8848
8848
|
antiquewhite: "#faebd7",
|
|
8849
8849
|
aqua: "#00ffff",
|
|
@@ -8992,7 +8992,7 @@ const Su = {
|
|
|
8992
8992
|
whitesmoke: "#f5f5f5",
|
|
8993
8993
|
yellow: "#ffff00",
|
|
8994
8994
|
yellowgreen: "#9acd32"
|
|
8995
|
-
},
|
|
8995
|
+
}, ku = (e) => {
|
|
8996
8996
|
let r = Array.from(e), t = !1;
|
|
8997
8997
|
return r[0] === "#" && (r.shift(), t = !0), r.length === 3 && (r = r.map((n) => `${n}${n}`)), `${t ? "#" : ""}${r.join("").toLowerCase()}`;
|
|
8998
8998
|
}, Fr = (e) => {
|
|
@@ -9001,7 +9001,7 @@ const Su = {
|
|
|
9001
9001
|
}, Mt = (...e) => {
|
|
9002
9002
|
const [r, t, n] = Array.isArray(e[0]) ? e[0] : e;
|
|
9003
9003
|
return `#${Fr(r)}${Fr(t)}${Fr(n)}`;
|
|
9004
|
-
},
|
|
9004
|
+
}, Fu = (e, r, t) => {
|
|
9005
9005
|
if (r === 0) {
|
|
9006
9006
|
const f = Math.round(t * 255);
|
|
9007
9007
|
return [f, f, f];
|
|
@@ -9013,10 +9013,10 @@ const Su = {
|
|
|
9013
9013
|
Math.round((i + o) * 255),
|
|
9014
9014
|
Math.round((l + o) * 255)
|
|
9015
9015
|
];
|
|
9016
|
-
},
|
|
9016
|
+
}, Uu = (e) => /^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.test(e), Gn = (e) => {
|
|
9017
9017
|
const r = e.trim().toLowerCase();
|
|
9018
9018
|
if (r.startsWith("#") || /^[0-9a-f]{3}([0-9a-f]{3})?$/.test(r))
|
|
9019
|
-
return
|
|
9019
|
+
return Uu(r) ? ku(r) : void 0;
|
|
9020
9020
|
if (r.startsWith("rgb")) {
|
|
9021
9021
|
const n = r.match(
|
|
9022
9022
|
/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*[\d.]+\s*)?\)/
|
|
@@ -9032,10 +9032,10 @@ const Su = {
|
|
|
9032
9032
|
/hsla?\(\s*(\d+)\s*,\s*([\d.]+)%\s*,\s*([\d.]+)%\s*(?:,\s*[\d.]+\s*)?\)/
|
|
9033
9033
|
);
|
|
9034
9034
|
if (!n) return;
|
|
9035
|
-
const a = Number.parseInt(n[1], 10), s = Number.parseFloat(n[2]) / 100, o = Number.parseFloat(n[3]) / 100, [u, i, l] =
|
|
9035
|
+
const a = Number.parseInt(n[1], 10), s = Number.parseFloat(n[2]) / 100, o = Number.parseFloat(n[3]) / 100, [u, i, l] = Fu(a, s, o);
|
|
9036
9036
|
return Mt(u, i, l);
|
|
9037
9037
|
}
|
|
9038
|
-
const t =
|
|
9038
|
+
const t = Tu[r];
|
|
9039
9039
|
if (t) return t;
|
|
9040
9040
|
}, me = {
|
|
9041
9041
|
circle: "circle",
|
|
@@ -9049,7 +9049,7 @@ const Su = {
|
|
|
9049
9049
|
}, ur = {
|
|
9050
9050
|
fill: "fill",
|
|
9051
9051
|
stroke: "stroke"
|
|
9052
|
-
},
|
|
9052
|
+
}, Cu = {
|
|
9053
9053
|
tiling: [
|
|
9054
9054
|
me.circle,
|
|
9055
9055
|
me.ellipse,
|
|
@@ -9062,20 +9062,20 @@ const Su = {
|
|
|
9062
9062
|
`[${ur.fill}]`,
|
|
9063
9063
|
`[${ur.stroke}]`
|
|
9064
9064
|
]
|
|
9065
|
-
},
|
|
9065
|
+
}, wu = (e) => Array.from(
|
|
9066
9066
|
e.querySelectorAll(
|
|
9067
|
-
|
|
9067
|
+
Cu.tiling.map((r) => `*:not(clipPath) > ${r}`).join(", ")
|
|
9068
9068
|
)
|
|
9069
|
-
),
|
|
9069
|
+
), Eu = (e) => {
|
|
9070
9070
|
const r = e.getAttribute(ur.stroke);
|
|
9071
9071
|
return r === "none" || !r ? !1 : r;
|
|
9072
9072
|
}, Ur = (e) => {
|
|
9073
9073
|
if (!(e === "none" || e === "transparent" || e.startsWith("url(")))
|
|
9074
|
-
return
|
|
9075
|
-
},
|
|
9076
|
-
const r =
|
|
9074
|
+
return Gn(e);
|
|
9075
|
+
}, Ou = (e) => {
|
|
9076
|
+
const r = wu(e).reduce(
|
|
9077
9077
|
(t, n) => {
|
|
9078
|
-
const a = n.getAttribute("stop-color"), s = n.getAttribute(ur.fill) || "#000", o =
|
|
9078
|
+
const a = n.getAttribute("stop-color"), s = n.getAttribute(ur.fill) || "#000", o = Eu(n);
|
|
9079
9079
|
if (!a) {
|
|
9080
9080
|
const u = Ur(s);
|
|
9081
9081
|
u && t.add(u);
|
|
@@ -9093,15 +9093,15 @@ const Su = {
|
|
|
9093
9093
|
/* @__PURE__ */ new Set()
|
|
9094
9094
|
);
|
|
9095
9095
|
return Array.from(r);
|
|
9096
|
-
},
|
|
9096
|
+
}, Lu = (e) => {
|
|
9097
9097
|
const r = new Zr().parseFromString(e, "image/svg+xml").querySelector("svg");
|
|
9098
|
-
return r ?
|
|
9098
|
+
return r ? Ou(r) : [];
|
|
9099
9099
|
};
|
|
9100
|
-
function
|
|
9100
|
+
function Nn(e) {
|
|
9101
9101
|
const r = e.trim(), t = r.startsWith("<svg") || r.startsWith("<?xml"), n = t ? r : `<svg>${r}</svg>`;
|
|
9102
9102
|
return { doc: new Zr().parseFromString(n, "image/svg+xml"), wasWrapped: !t };
|
|
9103
9103
|
}
|
|
9104
|
-
function
|
|
9104
|
+
function Hn(e, r) {
|
|
9105
9105
|
const t = e.querySelector("svg");
|
|
9106
9106
|
return t ? r ? t.innerHTML : t.outerHTML : "";
|
|
9107
9107
|
}
|
|
@@ -9111,20 +9111,20 @@ function Vu(e) {
|
|
|
9111
9111
|
return [];
|
|
9112
9112
|
const t = /* @__PURE__ */ new Set();
|
|
9113
9113
|
for (const [, n] of r)
|
|
9114
|
-
for (const a of
|
|
9114
|
+
for (const a of Lu(n.svg))
|
|
9115
9115
|
t.add(a);
|
|
9116
9116
|
return Array.from(t);
|
|
9117
9117
|
}
|
|
9118
|
-
function
|
|
9118
|
+
function Ru(e) {
|
|
9119
9119
|
return !!e && e !== "none" && e !== "transparent" && !e.startsWith("url(");
|
|
9120
9120
|
}
|
|
9121
|
-
function
|
|
9121
|
+
function Du(e) {
|
|
9122
9122
|
const t = new Zr().parseFromString(e, "image/svg+xml").querySelector("svg");
|
|
9123
9123
|
return t ? t.innerHTML.trim() : "";
|
|
9124
9124
|
}
|
|
9125
|
-
const
|
|
9126
|
-
function
|
|
9127
|
-
const { doc: t, wasWrapped: n } =
|
|
9125
|
+
const Au = ["fill", "stroke", "clip-path", "mask", "filter"];
|
|
9126
|
+
function Bu(e, r) {
|
|
9127
|
+
const { doc: t, wasWrapped: n } = Nn(e), a = /* @__PURE__ */ new Map();
|
|
9128
9128
|
for (const s of t.querySelectorAll("[id]")) {
|
|
9129
9129
|
const o = s.getAttribute("id");
|
|
9130
9130
|
if (!o) continue;
|
|
@@ -9133,7 +9133,7 @@ function Au(e, r) {
|
|
|
9133
9133
|
}
|
|
9134
9134
|
if (a.size === 0)
|
|
9135
9135
|
return e;
|
|
9136
|
-
for (const s of
|
|
9136
|
+
for (const s of Au)
|
|
9137
9137
|
for (const o of t.querySelectorAll(`[${s}]`)) {
|
|
9138
9138
|
const u = o.getAttribute(s);
|
|
9139
9139
|
if (u) {
|
|
@@ -9152,36 +9152,36 @@ function Au(e, r) {
|
|
|
9152
9152
|
l && s.setAttribute(o, `#${l}`);
|
|
9153
9153
|
}
|
|
9154
9154
|
}
|
|
9155
|
-
return
|
|
9155
|
+
return Hn(t, n);
|
|
9156
9156
|
}
|
|
9157
|
-
const
|
|
9158
|
-
function
|
|
9159
|
-
const { doc: t, wasWrapped: n } =
|
|
9160
|
-
for (const s of
|
|
9157
|
+
const Mu = ["fill", "stroke", "stop-color"], Iu = ["path", "rect", "circle", "ellipse", "polygon", "polyline", "text"];
|
|
9158
|
+
function Pu(e, r) {
|
|
9159
|
+
const { doc: t, wasWrapped: n } = Nn(e);
|
|
9160
|
+
for (const s of Mu)
|
|
9161
9161
|
for (const o of t.querySelectorAll(`[${s}]`)) {
|
|
9162
9162
|
const u = o.getAttribute(s);
|
|
9163
|
-
if (!u || !
|
|
9164
|
-
const i =
|
|
9163
|
+
if (!u || !Ru(u)) continue;
|
|
9164
|
+
const i = Gn(u), l = i ? r[i] : void 0;
|
|
9165
9165
|
l && o.setAttribute(s, l.hex);
|
|
9166
9166
|
}
|
|
9167
9167
|
const a = r["#000000"];
|
|
9168
9168
|
if (a) {
|
|
9169
|
-
const s =
|
|
9169
|
+
const s = Iu.map((o) => `${o}:not([fill])`).join(", ");
|
|
9170
9170
|
for (const o of t.querySelectorAll(s))
|
|
9171
9171
|
o.setAttribute("fill", a.hex);
|
|
9172
9172
|
}
|
|
9173
|
-
return
|
|
9173
|
+
return Hn(t, n);
|
|
9174
9174
|
}
|
|
9175
|
-
const
|
|
9176
|
-
const r = `matrix(${e.join(",")})`, t = new
|
|
9175
|
+
const Gu = (e = [1, 0, 0, 1, 0, 0]) => {
|
|
9176
|
+
const r = `matrix(${e.join(",")})`, t = new Su(r);
|
|
9177
9177
|
if (!t)
|
|
9178
9178
|
throw new Error("Your browser does not support matrices");
|
|
9179
9179
|
return t;
|
|
9180
9180
|
};
|
|
9181
|
-
function
|
|
9181
|
+
function Nu(e) {
|
|
9182
9182
|
return e.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">");
|
|
9183
9183
|
}
|
|
9184
|
-
const It = (e, r, t) => e / t * r,
|
|
9184
|
+
const It = (e, r, t) => e / t * r, Hu = ({
|
|
9185
9185
|
font: e,
|
|
9186
9186
|
baselinePath: r,
|
|
9187
9187
|
text: t,
|
|
@@ -9190,78 +9190,78 @@ const It = (e, r, t) => e / t * r, Nu = ({
|
|
|
9190
9190
|
horizontalAlignment: s = "centre",
|
|
9191
9191
|
colourMap: o
|
|
9192
9192
|
}) => {
|
|
9193
|
-
const { outlineWidth: u, letterSpacing: i, letterSpacingOutline: l } = a, f = new
|
|
9194
|
-
let
|
|
9195
|
-
s === "distributed" && (
|
|
9196
|
-
const w =
|
|
9193
|
+
const { outlineWidth: u, letterSpacing: i, letterSpacingOutline: l } = a, f = new _n(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;
|
|
9194
|
+
let L = y ? y * n : 0;
|
|
9195
|
+
s === "distributed" && (L = t.length === 1 ? 0 : (p - U) / (t.length - 1));
|
|
9196
|
+
const w = L * (t.length - 1), B = U + w;
|
|
9197
9197
|
let C = 0 - m;
|
|
9198
|
-
s === "centre" ? C = (p -
|
|
9199
|
-
const
|
|
9200
|
-
for (let
|
|
9201
|
-
const
|
|
9198
|
+
s === "centre" ? C = (p - B) / 2 - m : s === "right" && (C = p - U - m - w);
|
|
9199
|
+
const F = [];
|
|
9200
|
+
for (let D = 0; D < h.length; D++) {
|
|
9201
|
+
const R = h[D], A = R.getBoundingBox(), H = e.charToGlyph(t[D]), { advanceWidth: Q } = H;
|
|
9202
9202
|
if (!Q)
|
|
9203
9203
|
throw new Error(
|
|
9204
|
-
`No advance width for character: ${t[
|
|
9204
|
+
`No advance width for character: ${t[D]} in font ${e.names.fontFamily}`
|
|
9205
9205
|
);
|
|
9206
|
-
const { x1: G, x2:
|
|
9206
|
+
const { x1: G, x2: z } = H.getBoundingBox(), Y = It(
|
|
9207
9207
|
Q,
|
|
9208
9208
|
n,
|
|
9209
9209
|
e.unitsPerEm
|
|
9210
|
-
),
|
|
9210
|
+
), _ = It(z - G, n, e.unitsPerEm);
|
|
9211
9211
|
let P = C + A.x1;
|
|
9212
|
-
if (
|
|
9212
|
+
if (D > 0 && (P += L * D), P + _ > p)
|
|
9213
9213
|
throw new Error(
|
|
9214
|
-
`TOO_WIDE: character "${t[
|
|
9214
|
+
`TOO_WIDE: character "${t[D]}" at index ${D} exceeds baseline path length (${Math.round(P + _)} > ${Math.round(p)})`
|
|
9215
9215
|
);
|
|
9216
|
-
const
|
|
9216
|
+
const V = P + Y / 2, $ = f.getTangentAtLength(V), M = Math.atan2($.y, $.x) * 180 / Math.PI, q = f.getPointAtLength(P), De = q.x, pr = q.y, Ae = A.x2 - A.x1, Be = new fe(A.x1 + Ae / 2, 0), Me = vu(
|
|
9217
9217
|
new fe(A.x1, 0),
|
|
9218
|
-
|
|
9218
|
+
M,
|
|
9219
9219
|
Be
|
|
9220
|
-
), Ce = De - Me.X,
|
|
9221
|
-
let se =
|
|
9222
|
-
se = se.translate(Ce,
|
|
9223
|
-
const
|
|
9224
|
-
let ve =
|
|
9220
|
+
), Ce = De - Me.X, Wn = pr - Me.Y;
|
|
9221
|
+
let se = Gu();
|
|
9222
|
+
se = se.translate(Ce, Wn), M && (se = se.translate(A.x1 + Ae / 2, 0), se = se.rotate(M), se = se.translate(-A.x1 - Ae / 2, 0));
|
|
9223
|
+
const zn = se.toString();
|
|
9224
|
+
let ve = R.toPathData(2);
|
|
9225
9225
|
ve.length && !ve.endsWith("Z") && (ve += "Z", ve = ve.replace(/M/g, "ZM"), ve = ve.substring(1));
|
|
9226
9226
|
let cr;
|
|
9227
9227
|
if (e.svgGlyphs) {
|
|
9228
|
-
const hr = e.svgGlyphs.get(
|
|
9228
|
+
const hr = e.svgGlyphs.get(H.index);
|
|
9229
9229
|
if (hr) {
|
|
9230
|
-
let Ie =
|
|
9231
|
-
Ie =
|
|
9230
|
+
let Ie = Du(hr.svg);
|
|
9231
|
+
Ie = Bu(Ie, `g${H.index}-${D}`), o && (Ie = Pu(Ie, o)), cr = {
|
|
9232
9232
|
content: Ie,
|
|
9233
9233
|
viewBox: hr.viewbox,
|
|
9234
9234
|
x: A.x1,
|
|
9235
9235
|
y: A.y1,
|
|
9236
9236
|
width: A.x2 - A.x1,
|
|
9237
9237
|
height: A.y2 - A.y1,
|
|
9238
|
-
glyphIndex:
|
|
9238
|
+
glyphIndex: H.index
|
|
9239
9239
|
};
|
|
9240
9240
|
}
|
|
9241
9241
|
}
|
|
9242
|
-
|
|
9243
|
-
path:
|
|
9242
|
+
F.push({
|
|
9243
|
+
path: R,
|
|
9244
9244
|
matrix: se,
|
|
9245
9245
|
attributes: {
|
|
9246
9246
|
d: ve,
|
|
9247
|
-
"data-character":
|
|
9248
|
-
transform:
|
|
9247
|
+
"data-character": Nu(t[D]),
|
|
9248
|
+
transform: zn
|
|
9249
9249
|
},
|
|
9250
9250
|
glyphData: {
|
|
9251
|
-
index:
|
|
9251
|
+
index: H.index,
|
|
9252
9252
|
bbox: A
|
|
9253
9253
|
},
|
|
9254
9254
|
...cr ? { svgGlyph: cr } : {}
|
|
9255
9255
|
});
|
|
9256
9256
|
}
|
|
9257
|
-
return
|
|
9257
|
+
return F;
|
|
9258
9258
|
}, Pt = { hex: "#FFFFFF" }, Ir = (e, r) => {
|
|
9259
9259
|
const t = `data-${e}-colour-url`, n = [`${e}="${r.hex}"`];
|
|
9260
9260
|
return r.reference && n.push(`${t}="${r.reference}"`), n.join(" ");
|
|
9261
9261
|
}, Gt = (e, r) => {
|
|
9262
9262
|
const { attributes: t, svgGlyph: n } = e;
|
|
9263
9263
|
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}" ${Ir("fill", r)} transform="${t.transform}" data-character="${t["data-character"]}"/>`;
|
|
9264
|
-
},
|
|
9264
|
+
}, Wu = ({
|
|
9265
9265
|
boxDimensions: e,
|
|
9266
9266
|
paths: r,
|
|
9267
9267
|
spacing: t = $e,
|
|
@@ -9286,105 +9286,112 @@ const It = (e, r, t) => e / t * r, Nu = ({
|
|
|
9286
9286
|
${f}
|
|
9287
9287
|
` : "";
|
|
9288
9288
|
return `<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${u}" viewBox="0 0 ${o} ${u}">${c}</svg>`;
|
|
9289
|
-
},
|
|
9289
|
+
}, Nt = (e) => {
|
|
9290
9290
|
const {
|
|
9291
9291
|
text: r,
|
|
9292
9292
|
font: t,
|
|
9293
9293
|
physicalSize: n,
|
|
9294
|
-
|
|
9295
|
-
|
|
9296
|
-
|
|
9297
|
-
|
|
9298
|
-
|
|
9299
|
-
|
|
9300
|
-
|
|
9301
|
-
|
|
9302
|
-
|
|
9303
|
-
|
|
9294
|
+
fontSize: a,
|
|
9295
|
+
boxDimensions: s,
|
|
9296
|
+
spacing: o = $e,
|
|
9297
|
+
verticalAlignment: u = "centre",
|
|
9298
|
+
baseline: i = "flat",
|
|
9299
|
+
horizontalAlignment: l = "left",
|
|
9300
|
+
fillColour: f = { hex: "#FFFFFF" },
|
|
9301
|
+
strokeColour: c = { hex: "#FFFFFF" },
|
|
9302
|
+
colourMap: p
|
|
9303
|
+
} = e, { width: h, height: d, physicalWidth: g, physicalHeight: m } = s;
|
|
9304
|
+
if (h <= 0 || d <= 0)
|
|
9304
9305
|
throw new Error(
|
|
9305
|
-
`boxDimensions width and height must be positive (got ${
|
|
9306
|
+
`boxDimensions width and height must be positive (got ${h}x${d})`
|
|
9306
9307
|
);
|
|
9307
|
-
if (
|
|
9308
|
+
if (g <= 0 || m <= 0)
|
|
9308
9309
|
throw new Error(
|
|
9309
|
-
`boxDimensions physicalWidth and physicalHeight must be positive (got ${
|
|
9310
|
+
`boxDimensions physicalWidth and physicalHeight must be positive (got ${g}x${m})`
|
|
9310
9311
|
);
|
|
9311
9312
|
if (n[0] <= 0)
|
|
9312
9313
|
throw new Error(
|
|
9313
9314
|
`physicalSize height must be positive (got ${n[0]})`
|
|
9314
9315
|
);
|
|
9315
|
-
const
|
|
9316
|
+
const x = a ?? xu({
|
|
9316
9317
|
font: t,
|
|
9317
|
-
boxDimensions:
|
|
9318
|
+
boxDimensions: s,
|
|
9318
9319
|
physicalSize: n,
|
|
9319
|
-
spacing:
|
|
9320
|
-
}),
|
|
9321
|
-
let
|
|
9322
|
-
`).filter((
|
|
9323
|
-
|
|
9324
|
-
const
|
|
9325
|
-
(
|
|
9326
|
-
),
|
|
9327
|
-
for (let
|
|
9328
|
-
let
|
|
9329
|
-
switch (
|
|
9320
|
+
spacing: o
|
|
9321
|
+
}), U = du(i);
|
|
9322
|
+
let y = r.split(`
|
|
9323
|
+
`).filter((R) => R.length > 0);
|
|
9324
|
+
y.length || (y = [""]), (U.type === "curved" || U.type === "custom") && (y = [y.join("")]);
|
|
9325
|
+
const L = y.map(
|
|
9326
|
+
(R) => bu({ font: t, text: R, fontSize: x, spacing: o })
|
|
9327
|
+
), 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 = [];
|
|
9328
|
+
for (let R = 0; R < y.length; R++) {
|
|
9329
|
+
let A;
|
|
9330
|
+
switch (U.type) {
|
|
9330
9331
|
case "custom":
|
|
9331
|
-
|
|
9332
|
+
gu(U.path), A = U.path;
|
|
9332
9333
|
break;
|
|
9333
9334
|
case "curved":
|
|
9334
|
-
|
|
9335
|
-
boxDimensions:
|
|
9336
|
-
baseline:
|
|
9337
|
-
textHeight:
|
|
9338
|
-
verticalAlignment:
|
|
9335
|
+
A = In({
|
|
9336
|
+
boxDimensions: s,
|
|
9337
|
+
baseline: L[R].baseline,
|
|
9338
|
+
textHeight: L[R].height * (1 + Mn),
|
|
9339
|
+
verticalAlignment: u
|
|
9339
9340
|
});
|
|
9340
9341
|
break;
|
|
9341
9342
|
case "flat":
|
|
9342
|
-
|
|
9343
|
-
boxDimensions:
|
|
9344
|
-
totalTextHeight:
|
|
9345
|
-
baseline:
|
|
9346
|
-
lineHeight:
|
|
9347
|
-
verticalAlignment:
|
|
9348
|
-
lineNumber:
|
|
9343
|
+
A = mu({
|
|
9344
|
+
boxDimensions: s,
|
|
9345
|
+
totalTextHeight: F,
|
|
9346
|
+
baseline: w,
|
|
9347
|
+
lineHeight: C,
|
|
9348
|
+
verticalAlignment: u,
|
|
9349
|
+
lineNumber: R
|
|
9349
9350
|
});
|
|
9350
9351
|
break;
|
|
9351
9352
|
}
|
|
9352
|
-
const
|
|
9353
|
+
const H = Hu({
|
|
9353
9354
|
font: t,
|
|
9354
|
-
baselinePath:
|
|
9355
|
-
text:
|
|
9356
|
-
fontSize:
|
|
9357
|
-
spacing:
|
|
9358
|
-
horizontalAlignment:
|
|
9359
|
-
colourMap:
|
|
9355
|
+
baselinePath: A,
|
|
9356
|
+
text: y[R],
|
|
9357
|
+
fontSize: x,
|
|
9358
|
+
spacing: o,
|
|
9359
|
+
horizontalAlignment: l,
|
|
9360
|
+
colourMap: p
|
|
9360
9361
|
});
|
|
9361
|
-
|
|
9362
|
-
}
|
|
9363
|
-
return
|
|
9364
|
-
boxDimensions:
|
|
9365
|
-
paths:
|
|
9366
|
-
spacing:
|
|
9367
|
-
fontSize:
|
|
9368
|
-
fillColour:
|
|
9369
|
-
strokeColour:
|
|
9362
|
+
D.push(...H);
|
|
9363
|
+
}
|
|
9364
|
+
return Wu({
|
|
9365
|
+
boxDimensions: s,
|
|
9366
|
+
paths: D,
|
|
9367
|
+
spacing: o,
|
|
9368
|
+
fontSize: x,
|
|
9369
|
+
fillColour: f,
|
|
9370
|
+
strokeColour: c
|
|
9370
9371
|
});
|
|
9371
9372
|
}, qu = async (e) => {
|
|
9372
|
-
const { fontUrl: r,
|
|
9373
|
-
|
|
9373
|
+
const { fontUrl: r, fontSizeFallback: t, ...n } = e, a = !!n.colourMap, s = await cu(r, a);
|
|
9374
|
+
try {
|
|
9375
|
+
return Nt({ ...n, font: s });
|
|
9376
|
+
} catch (o) {
|
|
9377
|
+
if (t != null && o instanceof Error && o.message.startsWith("TOO_WIDE"))
|
|
9378
|
+
return Nt({ ...n, font: s, fontSize: t });
|
|
9379
|
+
throw o;
|
|
9380
|
+
}
|
|
9374
9381
|
};
|
|
9375
9382
|
export {
|
|
9376
|
-
|
|
9383
|
+
hu as DEFAULT_OUTLINE_FACTOR,
|
|
9377
9384
|
$e as DEFAULT_SPACING,
|
|
9378
|
-
|
|
9379
|
-
|
|
9380
|
-
|
|
9385
|
+
Bn as LINE_HEIGHT,
|
|
9386
|
+
In as generateCurvedBaseline,
|
|
9387
|
+
mu as generateFlatBaseline,
|
|
9381
9388
|
_u as getFontCache,
|
|
9382
9389
|
Vu as getFontColours,
|
|
9383
|
-
|
|
9390
|
+
xu as getFontSizeFromPhysicalSize,
|
|
9384
9391
|
qu as getRenderedText,
|
|
9385
|
-
|
|
9386
|
-
|
|
9387
|
-
|
|
9388
|
-
|
|
9389
|
-
|
|
9392
|
+
bu as getTextMetricsAtFontSize,
|
|
9393
|
+
cu as loadOpentypeFont,
|
|
9394
|
+
du as normaliseBaselineOption,
|
|
9395
|
+
Nt as renderText,
|
|
9396
|
+
gu as validateCustomBaselinePath
|
|
9390
9397
|
};
|