@mlightcad/mtext-renderer 0.9.3 → 0.9.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +898 -874
- package/dist/index.umd.cjs +8 -8
- package/dist/mtext-renderer-worker.js +328 -304
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as D from "three";
|
|
2
2
|
import { BufferGeometry as zi, BufferAttribute as Wi, ShapePath as Ia, ShapeUtils as Da, Shape as qi, LineCurve as ar, QuadraticBezierCurve as mn, CubicBezierCurve as bn, EllipseCurve as xn } from "three";
|
|
3
3
|
class Sn {
|
|
4
4
|
constructor() {
|
|
@@ -369,7 +369,7 @@ class Pa {
|
|
|
369
369
|
this.unsupportedChars[e] || (this.unsupportedChars[e] = 0), this.unsupportedChars[e]++;
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
class Na extends
|
|
372
|
+
class Na extends D.Shape {
|
|
373
373
|
constructor() {
|
|
374
374
|
super(...arguments), this.width = 0;
|
|
375
375
|
}
|
|
@@ -398,7 +398,7 @@ function $i(t) {
|
|
|
398
398
|
const a = () => {
|
|
399
399
|
t.removeEventListener("success", i), t.removeEventListener("error", s);
|
|
400
400
|
}, i = () => {
|
|
401
|
-
r(
|
|
401
|
+
r(tt(t.result)), a();
|
|
402
402
|
}, s = () => {
|
|
403
403
|
n(t.error), a();
|
|
404
404
|
};
|
|
@@ -429,7 +429,7 @@ let Dr = {
|
|
|
429
429
|
if (e === "store")
|
|
430
430
|
return r.objectStoreNames[1] ? void 0 : r.objectStore(r.objectStoreNames[0]);
|
|
431
431
|
}
|
|
432
|
-
return
|
|
432
|
+
return tt(t[e]);
|
|
433
433
|
},
|
|
434
434
|
set(t, e, r) {
|
|
435
435
|
return t[e] = r, !0;
|
|
@@ -443,15 +443,15 @@ function Ga(t) {
|
|
|
443
443
|
}
|
|
444
444
|
function Qi(t) {
|
|
445
445
|
return Zi().includes(t) ? function(...e) {
|
|
446
|
-
return t.apply(_r(this), e),
|
|
446
|
+
return t.apply(_r(this), e), tt(this.request);
|
|
447
447
|
} : function(...e) {
|
|
448
|
-
return
|
|
448
|
+
return tt(t.apply(_r(this), e));
|
|
449
449
|
};
|
|
450
450
|
}
|
|
451
451
|
function Ji(t) {
|
|
452
452
|
return typeof t == "function" ? Qi(t) : (t instanceof IDBTransaction && Ki(t), Mr(t, Yi()) ? new Proxy(t, Dr) : t);
|
|
453
453
|
}
|
|
454
|
-
function
|
|
454
|
+
function tt(t) {
|
|
455
455
|
if (t instanceof IDBRequest)
|
|
456
456
|
return $i(t);
|
|
457
457
|
if (ir.has(t))
|
|
@@ -461,9 +461,9 @@ function et(t) {
|
|
|
461
461
|
}
|
|
462
462
|
const _r = (t) => Jt.get(t);
|
|
463
463
|
function es(t, e, { blocked: r, upgrade: n, blocking: a, terminated: i } = {}) {
|
|
464
|
-
const s = indexedDB.open(t, e), o =
|
|
464
|
+
const s = indexedDB.open(t, e), o = tt(s);
|
|
465
465
|
return n && s.addEventListener("upgradeneeded", (c) => {
|
|
466
|
-
n(
|
|
466
|
+
n(tt(s.result), c.oldVersion, c.newVersion, tt(s.transaction), c);
|
|
467
467
|
}), r && s.addEventListener("blocked", (c) => r(
|
|
468
468
|
// Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
|
|
469
469
|
c.oldVersion,
|
|
@@ -501,12 +501,12 @@ Ga((t) => ({
|
|
|
501
501
|
get: (e, r, n) => Tn(e, r) || t.get(e, r, n),
|
|
502
502
|
has: (e, r) => !!Tn(e, r) || t.has(e, r)
|
|
503
503
|
}));
|
|
504
|
-
const ns = ["continue", "continuePrimaryKey", "advance"],
|
|
504
|
+
const ns = ["continue", "continuePrimaryKey", "advance"], En = {}, Pr = /* @__PURE__ */ new WeakMap(), Ha = /* @__PURE__ */ new WeakMap(), as = {
|
|
505
505
|
get(t, e) {
|
|
506
506
|
if (!ns.includes(e))
|
|
507
507
|
return t[e];
|
|
508
|
-
let r =
|
|
509
|
-
return r || (r =
|
|
508
|
+
let r = En[e];
|
|
509
|
+
return r || (r = En[e] = function(...n) {
|
|
510
510
|
Pr.set(this, Ha.get(this)[e](...n));
|
|
511
511
|
}), r;
|
|
512
512
|
}
|
|
@@ -520,26 +520,26 @@ async function* is(...t) {
|
|
|
520
520
|
for (Ha.set(r, e), Jt.set(r, _r(e)); e; )
|
|
521
521
|
yield r, e = await (Pr.get(r) || e.continue()), Pr.delete(r);
|
|
522
522
|
}
|
|
523
|
-
function
|
|
523
|
+
function Cn(t, e) {
|
|
524
524
|
return e === Symbol.asyncIterator && Mr(t, [IDBIndex, IDBObjectStore, IDBCursor]) || e === "iterate" && Mr(t, [IDBIndex, IDBObjectStore]);
|
|
525
525
|
}
|
|
526
526
|
Ga((t) => ({
|
|
527
527
|
...t,
|
|
528
528
|
get(e, r, n) {
|
|
529
|
-
return
|
|
529
|
+
return Cn(e, r) ? is : t.get(e, r, n);
|
|
530
530
|
},
|
|
531
531
|
has(e, r) {
|
|
532
|
-
return
|
|
532
|
+
return Cn(e, r) || t.has(e, r);
|
|
533
533
|
}
|
|
534
534
|
}));
|
|
535
|
-
const
|
|
535
|
+
const Qe = {
|
|
536
536
|
fonts: "fonts"
|
|
537
537
|
}, or = [
|
|
538
538
|
{
|
|
539
539
|
version: 1,
|
|
540
540
|
stores: [
|
|
541
541
|
{
|
|
542
|
-
name:
|
|
542
|
+
name: Qe.fonts,
|
|
543
543
|
keyPath: "name"
|
|
544
544
|
}
|
|
545
545
|
]
|
|
@@ -548,7 +548,7 @@ const $e = {
|
|
|
548
548
|
version: 2,
|
|
549
549
|
stores: [
|
|
550
550
|
{
|
|
551
|
-
name:
|
|
551
|
+
name: Qe.fonts,
|
|
552
552
|
keyPath: "name"
|
|
553
553
|
}
|
|
554
554
|
]
|
|
@@ -571,7 +571,7 @@ const $e = {
|
|
|
571
571
|
* @param fontData The font data to store
|
|
572
572
|
*/
|
|
573
573
|
async set(e, r) {
|
|
574
|
-
await (await this.getDatabase()).put(
|
|
574
|
+
await (await this.getDatabase()).put(Qe.fonts, { ...r, name: e });
|
|
575
575
|
}
|
|
576
576
|
/**
|
|
577
577
|
* Gets a font from the cache
|
|
@@ -579,27 +579,27 @@ const $e = {
|
|
|
579
579
|
* @returns The font data if found, undefined otherwise
|
|
580
580
|
*/
|
|
581
581
|
async get(e) {
|
|
582
|
-
return await (await this.getDatabase()).get(
|
|
582
|
+
return await (await this.getDatabase()).get(Qe.fonts, e);
|
|
583
583
|
}
|
|
584
584
|
/**
|
|
585
585
|
* Deletes a font from the cache
|
|
586
586
|
* @param fileName The font file name (key)
|
|
587
587
|
*/
|
|
588
588
|
async delete(e) {
|
|
589
|
-
await (await this.getDatabase()).delete(
|
|
589
|
+
await (await this.getDatabase()).delete(Qe.fonts, e);
|
|
590
590
|
}
|
|
591
591
|
/**
|
|
592
592
|
* Gets all fonts from the cache
|
|
593
593
|
* @returns An array of all font data in the cache
|
|
594
594
|
*/
|
|
595
595
|
async getAll() {
|
|
596
|
-
return await (await this.getDatabase()).getAll(
|
|
596
|
+
return await (await this.getDatabase()).getAll(Qe.fonts);
|
|
597
597
|
}
|
|
598
598
|
/**
|
|
599
599
|
* Clears all fonts from the cache
|
|
600
600
|
*/
|
|
601
601
|
async clear() {
|
|
602
|
-
await (await this.getDatabase()).clear(
|
|
602
|
+
await (await this.getDatabase()).clear(Qe.fonts);
|
|
603
603
|
}
|
|
604
604
|
/**
|
|
605
605
|
* Checks if a font exists in the cache
|
|
@@ -870,46 +870,46 @@ ja(Va, Xa, 2, 1);
|
|
|
870
870
|
$r[28] = 0;
|
|
871
871
|
Kr[28] = 258;
|
|
872
872
|
var ps = fs;
|
|
873
|
-
function
|
|
873
|
+
function at(t, e, r, n, a) {
|
|
874
874
|
return Math.pow(1 - a, 3) * t + 3 * Math.pow(1 - a, 2) * a * e + 3 * (1 - a) * Math.pow(a, 2) * r + Math.pow(a, 3) * n;
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function je() {
|
|
877
877
|
this.x1 = Number.NaN, this.y1 = Number.NaN, this.x2 = Number.NaN, this.y2 = Number.NaN;
|
|
878
878
|
}
|
|
879
|
-
|
|
879
|
+
je.prototype.isEmpty = function() {
|
|
880
880
|
return isNaN(this.x1) || isNaN(this.y1) || isNaN(this.x2) || isNaN(this.y2);
|
|
881
881
|
};
|
|
882
|
-
|
|
882
|
+
je.prototype.addPoint = function(t, e) {
|
|
883
883
|
typeof t == "number" && ((isNaN(this.x1) || isNaN(this.x2)) && (this.x1 = t, this.x2 = t), t < this.x1 && (this.x1 = t), t > this.x2 && (this.x2 = t)), typeof e == "number" && ((isNaN(this.y1) || isNaN(this.y2)) && (this.y1 = e, this.y2 = e), e < this.y1 && (this.y1 = e), e > this.y2 && (this.y2 = e));
|
|
884
884
|
};
|
|
885
|
-
|
|
885
|
+
je.prototype.addX = function(t) {
|
|
886
886
|
this.addPoint(t, null);
|
|
887
887
|
};
|
|
888
|
-
|
|
888
|
+
je.prototype.addY = function(t) {
|
|
889
889
|
this.addPoint(null, t);
|
|
890
890
|
};
|
|
891
|
-
|
|
891
|
+
je.prototype.addBezier = function(t, e, r, n, a, i, s, o) {
|
|
892
892
|
var c = [t, e], u = [r, n], h = [a, i], d = [s, o];
|
|
893
893
|
this.addPoint(t, e), this.addPoint(s, o);
|
|
894
894
|
for (var f = 0; f <= 1; f++) {
|
|
895
|
-
var g = 6 * c[f] - 12 * u[f] + 6 * h[f],
|
|
896
|
-
if (
|
|
895
|
+
var g = 6 * c[f] - 12 * u[f] + 6 * h[f], x = -3 * c[f] + 9 * u[f] - 9 * h[f] + 3 * d[f], v = 3 * u[f] - 3 * c[f];
|
|
896
|
+
if (x === 0) {
|
|
897
897
|
if (g === 0)
|
|
898
898
|
continue;
|
|
899
|
-
var
|
|
900
|
-
0 <
|
|
899
|
+
var S = -v / g;
|
|
900
|
+
0 < S && S < 1 && (f === 0 && this.addX(at(c[f], u[f], h[f], d[f], S)), f === 1 && this.addY(at(c[f], u[f], h[f], d[f], S)));
|
|
901
901
|
continue;
|
|
902
902
|
}
|
|
903
|
-
var m = Math.pow(g, 2) - 4 * v *
|
|
903
|
+
var m = Math.pow(g, 2) - 4 * v * x;
|
|
904
904
|
if (!(m < 0)) {
|
|
905
|
-
var F = (-g + Math.sqrt(m)) / (2 *
|
|
906
|
-
0 < F && F < 1 && (f === 0 && this.addX(
|
|
907
|
-
var w = (-g - Math.sqrt(m)) / (2 *
|
|
908
|
-
0 < w && w < 1 && (f === 0 && this.addX(
|
|
905
|
+
var F = (-g + Math.sqrt(m)) / (2 * x);
|
|
906
|
+
0 < F && F < 1 && (f === 0 && this.addX(at(c[f], u[f], h[f], d[f], F)), f === 1 && this.addY(at(c[f], u[f], h[f], d[f], F)));
|
|
907
|
+
var w = (-g - Math.sqrt(m)) / (2 * x);
|
|
908
|
+
0 < w && w < 1 && (f === 0 && this.addX(at(c[f], u[f], h[f], d[f], w)), f === 1 && this.addY(at(c[f], u[f], h[f], d[f], w)));
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
911
|
};
|
|
912
|
-
|
|
912
|
+
je.prototype.addQuad = function(t, e, r, n, a, i) {
|
|
913
913
|
var s = t + 0.6666666666666666 * (r - t), o = e + 2 / 3 * (n - e), c = s + 1 / 3 * (a - t), u = o + 1 / 3 * (i - e);
|
|
914
914
|
this.addBezier(t, e, s, o, c, u, a, i);
|
|
915
915
|
};
|
|
@@ -958,7 +958,7 @@ oe.prototype.close = oe.prototype.closePath = function() {
|
|
|
958
958
|
oe.prototype.extend = function(t) {
|
|
959
959
|
if (t.commands)
|
|
960
960
|
t = t.commands;
|
|
961
|
-
else if (t instanceof
|
|
961
|
+
else if (t instanceof je) {
|
|
962
962
|
var e = t;
|
|
963
963
|
this.moveTo(e.x1, e.y1), this.lineTo(e.x2, e.y1), this.lineTo(e.x2, e.y2), this.lineTo(e.x1, e.y2), this.close();
|
|
964
964
|
return;
|
|
@@ -966,7 +966,7 @@ oe.prototype.extend = function(t) {
|
|
|
966
966
|
Array.prototype.push.apply(this.commands, t);
|
|
967
967
|
};
|
|
968
968
|
oe.prototype.getBoundingBox = function() {
|
|
969
|
-
for (var t = new
|
|
969
|
+
for (var t = new je(), e = 0, r = 0, n = 0, a = 0, i = 0; i < this.commands.length; i++) {
|
|
970
970
|
var s = this.commands[i];
|
|
971
971
|
switch (s.type) {
|
|
972
972
|
case "M":
|
|
@@ -1027,11 +1027,11 @@ oe.prototype.toDOMElement = function(t) {
|
|
|
1027
1027
|
function Ya(t) {
|
|
1028
1028
|
throw new Error(t);
|
|
1029
1029
|
}
|
|
1030
|
-
function
|
|
1030
|
+
function On(t, e) {
|
|
1031
1031
|
t || Ya(e);
|
|
1032
1032
|
}
|
|
1033
|
-
var P = { fail: Ya, argument:
|
|
1034
|
-
function
|
|
1033
|
+
var P = { fail: Ya, argument: On, assert: On }, Ln = 32768, Rn = 2147483648, ut = {}, R = {}, N = {};
|
|
1034
|
+
function Ee(t) {
|
|
1035
1035
|
return function() {
|
|
1036
1036
|
return t;
|
|
1037
1037
|
};
|
|
@@ -1039,11 +1039,11 @@ function Ce(t) {
|
|
|
1039
1039
|
R.BYTE = function(t) {
|
|
1040
1040
|
return P.argument(t >= 0 && t <= 255, "Byte value should be between 0 and 255."), [t];
|
|
1041
1041
|
};
|
|
1042
|
-
N.BYTE =
|
|
1042
|
+
N.BYTE = Ee(1);
|
|
1043
1043
|
R.CHAR = function(t) {
|
|
1044
1044
|
return [t.charCodeAt(0)];
|
|
1045
1045
|
};
|
|
1046
|
-
N.CHAR =
|
|
1046
|
+
N.CHAR = Ee(1);
|
|
1047
1047
|
R.CHARARRAY = function(t) {
|
|
1048
1048
|
typeof t > "u" && (t = "", console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));
|
|
1049
1049
|
for (var e = [], r = 0; r < t.length; r += 1)
|
|
@@ -1056,23 +1056,23 @@ N.CHARARRAY = function(t) {
|
|
|
1056
1056
|
R.USHORT = function(t) {
|
|
1057
1057
|
return [t >> 8 & 255, t & 255];
|
|
1058
1058
|
};
|
|
1059
|
-
N.USHORT =
|
|
1059
|
+
N.USHORT = Ee(2);
|
|
1060
1060
|
R.SHORT = function(t) {
|
|
1061
|
-
return t >=
|
|
1061
|
+
return t >= Ln && (t = -(2 * Ln - t)), [t >> 8 & 255, t & 255];
|
|
1062
1062
|
};
|
|
1063
|
-
N.SHORT =
|
|
1063
|
+
N.SHORT = Ee(2);
|
|
1064
1064
|
R.UINT24 = function(t) {
|
|
1065
1065
|
return [t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
1066
1066
|
};
|
|
1067
|
-
N.UINT24 =
|
|
1067
|
+
N.UINT24 = Ee(3);
|
|
1068
1068
|
R.ULONG = function(t) {
|
|
1069
1069
|
return [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
1070
1070
|
};
|
|
1071
|
-
N.ULONG =
|
|
1071
|
+
N.ULONG = Ee(4);
|
|
1072
1072
|
R.LONG = function(t) {
|
|
1073
1073
|
return t >= Rn && (t = -(2 * Rn - t)), [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
1074
1074
|
};
|
|
1075
|
-
N.LONG =
|
|
1075
|
+
N.LONG = Ee(4);
|
|
1076
1076
|
R.FIXED = R.ULONG;
|
|
1077
1077
|
N.FIXED = N.ULONG;
|
|
1078
1078
|
R.FWORD = R.SHORT;
|
|
@@ -1082,7 +1082,7 @@ N.UFWORD = N.USHORT;
|
|
|
1082
1082
|
R.LONGDATETIME = function(t) {
|
|
1083
1083
|
return [0, 0, 0, 0, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
1084
1084
|
};
|
|
1085
|
-
N.LONGDATETIME =
|
|
1085
|
+
N.LONGDATETIME = Ee(8);
|
|
1086
1086
|
R.TAG = function(t) {
|
|
1087
1087
|
return P.argument(t.length === 4, "Tag should be exactly 4 ASCII characters."), [
|
|
1088
1088
|
t.charCodeAt(0),
|
|
@@ -1091,7 +1091,7 @@ R.TAG = function(t) {
|
|
|
1091
1091
|
t.charCodeAt(3)
|
|
1092
1092
|
];
|
|
1093
1093
|
};
|
|
1094
|
-
N.TAG =
|
|
1094
|
+
N.TAG = Ee(4);
|
|
1095
1095
|
R.Card8 = R.BYTE;
|
|
1096
1096
|
N.Card8 = N.BYTE;
|
|
1097
1097
|
R.Card16 = R.USHORT;
|
|
@@ -1109,11 +1109,11 @@ N.NUMBER = function(t) {
|
|
|
1109
1109
|
R.NUMBER16 = function(t) {
|
|
1110
1110
|
return [28, t >> 8 & 255, t & 255];
|
|
1111
1111
|
};
|
|
1112
|
-
N.NUMBER16 =
|
|
1112
|
+
N.NUMBER16 = Ee(3);
|
|
1113
1113
|
R.NUMBER32 = function(t) {
|
|
1114
1114
|
return [29, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
1115
1115
|
};
|
|
1116
|
-
N.NUMBER32 =
|
|
1116
|
+
N.NUMBER32 = Ee(5);
|
|
1117
1117
|
R.REAL = function(t) {
|
|
1118
1118
|
var e = t.toString(), r = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);
|
|
1119
1119
|
if (r) {
|
|
@@ -1567,98 +1567,98 @@ var Fs = {
|
|
|
1567
1567
|
longDateTime: 8,
|
|
1568
1568
|
tag: 4
|
|
1569
1569
|
};
|
|
1570
|
-
function
|
|
1570
|
+
function C(t, e) {
|
|
1571
1571
|
this.data = t, this.offset = e, this.relativeOffset = 0;
|
|
1572
1572
|
}
|
|
1573
|
-
|
|
1573
|
+
C.prototype.parseByte = function() {
|
|
1574
1574
|
var t = this.data.getUint8(this.offset + this.relativeOffset);
|
|
1575
1575
|
return this.relativeOffset += 1, t;
|
|
1576
1576
|
};
|
|
1577
|
-
|
|
1577
|
+
C.prototype.parseChar = function() {
|
|
1578
1578
|
var t = this.data.getInt8(this.offset + this.relativeOffset);
|
|
1579
1579
|
return this.relativeOffset += 1, t;
|
|
1580
1580
|
};
|
|
1581
|
-
|
|
1582
|
-
|
|
1581
|
+
C.prototype.parseCard8 = C.prototype.parseByte;
|
|
1582
|
+
C.prototype.parseUShort = function() {
|
|
1583
1583
|
var t = this.data.getUint16(this.offset + this.relativeOffset);
|
|
1584
1584
|
return this.relativeOffset += 2, t;
|
|
1585
1585
|
};
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1586
|
+
C.prototype.parseCard16 = C.prototype.parseUShort;
|
|
1587
|
+
C.prototype.parseSID = C.prototype.parseUShort;
|
|
1588
|
+
C.prototype.parseOffset16 = C.prototype.parseUShort;
|
|
1589
|
+
C.prototype.parseShort = function() {
|
|
1590
1590
|
var t = this.data.getInt16(this.offset + this.relativeOffset);
|
|
1591
1591
|
return this.relativeOffset += 2, t;
|
|
1592
1592
|
};
|
|
1593
|
-
|
|
1593
|
+
C.prototype.parseF2Dot14 = function() {
|
|
1594
1594
|
var t = this.data.getInt16(this.offset + this.relativeOffset) / 16384;
|
|
1595
1595
|
return this.relativeOffset += 2, t;
|
|
1596
1596
|
};
|
|
1597
|
-
|
|
1597
|
+
C.prototype.parseULong = function() {
|
|
1598
1598
|
var t = Qr(this.data, this.offset + this.relativeOffset);
|
|
1599
1599
|
return this.relativeOffset += 4, t;
|
|
1600
1600
|
};
|
|
1601
|
-
|
|
1602
|
-
|
|
1601
|
+
C.prototype.parseOffset32 = C.prototype.parseULong;
|
|
1602
|
+
C.prototype.parseFixed = function() {
|
|
1603
1603
|
var t = Za(this.data, this.offset + this.relativeOffset);
|
|
1604
1604
|
return this.relativeOffset += 4, t;
|
|
1605
1605
|
};
|
|
1606
|
-
|
|
1606
|
+
C.prototype.parseString = function(t) {
|
|
1607
1607
|
var e = this.data, r = this.offset + this.relativeOffset, n = "";
|
|
1608
1608
|
this.relativeOffset += t;
|
|
1609
1609
|
for (var a = 0; a < t; a++)
|
|
1610
1610
|
n += String.fromCharCode(e.getUint8(r + a));
|
|
1611
1611
|
return n;
|
|
1612
1612
|
};
|
|
1613
|
-
|
|
1613
|
+
C.prototype.parseTag = function() {
|
|
1614
1614
|
return this.parseString(4);
|
|
1615
1615
|
};
|
|
1616
|
-
|
|
1616
|
+
C.prototype.parseLongDateTime = function() {
|
|
1617
1617
|
var t = Qr(this.data, this.offset + this.relativeOffset + 4);
|
|
1618
1618
|
return t -= 2082844800, this.relativeOffset += 8, t;
|
|
1619
1619
|
};
|
|
1620
|
-
|
|
1620
|
+
C.prototype.parseVersion = function(t) {
|
|
1621
1621
|
var e = $t(this.data, this.offset + this.relativeOffset), r = $t(this.data, this.offset + this.relativeOffset + 2);
|
|
1622
1622
|
return this.relativeOffset += 4, t === void 0 && (t = 4096), e + r / t / 10;
|
|
1623
1623
|
};
|
|
1624
|
-
|
|
1624
|
+
C.prototype.skip = function(t, e) {
|
|
1625
1625
|
e === void 0 && (e = 1), this.relativeOffset += Fs[t] * e;
|
|
1626
1626
|
};
|
|
1627
|
-
|
|
1627
|
+
C.prototype.parseULongList = function(t) {
|
|
1628
1628
|
t === void 0 && (t = this.parseULong());
|
|
1629
1629
|
for (var e = new Array(t), r = this.data, n = this.offset + this.relativeOffset, a = 0; a < t; a++)
|
|
1630
1630
|
e[a] = r.getUint32(n), n += 4;
|
|
1631
1631
|
return this.relativeOffset += t * 4, e;
|
|
1632
1632
|
};
|
|
1633
|
-
|
|
1633
|
+
C.prototype.parseOffset16List = C.prototype.parseUShortList = function(t) {
|
|
1634
1634
|
t === void 0 && (t = this.parseUShort());
|
|
1635
1635
|
for (var e = new Array(t), r = this.data, n = this.offset + this.relativeOffset, a = 0; a < t; a++)
|
|
1636
1636
|
e[a] = r.getUint16(n), n += 2;
|
|
1637
1637
|
return this.relativeOffset += t * 2, e;
|
|
1638
1638
|
};
|
|
1639
|
-
|
|
1639
|
+
C.prototype.parseShortList = function(t) {
|
|
1640
1640
|
for (var e = new Array(t), r = this.data, n = this.offset + this.relativeOffset, a = 0; a < t; a++)
|
|
1641
1641
|
e[a] = r.getInt16(n), n += 2;
|
|
1642
1642
|
return this.relativeOffset += t * 2, e;
|
|
1643
1643
|
};
|
|
1644
|
-
|
|
1644
|
+
C.prototype.parseByteList = function(t) {
|
|
1645
1645
|
for (var e = new Array(t), r = this.data, n = this.offset + this.relativeOffset, a = 0; a < t; a++)
|
|
1646
1646
|
e[a] = r.getUint8(n++);
|
|
1647
1647
|
return this.relativeOffset += t, e;
|
|
1648
1648
|
};
|
|
1649
|
-
|
|
1649
|
+
C.prototype.parseList = function(t, e) {
|
|
1650
1650
|
e || (e = t, t = this.parseUShort());
|
|
1651
1651
|
for (var r = new Array(t), n = 0; n < t; n++)
|
|
1652
1652
|
r[n] = e.call(this);
|
|
1653
1653
|
return r;
|
|
1654
1654
|
};
|
|
1655
|
-
|
|
1655
|
+
C.prototype.parseList32 = function(t, e) {
|
|
1656
1656
|
e || (e = t, t = this.parseULong());
|
|
1657
1657
|
for (var r = new Array(t), n = 0; n < t; n++)
|
|
1658
1658
|
r[n] = e.call(this);
|
|
1659
1659
|
return r;
|
|
1660
1660
|
};
|
|
1661
|
-
|
|
1661
|
+
C.prototype.parseRecordList = function(t, e) {
|
|
1662
1662
|
e || (e = t, t = this.parseUShort());
|
|
1663
1663
|
for (var r = new Array(t), n = Object.keys(e), a = 0; a < t; a++) {
|
|
1664
1664
|
for (var i = {}, s = 0; s < n.length; s++) {
|
|
@@ -1669,7 +1669,7 @@ E.prototype.parseRecordList = function(t, e) {
|
|
|
1669
1669
|
}
|
|
1670
1670
|
return r;
|
|
1671
1671
|
};
|
|
1672
|
-
|
|
1672
|
+
C.prototype.parseRecordList32 = function(t, e) {
|
|
1673
1673
|
e || (e = t, t = this.parseULong());
|
|
1674
1674
|
for (var r = new Array(t), n = Object.keys(e), a = 0; a < t; a++) {
|
|
1675
1675
|
for (var i = {}, s = 0; s < n.length; s++) {
|
|
@@ -1680,7 +1680,7 @@ E.prototype.parseRecordList32 = function(t, e) {
|
|
|
1680
1680
|
}
|
|
1681
1681
|
return r;
|
|
1682
1682
|
};
|
|
1683
|
-
|
|
1683
|
+
C.prototype.parseStruct = function(t) {
|
|
1684
1684
|
if (typeof t == "function")
|
|
1685
1685
|
return t.call(this);
|
|
1686
1686
|
for (var e = Object.keys(t), r = {}, n = 0; n < e.length; n++) {
|
|
@@ -1689,28 +1689,28 @@ E.prototype.parseStruct = function(t) {
|
|
|
1689
1689
|
}
|
|
1690
1690
|
return r;
|
|
1691
1691
|
};
|
|
1692
|
-
|
|
1692
|
+
C.prototype.parseValueRecord = function(t) {
|
|
1693
1693
|
if (t === void 0 && (t = this.parseUShort()), t !== 0) {
|
|
1694
1694
|
var e = {};
|
|
1695
1695
|
return t & 1 && (e.xPlacement = this.parseShort()), t & 2 && (e.yPlacement = this.parseShort()), t & 4 && (e.xAdvance = this.parseShort()), t & 8 && (e.yAdvance = this.parseShort()), t & 16 && (e.xPlaDevice = void 0, this.parseShort()), t & 32 && (e.yPlaDevice = void 0, this.parseShort()), t & 64 && (e.xAdvDevice = void 0, this.parseShort()), t & 128 && (e.yAdvDevice = void 0, this.parseShort()), e;
|
|
1696
1696
|
}
|
|
1697
1697
|
};
|
|
1698
|
-
|
|
1698
|
+
C.prototype.parseValueRecordList = function() {
|
|
1699
1699
|
for (var t = this.parseUShort(), e = this.parseUShort(), r = new Array(e), n = 0; n < e; n++)
|
|
1700
1700
|
r[n] = this.parseValueRecord(t);
|
|
1701
1701
|
return r;
|
|
1702
1702
|
};
|
|
1703
|
-
|
|
1703
|
+
C.prototype.parsePointer = function(t) {
|
|
1704
1704
|
var e = this.parseOffset16();
|
|
1705
1705
|
if (e > 0)
|
|
1706
|
-
return new
|
|
1706
|
+
return new C(this.data, this.offset + e).parseStruct(t);
|
|
1707
1707
|
};
|
|
1708
|
-
|
|
1708
|
+
C.prototype.parsePointer32 = function(t) {
|
|
1709
1709
|
var e = this.parseOffset32();
|
|
1710
1710
|
if (e > 0)
|
|
1711
|
-
return new
|
|
1711
|
+
return new C(this.data, this.offset + e).parseStruct(t);
|
|
1712
1712
|
};
|
|
1713
|
-
|
|
1713
|
+
C.prototype.parseListOfLists = function(t) {
|
|
1714
1714
|
for (var e = this.parseOffset16List(), r = e.length, n = this.relativeOffset, a = new Array(r), i = 0; i < r; i++) {
|
|
1715
1715
|
var s = e[i];
|
|
1716
1716
|
if (s === 0) {
|
|
@@ -1726,7 +1726,7 @@ E.prototype.parseListOfLists = function(t) {
|
|
|
1726
1726
|
}
|
|
1727
1727
|
return this.relativeOffset = n, a;
|
|
1728
1728
|
};
|
|
1729
|
-
|
|
1729
|
+
C.prototype.parseCoverage = function() {
|
|
1730
1730
|
var t = this.offset + this.relativeOffset, e = this.parseUShort(), r = this.parseUShort();
|
|
1731
1731
|
if (e === 1)
|
|
1732
1732
|
return {
|
|
@@ -1747,7 +1747,7 @@ E.prototype.parseCoverage = function() {
|
|
|
1747
1747
|
}
|
|
1748
1748
|
throw new Error("0x" + t.toString(16) + ": Coverage format must be 1 or 2.");
|
|
1749
1749
|
};
|
|
1750
|
-
|
|
1750
|
+
C.prototype.parseClassDef = function() {
|
|
1751
1751
|
var t = this.offset + this.relativeOffset, e = this.parseUShort();
|
|
1752
1752
|
if (e === 1)
|
|
1753
1753
|
return {
|
|
@@ -1759,103 +1759,103 @@ E.prototype.parseClassDef = function() {
|
|
|
1759
1759
|
return {
|
|
1760
1760
|
format: 2,
|
|
1761
1761
|
ranges: this.parseRecordList({
|
|
1762
|
-
start:
|
|
1763
|
-
end:
|
|
1764
|
-
classId:
|
|
1762
|
+
start: C.uShort,
|
|
1763
|
+
end: C.uShort,
|
|
1764
|
+
classId: C.uShort
|
|
1765
1765
|
})
|
|
1766
1766
|
};
|
|
1767
1767
|
throw new Error("0x" + t.toString(16) + ": ClassDef format must be 1 or 2.");
|
|
1768
1768
|
};
|
|
1769
|
-
|
|
1769
|
+
C.list = function(t, e) {
|
|
1770
1770
|
return function() {
|
|
1771
1771
|
return this.parseList(t, e);
|
|
1772
1772
|
};
|
|
1773
1773
|
};
|
|
1774
|
-
|
|
1774
|
+
C.list32 = function(t, e) {
|
|
1775
1775
|
return function() {
|
|
1776
1776
|
return this.parseList32(t, e);
|
|
1777
1777
|
};
|
|
1778
1778
|
};
|
|
1779
|
-
|
|
1779
|
+
C.recordList = function(t, e) {
|
|
1780
1780
|
return function() {
|
|
1781
1781
|
return this.parseRecordList(t, e);
|
|
1782
1782
|
};
|
|
1783
1783
|
};
|
|
1784
|
-
|
|
1784
|
+
C.recordList32 = function(t, e) {
|
|
1785
1785
|
return function() {
|
|
1786
1786
|
return this.parseRecordList32(t, e);
|
|
1787
1787
|
};
|
|
1788
1788
|
};
|
|
1789
|
-
|
|
1789
|
+
C.pointer = function(t) {
|
|
1790
1790
|
return function() {
|
|
1791
1791
|
return this.parsePointer(t);
|
|
1792
1792
|
};
|
|
1793
1793
|
};
|
|
1794
|
-
|
|
1794
|
+
C.pointer32 = function(t) {
|
|
1795
1795
|
return function() {
|
|
1796
1796
|
return this.parsePointer32(t);
|
|
1797
1797
|
};
|
|
1798
1798
|
};
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1799
|
+
C.tag = C.prototype.parseTag;
|
|
1800
|
+
C.byte = C.prototype.parseByte;
|
|
1801
|
+
C.uShort = C.offset16 = C.prototype.parseUShort;
|
|
1802
|
+
C.uShortList = C.prototype.parseUShortList;
|
|
1803
|
+
C.uLong = C.offset32 = C.prototype.parseULong;
|
|
1804
|
+
C.uLongList = C.prototype.parseULongList;
|
|
1805
|
+
C.struct = C.prototype.parseStruct;
|
|
1806
|
+
C.coverage = C.prototype.parseCoverage;
|
|
1807
|
+
C.classDef = C.prototype.parseClassDef;
|
|
1808
1808
|
var In = {
|
|
1809
|
-
reserved:
|
|
1810
|
-
reqFeatureIndex:
|
|
1811
|
-
featureIndexes:
|
|
1812
|
-
};
|
|
1813
|
-
|
|
1814
|
-
return this.parsePointer(
|
|
1815
|
-
tag:
|
|
1816
|
-
script:
|
|
1817
|
-
defaultLangSys:
|
|
1818
|
-
langSysRecords:
|
|
1819
|
-
tag:
|
|
1820
|
-
langSys:
|
|
1809
|
+
reserved: C.uShort,
|
|
1810
|
+
reqFeatureIndex: C.uShort,
|
|
1811
|
+
featureIndexes: C.uShortList
|
|
1812
|
+
};
|
|
1813
|
+
C.prototype.parseScriptList = function() {
|
|
1814
|
+
return this.parsePointer(C.recordList({
|
|
1815
|
+
tag: C.tag,
|
|
1816
|
+
script: C.pointer({
|
|
1817
|
+
defaultLangSys: C.pointer(In),
|
|
1818
|
+
langSysRecords: C.recordList({
|
|
1819
|
+
tag: C.tag,
|
|
1820
|
+
langSys: C.pointer(In)
|
|
1821
1821
|
})
|
|
1822
1822
|
})
|
|
1823
1823
|
})) || [];
|
|
1824
1824
|
};
|
|
1825
|
-
|
|
1826
|
-
return this.parsePointer(
|
|
1827
|
-
tag:
|
|
1828
|
-
feature:
|
|
1829
|
-
featureParams:
|
|
1830
|
-
lookupListIndexes:
|
|
1825
|
+
C.prototype.parseFeatureList = function() {
|
|
1826
|
+
return this.parsePointer(C.recordList({
|
|
1827
|
+
tag: C.tag,
|
|
1828
|
+
feature: C.pointer({
|
|
1829
|
+
featureParams: C.offset16,
|
|
1830
|
+
lookupListIndexes: C.uShortList
|
|
1831
1831
|
})
|
|
1832
1832
|
})) || [];
|
|
1833
1833
|
};
|
|
1834
|
-
|
|
1835
|
-
return this.parsePointer(
|
|
1834
|
+
C.prototype.parseLookupList = function(t) {
|
|
1835
|
+
return this.parsePointer(C.list(C.pointer(function() {
|
|
1836
1836
|
var e = this.parseUShort();
|
|
1837
1837
|
P.argument(1 <= e && e <= 9, "GPOS/GSUB lookup type " + e + " unknown.");
|
|
1838
1838
|
var r = this.parseUShort(), n = r & 16;
|
|
1839
1839
|
return {
|
|
1840
1840
|
lookupType: e,
|
|
1841
1841
|
lookupFlag: r,
|
|
1842
|
-
subtables: this.parseList(
|
|
1842
|
+
subtables: this.parseList(C.pointer(t[e])),
|
|
1843
1843
|
markFilteringSet: n ? this.parseUShort() : void 0
|
|
1844
1844
|
};
|
|
1845
1845
|
}))) || [];
|
|
1846
1846
|
};
|
|
1847
|
-
|
|
1847
|
+
C.prototype.parseFeatureVariationsList = function() {
|
|
1848
1848
|
return this.parsePointer32(function() {
|
|
1849
1849
|
var t = this.parseUShort(), e = this.parseUShort();
|
|
1850
1850
|
P.argument(t === 1 && e < 1, "GPOS/GSUB feature variations table unknown.");
|
|
1851
1851
|
var r = this.parseRecordList32({
|
|
1852
|
-
conditionSetOffset:
|
|
1853
|
-
featureTableSubstitutionOffset:
|
|
1852
|
+
conditionSetOffset: C.offset32,
|
|
1853
|
+
featureTableSubstitutionOffset: C.offset32
|
|
1854
1854
|
});
|
|
1855
1855
|
return r;
|
|
1856
1856
|
}) || [];
|
|
1857
1857
|
};
|
|
1858
|
-
var
|
|
1858
|
+
var _ = {
|
|
1859
1859
|
getByte: Mn,
|
|
1860
1860
|
getCard8: Mn,
|
|
1861
1861
|
getUShort: $t,
|
|
@@ -1867,7 +1867,7 @@ var D = {
|
|
|
1867
1867
|
getOffset: xs,
|
|
1868
1868
|
getBytes: Ss,
|
|
1869
1869
|
bytesToString: ws,
|
|
1870
|
-
Parser:
|
|
1870
|
+
Parser: C
|
|
1871
1871
|
};
|
|
1872
1872
|
function ks(t, e) {
|
|
1873
1873
|
e.parseUShort(), t.length = e.parseULong(), t.language = e.parseULong();
|
|
@@ -1881,23 +1881,23 @@ function Ts(t, e, r, n, a) {
|
|
|
1881
1881
|
t.length = e.parseUShort(), t.language = e.parseUShort();
|
|
1882
1882
|
var i;
|
|
1883
1883
|
t.segCount = i = e.parseUShort() >> 1, e.skip("uShort", 3), t.glyphIndexMap = {};
|
|
1884
|
-
for (var s = new
|
|
1885
|
-
for (var f = void 0, g = s.parseUShort(),
|
|
1886
|
-
|
|
1884
|
+
for (var s = new _.Parser(r, n + a + 14), o = new _.Parser(r, n + a + 16 + i * 2), c = new _.Parser(r, n + a + 16 + i * 4), u = new _.Parser(r, n + a + 16 + i * 6), h = n + a + 16 + i * 8, d = 0; d < i - 1; d += 1)
|
|
1885
|
+
for (var f = void 0, g = s.parseUShort(), x = o.parseUShort(), v = c.parseShort(), S = u.parseUShort(), m = x; m <= g; m += 1)
|
|
1886
|
+
S !== 0 ? (h = u.offset + u.relativeOffset - 2, h += S, h += (m - x) * 2, f = _.getUShort(r, h), f !== 0 && (f = f + v & 65535)) : f = m + v & 65535, t.glyphIndexMap[m] = f;
|
|
1887
1887
|
}
|
|
1888
|
-
function
|
|
1888
|
+
function Es(t, e) {
|
|
1889
1889
|
var r = {};
|
|
1890
|
-
r.version =
|
|
1890
|
+
r.version = _.getUShort(t, e), P.argument(r.version === 0, "cmap table version should be 0."), r.numTables = _.getUShort(t, e + 2);
|
|
1891
1891
|
for (var n = -1, a = r.numTables - 1; a >= 0; a -= 1) {
|
|
1892
|
-
var i =
|
|
1892
|
+
var i = _.getUShort(t, e + 4 + a * 8), s = _.getUShort(t, e + 4 + a * 8 + 2);
|
|
1893
1893
|
if (i === 3 && (s === 0 || s === 1 || s === 10) || i === 0 && (s === 0 || s === 1 || s === 2 || s === 3 || s === 4)) {
|
|
1894
|
-
n =
|
|
1894
|
+
n = _.getULong(t, e + 4 + a * 8 + 4);
|
|
1895
1895
|
break;
|
|
1896
1896
|
}
|
|
1897
1897
|
}
|
|
1898
1898
|
if (n === -1)
|
|
1899
1899
|
throw new Error("No valid cmap sub-tables found.");
|
|
1900
|
-
var o = new
|
|
1900
|
+
var o = new _.Parser(t, e + n);
|
|
1901
1901
|
if (r.format = o.parseUShort(), r.format === 12)
|
|
1902
1902
|
ks(r, o);
|
|
1903
1903
|
else if (r.format === 4)
|
|
@@ -1906,7 +1906,7 @@ function Cs(t, e) {
|
|
|
1906
1906
|
throw new Error("Only format 4 and 12 cmap tables are supported (found format " + r.format + ").");
|
|
1907
1907
|
return r;
|
|
1908
1908
|
}
|
|
1909
|
-
function
|
|
1909
|
+
function Cs(t, e, r) {
|
|
1910
1910
|
t.segments.push({
|
|
1911
1911
|
end: e,
|
|
1912
1912
|
start: e,
|
|
@@ -1959,20 +1959,20 @@ function Us(t) {
|
|
|
1959
1959
|
var i = new M.Table("cmap", a);
|
|
1960
1960
|
for (i.segments = [], r = 0; r < t.length; r += 1) {
|
|
1961
1961
|
for (var s = t.get(r), o = 0; o < s.unicodes.length; o += 1)
|
|
1962
|
-
|
|
1962
|
+
Cs(i, s.unicodes[o], r);
|
|
1963
1963
|
i.segments = i.segments.sort(function(F, w) {
|
|
1964
1964
|
return F.start - w.start;
|
|
1965
1965
|
});
|
|
1966
1966
|
}
|
|
1967
1967
|
As(i);
|
|
1968
|
-
var c = i.segments.length, u = 0, h = [], d = [], f = [], g = [],
|
|
1968
|
+
var c = i.segments.length, u = 0, h = [], d = [], f = [], g = [], x = [], v = [];
|
|
1969
1969
|
for (r = 0; r < c; r += 1) {
|
|
1970
|
-
var
|
|
1971
|
-
|
|
1970
|
+
var S = i.segments[r];
|
|
1971
|
+
S.end <= 65535 && S.start <= 65535 ? (h = h.concat({ name: "end_" + r, type: "USHORT", value: S.end }), d = d.concat({ name: "start_" + r, type: "USHORT", value: S.start }), f = f.concat({ name: "idDelta_" + r, type: "SHORT", value: S.delta }), g = g.concat({ name: "idRangeOffset_" + r, type: "USHORT", value: S.offset }), S.glyphId !== void 0 && (x = x.concat({ name: "glyph_" + r, type: "USHORT", value: S.glyphId }))) : u += 1, !e && S.glyphIndex !== void 0 && (v = v.concat({ name: "cmap12Start_" + r, type: "ULONG", value: S.start }), v = v.concat({ name: "cmap12End_" + r, type: "ULONG", value: S.end }), v = v.concat({ name: "cmap12Glyph_" + r, type: "ULONG", value: S.glyphIndex }));
|
|
1972
1972
|
}
|
|
1973
|
-
if (i.segCountX2 = (c - u) * 2, i.searchRange = Math.pow(2, Math.floor(Math.log(c - u) / Math.log(2))) * 2, i.entrySelector = Math.log(i.searchRange / 2) / Math.log(2), i.rangeShift = i.segCountX2 - i.searchRange, i.fields = i.fields.concat(h), i.fields.push({ name: "reservedPad", type: "USHORT", value: 0 }), i.fields = i.fields.concat(d), i.fields = i.fields.concat(f), i.fields = i.fields.concat(g), i.fields = i.fields.concat(
|
|
1973
|
+
if (i.segCountX2 = (c - u) * 2, i.searchRange = Math.pow(2, Math.floor(Math.log(c - u) / Math.log(2))) * 2, i.entrySelector = Math.log(i.searchRange / 2) / Math.log(2), i.rangeShift = i.segCountX2 - i.searchRange, i.fields = i.fields.concat(h), i.fields.push({ name: "reservedPad", type: "USHORT", value: 0 }), i.fields = i.fields.concat(d), i.fields = i.fields.concat(f), i.fields = i.fields.concat(g), i.fields = i.fields.concat(x), i.cmap4Length = 14 + // Subtable header
|
|
1974
1974
|
h.length * 2 + 2 + // reservedPad
|
|
1975
|
-
d.length * 2 + f.length * 2 + g.length * 2 +
|
|
1975
|
+
d.length * 2 + f.length * 2 + g.length * 2 + x.length * 2, !e) {
|
|
1976
1976
|
var m = 16 + // Subtable header
|
|
1977
1977
|
v.length * 4;
|
|
1978
1978
|
i.cmap12Offset = 12 + 2 * 2 + 4 + i.cmap4Length, i.fields = i.fields.concat([
|
|
@@ -1985,7 +1985,7 @@ function Us(t) {
|
|
|
1985
1985
|
}
|
|
1986
1986
|
return i;
|
|
1987
1987
|
}
|
|
1988
|
-
var $a = { parse:
|
|
1988
|
+
var $a = { parse: Es, make: Us }, Wt = [
|
|
1989
1989
|
".notdef",
|
|
1990
1990
|
"space",
|
|
1991
1991
|
"exclam",
|
|
@@ -2630,7 +2630,7 @@ var $a = { parse: Cs, make: Us }, Wt = [
|
|
|
2630
2630
|
"oslash",
|
|
2631
2631
|
"oe",
|
|
2632
2632
|
"germandbls"
|
|
2633
|
-
],
|
|
2633
|
+
], Os = [
|
|
2634
2634
|
"",
|
|
2635
2635
|
"",
|
|
2636
2636
|
"",
|
|
@@ -2886,7 +2886,7 @@ var $a = { parse: Cs, make: Us }, Wt = [
|
|
|
2886
2886
|
"Yacutesmall",
|
|
2887
2887
|
"Thornsmall",
|
|
2888
2888
|
"Ydieresissmall"
|
|
2889
|
-
],
|
|
2889
|
+
], Je = [
|
|
2890
2890
|
".notdef",
|
|
2891
2891
|
".null",
|
|
2892
2892
|
"nonmarkingreturn",
|
|
@@ -3175,17 +3175,17 @@ Kt.prototype.charToGlyphIndex = function(t) {
|
|
|
3175
3175
|
function Jr(t) {
|
|
3176
3176
|
switch (t.version) {
|
|
3177
3177
|
case 1:
|
|
3178
|
-
this.names =
|
|
3178
|
+
this.names = Je.slice();
|
|
3179
3179
|
break;
|
|
3180
3180
|
case 2:
|
|
3181
3181
|
this.names = new Array(t.numberOfGlyphs);
|
|
3182
3182
|
for (var e = 0; e < t.numberOfGlyphs; e++)
|
|
3183
|
-
t.glyphNameIndex[e] <
|
|
3183
|
+
t.glyphNameIndex[e] < Je.length ? this.names[e] = Je[t.glyphNameIndex[e]] : this.names[e] = t.names[t.glyphNameIndex[e] - Je.length];
|
|
3184
3184
|
break;
|
|
3185
3185
|
case 2.5:
|
|
3186
3186
|
this.names = new Array(t.numberOfGlyphs);
|
|
3187
3187
|
for (var r = 0; r < t.numberOfGlyphs; r++)
|
|
3188
|
-
this.names[r] =
|
|
3188
|
+
this.names[r] = Je[r + t.glyphNameIndex[r]];
|
|
3189
3189
|
break;
|
|
3190
3190
|
case 3:
|
|
3191
3191
|
this.names = [];
|
|
@@ -3201,7 +3201,7 @@ Jr.prototype.nameToGlyphIndex = function(t) {
|
|
|
3201
3201
|
Jr.prototype.glyphIndexToName = function(t) {
|
|
3202
3202
|
return this.names[t];
|
|
3203
3203
|
};
|
|
3204
|
-
function
|
|
3204
|
+
function Ls(t) {
|
|
3205
3205
|
for (var e, r = t.tables.cmap.glyphIndexMap, n = Object.keys(r), a = 0; a < n.length; a += 1) {
|
|
3206
3206
|
var i = n[a], s = r[i];
|
|
3207
3207
|
e = t.glyphs.get(s), e.addUnicode(parseInt(i));
|
|
@@ -3219,12 +3219,12 @@ function Rs(t) {
|
|
|
3219
3219
|
}
|
|
3220
3220
|
}
|
|
3221
3221
|
function Ms(t, e) {
|
|
3222
|
-
e.lowMemory ? Rs(t) :
|
|
3222
|
+
e.lowMemory ? Rs(t) : Ls(t);
|
|
3223
3223
|
}
|
|
3224
3224
|
function Is(t, e, r, n, a) {
|
|
3225
3225
|
t.beginPath(), t.moveTo(e, r), t.lineTo(n, a), t.stroke();
|
|
3226
3226
|
}
|
|
3227
|
-
var
|
|
3227
|
+
var Ze = { line: Is };
|
|
3228
3228
|
function Ds(t, e) {
|
|
3229
3229
|
var r = e || new oe();
|
|
3230
3230
|
return {
|
|
@@ -3306,10 +3306,10 @@ Se.prototype.draw = function(t, e, r, n, a) {
|
|
|
3306
3306
|
this.getPath(e, r, n, a).draw(t);
|
|
3307
3307
|
};
|
|
3308
3308
|
Se.prototype.drawPoints = function(t, e, r, n) {
|
|
3309
|
-
function a(d, f, g,
|
|
3309
|
+
function a(d, f, g, x) {
|
|
3310
3310
|
t.beginPath();
|
|
3311
3311
|
for (var v = 0; v < d.length; v += 1)
|
|
3312
|
-
t.moveTo(f + d[v].x *
|
|
3312
|
+
t.moveTo(f + d[v].x * x, g + d[v].y * x), t.arc(f + d[v].x * x, g + d[v].y * x, 2, 0, Math.PI * 2, !1);
|
|
3313
3313
|
t.closePath(), t.fill();
|
|
3314
3314
|
}
|
|
3315
3315
|
e = e !== void 0 ? e : 0, r = r !== void 0 ? r : 0, n = n !== void 0 ? n : 24;
|
|
@@ -3321,9 +3321,9 @@ Se.prototype.drawPoints = function(t, e, r, n) {
|
|
|
3321
3321
|
};
|
|
3322
3322
|
Se.prototype.drawMetrics = function(t, e, r, n) {
|
|
3323
3323
|
var a;
|
|
3324
|
-
e = e !== void 0 ? e : 0, r = r !== void 0 ? r : 0, n = n !== void 0 ? n : 24, a = 1 / this.path.unitsPerEm * n, t.lineWidth = 1, t.strokeStyle = "black",
|
|
3324
|
+
e = e !== void 0 ? e : 0, r = r !== void 0 ? r : 0, n = n !== void 0 ? n : 24, a = 1 / this.path.unitsPerEm * n, t.lineWidth = 1, t.strokeStyle = "black", Ze.line(t, e, -1e4, e, 1e4), Ze.line(t, -1e4, r, 1e4, r);
|
|
3325
3325
|
var i = this.xMin || 0, s = this.yMin || 0, o = this.xMax || 0, c = this.yMax || 0, u = this.advanceWidth || 0;
|
|
3326
|
-
t.strokeStyle = "blue",
|
|
3326
|
+
t.strokeStyle = "blue", Ze.line(t, e + i * a, -1e4, e + i * a, 1e4), Ze.line(t, e + o * a, -1e4, e + o * a, 1e4), Ze.line(t, -1e4, r + -s * a, 1e4, r + -s * a), Ze.line(t, -1e4, r + -c * a, 1e4, r + -c * a), t.strokeStyle = "green", Ze.line(t, e + u * a, -1e4, e + u * a, 1e4);
|
|
3327
3327
|
};
|
|
3328
3328
|
function Pt(t, e, r) {
|
|
3329
3329
|
Object.defineProperty(t, e, {
|
|
@@ -3401,40 +3401,40 @@ function Wr(t) {
|
|
|
3401
3401
|
return t.length < 1240 ? e = 107 : t.length < 33900 ? e = 1131 : e = 32768, e;
|
|
3402
3402
|
}
|
|
3403
3403
|
function He(t, e, r) {
|
|
3404
|
-
var n = [], a = [], i =
|
|
3404
|
+
var n = [], a = [], i = _.getCard16(t, e), s, o;
|
|
3405
3405
|
if (i !== 0) {
|
|
3406
|
-
var c =
|
|
3406
|
+
var c = _.getByte(t, e + 2);
|
|
3407
3407
|
s = e + (i + 1) * c + 2;
|
|
3408
3408
|
for (var u = e + 3, h = 0; h < i + 1; h += 1)
|
|
3409
|
-
n.push(
|
|
3409
|
+
n.push(_.getOffset(t, u, c)), u += c;
|
|
3410
3410
|
o = s + n[i];
|
|
3411
3411
|
} else
|
|
3412
3412
|
o = e + 2;
|
|
3413
3413
|
for (var d = 0; d < n.length - 1; d += 1) {
|
|
3414
|
-
var f =
|
|
3414
|
+
var f = _.getBytes(t, s + n[d], s + n[d + 1]);
|
|
3415
3415
|
r && (f = r(f)), a.push(f);
|
|
3416
3416
|
}
|
|
3417
3417
|
return { objects: a, startOffset: e, endOffset: o };
|
|
3418
3418
|
}
|
|
3419
3419
|
function Gs(t, e) {
|
|
3420
|
-
var r = [], n =
|
|
3420
|
+
var r = [], n = _.getCard16(t, e), a, i;
|
|
3421
3421
|
if (n !== 0) {
|
|
3422
|
-
var s =
|
|
3422
|
+
var s = _.getByte(t, e + 2);
|
|
3423
3423
|
a = e + (n + 1) * s + 2;
|
|
3424
3424
|
for (var o = e + 3, c = 0; c < n + 1; c += 1)
|
|
3425
|
-
r.push(
|
|
3425
|
+
r.push(_.getOffset(t, o, s)), o += s;
|
|
3426
3426
|
i = a + r[n];
|
|
3427
3427
|
} else
|
|
3428
3428
|
i = e + 2;
|
|
3429
3429
|
return { offsets: r, startOffset: e, endOffset: i };
|
|
3430
3430
|
}
|
|
3431
3431
|
function Hs(t, e, r, n, a) {
|
|
3432
|
-
var i =
|
|
3432
|
+
var i = _.getCard16(r, n), s = 0;
|
|
3433
3433
|
if (i !== 0) {
|
|
3434
|
-
var o =
|
|
3434
|
+
var o = _.getByte(r, n + 2);
|
|
3435
3435
|
s = n + (i + 1) * o + 2;
|
|
3436
3436
|
}
|
|
3437
|
-
var c =
|
|
3437
|
+
var c = _.getBytes(r, s + e[t], s + e[t + 1]);
|
|
3438
3438
|
return c;
|
|
3439
3439
|
}
|
|
3440
3440
|
function zs(t) {
|
|
@@ -3473,7 +3473,7 @@ function qs(t) {
|
|
|
3473
3473
|
}
|
|
3474
3474
|
function ei(t, e, r) {
|
|
3475
3475
|
e = e !== void 0 ? e : 0;
|
|
3476
|
-
var n = new
|
|
3476
|
+
var n = new _.Parser(t, e), a = [], i = [];
|
|
3477
3477
|
for (r = r !== void 0 ? r : t.length; n.relativeOffset < r; ) {
|
|
3478
3478
|
var s = n.parseByte();
|
|
3479
3479
|
s <= 21 ? (s === 12 && (s = 1200 + n.parseByte()), a.push([s, i]), i = []) : i.push(Ws(n, s));
|
|
@@ -3499,7 +3499,7 @@ function ti(t, e, r) {
|
|
|
3499
3499
|
}
|
|
3500
3500
|
function Vs(t, e) {
|
|
3501
3501
|
var r = {};
|
|
3502
|
-
return r.formatMajor =
|
|
3502
|
+
return r.formatMajor = _.getCard8(t, e), r.formatMinor = _.getCard8(t, e + 1), r.size = _.getCard8(t, e + 2), r.offsetSize = _.getCard8(t, e + 3), r.startOffset = e, r.endOffset = e + 4, r;
|
|
3503
3503
|
}
|
|
3504
3504
|
var ri = [
|
|
3505
3505
|
{ name: "version", op: 0, type: "SID" },
|
|
@@ -3568,7 +3568,7 @@ function Dn(t, e, r, n) {
|
|
|
3568
3568
|
return a;
|
|
3569
3569
|
}
|
|
3570
3570
|
function js(t, e, r, n) {
|
|
3571
|
-
var a, i, s = new
|
|
3571
|
+
var a, i, s = new _.Parser(t, e);
|
|
3572
3572
|
r -= 1;
|
|
3573
3573
|
var o = [".notdef"], c = s.parseCard8();
|
|
3574
3574
|
if (c === 0)
|
|
@@ -3591,7 +3591,7 @@ function js(t, e, r, n) {
|
|
|
3591
3591
|
return o;
|
|
3592
3592
|
}
|
|
3593
3593
|
function Ys(t, e, r) {
|
|
3594
|
-
var n, a = {}, i = new
|
|
3594
|
+
var n, a = {}, i = new _.Parser(t, e), s = i.parseCard8();
|
|
3595
3595
|
if (s === 0)
|
|
3596
3596
|
for (var o = i.parseCard8(), c = 0; c < o; c += 1)
|
|
3597
3597
|
n = i.parseCard8(), a[n] = c;
|
|
@@ -3606,32 +3606,32 @@ function Ys(t, e, r) {
|
|
|
3606
3606
|
return new Kt(a, r);
|
|
3607
3607
|
}
|
|
3608
3608
|
function _n(t, e, r) {
|
|
3609
|
-
var n, a, i, s, o = new oe(), c = [], u = 0, h = !1, d = !1, f = 0, g = 0,
|
|
3609
|
+
var n, a, i, s, o = new oe(), c = [], u = 0, h = !1, d = !1, f = 0, g = 0, x, v, S, m;
|
|
3610
3610
|
if (t.isCIDFont) {
|
|
3611
3611
|
var F = t.tables.cff.topDict._fdSelect[e.index], w = t.tables.cff.topDict._fdArray[F];
|
|
3612
|
-
|
|
3612
|
+
x = w._subrs, v = w._subrsBias, S = w._defaultWidthX, m = w._nominalWidthX;
|
|
3613
3613
|
} else
|
|
3614
|
-
|
|
3615
|
-
var k =
|
|
3616
|
-
function
|
|
3617
|
-
d && o.closePath(), o.moveTo(
|
|
3618
|
-
}
|
|
3619
|
-
function
|
|
3620
|
-
var
|
|
3621
|
-
|
|
3622
|
-
}
|
|
3623
|
-
function B(
|
|
3624
|
-
for (var H, W, z, ce, ie, Y, Z, $, te, se, ae, ue, G = 0; G <
|
|
3625
|
-
var V =
|
|
3614
|
+
x = t.tables.cff.topDict._subrs, v = t.tables.cff.topDict._subrsBias, S = t.tables.cff.topDict._defaultWidthX, m = t.tables.cff.topDict._nominalWidthX;
|
|
3615
|
+
var k = S;
|
|
3616
|
+
function E(L, H) {
|
|
3617
|
+
d && o.closePath(), o.moveTo(L, H), d = !0;
|
|
3618
|
+
}
|
|
3619
|
+
function O() {
|
|
3620
|
+
var L;
|
|
3621
|
+
L = c.length % 2 !== 0, L && !h && (k = c.shift() + m), u += c.length >> 1, c.length = 0, h = !0;
|
|
3622
|
+
}
|
|
3623
|
+
function B(L) {
|
|
3624
|
+
for (var H, W, z, ce, ie, Y, Z, $, te, se, ae, ue, G = 0; G < L.length; ) {
|
|
3625
|
+
var V = L[G];
|
|
3626
3626
|
switch (G += 1, V) {
|
|
3627
3627
|
case 1:
|
|
3628
|
-
|
|
3628
|
+
O();
|
|
3629
3629
|
break;
|
|
3630
3630
|
case 3:
|
|
3631
|
-
|
|
3631
|
+
O();
|
|
3632
3632
|
break;
|
|
3633
3633
|
case 4:
|
|
3634
|
-
c.length > 1 && !h && (k = c.shift() + m, h = !0), g += c.pop(),
|
|
3634
|
+
c.length > 1 && !h && (k = c.shift() + m, h = !0), g += c.pop(), E(f, g);
|
|
3635
3635
|
break;
|
|
3636
3636
|
case 5:
|
|
3637
3637
|
for (; c.length > 0; )
|
|
@@ -3650,12 +3650,12 @@ function _n(t, e, r) {
|
|
|
3650
3650
|
n = f + c.shift(), a = g + c.shift(), i = n + c.shift(), s = a + c.shift(), f = i + c.shift(), g = s + c.shift(), o.curveTo(n, a, i, s, f, g);
|
|
3651
3651
|
break;
|
|
3652
3652
|
case 10:
|
|
3653
|
-
ie = c.pop() + v, Y =
|
|
3653
|
+
ie = c.pop() + v, Y = x[ie], Y && B(Y);
|
|
3654
3654
|
break;
|
|
3655
3655
|
case 11:
|
|
3656
3656
|
return;
|
|
3657
3657
|
case 12:
|
|
3658
|
-
switch (V =
|
|
3658
|
+
switch (V = L[G], G += 1, V) {
|
|
3659
3659
|
case 35:
|
|
3660
3660
|
n = f + c.shift(), a = g + c.shift(), i = n + c.shift(), s = a + c.shift(), Z = i + c.shift(), $ = s + c.shift(), te = Z + c.shift(), se = $ + c.shift(), ae = te + c.shift(), ue = se + c.shift(), f = ae + c.shift(), g = ue + c.shift(), c.shift(), o.curveTo(n, a, i, s, Z, $), o.curveTo(te, se, ae, ue, f, g);
|
|
3661
3661
|
break;
|
|
@@ -3676,20 +3676,20 @@ function _n(t, e, r) {
|
|
|
3676
3676
|
c.length > 0 && !h && (k = c.shift() + m, h = !0), d && (o.closePath(), d = !1);
|
|
3677
3677
|
break;
|
|
3678
3678
|
case 18:
|
|
3679
|
-
|
|
3679
|
+
O();
|
|
3680
3680
|
break;
|
|
3681
3681
|
case 19:
|
|
3682
3682
|
case 20:
|
|
3683
|
-
|
|
3683
|
+
O(), G += u + 7 >> 3;
|
|
3684
3684
|
break;
|
|
3685
3685
|
case 21:
|
|
3686
|
-
c.length > 2 && !h && (k = c.shift() + m, h = !0), g += c.pop(), f += c.pop(),
|
|
3686
|
+
c.length > 2 && !h && (k = c.shift() + m, h = !0), g += c.pop(), f += c.pop(), E(f, g);
|
|
3687
3687
|
break;
|
|
3688
3688
|
case 22:
|
|
3689
|
-
c.length > 1 && !h && (k = c.shift() + m, h = !0), f += c.pop(),
|
|
3689
|
+
c.length > 1 && !h && (k = c.shift() + m, h = !0), f += c.pop(), E(f, g);
|
|
3690
3690
|
break;
|
|
3691
3691
|
case 23:
|
|
3692
|
-
|
|
3692
|
+
O();
|
|
3693
3693
|
break;
|
|
3694
3694
|
case 24:
|
|
3695
3695
|
for (; c.length > 2; )
|
|
@@ -3710,7 +3710,7 @@ function _n(t, e, r) {
|
|
|
3710
3710
|
n = f + c.shift(), a = g, i = n + c.shift(), s = a + c.shift(), f = i + c.shift(), g = s, o.curveTo(n, a, i, s, f, g);
|
|
3711
3711
|
break;
|
|
3712
3712
|
case 28:
|
|
3713
|
-
H =
|
|
3713
|
+
H = L[G], W = L[G + 1], c.push((H << 24 | W << 16) >> 16), G += 2;
|
|
3714
3714
|
break;
|
|
3715
3715
|
case 29:
|
|
3716
3716
|
ie = c.pop() + t.gsubrsBias, Y = t.gsubrs[ie], Y && B(Y);
|
|
@@ -3724,14 +3724,14 @@ function _n(t, e, r) {
|
|
|
3724
3724
|
n = f, a = g + c.shift(), i = n + c.shift(), s = a + c.shift(), f = i + c.shift(), g = s + (c.length === 1 ? c.shift() : 0), o.curveTo(n, a, i, s, f, g);
|
|
3725
3725
|
break;
|
|
3726
3726
|
default:
|
|
3727
|
-
V < 32 ? console.log("Glyph " + e.index + ": unknown operator " + V) : V < 247 ? c.push(V - 139) : V < 251 ? (H =
|
|
3727
|
+
V < 32 ? console.log("Glyph " + e.index + ": unknown operator " + V) : V < 247 ? c.push(V - 139) : V < 251 ? (H = L[G], G += 1, c.push((V - 247) * 256 + H + 108)) : V < 255 ? (H = L[G], G += 1, c.push(-(V - 251) * 256 - H - 108)) : (H = L[G], W = L[G + 1], z = L[G + 2], ce = L[G + 3], G += 4, c.push((H << 24 | W << 16 | z << 8 | ce) / 65536));
|
|
3728
3728
|
}
|
|
3729
3729
|
}
|
|
3730
3730
|
}
|
|
3731
3731
|
return B(r), e.advanceWidth = k, o;
|
|
3732
3732
|
}
|
|
3733
3733
|
function Zs(t, e, r, n) {
|
|
3734
|
-
var a = [], i, s = new
|
|
3734
|
+
var a = [], i, s = new _.Parser(t, e), o = s.parseCard8();
|
|
3735
3735
|
if (o === 0)
|
|
3736
3736
|
for (var c = 0; c < r; c++) {
|
|
3737
3737
|
if (i = s.parseCard8(), i >= n)
|
|
@@ -3759,7 +3759,7 @@ function Zs(t, e, r, n) {
|
|
|
3759
3759
|
}
|
|
3760
3760
|
function $s(t, e, r, n) {
|
|
3761
3761
|
r.tables.cff = {};
|
|
3762
|
-
var a = Vs(t, e), i = He(t, a.endOffset,
|
|
3762
|
+
var a = Vs(t, e), i = He(t, a.endOffset, _.bytesToString), s = He(t, i.endOffset), o = He(t, s.endOffset, _.bytesToString), c = He(t, o.endOffset);
|
|
3763
3763
|
r.gsubrs = c.objects, r.gsubrsBias = Wr(r.gsubrs);
|
|
3764
3764
|
var u = Dn(t, e, s.objects, o.objects);
|
|
3765
3765
|
if (u.length !== 1)
|
|
@@ -3770,27 +3770,27 @@ function $s(t, e, r, n) {
|
|
|
3770
3770
|
if (d === 0 || f === 0)
|
|
3771
3771
|
throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
|
|
3772
3772
|
d += e;
|
|
3773
|
-
var g = He(t, d),
|
|
3774
|
-
h._fdArray =
|
|
3773
|
+
var g = He(t, d), x = Dn(t, e, g.objects, o.objects);
|
|
3774
|
+
h._fdArray = x, f += e, h._fdSelect = Zs(t, f, r.numGlyphs, x.length);
|
|
3775
3775
|
}
|
|
3776
|
-
var v = e + h.private[1],
|
|
3777
|
-
if (r.defaultWidthX =
|
|
3778
|
-
var m = v +
|
|
3776
|
+
var v = e + h.private[1], S = ai(t, v, h.private[0], o.objects);
|
|
3777
|
+
if (r.defaultWidthX = S.defaultWidthX, r.nominalWidthX = S.nominalWidthX, S.subrs !== 0) {
|
|
3778
|
+
var m = v + S.subrs, F = He(t, m);
|
|
3779
3779
|
r.subrs = F.objects, r.subrsBias = Wr(r.subrs);
|
|
3780
3780
|
} else
|
|
3781
3781
|
r.subrs = [], r.subrsBias = 0;
|
|
3782
3782
|
var w;
|
|
3783
3783
|
n.lowMemory ? (w = Gs(t, e + h.charStrings), r.nGlyphs = w.offsets.length) : (w = He(t, e + h.charStrings), r.nGlyphs = w.objects.length);
|
|
3784
3784
|
var k = js(t, e + h.charset, r.nGlyphs, o.objects);
|
|
3785
|
-
if (h.encoding === 0 ? r.cffEncoding = new Kt(Bs, k) : h.encoding === 1 ? r.cffEncoding = new Kt(
|
|
3785
|
+
if (h.encoding === 0 ? r.cffEncoding = new Kt(Bs, k) : h.encoding === 1 ? r.cffEncoding = new Kt(Os, k) : r.cffEncoding = Ys(t, e + h.encoding, k), r.encoding = r.encoding || r.cffEncoding, r.glyphs = new Me.GlyphSet(r), n.lowMemory)
|
|
3786
3786
|
r._push = function(B) {
|
|
3787
|
-
var
|
|
3788
|
-
r.glyphs.push(B, Me.cffGlyphLoader(r, B, _n,
|
|
3787
|
+
var L = Hs(B, w.offsets, t, e + h.charStrings);
|
|
3788
|
+
r.glyphs.push(B, Me.cffGlyphLoader(r, B, _n, L));
|
|
3789
3789
|
};
|
|
3790
3790
|
else
|
|
3791
|
-
for (var
|
|
3792
|
-
var
|
|
3793
|
-
r.glyphs.push(
|
|
3791
|
+
for (var E = 0; E < r.nGlyphs; E += 1) {
|
|
3792
|
+
var O = w.objects[E];
|
|
3793
|
+
r.glyphs.push(E, Me.cffGlyphLoader(r, E, _n, O));
|
|
3794
3794
|
}
|
|
3795
3795
|
}
|
|
3796
3796
|
function ii(t, e) {
|
|
@@ -3878,8 +3878,8 @@ function ro(t) {
|
|
|
3878
3878
|
else if (c.type === "L")
|
|
3879
3879
|
s = Math.round(c.x - n), o = Math.round(c.y - a), e.push({ name: "dx", type: "NUMBER", value: s }), e.push({ name: "dy", type: "NUMBER", value: o }), e.push({ name: "rlineto", type: "OP", value: 5 }), n = Math.round(c.x), a = Math.round(c.y);
|
|
3880
3880
|
else if (c.type === "C") {
|
|
3881
|
-
var d = Math.round(c.x1 - n), f = Math.round(c.y1 - a), g = Math.round(c.x2 - c.x1),
|
|
3882
|
-
s = Math.round(c.x - c.x2), o = Math.round(c.y - c.y2), e.push({ name: "dx1", type: "NUMBER", value: d }), e.push({ name: "dy1", type: "NUMBER", value: f }), e.push({ name: "dx2", type: "NUMBER", value: g }), e.push({ name: "dy2", type: "NUMBER", value:
|
|
3881
|
+
var d = Math.round(c.x1 - n), f = Math.round(c.y1 - a), g = Math.round(c.x2 - c.x1), x = Math.round(c.y2 - c.y1);
|
|
3882
|
+
s = Math.round(c.x - c.x2), o = Math.round(c.y - c.y2), e.push({ name: "dx1", type: "NUMBER", value: d }), e.push({ name: "dy1", type: "NUMBER", value: f }), e.push({ name: "dx2", type: "NUMBER", value: g }), e.push({ name: "dy2", type: "NUMBER", value: x }), e.push({ name: "dx", type: "NUMBER", value: s }), e.push({ name: "dy", type: "NUMBER", value: o }), e.push({ name: "rrcurveto", type: "OP", value: 8 }), n = Math.round(c.x), a = Math.round(c.y);
|
|
3883
3883
|
}
|
|
3884
3884
|
}
|
|
3885
3885
|
return e.push({ name: "endchar", type: "OP", value: 14 }), e;
|
|
@@ -3931,7 +3931,7 @@ function io(t, e) {
|
|
|
3931
3931
|
}
|
|
3932
3932
|
var oi = { parse: $s, make: io };
|
|
3933
3933
|
function so(t, e) {
|
|
3934
|
-
var r = {}, n = new
|
|
3934
|
+
var r = {}, n = new _.Parser(t, e);
|
|
3935
3935
|
return r.version = n.parseVersion(), r.fontRevision = Math.round(n.parseFixed() * 1e3) / 1e3, r.checkSumAdjustment = n.parseULong(), r.magicNumber = n.parseULong(), P.argument(r.magicNumber === 1594834165, "Font header has wrong magic number."), r.flags = n.parseUShort(), r.unitsPerEm = n.parseUShort(), r.created = n.parseLongDateTime(), r.modified = n.parseLongDateTime(), r.xMin = n.parseShort(), r.yMin = n.parseShort(), r.xMax = n.parseShort(), r.yMax = n.parseShort(), r.macStyle = n.parseUShort(), r.lowestRecPPEM = n.parseUShort(), r.fontDirectionHint = n.parseShort(), r.indexToLocFormat = n.parseShort(), r.glyphDataFormat = n.parseShort(), r;
|
|
3936
3936
|
}
|
|
3937
3937
|
function oo(t) {
|
|
@@ -3958,7 +3958,7 @@ function oo(t) {
|
|
|
3958
3958
|
}
|
|
3959
3959
|
var ci = { parse: so, make: oo };
|
|
3960
3960
|
function co(t, e) {
|
|
3961
|
-
var r = {}, n = new
|
|
3961
|
+
var r = {}, n = new _.Parser(t, e);
|
|
3962
3962
|
return r.version = n.parseVersion(), r.ascender = n.parseShort(), r.descender = n.parseShort(), r.lineGap = n.parseShort(), r.advanceWidthMax = n.parseUShort(), r.minLeftSideBearing = n.parseShort(), r.minRightSideBearing = n.parseShort(), r.xMaxExtent = n.parseShort(), r.caretSlopeRise = n.parseShort(), r.caretSlopeRun = n.parseShort(), r.caretOffset = n.parseShort(), n.relativeOffset += 8, r.metricDataFormat = n.parseShort(), r.numberOfHMetrics = n.parseUShort(), r;
|
|
3963
3963
|
}
|
|
3964
3964
|
function uo(t) {
|
|
@@ -3984,7 +3984,7 @@ function uo(t) {
|
|
|
3984
3984
|
}
|
|
3985
3985
|
var ui = { parse: co, make: uo };
|
|
3986
3986
|
function ho(t, e, r, n, a) {
|
|
3987
|
-
for (var i, s, o = new
|
|
3987
|
+
for (var i, s, o = new _.Parser(t, e), c = 0; c < n; c += 1) {
|
|
3988
3988
|
c < r && (i = o.parseUShort(), s = o.parseShort());
|
|
3989
3989
|
var u = a.get(c);
|
|
3990
3990
|
u.advanceWidth = i, u.leftSideBearing = s;
|
|
@@ -3992,7 +3992,7 @@ function ho(t, e, r, n, a) {
|
|
|
3992
3992
|
}
|
|
3993
3993
|
function lo(t, e, r, n, a) {
|
|
3994
3994
|
t._hmtxTableData = {};
|
|
3995
|
-
for (var i, s, o = new
|
|
3995
|
+
for (var i, s, o = new _.Parser(e, r), c = 0; c < a; c += 1)
|
|
3996
3996
|
c < n && (i = o.parseUShort(), s = o.parseShort()), t._hmtxTableData[c] = {
|
|
3997
3997
|
advanceWidth: i,
|
|
3998
3998
|
leftSideBearing: s
|
|
@@ -4021,7 +4021,7 @@ function go(t) {
|
|
|
4021
4021
|
return e.fields.push({ name: "stringPool", type: "CHARARRAY", value: r }), e;
|
|
4022
4022
|
}
|
|
4023
4023
|
function vo(t, e) {
|
|
4024
|
-
var r = new
|
|
4024
|
+
var r = new _.Parser(t, e), n = r.parseULong();
|
|
4025
4025
|
P.argument(n === 1, "Unsupported ltag table version."), r.skip("uLong", 1);
|
|
4026
4026
|
for (var a = r.parseULong(), i = [], s = 0; s < a; s++) {
|
|
4027
4027
|
for (var o = "", c = e + r.parseUShort(), u = r.parseUShort(), h = c; h < c + u; ++h)
|
|
@@ -4032,7 +4032,7 @@ function vo(t, e) {
|
|
|
4032
4032
|
}
|
|
4033
4033
|
var li = { make: go, parse: vo };
|
|
4034
4034
|
function yo(t, e) {
|
|
4035
|
-
var r = {}, n = new
|
|
4035
|
+
var r = {}, n = new _.Parser(t, e);
|
|
4036
4036
|
return r.version = n.parseVersion(), r.numGlyphs = n.parseUShort(), r.version === 1 && (r.maxPoints = n.parseUShort(), r.maxContours = n.parseUShort(), r.maxCompositePoints = n.parseUShort(), r.maxCompositeContours = n.parseUShort(), r.maxZones = n.parseUShort(), r.maxTwilightPoints = n.parseUShort(), r.maxStorage = n.parseUShort(), r.maxFunctionDefs = n.parseUShort(), r.maxInstructionDefs = n.parseUShort(), r.maxStackElements = n.parseUShort(), r.maxSizeOfInstructions = n.parseUShort(), r.maxComponentElements = n.parseUShort(), r.maxComponentDepth = n.parseUShort()), r;
|
|
4037
4037
|
}
|
|
4038
4038
|
function mo(t) {
|
|
@@ -4779,13 +4779,13 @@ function vi(t, e, r) {
|
|
|
4779
4779
|
}
|
|
4780
4780
|
}
|
|
4781
4781
|
function Fo(t, e, r) {
|
|
4782
|
-
for (var n = {}, a = new
|
|
4783
|
-
var u = a.parseUShort(), h = a.parseUShort(), d = a.parseUShort(), f = a.parseUShort(), g = pi[f] || f,
|
|
4784
|
-
if (m !== void 0 &&
|
|
4782
|
+
for (var n = {}, a = new _.Parser(t, e), i = a.parseUShort(), s = a.parseUShort(), o = a.offset + a.parseUShort(), c = 0; c < s; c++) {
|
|
4783
|
+
var u = a.parseUShort(), h = a.parseUShort(), d = a.parseUShort(), f = a.parseUShort(), g = pi[f] || f, x = a.parseUShort(), v = a.parseUShort(), S = xo(u, d, r), m = vi(u, h, d);
|
|
4784
|
+
if (m !== void 0 && S !== void 0) {
|
|
4785
4785
|
var F = void 0;
|
|
4786
|
-
if (m === qr ? F = ut.UTF16(t, o + v,
|
|
4786
|
+
if (m === qr ? F = ut.UTF16(t, o + v, x) : F = ut.MACSTRING(t, o + v, x, m), F) {
|
|
4787
4787
|
var w = n[g];
|
|
4788
|
-
w === void 0 && (w = n[g] = {}), w[
|
|
4788
|
+
w === void 0 && (w = n[g] = {}), w[S] = F;
|
|
4789
4789
|
}
|
|
4790
4790
|
}
|
|
4791
4791
|
}
|
|
@@ -4839,28 +4839,28 @@ function To(t, e) {
|
|
|
4839
4839
|
for (var c = ur(di), u = ur(gi), h = [], d = [], f = 0; f < n.length; f++) {
|
|
4840
4840
|
r = n[f];
|
|
4841
4841
|
var g = a[r];
|
|
4842
|
-
for (var
|
|
4843
|
-
var v = g[
|
|
4844
|
-
k === void 0 && (
|
|
4845
|
-
var
|
|
4842
|
+
for (var x in g) {
|
|
4843
|
+
var v = g[x], S = 1, m = c[x], F = bo[m], w = vi(S, F, m), k = R.MACSTRING(v, w);
|
|
4844
|
+
k === void 0 && (S = 0, m = e.indexOf(x), m < 0 && (m = e.length, e.push(x)), F = 4, k = R.UTF16(v));
|
|
4845
|
+
var E = Hn(k, d);
|
|
4846
4846
|
h.push(Gn(
|
|
4847
|
-
|
|
4847
|
+
S,
|
|
4848
4848
|
F,
|
|
4849
4849
|
m,
|
|
4850
4850
|
r,
|
|
4851
4851
|
k.length,
|
|
4852
|
-
|
|
4852
|
+
E
|
|
4853
4853
|
));
|
|
4854
|
-
var
|
|
4855
|
-
if (
|
|
4856
|
-
var B = R.UTF16(v),
|
|
4854
|
+
var O = u[x];
|
|
4855
|
+
if (O !== void 0) {
|
|
4856
|
+
var B = R.UTF16(v), L = Hn(B, d);
|
|
4857
4857
|
h.push(Gn(
|
|
4858
4858
|
3,
|
|
4859
4859
|
1,
|
|
4860
|
-
|
|
4860
|
+
O,
|
|
4861
4861
|
r,
|
|
4862
4862
|
B.length,
|
|
4863
|
-
|
|
4863
|
+
L
|
|
4864
4864
|
));
|
|
4865
4865
|
}
|
|
4866
4866
|
}
|
|
@@ -5124,7 +5124,7 @@ var yi = { parse: Fo, make: To }, Vr = [
|
|
|
5124
5124
|
{ begin: 127024, end: 127135 }
|
|
5125
5125
|
// Domino Tiles
|
|
5126
5126
|
];
|
|
5127
|
-
function
|
|
5127
|
+
function Eo(t) {
|
|
5128
5128
|
for (var e = 0; e < Vr.length; e += 1) {
|
|
5129
5129
|
var r = Vr[e];
|
|
5130
5130
|
if (t >= r.begin && t < r.end)
|
|
@@ -5132,8 +5132,8 @@ function Co(t) {
|
|
|
5132
5132
|
}
|
|
5133
5133
|
return -1;
|
|
5134
5134
|
}
|
|
5135
|
-
function
|
|
5136
|
-
var r = {}, n = new
|
|
5135
|
+
function Co(t, e) {
|
|
5136
|
+
var r = {}, n = new _.Parser(t, e);
|
|
5137
5137
|
r.version = n.parseUShort(), r.xAvgCharWidth = n.parseShort(), r.usWeightClass = n.parseUShort(), r.usWidthClass = n.parseUShort(), r.fsType = n.parseUShort(), r.ySubscriptXSize = n.parseShort(), r.ySubscriptYSize = n.parseShort(), r.ySubscriptXOffset = n.parseShort(), r.ySubscriptYOffset = n.parseShort(), r.ySuperscriptXSize = n.parseShort(), r.ySuperscriptYSize = n.parseShort(), r.ySuperscriptXOffset = n.parseShort(), r.ySuperscriptYOffset = n.parseShort(), r.yStrikeoutSize = n.parseShort(), r.yStrikeoutPosition = n.parseShort(), r.sFamilyClass = n.parseShort(), r.panose = [];
|
|
5138
5138
|
for (var a = 0; a < 10; a++)
|
|
5139
5139
|
r.panose[a] = n.parseByte();
|
|
@@ -5189,12 +5189,12 @@ function Ao(t) {
|
|
|
5189
5189
|
{ name: "usMaxContext", type: "USHORT", value: 0 }
|
|
5190
5190
|
], t);
|
|
5191
5191
|
}
|
|
5192
|
-
var Xr = { parse:
|
|
5192
|
+
var Xr = { parse: Co, make: Ao, unicodeRanges: Vr, getUnicodeRange: Eo };
|
|
5193
5193
|
function Uo(t, e) {
|
|
5194
|
-
var r = {}, n = new
|
|
5194
|
+
var r = {}, n = new _.Parser(t, e);
|
|
5195
5195
|
switch (r.version = n.parseVersion(), r.italicAngle = n.parseFixed(), r.underlinePosition = n.parseShort(), r.underlineThickness = n.parseShort(), r.isFixedPitch = n.parseULong(), r.minMemType42 = n.parseULong(), r.maxMemType42 = n.parseULong(), r.minMemType1 = n.parseULong(), r.maxMemType1 = n.parseULong(), r.version) {
|
|
5196
5196
|
case 1:
|
|
5197
|
-
r.names =
|
|
5197
|
+
r.names = Je.slice();
|
|
5198
5198
|
break;
|
|
5199
5199
|
case 2:
|
|
5200
5200
|
r.numberOfGlyphs = n.parseUShort(), r.glyphNameIndex = new Array(r.numberOfGlyphs);
|
|
@@ -5202,7 +5202,7 @@ function Uo(t, e) {
|
|
|
5202
5202
|
r.glyphNameIndex[a] = n.parseUShort();
|
|
5203
5203
|
r.names = [];
|
|
5204
5204
|
for (var i = 0; i < r.numberOfGlyphs; i++)
|
|
5205
|
-
if (r.glyphNameIndex[i] >=
|
|
5205
|
+
if (r.glyphNameIndex[i] >= Je.length) {
|
|
5206
5206
|
var s = n.parseChar();
|
|
5207
5207
|
r.names.push(n.parseString(s));
|
|
5208
5208
|
}
|
|
@@ -5234,13 +5234,13 @@ Fe[1] = function() {
|
|
|
5234
5234
|
if (r === 1)
|
|
5235
5235
|
return {
|
|
5236
5236
|
substFormat: 1,
|
|
5237
|
-
coverage: this.parsePointer(
|
|
5237
|
+
coverage: this.parsePointer(C.coverage),
|
|
5238
5238
|
deltaGlyphId: this.parseUShort()
|
|
5239
5239
|
};
|
|
5240
5240
|
if (r === 2)
|
|
5241
5241
|
return {
|
|
5242
5242
|
substFormat: 2,
|
|
5243
|
-
coverage: this.parsePointer(
|
|
5243
|
+
coverage: this.parsePointer(C.coverage),
|
|
5244
5244
|
substitute: this.parseOffset16List()
|
|
5245
5245
|
};
|
|
5246
5246
|
P.assert(!1, "0x" + e.toString(16) + ": lookup type 1 format must be 1 or 2.");
|
|
@@ -5249,7 +5249,7 @@ Fe[2] = function() {
|
|
|
5249
5249
|
var e = this.parseUShort();
|
|
5250
5250
|
return P.argument(e === 1, "GSUB Multiple Substitution Subtable identifier-format must be 1"), {
|
|
5251
5251
|
substFormat: e,
|
|
5252
|
-
coverage: this.parsePointer(
|
|
5252
|
+
coverage: this.parsePointer(C.coverage),
|
|
5253
5253
|
sequences: this.parseListOfLists()
|
|
5254
5254
|
};
|
|
5255
5255
|
};
|
|
@@ -5257,7 +5257,7 @@ Fe[3] = function() {
|
|
|
5257
5257
|
var e = this.parseUShort();
|
|
5258
5258
|
return P.argument(e === 1, "GSUB Alternate Substitution Subtable identifier-format must be 1"), {
|
|
5259
5259
|
substFormat: e,
|
|
5260
|
-
coverage: this.parsePointer(
|
|
5260
|
+
coverage: this.parsePointer(C.coverage),
|
|
5261
5261
|
alternateSets: this.parseListOfLists()
|
|
5262
5262
|
};
|
|
5263
5263
|
};
|
|
@@ -5265,7 +5265,7 @@ Fe[4] = function() {
|
|
|
5265
5265
|
var e = this.parseUShort();
|
|
5266
5266
|
return P.argument(e === 1, "GSUB ligature table identifier-format must be 1"), {
|
|
5267
5267
|
substFormat: e,
|
|
5268
|
-
coverage: this.parsePointer(
|
|
5268
|
+
coverage: this.parsePointer(C.coverage),
|
|
5269
5269
|
ligatureSets: this.parseListOfLists(function() {
|
|
5270
5270
|
return {
|
|
5271
5271
|
ligGlyph: this.parseUShort(),
|
|
@@ -5275,15 +5275,15 @@ Fe[4] = function() {
|
|
|
5275
5275
|
};
|
|
5276
5276
|
};
|
|
5277
5277
|
var st = {
|
|
5278
|
-
sequenceIndex:
|
|
5279
|
-
lookupListIndex:
|
|
5278
|
+
sequenceIndex: C.uShort,
|
|
5279
|
+
lookupListIndex: C.uShort
|
|
5280
5280
|
};
|
|
5281
5281
|
Fe[5] = function() {
|
|
5282
5282
|
var e = this.offset + this.relativeOffset, r = this.parseUShort();
|
|
5283
5283
|
if (r === 1)
|
|
5284
5284
|
return {
|
|
5285
5285
|
substFormat: r,
|
|
5286
|
-
coverage: this.parsePointer(
|
|
5286
|
+
coverage: this.parsePointer(C.coverage),
|
|
5287
5287
|
ruleSets: this.parseListOfLists(function() {
|
|
5288
5288
|
var i = this.parseUShort(), s = this.parseUShort();
|
|
5289
5289
|
return {
|
|
@@ -5295,8 +5295,8 @@ Fe[5] = function() {
|
|
|
5295
5295
|
if (r === 2)
|
|
5296
5296
|
return {
|
|
5297
5297
|
substFormat: r,
|
|
5298
|
-
coverage: this.parsePointer(
|
|
5299
|
-
classDef: this.parsePointer(
|
|
5298
|
+
coverage: this.parsePointer(C.coverage),
|
|
5299
|
+
classDef: this.parsePointer(C.classDef),
|
|
5300
5300
|
classSets: this.parseListOfLists(function() {
|
|
5301
5301
|
var i = this.parseUShort(), s = this.parseUShort();
|
|
5302
5302
|
return {
|
|
@@ -5309,7 +5309,7 @@ Fe[5] = function() {
|
|
|
5309
5309
|
var n = this.parseUShort(), a = this.parseUShort();
|
|
5310
5310
|
return {
|
|
5311
5311
|
substFormat: r,
|
|
5312
|
-
coverages: this.parseList(n,
|
|
5312
|
+
coverages: this.parseList(n, C.pointer(C.coverage)),
|
|
5313
5313
|
lookupRecords: this.parseRecordList(a, st)
|
|
5314
5314
|
};
|
|
5315
5315
|
}
|
|
@@ -5320,7 +5320,7 @@ Fe[6] = function() {
|
|
|
5320
5320
|
if (r === 1)
|
|
5321
5321
|
return {
|
|
5322
5322
|
substFormat: 1,
|
|
5323
|
-
coverage: this.parsePointer(
|
|
5323
|
+
coverage: this.parsePointer(C.coverage),
|
|
5324
5324
|
chainRuleSets: this.parseListOfLists(function() {
|
|
5325
5325
|
return {
|
|
5326
5326
|
backtrack: this.parseUShortList(),
|
|
@@ -5333,10 +5333,10 @@ Fe[6] = function() {
|
|
|
5333
5333
|
if (r === 2)
|
|
5334
5334
|
return {
|
|
5335
5335
|
substFormat: 2,
|
|
5336
|
-
coverage: this.parsePointer(
|
|
5337
|
-
backtrackClassDef: this.parsePointer(
|
|
5338
|
-
inputClassDef: this.parsePointer(
|
|
5339
|
-
lookaheadClassDef: this.parsePointer(
|
|
5336
|
+
coverage: this.parsePointer(C.coverage),
|
|
5337
|
+
backtrackClassDef: this.parsePointer(C.classDef),
|
|
5338
|
+
inputClassDef: this.parsePointer(C.classDef),
|
|
5339
|
+
lookaheadClassDef: this.parsePointer(C.classDef),
|
|
5340
5340
|
chainClassSet: this.parseListOfLists(function() {
|
|
5341
5341
|
return {
|
|
5342
5342
|
backtrack: this.parseUShortList(),
|
|
@@ -5349,9 +5349,9 @@ Fe[6] = function() {
|
|
|
5349
5349
|
if (r === 3)
|
|
5350
5350
|
return {
|
|
5351
5351
|
substFormat: 3,
|
|
5352
|
-
backtrackCoverage: this.parseList(
|
|
5353
|
-
inputCoverage: this.parseList(
|
|
5354
|
-
lookaheadCoverage: this.parseList(
|
|
5352
|
+
backtrackCoverage: this.parseList(C.pointer(C.coverage)),
|
|
5353
|
+
inputCoverage: this.parseList(C.pointer(C.coverage)),
|
|
5354
|
+
lookaheadCoverage: this.parseList(C.pointer(C.coverage)),
|
|
5355
5355
|
lookupRecords: this.parseRecordList(st)
|
|
5356
5356
|
};
|
|
5357
5357
|
P.assert(!1, "0x" + e.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
|
|
@@ -5359,7 +5359,7 @@ Fe[6] = function() {
|
|
|
5359
5359
|
Fe[7] = function() {
|
|
5360
5360
|
var e = this.parseUShort();
|
|
5361
5361
|
P.argument(e === 1, "GSUB Extension Substitution subtable identifier-format must be 1");
|
|
5362
|
-
var r = this.parseUShort(), n = new
|
|
5362
|
+
var r = this.parseUShort(), n = new C(this.data, this.offset + this.parseULong());
|
|
5363
5363
|
return {
|
|
5364
5364
|
substFormat: 1,
|
|
5365
5365
|
lookupType: r,
|
|
@@ -5370,15 +5370,15 @@ Fe[8] = function() {
|
|
|
5370
5370
|
var e = this.parseUShort();
|
|
5371
5371
|
return P.argument(e === 1, "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"), {
|
|
5372
5372
|
substFormat: e,
|
|
5373
|
-
coverage: this.parsePointer(
|
|
5374
|
-
backtrackCoverage: this.parseList(
|
|
5375
|
-
lookaheadCoverage: this.parseList(
|
|
5373
|
+
coverage: this.parsePointer(C.coverage),
|
|
5374
|
+
backtrackCoverage: this.parseList(C.pointer(C.coverage)),
|
|
5375
|
+
lookaheadCoverage: this.parseList(C.pointer(C.coverage)),
|
|
5376
5376
|
substitutes: this.parseUShortList()
|
|
5377
5377
|
};
|
|
5378
5378
|
};
|
|
5379
|
-
function
|
|
5379
|
+
function Oo(t, e) {
|
|
5380
5380
|
e = e || 0;
|
|
5381
|
-
var r = new
|
|
5381
|
+
var r = new C(t, e), n = r.parseVersion(1);
|
|
5382
5382
|
return P.argument(n === 1 || n === 1.1, "Unsupported GSUB table version."), n === 1 ? {
|
|
5383
5383
|
version: n,
|
|
5384
5384
|
scripts: r.parseScriptList(),
|
|
@@ -5466,7 +5466,7 @@ ht[6] = function(e) {
|
|
|
5466
5466
|
}
|
|
5467
5467
|
P.assert(!1, "lookup type 6 format must be 1, 2 or 3.");
|
|
5468
5468
|
};
|
|
5469
|
-
function
|
|
5469
|
+
function Lo(t) {
|
|
5470
5470
|
return new M.Table("GSUB", [
|
|
5471
5471
|
{ name: "version", type: "ULONG", value: 65536 },
|
|
5472
5472
|
{ name: "scripts", type: "TABLE", value: new M.ScriptList(t.scripts) },
|
|
@@ -5474,9 +5474,9 @@ function Oo(t) {
|
|
|
5474
5474
|
{ name: "lookups", type: "TABLE", value: new M.LookupList(t.lookups, ht) }
|
|
5475
5475
|
]);
|
|
5476
5476
|
}
|
|
5477
|
-
var bi = { parse:
|
|
5477
|
+
var bi = { parse: Oo, make: Lo };
|
|
5478
5478
|
function Ro(t, e) {
|
|
5479
|
-
var r = new
|
|
5479
|
+
var r = new _.Parser(t, e), n = r.parseULong();
|
|
5480
5480
|
P.argument(n === 1, "Unsupported META table version."), r.parseULong(), r.parseULong();
|
|
5481
5481
|
for (var a = r.parseULong(), i = {}, s = 0; s < a; s++) {
|
|
5482
5482
|
var o = r.parseTag(), c = r.parseULong(), u = r.parseULong(), h = ut.UTF8(t, e + c, u);
|
|
@@ -5556,12 +5556,12 @@ function Io(t) {
|
|
|
5556
5556
|
return e / t.length;
|
|
5557
5557
|
}
|
|
5558
5558
|
function Do(t) {
|
|
5559
|
-
for (var e = [], r = [], n = [], a = [], i = [], s = [], o = [], c, u = 0, h = 0, d = 0, f = 0, g = 0,
|
|
5560
|
-
var v = t.glyphs.get(
|
|
5559
|
+
for (var e = [], r = [], n = [], a = [], i = [], s = [], o = [], c, u = 0, h = 0, d = 0, f = 0, g = 0, x = 0; x < t.glyphs.length; x += 1) {
|
|
5560
|
+
var v = t.glyphs.get(x), S = v.unicode | 0;
|
|
5561
5561
|
if (isNaN(v.advanceWidth))
|
|
5562
|
-
throw new Error("Glyph " + v.name + " (" +
|
|
5563
|
-
(c >
|
|
5564
|
-
var m = Xr.getUnicodeRange(
|
|
5562
|
+
throw new Error("Glyph " + v.name + " (" + x + "): advanceWidth is not a number.");
|
|
5563
|
+
(c > S || c === void 0) && S > 0 && (c = S), u < S && (u = S);
|
|
5564
|
+
var m = Xr.getUnicodeRange(S);
|
|
5565
5565
|
if (m < 32)
|
|
5566
5566
|
h |= 1 << m;
|
|
5567
5567
|
else if (m < 64)
|
|
@@ -5599,7 +5599,7 @@ function Do(t) {
|
|
|
5599
5599
|
yMax: w.yMax,
|
|
5600
5600
|
lowestRecPPEM: 3,
|
|
5601
5601
|
createdTimestamp: t.createdTimestamp
|
|
5602
|
-
}),
|
|
5602
|
+
}), E = ui.make({
|
|
5603
5603
|
ascender: w.ascender,
|
|
5604
5604
|
descender: w.descender,
|
|
5605
5605
|
advanceWidthMax: w.advanceWidthMax,
|
|
@@ -5607,7 +5607,7 @@ function Do(t) {
|
|
|
5607
5607
|
minRightSideBearing: w.minRightSideBearing,
|
|
5608
5608
|
xMaxExtent: w.maxLeftSideBearing + (w.xMax - w.xMin),
|
|
5609
5609
|
numberOfHMetrics: t.glyphs.length
|
|
5610
|
-
}),
|
|
5610
|
+
}), O = fi.make(t.glyphs.length), B = Xr.make(Object.assign({
|
|
5611
5611
|
xAvgCharWidth: Math.round(w.advanceWidthAvg),
|
|
5612
5612
|
usFirstCharIndex: c,
|
|
5613
5613
|
usLastCharIndex: u,
|
|
@@ -5632,7 +5632,7 @@ function Do(t) {
|
|
|
5632
5632
|
// Use space as the default character, if available.
|
|
5633
5633
|
usBreakChar: t.hasChar(" ") ? 32 : 0
|
|
5634
5634
|
// Use space as the break character, if available.
|
|
5635
|
-
}, t.tables.os2)),
|
|
5635
|
+
}, t.tables.os2)), L = hi.make(t.glyphs), H = $a.make(t.glyphs), W = t.getEnglishName("fontFamily"), z = t.getEnglishName("fontSubfamily"), ce = W + " " + z, ie = t.getEnglishName("postScriptName");
|
|
5636
5636
|
ie || (ie = W.replace(/\s/g, "") + "-" + z);
|
|
5637
5637
|
var Y = {};
|
|
5638
5638
|
for (var Z in t.names)
|
|
@@ -5646,16 +5646,16 @@ function Do(t) {
|
|
|
5646
5646
|
postScriptName: ie,
|
|
5647
5647
|
unitsPerEm: t.unitsPerEm,
|
|
5648
5648
|
fontBBox: [0, w.yMin, w.ascender, w.advanceWidthMax]
|
|
5649
|
-
}), G = t.metas && Object.keys(t.metas).length > 0 ? xi.make(t.metas) : void 0, V = [k,
|
|
5649
|
+
}), G = t.metas && Object.keys(t.metas).length > 0 ? xi.make(t.metas) : void 0, V = [k, E, O, B, te, H, ae, ue, L];
|
|
5650
5650
|
se && V.push(se), t.tables.gsub && V.push(bi.make(t.tables.gsub)), G && V.push(G);
|
|
5651
|
-
for (var
|
|
5651
|
+
for (var nt = Si(V), Bt = nt.encode(), Ot = tn(Bt), ft = nt.fields, Lt = !1, Pe = 0; Pe < ft.length; Pe += 1)
|
|
5652
5652
|
if (ft[Pe].name === "head table") {
|
|
5653
|
-
ft[Pe].value.checkSumAdjustment = 2981146554 -
|
|
5653
|
+
ft[Pe].value.checkSumAdjustment = 2981146554 - Ot, Lt = !0;
|
|
5654
5654
|
break;
|
|
5655
5655
|
}
|
|
5656
|
-
if (!
|
|
5656
|
+
if (!Lt)
|
|
5657
5657
|
throw new Error("Could not find head table with checkSum to adjust.");
|
|
5658
|
-
return
|
|
5658
|
+
return nt;
|
|
5659
5659
|
}
|
|
5660
5660
|
var _o = { make: Si, fontToTable: Do, computeCheckSum: tn };
|
|
5661
5661
|
function hr(t, e) {
|
|
@@ -6012,8 +6012,8 @@ ge.prototype.getLigatures = function(t, e, r) {
|
|
|
6012
6012
|
for (var n = [], a = this.getLookupTables(e, r, t, 4), i = 0; i < a.length; i++)
|
|
6013
6013
|
for (var s = a[i].subtables, o = 0; o < s.length; o++)
|
|
6014
6014
|
for (var c = s[o], u = this.expandCoverage(c.coverage), h = c.ligatureSets, d = 0; d < u.length; d++)
|
|
6015
|
-
for (var f = u[d], g = h[d],
|
|
6016
|
-
var v = g[
|
|
6015
|
+
for (var f = u[d], g = h[d], x = 0; x < g.length; x++) {
|
|
6016
|
+
var v = g[x];
|
|
6017
6017
|
n.push({
|
|
6018
6018
|
sub: [f].concat(v.components),
|
|
6019
6019
|
by: v.ligGlyph
|
|
@@ -6124,7 +6124,7 @@ function jn(t, e, r, n, a) {
|
|
|
6124
6124
|
return (e & n) > 0 ? (i = t.parseByte(), e & a || (i = -i), i = r + i) : (e & a) > 0 ? i = r : i = r + t.parseShort(), i;
|
|
6125
6125
|
}
|
|
6126
6126
|
function wi(t, e, r) {
|
|
6127
|
-
var n = new
|
|
6127
|
+
var n = new _.Parser(e, r);
|
|
6128
6128
|
t.numberOfContours = n.parseShort(), t._xMin = n.parseShort(), t._yMin = n.parseShort(), t._xMax = n.parseShort(), t._yMax = n.parseShort();
|
|
6129
6129
|
var a, i;
|
|
6130
6130
|
if (t.numberOfContours > 0) {
|
|
@@ -6140,14 +6140,14 @@ function wi(t, e, r) {
|
|
|
6140
6140
|
for (var d = n.parseByte(), f = 0; f < d; f += 1)
|
|
6141
6141
|
a.push(i), h += 1;
|
|
6142
6142
|
if (P.argument(a.length === u, "Bad flags."), s.length > 0) {
|
|
6143
|
-
var g = [],
|
|
6143
|
+
var g = [], x;
|
|
6144
6144
|
if (u > 0) {
|
|
6145
6145
|
for (var v = 0; v < u; v += 1)
|
|
6146
|
-
i = a[v],
|
|
6147
|
-
for (var
|
|
6148
|
-
i = a[m],
|
|
6146
|
+
i = a[v], x = {}, x.onCurve = !!(i & 1), x.lastPointOfContour = s.indexOf(v) >= 0, g.push(x);
|
|
6147
|
+
for (var S = 0, m = 0; m < u; m += 1)
|
|
6148
|
+
i = a[m], x = g[m], x.x = jn(n, i, S, 2, 16), S = x.x;
|
|
6149
6149
|
for (var F = 0, w = 0; w < u; w += 1)
|
|
6150
|
-
i = a[w],
|
|
6150
|
+
i = a[w], x = g[w], x.y = jn(n, i, F, 4, 32), F = x.y;
|
|
6151
6151
|
}
|
|
6152
6152
|
t.points = g;
|
|
6153
6153
|
} else
|
|
@@ -6158,7 +6158,7 @@ function wi(t, e, r) {
|
|
|
6158
6158
|
t.isComposite = !0, t.points = [], t.components = [];
|
|
6159
6159
|
for (var k = !0; k; ) {
|
|
6160
6160
|
a = n.parseUShort();
|
|
6161
|
-
var
|
|
6161
|
+
var E = {
|
|
6162
6162
|
glyphIndex: n.parseUShort(),
|
|
6163
6163
|
xScale: 1,
|
|
6164
6164
|
scale01: 0,
|
|
@@ -6167,11 +6167,11 @@ function wi(t, e, r) {
|
|
|
6167
6167
|
dx: 0,
|
|
6168
6168
|
dy: 0
|
|
6169
6169
|
};
|
|
6170
|
-
(a & 1) > 0 ? (a & 2) > 0 ? (
|
|
6170
|
+
(a & 1) > 0 ? (a & 2) > 0 ? (E.dx = n.parseShort(), E.dy = n.parseShort()) : E.matchedPoints = [n.parseUShort(), n.parseUShort()] : (a & 2) > 0 ? (E.dx = n.parseChar(), E.dy = n.parseChar()) : E.matchedPoints = [n.parseByte(), n.parseByte()], (a & 8) > 0 ? E.xScale = E.yScale = n.parseF2Dot14() : (a & 64) > 0 ? (E.xScale = n.parseF2Dot14(), E.yScale = n.parseF2Dot14()) : (a & 128) > 0 && (E.xScale = n.parseF2Dot14(), E.scale01 = n.parseF2Dot14(), E.scale10 = n.parseF2Dot14(), E.yScale = n.parseF2Dot14()), t.components.push(E), k = !!(a & 32);
|
|
6171
6171
|
}
|
|
6172
6172
|
if (a & 256) {
|
|
6173
6173
|
t.instructionLength = n.parseUShort(), t.instructions = [];
|
|
6174
|
-
for (var
|
|
6174
|
+
for (var O = 0; O < t.instructionLength; O += 1)
|
|
6175
6175
|
t.instructions.push(n.parseByte());
|
|
6176
6176
|
}
|
|
6177
6177
|
}
|
|
@@ -6263,7 +6263,7 @@ function Wo(t, e, r, n) {
|
|
|
6263
6263
|
function qo(t, e, r, n, a) {
|
|
6264
6264
|
return a.lowMemory ? Wo(t, e, r, n) : zo(t, e, r, n);
|
|
6265
6265
|
}
|
|
6266
|
-
var Ti = { getPath: Fi, parse: qo },
|
|
6266
|
+
var Ti = { getPath: Fi, parse: qo }, Ei, rt, Ci, jr;
|
|
6267
6267
|
function Ai(t) {
|
|
6268
6268
|
this.font = t, this.getCommands = function(e) {
|
|
6269
6269
|
return Ti.getPath(e).commands;
|
|
@@ -6290,7 +6290,7 @@ function Zo(t) {
|
|
|
6290
6290
|
var Bi = function(t) {
|
|
6291
6291
|
var e = this.srPeriod, r = this.srPhase, n = this.srThreshold, a = 1;
|
|
6292
6292
|
return t < 0 && (t = -t, a = -1), t += n - r, t = Math.trunc(t / e) * e, t += r, t < 0 ? r * a : t * a;
|
|
6293
|
-
},
|
|
6293
|
+
}, Le = {
|
|
6294
6294
|
x: 1,
|
|
6295
6295
|
y: 0,
|
|
6296
6296
|
axis: "x",
|
|
@@ -6315,10 +6315,10 @@ var Bi = function(t) {
|
|
|
6315
6315
|
return;
|
|
6316
6316
|
}
|
|
6317
6317
|
if (a = n.distance(t, e, !0, !0), i = n.distance(t, r, !0, !0), c = n.distance(e, e, !1, !0), u = n.distance(r, r, !1, !0), s = Math.abs(a), o = Math.abs(i), h = s + o, h === 0) {
|
|
6318
|
-
|
|
6318
|
+
Le.setRelative(t, t, (c + u) / 2, n, !0);
|
|
6319
6319
|
return;
|
|
6320
6320
|
}
|
|
6321
|
-
|
|
6321
|
+
Le.setRelative(t, t, (c * o + u * s) / h, n, !0);
|
|
6322
6322
|
},
|
|
6323
6323
|
// Slope of line normal to this
|
|
6324
6324
|
normalSlope: Number.NEGATIVE_INFINITY,
|
|
@@ -6419,15 +6419,15 @@ var Bi = function(t) {
|
|
|
6419
6419
|
t.yTouched = !1;
|
|
6420
6420
|
}
|
|
6421
6421
|
};
|
|
6422
|
-
Object.freeze(
|
|
6422
|
+
Object.freeze(Le);
|
|
6423
6423
|
Object.freeze(De);
|
|
6424
|
-
function
|
|
6424
|
+
function Et(t, e) {
|
|
6425
6425
|
this.x = t, this.y = e, this.axis = void 0, this.slope = e / t, this.normalSlope = -t / e, Object.freeze(this);
|
|
6426
6426
|
}
|
|
6427
|
-
|
|
6428
|
-
return this.x *
|
|
6427
|
+
Et.prototype.distance = function(t, e, r, n) {
|
|
6428
|
+
return this.x * Le.distance(t, e, r, n) + this.y * De.distance(t, e, r, n);
|
|
6429
6429
|
};
|
|
6430
|
-
|
|
6430
|
+
Et.prototype.interpolate = function(t, e, r, n) {
|
|
6431
6431
|
var a, i, s, o, c, u, h;
|
|
6432
6432
|
if (s = n.distance(t, e, !0, !0), o = n.distance(t, r, !0, !0), a = n.distance(e, e, !1, !0), i = n.distance(r, r, !1, !0), c = Math.abs(s), u = Math.abs(o), h = c + u, h === 0) {
|
|
6433
6433
|
this.setRelative(t, t, (a + i) / 2, n, !0);
|
|
@@ -6435,17 +6435,17 @@ Ct.prototype.interpolate = function(t, e, r, n) {
|
|
|
6435
6435
|
}
|
|
6436
6436
|
this.setRelative(t, t, (a * u + i * c) / h, n, !0);
|
|
6437
6437
|
};
|
|
6438
|
-
|
|
6438
|
+
Et.prototype.setRelative = function(t, e, r, n, a) {
|
|
6439
6439
|
n = n || this;
|
|
6440
6440
|
var i = a ? e.xo : e.x, s = a ? e.yo : e.y, o = i + r * n.x, c = s + r * n.y, u = n.normalSlope, h = this.slope, d = t.x, f = t.y;
|
|
6441
6441
|
t.x = (h * d - u * o + c - f) / (h - u), t.y = h * (t.x - d) + f;
|
|
6442
6442
|
};
|
|
6443
|
-
|
|
6443
|
+
Et.prototype.touch = function(t) {
|
|
6444
6444
|
t.xTouched = !0, t.yTouched = !0;
|
|
6445
6445
|
};
|
|
6446
|
-
function
|
|
6446
|
+
function Ct(t, e) {
|
|
6447
6447
|
var r = Math.sqrt(t * t + e * e);
|
|
6448
|
-
return t /= r, e /= r, t === 1 && e === 0 ?
|
|
6448
|
+
return t /= r, e /= r, t === 1 && e === 0 ? Le : t === 0 && e === 1 ? De : new Et(t, e);
|
|
6449
6449
|
}
|
|
6450
6450
|
function _e(t, e, r, n) {
|
|
6451
6451
|
this.x = this.xo = Math.round(t * 64) / 64, this.y = this.yo = Math.round(e * 64) / 64, this.lastPointOfContour = r, this.onCurve = n, this.prevPointOnContour = void 0, this.nextPointOnContour = void 0, this.xTouched = !1, this.yTouched = !1, Object.preventExtensions(this);
|
|
@@ -6471,12 +6471,12 @@ var wt = Object.freeze(new _e(0, 0)), $o = {
|
|
|
6471
6471
|
// minimum distance
|
|
6472
6472
|
autoFlip: !0
|
|
6473
6473
|
};
|
|
6474
|
-
function
|
|
6474
|
+
function We(t, e) {
|
|
6475
6475
|
switch (this.env = t, this.stack = [], this.prog = e, t) {
|
|
6476
6476
|
case "glyf":
|
|
6477
6477
|
this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
|
|
6478
6478
|
case "prep":
|
|
6479
|
-
this.fv = this.pv = this.dpv =
|
|
6479
|
+
this.fv = this.pv = this.dpv = Le, this.round = Ui;
|
|
6480
6480
|
}
|
|
6481
6481
|
}
|
|
6482
6482
|
Ai.prototype.exec = function(t, e) {
|
|
@@ -6487,15 +6487,15 @@ Ai.prototype.exec = function(t, e) {
|
|
|
6487
6487
|
if (!n || n.ppem !== e) {
|
|
6488
6488
|
var a = this._fpgmState;
|
|
6489
6489
|
if (!a) {
|
|
6490
|
-
|
|
6490
|
+
We.prototype = $o, a = this._fpgmState = new We("fpgm", r.tables.fpgm), a.funcs = [], a.font = r, exports.DEBUG && (console.log("---EXEC FPGM---"), a.step = -1);
|
|
6491
6491
|
try {
|
|
6492
|
-
|
|
6492
|
+
rt(a);
|
|
6493
6493
|
} catch (u) {
|
|
6494
6494
|
console.log("Hinting error in FPGM:" + u), this._errorState = 3;
|
|
6495
6495
|
return;
|
|
6496
6496
|
}
|
|
6497
6497
|
}
|
|
6498
|
-
|
|
6498
|
+
We.prototype = a, n = this._prepState = new We("prep", r.tables.prep), n.ppem = e;
|
|
6499
6499
|
var i = r.tables.cvt;
|
|
6500
6500
|
if (i)
|
|
6501
6501
|
for (var s = n.cvt = new Array(i.length), o = e / r.unitsPerEm, c = 0; c < i.length; c++)
|
|
@@ -6504,43 +6504,43 @@ Ai.prototype.exec = function(t, e) {
|
|
|
6504
6504
|
n.cvt = [];
|
|
6505
6505
|
exports.DEBUG && (console.log("---EXEC PREP---"), n.step = -1);
|
|
6506
6506
|
try {
|
|
6507
|
-
|
|
6507
|
+
rt(n);
|
|
6508
6508
|
} catch (u) {
|
|
6509
6509
|
this._errorState < 2 && console.log("Hinting error in PREP:" + u), this._errorState = 2;
|
|
6510
6510
|
}
|
|
6511
6511
|
}
|
|
6512
6512
|
if (!(this._errorState > 1))
|
|
6513
6513
|
try {
|
|
6514
|
-
return
|
|
6514
|
+
return Ci(t, n);
|
|
6515
6515
|
} catch (u) {
|
|
6516
6516
|
this._errorState < 1 && (console.log("Hinting error:" + u), console.log("Note: further hinting errors are silenced")), this._errorState = 1;
|
|
6517
6517
|
return;
|
|
6518
6518
|
}
|
|
6519
6519
|
}
|
|
6520
6520
|
};
|
|
6521
|
-
|
|
6521
|
+
Ci = function(t, e) {
|
|
6522
6522
|
var r = e.ppem / e.font.unitsPerEm, n = r, a = t.components, i, s, o;
|
|
6523
|
-
if (
|
|
6524
|
-
o = new
|
|
6523
|
+
if (We.prototype = e, !a)
|
|
6524
|
+
o = new We("glyf", t.instructions), exports.DEBUG && (console.log("---EXEC GLYPH---"), o.step = -1), jr(t, o, r, n), s = o.gZone;
|
|
6525
6525
|
else {
|
|
6526
6526
|
var c = e.font;
|
|
6527
6527
|
s = [], i = [];
|
|
6528
6528
|
for (var u = 0; u < a.length; u++) {
|
|
6529
6529
|
var h = a[u], d = c.glyphs.get(h.glyphIndex);
|
|
6530
|
-
o = new
|
|
6531
|
-
for (var f = Math.round(h.dx * r), g = Math.round(h.dy * n),
|
|
6532
|
-
var m = S
|
|
6530
|
+
o = new We("glyf", d.instructions), exports.DEBUG && (console.log("---EXEC COMP " + u + "---"), o.step = -1), jr(d, o, r, n);
|
|
6531
|
+
for (var f = Math.round(h.dx * r), g = Math.round(h.dy * n), x = o.gZone, v = o.contours, S = 0; S < x.length; S++) {
|
|
6532
|
+
var m = x[S];
|
|
6533
6533
|
m.xTouched = m.yTouched = !1, m.xo = m.x = m.x + f, m.yo = m.y = m.y + g;
|
|
6534
6534
|
}
|
|
6535
6535
|
var F = s.length;
|
|
6536
|
-
s.push.apply(s,
|
|
6536
|
+
s.push.apply(s, x);
|
|
6537
6537
|
for (var w = 0; w < v.length; w++)
|
|
6538
6538
|
i.push(v[w] + F);
|
|
6539
6539
|
}
|
|
6540
|
-
t.instructions && !o.inhibitGridFit && (o = new
|
|
6540
|
+
t.instructions && !o.inhibitGridFit && (o = new We("glyf", t.instructions), o.gZone = o.z0 = o.z1 = o.z2 = s, o.contours = i, s.push(
|
|
6541
6541
|
new _e(0, 0),
|
|
6542
6542
|
new _e(Math.round(t.advanceWidth * r), 0)
|
|
6543
|
-
), exports.DEBUG && (console.log("---EXEC COMPOSITE---"), o.step = -1),
|
|
6543
|
+
), exports.DEBUG && (console.log("---EXEC COMPOSITE---"), o.step = -1), rt(o), s.length -= 2);
|
|
6544
6544
|
}
|
|
6545
6545
|
return s;
|
|
6546
6546
|
};
|
|
@@ -6563,19 +6563,19 @@ jr = function(t, e, r, n) {
|
|
|
6563
6563
|
if (s.push(
|
|
6564
6564
|
new _e(0, 0),
|
|
6565
6565
|
new _e(Math.round(t.advanceWidth * r), 0)
|
|
6566
|
-
),
|
|
6566
|
+
), rt(e), s.length -= 2, exports.DEBUG) {
|
|
6567
6567
|
console.log("FINISHED GLYPH", e.stack);
|
|
6568
|
-
for (var
|
|
6569
|
-
console.log(
|
|
6568
|
+
for (var x = 0; x < i; x++)
|
|
6569
|
+
console.log(x, s[x].x, s[x].y);
|
|
6570
6570
|
}
|
|
6571
6571
|
}
|
|
6572
6572
|
};
|
|
6573
|
-
|
|
6573
|
+
rt = function(t) {
|
|
6574
6574
|
var e = t.prog;
|
|
6575
6575
|
if (e) {
|
|
6576
6576
|
var r = e.length, n;
|
|
6577
6577
|
for (t.ip = 0; t.ip < r; t.ip++) {
|
|
6578
|
-
if (exports.DEBUG && t.step++, n =
|
|
6578
|
+
if (exports.DEBUG && t.step++, n = Ei[e[t.ip]], !n)
|
|
6579
6579
|
throw new Error(
|
|
6580
6580
|
"unknown instruction: 0x" + Number(e[t.ip]).toString(16)
|
|
6581
6581
|
);
|
|
@@ -6587,7 +6587,7 @@ function er(t) {
|
|
|
6587
6587
|
for (var e = t.tZone = new Array(t.gZone.length), r = 0; r < e.length; r++)
|
|
6588
6588
|
e[r] = new _e(0, 0);
|
|
6589
6589
|
}
|
|
6590
|
-
function
|
|
6590
|
+
function Oi(t, e) {
|
|
6591
6591
|
var r = t.prog, n = t.ip, a = 1, i;
|
|
6592
6592
|
do
|
|
6593
6593
|
if (i = r[++n], i === 88)
|
|
@@ -6620,21 +6620,21 @@ function Kn(t, e) {
|
|
|
6620
6620
|
var r = e.stack, n = r.pop(), a = r.pop(), i = e.z2[n], s = e.z1[a];
|
|
6621
6621
|
exports.DEBUG && console.log("SPVTL[" + t + "]", n, a);
|
|
6622
6622
|
var o, c;
|
|
6623
|
-
t ? (o = i.y - s.y, c = s.x - i.x) : (o = s.x - i.x, c = s.y - i.y), e.pv = e.dpv =
|
|
6623
|
+
t ? (o = i.y - s.y, c = s.x - i.x) : (o = s.x - i.x, c = s.y - i.y), e.pv = e.dpv = Ct(o, c);
|
|
6624
6624
|
}
|
|
6625
6625
|
function Qn(t, e) {
|
|
6626
6626
|
var r = e.stack, n = r.pop(), a = r.pop(), i = e.z2[n], s = e.z1[a];
|
|
6627
6627
|
exports.DEBUG && console.log("SFVTL[" + t + "]", n, a);
|
|
6628
6628
|
var o, c;
|
|
6629
|
-
t ? (o = i.y - s.y, c = s.x - i.x) : (o = s.x - i.x, c = s.y - i.y), e.fv =
|
|
6629
|
+
t ? (o = i.y - s.y, c = s.x - i.x) : (o = s.x - i.x, c = s.y - i.y), e.fv = Ct(o, c);
|
|
6630
6630
|
}
|
|
6631
6631
|
function Ko(t) {
|
|
6632
6632
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6633
|
-
exports.DEBUG && console.log(t.step, "SPVFS[]", r, n), t.pv = t.dpv =
|
|
6633
|
+
exports.DEBUG && console.log(t.step, "SPVFS[]", r, n), t.pv = t.dpv = Ct(n, r);
|
|
6634
6634
|
}
|
|
6635
6635
|
function Qo(t) {
|
|
6636
6636
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
6637
|
-
exports.DEBUG && console.log(t.step, "SPVFS[]", r, n), t.fv =
|
|
6637
|
+
exports.DEBUG && console.log(t.step, "SPVFS[]", r, n), t.fv = Ct(n, r);
|
|
6638
6638
|
}
|
|
6639
6639
|
function Jo(t) {
|
|
6640
6640
|
var e = t.stack, r = t.pv;
|
|
@@ -6650,8 +6650,8 @@ function tc(t) {
|
|
|
6650
6650
|
function rc(t) {
|
|
6651
6651
|
var e = t.stack, r = e.pop(), n = e.pop(), a = e.pop(), i = e.pop(), s = e.pop(), o = t.z0, c = t.z1, u = o[r], h = o[n], d = c[a], f = c[i], g = t.z2[s];
|
|
6652
6652
|
exports.DEBUG && console.log("ISECT[], ", r, n, a, i, s);
|
|
6653
|
-
var
|
|
6654
|
-
g.x = (B * (F - k) -
|
|
6653
|
+
var x = u.x, v = u.y, S = h.x, m = h.y, F = d.x, w = d.y, k = f.x, E = f.y, O = (x - S) * (w - E) - (v - m) * (F - k), B = x * m - v * S, L = F * E - w * k;
|
|
6654
|
+
g.x = (B * (F - k) - L * (x - S)) / O, g.y = (B * (w - E) - L * (v - m)) / O;
|
|
6655
6655
|
}
|
|
6656
6656
|
function nc(t) {
|
|
6657
6657
|
t.rp0 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP0[]", t.rp0);
|
|
@@ -6728,7 +6728,7 @@ function pc(t) {
|
|
|
6728
6728
|
exports.DEBUG && console.log(t.step, "SMD[]", e), t.minDis = e / 64;
|
|
6729
6729
|
}
|
|
6730
6730
|
function dc(t) {
|
|
6731
|
-
exports.DEBUG && console.log(t.step, "ELSE[]"),
|
|
6731
|
+
exports.DEBUG && console.log(t.step, "ELSE[]"), Oi(t, !1);
|
|
6732
6732
|
}
|
|
6733
6733
|
function gc(t) {
|
|
6734
6734
|
var e = t.stack.pop();
|
|
@@ -6762,7 +6762,7 @@ function Sc(t) {
|
|
|
6762
6762
|
var a = t.ip, i = t.prog;
|
|
6763
6763
|
t.prog = t.funcs[r];
|
|
6764
6764
|
for (var s = 0; s < n; s++)
|
|
6765
|
-
|
|
6765
|
+
rt(t), exports.DEBUG && console.log(
|
|
6766
6766
|
++t.step,
|
|
6767
6767
|
s + 1 < n ? "next loopcall" : "done loopcall",
|
|
6768
6768
|
s
|
|
@@ -6773,7 +6773,7 @@ function wc(t) {
|
|
|
6773
6773
|
var e = t.stack.pop();
|
|
6774
6774
|
exports.DEBUG && console.log(t.step, "CALL[]", e);
|
|
6775
6775
|
var r = t.ip, n = t.prog;
|
|
6776
|
-
t.prog = t.funcs[e],
|
|
6776
|
+
t.prog = t.funcs[e], rt(t), t.ip = r, t.prog = n, exports.DEBUG && console.log(++t.step, "returning from", e);
|
|
6777
6777
|
}
|
|
6778
6778
|
function Fc(t) {
|
|
6779
6779
|
var e = t.stack, r = e.pop();
|
|
@@ -6839,7 +6839,7 @@ function na(t, e) {
|
|
|
6839
6839
|
for (var u, h = s.distance(a, a, !1, !0), d = c.length - 2, f = 0; f < d; f++)
|
|
6840
6840
|
u = c[f], i.setRelative(u, u, h, s);
|
|
6841
6841
|
}
|
|
6842
|
-
function
|
|
6842
|
+
function Ec(t) {
|
|
6843
6843
|
for (var e = t.stack, r = t.loop, n = t.fv, a = e.pop() / 64, i = t.z2; r--; ) {
|
|
6844
6844
|
var s = e.pop(), o = i[s];
|
|
6845
6845
|
exports.DEBUG && console.log(
|
|
@@ -6851,7 +6851,7 @@ function Cc(t) {
|
|
|
6851
6851
|
}
|
|
6852
6852
|
t.loop = 1;
|
|
6853
6853
|
}
|
|
6854
|
-
function
|
|
6854
|
+
function Cc(t) {
|
|
6855
6855
|
for (var e = t.stack, r = t.rp1, n = t.rp2, a = t.loop, i = t.z0[r], s = t.z1[n], o = t.fv, c = t.dpv, u = t.z2; a--; ) {
|
|
6856
6856
|
var h = e.pop(), d = u[h];
|
|
6857
6857
|
exports.DEBUG && console.log(
|
|
@@ -6904,7 +6904,7 @@ function Bc(t) {
|
|
|
6904
6904
|
n.push(e[++r]);
|
|
6905
6905
|
t.ip = r;
|
|
6906
6906
|
}
|
|
6907
|
-
function
|
|
6907
|
+
function Oc(t) {
|
|
6908
6908
|
var e = t.ip, r = t.prog, n = t.stack, a = r[++e];
|
|
6909
6909
|
exports.DEBUG && console.log(t.step, "NPUSHW[]", a);
|
|
6910
6910
|
for (var i = 0; i < a; i++) {
|
|
@@ -6913,7 +6913,7 @@ function Lc(t) {
|
|
|
6913
6913
|
}
|
|
6914
6914
|
t.ip = e;
|
|
6915
6915
|
}
|
|
6916
|
-
function
|
|
6916
|
+
function Lc(t) {
|
|
6917
6917
|
var e = t.stack, r = t.store;
|
|
6918
6918
|
r || (r = t.store = []);
|
|
6919
6919
|
var n = e.pop(), a = e.pop();
|
|
@@ -6981,7 +6981,7 @@ function Vc(t) {
|
|
|
6981
6981
|
}
|
|
6982
6982
|
function Xc(t) {
|
|
6983
6983
|
var e = t.stack.pop();
|
|
6984
|
-
exports.DEBUG && console.log(t.step, "IF[]", e), e || (
|
|
6984
|
+
exports.DEBUG && console.log(t.step, "IF[]", e), e || (Oi(t, !0), exports.DEBUG && console.log(t.step, "EIF[]"));
|
|
6985
6985
|
}
|
|
6986
6986
|
function jc(t) {
|
|
6987
6987
|
exports.DEBUG && console.log(t.step, "EIF[]");
|
|
@@ -7004,10 +7004,10 @@ function pr(t, e) {
|
|
|
7004
7004
|
for (var h = 0; h < n; h++) {
|
|
7005
7005
|
var d = r.pop(), f = r.pop(), g = o + ((f & 240) >> 4);
|
|
7006
7006
|
if (g === s) {
|
|
7007
|
-
var
|
|
7008
|
-
|
|
7007
|
+
var x = (f & 15) - 8;
|
|
7008
|
+
x >= 0 && x++, exports.DEBUG && console.log(e.step, "DELTAPFIX", d, "by", x * c);
|
|
7009
7009
|
var v = u[d];
|
|
7010
|
-
a.setRelative(v, v,
|
|
7010
|
+
a.setRelative(v, v, x * c, i);
|
|
7011
7011
|
}
|
|
7012
7012
|
}
|
|
7013
7013
|
}
|
|
@@ -7159,7 +7159,7 @@ function ca(t, e) {
|
|
|
7159
7159
|
var r = e.stack, n = r.pop(), a = r.pop(), i = e.z2[n], s = e.z1[a];
|
|
7160
7160
|
exports.DEBUG && console.log(e.step, "SDPVTL[" + t + "]", n, a);
|
|
7161
7161
|
var o, c;
|
|
7162
|
-
t ? (o = i.y - s.y, c = s.x - i.x) : (o = s.x - i.x, c = s.y - i.y), e.dpv =
|
|
7162
|
+
t ? (o = i.y - s.y, c = s.x - i.x) : (o = s.x - i.x, c = s.y - i.y), e.dpv = Ct(o, c);
|
|
7163
7163
|
}
|
|
7164
7164
|
function du(t) {
|
|
7165
7165
|
var e = t.stack, r = e.pop(), n = 0;
|
|
@@ -7211,8 +7211,8 @@ function Ge(t, e) {
|
|
|
7211
7211
|
e.ip = r;
|
|
7212
7212
|
}
|
|
7213
7213
|
function I(t, e, r, n, a, i) {
|
|
7214
|
-
var s = i.stack, o = t && s.pop(), c = s.pop(), u = i.rp0, h = i.z0[u], d = i.z1[c], f = i.minDis, g = i.fv,
|
|
7215
|
-
|
|
7214
|
+
var s = i.stack, o = t && s.pop(), c = s.pop(), u = i.rp0, h = i.z0[u], d = i.z1[c], f = i.minDis, g = i.fv, x = i.dpv, v, S, m, F;
|
|
7215
|
+
S = v = x.distance(d, h, !0, !0), m = S >= 0 ? 1 : -1, S = Math.abs(S), t && (F = i.cvt[o], n && Math.abs(S - F) < i.cvCutIn && (S = F)), r && S < f && (S = f), n && (S = i.round(S)), g.setRelative(d, h, m * S, x), g.touch(d), exports.DEBUG && console.log(
|
|
7216
7216
|
i.step,
|
|
7217
7217
|
(t ? "MIRP[" : "MDRP[") + (e ? "M" : "m") + (r ? ">" : "_") + (n ? "R" : "_") + (a === 0 ? "Gr" : a === 1 ? "Bl" : a === 2 ? "Wh" : "") + "]",
|
|
7218
7218
|
t ? o + "(" + i.cvt[o] + "," + F + ")" : "",
|
|
@@ -7220,23 +7220,23 @@ function I(t, e, r, n, a, i) {
|
|
|
7220
7220
|
"(d =",
|
|
7221
7221
|
v,
|
|
7222
7222
|
"->",
|
|
7223
|
-
m *
|
|
7223
|
+
m * S,
|
|
7224
7224
|
")"
|
|
7225
7225
|
), i.rp1 = i.rp0, i.rp2 = c, e && (i.rp0 = c);
|
|
7226
7226
|
}
|
|
7227
|
-
|
|
7227
|
+
Ei = [
|
|
7228
7228
|
/* 0x00 */
|
|
7229
7229
|
Yn.bind(void 0, De),
|
|
7230
7230
|
/* 0x01 */
|
|
7231
|
-
Yn.bind(void 0,
|
|
7231
|
+
Yn.bind(void 0, Le),
|
|
7232
7232
|
/* 0x02 */
|
|
7233
7233
|
Zn.bind(void 0, De),
|
|
7234
7234
|
/* 0x03 */
|
|
7235
|
-
Zn.bind(void 0,
|
|
7235
|
+
Zn.bind(void 0, Le),
|
|
7236
7236
|
/* 0x04 */
|
|
7237
7237
|
$n.bind(void 0, De),
|
|
7238
7238
|
/* 0x05 */
|
|
7239
|
-
$n.bind(void 0,
|
|
7239
|
+
$n.bind(void 0, Le),
|
|
7240
7240
|
/* 0x06 */
|
|
7241
7241
|
Kn.bind(void 0, 0),
|
|
7242
7242
|
/* 0x07 */
|
|
@@ -7329,7 +7329,7 @@ Ci = [
|
|
|
7329
7329
|
/* 0x30 */
|
|
7330
7330
|
ea.bind(void 0, De),
|
|
7331
7331
|
/* 0x31 */
|
|
7332
|
-
ea.bind(void 0,
|
|
7332
|
+
ea.bind(void 0, Le),
|
|
7333
7333
|
/* 0x32 */
|
|
7334
7334
|
ta.bind(void 0, 0),
|
|
7335
7335
|
/* 0x33 */
|
|
@@ -7343,9 +7343,9 @@ Ci = [
|
|
|
7343
7343
|
/* 0x37 */
|
|
7344
7344
|
na.bind(void 0, 1),
|
|
7345
7345
|
/* 0x38 */
|
|
7346
|
-
Cc,
|
|
7347
|
-
/* 0x39 */
|
|
7348
7346
|
Ec,
|
|
7347
|
+
/* 0x39 */
|
|
7348
|
+
Cc,
|
|
7349
7349
|
/* 0x3A */
|
|
7350
7350
|
aa.bind(void 0, 0),
|
|
7351
7351
|
/* 0x3B */
|
|
@@ -7361,9 +7361,9 @@ Ci = [
|
|
|
7361
7361
|
/* 0x40 */
|
|
7362
7362
|
Bc,
|
|
7363
7363
|
/* 0x41 */
|
|
7364
|
-
Lc,
|
|
7365
|
-
/* 0x42 */
|
|
7366
7364
|
Oc,
|
|
7365
|
+
/* 0x42 */
|
|
7366
|
+
Lc,
|
|
7367
7367
|
/* 0x43 */
|
|
7368
7368
|
Rc,
|
|
7369
7369
|
/* 0x44 */
|
|
@@ -8012,13 +8012,13 @@ ee.prototype.tokenize = function(t) {
|
|
|
8012
8012
|
}
|
|
8013
8013
|
return this.dispatch("end", [this.tokens]), this.tokens;
|
|
8014
8014
|
};
|
|
8015
|
-
function
|
|
8015
|
+
function Ve(t) {
|
|
8016
8016
|
return /[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(t);
|
|
8017
8017
|
}
|
|
8018
|
-
function
|
|
8018
|
+
function Li(t) {
|
|
8019
8019
|
return /[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(t);
|
|
8020
8020
|
}
|
|
8021
|
-
function
|
|
8021
|
+
function Xe(t) {
|
|
8022
8022
|
return /[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(t);
|
|
8023
8023
|
}
|
|
8024
8024
|
function qt(t) {
|
|
@@ -8030,7 +8030,7 @@ function wu(t) {
|
|
|
8030
8030
|
function ve(t) {
|
|
8031
8031
|
this.font = t, this.features = {};
|
|
8032
8032
|
}
|
|
8033
|
-
function
|
|
8033
|
+
function et(t) {
|
|
8034
8034
|
this.id = t.id, this.tag = t.tag, this.substitution = t.substitution;
|
|
8035
8035
|
}
|
|
8036
8036
|
function At(t, e) {
|
|
@@ -8083,13 +8083,13 @@ function Tu(t, e) {
|
|
|
8083
8083
|
var a = e.inputCoverage.length - 1;
|
|
8084
8084
|
if (t.lookahead.length < e.lookaheadCoverage.length)
|
|
8085
8085
|
return [];
|
|
8086
|
-
for (var i = t.lookahead.slice(a); i.length &&
|
|
8086
|
+
for (var i = t.lookahead.slice(a); i.length && Xe(i[0].char); )
|
|
8087
8087
|
i.shift();
|
|
8088
8088
|
var s = new ke(i, 0), o = gr(
|
|
8089
8089
|
e.lookaheadCoverage,
|
|
8090
8090
|
s
|
|
8091
8091
|
), c = [].concat(t.backtrack);
|
|
8092
|
-
for (c.reverse(); c.length &&
|
|
8092
|
+
for (c.reverse(); c.length && Xe(c[0].char); )
|
|
8093
8093
|
c.shift();
|
|
8094
8094
|
if (c.length < e.backtrackCoverage.length)
|
|
8095
8095
|
return [];
|
|
@@ -8099,17 +8099,17 @@ function Tu(t, e) {
|
|
|
8099
8099
|
), d = n.length === e.inputCoverage.length && o.length === e.lookaheadCoverage.length && h.length === e.backtrackCoverage.length, f = [];
|
|
8100
8100
|
if (d)
|
|
8101
8101
|
for (var g = 0; g < e.lookupRecords.length; g++)
|
|
8102
|
-
for (var
|
|
8103
|
-
var F =
|
|
8102
|
+
for (var x = e.lookupRecords[g], v = x.lookupListIndex, S = this.getLookupByIndex(v), m = 0; m < S.subtables.length; m++) {
|
|
8103
|
+
var F = S.subtables[m], w = this.getLookupMethod(S, F), k = this.getSubstitutionType(S, F);
|
|
8104
8104
|
if (k === "12")
|
|
8105
|
-
for (var
|
|
8106
|
-
var
|
|
8105
|
+
for (var E = 0; E < n.length; E++) {
|
|
8106
|
+
var O = t.get(E), B = w(O);
|
|
8107
8107
|
B && f.push(B);
|
|
8108
8108
|
}
|
|
8109
8109
|
}
|
|
8110
8110
|
return f;
|
|
8111
8111
|
}
|
|
8112
|
-
function
|
|
8112
|
+
function Eu(t, e) {
|
|
8113
8113
|
var r = t.current, n = At(r, e.coverage);
|
|
8114
8114
|
if (n === -1)
|
|
8115
8115
|
return null;
|
|
@@ -8125,7 +8125,7 @@ function Cu(t, e) {
|
|
|
8125
8125
|
}
|
|
8126
8126
|
return null;
|
|
8127
8127
|
}
|
|
8128
|
-
function
|
|
8128
|
+
function Cu(t, e) {
|
|
8129
8129
|
var r = At(t, e.coverage);
|
|
8130
8130
|
return r === -1 ? null : e.sequences[r];
|
|
8131
8131
|
}
|
|
@@ -8208,14 +8208,14 @@ ve.prototype.getLookupMethod = function(t, e) {
|
|
|
8208
8208
|
};
|
|
8209
8209
|
case "41":
|
|
8210
8210
|
return function(a) {
|
|
8211
|
-
return
|
|
8211
|
+
return Eu.apply(
|
|
8212
8212
|
r,
|
|
8213
8213
|
[a, e]
|
|
8214
8214
|
);
|
|
8215
8215
|
};
|
|
8216
8216
|
case "21":
|
|
8217
8217
|
return function(a) {
|
|
8218
|
-
return
|
|
8218
|
+
return Cu.apply(
|
|
8219
8219
|
r,
|
|
8220
8220
|
[a, e]
|
|
8221
8221
|
);
|
|
@@ -8240,35 +8240,35 @@ ve.prototype.lookupFeature = function(t) {
|
|
|
8240
8240
|
var h = c[u], d = this.getSubstitutionType(o, h), f = this.getLookupMethod(o, h), g = void 0;
|
|
8241
8241
|
switch (d) {
|
|
8242
8242
|
case "11":
|
|
8243
|
-
g = f(e.current), g && i.splice(r, 1, new
|
|
8243
|
+
g = f(e.current), g && i.splice(r, 1, new et({
|
|
8244
8244
|
id: 11,
|
|
8245
8245
|
tag: t.tag,
|
|
8246
8246
|
substitution: g
|
|
8247
8247
|
}));
|
|
8248
8248
|
break;
|
|
8249
8249
|
case "12":
|
|
8250
|
-
g = f(e.current), g && i.splice(r, 1, new
|
|
8250
|
+
g = f(e.current), g && i.splice(r, 1, new et({
|
|
8251
8251
|
id: 12,
|
|
8252
8252
|
tag: t.tag,
|
|
8253
8253
|
substitution: g
|
|
8254
8254
|
}));
|
|
8255
8255
|
break;
|
|
8256
8256
|
case "63":
|
|
8257
|
-
g = f(e), Array.isArray(g) && g.length && i.splice(r, 1, new
|
|
8257
|
+
g = f(e), Array.isArray(g) && g.length && i.splice(r, 1, new et({
|
|
8258
8258
|
id: 63,
|
|
8259
8259
|
tag: t.tag,
|
|
8260
8260
|
substitution: g
|
|
8261
8261
|
}));
|
|
8262
8262
|
break;
|
|
8263
8263
|
case "41":
|
|
8264
|
-
g = f(e), g && i.splice(r, 1, new
|
|
8264
|
+
g = f(e), g && i.splice(r, 1, new et({
|
|
8265
8265
|
id: 41,
|
|
8266
8266
|
tag: t.tag,
|
|
8267
8267
|
substitution: g
|
|
8268
8268
|
}));
|
|
8269
8269
|
break;
|
|
8270
8270
|
case "21":
|
|
8271
|
-
g = f(e.current), g && i.splice(r, 1, new
|
|
8271
|
+
g = f(e.current), g && i.splice(r, 1, new et({
|
|
8272
8272
|
id: 21,
|
|
8273
8273
|
tag: t.tag,
|
|
8274
8274
|
substitution: g
|
|
@@ -8312,8 +8312,8 @@ function Au(t) {
|
|
|
8312
8312
|
var e = t.current, r = t.get(-1);
|
|
8313
8313
|
return (
|
|
8314
8314
|
// ? arabic first char
|
|
8315
|
-
r === null &&
|
|
8316
|
-
!
|
|
8315
|
+
r === null && Ve(e) || // ? arabic char preceded with a non arabic char
|
|
8316
|
+
!Ve(r) && Ve(e)
|
|
8317
8317
|
);
|
|
8318
8318
|
}
|
|
8319
8319
|
function Uu(t) {
|
|
@@ -8321,26 +8321,26 @@ function Uu(t) {
|
|
|
8321
8321
|
return (
|
|
8322
8322
|
// ? last arabic char
|
|
8323
8323
|
e === null || // ? next char is not arabic
|
|
8324
|
-
!
|
|
8324
|
+
!Ve(e)
|
|
8325
8325
|
);
|
|
8326
8326
|
}
|
|
8327
8327
|
var Bu = {
|
|
8328
8328
|
startCheck: Au,
|
|
8329
8329
|
endCheck: Uu
|
|
8330
8330
|
};
|
|
8331
|
-
function
|
|
8331
|
+
function Ou(t) {
|
|
8332
8332
|
var e = t.current, r = t.get(-1);
|
|
8333
8333
|
return (
|
|
8334
8334
|
// ? an arabic char preceded with a non arabic char
|
|
8335
|
-
(
|
|
8335
|
+
(Ve(e) || Xe(e)) && !Ve(r)
|
|
8336
8336
|
);
|
|
8337
8337
|
}
|
|
8338
|
-
function
|
|
8338
|
+
function Lu(t) {
|
|
8339
8339
|
var e = t.get(1);
|
|
8340
8340
|
switch (!0) {
|
|
8341
8341
|
case e === null:
|
|
8342
8342
|
return !0;
|
|
8343
|
-
case (!
|
|
8343
|
+
case (!Ve(e) && !Xe(e)):
|
|
8344
8344
|
var r = wu(e);
|
|
8345
8345
|
if (!r)
|
|
8346
8346
|
return !0;
|
|
@@ -8348,7 +8348,7 @@ function Ou(t) {
|
|
|
8348
8348
|
var n = !1;
|
|
8349
8349
|
if (n = t.lookahead.some(
|
|
8350
8350
|
function(a) {
|
|
8351
|
-
return
|
|
8351
|
+
return Ve(a) || Xe(a);
|
|
8352
8352
|
}
|
|
8353
8353
|
), !n)
|
|
8354
8354
|
return !0;
|
|
@@ -8359,8 +8359,8 @@ function Ou(t) {
|
|
|
8359
8359
|
}
|
|
8360
8360
|
}
|
|
8361
8361
|
var Ru = {
|
|
8362
|
-
startCheck:
|
|
8363
|
-
endCheck:
|
|
8362
|
+
startCheck: Ou,
|
|
8363
|
+
endCheck: Lu
|
|
8364
8364
|
};
|
|
8365
8365
|
function Mu(t, e, r) {
|
|
8366
8366
|
e[r].setState(t.tag, t.substitution);
|
|
@@ -8387,11 +8387,11 @@ var ua = {
|
|
|
8387
8387
|
41: _u
|
|
8388
8388
|
};
|
|
8389
8389
|
function an(t, e, r) {
|
|
8390
|
-
t instanceof
|
|
8390
|
+
t instanceof et && ua[t.id] && ua[t.id](t, e, r);
|
|
8391
8391
|
}
|
|
8392
8392
|
function Pu(t) {
|
|
8393
8393
|
for (var e = [].concat(t.backtrack), r = e.length - 1; r >= 0; r--) {
|
|
8394
|
-
var n = e[r], a =
|
|
8394
|
+
var n = e[r], a = Li(n), i = Xe(n);
|
|
8395
8395
|
if (!a && !i)
|
|
8396
8396
|
return !0;
|
|
8397
8397
|
if (a)
|
|
@@ -8400,10 +8400,10 @@ function Pu(t) {
|
|
|
8400
8400
|
return !1;
|
|
8401
8401
|
}
|
|
8402
8402
|
function Nu(t) {
|
|
8403
|
-
if (
|
|
8403
|
+
if (Li(t.current))
|
|
8404
8404
|
return !1;
|
|
8405
8405
|
for (var e = 0; e < t.lookahead.length; e++) {
|
|
8406
|
-
var r = t.lookahead[e], n =
|
|
8406
|
+
var r = t.lookahead[e], n = Xe(r);
|
|
8407
8407
|
if (!n)
|
|
8408
8408
|
return !0;
|
|
8409
8409
|
}
|
|
@@ -8428,7 +8428,7 @@ function Gu(t) {
|
|
|
8428
8428
|
0
|
|
8429
8429
|
);
|
|
8430
8430
|
a.forEach(function(o, c) {
|
|
8431
|
-
if (!
|
|
8431
|
+
if (!Xe(o.char)) {
|
|
8432
8432
|
i.setCurrentIndex(c), s.setCurrentIndex(c);
|
|
8433
8433
|
var u = 0;
|
|
8434
8434
|
Pu(s) && (u |= 1), Nu(s) && (u |= 2);
|
|
@@ -8453,7 +8453,7 @@ function Gu(t) {
|
|
|
8453
8453
|
if (d instanceof Error)
|
|
8454
8454
|
return console.info(d.message);
|
|
8455
8455
|
d.forEach(function(f, g) {
|
|
8456
|
-
f instanceof
|
|
8456
|
+
f instanceof et && (an(f, a, g), i.context[g] = f.substitution);
|
|
8457
8457
|
});
|
|
8458
8458
|
}
|
|
8459
8459
|
}
|
|
@@ -8524,13 +8524,13 @@ function Vu(t) {
|
|
|
8524
8524
|
), a = la(n));
|
|
8525
8525
|
});
|
|
8526
8526
|
}
|
|
8527
|
-
function
|
|
8527
|
+
function Ce(t) {
|
|
8528
8528
|
this.baseDir = t || "ltr", this.tokenizer = new ee(), this.featuresTags = {};
|
|
8529
8529
|
}
|
|
8530
|
-
|
|
8530
|
+
Ce.prototype.setText = function(t) {
|
|
8531
8531
|
this.text = t;
|
|
8532
8532
|
};
|
|
8533
|
-
|
|
8533
|
+
Ce.prototype.contextChecks = {
|
|
8534
8534
|
latinWordCheck: qu,
|
|
8535
8535
|
arabicWordCheck: Bu,
|
|
8536
8536
|
arabicSentenceCheck: Ru
|
|
@@ -8557,7 +8557,7 @@ function ju() {
|
|
|
8557
8557
|
);
|
|
8558
8558
|
});
|
|
8559
8559
|
}
|
|
8560
|
-
|
|
8560
|
+
Ce.prototype.registerFeatures = function(t, e) {
|
|
8561
8561
|
var r = this, n = e.filter(
|
|
8562
8562
|
function(a) {
|
|
8563
8563
|
return r.query.supports({ script: t, tag: a });
|
|
@@ -8565,7 +8565,7 @@ Ee.prototype.registerFeatures = function(t, e) {
|
|
|
8565
8565
|
);
|
|
8566
8566
|
this.featuresTags.hasOwnProperty(t) ? this.featuresTags[t] = this.featuresTags[t].concat(n) : this.featuresTags[t] = n;
|
|
8567
8567
|
};
|
|
8568
|
-
|
|
8568
|
+
Ce.prototype.applyFeatures = function(t, e) {
|
|
8569
8569
|
if (!t)
|
|
8570
8570
|
throw new Error(
|
|
8571
8571
|
"No valid font was provided to apply features"
|
|
@@ -8576,7 +8576,7 @@ Ee.prototype.applyFeatures = function(t, e) {
|
|
|
8576
8576
|
this.query.supports({ script: n.script }) && this.registerFeatures(n.script, n.tags);
|
|
8577
8577
|
}
|
|
8578
8578
|
};
|
|
8579
|
-
|
|
8579
|
+
Ce.prototype.registerModifier = function(t, e, r) {
|
|
8580
8580
|
this.tokenizer.registerModifier(t, e, r);
|
|
8581
8581
|
};
|
|
8582
8582
|
function sn() {
|
|
@@ -8621,19 +8621,19 @@ function $u() {
|
|
|
8621
8621
|
}
|
|
8622
8622
|
}
|
|
8623
8623
|
}
|
|
8624
|
-
|
|
8624
|
+
Ce.prototype.checkContextReady = function(t) {
|
|
8625
8625
|
return !!this.tokenizer.getContext(t);
|
|
8626
8626
|
};
|
|
8627
|
-
|
|
8627
|
+
Ce.prototype.applyFeaturesToContexts = function() {
|
|
8628
8628
|
this.checkContextReady("arabicWord") && (Yu.call(this), Zu.call(this)), this.checkContextReady("latinWord") && $u.call(this), this.checkContextReady("arabicSentence") && ju.call(this);
|
|
8629
8629
|
};
|
|
8630
|
-
|
|
8630
|
+
Ce.prototype.processText = function(t) {
|
|
8631
8631
|
(!this.text || this.text !== t) && (this.setText(t), Xu.call(this), this.applyFeaturesToContexts());
|
|
8632
8632
|
};
|
|
8633
|
-
|
|
8633
|
+
Ce.prototype.getBidiText = function(t) {
|
|
8634
8634
|
return this.processText(t), this.tokenizer.getText();
|
|
8635
8635
|
};
|
|
8636
|
-
|
|
8636
|
+
Ce.prototype.getTextGlyphs = function(t) {
|
|
8637
8637
|
this.processText(t);
|
|
8638
8638
|
for (var e = [], r = 0; r < this.tokenizer.tokens.length; r++) {
|
|
8639
8639
|
var n = this.tokenizer.tokens[r];
|
|
@@ -8697,7 +8697,7 @@ j.prototype.updateFeatures = function(t) {
|
|
|
8697
8697
|
});
|
|
8698
8698
|
};
|
|
8699
8699
|
j.prototype.stringToGlyphs = function(t, e) {
|
|
8700
|
-
var r = this, n = new
|
|
8700
|
+
var r = this, n = new Ce(), a = function(d) {
|
|
8701
8701
|
return r.charToGlyphIndex(d.char);
|
|
8702
8702
|
};
|
|
8703
8703
|
n.registerModifier("glyphIndex", null, a);
|
|
@@ -8892,7 +8892,7 @@ function Ku(t, e, r) {
|
|
|
8892
8892
|
];
|
|
8893
8893
|
}
|
|
8894
8894
|
function Qu(t, e, r) {
|
|
8895
|
-
var n = {}, a = new
|
|
8895
|
+
var n = {}, a = new _.Parser(t, e);
|
|
8896
8896
|
return n.tag = a.parseTag(), n.minValue = a.parseFixed(), n.defaultValue = a.parseFixed(), n.maxValue = a.parseFixed(), a.skip("uShort", 1), n.name = r[a.parseUShort()] || {}, n;
|
|
8897
8897
|
}
|
|
8898
8898
|
function Ju(t, e, r, n) {
|
|
@@ -8910,7 +8910,7 @@ function Ju(t, e, r, n) {
|
|
|
8910
8910
|
return i;
|
|
8911
8911
|
}
|
|
8912
8912
|
function eh(t, e, r, n) {
|
|
8913
|
-
var a = {}, i = new
|
|
8913
|
+
var a = {}, i = new _.Parser(t, e);
|
|
8914
8914
|
a.name = n[i.parseUShort()] || {}, i.skip("uShort", 1), a.coordinates = {};
|
|
8915
8915
|
for (var s = 0; s < r.length; ++s)
|
|
8916
8916
|
a.coordinates[r[s].tag] = i.parseFixed();
|
|
@@ -8934,20 +8934,20 @@ function th(t, e) {
|
|
|
8934
8934
|
return r;
|
|
8935
8935
|
}
|
|
8936
8936
|
function rh(t, e, r) {
|
|
8937
|
-
var n = new
|
|
8937
|
+
var n = new _.Parser(t, e), a = n.parseULong();
|
|
8938
8938
|
P.argument(a === 65536, "Unsupported fvar table version.");
|
|
8939
8939
|
var i = n.parseOffset16();
|
|
8940
8940
|
n.skip("uShort", 1);
|
|
8941
8941
|
for (var s = n.parseUShort(), o = n.parseUShort(), c = n.parseUShort(), u = n.parseUShort(), h = [], d = 0; d < s; d++)
|
|
8942
8942
|
h.push(Qu(t, e + i + d * o, r));
|
|
8943
|
-
for (var f = [], g = e + i + s * o,
|
|
8944
|
-
f.push(eh(t, g +
|
|
8943
|
+
for (var f = [], g = e + i + s * o, x = 0; x < c; x++)
|
|
8944
|
+
f.push(eh(t, g + x * u, h, r));
|
|
8945
8945
|
return { axes: h, instances: f };
|
|
8946
8946
|
}
|
|
8947
8947
|
var nh = { make: th, parse: rh }, ah = function() {
|
|
8948
8948
|
return {
|
|
8949
|
-
coverage: this.parsePointer(
|
|
8950
|
-
attachPoints: this.parseList(
|
|
8949
|
+
coverage: this.parsePointer(C.coverage),
|
|
8950
|
+
attachPoints: this.parseList(C.pointer(C.uShortList))
|
|
8951
8951
|
};
|
|
8952
8952
|
}, ih = function() {
|
|
8953
8953
|
var t = this.parseUShort();
|
|
@@ -8961,28 +8961,28 @@ var nh = { make: th, parse: rh }, ah = function() {
|
|
|
8961
8961
|
if (t === 3)
|
|
8962
8962
|
return { coordinate: this.parseShort() };
|
|
8963
8963
|
}, sh = function() {
|
|
8964
|
-
return this.parseList(
|
|
8964
|
+
return this.parseList(C.pointer(ih));
|
|
8965
8965
|
}, oh = function() {
|
|
8966
8966
|
return {
|
|
8967
|
-
coverage: this.parsePointer(
|
|
8968
|
-
ligGlyphs: this.parseList(
|
|
8967
|
+
coverage: this.parsePointer(C.coverage),
|
|
8968
|
+
ligGlyphs: this.parseList(C.pointer(sh))
|
|
8969
8969
|
};
|
|
8970
8970
|
}, ch = function() {
|
|
8971
|
-
return this.parseUShort(), this.parseList(
|
|
8971
|
+
return this.parseUShort(), this.parseList(C.pointer(C.coverage));
|
|
8972
8972
|
};
|
|
8973
8973
|
function uh(t, e) {
|
|
8974
8974
|
e = e || 0;
|
|
8975
|
-
var r = new
|
|
8975
|
+
var r = new C(t, e), n = r.parseVersion(1);
|
|
8976
8976
|
P.argument(
|
|
8977
8977
|
n === 1 || n === 1.2 || n === 1.3,
|
|
8978
8978
|
"Unsupported GDEF table version."
|
|
8979
8979
|
);
|
|
8980
8980
|
var a = {
|
|
8981
8981
|
version: n,
|
|
8982
|
-
classDef: r.parsePointer(
|
|
8982
|
+
classDef: r.parsePointer(C.classDef),
|
|
8983
8983
|
attachList: r.parsePointer(ah),
|
|
8984
8984
|
ligCaretList: r.parsePointer(oh),
|
|
8985
|
-
markAttachClassDef: r.parsePointer(
|
|
8985
|
+
markAttachClassDef: r.parsePointer(C.classDef)
|
|
8986
8986
|
};
|
|
8987
8987
|
return n >= 1.2 && (a.markGlyphSets = r.parsePointer(ch)), a;
|
|
8988
8988
|
}
|
|
@@ -8992,13 +8992,13 @@ Te[1] = function() {
|
|
|
8992
8992
|
if (r === 1)
|
|
8993
8993
|
return {
|
|
8994
8994
|
posFormat: 1,
|
|
8995
|
-
coverage: this.parsePointer(
|
|
8995
|
+
coverage: this.parsePointer(C.coverage),
|
|
8996
8996
|
value: this.parseValueRecord()
|
|
8997
8997
|
};
|
|
8998
8998
|
if (r === 2)
|
|
8999
8999
|
return {
|
|
9000
9000
|
posFormat: 2,
|
|
9001
|
-
coverage: this.parsePointer(
|
|
9001
|
+
coverage: this.parsePointer(C.coverage),
|
|
9002
9002
|
values: this.parseValueRecordList()
|
|
9003
9003
|
};
|
|
9004
9004
|
P.assert(!1, "0x" + e.toString(16) + ": GPOS lookup type 1 format must be 1 or 2.");
|
|
@@ -9006,14 +9006,14 @@ Te[1] = function() {
|
|
|
9006
9006
|
Te[2] = function() {
|
|
9007
9007
|
var e = this.offset + this.relativeOffset, r = this.parseUShort();
|
|
9008
9008
|
P.assert(r === 1 || r === 2, "0x" + e.toString(16) + ": GPOS lookup type 2 format must be 1 or 2.");
|
|
9009
|
-
var n = this.parsePointer(
|
|
9009
|
+
var n = this.parsePointer(C.coverage), a = this.parseUShort(), i = this.parseUShort();
|
|
9010
9010
|
if (r === 1)
|
|
9011
9011
|
return {
|
|
9012
9012
|
posFormat: r,
|
|
9013
9013
|
coverage: n,
|
|
9014
9014
|
valueFormat1: a,
|
|
9015
9015
|
valueFormat2: i,
|
|
9016
|
-
pairSets: this.parseList(
|
|
9016
|
+
pairSets: this.parseList(C.pointer(C.list(function() {
|
|
9017
9017
|
return {
|
|
9018
9018
|
// pairValueRecord
|
|
9019
9019
|
secondGlyph: this.parseUShort(),
|
|
@@ -9023,7 +9023,7 @@ Te[2] = function() {
|
|
|
9023
9023
|
})))
|
|
9024
9024
|
};
|
|
9025
9025
|
if (r === 2) {
|
|
9026
|
-
var s = this.parsePointer(
|
|
9026
|
+
var s = this.parsePointer(C.classDef), o = this.parsePointer(C.classDef), c = this.parseUShort(), u = this.parseUShort();
|
|
9027
9027
|
return {
|
|
9028
9028
|
// Class Pair Adjustment
|
|
9029
9029
|
posFormat: r,
|
|
@@ -9034,7 +9034,7 @@ Te[2] = function() {
|
|
|
9034
9034
|
classDef2: o,
|
|
9035
9035
|
class1Count: c,
|
|
9036
9036
|
class2Count: u,
|
|
9037
|
-
classRecords: this.parseList(c,
|
|
9037
|
+
classRecords: this.parseList(c, C.list(u, function() {
|
|
9038
9038
|
return {
|
|
9039
9039
|
value1: this.parseValueRecord(a),
|
|
9040
9040
|
value2: this.parseValueRecord(i)
|
|
@@ -9066,7 +9066,7 @@ Te[9] = function() {
|
|
|
9066
9066
|
};
|
|
9067
9067
|
function lh(t, e) {
|
|
9068
9068
|
e = e || 0;
|
|
9069
|
-
var r = new
|
|
9069
|
+
var r = new C(t, e), n = r.parseVersion(1);
|
|
9070
9070
|
return P.argument(n === 1 || n === 1.1, "Unsupported GPOS table version " + n), n === 1 ? {
|
|
9071
9071
|
version: n,
|
|
9072
9072
|
scripts: r.parseScriptList(),
|
|
@@ -9120,7 +9120,7 @@ function vh(t) {
|
|
|
9120
9120
|
return e;
|
|
9121
9121
|
}
|
|
9122
9122
|
function yh(t, e) {
|
|
9123
|
-
var r = new
|
|
9123
|
+
var r = new _.Parser(t, e), n = r.parseUShort();
|
|
9124
9124
|
if (n === 0)
|
|
9125
9125
|
return gh(r);
|
|
9126
9126
|
if (n === 1)
|
|
@@ -9129,7 +9129,7 @@ function yh(t, e) {
|
|
|
9129
9129
|
}
|
|
9130
9130
|
var mh = { parse: yh };
|
|
9131
9131
|
function bh(t, e, r, n) {
|
|
9132
|
-
for (var a = new
|
|
9132
|
+
for (var a = new _.Parser(t, e), i = n ? a.parseUShort : a.parseULong, s = [], o = 0; o < r + 1; o += 1) {
|
|
9133
9133
|
var c = i.call(a);
|
|
9134
9134
|
n && (c *= 2), s.push(c);
|
|
9135
9135
|
}
|
|
@@ -9138,14 +9138,14 @@ function bh(t, e, r, n) {
|
|
|
9138
9138
|
var xh = { parse: bh };
|
|
9139
9139
|
function fa(t, e) {
|
|
9140
9140
|
for (var r = [], n = 12, a = 0; a < e; a += 1) {
|
|
9141
|
-
var i =
|
|
9141
|
+
var i = _.getTag(t, n), s = _.getULong(t, n + 4), o = _.getULong(t, n + 8), c = _.getULong(t, n + 12);
|
|
9142
9142
|
r.push({ tag: i, checksum: s, offset: o, length: c, compression: !1 }), n += 16;
|
|
9143
9143
|
}
|
|
9144
9144
|
return r;
|
|
9145
9145
|
}
|
|
9146
9146
|
function Sh(t, e) {
|
|
9147
9147
|
for (var r = [], n = 44, a = 0; a < e; a += 1) {
|
|
9148
|
-
var i =
|
|
9148
|
+
var i = _.getTag(t, n), s = _.getULong(t, n + 4), o = _.getULong(t, n + 8), c = _.getULong(t, n + 12), u = void 0;
|
|
9149
9149
|
o < c ? u = "WOFF" : u = !1, r.push({
|
|
9150
9150
|
tag: i,
|
|
9151
9151
|
offset: s,
|
|
@@ -9168,63 +9168,63 @@ function re(t, e) {
|
|
|
9168
9168
|
}
|
|
9169
9169
|
function wh(t, e) {
|
|
9170
9170
|
e = e ?? {};
|
|
9171
|
-
var r, n, a = new j({ empty: !0 }), i = new DataView(t, 0), s, o = [], c =
|
|
9171
|
+
var r, n, a = new j({ empty: !0 }), i = new DataView(t, 0), s, o = [], c = _.getTag(i, 0);
|
|
9172
9172
|
if (c === "\0\0\0" || c === "true" || c === "typ1")
|
|
9173
|
-
a.outlinesFormat = "truetype", s =
|
|
9173
|
+
a.outlinesFormat = "truetype", s = _.getUShort(i, 4), o = fa(i, s);
|
|
9174
9174
|
else if (c === "OTTO")
|
|
9175
|
-
a.outlinesFormat = "cff", s =
|
|
9175
|
+
a.outlinesFormat = "cff", s = _.getUShort(i, 4), o = fa(i, s);
|
|
9176
9176
|
else if (c === "wOFF") {
|
|
9177
|
-
var u =
|
|
9177
|
+
var u = _.getTag(i, 4);
|
|
9178
9178
|
if (u === "\0\0\0")
|
|
9179
9179
|
a.outlinesFormat = "truetype";
|
|
9180
9180
|
else if (u === "OTTO")
|
|
9181
9181
|
a.outlinesFormat = "cff";
|
|
9182
9182
|
else
|
|
9183
9183
|
throw new Error("Unsupported OpenType flavor " + c);
|
|
9184
|
-
s =
|
|
9184
|
+
s = _.getUShort(i, 12), o = Sh(i, s);
|
|
9185
9185
|
} else
|
|
9186
9186
|
throw new Error("Unsupported OpenType signature " + c);
|
|
9187
|
-
for (var h, d, f, g,
|
|
9188
|
-
var B = o[
|
|
9187
|
+
for (var h, d, f, g, x, v, S, m, F, w, k, E, O = 0; O < s; O += 1) {
|
|
9188
|
+
var B = o[O], L = void 0;
|
|
9189
9189
|
switch (B.tag) {
|
|
9190
9190
|
case "cmap":
|
|
9191
|
-
|
|
9191
|
+
L = re(i, B), a.tables.cmap = $a.parse(L.data, L.offset), a.encoding = new Qa(a.tables.cmap);
|
|
9192
9192
|
break;
|
|
9193
9193
|
case "cvt ":
|
|
9194
|
-
|
|
9194
|
+
L = re(i, B), E = new _.Parser(L.data, L.offset), a.tables.cvt = E.parseShortList(B.length / 2);
|
|
9195
9195
|
break;
|
|
9196
9196
|
case "fvar":
|
|
9197
9197
|
d = B;
|
|
9198
9198
|
break;
|
|
9199
9199
|
case "fpgm":
|
|
9200
|
-
|
|
9200
|
+
L = re(i, B), E = new _.Parser(L.data, L.offset), a.tables.fpgm = E.parseByteList(B.length);
|
|
9201
9201
|
break;
|
|
9202
9202
|
case "head":
|
|
9203
|
-
|
|
9203
|
+
L = re(i, B), a.tables.head = ci.parse(L.data, L.offset), a.unitsPerEm = a.tables.head.unitsPerEm, r = a.tables.head.indexToLocFormat;
|
|
9204
9204
|
break;
|
|
9205
9205
|
case "hhea":
|
|
9206
|
-
|
|
9206
|
+
L = re(i, B), a.tables.hhea = ui.parse(L.data, L.offset), a.ascender = a.tables.hhea.ascender, a.descender = a.tables.hhea.descender, a.numberOfHMetrics = a.tables.hhea.numberOfHMetrics;
|
|
9207
9207
|
break;
|
|
9208
9208
|
case "hmtx":
|
|
9209
|
-
|
|
9209
|
+
S = B;
|
|
9210
9210
|
break;
|
|
9211
9211
|
case "ltag":
|
|
9212
|
-
|
|
9212
|
+
L = re(i, B), n = li.parse(L.data, L.offset);
|
|
9213
9213
|
break;
|
|
9214
9214
|
case "maxp":
|
|
9215
|
-
|
|
9215
|
+
L = re(i, B), a.tables.maxp = fi.parse(L.data, L.offset), a.numGlyphs = a.tables.maxp.numGlyphs;
|
|
9216
9216
|
break;
|
|
9217
9217
|
case "name":
|
|
9218
9218
|
w = B;
|
|
9219
9219
|
break;
|
|
9220
9220
|
case "OS/2":
|
|
9221
|
-
|
|
9221
|
+
L = re(i, B), a.tables.os2 = Xr.parse(L.data, L.offset);
|
|
9222
9222
|
break;
|
|
9223
9223
|
case "post":
|
|
9224
|
-
|
|
9224
|
+
L = re(i, B), a.tables.post = mi.parse(L.data, L.offset), a.glyphNames = new Jr(a.tables.post);
|
|
9225
9225
|
break;
|
|
9226
9226
|
case "prep":
|
|
9227
|
-
|
|
9227
|
+
L = re(i, B), E = new _.Parser(L.data, L.offset), a.tables.prep = E.parseByteList(B.length);
|
|
9228
9228
|
break;
|
|
9229
9229
|
case "glyf":
|
|
9230
9230
|
f = B;
|
|
@@ -9242,7 +9242,7 @@ function wh(t, e) {
|
|
|
9242
9242
|
g = B;
|
|
9243
9243
|
break;
|
|
9244
9244
|
case "GPOS":
|
|
9245
|
-
|
|
9245
|
+
x = B;
|
|
9246
9246
|
break;
|
|
9247
9247
|
case "GSUB":
|
|
9248
9248
|
v = B;
|
|
@@ -9261,7 +9261,7 @@ function wh(t, e) {
|
|
|
9261
9261
|
oi.parse(Y.data, Y.offset, a, e);
|
|
9262
9262
|
} else
|
|
9263
9263
|
throw new Error("Font doesn't contain TrueType or CFF outlines.");
|
|
9264
|
-
var Z = re(i,
|
|
9264
|
+
var Z = re(i, S);
|
|
9265
9265
|
if (hi.parse(a, Z.data, Z.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, e), Ms(a, e), m) {
|
|
9266
9266
|
var $ = re(i, m);
|
|
9267
9267
|
a.kerningPairs = mh.parse($.data, $.offset);
|
|
@@ -9271,8 +9271,8 @@ function wh(t, e) {
|
|
|
9271
9271
|
var te = re(i, g);
|
|
9272
9272
|
a.tables.gdef = hh.parse(te.data, te.offset);
|
|
9273
9273
|
}
|
|
9274
|
-
if (
|
|
9275
|
-
var se = re(i,
|
|
9274
|
+
if (x) {
|
|
9275
|
+
var se = re(i, x);
|
|
9276
9276
|
a.tables.gpos = dh.parse(se.data, se.offset), a.position.init();
|
|
9277
9277
|
}
|
|
9278
9278
|
if (v) {
|
|
@@ -9327,8 +9327,8 @@ function pa(t, e = !1) {
|
|
|
9327
9327
|
const d = [];
|
|
9328
9328
|
for (let f = 0; f < t.length; ++f) {
|
|
9329
9329
|
const g = t[f].index;
|
|
9330
|
-
for (let
|
|
9331
|
-
d.push(g.getX(
|
|
9330
|
+
for (let x = 0; x < g.count; ++x)
|
|
9331
|
+
d.push(g.getX(x) + h);
|
|
9332
9332
|
h += t[f].attributes.position.count;
|
|
9333
9333
|
}
|
|
9334
9334
|
c.setIndex(d);
|
|
@@ -9347,10 +9347,10 @@ function pa(t, e = !1) {
|
|
|
9347
9347
|
const g = [];
|
|
9348
9348
|
for (let v = 0; v < s[h].length; ++v)
|
|
9349
9349
|
g.push(s[h][v][f]);
|
|
9350
|
-
const
|
|
9351
|
-
if (!
|
|
9350
|
+
const x = da(g);
|
|
9351
|
+
if (!x)
|
|
9352
9352
|
return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + h + " morphAttribute."), null;
|
|
9353
|
-
c.morphAttributes[h].push(
|
|
9353
|
+
c.morphAttributes[h].push(x);
|
|
9354
9354
|
}
|
|
9355
9355
|
}
|
|
9356
9356
|
return c;
|
|
@@ -9376,9 +9376,9 @@ function da(t) {
|
|
|
9376
9376
|
if (h.isInterleavedBufferAttribute) {
|
|
9377
9377
|
const d = c / r;
|
|
9378
9378
|
for (let f = 0, g = h.count; f < g; f++)
|
|
9379
|
-
for (let
|
|
9380
|
-
const v = h.getComponent(f,
|
|
9381
|
-
o.setComponent(f + d,
|
|
9379
|
+
for (let x = 0; x < r; x++) {
|
|
9380
|
+
const v = h.getComponent(f, x);
|
|
9381
|
+
o.setComponent(f + d, x, v);
|
|
9382
9382
|
}
|
|
9383
9383
|
} else
|
|
9384
9384
|
s.set(h.array, c);
|
|
@@ -9392,35 +9392,35 @@ function Fh(t, e = 1e-4) {
|
|
|
9392
9392
|
let s = 0;
|
|
9393
9393
|
const o = Object.keys(t.attributes), c = {}, u = {}, h = [], d = ["getX", "getY", "getZ", "getW"], f = ["setX", "setY", "setZ", "setW"];
|
|
9394
9394
|
for (let F = 0, w = o.length; F < w; F++) {
|
|
9395
|
-
const k = o[F],
|
|
9396
|
-
c[k] = new
|
|
9397
|
-
new
|
|
9398
|
-
|
|
9399
|
-
|
|
9395
|
+
const k = o[F], E = t.attributes[k];
|
|
9396
|
+
c[k] = new E.constructor(
|
|
9397
|
+
new E.array.constructor(E.count * E.itemSize),
|
|
9398
|
+
E.itemSize,
|
|
9399
|
+
E.normalized
|
|
9400
9400
|
);
|
|
9401
|
-
const
|
|
9402
|
-
|
|
9401
|
+
const O = t.morphAttributes[k];
|
|
9402
|
+
O && (u[k] || (u[k] = []), O.forEach((B, L) => {
|
|
9403
9403
|
const H = new B.array.constructor(B.count * B.itemSize);
|
|
9404
|
-
u[k][
|
|
9404
|
+
u[k][L] = new B.constructor(H, B.itemSize, B.normalized);
|
|
9405
9405
|
}));
|
|
9406
9406
|
}
|
|
9407
|
-
const g = e * 0.5,
|
|
9407
|
+
const g = e * 0.5, x = Math.log10(1 / e), v = Math.pow(10, x), S = g * v;
|
|
9408
9408
|
for (let F = 0; F < i; F++) {
|
|
9409
9409
|
const w = n ? n.getX(F) : F;
|
|
9410
9410
|
let k = "";
|
|
9411
|
-
for (let
|
|
9412
|
-
const B = o[
|
|
9411
|
+
for (let E = 0, O = o.length; E < O; E++) {
|
|
9412
|
+
const B = o[E], L = t.getAttribute(B), H = L.itemSize;
|
|
9413
9413
|
for (let W = 0; W < H; W++)
|
|
9414
|
-
k += `${~~(
|
|
9414
|
+
k += `${~~(L[d[W]](w) * v + S)},`;
|
|
9415
9415
|
}
|
|
9416
9416
|
if (k in r)
|
|
9417
9417
|
h.push(r[k]);
|
|
9418
9418
|
else {
|
|
9419
|
-
for (let
|
|
9420
|
-
const B = o[
|
|
9419
|
+
for (let E = 0, O = o.length; E < O; E++) {
|
|
9420
|
+
const B = o[E], L = t.getAttribute(B), H = t.morphAttributes[B], W = L.itemSize, z = c[B], ce = u[B];
|
|
9421
9421
|
for (let ie = 0; ie < W; ie++) {
|
|
9422
9422
|
const Y = d[ie], Z = f[ie];
|
|
9423
|
-
if (z[Z](s,
|
|
9423
|
+
if (z[Z](s, L[Y](w)), H)
|
|
9424
9424
|
for (let $ = 0, te = H.length; $ < te; $++)
|
|
9425
9425
|
ce[$][Z](s, H[$][Y](w));
|
|
9426
9426
|
}
|
|
@@ -9437,17 +9437,17 @@ function Fh(t, e = 1e-4) {
|
|
|
9437
9437
|
w.normalized
|
|
9438
9438
|
)), F in u)
|
|
9439
9439
|
for (let k = 0; k < u[F].length; k++) {
|
|
9440
|
-
const
|
|
9441
|
-
m.morphAttributes[F][k] = new
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9440
|
+
const E = u[F][k];
|
|
9441
|
+
m.morphAttributes[F][k] = new E.constructor(
|
|
9442
|
+
E.array.slice(0, s * E.itemSize),
|
|
9443
|
+
E.itemSize,
|
|
9444
|
+
E.normalized
|
|
9445
9445
|
);
|
|
9446
9446
|
}
|
|
9447
9447
|
}
|
|
9448
9448
|
return m.setIndex(h), m;
|
|
9449
9449
|
}
|
|
9450
|
-
new
|
|
9450
|
+
new D.Vector2();
|
|
9451
9451
|
class ga extends Na {
|
|
9452
9452
|
constructor(e, r, n) {
|
|
9453
9453
|
super(), this.isFound = !1, this.char = e, this.fontSize = r, this.font = n, this.width = this.getCharWidth(e, r, n);
|
|
@@ -9464,7 +9464,7 @@ class ga extends Na {
|
|
|
9464
9464
|
);
|
|
9465
9465
|
if (e == null) {
|
|
9466
9466
|
const r = this.font.generateShapes(this.char, this.fontSize);
|
|
9467
|
-
return e = new
|
|
9467
|
+
return e = new D.ShapeGeometry(r, 4), e.hasAttribute("uv") && e.deleteAttribute("uv"), e.hasAttribute("normal") && e.deleteAttribute("normal"), Fh(e, 1e-6);
|
|
9468
9468
|
}
|
|
9469
9469
|
return e;
|
|
9470
9470
|
}
|
|
@@ -9500,41 +9500,41 @@ function Th(t, e, r) {
|
|
|
9500
9500
|
`)
|
|
9501
9501
|
o = 0, c -= i;
|
|
9502
9502
|
else {
|
|
9503
|
-
const d =
|
|
9503
|
+
const d = Eh(h, a, o, c, r);
|
|
9504
9504
|
o += d.offsetX, s.push(d.path);
|
|
9505
9505
|
}
|
|
9506
9506
|
}
|
|
9507
9507
|
return s;
|
|
9508
9508
|
}
|
|
9509
|
-
function
|
|
9509
|
+
function Eh(t, e, r, n, a) {
|
|
9510
9510
|
const i = a.glyphs[t] || a.glyphs["?"];
|
|
9511
9511
|
if (!i) {
|
|
9512
9512
|
console.error('THREE.Font: character "' + t + '" does not exists in font family ' + a.familyName + ".");
|
|
9513
9513
|
return;
|
|
9514
9514
|
}
|
|
9515
9515
|
const s = new Ia();
|
|
9516
|
-
let o, c, u, h, d, f, g,
|
|
9516
|
+
let o, c, u, h, d, f, g, x;
|
|
9517
9517
|
if (i.o) {
|
|
9518
9518
|
const v = i._cachedOutline || (i._cachedOutline = i.o.split(" "));
|
|
9519
|
-
for (let
|
|
9520
|
-
switch (v[
|
|
9519
|
+
for (let S = 0, m = v.length; S < m; )
|
|
9520
|
+
switch (v[S++]) {
|
|
9521
9521
|
case "m":
|
|
9522
|
-
o = v[
|
|
9522
|
+
o = v[S++] * e + r, c = v[S++] * e + n, s.moveTo(o, c);
|
|
9523
9523
|
break;
|
|
9524
9524
|
case "l":
|
|
9525
|
-
o = v[
|
|
9525
|
+
o = v[S++] * e + r, c = v[S++] * e + n, s.lineTo(o, c);
|
|
9526
9526
|
break;
|
|
9527
9527
|
case "q":
|
|
9528
|
-
u = v[
|
|
9528
|
+
u = v[S++] * e + r, h = v[S++] * e + n, d = v[S++] * e + r, f = v[S++] * e + n, s.quadraticCurveTo(d, f, u, h);
|
|
9529
9529
|
break;
|
|
9530
9530
|
case "b":
|
|
9531
|
-
u = v[
|
|
9531
|
+
u = v[S++] * e + r, h = v[S++] * e + n, d = v[S++] * e + r, f = v[S++] * e + n, g = v[S++] * e + r, x = v[S++] * e + n, s.bezierCurveTo(d, f, g, x, u, h);
|
|
9532
9532
|
break;
|
|
9533
9533
|
}
|
|
9534
9534
|
}
|
|
9535
9535
|
return { offsetX: i.ha * e, path: s };
|
|
9536
9536
|
}
|
|
9537
|
-
class
|
|
9537
|
+
class Ch extends kh {
|
|
9538
9538
|
/**
|
|
9539
9539
|
* Generates geometry shapes from the given text and size.
|
|
9540
9540
|
*
|
|
@@ -9610,7 +9610,7 @@ function Uh(t, e, r, n, a) {
|
|
|
9610
9610
|
let c = 0;
|
|
9611
9611
|
for (; c < o.length; ) {
|
|
9612
9612
|
const u = o[c++];
|
|
9613
|
-
let h, d, f, g,
|
|
9613
|
+
let h, d, f, g, x, v, S, m;
|
|
9614
9614
|
switch (u) {
|
|
9615
9615
|
case "m":
|
|
9616
9616
|
h = parseFloat(o[c++]) * e + r, d = parseFloat(o[c++]) * e + n, s.moveTo(h, d);
|
|
@@ -9619,10 +9619,10 @@ function Uh(t, e, r, n, a) {
|
|
|
9619
9619
|
h = parseFloat(o[c++]) * e + r, d = parseFloat(o[c++]) * e + n, s.lineTo(h, d);
|
|
9620
9620
|
break;
|
|
9621
9621
|
case "q":
|
|
9622
|
-
f = parseFloat(o[c++]) * e + r, g = parseFloat(o[c++]) * e + n,
|
|
9622
|
+
f = parseFloat(o[c++]) * e + r, g = parseFloat(o[c++]) * e + n, x = parseFloat(o[c++]) * e + r, v = parseFloat(o[c++]) * e + n, s.quadraticCurveTo(x, v, f, g);
|
|
9623
9623
|
break;
|
|
9624
9624
|
case "b":
|
|
9625
|
-
f = parseFloat(o[c++]) * e + r, g = parseFloat(o[c++]) * e + n,
|
|
9625
|
+
f = parseFloat(o[c++]) * e + r, g = parseFloat(o[c++]) * e + n, x = parseFloat(o[c++]) * e + r, v = parseFloat(o[c++]) * e + n, S = parseFloat(o[c++]) * e + r, m = parseFloat(o[c++]) * e + n, s.bezierCurveTo(x, v, S, m, f, g);
|
|
9626
9626
|
break;
|
|
9627
9627
|
}
|
|
9628
9628
|
}
|
|
@@ -9638,7 +9638,7 @@ function Bh(t, e) {
|
|
|
9638
9638
|
}
|
|
9639
9639
|
return r;
|
|
9640
9640
|
}
|
|
9641
|
-
function
|
|
9641
|
+
function Oh(t) {
|
|
9642
9642
|
const e = t.length, r = Array(e).fill(null);
|
|
9643
9643
|
for (let n = 0; n < e; n++) {
|
|
9644
9644
|
let a = null, i = 1 / 0;
|
|
@@ -9651,7 +9651,7 @@ function Lh(t) {
|
|
|
9651
9651
|
}
|
|
9652
9652
|
return r;
|
|
9653
9653
|
}
|
|
9654
|
-
function
|
|
9654
|
+
function Lh(t) {
|
|
9655
9655
|
const e = t.length, r = Array.from({ length: e }, () => []);
|
|
9656
9656
|
for (let n = 0; n < e; n++) {
|
|
9657
9657
|
const a = t[n];
|
|
@@ -9709,25 +9709,25 @@ function va(t, e) {
|
|
|
9709
9709
|
function Ih(t, e = 32) {
|
|
9710
9710
|
const r = t.subPaths;
|
|
9711
9711
|
if (!r || r.length === 0) return [];
|
|
9712
|
-
const n = r.map((g) => g.getPoints(e)), a =
|
|
9712
|
+
const n = r.map((g) => g.getPoints(e)), a = Oh(n), i = Lh(a), s = Rh(a), o = r.length, c = Array(o).fill(-1), u = Array(o).fill(-1);
|
|
9713
9713
|
for (const g of s) {
|
|
9714
|
-
const
|
|
9715
|
-
for (;
|
|
9716
|
-
const v =
|
|
9714
|
+
const x = [{ idx: g, d: 0 }];
|
|
9715
|
+
for (; x.length; ) {
|
|
9716
|
+
const v = x.pop();
|
|
9717
9717
|
c[v.idx] = v.d, u[v.idx] = g;
|
|
9718
|
-
for (const
|
|
9718
|
+
for (const S of i[v.idx]) x.push({ idx: S, d: v.d + 1 });
|
|
9719
9719
|
}
|
|
9720
9720
|
}
|
|
9721
9721
|
const h = [], d = /* @__PURE__ */ new Set();
|
|
9722
9722
|
function f(g) {
|
|
9723
|
-
const
|
|
9723
|
+
const x = va(r[g], !0);
|
|
9724
9724
|
d.add(g);
|
|
9725
9725
|
for (const v of i[g])
|
|
9726
9726
|
if (!d.has(v) && c[v] === c[g] + 1) {
|
|
9727
|
-
const
|
|
9728
|
-
|
|
9727
|
+
const S = va(r[v], !1);
|
|
9728
|
+
x.holes.push(S), d.add(v);
|
|
9729
9729
|
}
|
|
9730
|
-
h.push(
|
|
9730
|
+
h.push(x);
|
|
9731
9731
|
}
|
|
9732
9732
|
for (const g of s) f(g);
|
|
9733
9733
|
for (let g = 0; g < o; g++)
|
|
@@ -9773,7 +9773,7 @@ class _h extends Pa {
|
|
|
9773
9773
|
throw new Error(
|
|
9774
9774
|
"Invalid font cache data. Please remove font cache database named 'mlightcad' in IndexedDB and try again!"
|
|
9775
9775
|
);
|
|
9776
|
-
this.font = new
|
|
9776
|
+
this.font = new Ch(this.data);
|
|
9777
9777
|
}
|
|
9778
9778
|
/**
|
|
9779
9779
|
* Parses a mesh font from raw binary data.
|
|
@@ -10530,14 +10530,14 @@ class mt {
|
|
|
10530
10530
|
const { strokeWidth: r = "0.5%", strokeColor: n = "black", isAutoFit: a = !1 } = e;
|
|
10531
10531
|
let i, s;
|
|
10532
10532
|
if (a) {
|
|
10533
|
-
const o = this.bbox, c = 0.2, u = o.maxX - o.minX, h = o.maxY - o.minY, d = u === 0 ? h : u, f = h === 0 ? u : h, g = o.minX - d * c,
|
|
10533
|
+
const o = this.bbox, c = 0.2, u = o.maxX - o.minX, h = o.maxY - o.minY, d = u === 0 ? h : u, f = h === 0 ? u : h, g = o.minX - d * c, x = o.maxX + d * c, v = o.minY - f * c, S = o.maxY + f * c;
|
|
10534
10534
|
s = this.polylines.map((m) => {
|
|
10535
10535
|
let F = "";
|
|
10536
10536
|
return m.forEach((w, k) => {
|
|
10537
|
-
const
|
|
10538
|
-
F += k === 0 ? `M ${
|
|
10537
|
+
const E = w.x, O = -w.y;
|
|
10538
|
+
F += k === 0 ? `M ${E} ${O} ` : `L ${E} ${O} `;
|
|
10539
10539
|
}), `<path d="${F}" stroke="${n}" stroke-width="${r}" fill="none"/>`;
|
|
10540
|
-
}).join(""), i = `${g} ${-
|
|
10540
|
+
}).join(""), i = `${g} ${-S} ${x - g} ${S - v}`;
|
|
10541
10541
|
} else
|
|
10542
10542
|
i = "0 0 20 20", s = this.polylines.map((o) => {
|
|
10543
10543
|
let c = "";
|
|
@@ -10625,8 +10625,8 @@ class Vh {
|
|
|
10625
10625
|
h && (h.x *= u, h.y *= c);
|
|
10626
10626
|
const d = e.polylines.map(
|
|
10627
10627
|
(f) => f.map((g) => {
|
|
10628
|
-
const
|
|
10629
|
-
return
|
|
10628
|
+
const x = g.clone();
|
|
10629
|
+
return x.x *= u, x.y *= c, x;
|
|
10630
10630
|
})
|
|
10631
10631
|
);
|
|
10632
10632
|
return new mt(h, d);
|
|
@@ -10815,8 +10815,8 @@ class Vh {
|
|
|
10815
10815
|
let u = o & 7;
|
|
10816
10816
|
const h = o < 0, d = Math.PI / 4 * c, f = n.currentPoint.clone().subtract(new J(Math.cos(d) * s, Math.sin(d) * s)), g = Ft.fromOctant(f, s, c, u, h);
|
|
10817
10817
|
if (n.isPenDown) {
|
|
10818
|
-
const
|
|
10819
|
-
n.currentPolyline.pop(), n.currentPolyline.push(...
|
|
10818
|
+
const x = g.tessellate();
|
|
10819
|
+
n.currentPolyline.pop(), n.currentPolyline.push(...x.slice());
|
|
10820
10820
|
}
|
|
10821
10821
|
return n.currentPoint = (a = g.tessellate().pop()) == null ? void 0 : a.clone(), i;
|
|
10822
10822
|
}
|
|
@@ -10826,27 +10826,27 @@ class Vh {
|
|
|
10826
10826
|
let f = h & 7;
|
|
10827
10827
|
f === 0 && (f = 8), s !== 0 && f--;
|
|
10828
10828
|
const g = Math.PI / 4;
|
|
10829
|
-
let
|
|
10830
|
-
h < 0 && (v = -v,
|
|
10831
|
-
let m = g * d, F = m +
|
|
10832
|
-
m += g * i / 256 *
|
|
10829
|
+
let x = g * f, v = qh, S = 1;
|
|
10830
|
+
h < 0 && (v = -v, x = -x, S = -1);
|
|
10831
|
+
let m = g * d, F = m + x;
|
|
10832
|
+
m += g * i / 256 * S, F += g * s / 256 * S;
|
|
10833
10833
|
const w = n.currentPoint.clone().subtract(new J(u * Math.cos(m), u * Math.sin(m)));
|
|
10834
10834
|
if (n.currentPoint = w.clone().add(new J(u * Math.cos(F), u * Math.sin(F))), n.isPenDown) {
|
|
10835
10835
|
let k = m;
|
|
10836
|
-
const
|
|
10837
|
-
if (
|
|
10836
|
+
const E = [];
|
|
10837
|
+
if (E.push(
|
|
10838
10838
|
w.clone().add(new J(u * Math.cos(k), u * Math.sin(k)))
|
|
10839
10839
|
), v > 0)
|
|
10840
10840
|
for (; k + v < F; )
|
|
10841
|
-
k += v,
|
|
10841
|
+
k += v, E.push(
|
|
10842
10842
|
w.clone().add(new J(u * Math.cos(k), u * Math.sin(k)))
|
|
10843
10843
|
);
|
|
10844
10844
|
else
|
|
10845
10845
|
for (; k + v > F; )
|
|
10846
|
-
k += v,
|
|
10846
|
+
k += v, E.push(
|
|
10847
10847
|
w.clone().add(new J(u * Math.cos(k), u * Math.sin(k)))
|
|
10848
10848
|
);
|
|
10849
|
-
|
|
10849
|
+
E.push(w.clone().add(new J(u * Math.cos(F), u * Math.sin(F)))), n.currentPolyline.push(...E);
|
|
10850
10850
|
}
|
|
10851
10851
|
return a;
|
|
10852
10852
|
}
|
|
@@ -11044,9 +11044,9 @@ var Mi = { exports: {} }, on = {}, rr = {};
|
|
|
11044
11044
|
rr.byteLength = Kh;
|
|
11045
11045
|
rr.toByteArray = Jh;
|
|
11046
11046
|
rr.fromByteArray = rl;
|
|
11047
|
-
var
|
|
11048
|
-
for (var
|
|
11049
|
-
|
|
11047
|
+
var Oe = [], ye = [], Zh = typeof Uint8Array < "u" ? Uint8Array : Array, yr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
11048
|
+
for (var it = 0, $h = yr.length; it < $h; ++it)
|
|
11049
|
+
Oe[it] = yr[it], ye[yr.charCodeAt(it)] = it;
|
|
11050
11050
|
ye[45] = 62;
|
|
11051
11051
|
ye[95] = 63;
|
|
11052
11052
|
function Ii(t) {
|
|
@@ -11072,7 +11072,7 @@ function Jh(t) {
|
|
|
11072
11072
|
return a === 2 && (e = ye[t.charCodeAt(c)] << 2 | ye[t.charCodeAt(c + 1)] >> 4, i[s++] = e & 255), a === 1 && (e = ye[t.charCodeAt(c)] << 10 | ye[t.charCodeAt(c + 1)] << 4 | ye[t.charCodeAt(c + 2)] >> 2, i[s++] = e >> 8 & 255, i[s++] = e & 255), i;
|
|
11073
11073
|
}
|
|
11074
11074
|
function el(t) {
|
|
11075
|
-
return
|
|
11075
|
+
return Oe[t >> 18 & 63] + Oe[t >> 12 & 63] + Oe[t >> 6 & 63] + Oe[t & 63];
|
|
11076
11076
|
}
|
|
11077
11077
|
function tl(t, e, r) {
|
|
11078
11078
|
for (var n, a = [], i = e; i < r; i += 3)
|
|
@@ -11083,9 +11083,9 @@ function rl(t) {
|
|
|
11083
11083
|
for (var e, r = t.length, n = r % 3, a = [], i = 16383, s = 0, o = r - n; s < o; s += i)
|
|
11084
11084
|
a.push(tl(t, s, s + i > o ? o : s + i));
|
|
11085
11085
|
return n === 1 ? (e = t[r - 1], a.push(
|
|
11086
|
-
|
|
11086
|
+
Oe[e >> 2] + Oe[e << 4 & 63] + "=="
|
|
11087
11087
|
)) : n === 2 && (e = (t[r - 2] << 8) + t[r - 1], a.push(
|
|
11088
|
-
|
|
11088
|
+
Oe[e >> 10] + Oe[e >> 4 & 63] + Oe[e << 2 & 63] + "="
|
|
11089
11089
|
)), a.join("");
|
|
11090
11090
|
}
|
|
11091
11091
|
var cn = {};
|
|
@@ -11106,12 +11106,12 @@ cn.read = function(t, e, r, n, a) {
|
|
|
11106
11106
|
return (g ? -1 : 1) * s * Math.pow(2, i - n);
|
|
11107
11107
|
};
|
|
11108
11108
|
cn.write = function(t, e, r, n, a, i) {
|
|
11109
|
-
var s, o, c, u = i * 8 - a - 1, h = (1 << u) - 1, d = h >> 1, f = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = n ? 0 : i - 1,
|
|
11110
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (o = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (c = Math.pow(2, -s)) < 1 && (s--, c *= 2), s + d >= 1 ? e += f / c : e += f * Math.pow(2, 1 - d), e * c >= 2 && (s++, c /= 2), s + d >= h ? (o = 0, s = h) : s + d >= 1 ? (o = (e * c - 1) * Math.pow(2, a), s = s + d) : (o = e * Math.pow(2, d - 1) * Math.pow(2, a), s = 0)); a >= 8; t[r + g] = o & 255, g +=
|
|
11109
|
+
var s, o, c, u = i * 8 - a - 1, h = (1 << u) - 1, d = h >> 1, f = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, g = n ? 0 : i - 1, x = n ? 1 : -1, v = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
11110
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (o = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (c = Math.pow(2, -s)) < 1 && (s--, c *= 2), s + d >= 1 ? e += f / c : e += f * Math.pow(2, 1 - d), e * c >= 2 && (s++, c /= 2), s + d >= h ? (o = 0, s = h) : s + d >= 1 ? (o = (e * c - 1) * Math.pow(2, a), s = s + d) : (o = e * Math.pow(2, d - 1) * Math.pow(2, a), s = 0)); a >= 8; t[r + g] = o & 255, g += x, o /= 256, a -= 8)
|
|
11111
11111
|
;
|
|
11112
|
-
for (s = s << a | o, u += a; u > 0; t[r + g] = s & 255, g +=
|
|
11112
|
+
for (s = s << a | o, u += a; u > 0; t[r + g] = s & 255, g += x, s /= 256, u -= 8)
|
|
11113
11113
|
;
|
|
11114
|
-
t[r + g -
|
|
11114
|
+
t[r + g - x] |= v * 128;
|
|
11115
11115
|
};
|
|
11116
11116
|
/*!
|
|
11117
11117
|
* The buffer module from node.js, for the browser.
|
|
@@ -11170,7 +11170,7 @@ cn.write = function(t, e, r, n, a, i) {
|
|
|
11170
11170
|
if (typeof y == "string")
|
|
11171
11171
|
return f(y, l);
|
|
11172
11172
|
if (ArrayBuffer.isView(y))
|
|
11173
|
-
return
|
|
11173
|
+
return x(y);
|
|
11174
11174
|
if (y == null)
|
|
11175
11175
|
throw new TypeError(
|
|
11176
11176
|
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof y
|
|
@@ -11184,7 +11184,7 @@ cn.write = function(t, e, r, n, a, i) {
|
|
|
11184
11184
|
var b = y.valueOf && y.valueOf();
|
|
11185
11185
|
if (b != null && b !== y)
|
|
11186
11186
|
return o.from(b, l, p);
|
|
11187
|
-
var T =
|
|
11187
|
+
var T = S(y);
|
|
11188
11188
|
if (T) return T;
|
|
11189
11189
|
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof y[Symbol.toPrimitive] == "function")
|
|
11190
11190
|
return o.from(
|
|
@@ -11230,7 +11230,7 @@ cn.write = function(t, e, r, n, a, i) {
|
|
|
11230
11230
|
p[b] = y[b] & 255;
|
|
11231
11231
|
return p;
|
|
11232
11232
|
}
|
|
11233
|
-
function
|
|
11233
|
+
function x(y) {
|
|
11234
11234
|
if (Ae(y, Uint8Array)) {
|
|
11235
11235
|
var l = new Uint8Array(y);
|
|
11236
11236
|
return v(l.buffer, l.byteOffset, l.byteLength);
|
|
@@ -11245,7 +11245,7 @@ cn.write = function(t, e, r, n, a, i) {
|
|
|
11245
11245
|
var b;
|
|
11246
11246
|
return l === void 0 && p === void 0 ? b = new Uint8Array(y) : p === void 0 ? b = new Uint8Array(y, l) : b = new Uint8Array(y, l, p), Object.setPrototypeOf(b, o.prototype), b;
|
|
11247
11247
|
}
|
|
11248
|
-
function
|
|
11248
|
+
function S(y) {
|
|
11249
11249
|
if (o.isBuffer(y)) {
|
|
11250
11250
|
var l = m(y.length) | 0, p = s(l);
|
|
11251
11251
|
return p.length === 0 || y.copy(p, 0, 0, l), p;
|
|
@@ -11385,7 +11385,7 @@ cn.write = function(t, e, r, n, a, i) {
|
|
|
11385
11385
|
}
|
|
11386
11386
|
}
|
|
11387
11387
|
o.prototype._isBuffer = !0;
|
|
11388
|
-
function
|
|
11388
|
+
function E(y, l, p) {
|
|
11389
11389
|
var b = y[l];
|
|
11390
11390
|
y[l] = y[p], y[p] = b;
|
|
11391
11391
|
}
|
|
@@ -11394,21 +11394,21 @@ cn.write = function(t, e, r, n, a, i) {
|
|
|
11394
11394
|
if (l % 2 !== 0)
|
|
11395
11395
|
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
11396
11396
|
for (var p = 0; p < l; p += 2)
|
|
11397
|
-
|
|
11397
|
+
E(this, p, p + 1);
|
|
11398
11398
|
return this;
|
|
11399
11399
|
}, o.prototype.swap32 = function() {
|
|
11400
11400
|
var l = this.length;
|
|
11401
11401
|
if (l % 4 !== 0)
|
|
11402
11402
|
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
11403
11403
|
for (var p = 0; p < l; p += 4)
|
|
11404
|
-
|
|
11404
|
+
E(this, p, p + 3), E(this, p + 1, p + 2);
|
|
11405
11405
|
return this;
|
|
11406
11406
|
}, o.prototype.swap64 = function() {
|
|
11407
11407
|
var l = this.length;
|
|
11408
11408
|
if (l % 8 !== 0)
|
|
11409
11409
|
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
11410
11410
|
for (var p = 0; p < l; p += 8)
|
|
11411
|
-
|
|
11411
|
+
E(this, p, p + 7), E(this, p + 1, p + 6), E(this, p + 2, p + 5), E(this, p + 3, p + 4);
|
|
11412
11412
|
return this;
|
|
11413
11413
|
}, o.prototype.toString = function() {
|
|
11414
11414
|
var l = this.length;
|
|
@@ -11440,7 +11440,7 @@ cn.write = function(t, e, r, n, a, i) {
|
|
|
11440
11440
|
}
|
|
11441
11441
|
return U < q ? -1 : q < U ? 1 : 0;
|
|
11442
11442
|
};
|
|
11443
|
-
function
|
|
11443
|
+
function O(y, l, p, b, T) {
|
|
11444
11444
|
if (y.length === 0) return -1;
|
|
11445
11445
|
if (typeof p == "string" ? (b = p, p = 0) : p > 2147483647 ? p = 2147483647 : p < -2147483648 && (p = -2147483648), p = +p, nr(p) && (p = T ? 0 : y.length - 1), p < 0 && (p = y.length + p), p >= y.length) {
|
|
11446
11446
|
if (T) return -1;
|
|
@@ -11486,11 +11486,11 @@ cn.write = function(t, e, r, n, a, i) {
|
|
|
11486
11486
|
o.prototype.includes = function(l, p, b) {
|
|
11487
11487
|
return this.indexOf(l, p, b) !== -1;
|
|
11488
11488
|
}, o.prototype.indexOf = function(l, p, b) {
|
|
11489
|
-
return
|
|
11489
|
+
return O(this, l, p, b, !0);
|
|
11490
11490
|
}, o.prototype.lastIndexOf = function(l, p, b) {
|
|
11491
|
-
return
|
|
11491
|
+
return O(this, l, p, b, !1);
|
|
11492
11492
|
};
|
|
11493
|
-
function
|
|
11493
|
+
function L(y, l, p, b) {
|
|
11494
11494
|
p = Number(p) || 0;
|
|
11495
11495
|
var T = y.length - p;
|
|
11496
11496
|
b ? (b = Number(b), b > T && (b = T)) : b = T;
|
|
@@ -11533,7 +11533,7 @@ cn.write = function(t, e, r, n, a, i) {
|
|
|
11533
11533
|
for (var U = !1; ; )
|
|
11534
11534
|
switch (T) {
|
|
11535
11535
|
case "hex":
|
|
11536
|
-
return
|
|
11536
|
+
return L(this, l, p, b);
|
|
11537
11537
|
case "utf8":
|
|
11538
11538
|
case "utf-8":
|
|
11539
11539
|
return H(this, l, p, b);
|
|
@@ -11748,25 +11748,25 @@ cn.write = function(t, e, r, n, a, i) {
|
|
|
11748
11748
|
}, o.prototype.writeInt32BE = function(l, p, b) {
|
|
11749
11749
|
return l = +l, p = p >>> 0, b || V(this, l, p, 4, 2147483647, -2147483648), l < 0 && (l = 4294967295 + l + 1), this[p] = l >>> 24, this[p + 1] = l >>> 16, this[p + 2] = l >>> 8, this[p + 3] = l & 255, p + 4;
|
|
11750
11750
|
};
|
|
11751
|
-
function
|
|
11751
|
+
function nt(y, l, p, b, T, A) {
|
|
11752
11752
|
if (p + b > y.length) throw new RangeError("Index out of range");
|
|
11753
11753
|
if (p < 0) throw new RangeError("Index out of range");
|
|
11754
11754
|
}
|
|
11755
11755
|
function Bt(y, l, p, b, T) {
|
|
11756
|
-
return l = +l, p = p >>> 0, T ||
|
|
11756
|
+
return l = +l, p = p >>> 0, T || nt(y, l, p, 4), r.write(y, l, p, b, 23, 4), p + 4;
|
|
11757
11757
|
}
|
|
11758
11758
|
o.prototype.writeFloatLE = function(l, p, b) {
|
|
11759
11759
|
return Bt(this, l, p, !0, b);
|
|
11760
11760
|
}, o.prototype.writeFloatBE = function(l, p, b) {
|
|
11761
11761
|
return Bt(this, l, p, !1, b);
|
|
11762
11762
|
};
|
|
11763
|
-
function
|
|
11764
|
-
return l = +l, p = p >>> 0, T ||
|
|
11763
|
+
function Ot(y, l, p, b, T) {
|
|
11764
|
+
return l = +l, p = p >>> 0, T || nt(y, l, p, 8), r.write(y, l, p, b, 52, 8), p + 8;
|
|
11765
11765
|
}
|
|
11766
11766
|
o.prototype.writeDoubleLE = function(l, p, b) {
|
|
11767
|
-
return
|
|
11767
|
+
return Ot(this, l, p, !0, b);
|
|
11768
11768
|
}, o.prototype.writeDoubleBE = function(l, p, b) {
|
|
11769
|
-
return
|
|
11769
|
+
return Ot(this, l, p, !1, b);
|
|
11770
11770
|
}, o.prototype.copy = function(l, p, b, T) {
|
|
11771
11771
|
if (!o.isBuffer(l)) throw new TypeError("argument should be a Buffer");
|
|
11772
11772
|
if (b || (b = 0), !T && T !== 0 && (T = this.length), p >= l.length && (p = l.length), p || (p = 0), T > 0 && T < b && (T = b), T === b || l.length === 0 || this.length === 0) return 0;
|
|
@@ -11811,7 +11811,7 @@ cn.write = function(t, e, r, n, a, i) {
|
|
|
11811
11811
|
return this;
|
|
11812
11812
|
};
|
|
11813
11813
|
var ft = /[^+/0-9A-Za-z-_]/g;
|
|
11814
|
-
function
|
|
11814
|
+
function Lt(y) {
|
|
11815
11815
|
if (y = y.split("=")[0], y = y.trim().replace(ft, ""), y.length < 2) return "";
|
|
11816
11816
|
for (; y.length % 4 !== 0; )
|
|
11817
11817
|
y = y + "=";
|
|
@@ -11878,7 +11878,7 @@ cn.write = function(t, e, r, n, a, i) {
|
|
|
11878
11878
|
return A;
|
|
11879
11879
|
}
|
|
11880
11880
|
function gn(y) {
|
|
11881
|
-
return e.toByteArray(
|
|
11881
|
+
return e.toByteArray(Lt(y));
|
|
11882
11882
|
}
|
|
11883
11883
|
function Rt(y, l, p, b) {
|
|
11884
11884
|
for (var T = 0; T < b && !(T + p >= l.length || T >= y.length); ++T)
|
|
@@ -11928,7 +11928,7 @@ if (!me.kStringMaxLength)
|
|
|
11928
11928
|
me.constants || (me.constants = {
|
|
11929
11929
|
MAX_LENGTH: me.kMaxLength
|
|
11930
11930
|
}, me.kStringMaxLength && (me.constants.MAX_STRING_LENGTH = me.kStringMaxLength));
|
|
11931
|
-
var
|
|
11931
|
+
var Ye = me, un = {}, Di = "\uFEFF";
|
|
11932
11932
|
un.PrependBOM = hn;
|
|
11933
11933
|
function hn(t, e) {
|
|
11934
11934
|
this.encoder = t, this.addBOM = !0;
|
|
@@ -12052,10 +12052,10 @@ function sl() {
|
|
|
12052
12052
|
this.fillLast = c, F = 4;
|
|
12053
12053
|
break;
|
|
12054
12054
|
case "base64":
|
|
12055
|
-
this.text = g, this.end =
|
|
12055
|
+
this.text = g, this.end = x, F = 3;
|
|
12056
12056
|
break;
|
|
12057
12057
|
default:
|
|
12058
|
-
this.write = v, this.end =
|
|
12058
|
+
this.write = v, this.end = S;
|
|
12059
12059
|
return;
|
|
12060
12060
|
}
|
|
12061
12061
|
this.lastNeed = 0, this.lastTotal = 0, this.lastChar = t.allocUnsafe(F);
|
|
@@ -12080,8 +12080,8 @@ function sl() {
|
|
|
12080
12080
|
function s(m, F, w) {
|
|
12081
12081
|
var k = F.length - 1;
|
|
12082
12082
|
if (k < w) return 0;
|
|
12083
|
-
var
|
|
12084
|
-
return
|
|
12083
|
+
var E = i(F[k]);
|
|
12084
|
+
return E >= 0 ? (E > 0 && (m.lastNeed = E - 1), E) : --k < w || E === -2 ? 0 : (E = i(F[k]), E >= 0 ? (E > 0 && (m.lastNeed = E - 2), E) : --k < w || E === -2 ? 0 : (E = i(F[k]), E >= 0 ? (E > 0 && (E === 2 ? E = 0 : m.lastNeed = E - 3), E) : 0));
|
|
12085
12085
|
}
|
|
12086
12086
|
function o(m, F, w) {
|
|
12087
12087
|
if ((F[0] & 192) !== 128)
|
|
@@ -12135,14 +12135,14 @@ function sl() {
|
|
|
12135
12135
|
var w = (m.length - F) % 3;
|
|
12136
12136
|
return w === 0 ? m.toString("base64", F) : (this.lastNeed = 3 - w, this.lastTotal = 3, w === 1 ? this.lastChar[0] = m[m.length - 1] : (this.lastChar[0] = m[m.length - 2], this.lastChar[1] = m[m.length - 1]), m.toString("base64", F, m.length - w));
|
|
12137
12137
|
}
|
|
12138
|
-
function
|
|
12138
|
+
function x(m) {
|
|
12139
12139
|
var F = m && m.length ? this.write(m) : "";
|
|
12140
12140
|
return this.lastNeed ? F + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : F;
|
|
12141
12141
|
}
|
|
12142
12142
|
function v(m) {
|
|
12143
12143
|
return m.toString(this.encoding);
|
|
12144
12144
|
}
|
|
12145
|
-
function
|
|
12145
|
+
function S(m) {
|
|
12146
12146
|
return m && m.length ? this.write(m) : "";
|
|
12147
12147
|
}
|
|
12148
12148
|
return br;
|
|
@@ -12151,7 +12151,7 @@ var xr, xa;
|
|
|
12151
12151
|
function ol() {
|
|
12152
12152
|
if (xa) return xr;
|
|
12153
12153
|
xa = 1;
|
|
12154
|
-
var t =
|
|
12154
|
+
var t = Ye.Buffer;
|
|
12155
12155
|
xr = {
|
|
12156
12156
|
// Encodings
|
|
12157
12157
|
utf8: { type: "_internal", bomAware: !0 },
|
|
@@ -12209,8 +12209,8 @@ function ol() {
|
|
|
12209
12209
|
this.acc = 0, this.contBytes = 0, this.accBytes = 0, this.defaultCharUnicode = h.defaultCharUnicode;
|
|
12210
12210
|
}
|
|
12211
12211
|
o.prototype.write = function(u) {
|
|
12212
|
-
for (var h = this.acc, d = this.contBytes, f = this.accBytes, g = "",
|
|
12213
|
-
var v = u[
|
|
12212
|
+
for (var h = this.acc, d = this.contBytes, f = this.accBytes, g = "", x = 0; x < u.length; x++) {
|
|
12213
|
+
var v = u[x];
|
|
12214
12214
|
(v & 192) !== 128 ? (d > 0 && (g += this.defaultCharUnicode, d = 0), v < 128 ? g += String.fromCharCode(v) : v < 224 ? (h = v & 31, d = 1, f = 1) : v < 240 ? (h = v & 15, d = 2, f = 1) : g += this.defaultCharUnicode) : d > 0 ? (h = h << 6 | v & 63, d--, f++, d === 0 && (f === 2 && h < 128 && h > 0 ? g += this.defaultCharUnicode : f === 3 && h < 2048 ? g += this.defaultCharUnicode : g += String.fromCharCode(h))) : g += this.defaultCharUnicode;
|
|
12215
12215
|
}
|
|
12216
12216
|
return this.acc = h, this.contBytes = d, this.accBytes = f, g;
|
|
@@ -12238,7 +12238,7 @@ var Ie = {}, Sa;
|
|
|
12238
12238
|
function cl() {
|
|
12239
12239
|
if (Sa) return Ie;
|
|
12240
12240
|
Sa = 1;
|
|
12241
|
-
var t =
|
|
12241
|
+
var t = Ye.Buffer;
|
|
12242
12242
|
Ie._utf32 = e;
|
|
12243
12243
|
function e(u, h) {
|
|
12244
12244
|
this.iconv = h, this.bomAware = !0, this.isLE = u.isLE;
|
|
@@ -12248,17 +12248,17 @@ function cl() {
|
|
|
12248
12248
|
this.isLE = h.isLE, this.highSurrogate = 0;
|
|
12249
12249
|
}
|
|
12250
12250
|
r.prototype.write = function(u) {
|
|
12251
|
-
for (var h = t.from(u, "ucs2"), d = t.alloc(h.length * 2), f = this.isLE ? d.writeUInt32LE : d.writeUInt32BE, g = 0,
|
|
12252
|
-
var v = h.readUInt16LE(
|
|
12251
|
+
for (var h = t.from(u, "ucs2"), d = t.alloc(h.length * 2), f = this.isLE ? d.writeUInt32LE : d.writeUInt32BE, g = 0, x = 0; x < h.length; x += 2) {
|
|
12252
|
+
var v = h.readUInt16LE(x), S = v >= 55296 && v < 56320, m = v >= 56320 && v < 57344;
|
|
12253
12253
|
if (this.highSurrogate)
|
|
12254
|
-
if (
|
|
12254
|
+
if (S || !m)
|
|
12255
12255
|
f.call(d, this.highSurrogate, g), g += 4;
|
|
12256
12256
|
else {
|
|
12257
12257
|
var F = (this.highSurrogate - 55296 << 10 | v - 56320) + 65536;
|
|
12258
12258
|
f.call(d, F, g), g += 4, this.highSurrogate = 0;
|
|
12259
12259
|
continue;
|
|
12260
12260
|
}
|
|
12261
|
-
|
|
12261
|
+
S ? this.highSurrogate = v : (f.call(d, v, g), g += 4, this.highSurrogate = 0);
|
|
12262
12262
|
}
|
|
12263
12263
|
return g < d.length && (d = d.slice(0, g)), d;
|
|
12264
12264
|
}, r.prototype.end = function() {
|
|
@@ -12273,14 +12273,14 @@ function cl() {
|
|
|
12273
12273
|
n.prototype.write = function(u) {
|
|
12274
12274
|
if (u.length === 0)
|
|
12275
12275
|
return "";
|
|
12276
|
-
var h = 0, d = 0, f = t.alloc(u.length + 4), g = 0,
|
|
12276
|
+
var h = 0, d = 0, f = t.alloc(u.length + 4), g = 0, x = this.isLE, v = this.overflow, S = this.badChar;
|
|
12277
12277
|
if (v.length > 0) {
|
|
12278
12278
|
for (; h < u.length && v.length < 4; h++)
|
|
12279
12279
|
v.push(u[h]);
|
|
12280
|
-
v.length === 4 && (
|
|
12280
|
+
v.length === 4 && (x ? d = v[h] | v[h + 1] << 8 | v[h + 2] << 16 | v[h + 3] << 24 : d = v[h + 3] | v[h + 2] << 8 | v[h + 1] << 16 | v[h] << 24, v.length = 0, g = a(f, g, d, S));
|
|
12281
12281
|
}
|
|
12282
12282
|
for (; h < u.length - 3; h += 4)
|
|
12283
|
-
|
|
12283
|
+
x ? d = u[h] | u[h + 1] << 8 | u[h + 2] << 16 | u[h + 3] << 24 : d = u[h + 3] | u[h + 2] << 8 | u[h + 1] << 16 | u[h] << 24, g = a(f, g, d, S);
|
|
12284
12284
|
for (; h < u.length; h++)
|
|
12285
12285
|
v.push(u[h]);
|
|
12286
12286
|
return f.slice(0, g).toString("ucs2");
|
|
@@ -12335,7 +12335,7 @@ function cl() {
|
|
|
12335
12335
|
return this.decoder.end();
|
|
12336
12336
|
};
|
|
12337
12337
|
function c(u, h) {
|
|
12338
|
-
var d = [], f = 0, g = 0,
|
|
12338
|
+
var d = [], f = 0, g = 0, x = 0, v = 0, S = 0;
|
|
12339
12339
|
e:
|
|
12340
12340
|
for (var m = 0; m < u.length; m++)
|
|
12341
12341
|
for (var F = u[m], w = 0; w < F.length; w++)
|
|
@@ -12346,10 +12346,10 @@ function cl() {
|
|
|
12346
12346
|
if (d[0] === 0 && d[1] === 0 && d[2] === 254 && d[3] === 255)
|
|
12347
12347
|
return "utf-32be";
|
|
12348
12348
|
}
|
|
12349
|
-
if ((d[0] !== 0 || d[1] > 16) &&
|
|
12349
|
+
if ((d[0] !== 0 || d[1] > 16) && x++, (d[3] !== 0 || d[2] > 16) && g++, d[0] === 0 && d[1] === 0 && (d[2] !== 0 || d[3] !== 0) && S++, (d[0] !== 0 || d[1] !== 0) && d[2] === 0 && d[3] === 0 && v++, d.length = 0, f++, f >= 100)
|
|
12350
12350
|
break e;
|
|
12351
12351
|
}
|
|
12352
|
-
return
|
|
12352
|
+
return S - x > v - g ? "utf-32be" : S - x < v - g ? "utf-32le" : h || "utf-32le";
|
|
12353
12353
|
}
|
|
12354
12354
|
return Ie;
|
|
12355
12355
|
}
|
|
@@ -12357,7 +12357,7 @@ var Ht = {}, wa;
|
|
|
12357
12357
|
function ul() {
|
|
12358
12358
|
if (wa) return Ht;
|
|
12359
12359
|
wa = 1;
|
|
12360
|
-
var t =
|
|
12360
|
+
var t = Ye.Buffer;
|
|
12361
12361
|
Ht.utf16be = e;
|
|
12362
12362
|
function e() {
|
|
12363
12363
|
}
|
|
@@ -12425,9 +12425,9 @@ function ul() {
|
|
|
12425
12425
|
function o(c, u) {
|
|
12426
12426
|
var h = [], d = 0, f = 0, g = 0;
|
|
12427
12427
|
e:
|
|
12428
|
-
for (var
|
|
12429
|
-
for (var v = c[
|
|
12430
|
-
if (h.push(v[
|
|
12428
|
+
for (var x = 0; x < c.length; x++)
|
|
12429
|
+
for (var v = c[x], S = 0; S < v.length; S++)
|
|
12430
|
+
if (h.push(v[S]), h.length === 2) {
|
|
12431
12431
|
if (d === 0) {
|
|
12432
12432
|
if (h[0] === 255 && h[1] === 254) return "utf-16le";
|
|
12433
12433
|
if (h[0] === 254 && h[1] === 255) return "utf-16be";
|
|
@@ -12443,93 +12443,93 @@ var dt = {}, Fa;
|
|
|
12443
12443
|
function hl() {
|
|
12444
12444
|
if (Fa) return dt;
|
|
12445
12445
|
Fa = 1;
|
|
12446
|
-
var t =
|
|
12446
|
+
var t = Ye.Buffer;
|
|
12447
12447
|
dt.utf7 = e, dt.unicode11utf7 = "utf7";
|
|
12448
|
-
function e(v,
|
|
12449
|
-
this.iconv =
|
|
12448
|
+
function e(v, S) {
|
|
12449
|
+
this.iconv = S;
|
|
12450
12450
|
}
|
|
12451
12451
|
e.prototype.encoder = n, e.prototype.decoder = a, e.prototype.bomAware = !0;
|
|
12452
12452
|
var r = /[^A-Za-z0-9'\(\),-\.\/:\? \n\r\t]+/g;
|
|
12453
|
-
function n(v,
|
|
12454
|
-
this.iconv =
|
|
12453
|
+
function n(v, S) {
|
|
12454
|
+
this.iconv = S.iconv;
|
|
12455
12455
|
}
|
|
12456
12456
|
n.prototype.write = function(v) {
|
|
12457
|
-
return t.from(v.replace(r, (function(
|
|
12458
|
-
return "+" + (
|
|
12457
|
+
return t.from(v.replace(r, (function(S) {
|
|
12458
|
+
return "+" + (S === "+" ? "" : this.iconv.encode(S, "utf16-be").toString("base64").replace(/=+$/, "")) + "-";
|
|
12459
12459
|
}).bind(this)));
|
|
12460
12460
|
}, n.prototype.end = function() {
|
|
12461
12461
|
};
|
|
12462
|
-
function a(v,
|
|
12463
|
-
this.iconv =
|
|
12462
|
+
function a(v, S) {
|
|
12463
|
+
this.iconv = S.iconv, this.inBase64 = !1, this.base64Accum = "";
|
|
12464
12464
|
}
|
|
12465
12465
|
for (var i = /[A-Za-z0-9\/+]/, s = [], o = 0; o < 256; o++)
|
|
12466
12466
|
s[o] = i.test(String.fromCharCode(o));
|
|
12467
12467
|
var c = 43, u = 45, h = 38;
|
|
12468
12468
|
a.prototype.write = function(v) {
|
|
12469
|
-
for (var
|
|
12469
|
+
for (var S = "", m = 0, F = this.inBase64, w = this.base64Accum, k = 0; k < v.length; k++)
|
|
12470
12470
|
if (!F)
|
|
12471
|
-
v[k] == c && (
|
|
12471
|
+
v[k] == c && (S += this.iconv.decode(v.slice(m, k), "ascii"), m = k + 1, F = !0);
|
|
12472
12472
|
else if (!s[v[k]]) {
|
|
12473
12473
|
if (k == m && v[k] == u)
|
|
12474
|
-
|
|
12474
|
+
S += "+";
|
|
12475
12475
|
else {
|
|
12476
|
-
var
|
|
12477
|
-
|
|
12476
|
+
var E = w + this.iconv.decode(v.slice(m, k), "ascii");
|
|
12477
|
+
S += this.iconv.decode(t.from(E, "base64"), "utf16-be");
|
|
12478
12478
|
}
|
|
12479
12479
|
v[k] != u && k--, m = k + 1, F = !1, w = "";
|
|
12480
12480
|
}
|
|
12481
12481
|
if (!F)
|
|
12482
|
-
|
|
12482
|
+
S += this.iconv.decode(v.slice(m), "ascii");
|
|
12483
12483
|
else {
|
|
12484
|
-
var
|
|
12485
|
-
w =
|
|
12484
|
+
var E = w + this.iconv.decode(v.slice(m), "ascii"), O = E.length - E.length % 8;
|
|
12485
|
+
w = E.slice(O), E = E.slice(0, O), S += this.iconv.decode(t.from(E, "base64"), "utf16-be");
|
|
12486
12486
|
}
|
|
12487
|
-
return this.inBase64 = F, this.base64Accum = w,
|
|
12487
|
+
return this.inBase64 = F, this.base64Accum = w, S;
|
|
12488
12488
|
}, a.prototype.end = function() {
|
|
12489
12489
|
var v = "";
|
|
12490
12490
|
return this.inBase64 && this.base64Accum.length > 0 && (v = this.iconv.decode(t.from(this.base64Accum, "base64"), "utf16-be")), this.inBase64 = !1, this.base64Accum = "", v;
|
|
12491
12491
|
}, dt.utf7imap = d;
|
|
12492
|
-
function d(v,
|
|
12493
|
-
this.iconv =
|
|
12492
|
+
function d(v, S) {
|
|
12493
|
+
this.iconv = S;
|
|
12494
12494
|
}
|
|
12495
12495
|
d.prototype.encoder = f, d.prototype.decoder = g, d.prototype.bomAware = !0;
|
|
12496
|
-
function f(v,
|
|
12497
|
-
this.iconv =
|
|
12496
|
+
function f(v, S) {
|
|
12497
|
+
this.iconv = S.iconv, this.inBase64 = !1, this.base64Accum = t.alloc(6), this.base64AccumIdx = 0;
|
|
12498
12498
|
}
|
|
12499
12499
|
f.prototype.write = function(v) {
|
|
12500
|
-
for (var
|
|
12501
|
-
var
|
|
12502
|
-
|
|
12500
|
+
for (var S = this.inBase64, m = this.base64Accum, F = this.base64AccumIdx, w = t.alloc(v.length * 5 + 10), k = 0, E = 0; E < v.length; E++) {
|
|
12501
|
+
var O = v.charCodeAt(E);
|
|
12502
|
+
O >= 32 && O <= 126 ? (S && (F > 0 && (k += w.write(m.slice(0, F).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), k), F = 0), w[k++] = u, S = !1), S || (w[k++] = O, O === h && (w[k++] = u))) : (S || (w[k++] = h, S = !0), S && (m[F++] = O >> 8, m[F++] = O & 255, F == m.length && (k += w.write(m.toString("base64").replace(/\//g, ","), k), F = 0)));
|
|
12503
12503
|
}
|
|
12504
|
-
return this.inBase64 =
|
|
12504
|
+
return this.inBase64 = S, this.base64AccumIdx = F, w.slice(0, k);
|
|
12505
12505
|
}, f.prototype.end = function() {
|
|
12506
|
-
var v = t.alloc(10),
|
|
12507
|
-
return this.inBase64 && (this.base64AccumIdx > 0 && (
|
|
12506
|
+
var v = t.alloc(10), S = 0;
|
|
12507
|
+
return this.inBase64 && (this.base64AccumIdx > 0 && (S += v.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), S), this.base64AccumIdx = 0), v[S++] = u, this.inBase64 = !1), v.slice(0, S);
|
|
12508
12508
|
};
|
|
12509
|
-
function g(v,
|
|
12510
|
-
this.iconv =
|
|
12509
|
+
function g(v, S) {
|
|
12510
|
+
this.iconv = S.iconv, this.inBase64 = !1, this.base64Accum = "";
|
|
12511
12511
|
}
|
|
12512
|
-
var
|
|
12513
|
-
return
|
|
12514
|
-
for (var
|
|
12512
|
+
var x = s.slice();
|
|
12513
|
+
return x[44] = !0, g.prototype.write = function(v) {
|
|
12514
|
+
for (var S = "", m = 0, F = this.inBase64, w = this.base64Accum, k = 0; k < v.length; k++)
|
|
12515
12515
|
if (!F)
|
|
12516
|
-
v[k] == h && (
|
|
12517
|
-
else if (!
|
|
12516
|
+
v[k] == h && (S += this.iconv.decode(v.slice(m, k), "ascii"), m = k + 1, F = !0);
|
|
12517
|
+
else if (!x[v[k]]) {
|
|
12518
12518
|
if (k == m && v[k] == u)
|
|
12519
|
-
|
|
12519
|
+
S += "&";
|
|
12520
12520
|
else {
|
|
12521
|
-
var
|
|
12522
|
-
|
|
12521
|
+
var E = w + this.iconv.decode(v.slice(m, k), "ascii").replace(/,/g, "/");
|
|
12522
|
+
S += this.iconv.decode(t.from(E, "base64"), "utf16-be");
|
|
12523
12523
|
}
|
|
12524
12524
|
v[k] != u && k--, m = k + 1, F = !1, w = "";
|
|
12525
12525
|
}
|
|
12526
12526
|
if (!F)
|
|
12527
|
-
|
|
12527
|
+
S += this.iconv.decode(v.slice(m), "ascii");
|
|
12528
12528
|
else {
|
|
12529
|
-
var
|
|
12530
|
-
w =
|
|
12529
|
+
var E = w + this.iconv.decode(v.slice(m), "ascii").replace(/,/g, "/"), O = E.length - E.length % 8;
|
|
12530
|
+
w = E.slice(O), E = E.slice(0, O), S += this.iconv.decode(t.from(E, "base64"), "utf16-be");
|
|
12531
12531
|
}
|
|
12532
|
-
return this.inBase64 = F, this.base64Accum = w,
|
|
12532
|
+
return this.inBase64 = F, this.base64Accum = w, S;
|
|
12533
12533
|
}, g.prototype.end = function() {
|
|
12534
12534
|
var v = "";
|
|
12535
12535
|
return this.inBase64 && this.base64Accum.length > 0 && (v = this.iconv.decode(t.from(this.base64Accum, "base64"), "utf16-be")), this.inBase64 = !1, this.base64Accum = "", v;
|
|
@@ -12539,7 +12539,7 @@ var Sr = {}, ka;
|
|
|
12539
12539
|
function ll() {
|
|
12540
12540
|
if (ka) return Sr;
|
|
12541
12541
|
ka = 1;
|
|
12542
|
-
var t =
|
|
12542
|
+
var t = Ye.Buffer;
|
|
12543
12543
|
Sr._sbcs = e;
|
|
12544
12544
|
function e(a, i) {
|
|
12545
12545
|
if (!a)
|
|
@@ -12725,9 +12725,9 @@ function fl() {
|
|
|
12725
12725
|
csmacintosh: "macintosh"
|
|
12726
12726
|
}), wr;
|
|
12727
12727
|
}
|
|
12728
|
-
var Fr,
|
|
12728
|
+
var Fr, Ea;
|
|
12729
12729
|
function pl() {
|
|
12730
|
-
return
|
|
12730
|
+
return Ea || (Ea = 1, Fr = {
|
|
12731
12731
|
437: "cp437",
|
|
12732
12732
|
737: "cp737",
|
|
12733
12733
|
775: "cp775",
|
|
@@ -13181,11 +13181,11 @@ function pl() {
|
|
|
13181
13181
|
}
|
|
13182
13182
|
}), Fr;
|
|
13183
13183
|
}
|
|
13184
|
-
var kr = {},
|
|
13184
|
+
var kr = {}, Ca;
|
|
13185
13185
|
function dl() {
|
|
13186
|
-
if (
|
|
13187
|
-
|
|
13188
|
-
var t =
|
|
13186
|
+
if (Ca) return kr;
|
|
13187
|
+
Ca = 1;
|
|
13188
|
+
var t = Ye.Buffer;
|
|
13189
13189
|
kr._dbcs = c;
|
|
13190
13190
|
for (var e = -1, r = -2, n = -10, a = -1e3, i = new Array(256), s = -1, o = 0; o < 256; o++)
|
|
13191
13191
|
i[o] = e;
|
|
@@ -13194,33 +13194,33 @@ function dl() {
|
|
|
13194
13194
|
throw new Error("DBCS codec is called without the data.");
|
|
13195
13195
|
if (!f.table)
|
|
13196
13196
|
throw new Error("Encoding '" + this.encodingName + "' has no data.");
|
|
13197
|
-
var
|
|
13197
|
+
var x = f.table();
|
|
13198
13198
|
this.decodeTables = [], this.decodeTables[0] = i.slice(0), this.decodeTableSeq = [];
|
|
13199
|
-
for (var v = 0; v <
|
|
13200
|
-
this._addDecodeChunk(
|
|
13199
|
+
for (var v = 0; v < x.length; v++)
|
|
13200
|
+
this._addDecodeChunk(x[v]);
|
|
13201
13201
|
if (typeof f.gb18030 == "function") {
|
|
13202
13202
|
this.gb18030 = f.gb18030();
|
|
13203
|
-
var
|
|
13203
|
+
var S = this.decodeTables.length;
|
|
13204
13204
|
this.decodeTables.push(i.slice(0));
|
|
13205
13205
|
var m = this.decodeTables.length;
|
|
13206
13206
|
this.decodeTables.push(i.slice(0));
|
|
13207
13207
|
for (var F = this.decodeTables[0], v = 129; v <= 254; v++)
|
|
13208
13208
|
for (var w = this.decodeTables[a - F[v]], k = 48; k <= 57; k++) {
|
|
13209
13209
|
if (w[k] === e)
|
|
13210
|
-
w[k] = a -
|
|
13210
|
+
w[k] = a - S;
|
|
13211
13211
|
else if (w[k] > a)
|
|
13212
13212
|
throw new Error("gb18030 decode tables conflict at byte 2");
|
|
13213
|
-
for (var
|
|
13214
|
-
if (
|
|
13215
|
-
|
|
13213
|
+
for (var E = this.decodeTables[a - w[k]], O = 129; O <= 254; O++) {
|
|
13214
|
+
if (E[O] === e)
|
|
13215
|
+
E[O] = a - m;
|
|
13216
13216
|
else {
|
|
13217
|
-
if (
|
|
13217
|
+
if (E[O] === a - m)
|
|
13218
13218
|
continue;
|
|
13219
|
-
if (
|
|
13219
|
+
if (E[O] > a)
|
|
13220
13220
|
throw new Error("gb18030 decode tables conflict at byte 3");
|
|
13221
13221
|
}
|
|
13222
|
-
for (var B = this.decodeTables[a -
|
|
13223
|
-
B[
|
|
13222
|
+
for (var B = this.decodeTables[a - E[O]], L = 48; L <= 57; L++)
|
|
13223
|
+
B[L] === e && (B[L] = r);
|
|
13224
13224
|
}
|
|
13225
13225
|
}
|
|
13226
13226
|
}
|
|
@@ -13244,42 +13244,42 @@ function dl() {
|
|
|
13244
13244
|
for (var g = []; f > 0; f >>>= 8)
|
|
13245
13245
|
g.push(f & 255);
|
|
13246
13246
|
g.length == 0 && g.push(0);
|
|
13247
|
-
for (var
|
|
13248
|
-
var
|
|
13249
|
-
if (
|
|
13250
|
-
|
|
13251
|
-
else if (
|
|
13252
|
-
|
|
13247
|
+
for (var x = this.decodeTables[0], v = g.length - 1; v > 0; v--) {
|
|
13248
|
+
var S = x[g[v]];
|
|
13249
|
+
if (S == e)
|
|
13250
|
+
x[g[v]] = a - this.decodeTables.length, this.decodeTables.push(x = i.slice(0));
|
|
13251
|
+
else if (S <= a)
|
|
13252
|
+
x = this.decodeTables[a - S];
|
|
13253
13253
|
else
|
|
13254
13254
|
throw new Error("Overwrite byte in " + this.encodingName + ", addr: " + f.toString(16));
|
|
13255
13255
|
}
|
|
13256
|
-
return
|
|
13256
|
+
return x;
|
|
13257
13257
|
}, c.prototype._addDecodeChunk = function(f) {
|
|
13258
|
-
var g = parseInt(f[0], 16),
|
|
13258
|
+
var g = parseInt(f[0], 16), x = this._getDecodeTrieNode(g);
|
|
13259
13259
|
g = g & 255;
|
|
13260
13260
|
for (var v = 1; v < f.length; v++) {
|
|
13261
|
-
var
|
|
13262
|
-
if (typeof
|
|
13263
|
-
for (var m = 0; m <
|
|
13264
|
-
var F =
|
|
13261
|
+
var S = f[v];
|
|
13262
|
+
if (typeof S == "string")
|
|
13263
|
+
for (var m = 0; m < S.length; ) {
|
|
13264
|
+
var F = S.charCodeAt(m++);
|
|
13265
13265
|
if (F >= 55296 && F < 56320) {
|
|
13266
|
-
var w =
|
|
13266
|
+
var w = S.charCodeAt(m++);
|
|
13267
13267
|
if (w >= 56320 && w < 57344)
|
|
13268
|
-
|
|
13268
|
+
x[g++] = 65536 + (F - 55296) * 1024 + (w - 56320);
|
|
13269
13269
|
else
|
|
13270
13270
|
throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + f[0]);
|
|
13271
13271
|
} else if (F > 4080 && F <= 4095) {
|
|
13272
|
-
for (var k = 4095 - F + 2,
|
|
13273
|
-
|
|
13274
|
-
|
|
13272
|
+
for (var k = 4095 - F + 2, E = [], O = 0; O < k; O++)
|
|
13273
|
+
E.push(S.charCodeAt(m++));
|
|
13274
|
+
x[g++] = n - this.decodeTableSeq.length, this.decodeTableSeq.push(E);
|
|
13275
13275
|
} else
|
|
13276
|
-
|
|
13276
|
+
x[g++] = F;
|
|
13277
13277
|
}
|
|
13278
|
-
else if (typeof
|
|
13279
|
-
for (var B =
|
|
13280
|
-
|
|
13278
|
+
else if (typeof S == "number")
|
|
13279
|
+
for (var B = x[g - 1] + 1, m = 0; m < S; m++)
|
|
13280
|
+
x[g++] = B++;
|
|
13281
13281
|
else
|
|
13282
|
-
throw new Error("Incorrect type '" + typeof
|
|
13282
|
+
throw new Error("Incorrect type '" + typeof S + "' given in " + this.encodingName + " at chunk " + f[0]);
|
|
13283
13283
|
}
|
|
13284
13284
|
if (g > 255)
|
|
13285
13285
|
throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + f[0] + ": too long" + g);
|
|
@@ -13287,65 +13287,65 @@ function dl() {
|
|
|
13287
13287
|
var g = f >> 8;
|
|
13288
13288
|
return this.encodeTable[g] === void 0 && (this.encodeTable[g] = i.slice(0)), this.encodeTable[g];
|
|
13289
13289
|
}, c.prototype._setEncodeChar = function(f, g) {
|
|
13290
|
-
var
|
|
13291
|
-
|
|
13290
|
+
var x = this._getEncodeBucket(f), v = f & 255;
|
|
13291
|
+
x[v] <= n ? this.encodeTableSeq[n - x[v]][s] = g : x[v] == e && (x[v] = g);
|
|
13292
13292
|
}, c.prototype._setEncodeSequence = function(f, g) {
|
|
13293
|
-
var
|
|
13294
|
-
v[
|
|
13293
|
+
var x = f[0], v = this._getEncodeBucket(x), S = x & 255, m;
|
|
13294
|
+
v[S] <= n ? m = this.encodeTableSeq[n - v[S]] : (m = {}, v[S] !== e && (m[s] = v[S]), v[S] = n - this.encodeTableSeq.length, this.encodeTableSeq.push(m));
|
|
13295
13295
|
for (var F = 1; F < f.length - 1; F++) {
|
|
13296
|
-
var w = m[
|
|
13297
|
-
typeof w == "object" ? m = w : (m = m[
|
|
13296
|
+
var w = m[x];
|
|
13297
|
+
typeof w == "object" ? m = w : (m = m[x] = {}, w !== void 0 && (m[s] = w));
|
|
13298
13298
|
}
|
|
13299
|
-
|
|
13300
|
-
}, c.prototype._fillEncodeTable = function(f, g,
|
|
13301
|
-
for (var v = this.decodeTables[f],
|
|
13299
|
+
x = f[f.length - 1], m[x] = g;
|
|
13300
|
+
}, c.prototype._fillEncodeTable = function(f, g, x) {
|
|
13301
|
+
for (var v = this.decodeTables[f], S = !1, m = {}, F = 0; F < 256; F++) {
|
|
13302
13302
|
var w = v[F], k = g + F;
|
|
13303
|
-
if (!
|
|
13303
|
+
if (!x[k])
|
|
13304
13304
|
if (w >= 0)
|
|
13305
|
-
this._setEncodeChar(w, k),
|
|
13305
|
+
this._setEncodeChar(w, k), S = !0;
|
|
13306
13306
|
else if (w <= a) {
|
|
13307
|
-
var
|
|
13308
|
-
if (!m[
|
|
13309
|
-
var
|
|
13310
|
-
this._fillEncodeTable(
|
|
13307
|
+
var E = a - w;
|
|
13308
|
+
if (!m[E]) {
|
|
13309
|
+
var O = k << 8 >>> 0;
|
|
13310
|
+
this._fillEncodeTable(E, O, x) ? S = !0 : m[E] = !0;
|
|
13311
13311
|
}
|
|
13312
|
-
} else w <= n && (this._setEncodeSequence(this.decodeTableSeq[n - w], k),
|
|
13312
|
+
} else w <= n && (this._setEncodeSequence(this.decodeTableSeq[n - w], k), S = !0);
|
|
13313
13313
|
}
|
|
13314
|
-
return
|
|
13314
|
+
return S;
|
|
13315
13315
|
};
|
|
13316
13316
|
function u(f, g) {
|
|
13317
13317
|
this.leadSurrogate = -1, this.seqObj = void 0, this.encodeTable = g.encodeTable, this.encodeTableSeq = g.encodeTableSeq, this.defaultCharSingleByte = g.defCharSB, this.gb18030 = g.gb18030;
|
|
13318
13318
|
}
|
|
13319
13319
|
u.prototype.write = function(f) {
|
|
13320
|
-
for (var g = t.alloc(f.length * (this.gb18030 ? 4 : 3)),
|
|
13321
|
-
if (
|
|
13320
|
+
for (var g = t.alloc(f.length * (this.gb18030 ? 4 : 3)), x = this.leadSurrogate, v = this.seqObj, S = -1, m = 0, F = 0; ; ) {
|
|
13321
|
+
if (S === -1) {
|
|
13322
13322
|
if (m == f.length) break;
|
|
13323
13323
|
var w = f.charCodeAt(m++);
|
|
13324
13324
|
} else {
|
|
13325
|
-
var w =
|
|
13326
|
-
|
|
13325
|
+
var w = S;
|
|
13326
|
+
S = -1;
|
|
13327
13327
|
}
|
|
13328
13328
|
if (w >= 55296 && w < 57344)
|
|
13329
13329
|
if (w < 56320)
|
|
13330
|
-
if (
|
|
13331
|
-
|
|
13330
|
+
if (x === -1) {
|
|
13331
|
+
x = w;
|
|
13332
13332
|
continue;
|
|
13333
13333
|
} else
|
|
13334
|
-
|
|
13334
|
+
x = w, w = e;
|
|
13335
13335
|
else
|
|
13336
|
-
|
|
13337
|
-
else
|
|
13336
|
+
x !== -1 ? (w = 65536 + (x - 55296) * 1024 + (w - 56320), x = -1) : w = e;
|
|
13337
|
+
else x !== -1 && (S = w, w = e, x = -1);
|
|
13338
13338
|
var k = e;
|
|
13339
13339
|
if (v !== void 0 && w != e) {
|
|
13340
|
-
var
|
|
13341
|
-
if (typeof
|
|
13342
|
-
v =
|
|
13340
|
+
var E = v[w];
|
|
13341
|
+
if (typeof E == "object") {
|
|
13342
|
+
v = E;
|
|
13343
13343
|
continue;
|
|
13344
|
-
} else typeof
|
|
13344
|
+
} else typeof E == "number" ? k = E : E == null && (E = v[s], E !== void 0 && (k = E, S = w));
|
|
13345
13345
|
v = void 0;
|
|
13346
13346
|
} else if (w >= 0) {
|
|
13347
|
-
var
|
|
13348
|
-
if (
|
|
13347
|
+
var O = this.encodeTable[w >> 8];
|
|
13348
|
+
if (O !== void 0 && (k = O[w & 255]), k <= n) {
|
|
13349
13349
|
v = this.encodeTableSeq[n - k];
|
|
13350
13350
|
continue;
|
|
13351
13351
|
}
|
|
@@ -13360,13 +13360,13 @@ function dl() {
|
|
|
13360
13360
|
}
|
|
13361
13361
|
k === e && (k = this.defaultCharSingleByte), k < 256 ? g[F++] = k : k < 65536 ? (g[F++] = k >> 8, g[F++] = k & 255) : k < 16777216 ? (g[F++] = k >> 16, g[F++] = k >> 8 & 255, g[F++] = k & 255) : (g[F++] = k >>> 24, g[F++] = k >>> 16 & 255, g[F++] = k >>> 8 & 255, g[F++] = k & 255);
|
|
13362
13362
|
}
|
|
13363
|
-
return this.seqObj = v, this.leadSurrogate =
|
|
13363
|
+
return this.seqObj = v, this.leadSurrogate = x, g.slice(0, F);
|
|
13364
13364
|
}, u.prototype.end = function() {
|
|
13365
13365
|
if (!(this.leadSurrogate === -1 && this.seqObj === void 0)) {
|
|
13366
13366
|
var f = t.alloc(10), g = 0;
|
|
13367
13367
|
if (this.seqObj) {
|
|
13368
|
-
var
|
|
13369
|
-
|
|
13368
|
+
var x = this.seqObj[s];
|
|
13369
|
+
x !== void 0 && (x < 256 ? f[g++] = x : (f[g++] = x >> 8, f[g++] = x & 255)), this.seqObj = void 0;
|
|
13370
13370
|
}
|
|
13371
13371
|
return this.leadSurrogate !== -1 && (f[g++] = this.defaultCharSingleByte, this.leadSurrogate = -1), f.slice(0, g);
|
|
13372
13372
|
}
|
|
@@ -13375,34 +13375,34 @@ function dl() {
|
|
|
13375
13375
|
this.nodeIdx = 0, this.prevBytes = [], this.decodeTables = g.decodeTables, this.decodeTableSeq = g.decodeTableSeq, this.defaultCharUnicode = g.defaultCharUnicode, this.gb18030 = g.gb18030;
|
|
13376
13376
|
}
|
|
13377
13377
|
h.prototype.write = function(f) {
|
|
13378
|
-
for (var g = t.alloc(f.length * 2),
|
|
13379
|
-
var
|
|
13378
|
+
for (var g = t.alloc(f.length * 2), x = this.nodeIdx, v = this.prevBytes, S = this.prevBytes.length, m = -this.prevBytes.length, F, w = 0, k = 0; w < f.length; w++) {
|
|
13379
|
+
var E = w >= 0 ? f[w] : v[w + S], F = this.decodeTables[x][E];
|
|
13380
13380
|
if (!(F >= 0)) if (F === e)
|
|
13381
13381
|
F = this.defaultCharUnicode.charCodeAt(0), w = m;
|
|
13382
13382
|
else if (F === r) {
|
|
13383
13383
|
if (w >= 3)
|
|
13384
|
-
var
|
|
13384
|
+
var O = (f[w - 3] - 129) * 12600 + (f[w - 2] - 48) * 1260 + (f[w - 1] - 129) * 10 + (E - 48);
|
|
13385
13385
|
else
|
|
13386
|
-
var
|
|
13387
|
-
var B = d(this.gb18030.gbChars,
|
|
13388
|
-
F = this.gb18030.uChars[B] +
|
|
13386
|
+
var O = (v[w - 3 + S] - 129) * 12600 + ((w - 2 >= 0 ? f[w - 2] : v[w - 2 + S]) - 48) * 1260 + ((w - 1 >= 0 ? f[w - 1] : v[w - 1 + S]) - 129) * 10 + (E - 48);
|
|
13387
|
+
var B = d(this.gb18030.gbChars, O);
|
|
13388
|
+
F = this.gb18030.uChars[B] + O - this.gb18030.gbChars[B];
|
|
13389
13389
|
} else if (F <= a) {
|
|
13390
|
-
|
|
13390
|
+
x = a - F;
|
|
13391
13391
|
continue;
|
|
13392
13392
|
} else if (F <= n) {
|
|
13393
|
-
for (var
|
|
13394
|
-
F =
|
|
13395
|
-
F =
|
|
13393
|
+
for (var L = this.decodeTableSeq[n - F], H = 0; H < L.length - 1; H++)
|
|
13394
|
+
F = L[H], g[k++] = F & 255, g[k++] = F >> 8;
|
|
13395
|
+
F = L[L.length - 1];
|
|
13396
13396
|
} else
|
|
13397
|
-
throw new Error("iconv-lite internal error: invalid decoding table value " + F + " at " +
|
|
13397
|
+
throw new Error("iconv-lite internal error: invalid decoding table value " + F + " at " + x + "/" + E);
|
|
13398
13398
|
if (F >= 65536) {
|
|
13399
13399
|
F -= 65536;
|
|
13400
13400
|
var W = 55296 | F >> 10;
|
|
13401
13401
|
g[k++] = W & 255, g[k++] = W >> 8, F = 56320 | F & 1023;
|
|
13402
13402
|
}
|
|
13403
|
-
g[k++] = F & 255, g[k++] = F >> 8,
|
|
13403
|
+
g[k++] = F & 255, g[k++] = F >> 8, x = 0, m = w + 1;
|
|
13404
13404
|
}
|
|
13405
|
-
return this.nodeIdx =
|
|
13405
|
+
return this.nodeIdx = x, this.prevBytes = m >= 0 ? Array.prototype.slice.call(f, m) : v.slice(m + S).concat(Array.prototype.slice.call(f)), g.slice(0, k).toString("ucs2");
|
|
13406
13406
|
}, h.prototype.end = function() {
|
|
13407
13407
|
for (var f = ""; this.prevBytes.length > 0; ) {
|
|
13408
13408
|
f += this.defaultCharUnicode;
|
|
@@ -13414,11 +13414,11 @@ function dl() {
|
|
|
13414
13414
|
function d(f, g) {
|
|
13415
13415
|
if (f[0] > g)
|
|
13416
13416
|
return -1;
|
|
13417
|
-
for (var
|
|
13418
|
-
var
|
|
13419
|
-
f[
|
|
13417
|
+
for (var x = 0, v = f.length; x < v - 1; ) {
|
|
13418
|
+
var S = x + (v - x + 1 >> 1);
|
|
13419
|
+
f[S] <= g ? x = S : v = S;
|
|
13420
13420
|
}
|
|
13421
|
-
return
|
|
13421
|
+
return x;
|
|
13422
13422
|
}
|
|
13423
13423
|
return kr;
|
|
13424
13424
|
}
|
|
@@ -21691,9 +21691,9 @@ const gl = [
|
|
|
21691
21691
|
"𤅟𤩹𨮏孆𨰃𡢞瓈𡦈甎瓩甞𨻙𡩋寗𨺬鎅畍畊畧畮𤾂㼄𤴓疎瑝疞疴瘂瘬癑癏癯癶𦏵皐臯㟸𦤑𦤎皡皥皷盌𦾟葢𥂝𥅽𡸜眞眦着撯𥈠睘𣊬瞯𨥤𨥨𡛁矴砉𡍶𤨒棊碯磇磓隥礮𥗠磗礴碱𧘌辸袄𨬫𦂃𢘜禆褀椂禀𥡗禝𧬹礼禩渪𧄦㺨秆𩄍秔"
|
|
21692
21692
|
]
|
|
21693
21693
|
];
|
|
21694
|
-
var
|
|
21694
|
+
var Er, Ba;
|
|
21695
21695
|
function wl() {
|
|
21696
|
-
return Ba || (Ba = 1,
|
|
21696
|
+
return Ba || (Ba = 1, Er = {
|
|
21697
21697
|
// == Japanese/ShiftJIS ====================================================
|
|
21698
21698
|
// All japanese encodings are based on JIS X set of standards:
|
|
21699
21699
|
// JIS X 0201 - Single-byte encoding of ASCII + ¥ + Kana chars at 0xA1-0xDF.
|
|
@@ -21932,11 +21932,11 @@ function wl() {
|
|
|
21932
21932
|
cnbig5: "big5hkscs",
|
|
21933
21933
|
csbig5: "big5hkscs",
|
|
21934
21934
|
xxbig5: "big5hkscs"
|
|
21935
|
-
}),
|
|
21935
|
+
}), Er;
|
|
21936
21936
|
}
|
|
21937
|
-
var
|
|
21937
|
+
var Oa;
|
|
21938
21938
|
function Fl() {
|
|
21939
|
-
return
|
|
21939
|
+
return Oa || (Oa = 1, function(t) {
|
|
21940
21940
|
for (var e = _i, r = [
|
|
21941
21941
|
ol(),
|
|
21942
21942
|
cl(),
|
|
@@ -21953,12 +21953,12 @@ function Fl() {
|
|
|
21953
21953
|
}
|
|
21954
21954
|
}(mr)), mr;
|
|
21955
21955
|
}
|
|
21956
|
-
var
|
|
21956
|
+
var Cr, La;
|
|
21957
21957
|
function kl() {
|
|
21958
|
-
if (
|
|
21959
|
-
|
|
21960
|
-
var t =
|
|
21961
|
-
return
|
|
21958
|
+
if (La) return Cr;
|
|
21959
|
+
La = 1;
|
|
21960
|
+
var t = Ye.Buffer;
|
|
21961
|
+
return Cr = function(e) {
|
|
21962
21962
|
var r = e.Transform;
|
|
21963
21963
|
function n(i, s) {
|
|
21964
21964
|
this.conv = i, s = s || {}, s.decodeStrings = !1, r.call(this, s);
|
|
@@ -22021,14 +22021,14 @@ function kl() {
|
|
|
22021
22021
|
IconvLiteEncoderStream: n,
|
|
22022
22022
|
IconvLiteDecoderStream: a
|
|
22023
22023
|
};
|
|
22024
|
-
},
|
|
22024
|
+
}, Cr;
|
|
22025
22025
|
}
|
|
22026
|
-
const Tl = {},
|
|
22026
|
+
const Tl = {}, El = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
22027
22027
|
__proto__: null,
|
|
22028
22028
|
default: Tl
|
|
22029
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
22029
|
+
}, Symbol.toStringTag, { value: "Module" })), Cl = /* @__PURE__ */ Yh(El);
|
|
22030
22030
|
(function(t) {
|
|
22031
|
-
var e =
|
|
22031
|
+
var e = Ye.Buffer, r = un, n = _i, a = t.exports;
|
|
22032
22032
|
a.encodings = null, a.defaultCharUnicode = "�", a.defaultCharSingleByte = "?", a.encode = function(o, c, u) {
|
|
22033
22033
|
o = "" + (o || "");
|
|
22034
22034
|
var h = a.getEncoder(c, u), d = h.write(o), f = h.end();
|
|
@@ -22088,7 +22088,7 @@ const Tl = {}, Cl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
22088
22088
|
};
|
|
22089
22089
|
var i;
|
|
22090
22090
|
try {
|
|
22091
|
-
i =
|
|
22091
|
+
i = Cl;
|
|
22092
22092
|
} catch {
|
|
22093
22093
|
}
|
|
22094
22094
|
i && i.Transform ? a.enableStreamingAPI(i) : a.encodeStream = a.decodeStream = function() {
|
|
@@ -22128,7 +22128,7 @@ class fn extends Na {
|
|
|
22128
22128
|
if (e == null) {
|
|
22129
22129
|
const r = this.shape.polylines, n = [], a = [];
|
|
22130
22130
|
let i = 0;
|
|
22131
|
-
e = new
|
|
22131
|
+
e = new D.BufferGeometry();
|
|
22132
22132
|
for (let s = 0; s < r.length; s++) {
|
|
22133
22133
|
const o = r[s];
|
|
22134
22134
|
for (let c = 0; c < o.length; c++) {
|
|
@@ -22138,7 +22138,7 @@ class fn extends Na {
|
|
|
22138
22138
|
}
|
|
22139
22139
|
e.setAttribute(
|
|
22140
22140
|
"position",
|
|
22141
|
-
new
|
|
22141
|
+
new D.Float32BufferAttribute(n, 3)
|
|
22142
22142
|
), e.setIndex(a);
|
|
22143
22143
|
}
|
|
22144
22144
|
return e;
|
|
@@ -22234,7 +22234,7 @@ class Bl extends Pa {
|
|
|
22234
22234
|
return e.charCodeAt(0);
|
|
22235
22235
|
}
|
|
22236
22236
|
}
|
|
22237
|
-
class
|
|
22237
|
+
class qe {
|
|
22238
22238
|
constructor() {
|
|
22239
22239
|
}
|
|
22240
22240
|
/**
|
|
@@ -22242,7 +22242,7 @@ class We {
|
|
|
22242
22242
|
* @returns The FontFactory instance
|
|
22243
22243
|
*/
|
|
22244
22244
|
static get instance() {
|
|
22245
|
-
return
|
|
22245
|
+
return qe._instance || (qe._instance = new qe()), qe._instance;
|
|
22246
22246
|
}
|
|
22247
22247
|
/**
|
|
22248
22248
|
* Creates a font instance based on the provided font data.
|
|
@@ -22267,7 +22267,7 @@ class Re {
|
|
|
22267
22267
|
fontNotFound: new Sn(),
|
|
22268
22268
|
/** Event triggered when a font is successfully loaded */
|
|
22269
22269
|
fontLoaded: new Sn()
|
|
22270
|
-
}, this.loader = new
|
|
22270
|
+
}, this.loader = new D.FileLoader(), this.loader.setResponseType("arraybuffer"), this.fileNames = [], this.fontLoader = new Ol();
|
|
22271
22271
|
}
|
|
22272
22272
|
/**
|
|
22273
22273
|
* Gets the singleton instance of the FontManager
|
|
@@ -22466,12 +22466,12 @@ class Re {
|
|
|
22466
22466
|
return;
|
|
22467
22467
|
const i = await vt.instance.get(a);
|
|
22468
22468
|
if (i) {
|
|
22469
|
-
const s =
|
|
22469
|
+
const s = qe.instance.createFont(i);
|
|
22470
22470
|
this.loadedFontMap.set(a, s);
|
|
22471
22471
|
} else {
|
|
22472
22472
|
const s = await this.loader.loadAsync(e.url);
|
|
22473
22473
|
n.data = s;
|
|
22474
|
-
const o =
|
|
22474
|
+
const o = qe.instance.createFont(n);
|
|
22475
22475
|
o && (e.name.forEach((c) => o.names.add(c)), this.loadedFontMap.set(a, o), this.enableFontCache && await vt.instance.set(a, n));
|
|
22476
22476
|
}
|
|
22477
22477
|
this.events.fontLoaded.dispatch({
|
|
@@ -22498,7 +22498,7 @@ class Re {
|
|
|
22498
22498
|
const { name: n } = r;
|
|
22499
22499
|
if (this.fileNames && !this.fileNames.includes(n))
|
|
22500
22500
|
continue;
|
|
22501
|
-
const a =
|
|
22501
|
+
const a = qe.instance.createFont(r);
|
|
22502
22502
|
this.loadedFontMap.set(n, a);
|
|
22503
22503
|
}
|
|
22504
22504
|
}
|
|
@@ -22527,7 +22527,7 @@ class Re {
|
|
|
22527
22527
|
return e == null ? (this.loadedFontMap.clear(), !0) : this.loadedFontMap.delete(e);
|
|
22528
22528
|
}
|
|
22529
22529
|
}
|
|
22530
|
-
class
|
|
22530
|
+
class Ol {
|
|
22531
22531
|
/**
|
|
22532
22532
|
* Creates a new instance of DefaultFontLoader
|
|
22533
22533
|
*/
|
|
@@ -22623,8 +22623,8 @@ class Ll {
|
|
|
22623
22623
|
});
|
|
22624
22624
|
}
|
|
22625
22625
|
}
|
|
22626
|
-
var
|
|
22627
|
-
const
|
|
22626
|
+
var Ke = /* @__PURE__ */ ((t) => (t[t.NONE = 0] = "NONE", t[t.WORD = 1] = "WORD", t[t.STACK = 2] = "STACK", t[t.SPACE = 3] = "SPACE", t[t.NBSP = 4] = "NBSP", t[t.TABULATOR = 5] = "TABULATOR", t[t.NEW_PARAGRAPH = 6] = "NEW_PARAGRAPH", t[t.NEW_COLUMN = 7] = "NEW_COLUMN", t[t.WRAP_AT_DIMLINE = 8] = "WRAP_AT_DIMLINE", t[t.PROPERTIES_CHANGED = 9] = "PROPERTIES_CHANGED", t))(Ke || {}), gt = /* @__PURE__ */ ((t) => (t[t.BOTTOM = 0] = "BOTTOM", t[t.MIDDLE = 1] = "MIDDLE", t[t.TOP = 2] = "TOP", t))(gt || {}), we = /* @__PURE__ */ ((t) => (t[t.DEFAULT = 0] = "DEFAULT", t[t.LEFT = 1] = "LEFT", t[t.RIGHT = 2] = "RIGHT", t[t.CENTER = 3] = "CENTER", t[t.JUSTIFIED = 4] = "JUSTIFIED", t[t.DISTRIBUTED = 5] = "DISTRIBUTED", t))(we || {});
|
|
22627
|
+
const Ll = {
|
|
22628
22628
|
c: "Ø",
|
|
22629
22629
|
d: "°",
|
|
22630
22630
|
p: "±",
|
|
@@ -23224,7 +23224,7 @@ class Dl {
|
|
|
23224
23224
|
continue;
|
|
23225
23225
|
}
|
|
23226
23226
|
if (s === "%" && this.scanner.peek(1) === "%") {
|
|
23227
|
-
const c = this.scanner.peek(2).toLowerCase(), u =
|
|
23227
|
+
const c = this.scanner.peek(2).toLowerCase(), u = Ll[c];
|
|
23228
23228
|
if (u) {
|
|
23229
23229
|
this.scanner.consume(3), a += u;
|
|
23230
23230
|
continue;
|
|
@@ -23684,7 +23684,7 @@ class Ur {
|
|
|
23684
23684
|
this.type = e, this.ctx = r, this.data = n;
|
|
23685
23685
|
}
|
|
23686
23686
|
}
|
|
23687
|
-
var
|
|
23687
|
+
var ze = /* @__PURE__ */ ((t) => (t[t.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", t[t.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", t[t.TOP_TO_BOTTOM = 3] = "TOP_TO_BOTTOM", t[t.BOTTOM_TO_TOP = 4] = "BOTTOM_TO_TOP", t[t.BY_STYLE = 5] = "BY_STYLE", t))(ze || {}), _l = /* @__PURE__ */ ((t) => (t[t.TopLeft = 1] = "TopLeft", t[t.TopCenter = 2] = "TopCenter", t[t.TopRight = 3] = "TopRight", t[t.MiddleLeft = 4] = "MiddleLeft", t[t.MiddleCenter = 5] = "MiddleCenter", t[t.MiddleRight = 6] = "MiddleRight", t[t.BottomLeft = 7] = "BottomLeft", t[t.BottomCenter = 8] = "BottomCenter", t[t.BottomRight = 9] = "BottomRight", t))(_l || {}), ne = /* @__PURE__ */ ((t) => (t.CHAR = "CHAR", t.NEW_PARAGRAPH = "NEW_PARAGRAPH", t.STACK = "STACK", t))(ne || {});
|
|
23688
23688
|
const Yr = "";
|
|
23689
23689
|
function Pl(t) {
|
|
23690
23690
|
if (!(!t || [
|
|
@@ -23701,7 +23701,7 @@ function Nl(t, e, r) {
|
|
|
23701
23701
|
const n = [];
|
|
23702
23702
|
if (t.filter((f) => f.char !== Yr).forEach((f) => {
|
|
23703
23703
|
const g = Pl(
|
|
23704
|
-
new
|
|
23704
|
+
new D.Box3().copy(f.box).applyMatrix4(e)
|
|
23705
23705
|
);
|
|
23706
23706
|
g && n.push({
|
|
23707
23707
|
type: f.type === ne.NEW_PARAGRAPH ? ne.NEW_PARAGRAPH : ne.CHAR,
|
|
@@ -23722,7 +23722,7 @@ function Nl(t, e, r) {
|
|
|
23722
23722
|
}
|
|
23723
23723
|
const c = n.slice(0, s).filter(a), u = n.slice(o + 1).filter(a), h = n.slice(s, o + 1).filter(i);
|
|
23724
23724
|
if (h.length === 0) return [...c, ...u];
|
|
23725
|
-
const d = new
|
|
23725
|
+
const d = new D.Box3().copy(h[0].box);
|
|
23726
23726
|
return h.slice(1).forEach((f) => d.union(f.box)), [
|
|
23727
23727
|
...c,
|
|
23728
23728
|
{
|
|
@@ -23734,7 +23734,7 @@ function Nl(t, e, r) {
|
|
|
23734
23734
|
...u
|
|
23735
23735
|
];
|
|
23736
23736
|
}
|
|
23737
|
-
const Gl = /* @__PURE__ */ new
|
|
23737
|
+
const Gl = /* @__PURE__ */ new D.Vector3(), Hl = 1.666666, zt = 0.3;
|
|
23738
23738
|
class dn extends Ut {
|
|
23739
23739
|
/**
|
|
23740
23740
|
* Creates a new RenderContext instance with optional initial values.
|
|
@@ -24020,85 +24020,93 @@ class zl {
|
|
|
24020
24020
|
*/
|
|
24021
24021
|
processText(e) {
|
|
24022
24022
|
this._lastCharBoxTarget = void 0;
|
|
24023
|
-
const r = [], n = [], a = [], i = []
|
|
24024
|
-
|
|
24025
|
-
|
|
24023
|
+
const r = [], n = [], a = [], i = [];
|
|
24024
|
+
let s;
|
|
24025
|
+
const o = new D.Group();
|
|
24026
|
+
for (const c of e)
|
|
24027
|
+
if (s = c.type, c.type === Ke.NEW_PARAGRAPH)
|
|
24026
24028
|
this.startNewParagraph(
|
|
24027
24029
|
r,
|
|
24028
24030
|
n,
|
|
24029
24031
|
a,
|
|
24030
24032
|
i,
|
|
24031
|
-
|
|
24033
|
+
o
|
|
24032
24034
|
);
|
|
24033
|
-
else if (
|
|
24034
|
-
const
|
|
24035
|
-
Array.isArray(
|
|
24036
|
-
(
|
|
24037
|
-
|
|
24035
|
+
else if (c.type === Ke.WORD) {
|
|
24036
|
+
const u = c.data;
|
|
24037
|
+
Array.isArray(u) ? u.forEach(
|
|
24038
|
+
(h) => this.processWord(
|
|
24039
|
+
h,
|
|
24038
24040
|
r,
|
|
24039
24041
|
n,
|
|
24040
24042
|
a,
|
|
24041
24043
|
i
|
|
24042
24044
|
)
|
|
24043
|
-
) : typeof
|
|
24044
|
-
|
|
24045
|
+
) : typeof u == "string" && u.length > 0 && this.processWord(
|
|
24046
|
+
u,
|
|
24045
24047
|
r,
|
|
24046
24048
|
n,
|
|
24047
24049
|
a,
|
|
24048
24050
|
i
|
|
24049
24051
|
);
|
|
24050
|
-
} else if (
|
|
24052
|
+
} else if (c.type === Ke.SPACE)
|
|
24051
24053
|
this.processBlank(a, i);
|
|
24052
|
-
else if (
|
|
24054
|
+
else if (c.type === Ke.PROPERTIES_CHANGED) {
|
|
24053
24055
|
this.processGeometries(
|
|
24054
24056
|
r,
|
|
24055
24057
|
n,
|
|
24056
24058
|
a,
|
|
24057
24059
|
i,
|
|
24058
|
-
|
|
24060
|
+
o
|
|
24059
24061
|
);
|
|
24060
|
-
const
|
|
24061
|
-
if (
|
|
24062
|
-
for (; this._contextStack.length >
|
|
24062
|
+
const u = c.data;
|
|
24063
|
+
if (u.command === void 0)
|
|
24064
|
+
for (; this._contextStack.length > u.depth; )
|
|
24063
24065
|
this._currentContext = this._contextStack.pop();
|
|
24064
24066
|
else {
|
|
24065
|
-
for (; this._contextStack.length <
|
|
24067
|
+
for (; this._contextStack.length < u.depth; )
|
|
24066
24068
|
this._contextStack.push(this._currentContext.clone());
|
|
24067
|
-
this.processFormat(
|
|
24069
|
+
this.processFormat(u);
|
|
24068
24070
|
}
|
|
24069
|
-
} else if (
|
|
24071
|
+
} else if (c.type === Ke.STACK) {
|
|
24070
24072
|
this.processGeometries(
|
|
24071
24073
|
r,
|
|
24072
24074
|
n,
|
|
24073
24075
|
a,
|
|
24074
24076
|
i,
|
|
24075
|
-
|
|
24077
|
+
o
|
|
24076
24078
|
);
|
|
24077
|
-
const
|
|
24079
|
+
const u = c.data;
|
|
24078
24080
|
this.processStack(
|
|
24079
|
-
|
|
24081
|
+
u,
|
|
24080
24082
|
r,
|
|
24081
24083
|
n,
|
|
24082
24084
|
a,
|
|
24083
24085
|
i
|
|
24084
24086
|
);
|
|
24085
|
-
const
|
|
24087
|
+
const h = u[2] === "^" ? ne.CHAR : ne.STACK;
|
|
24086
24088
|
this.processGeometries(
|
|
24087
24089
|
r,
|
|
24088
24090
|
n,
|
|
24089
24091
|
a,
|
|
24090
24092
|
i,
|
|
24091
|
-
|
|
24092
|
-
|
|
24093
|
+
o,
|
|
24094
|
+
h
|
|
24093
24095
|
);
|
|
24094
24096
|
}
|
|
24095
|
-
return (r.length > 0 || n.length > 0
|
|
24097
|
+
return s === Ke.NEW_PARAGRAPH && this.recordLineBreak(a, i), r.length > 0 || n.length > 0 ? this.processGeometries(
|
|
24096
24098
|
r,
|
|
24097
24099
|
n,
|
|
24098
24100
|
a,
|
|
24099
24101
|
i,
|
|
24100
|
-
|
|
24101
|
-
)
|
|
24102
|
+
o
|
|
24103
|
+
) : (a.length > 0 || i.length > 0) && this.processGeometries(
|
|
24104
|
+
r,
|
|
24105
|
+
n,
|
|
24106
|
+
a,
|
|
24107
|
+
i,
|
|
24108
|
+
o
|
|
24109
|
+
), this.processLastLine(), o;
|
|
24102
24110
|
}
|
|
24103
24111
|
processGeometries(e, r, n, a, i, s = ne.CHAR) {
|
|
24104
24112
|
if (e.length > 0 || r.length > 0) {
|
|
@@ -24110,6 +24118,9 @@ class zl {
|
|
|
24110
24118
|
s
|
|
24111
24119
|
);
|
|
24112
24120
|
i.add(o), this._currentLineObjects.push(o), e.length = 0, r.length = 0, n.length = 0, a.length = 0;
|
|
24121
|
+
} else if (n.length > 0 || a.length > 0) {
|
|
24122
|
+
const o = new D.Object3D();
|
|
24123
|
+
o.userData.bboxIntersectionCheck = !0, o.userData.charBoxType = s, o.userData.charBoxes = [...n, ...a], i.add(o), this._currentLineObjects.push(o), n.length = 0, a.length = 0;
|
|
24113
24124
|
}
|
|
24114
24125
|
}
|
|
24115
24126
|
processWord(e, r, n, a, i) {
|
|
@@ -24131,10 +24142,10 @@ class zl {
|
|
|
24131
24142
|
processStack(e, r, n, a, i) {
|
|
24132
24143
|
const [s, o, c] = e, u = this._hOffset, h = this._vOffset, d = this._currentContext.charTrackingFactor.value, f = this._currentContext.fontSize, g = this._currentContext.fontSizeScaleFactor;
|
|
24133
24144
|
this._hOffset = u, this._currentContext.charTrackingFactor = { value: 1, isRelative: !1 };
|
|
24134
|
-
let
|
|
24145
|
+
let x = 0;
|
|
24135
24146
|
for (let w = 0; w < s.length; w++) {
|
|
24136
24147
|
const k = this.getCharShape(s[w]);
|
|
24137
|
-
k && (
|
|
24148
|
+
k && (x += k.width * this.currentWidthFactor);
|
|
24138
24149
|
}
|
|
24139
24150
|
this._hOffset = u;
|
|
24140
24151
|
let v = 0;
|
|
@@ -24142,10 +24153,10 @@ class zl {
|
|
|
24142
24153
|
const k = this.getCharShape(o[w]);
|
|
24143
24154
|
k && (v += k.width * this.currentWidthFactor);
|
|
24144
24155
|
}
|
|
24145
|
-
const
|
|
24156
|
+
const S = Math.max(x, v), m = (S - x) / 2, F = (S - v) / 2;
|
|
24146
24157
|
if (c === "^") {
|
|
24147
24158
|
if (this._currentContext.fontSizeScaleFactor = g * 0.7, this.calcuateLineParams(), s && !o) {
|
|
24148
|
-
const w = [], k = [],
|
|
24159
|
+
const w = [], k = [], E = [], O = [];
|
|
24149
24160
|
this._hOffset = u, this._vOffset = this.convertTopAlignedVOffset(
|
|
24150
24161
|
h + f * 0.1,
|
|
24151
24162
|
this.currentFontSize
|
|
@@ -24155,12 +24166,12 @@ class zl {
|
|
|
24155
24166
|
s[B],
|
|
24156
24167
|
w,
|
|
24157
24168
|
k,
|
|
24158
|
-
|
|
24159
|
-
|
|
24169
|
+
E,
|
|
24170
|
+
O
|
|
24160
24171
|
);
|
|
24161
|
-
r.push(...w), n.push(...k), a.push(...
|
|
24172
|
+
r.push(...w), n.push(...k), a.push(...E), i.push(...O), this._hOffset = u + x;
|
|
24162
24173
|
} else if (!s && o) {
|
|
24163
|
-
const w = [], k = [],
|
|
24174
|
+
const w = [], k = [], E = [], O = [];
|
|
24164
24175
|
this._hOffset = u, this._vOffset = this.convertTopAlignedVOffset(
|
|
24165
24176
|
h - f * 0.6,
|
|
24166
24177
|
this.currentFontSize
|
|
@@ -24170,14 +24181,14 @@ class zl {
|
|
|
24170
24181
|
o[B],
|
|
24171
24182
|
w,
|
|
24172
24183
|
k,
|
|
24173
|
-
|
|
24174
|
-
|
|
24184
|
+
E,
|
|
24185
|
+
O
|
|
24175
24186
|
);
|
|
24176
|
-
r.push(...w), n.push(...k), a.push(...
|
|
24187
|
+
r.push(...w), n.push(...k), a.push(...E), i.push(...O), this._hOffset = u + v;
|
|
24177
24188
|
}
|
|
24178
24189
|
this._currentContext.fontSizeScaleFactor = g, this.calcuateLineParams();
|
|
24179
24190
|
} else {
|
|
24180
|
-
const w = [], k = [],
|
|
24191
|
+
const w = [], k = [], E = [], O = [];
|
|
24181
24192
|
this._hOffset = u + m, this._vOffset = this.convertTopAlignedVOffset(
|
|
24182
24193
|
h + this.currentFontSize * 0.3,
|
|
24183
24194
|
this.currentFontSize
|
|
@@ -24187,17 +24198,17 @@ class zl {
|
|
|
24187
24198
|
s[z],
|
|
24188
24199
|
w,
|
|
24189
24200
|
k,
|
|
24190
|
-
|
|
24191
|
-
|
|
24201
|
+
E,
|
|
24202
|
+
O
|
|
24192
24203
|
);
|
|
24193
|
-
r.push(...w), n.push(...k), a.push(...
|
|
24204
|
+
r.push(...w), n.push(...k), a.push(...E), i.push(...O), (c === "/" || c === "#") && this.recordStackDivider(
|
|
24194
24205
|
u,
|
|
24195
24206
|
h,
|
|
24196
|
-
|
|
24207
|
+
S,
|
|
24197
24208
|
a,
|
|
24198
24209
|
i
|
|
24199
24210
|
);
|
|
24200
|
-
const B = [],
|
|
24211
|
+
const B = [], L = [], H = [], W = [];
|
|
24201
24212
|
this._hOffset = u + F, this._vOffset = this.convertTopAlignedVOffset(
|
|
24202
24213
|
h - this.currentFontSize * 0.6,
|
|
24203
24214
|
this.currentFontSize
|
|
@@ -24206,25 +24217,25 @@ class zl {
|
|
|
24206
24217
|
this.processChar(
|
|
24207
24218
|
o[z],
|
|
24208
24219
|
B,
|
|
24209
|
-
|
|
24220
|
+
L,
|
|
24210
24221
|
H,
|
|
24211
24222
|
W
|
|
24212
24223
|
);
|
|
24213
|
-
if (r.push(...B), n.push(...
|
|
24214
|
-
const z = new
|
|
24224
|
+
if (r.push(...B), n.push(...L), a.push(...H), i.push(...W), c === "/" || c === "#") {
|
|
24225
|
+
const z = new D.BufferGeometry(), ce = new Float32Array([
|
|
24215
24226
|
u,
|
|
24216
24227
|
h - this.currentFontSize * 0.8 + this.defaultFontSize * zt,
|
|
24217
24228
|
0,
|
|
24218
|
-
u +
|
|
24229
|
+
u + S,
|
|
24219
24230
|
h - this.currentFontSize * 0.8 + this.defaultFontSize * zt,
|
|
24220
24231
|
0
|
|
24221
24232
|
]);
|
|
24222
24233
|
z.setAttribute(
|
|
24223
24234
|
"position",
|
|
24224
|
-
new
|
|
24235
|
+
new D.BufferAttribute(ce, 3)
|
|
24225
24236
|
), z.setIndex(null), z.userData = { isDecoration: !0 }, n.push(z);
|
|
24226
24237
|
}
|
|
24227
|
-
this._hOffset = u +
|
|
24238
|
+
this._hOffset = u + S;
|
|
24228
24239
|
}
|
|
24229
24240
|
this._vOffset = h, this._currentContext.charTrackingFactor = {
|
|
24230
24241
|
value: d,
|
|
@@ -24233,9 +24244,9 @@ class zl {
|
|
|
24233
24244
|
}
|
|
24234
24245
|
recordStackDivider(e, r, n, a, i) {
|
|
24235
24246
|
if (this._options.collectCharBoxes === !1) return;
|
|
24236
|
-
const s = r - this.currentFontSize * 0.8 + this.defaultFontSize * zt, o = new
|
|
24237
|
-
new
|
|
24238
|
-
new
|
|
24247
|
+
const s = r - this.currentFontSize * 0.8 + this.defaultFontSize * zt, o = new D.Box3(
|
|
24248
|
+
new D.Vector3(e, s, 0),
|
|
24249
|
+
new D.Vector3(e + n, s, 0)
|
|
24239
24250
|
);
|
|
24240
24251
|
this.resolveCharBoxTarget(a, i) === "mesh" ? a.push({
|
|
24241
24252
|
type: ne.CHAR,
|
|
@@ -24258,9 +24269,9 @@ class zl {
|
|
|
24258
24269
|
}
|
|
24259
24270
|
processBlank(e, r) {
|
|
24260
24271
|
if (this._options.collectCharBoxes !== !1) {
|
|
24261
|
-
const n = this._hOffset, a = this.flowDirection ==
|
|
24262
|
-
new
|
|
24263
|
-
new
|
|
24272
|
+
const n = this._hOffset, a = this.flowDirection == ze.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.defaultFontSize, i = new D.Box3(
|
|
24273
|
+
new D.Vector3(n, a, 0),
|
|
24274
|
+
new D.Vector3(
|
|
24264
24275
|
n + this._currentContext.blankWidth,
|
|
24265
24276
|
a + this.currentFontSize,
|
|
24266
24277
|
0
|
|
@@ -24282,7 +24293,10 @@ class zl {
|
|
|
24282
24293
|
}
|
|
24283
24294
|
recordLineBreak(e, r) {
|
|
24284
24295
|
if (this._options.collectCharBoxes === !1 || !e || !r) return;
|
|
24285
|
-
const n =
|
|
24296
|
+
const n = this.flowDirection == ze.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.defaultFontSize, a = new D.Box3(
|
|
24297
|
+
new D.Vector3(this._hOffset, n, 0),
|
|
24298
|
+
new D.Vector3(this._hOffset, n + this.currentLineHeight, 0)
|
|
24299
|
+
);
|
|
24286
24300
|
this.resolveCharBoxTarget(e, r) === "mesh" ? e.push({
|
|
24287
24301
|
type: ne.NEW_PARAGRAPH,
|
|
24288
24302
|
box: a,
|
|
@@ -24308,10 +24322,10 @@ class zl {
|
|
|
24308
24322
|
o.scale(this.currentWidthFactor, 1, 1);
|
|
24309
24323
|
let c = this._currentContext.oblique;
|
|
24310
24324
|
if (this._currentContext.italic && (c += 15), c) {
|
|
24311
|
-
const
|
|
24325
|
+
const S = c * Math.PI / 180, m = new D.Matrix4();
|
|
24312
24326
|
m.set(
|
|
24313
24327
|
1,
|
|
24314
|
-
Math.tan(
|
|
24328
|
+
Math.tan(S),
|
|
24315
24329
|
0,
|
|
24316
24330
|
0,
|
|
24317
24331
|
0,
|
|
@@ -24330,28 +24344,28 @@ class zl {
|
|
|
24330
24344
|
}
|
|
24331
24345
|
const u = this.fontManager.getFontType(this.currentFont);
|
|
24332
24346
|
this._currentContext.bold && u === "mesh" && o.scale(1.06, 1.06, 1), this.hOffset > (this.maxLineWidth || 1 / 0) && this.startNewLine(a, i);
|
|
24333
|
-
const h = this.hOffset, d = this.flowDirection ==
|
|
24347
|
+
const h = this.hOffset, d = this.flowDirection == ze.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.defaultFontSize, f = s.width * this.currentWidthFactor, g = this.currentFontSize;
|
|
24334
24348
|
if (o.translate(h, d, 0), this.currentHorizontalAlignment == we.DISTRIBUTED ? this._hOffset += s.width * this.currentWidthFactor : this._hOffset += s.width * this.currentWordSpace * this.currentWidthFactor, r.push(o), this._lineHasRenderableChar = !0, this._options.collectCharBoxes !== !1) {
|
|
24335
24349
|
o.userData.char = e, o.boundingBox || o.computeBoundingBox();
|
|
24336
|
-
const
|
|
24337
|
-
o instanceof
|
|
24350
|
+
const S = new D.Box3().copy(o.boundingBox);
|
|
24351
|
+
o instanceof D.ShapeGeometry ? (this._lastCharBoxTarget = "mesh", a.push({
|
|
24338
24352
|
type: ne.CHAR,
|
|
24339
|
-
box:
|
|
24353
|
+
box: S,
|
|
24340
24354
|
char: e,
|
|
24341
24355
|
children: []
|
|
24342
24356
|
})) : (this._lastCharBoxTarget = "line", i.push({
|
|
24343
24357
|
type: ne.CHAR,
|
|
24344
|
-
box:
|
|
24358
|
+
box: S,
|
|
24345
24359
|
char: e,
|
|
24346
24360
|
children: []
|
|
24347
24361
|
}));
|
|
24348
24362
|
}
|
|
24349
|
-
const
|
|
24363
|
+
const x = g * 0.05, v = 1e-3;
|
|
24350
24364
|
if (this._currentContext.underline) {
|
|
24351
|
-
const
|
|
24352
|
-
|
|
24365
|
+
const S = new D.BufferGeometry(), m = d - x;
|
|
24366
|
+
S.setAttribute(
|
|
24353
24367
|
"position",
|
|
24354
|
-
new
|
|
24368
|
+
new D.BufferAttribute(
|
|
24355
24369
|
new Float32Array([
|
|
24356
24370
|
h,
|
|
24357
24371
|
m,
|
|
@@ -24362,13 +24376,13 @@ class zl {
|
|
|
24362
24376
|
]),
|
|
24363
24377
|
3
|
|
24364
24378
|
)
|
|
24365
|
-
),
|
|
24379
|
+
), S.setIndex(null), S.userData = { isDecoration: !0 }, n.push(S);
|
|
24366
24380
|
}
|
|
24367
24381
|
if (this._currentContext.overline) {
|
|
24368
|
-
const
|
|
24369
|
-
|
|
24382
|
+
const S = new D.BufferGeometry(), m = d + g + x;
|
|
24383
|
+
S.setAttribute(
|
|
24370
24384
|
"position",
|
|
24371
|
-
new
|
|
24385
|
+
new D.BufferAttribute(
|
|
24372
24386
|
new Float32Array([
|
|
24373
24387
|
h,
|
|
24374
24388
|
m,
|
|
@@ -24379,13 +24393,13 @@ class zl {
|
|
|
24379
24393
|
]),
|
|
24380
24394
|
3
|
|
24381
24395
|
)
|
|
24382
|
-
),
|
|
24396
|
+
), S.setIndex(null), S.userData = { isDecoration: !0 }, n.push(S);
|
|
24383
24397
|
}
|
|
24384
24398
|
if (this._currentContext.strikeThrough) {
|
|
24385
|
-
const
|
|
24386
|
-
|
|
24399
|
+
const S = new D.BufferGeometry(), m = d + g / 2 - g * 0.2;
|
|
24400
|
+
S.setAttribute(
|
|
24387
24401
|
"position",
|
|
24388
|
-
new
|
|
24402
|
+
new D.BufferAttribute(
|
|
24389
24403
|
new Float32Array([
|
|
24390
24404
|
h,
|
|
24391
24405
|
m,
|
|
@@ -24396,7 +24410,7 @@ class zl {
|
|
|
24396
24410
|
]),
|
|
24397
24411
|
3
|
|
24398
24412
|
)
|
|
24399
|
-
),
|
|
24413
|
+
), S.setIndex(null), S.userData = { isDecoration: !0 }, n.push(S);
|
|
24400
24414
|
}
|
|
24401
24415
|
}
|
|
24402
24416
|
processLastLine() {
|
|
@@ -24443,12 +24457,12 @@ class zl {
|
|
|
24443
24457
|
this.recordLineBreak(e, r), this.advanceToNextLine();
|
|
24444
24458
|
}
|
|
24445
24459
|
advanceToNextLine() {
|
|
24446
|
-
this._hOffset = 0, this._lineHasRenderableChar ? this._pendingEmptyLineFontSizeAdjust = void 0 : this._pendingEmptyLineFontSizeAdjust = this.currentFontSize, this.flowDirection ==
|
|
24460
|
+
this._hOffset = 0, this._lineHasRenderableChar ? this._pendingEmptyLineFontSizeAdjust = void 0 : this._pendingEmptyLineFontSizeAdjust = this.currentFontSize, this.flowDirection == ze.BOTTOM_TO_TOP ? this._vOffset += this.currentLineHeight : this._vOffset -= this.currentLineHeight, this._lineCount++, this.processAlignment(), this._currentLineObjects = [], this._lineCount == 2 ? this._totalHeight = this.currentMaxFontSize : this._totalHeight = this._totalHeight + this.currentLineHeight, this._maxFontSize = 0, this._lineHasRenderableChar = !1;
|
|
24447
24461
|
}
|
|
24448
24462
|
applyPendingEmptyLineYAdjust() {
|
|
24449
24463
|
if (this._pendingEmptyLineFontSizeAdjust === void 0) return;
|
|
24450
24464
|
const e = this.currentFontSize - this._pendingEmptyLineFontSizeAdjust;
|
|
24451
|
-
e !== 0 && (this.flowDirection ==
|
|
24465
|
+
e !== 0 && (this.flowDirection == ze.BOTTOM_TO_TOP ? this._vOffset += e : this._vOffset -= e), this._pendingEmptyLineFontSizeAdjust = void 0;
|
|
24452
24466
|
}
|
|
24453
24467
|
resolveCharBoxTarget(e, r) {
|
|
24454
24468
|
return this._lastCharBoxTarget ? this._lastCharBoxTarget : e.length > 0 && r.length === 0 ? "mesh" : r.length > 0 && e.length === 0 ? "line" : this.fontManager.getFontType(this.currentFont) === "mesh" ? "mesh" : "line";
|
|
@@ -24474,7 +24488,7 @@ class zl {
|
|
|
24474
24488
|
var u;
|
|
24475
24489
|
const c = (u = s.userData) == null ? void 0 : u.charBoxes;
|
|
24476
24490
|
if (c && c.length > 0) {
|
|
24477
|
-
const h = new
|
|
24491
|
+
const h = new D.Vector3(o, 0, 0);
|
|
24478
24492
|
c.forEach((d) => {
|
|
24479
24493
|
var f;
|
|
24480
24494
|
return (f = d.box) == null ? void 0 : f.translate(h);
|
|
@@ -24532,7 +24546,7 @@ class zl {
|
|
|
24532
24546
|
* @returns Return three.js object created from the specified text shape geometries
|
|
24533
24547
|
*/
|
|
24534
24548
|
toThreeObject(e, r, n, a, i) {
|
|
24535
|
-
const s = new
|
|
24549
|
+
const s = new D.Group(), o = this._currentContext.getColorAsHex(), c = this.styleManager.getMeshBasicMaterial({
|
|
24536
24550
|
layer: this._style.layer,
|
|
24537
24551
|
isByLayer: this._style.isByLayer,
|
|
24538
24552
|
color: o
|
|
@@ -24540,18 +24554,18 @@ class zl {
|
|
|
24540
24554
|
layer: this._style.layer,
|
|
24541
24555
|
isByLayer: this._style.isByLayer,
|
|
24542
24556
|
color: o
|
|
24543
|
-
}), h = this._options.collectCharBoxes !== !1, d = e.filter((g) => g instanceof
|
|
24557
|
+
}), h = this._options.collectCharBoxes !== !1, d = e.filter((g) => g instanceof D.ShapeGeometry);
|
|
24544
24558
|
if (d.length > 0) {
|
|
24545
|
-
const g = d.length > 1 ? pa(d) : d[0],
|
|
24546
|
-
|
|
24559
|
+
const g = d.length > 1 ? pa(d) : d[0], x = new D.Mesh(g, c);
|
|
24560
|
+
x.userData.bboxIntersectionCheck = !0, x.userData.charBoxType = i, h && n.length > 0 && (x.userData.charBoxes = n.slice()), s.add(x);
|
|
24547
24561
|
}
|
|
24548
24562
|
const f = [
|
|
24549
24563
|
...r,
|
|
24550
|
-
...e.filter((g) => !(g instanceof
|
|
24564
|
+
...e.filter((g) => !(g instanceof D.ShapeGeometry))
|
|
24551
24565
|
];
|
|
24552
24566
|
if (f.length > 0) {
|
|
24553
|
-
const g = f.length > 1 ? pa(f) : f[0],
|
|
24554
|
-
|
|
24567
|
+
const g = f.length > 1 ? pa(f) : f[0], x = new D.LineSegments(g, u);
|
|
24568
|
+
x.userData.bboxIntersectionCheck = !0, x.userData.charBoxType = i, h && a.length > 0 && (x.userData.charBoxes = a.slice()), s.add(x);
|
|
24555
24569
|
}
|
|
24556
24570
|
return s.children.length === 1 ? s.children[0] : s;
|
|
24557
24571
|
}
|
|
@@ -24562,8 +24576,8 @@ class zl {
|
|
|
24562
24576
|
this.calcuateLineParams(e);
|
|
24563
24577
|
}
|
|
24564
24578
|
}
|
|
24565
|
-
const Br = /* @__PURE__ */ new
|
|
24566
|
-
class Qt extends
|
|
24579
|
+
const Br = /* @__PURE__ */ new D.Vector3(), $e = /* @__PURE__ */ new D.Vector3(), Or = /* @__PURE__ */ new D.Vector3(), Lr = /* @__PURE__ */ new D.Quaternion(), Rr = /* @__PURE__ */ new D.Matrix4(), Ra = /* @__PURE__ */ new D.Matrix4(), Ma = /* @__PURE__ */ new D.Vector3(1, 0, 0);
|
|
24580
|
+
class Qt extends D.Object3D {
|
|
24567
24581
|
/**
|
|
24568
24582
|
* Extracts all unique font names used in an MText string.
|
|
24569
24583
|
* This function searches for font commands in the format \f{fontname}| or \f{fontname}; and returns a set of unique font names.
|
|
@@ -24597,7 +24611,7 @@ class Qt extends _.Object3D {
|
|
|
24597
24611
|
super(), this._style = r, this._styleManager = n, this._fontManager = a, this._colorSettings = {
|
|
24598
24612
|
byLayerColor: i.byLayerColor,
|
|
24599
24613
|
byBlockColor: i.byBlockColor
|
|
24600
|
-
}, this._box = new
|
|
24614
|
+
}, this._box = new D.Box3(), this._charBoxes = [], this._mtextData = e, this._fontsInStyleLoaded = !1;
|
|
24601
24615
|
}
|
|
24602
24616
|
/**
|
|
24603
24617
|
* Gets the font manager instance associated with this MText object.
|
|
@@ -24717,24 +24731,34 @@ class Qt extends _.Object3D {
|
|
|
24717
24731
|
const { object: n, height: a } = this.createMTextGroup(e, r);
|
|
24718
24732
|
if (!n)
|
|
24719
24733
|
return;
|
|
24720
|
-
n.matrix.decompose(
|
|
24734
|
+
n.matrix.decompose($e, Lr, Or), e.position && ($e.x += e.position.x, $e.y += e.position.y, n.matrix.compose($e, Lr, Or));
|
|
24721
24735
|
const i = e.width, s = this.calculateAnchorPoint(
|
|
24722
24736
|
i,
|
|
24723
24737
|
a,
|
|
24724
24738
|
e.attachmentPoint,
|
|
24725
24739
|
e.drawingDirection
|
|
24726
|
-
)
|
|
24727
|
-
|
|
24728
|
-
|
|
24740
|
+
), o = (h) => {
|
|
24741
|
+
if (!h || h.length === 0) return;
|
|
24742
|
+
const d = new D.Vector3(s.x, s.y, 0), f = (g) => {
|
|
24743
|
+
var x;
|
|
24744
|
+
(x = g.box) == null || x.translate(d), g.children && g.children.length > 0 && g.children.forEach(f);
|
|
24745
|
+
};
|
|
24746
|
+
h.forEach(f);
|
|
24747
|
+
};
|
|
24748
|
+
n.traverse((h) => {
|
|
24749
|
+
var d;
|
|
24750
|
+
"geometry" in h ? h.geometry.translate(s.x, s.y, 0) : o(
|
|
24751
|
+
(d = h.userData) == null ? void 0 : d.charBoxes
|
|
24752
|
+
), h.layers.enableAll();
|
|
24729
24753
|
});
|
|
24730
|
-
let
|
|
24754
|
+
let c = e.rotation || 0;
|
|
24731
24755
|
if (e.directionVector) {
|
|
24732
|
-
const
|
|
24733
|
-
|
|
24756
|
+
const h = e.directionVector, d = new D.Vector3(h.x, h.y, h.z), f = d.clone().cross(Ma), g = Ma.angleTo(d);
|
|
24757
|
+
c = f.z > 0 ? -g : g;
|
|
24734
24758
|
}
|
|
24735
|
-
n.matrix.compose(
|
|
24736
|
-
const
|
|
24737
|
-
return Rr.makeTranslation(-
|
|
24759
|
+
n.matrix.compose($e, Lr, Or);
|
|
24760
|
+
const u = e.position ? $e.clone().sub(e.position) : $e;
|
|
24761
|
+
return Rr.makeTranslation(-u.x, -u.y, 0), Ra.makeRotationZ(c), n.matrix.multiply(Rr), n.matrix.multiply(Ra), n.matrix.multiply(Rr.invert()), n.matrix.decompose(n.position, n.quaternion, n.scale), n;
|
|
24738
24762
|
}
|
|
24739
24763
|
/**
|
|
24740
24764
|
* Creates a group of text elements from MText data.
|
|
@@ -24752,7 +24776,7 @@ class Qt extends _.Object3D {
|
|
|
24752
24776
|
e.width && e.attachmentPoint && ([1, 4, 7].includes(e.attachmentPoint) ? a = we.LEFT : [2, 5, 8].includes(e.attachmentPoint) ? a = we.CENTER : [3, 6, 9].includes(e.attachmentPoint) && (a = we.RIGHT));
|
|
24753
24777
|
let i = gt.BOTTOM;
|
|
24754
24778
|
e.attachmentPoint && ([1, 2, 3].includes(e.attachmentPoint) ? i = gt.TOP : [4, 5, 6].includes(e.attachmentPoint) ? i = gt.MIDDLE : [7, 8, 9].includes(e.attachmentPoint) && (i = gt.BOTTOM));
|
|
24755
|
-
const s = e.height || 0, o = e.lineSpaceFactor || 0.3, c = e.drawingDirection ??
|
|
24779
|
+
const s = e.height || 0, o = e.lineSpaceFactor || 0.3, c = e.drawingDirection ?? ze.LEFT_TO_RIGHT, u = {
|
|
24756
24780
|
fontSize: s,
|
|
24757
24781
|
widthFactor: e.widthFactor ?? 1,
|
|
24758
24782
|
lineSpaceFactor: o,
|
|
@@ -24822,7 +24846,7 @@ class Qt extends _.Object3D {
|
|
|
24822
24846
|
i -= e, s += r;
|
|
24823
24847
|
break;
|
|
24824
24848
|
}
|
|
24825
|
-
return a ==
|
|
24849
|
+
return a == ze.BOTTOM_TO_TOP && (s -= r), { x: i, y: s };
|
|
24826
24850
|
}
|
|
24827
24851
|
/**
|
|
24828
24852
|
* Recursively calculates bounding boxes for an object and its children.
|
|
@@ -24842,11 +24866,11 @@ class Qt extends _.Object3D {
|
|
|
24842
24866
|
r.push(...u);
|
|
24843
24867
|
return;
|
|
24844
24868
|
}
|
|
24845
|
-
if (e instanceof
|
|
24869
|
+
if (e instanceof D.Line || e instanceof D.Mesh) {
|
|
24846
24870
|
const c = e.geometry;
|
|
24847
24871
|
if (!((o = c.userData) != null && o.isDecoration)) {
|
|
24848
24872
|
c.boundingBox === null && c.computeBoundingBox();
|
|
24849
|
-
const u = new
|
|
24873
|
+
const u = new D.Box3().copy(c.boundingBox);
|
|
24850
24874
|
u.applyMatrix4(e.matrixWorld), r.push({
|
|
24851
24875
|
type: ne.CHAR,
|
|
24852
24876
|
box: u,
|
|
@@ -24896,13 +24920,13 @@ class Pi {
|
|
|
24896
24920
|
}
|
|
24897
24921
|
getMeshBasicMaterial(e) {
|
|
24898
24922
|
const r = this.buildKey(e);
|
|
24899
|
-
return this.meshBasicMaterials[r] || (this.meshBasicMaterials[r] = new
|
|
24923
|
+
return this.meshBasicMaterials[r] || (this.meshBasicMaterials[r] = new D.MeshBasicMaterial({
|
|
24900
24924
|
color: e.color
|
|
24901
24925
|
})), this.meshBasicMaterials[r];
|
|
24902
24926
|
}
|
|
24903
24927
|
getLineBasicMaterial(e) {
|
|
24904
24928
|
const r = this.buildKey(e);
|
|
24905
|
-
return this.lineBasicMaterials[r] || (this.lineBasicMaterials[r] = new
|
|
24929
|
+
return this.lineBasicMaterials[r] || (this.lineBasicMaterials[r] = new D.LineBasicMaterial({
|
|
24906
24930
|
color: e.color
|
|
24907
24931
|
})), this.lineBasicMaterials[r];
|
|
24908
24932
|
}
|
|
@@ -25076,15 +25100,15 @@ class Wl {
|
|
|
25076
25100
|
* Reconstruct MText object from JSON serialized data
|
|
25077
25101
|
*/
|
|
25078
25102
|
reconstructMText(e, r) {
|
|
25079
|
-
const n = new
|
|
25103
|
+
const n = new D.Group();
|
|
25080
25104
|
return e.children.forEach((a) => {
|
|
25081
|
-
const i = new
|
|
25105
|
+
const i = new D.BufferGeometry();
|
|
25082
25106
|
if (Object.keys(a.geometry.attributes).forEach((c) => {
|
|
25083
25107
|
const u = a.geometry.attributes[c], h = new Float32Array(
|
|
25084
25108
|
u.arrayBuffer,
|
|
25085
25109
|
u.byteOffset,
|
|
25086
25110
|
u.length
|
|
25087
|
-
), d = new
|
|
25111
|
+
), d = new D.BufferAttribute(
|
|
25088
25112
|
h,
|
|
25089
25113
|
u.itemSize,
|
|
25090
25114
|
u.normalized
|
|
@@ -25097,14 +25121,14 @@ class Wl {
|
|
|
25097
25121
|
a.geometry.index.byteOffset,
|
|
25098
25122
|
a.geometry.index.length
|
|
25099
25123
|
);
|
|
25100
|
-
i.setIndex(new
|
|
25124
|
+
i.setIndex(new D.Uint32BufferAttribute(u, 1));
|
|
25101
25125
|
} else {
|
|
25102
25126
|
const u = new Uint16Array(
|
|
25103
25127
|
a.geometry.index.arrayBuffer,
|
|
25104
25128
|
a.geometry.index.byteOffset,
|
|
25105
25129
|
a.geometry.index.length
|
|
25106
25130
|
);
|
|
25107
|
-
i.setIndex(new
|
|
25131
|
+
i.setIndex(new D.Uint16BufferAttribute(u, 1));
|
|
25108
25132
|
}
|
|
25109
25133
|
let s;
|
|
25110
25134
|
a.type === "mesh" ? (s = this.defaultStyleManager.getMeshBasicMaterial({
|
|
@@ -25117,7 +25141,7 @@ class Wl {
|
|
|
25117
25141
|
color: a.material.color
|
|
25118
25142
|
}), a.material.transparent !== void 0 && (s.transparent = a.material.transparent), a.material.opacity !== void 0 && (s.opacity = a.material.opacity), a.material.linewidth !== void 0 && (s.linewidth = a.material.linewidth));
|
|
25119
25143
|
let o;
|
|
25120
|
-
a.type === "mesh" ? o = new
|
|
25144
|
+
a.type === "mesh" ? o = new D.Mesh(i, s) : o = new D.LineSegments(
|
|
25121
25145
|
i,
|
|
25122
25146
|
s
|
|
25123
25147
|
), i.boundingBox || i.computeBoundingBox(), i.boundingSphere || i.computeBoundingSphere(), o.position.set(
|
|
@@ -25130,13 +25154,13 @@ class Wl {
|
|
|
25130
25154
|
a.rotation.z,
|
|
25131
25155
|
a.rotation.w
|
|
25132
25156
|
), o.scale.set(a.scale.x, a.scale.y, a.scale.z), n.add(o);
|
|
25133
|
-
}), n.box = new
|
|
25134
|
-
new
|
|
25157
|
+
}), n.box = new D.Box3(
|
|
25158
|
+
new D.Vector3(
|
|
25135
25159
|
e.box.min.x,
|
|
25136
25160
|
e.box.min.y,
|
|
25137
25161
|
e.box.min.z
|
|
25138
25162
|
),
|
|
25139
|
-
new
|
|
25163
|
+
new D.Vector3(
|
|
25140
25164
|
e.box.max.x,
|
|
25141
25165
|
e.box.max.y,
|
|
25142
25166
|
e.box.max.z
|
|
@@ -25317,13 +25341,13 @@ export {
|
|
|
25317
25341
|
Pa as BaseFont,
|
|
25318
25342
|
Na as BaseTextShape,
|
|
25319
25343
|
ne as CharBoxType,
|
|
25320
|
-
|
|
25344
|
+
Ol as DefaultFontLoader,
|
|
25321
25345
|
Sn as EventManager,
|
|
25322
|
-
|
|
25346
|
+
qe as FontFactory,
|
|
25323
25347
|
Re as FontManager,
|
|
25324
25348
|
Qt as MText,
|
|
25325
25349
|
_l as MTextAttachmentPoint,
|
|
25326
|
-
|
|
25350
|
+
ze as MTextFlowDirection,
|
|
25327
25351
|
ql as MainThreadRenderer,
|
|
25328
25352
|
Yr as STACK_DIVIDER_CHAR,
|
|
25329
25353
|
Zl as UnifiedRenderer,
|