@mlightcad/mtext-renderer 0.12.6 → 0.12.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +948 -826
- package/dist/index.umd.cjs +8 -8
- package/dist/mtext-renderer-worker.js +715 -634
- package/lib/font/fontManager.d.ts +37 -0
- package/lib/worker/unifiedRenderer.d.ts +8 -0
- package/lib/worker/webWorkerRenderer.d.ts +11 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -315,7 +315,7 @@ function na(t) {
|
|
|
315
315
|
function Bo(t) {
|
|
316
316
|
return t.disposed === !0 ? !0 : Object.keys(t.attributes).length === 0 && t.index == null;
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function Mo(t) {
|
|
319
319
|
return t ? t.length * 2 : 0;
|
|
320
320
|
}
|
|
321
321
|
function ra(t) {
|
|
@@ -417,9 +417,9 @@ class zr {
|
|
|
417
417
|
this.map.clear();
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
|
-
const
|
|
420
|
+
const Do = 4096;
|
|
421
421
|
class _o {
|
|
422
|
-
constructor(e =
|
|
422
|
+
constructor(e = Do) {
|
|
423
423
|
this.maxSize = e, this.cache = new zr(e, (n, r) => {
|
|
424
424
|
r.dispose();
|
|
425
425
|
});
|
|
@@ -522,7 +522,7 @@ class ia extends I.Shape {
|
|
|
522
522
|
return this.width > 0;
|
|
523
523
|
}
|
|
524
524
|
}
|
|
525
|
-
class
|
|
525
|
+
class Fe {
|
|
526
526
|
/**
|
|
527
527
|
* Converts an unsigned byte to a signed byte as used in SHX format.
|
|
528
528
|
* Values > 127 are converted to their signed equivalent (-128 to -1).
|
|
@@ -678,11 +678,11 @@ class ke {
|
|
|
678
678
|
);
|
|
679
679
|
}
|
|
680
680
|
}
|
|
681
|
-
var
|
|
681
|
+
var K = /* @__PURE__ */ ((t) => (t.SHAPES = "shapes", t.BIGFONT = "bigfont", t.UNIFONT = "unifont", t))(K || {});
|
|
682
682
|
class Uo {
|
|
683
683
|
parse(e) {
|
|
684
684
|
const n = this.parseHeader(e).split(" "), r = n[1].toLocaleLowerCase();
|
|
685
|
-
if (!Object.values(
|
|
685
|
+
if (!Object.values(K).includes(r))
|
|
686
686
|
throw new Error(`Invalid font type: ${r}`);
|
|
687
687
|
return {
|
|
688
688
|
fileHeader: n[0],
|
|
@@ -984,11 +984,11 @@ class Ho {
|
|
|
984
984
|
class zo {
|
|
985
985
|
static createParser(e) {
|
|
986
986
|
switch (e) {
|
|
987
|
-
case
|
|
987
|
+
case K.SHAPES:
|
|
988
988
|
return new No();
|
|
989
|
-
case
|
|
989
|
+
case K.BIGFONT:
|
|
990
990
|
return new Go();
|
|
991
|
-
case
|
|
991
|
+
case K.UNIFONT:
|
|
992
992
|
return new Ho();
|
|
993
993
|
default:
|
|
994
994
|
throw new Error(`Unsupported font type: ${e}`);
|
|
@@ -1005,7 +1005,7 @@ class Wo {
|
|
|
1005
1005
|
return !1;
|
|
1006
1006
|
}
|
|
1007
1007
|
}
|
|
1008
|
-
class
|
|
1008
|
+
class Fn extends Wo {
|
|
1009
1009
|
constructor(e = ms) {
|
|
1010
1010
|
super(), this.cellWidthFactor = e;
|
|
1011
1011
|
}
|
|
@@ -1027,17 +1027,17 @@ class kn extends Wo {
|
|
|
1027
1027
|
if (!e.polylines.some((a) => a.length >= 2))
|
|
1028
1028
|
return n * r;
|
|
1029
1029
|
const s = n * r, { maxX: i } = e.bbox;
|
|
1030
|
-
return
|
|
1030
|
+
return Fn.isCenterOriginGlyph(e) ? Math.max(i, n / 2) + s : i + s;
|
|
1031
1031
|
}
|
|
1032
1032
|
resolve(e, n) {
|
|
1033
1033
|
var r;
|
|
1034
|
-
return e.hasExplicitAdvance ? ((r = e.lastPoint) == null ? void 0 : r.x) ?? 0 :
|
|
1034
|
+
return e.hasExplicitAdvance ? ((r = e.lastPoint) == null ? void 0 : r.x) ?? 0 : Fn.computeAdvance(e, n, this.cellWidthFactor);
|
|
1035
1035
|
}
|
|
1036
1036
|
markAlignedAdvanceExplicit(e) {
|
|
1037
1037
|
return !0;
|
|
1038
1038
|
}
|
|
1039
1039
|
}
|
|
1040
|
-
const Nn = new
|
|
1040
|
+
const Nn = new Fn();
|
|
1041
1041
|
class se {
|
|
1042
1042
|
/**
|
|
1043
1043
|
* Creates a new Point instance.
|
|
@@ -1355,7 +1355,7 @@ function Gn(t, e) {
|
|
|
1355
1355
|
};
|
|
1356
1356
|
}
|
|
1357
1357
|
function Jo(t, e, n) {
|
|
1358
|
-
if (t.header.fontType !==
|
|
1358
|
+
if (t.header.fontType !== K.SHAPES || !(0 in t.content.data))
|
|
1359
1359
|
return !1;
|
|
1360
1360
|
const r = -(n.descenderHeight + n.capHeight * 0.2);
|
|
1361
1361
|
return e.bbox.minY < r;
|
|
@@ -1365,7 +1365,7 @@ function ua(t, e) {
|
|
|
1365
1365
|
return !(t.bbox.minY < n || t.bbox.maxY - t.bbox.minY < e.capHeight * 0.05);
|
|
1366
1366
|
}
|
|
1367
1367
|
function Qo(t, e, n) {
|
|
1368
|
-
if (t.header.fontType !==
|
|
1368
|
+
if (t.header.fontType !== K.BIGFONT || t.content.baseDown > 0)
|
|
1369
1369
|
return 0;
|
|
1370
1370
|
const { height: r } = t.content;
|
|
1371
1371
|
if (r <= 0)
|
|
@@ -1395,7 +1395,7 @@ function Qo(t, e, n) {
|
|
|
1395
1395
|
return i.length % 2 === 0 ? (i[c - 1] + i[c]) / 2 : i[c];
|
|
1396
1396
|
}
|
|
1397
1397
|
function ec(t, e, n) {
|
|
1398
|
-
if (t.header.fontType !==
|
|
1398
|
+
if (t.header.fontType !== K.UNIFONT)
|
|
1399
1399
|
return !1;
|
|
1400
1400
|
if (t.content.dualOrientation)
|
|
1401
1401
|
return !0;
|
|
@@ -1412,13 +1412,13 @@ function ec(t, e, n) {
|
|
|
1412
1412
|
function tc(t, e, n, r = Nn, s = !1, i = 0) {
|
|
1413
1413
|
var a;
|
|
1414
1414
|
let o = t;
|
|
1415
|
-
if (e.header.fontType ===
|
|
1415
|
+
if (e.header.fontType === K.BIGFONT && i > 0) {
|
|
1416
1416
|
const u = e.content.height > 0 ? n.size / e.content.height : 1;
|
|
1417
1417
|
o = o.offset(new se(0, -i * u), !0);
|
|
1418
1418
|
}
|
|
1419
|
-
if (e.header.fontType ===
|
|
1420
|
-
const u = e.header.fontType ===
|
|
1421
|
-
(e.header.fontType !==
|
|
1419
|
+
if (e.header.fontType === K.UNIFONT || Jo(e, t, n)) {
|
|
1420
|
+
const u = e.header.fontType === K.UNIFONT && (s || e.content.dualOrientation || ua(t, n));
|
|
1421
|
+
(e.header.fontType !== K.UNIFONT || !u) && (o = o.offset(new se(0, n.capHeight), !0));
|
|
1422
1422
|
}
|
|
1423
1423
|
const c = r.resolve(o, n.cellWidth), l = r.markAlignedAdvanceExplicit(o) ? !0 : o.hasExplicitAdvance;
|
|
1424
1424
|
return new Bt(
|
|
@@ -1540,7 +1540,7 @@ class ic {
|
|
|
1540
1540
|
* @returns The parsed shape or undefined if the character is not found
|
|
1541
1541
|
*/
|
|
1542
1542
|
getCharShape(e, n) {
|
|
1543
|
-
const r = this.fontData.header.fontType ===
|
|
1543
|
+
const r = this.fontData.header.fontType === K.SHAPES && !(0 in this.fontData.content.data) ? n : n / this.fontData.content.height;
|
|
1544
1544
|
return this.parseAndScale(e, { factor: r });
|
|
1545
1545
|
}
|
|
1546
1546
|
/**
|
|
@@ -1558,7 +1558,7 @@ class ic {
|
|
|
1558
1558
|
else {
|
|
1559
1559
|
const s = this.fontData.content.data;
|
|
1560
1560
|
if (s[e]) {
|
|
1561
|
-
const i = this.prepareBigfontGlyphBytecode(e, s[e]), a = this.fontData.header.fontType !==
|
|
1561
|
+
const i = this.prepareBigfontGlyphBytecode(e, s[e]), a = this.fontData.header.fontType !== K.BIGFONT;
|
|
1562
1562
|
r = this.parseShape(i, { flushOnEnd: !0, initialPenDown: a }), this.shapeData.set(e, r), this.shapeCache.set(e, r);
|
|
1563
1563
|
}
|
|
1564
1564
|
}
|
|
@@ -1574,7 +1574,7 @@ class ic {
|
|
|
1574
1574
|
}
|
|
1575
1575
|
/** Strips the embedded character-code prefix from dual-byte BIGFONT parent glyphs. */
|
|
1576
1576
|
prepareBigfontGlyphBytecode(e, n) {
|
|
1577
|
-
if (this.fontData.header.fontType !==
|
|
1577
|
+
if (this.fontData.header.fontType !== K.BIGFONT || e <= 255)
|
|
1578
1578
|
return n;
|
|
1579
1579
|
const r = e >> 8 & 255, s = e & 255;
|
|
1580
1580
|
if (n.length >= 2 && n[0] === r && n[1] === s) {
|
|
@@ -1630,7 +1630,7 @@ class ic {
|
|
|
1630
1630
|
*/
|
|
1631
1631
|
shouldSkipVerticalFlagCommand(e = !1) {
|
|
1632
1632
|
const { content: n, header: r } = this.fontData;
|
|
1633
|
-
return r.fontType ===
|
|
1633
|
+
return r.fontType === K.BIGFONT ? !n.verticalDualMode : n.dualOrientation ? !e : n.orientation === "horizontal";
|
|
1634
1634
|
}
|
|
1635
1635
|
/** Marks that bytecode explicitly defines horizontal advance. */
|
|
1636
1636
|
markAdvanceDefined(e) {
|
|
@@ -1829,22 +1829,22 @@ class ic {
|
|
|
1829
1829
|
let s = n, i = 0, a, o = r.scale * this.fontData.content.baseUp, c = o;
|
|
1830
1830
|
const l = r.currentPoint.clone();
|
|
1831
1831
|
switch (r.currentPolyline.length > 1 && (r.polylines.push(r.currentPolyline.slice()), r.currentPolyline = []), this.fontData.header.fontType) {
|
|
1832
|
-
case
|
|
1832
|
+
case K.SHAPES:
|
|
1833
1833
|
s++, i = e[s];
|
|
1834
1834
|
break;
|
|
1835
|
-
case
|
|
1835
|
+
case K.BIGFONT:
|
|
1836
1836
|
if (s++, this.isVerticalDualBigfontMarker(e, s, "open"))
|
|
1837
1837
|
return s;
|
|
1838
1838
|
if (this.isVerticalDualBigfontMarker(e, s, "close"))
|
|
1839
1839
|
return s + 1;
|
|
1840
|
-
i = e[s], i === 0 && (s++, i = e[s++] << 8 | e[s++], l.x =
|
|
1840
|
+
i = e[s], i === 0 && (s++, i = e[s++] << 8 | e[s++], l.x = Fe.byteToSByte(e[s++]) * r.scale, l.y = Fe.byteToSByte(e[s++]) * r.scale, this.fontData.content.isExtended ? (c = e[s++] * r.scale, o = e[s] * r.scale) : (o = e[s] * r.scale, c = o));
|
|
1841
1841
|
break;
|
|
1842
|
-
case
|
|
1842
|
+
case K.UNIFONT:
|
|
1843
1843
|
s++, i = e[s++] << 8 | e[s++], s--;
|
|
1844
1844
|
break;
|
|
1845
1845
|
}
|
|
1846
1846
|
if (i !== 0)
|
|
1847
|
-
if (this.fontData.header.fontType ===
|
|
1847
|
+
if (this.fontData.header.fontType === K.UNIFONT) {
|
|
1848
1848
|
const u = r.isPenDown;
|
|
1849
1849
|
a = this.getScaledSubshapeAtInsertPoint(
|
|
1850
1850
|
i,
|
|
@@ -1853,7 +1853,7 @@ class ic {
|
|
|
1853
1853
|
l,
|
|
1854
1854
|
u
|
|
1855
1855
|
), a != null && a.polylines.some((f) => f.length >= 2) && (r.polylines.push(...a.polylines.slice()), a.lastPoint && (r.currentPoint = a.lastPoint.clone()), r.currentPolyline = [], r.isPenDown && r.currentPolyline.push(r.currentPoint.clone()));
|
|
1856
|
-
} else if (this.fontData.header.fontType ===
|
|
1856
|
+
} else if (this.fontData.header.fontType === K.SHAPES)
|
|
1857
1857
|
a = this.getScaledSubshapeAtInsertPoint(
|
|
1858
1858
|
i,
|
|
1859
1859
|
c,
|
|
@@ -1877,13 +1877,13 @@ class ic {
|
|
|
1877
1877
|
handleXYDisplacement(e, n, r) {
|
|
1878
1878
|
let s = n;
|
|
1879
1879
|
const i = new se();
|
|
1880
|
-
return i.x =
|
|
1880
|
+
return i.x = Fe.byteToSByte(e[++s]), i.y = Fe.byteToSByte(e[++s]), r.currentPoint.add(i.multiply(r.scale)), r.isPenDown ? r.currentPolyline.push(r.currentPoint.clone()) : this.notePenUpPositioning(r), s;
|
|
1881
1881
|
}
|
|
1882
1882
|
handleMultipleXYDisplacements(e, n, r) {
|
|
1883
1883
|
let s = n;
|
|
1884
1884
|
for (; !(s + 1 >= e.length); ) {
|
|
1885
1885
|
const i = new se();
|
|
1886
|
-
if (i.x =
|
|
1886
|
+
if (i.x = Fe.byteToSByte(e[++s]), i.y = Fe.byteToSByte(e[++s]), i.x === 0 && i.y === 0)
|
|
1887
1887
|
break;
|
|
1888
1888
|
r.currentPoint.add(i.multiply(r.scale)), r.isPenDown ? r.currentPolyline.push(r.currentPoint.clone()) : this.notePenUpPositioning(r);
|
|
1889
1889
|
}
|
|
@@ -1891,14 +1891,14 @@ class ic {
|
|
|
1891
1891
|
}
|
|
1892
1892
|
handleOctantArc(e, n, r) {
|
|
1893
1893
|
let s = n;
|
|
1894
|
-
const i = e[++s] * r.scale, a =
|
|
1894
|
+
const i = e[++s] * r.scale, a = Fe.byteToSByte(e[++s]), o = (a & 112) >> 4;
|
|
1895
1895
|
let c = a & 7;
|
|
1896
1896
|
const l = a < 0, u = Math.PI / 4 * o, f = r.currentPoint.clone().subtract(new se(Math.cos(u) * i, Math.sin(u) * i)), h = Zt.fromOctant(f, i, o, c, l).tessellate();
|
|
1897
1897
|
return r.isPenDown && (r.currentPolyline.pop(), r.currentPolyline.push(...h.slice())), r.currentPoint = h[h.length - 1].clone(), s;
|
|
1898
1898
|
}
|
|
1899
1899
|
handleFractionalArc(e, n, r) {
|
|
1900
1900
|
let s = n;
|
|
1901
|
-
const i = e[++s], a = e[++s], o = e[++s], c = e[++s], l = (o * 255 + c) * r.scale, u =
|
|
1901
|
+
const i = e[++s], a = e[++s], o = e[++s], c = e[++s], l = (o * 255 + c) * r.scale, u = Fe.byteToSByte(e[++s]), f = (u & 112) >> 4;
|
|
1902
1902
|
let h = u & 7;
|
|
1903
1903
|
h === 0 && (h = 8), a !== 0 && h--;
|
|
1904
1904
|
const p = Math.PI / 4;
|
|
@@ -1929,8 +1929,8 @@ class ic {
|
|
|
1929
1929
|
handleBulgeArc(e, n, r) {
|
|
1930
1930
|
let s = n;
|
|
1931
1931
|
const i = new se();
|
|
1932
|
-
i.x =
|
|
1933
|
-
const a =
|
|
1932
|
+
i.x = Fe.byteToSByte(e[++s]), i.y = Fe.byteToSByte(e[++s]);
|
|
1933
|
+
const a = Fe.byteToSByte(e[++s]);
|
|
1934
1934
|
return r.currentPoint = this.handleArcSegment(
|
|
1935
1935
|
r.currentPoint,
|
|
1936
1936
|
i,
|
|
@@ -1944,9 +1944,9 @@ class ic {
|
|
|
1944
1944
|
let s = n;
|
|
1945
1945
|
for (; !(s + 1 >= e.length); ) {
|
|
1946
1946
|
const i = new se();
|
|
1947
|
-
if (i.x =
|
|
1947
|
+
if (i.x = Fe.byteToSByte(e[++s]), i.y = Fe.byteToSByte(e[++s]), i.x === 0 && i.y === 0 || s + 1 >= e.length)
|
|
1948
1948
|
break;
|
|
1949
|
-
const a =
|
|
1949
|
+
const a = Fe.byteToSByte(e[++s]);
|
|
1950
1950
|
r.currentPoint = this.handleArcSegment(
|
|
1951
1951
|
r.currentPoint,
|
|
1952
1952
|
i,
|
|
@@ -1976,13 +1976,13 @@ class ic {
|
|
|
1976
1976
|
break;
|
|
1977
1977
|
case 7:
|
|
1978
1978
|
switch (this.fontData.header.fontType) {
|
|
1979
|
-
case
|
|
1979
|
+
case K.SHAPES:
|
|
1980
1980
|
n++;
|
|
1981
1981
|
break;
|
|
1982
|
-
case
|
|
1982
|
+
case K.BIGFONT:
|
|
1983
1983
|
n++, this.isVerticalDualBigfontMarker(e, n, "open") ? n++ : this.isVerticalDualBigfontMarker(e, n, "close") ? n += 2 : e[n] === 0 && (n += this.fontData.content.isExtended ? 6 : 5);
|
|
1984
1984
|
break;
|
|
1985
|
-
case
|
|
1985
|
+
case K.UNIFONT:
|
|
1986
1986
|
n += 2;
|
|
1987
1987
|
break;
|
|
1988
1988
|
}
|
|
@@ -2034,13 +2034,13 @@ class ic {
|
|
|
2034
2034
|
const l = this.fontData.content.data[e];
|
|
2035
2035
|
if (!l)
|
|
2036
2036
|
return;
|
|
2037
|
-
const u = this.fontData.header.fontType !==
|
|
2037
|
+
const u = this.fontData.header.fontType !== K.BIGFONT;
|
|
2038
2038
|
a = this.parseShape(l, {
|
|
2039
2039
|
flushOnEnd: !1,
|
|
2040
2040
|
initialPenDown: u
|
|
2041
2041
|
}), this.shapeData.set(e, a), this.subshapeCache.set(e, a);
|
|
2042
2042
|
}
|
|
2043
|
-
const o = this.fontData.header.fontType ===
|
|
2043
|
+
const o = this.fontData.header.fontType === K.BIGFONT ? void 0 : r / this.fontData.content.baseUp, c = a.polylines.some((l) => l.length > 0);
|
|
2044
2044
|
return (o !== void 0 ? this.scaleShapeByFactor(a, o) : this.scaleShapeByHeightAndWidth(
|
|
2045
2045
|
c ? a.normalizeToOrigin(!0) : a,
|
|
2046
2046
|
r,
|
|
@@ -2078,7 +2078,7 @@ class ac {
|
|
|
2078
2078
|
*/
|
|
2079
2079
|
constructor(e) {
|
|
2080
2080
|
if (e instanceof ArrayBuffer) {
|
|
2081
|
-
const n = new
|
|
2081
|
+
const n = new Fe(e), r = new Uo().parse(n), s = zo.createParser(r.fontType).parse(n);
|
|
2082
2082
|
this.fontData = {
|
|
2083
2083
|
header: r,
|
|
2084
2084
|
content: s
|
|
@@ -2274,7 +2274,7 @@ function hc(t) {
|
|
|
2274
2274
|
});
|
|
2275
2275
|
Tr.set(t, e);
|
|
2276
2276
|
}
|
|
2277
|
-
let
|
|
2277
|
+
let Fr = {
|
|
2278
2278
|
get(t, e, n) {
|
|
2279
2279
|
if (t instanceof IDBTransaction) {
|
|
2280
2280
|
if (e === "done")
|
|
@@ -2292,17 +2292,17 @@ let kr = {
|
|
|
2292
2292
|
}
|
|
2293
2293
|
};
|
|
2294
2294
|
function ha(t) {
|
|
2295
|
-
|
|
2295
|
+
Fr = t(Fr);
|
|
2296
2296
|
}
|
|
2297
2297
|
function fc(t) {
|
|
2298
2298
|
return lc().includes(t) ? function(...e) {
|
|
2299
|
-
return t.apply(
|
|
2299
|
+
return t.apply(kr(this), e), Tt(this.request);
|
|
2300
2300
|
} : function(...e) {
|
|
2301
|
-
return Tt(t.apply(
|
|
2301
|
+
return Tt(t.apply(kr(this), e));
|
|
2302
2302
|
};
|
|
2303
2303
|
}
|
|
2304
2304
|
function pc(t) {
|
|
2305
|
-
return typeof t == "function" ? fc(t) : (t instanceof IDBTransaction && hc(t), Cr(t, cc()) ? new Proxy(t,
|
|
2305
|
+
return typeof t == "function" ? fc(t) : (t instanceof IDBTransaction && hc(t), Cr(t, cc()) ? new Proxy(t, Fr) : t);
|
|
2306
2306
|
}
|
|
2307
2307
|
function Tt(t) {
|
|
2308
2308
|
if (t instanceof IDBRequest)
|
|
@@ -2312,7 +2312,7 @@ function Tt(t) {
|
|
|
2312
2312
|
const e = pc(t);
|
|
2313
2313
|
return e !== t && (Yn.set(t, e), Hn.set(e, t)), e;
|
|
2314
2314
|
}
|
|
2315
|
-
const
|
|
2315
|
+
const kr = (t) => Hn.get(t);
|
|
2316
2316
|
function dc(t, e, { blocked: n, upgrade: r, blocking: s, terminated: i } = {}) {
|
|
2317
2317
|
const a = indexedDB.open(t, e), o = Tt(a);
|
|
2318
2318
|
return r && a.addEventListener("upgradeneeded", (c) => {
|
|
@@ -2370,19 +2370,19 @@ async function* xc(...t) {
|
|
|
2370
2370
|
return;
|
|
2371
2371
|
e = e;
|
|
2372
2372
|
const n = new Proxy(e, bc);
|
|
2373
|
-
for (fa.set(n, e), Hn.set(n,
|
|
2373
|
+
for (fa.set(n, e), Hn.set(n, kr(e)); e; )
|
|
2374
2374
|
yield n, e = await (Er.get(n) || e.continue()), Er.delete(n);
|
|
2375
2375
|
}
|
|
2376
|
-
function
|
|
2376
|
+
function Fs(t, e) {
|
|
2377
2377
|
return e === Symbol.asyncIterator && Cr(t, [IDBIndex, IDBObjectStore, IDBCursor]) || e === "iterate" && Cr(t, [IDBIndex, IDBObjectStore]);
|
|
2378
2378
|
}
|
|
2379
2379
|
ha((t) => ({
|
|
2380
2380
|
...t,
|
|
2381
2381
|
get(e, n, r) {
|
|
2382
|
-
return
|
|
2382
|
+
return Fs(e, n) ? xc : t.get(e, n, r);
|
|
2383
2383
|
},
|
|
2384
2384
|
has(e, n) {
|
|
2385
|
-
return
|
|
2385
|
+
return Fs(e, n) || t.has(e, n);
|
|
2386
2386
|
}
|
|
2387
2387
|
}));
|
|
2388
2388
|
const St = {
|
|
@@ -2588,7 +2588,7 @@ const Ar = {
|
|
|
2588
2588
|
international: ["simplex", "amgdt"],
|
|
2589
2589
|
cjk: ["simplex", "amgdt"]
|
|
2590
2590
|
};
|
|
2591
|
-
function
|
|
2591
|
+
function ks(t) {
|
|
2592
2592
|
return Object.prototype.hasOwnProperty.call(Ar, t);
|
|
2593
2593
|
}
|
|
2594
2594
|
var Wr = 0, da = -3;
|
|
@@ -2598,7 +2598,7 @@ function Jt() {
|
|
|
2598
2598
|
function Tc(t, e) {
|
|
2599
2599
|
this.source = t, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = e, this.destLen = 0, this.ltree = new Jt(), this.dtree = new Jt();
|
|
2600
2600
|
}
|
|
2601
|
-
var ga = new Jt(), ma = new Jt(), Vr = new Uint8Array(30), qr = new Uint16Array(30), ya = new Uint8Array(30), ba = new Uint16Array(30),
|
|
2601
|
+
var ga = new Jt(), ma = new Jt(), Vr = new Uint8Array(30), qr = new Uint16Array(30), ya = new Uint8Array(30), ba = new Uint16Array(30), Fc = new Uint8Array([
|
|
2602
2602
|
16,
|
|
2603
2603
|
17,
|
|
2604
2604
|
18,
|
|
@@ -2626,7 +2626,7 @@ function xa(t, e, n, r) {
|
|
|
2626
2626
|
for (i = r, s = 0; s < 30; ++s)
|
|
2627
2627
|
e[s] = i, i += 1 << t[s];
|
|
2628
2628
|
}
|
|
2629
|
-
function
|
|
2629
|
+
function kc(t, e) {
|
|
2630
2630
|
var n;
|
|
2631
2631
|
for (n = 0; n < 7; ++n) t.table[n] = 0;
|
|
2632
2632
|
for (t.table[7] = 24, t.table[8] = 152, t.table[9] = 112, n = 0; n < 24; ++n) t.trans[n] = 256 + n;
|
|
@@ -2673,7 +2673,7 @@ function Ac(t, e, n) {
|
|
|
2673
2673
|
for (r = Ye(t, 5, 257), s = Ye(t, 5, 1), i = Ye(t, 4, 4), a = 0; a < 19; ++a) je[a] = 0;
|
|
2674
2674
|
for (a = 0; a < i; ++a) {
|
|
2675
2675
|
var l = Ye(t, 3, 0);
|
|
2676
|
-
je[
|
|
2676
|
+
je[Fc[a]] = l;
|
|
2677
2677
|
}
|
|
2678
2678
|
for (Jn(Es, je, 0, 19), o = 0; o < r + s; ) {
|
|
2679
2679
|
var u = Or(t, Es);
|
|
@@ -2742,7 +2742,7 @@ function va(t, e) {
|
|
|
2742
2742
|
} while (!r);
|
|
2743
2743
|
return n.destLen < n.dest.length ? typeof n.dest.slice == "function" ? n.dest.slice(0, n.destLen) : n.dest.subarray(0, n.destLen) : n.dest;
|
|
2744
2744
|
}
|
|
2745
|
-
|
|
2745
|
+
kc(ga, ma);
|
|
2746
2746
|
xa(Vr, qr, 4, 3);
|
|
2747
2747
|
xa(ya, ba, 2, 1);
|
|
2748
2748
|
Vr[28] = 0;
|
|
@@ -2750,22 +2750,22 @@ qr[28] = 258;
|
|
|
2750
2750
|
function Ot(t, e, n, r, s) {
|
|
2751
2751
|
return Math.pow(1 - s, 3) * t + 3 * Math.pow(1 - s, 2) * s * e + 3 * (1 - s) * Math.pow(s, 2) * n + Math.pow(s, 3) * r;
|
|
2752
2752
|
}
|
|
2753
|
-
function
|
|
2753
|
+
function kt() {
|
|
2754
2754
|
this.x1 = Number.NaN, this.y1 = Number.NaN, this.x2 = Number.NaN, this.y2 = Number.NaN;
|
|
2755
2755
|
}
|
|
2756
|
-
|
|
2756
|
+
kt.prototype.isEmpty = function() {
|
|
2757
2757
|
return isNaN(this.x1) || isNaN(this.y1) || isNaN(this.x2) || isNaN(this.y2);
|
|
2758
2758
|
};
|
|
2759
|
-
|
|
2759
|
+
kt.prototype.addPoint = function(t, e) {
|
|
2760
2760
|
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));
|
|
2761
2761
|
};
|
|
2762
|
-
|
|
2762
|
+
kt.prototype.addX = function(t) {
|
|
2763
2763
|
this.addPoint(t, null);
|
|
2764
2764
|
};
|
|
2765
|
-
|
|
2765
|
+
kt.prototype.addY = function(t) {
|
|
2766
2766
|
this.addPoint(null, t);
|
|
2767
2767
|
};
|
|
2768
|
-
|
|
2768
|
+
kt.prototype.addBezier = function(t, e, n, r, s, i, a, o) {
|
|
2769
2769
|
const c = [t, e], l = [n, r], u = [s, i], f = [a, o];
|
|
2770
2770
|
this.addPoint(t, e), this.addPoint(a, o);
|
|
2771
2771
|
for (let h = 0; h <= 1; h++) {
|
|
@@ -2784,11 +2784,11 @@ Ft.prototype.addBezier = function(t, e, n, r, s, i, a, o) {
|
|
|
2784
2784
|
0 < w && w < 1 && (h === 0 && this.addX(Ot(c[h], l[h], u[h], f[h], w)), h === 1 && this.addY(Ot(c[h], l[h], u[h], f[h], w)));
|
|
2785
2785
|
}
|
|
2786
2786
|
};
|
|
2787
|
-
|
|
2787
|
+
kt.prototype.addQuad = function(t, e, n, r, s, i) {
|
|
2788
2788
|
const a = t + 0.6666666666666666 * (n - t), o = e + 2 / 3 * (r - e), c = a + 1 / 3 * (s - t), l = o + 1 / 3 * (i - e);
|
|
2789
2789
|
this.addBezier(t, e, a, o, c, l, s, i);
|
|
2790
2790
|
};
|
|
2791
|
-
var Sa =
|
|
2791
|
+
var Sa = kt;
|
|
2792
2792
|
function de() {
|
|
2793
2793
|
this.commands = [], this.fill = "black", this.stroke = null, this.strokeWidth = 1;
|
|
2794
2794
|
}
|
|
@@ -3233,7 +3233,7 @@ B.UTF16 = function(t) {
|
|
|
3233
3233
|
z.UTF16 = function(t) {
|
|
3234
3234
|
return t.length * 2;
|
|
3235
3235
|
};
|
|
3236
|
-
var
|
|
3236
|
+
var kn = {
|
|
3237
3237
|
"x-mac-croatian": (
|
|
3238
3238
|
// Python: 'mac_croatian'
|
|
3239
3239
|
"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ"
|
|
@@ -3276,7 +3276,7 @@ var Fn = {
|
|
|
3276
3276
|
)
|
|
3277
3277
|
};
|
|
3278
3278
|
Nt.MACSTRING = function(t, e, n, r) {
|
|
3279
|
-
const s =
|
|
3279
|
+
const s = kn[r];
|
|
3280
3280
|
if (s === void 0)
|
|
3281
3281
|
return;
|
|
3282
3282
|
let i = "";
|
|
@@ -3286,10 +3286,10 @@ Nt.MACSTRING = function(t, e, n, r) {
|
|
|
3286
3286
|
}
|
|
3287
3287
|
return i;
|
|
3288
3288
|
};
|
|
3289
|
-
var hn = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), fn,
|
|
3289
|
+
var hn = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), fn, Mc = function(t) {
|
|
3290
3290
|
if (!fn) {
|
|
3291
3291
|
fn = {};
|
|
3292
|
-
for (let s in
|
|
3292
|
+
for (let s in kn)
|
|
3293
3293
|
fn[s] = new String(s);
|
|
3294
3294
|
}
|
|
3295
3295
|
const e = fn[t];
|
|
@@ -3300,7 +3300,7 @@ var hn = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), fn, Dc =
|
|
|
3300
3300
|
if (s !== void 0)
|
|
3301
3301
|
return s;
|
|
3302
3302
|
}
|
|
3303
|
-
const n =
|
|
3303
|
+
const n = kn[t];
|
|
3304
3304
|
if (n === void 0)
|
|
3305
3305
|
return;
|
|
3306
3306
|
const r = {};
|
|
@@ -3309,7 +3309,7 @@ var hn = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), fn, Dc =
|
|
|
3309
3309
|
return hn && hn.set(e, r), r;
|
|
3310
3310
|
};
|
|
3311
3311
|
B.MACSTRING = function(t, e) {
|
|
3312
|
-
const n =
|
|
3312
|
+
const n = Mc(e);
|
|
3313
3313
|
if (n === void 0)
|
|
3314
3314
|
return;
|
|
3315
3315
|
const r = [];
|
|
@@ -3328,7 +3328,7 @@ z.MACSTRING = function(t, e) {
|
|
|
3328
3328
|
function Lr(t) {
|
|
3329
3329
|
return t >= -128 && t <= 127;
|
|
3330
3330
|
}
|
|
3331
|
-
function
|
|
3331
|
+
function Dc(t, e, n) {
|
|
3332
3332
|
let r = 0;
|
|
3333
3333
|
const s = t.length;
|
|
3334
3334
|
for (; e < s && r < 64 && t[e] === 0; )
|
|
@@ -3372,7 +3372,7 @@ B.VARDELTAS = function(t) {
|
|
|
3372
3372
|
const n = [];
|
|
3373
3373
|
for (; e < t.length; ) {
|
|
3374
3374
|
const r = t[e];
|
|
3375
|
-
r === 0 ? e =
|
|
3375
|
+
r === 0 ? e = Dc(t, e, n) : r >= -128 && r <= 127 ? e = _c(t, e, n) : e = Uc(t, e, n);
|
|
3376
3376
|
}
|
|
3377
3377
|
return n;
|
|
3378
3378
|
};
|
|
@@ -3681,7 +3681,7 @@ function Rn(t, e) {
|
|
|
3681
3681
|
function Pc(t, e) {
|
|
3682
3682
|
return t.getInt16(e, !1);
|
|
3683
3683
|
}
|
|
3684
|
-
function
|
|
3684
|
+
function Fa(t, e) {
|
|
3685
3685
|
return (t.getUint16(e) << 8) + t.getUint8(e + 2);
|
|
3686
3686
|
}
|
|
3687
3687
|
function jr(t, e) {
|
|
@@ -3690,7 +3690,7 @@ function jr(t, e) {
|
|
|
3690
3690
|
function Nc(t, e) {
|
|
3691
3691
|
return t.getInt32(e, !1);
|
|
3692
3692
|
}
|
|
3693
|
-
function
|
|
3693
|
+
function ka(t, e) {
|
|
3694
3694
|
const n = t.getInt16(e, !1), r = t.getUint16(e + 2, !1);
|
|
3695
3695
|
return n + r / 65535;
|
|
3696
3696
|
}
|
|
@@ -3745,51 +3745,51 @@ var Vc = {
|
|
|
3745
3745
|
INNER_INDEX_BIT_COUNT_MASK: 15,
|
|
3746
3746
|
MAP_ENTRY_SIZE_MASK: 48
|
|
3747
3747
|
};
|
|
3748
|
-
function
|
|
3748
|
+
function F(t, e) {
|
|
3749
3749
|
this.data = t, this.offset = e, this.relativeOffset = 0;
|
|
3750
3750
|
}
|
|
3751
|
-
|
|
3751
|
+
F.prototype.parseByte = function() {
|
|
3752
3752
|
const t = this.data.getUint8(this.offset + this.relativeOffset);
|
|
3753
3753
|
return this.relativeOffset += 1, t;
|
|
3754
3754
|
};
|
|
3755
|
-
|
|
3755
|
+
F.prototype.parseChar = function() {
|
|
3756
3756
|
const t = this.data.getInt8(this.offset + this.relativeOffset);
|
|
3757
3757
|
return this.relativeOffset += 1, t;
|
|
3758
3758
|
};
|
|
3759
|
-
|
|
3760
|
-
|
|
3759
|
+
F.prototype.parseCard8 = F.prototype.parseByte;
|
|
3760
|
+
F.prototype.parseUShort = function() {
|
|
3761
3761
|
const t = this.data.getUint16(this.offset + this.relativeOffset);
|
|
3762
3762
|
return this.relativeOffset += 2, t;
|
|
3763
3763
|
};
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3764
|
+
F.prototype.parseCard16 = F.prototype.parseUShort;
|
|
3765
|
+
F.prototype.parseSID = F.prototype.parseUShort;
|
|
3766
|
+
F.prototype.parseOffset16 = F.prototype.parseUShort;
|
|
3767
|
+
F.prototype.parseShort = function() {
|
|
3768
3768
|
const t = this.data.getInt16(this.offset + this.relativeOffset);
|
|
3769
3769
|
return this.relativeOffset += 2, t;
|
|
3770
3770
|
};
|
|
3771
|
-
|
|
3771
|
+
F.prototype.parseF2Dot14 = function() {
|
|
3772
3772
|
const t = this.data.getInt16(this.offset + this.relativeOffset) / 16384;
|
|
3773
3773
|
return this.relativeOffset += 2, t;
|
|
3774
3774
|
};
|
|
3775
|
-
|
|
3776
|
-
const t =
|
|
3775
|
+
F.prototype.parseUInt24 = function() {
|
|
3776
|
+
const t = Fa(this.data, this.offset + this.relativeOffset);
|
|
3777
3777
|
return this.relativeOffset += 3, t;
|
|
3778
3778
|
};
|
|
3779
|
-
|
|
3779
|
+
F.prototype.parseULong = function() {
|
|
3780
3780
|
const t = jr(this.data, this.offset + this.relativeOffset);
|
|
3781
3781
|
return this.relativeOffset += 4, t;
|
|
3782
3782
|
};
|
|
3783
|
-
|
|
3783
|
+
F.prototype.parseLong = function() {
|
|
3784
3784
|
const t = Nc(this.data, this.offset + this.relativeOffset);
|
|
3785
3785
|
return this.relativeOffset += 4, t;
|
|
3786
3786
|
};
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
const t =
|
|
3787
|
+
F.prototype.parseOffset32 = F.prototype.parseULong;
|
|
3788
|
+
F.prototype.parseFixed = function() {
|
|
3789
|
+
const t = ka(this.data, this.offset + this.relativeOffset);
|
|
3790
3790
|
return this.relativeOffset += 4, t;
|
|
3791
3791
|
};
|
|
3792
|
-
|
|
3792
|
+
F.prototype.parseString = function(t) {
|
|
3793
3793
|
const e = this.data, n = this.offset + this.relativeOffset;
|
|
3794
3794
|
let r = "";
|
|
3795
3795
|
this.relativeOffset += t;
|
|
@@ -3797,21 +3797,21 @@ k.prototype.parseString = function(t) {
|
|
|
3797
3797
|
r += String.fromCharCode(e.getUint8(n + s));
|
|
3798
3798
|
return r;
|
|
3799
3799
|
};
|
|
3800
|
-
|
|
3800
|
+
F.prototype.parseTag = function() {
|
|
3801
3801
|
return this.parseString(4);
|
|
3802
3802
|
};
|
|
3803
|
-
|
|
3803
|
+
F.prototype.parseLongDateTime = function() {
|
|
3804
3804
|
let t = jr(this.data, this.offset + this.relativeOffset + 4);
|
|
3805
3805
|
return t -= 2082844800, this.relativeOffset += 8, t;
|
|
3806
3806
|
};
|
|
3807
|
-
|
|
3807
|
+
F.prototype.parseVersion = function(t) {
|
|
3808
3808
|
const e = Rn(this.data, this.offset + this.relativeOffset), n = Rn(this.data, this.offset + this.relativeOffset + 2);
|
|
3809
3809
|
return this.relativeOffset += 4, t === void 0 && (t = 4096), e + n / t / 10;
|
|
3810
3810
|
};
|
|
3811
|
-
|
|
3811
|
+
F.prototype.skip = function(t, e) {
|
|
3812
3812
|
e === void 0 && (e = 1), this.relativeOffset += Vc[t] * e;
|
|
3813
3813
|
};
|
|
3814
|
-
|
|
3814
|
+
F.prototype.parseULongList = function(t) {
|
|
3815
3815
|
t === void 0 && (t = this.parseULong());
|
|
3816
3816
|
const e = new Array(t), n = this.data;
|
|
3817
3817
|
let r = this.offset + this.relativeOffset;
|
|
@@ -3819,7 +3819,7 @@ k.prototype.parseULongList = function(t) {
|
|
|
3819
3819
|
e[s] = n.getUint32(r), r += 4;
|
|
3820
3820
|
return this.relativeOffset += t * 4, e;
|
|
3821
3821
|
};
|
|
3822
|
-
|
|
3822
|
+
F.prototype.parseOffset16List = F.prototype.parseUShortList = function(t) {
|
|
3823
3823
|
t === void 0 && (t = this.parseUShort());
|
|
3824
3824
|
const e = new Array(t), n = this.data;
|
|
3825
3825
|
let r = this.offset + this.relativeOffset;
|
|
@@ -3827,35 +3827,35 @@ k.prototype.parseOffset16List = k.prototype.parseUShortList = function(t) {
|
|
|
3827
3827
|
e[s] = n.getUint16(r), r += 2;
|
|
3828
3828
|
return this.relativeOffset += t * 2, e;
|
|
3829
3829
|
};
|
|
3830
|
-
|
|
3830
|
+
F.prototype.parseShortList = function(t) {
|
|
3831
3831
|
const e = new Array(t), n = this.data;
|
|
3832
3832
|
let r = this.offset + this.relativeOffset;
|
|
3833
3833
|
for (let s = 0; s < t; s++)
|
|
3834
3834
|
e[s] = n.getInt16(r), r += 2;
|
|
3835
3835
|
return this.relativeOffset += t * 2, e;
|
|
3836
3836
|
};
|
|
3837
|
-
|
|
3837
|
+
F.prototype.parseByteList = function(t) {
|
|
3838
3838
|
const e = new Array(t), n = this.data;
|
|
3839
3839
|
let r = this.offset + this.relativeOffset;
|
|
3840
3840
|
for (let s = 0; s < t; s++)
|
|
3841
3841
|
e[s] = n.getUint8(r++);
|
|
3842
3842
|
return this.relativeOffset += t, e;
|
|
3843
3843
|
};
|
|
3844
|
-
|
|
3844
|
+
F.prototype.parseList = function(t, e) {
|
|
3845
3845
|
e || (e = t, t = this.parseUShort());
|
|
3846
3846
|
const n = new Array(t);
|
|
3847
3847
|
for (let r = 0; r < t; r++)
|
|
3848
3848
|
n[r] = e.call(this);
|
|
3849
3849
|
return n;
|
|
3850
3850
|
};
|
|
3851
|
-
|
|
3851
|
+
F.prototype.parseList32 = function(t, e) {
|
|
3852
3852
|
e || (e = t, t = this.parseULong());
|
|
3853
3853
|
const n = new Array(t);
|
|
3854
3854
|
for (let r = 0; r < t; r++)
|
|
3855
3855
|
n[r] = e.call(this);
|
|
3856
3856
|
return n;
|
|
3857
3857
|
};
|
|
3858
|
-
|
|
3858
|
+
F.prototype.parseRecordList = function(t, e) {
|
|
3859
3859
|
e || (e = t, t = this.parseUShort());
|
|
3860
3860
|
const n = new Array(t), r = Object.keys(e);
|
|
3861
3861
|
for (let s = 0; s < t; s++) {
|
|
@@ -3868,7 +3868,7 @@ k.prototype.parseRecordList = function(t, e) {
|
|
|
3868
3868
|
}
|
|
3869
3869
|
return n;
|
|
3870
3870
|
};
|
|
3871
|
-
|
|
3871
|
+
F.prototype.parseRecordList32 = function(t, e) {
|
|
3872
3872
|
e || (e = t, t = this.parseULong());
|
|
3873
3873
|
const n = new Array(t), r = Object.keys(e);
|
|
3874
3874
|
for (let s = 0; s < t; s++) {
|
|
@@ -3881,7 +3881,7 @@ k.prototype.parseRecordList32 = function(t, e) {
|
|
|
3881
3881
|
}
|
|
3882
3882
|
return n;
|
|
3883
3883
|
};
|
|
3884
|
-
|
|
3884
|
+
F.prototype.parseTupleRecords = function(t, e) {
|
|
3885
3885
|
let n = [];
|
|
3886
3886
|
for (let r = 0; r < t; r++) {
|
|
3887
3887
|
let s = [];
|
|
@@ -3891,7 +3891,7 @@ k.prototype.parseTupleRecords = function(t, e) {
|
|
|
3891
3891
|
}
|
|
3892
3892
|
return n;
|
|
3893
3893
|
};
|
|
3894
|
-
|
|
3894
|
+
F.prototype.parseStruct = function(t) {
|
|
3895
3895
|
if (typeof t == "function")
|
|
3896
3896
|
return t.call(this);
|
|
3897
3897
|
{
|
|
@@ -3903,29 +3903,29 @@ k.prototype.parseStruct = function(t) {
|
|
|
3903
3903
|
return n;
|
|
3904
3904
|
}
|
|
3905
3905
|
};
|
|
3906
|
-
|
|
3906
|
+
F.prototype.parseValueRecord = function(t) {
|
|
3907
3907
|
if (t === void 0 && (t = this.parseUShort()), t === 0)
|
|
3908
3908
|
return;
|
|
3909
3909
|
const e = {};
|
|
3910
3910
|
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;
|
|
3911
3911
|
};
|
|
3912
|
-
|
|
3912
|
+
F.prototype.parseValueRecordList = function() {
|
|
3913
3913
|
const t = this.parseUShort(), e = this.parseUShort(), n = new Array(e);
|
|
3914
3914
|
for (let r = 0; r < e; r++)
|
|
3915
3915
|
n[r] = this.parseValueRecord(t);
|
|
3916
3916
|
return n;
|
|
3917
3917
|
};
|
|
3918
|
-
|
|
3918
|
+
F.prototype.parsePointer = function(t) {
|
|
3919
3919
|
const e = this.parseOffset16();
|
|
3920
3920
|
if (e > 0)
|
|
3921
|
-
return new
|
|
3921
|
+
return new F(this.data, this.offset + e).parseStruct(t);
|
|
3922
3922
|
};
|
|
3923
|
-
|
|
3923
|
+
F.prototype.parsePointer32 = function(t) {
|
|
3924
3924
|
const e = this.parseOffset32();
|
|
3925
3925
|
if (e > 0)
|
|
3926
|
-
return new
|
|
3926
|
+
return new F(this.data, this.offset + e).parseStruct(t);
|
|
3927
3927
|
};
|
|
3928
|
-
|
|
3928
|
+
F.prototype.parseListOfLists = function(t) {
|
|
3929
3929
|
const e = this.parseOffset16List(), n = e.length, r = this.relativeOffset, s = new Array(n);
|
|
3930
3930
|
for (let i = 0; i < n; i++) {
|
|
3931
3931
|
const a = e[i];
|
|
@@ -3943,7 +3943,7 @@ k.prototype.parseListOfLists = function(t) {
|
|
|
3943
3943
|
}
|
|
3944
3944
|
return this.relativeOffset = r, s;
|
|
3945
3945
|
};
|
|
3946
|
-
|
|
3946
|
+
F.prototype.parseCoverage = function() {
|
|
3947
3947
|
const t = this.offset + this.relativeOffset, e = this.parseUShort(), n = this.parseUShort();
|
|
3948
3948
|
if (e === 1)
|
|
3949
3949
|
return {
|
|
@@ -3965,7 +3965,7 @@ k.prototype.parseCoverage = function() {
|
|
|
3965
3965
|
}
|
|
3966
3966
|
throw new Error("0x" + t.toString(16) + ": Coverage format must be 1 or 2.");
|
|
3967
3967
|
};
|
|
3968
|
-
|
|
3968
|
+
F.prototype.parseClassDef = function() {
|
|
3969
3969
|
const t = this.offset + this.relativeOffset, e = this.parseUShort();
|
|
3970
3970
|
return e === 1 ? {
|
|
3971
3971
|
format: 1,
|
|
@@ -3974,111 +3974,111 @@ k.prototype.parseClassDef = function() {
|
|
|
3974
3974
|
} : e === 2 ? {
|
|
3975
3975
|
format: 2,
|
|
3976
3976
|
ranges: this.parseRecordList({
|
|
3977
|
-
start:
|
|
3978
|
-
end:
|
|
3979
|
-
classId:
|
|
3977
|
+
start: F.uShort,
|
|
3978
|
+
end: F.uShort,
|
|
3979
|
+
classId: F.uShort
|
|
3980
3980
|
})
|
|
3981
3981
|
} : (console.warn(`0x${t.toString(16)}: This font file uses an invalid ClassDef format of ${e}. It might be corrupted and should be reacquired if it doesn't display as intended.`), {
|
|
3982
3982
|
format: e
|
|
3983
3983
|
});
|
|
3984
3984
|
};
|
|
3985
|
-
|
|
3985
|
+
F.list = function(t, e) {
|
|
3986
3986
|
return function() {
|
|
3987
3987
|
return this.parseList(t, e);
|
|
3988
3988
|
};
|
|
3989
3989
|
};
|
|
3990
|
-
|
|
3990
|
+
F.list32 = function(t, e) {
|
|
3991
3991
|
return function() {
|
|
3992
3992
|
return this.parseList32(t, e);
|
|
3993
3993
|
};
|
|
3994
3994
|
};
|
|
3995
|
-
|
|
3995
|
+
F.recordList = function(t, e) {
|
|
3996
3996
|
return function() {
|
|
3997
3997
|
return this.parseRecordList(t, e);
|
|
3998
3998
|
};
|
|
3999
3999
|
};
|
|
4000
|
-
|
|
4000
|
+
F.recordList32 = function(t, e) {
|
|
4001
4001
|
return function() {
|
|
4002
4002
|
return this.parseRecordList32(t, e);
|
|
4003
4003
|
};
|
|
4004
4004
|
};
|
|
4005
|
-
|
|
4005
|
+
F.pointer = function(t) {
|
|
4006
4006
|
return function() {
|
|
4007
4007
|
return this.parsePointer(t);
|
|
4008
4008
|
};
|
|
4009
4009
|
};
|
|
4010
|
-
|
|
4010
|
+
F.pointer32 = function(t) {
|
|
4011
4011
|
return function() {
|
|
4012
4012
|
return this.parsePointer32(t);
|
|
4013
4013
|
};
|
|
4014
4014
|
};
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
var
|
|
4028
|
-
reserved:
|
|
4029
|
-
reqFeatureIndex:
|
|
4030
|
-
featureIndexes:
|
|
4031
|
-
};
|
|
4032
|
-
|
|
4033
|
-
return this.parsePointer(
|
|
4034
|
-
tag:
|
|
4035
|
-
script:
|
|
4036
|
-
defaultLangSys:
|
|
4037
|
-
langSysRecords:
|
|
4038
|
-
tag:
|
|
4039
|
-
langSys:
|
|
4015
|
+
F.tag = F.prototype.parseTag;
|
|
4016
|
+
F.byte = F.prototype.parseByte;
|
|
4017
|
+
F.uShort = F.offset16 = F.prototype.parseUShort;
|
|
4018
|
+
F.uShortList = F.prototype.parseUShortList;
|
|
4019
|
+
F.uInt24 = F.prototype.parseUInt24;
|
|
4020
|
+
F.uLong = F.offset32 = F.prototype.parseULong;
|
|
4021
|
+
F.uLongList = F.prototype.parseULongList;
|
|
4022
|
+
F.fixed = F.prototype.parseFixed;
|
|
4023
|
+
F.f2Dot14 = F.prototype.parseF2Dot14;
|
|
4024
|
+
F.struct = F.prototype.parseStruct;
|
|
4025
|
+
F.coverage = F.prototype.parseCoverage;
|
|
4026
|
+
F.classDef = F.prototype.parseClassDef;
|
|
4027
|
+
var Ms = {
|
|
4028
|
+
reserved: F.uShort,
|
|
4029
|
+
reqFeatureIndex: F.uShort,
|
|
4030
|
+
featureIndexes: F.uShortList
|
|
4031
|
+
};
|
|
4032
|
+
F.prototype.parseScriptList = function() {
|
|
4033
|
+
return this.parsePointer(F.recordList({
|
|
4034
|
+
tag: F.tag,
|
|
4035
|
+
script: F.pointer({
|
|
4036
|
+
defaultLangSys: F.pointer(Ms),
|
|
4037
|
+
langSysRecords: F.recordList({
|
|
4038
|
+
tag: F.tag,
|
|
4039
|
+
langSys: F.pointer(Ms)
|
|
4040
4040
|
})
|
|
4041
4041
|
})
|
|
4042
4042
|
})) || [];
|
|
4043
4043
|
};
|
|
4044
|
-
|
|
4045
|
-
return this.parsePointer(
|
|
4046
|
-
tag:
|
|
4047
|
-
feature:
|
|
4048
|
-
featureParams:
|
|
4049
|
-
lookupListIndexes:
|
|
4044
|
+
F.prototype.parseFeatureList = function() {
|
|
4045
|
+
return this.parsePointer(F.recordList({
|
|
4046
|
+
tag: F.tag,
|
|
4047
|
+
feature: F.pointer({
|
|
4048
|
+
featureParams: F.offset16,
|
|
4049
|
+
lookupListIndexes: F.uShortList
|
|
4050
4050
|
})
|
|
4051
4051
|
})) || [];
|
|
4052
4052
|
};
|
|
4053
|
-
|
|
4054
|
-
return this.parsePointer(
|
|
4053
|
+
F.prototype.parseLookupList = function(t) {
|
|
4054
|
+
return this.parsePointer(F.list(F.pointer(function() {
|
|
4055
4055
|
const e = this.parseUShort();
|
|
4056
4056
|
H.argument(1 <= e && e <= 9, "GPOS/GSUB lookup type " + e + " unknown.");
|
|
4057
4057
|
const n = this.parseUShort(), r = n & 16;
|
|
4058
4058
|
return {
|
|
4059
4059
|
lookupType: e,
|
|
4060
4060
|
lookupFlag: n,
|
|
4061
|
-
subtables: this.parseList(
|
|
4061
|
+
subtables: this.parseList(F.pointer(t[e])),
|
|
4062
4062
|
markFilteringSet: r ? this.parseUShort() : void 0
|
|
4063
4063
|
};
|
|
4064
4064
|
}))) || [];
|
|
4065
4065
|
};
|
|
4066
|
-
|
|
4066
|
+
F.prototype.parseFeatureVariationsList = function() {
|
|
4067
4067
|
return this.parsePointer32(function() {
|
|
4068
4068
|
const t = this.parseUShort(), e = this.parseUShort();
|
|
4069
4069
|
return H.argument(t === 1 && e < 1, "GPOS/GSUB feature variations table unknown."), this.parseRecordList32({
|
|
4070
|
-
conditionSetOffset:
|
|
4071
|
-
featureTableSubstitutionOffset:
|
|
4070
|
+
conditionSetOffset: F.offset32,
|
|
4071
|
+
featureTableSubstitutionOffset: F.offset32
|
|
4072
4072
|
});
|
|
4073
4073
|
}) || [];
|
|
4074
4074
|
};
|
|
4075
|
-
|
|
4075
|
+
F.prototype.parseVariationStore = function() {
|
|
4076
4076
|
const t = this.relativeOffset, e = this.parseUShort(), n = {
|
|
4077
4077
|
itemVariationStore: this.parseItemVariationStore()
|
|
4078
4078
|
};
|
|
4079
4079
|
return this.relativeOffset = t + e + 2, n;
|
|
4080
4080
|
};
|
|
4081
|
-
|
|
4081
|
+
F.prototype.parseItemVariationStore = function() {
|
|
4082
4082
|
const t = this.relativeOffset, e = {
|
|
4083
4083
|
format: this.parseUShort(),
|
|
4084
4084
|
variationRegions: [],
|
|
@@ -4091,24 +4091,24 @@ k.prototype.parseItemVariationStore = function() {
|
|
|
4091
4091
|
}
|
|
4092
4092
|
return e;
|
|
4093
4093
|
};
|
|
4094
|
-
|
|
4094
|
+
F.prototype.parseVariationRegionList = function() {
|
|
4095
4095
|
const t = this.parseUShort(), e = this.parseUShort();
|
|
4096
4096
|
return this.parseRecordList(e, {
|
|
4097
|
-
regionAxes:
|
|
4098
|
-
startCoord:
|
|
4099
|
-
peakCoord:
|
|
4100
|
-
endCoord:
|
|
4097
|
+
regionAxes: F.recordList(t, {
|
|
4098
|
+
startCoord: F.f2Dot14,
|
|
4099
|
+
peakCoord: F.f2Dot14,
|
|
4100
|
+
endCoord: F.f2Dot14
|
|
4101
4101
|
})
|
|
4102
4102
|
});
|
|
4103
4103
|
};
|
|
4104
|
-
|
|
4104
|
+
F.prototype.parseItemVariationSubtable = function() {
|
|
4105
4105
|
const t = this.parseUShort(), e = this.parseUShort(), n = this.parseUShortList(), r = n.length;
|
|
4106
4106
|
return {
|
|
4107
4107
|
regionIndexes: n,
|
|
4108
4108
|
deltaSets: t && r ? this.parseDeltaSets(t, e, r) : []
|
|
4109
4109
|
};
|
|
4110
4110
|
};
|
|
4111
|
-
|
|
4111
|
+
F.prototype.parseDeltaSetIndexMap = function() {
|
|
4112
4112
|
const t = this.parseByte(), e = this.parseByte(), n = [];
|
|
4113
4113
|
let r = 0;
|
|
4114
4114
|
switch (t) {
|
|
@@ -4147,7 +4147,7 @@ k.prototype.parseDeltaSetIndexMap = function() {
|
|
|
4147
4147
|
map: n
|
|
4148
4148
|
};
|
|
4149
4149
|
};
|
|
4150
|
-
|
|
4150
|
+
F.prototype.parseDeltaSets = function(t, e, n) {
|
|
4151
4151
|
const r = Array.from({ length: t }, () => []), s = e & we.LONG_WORDS, i = e & we.WORD_DELTA_COUNT_MASK;
|
|
4152
4152
|
if (i > n)
|
|
4153
4153
|
throw Error("wordCount must be less than or equal to regionIndexCount");
|
|
@@ -4157,7 +4157,7 @@ k.prototype.parseDeltaSets = function(t, e, n) {
|
|
|
4157
4157
|
l < i ? r[c].push(a()) : r[c].push(o());
|
|
4158
4158
|
return r;
|
|
4159
4159
|
};
|
|
4160
|
-
|
|
4160
|
+
F.prototype.parseTupleVariationStoreList = function(t, e, n) {
|
|
4161
4161
|
const r = this.parseUShort(), i = this.parseUShort() & 1, a = this.parseOffset32(), o = (i ? this.parseULong : this.parseUShort).bind(this), c = {};
|
|
4162
4162
|
let l = o();
|
|
4163
4163
|
i || (l *= 2);
|
|
@@ -4175,7 +4175,7 @@ k.prototype.parseTupleVariationStoreList = function(t, e, n) {
|
|
|
4175
4175
|
}
|
|
4176
4176
|
return c;
|
|
4177
4177
|
};
|
|
4178
|
-
|
|
4178
|
+
F.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
|
|
4179
4179
|
const i = this.relativeOffset;
|
|
4180
4180
|
this.relativeOffset = t, n === "cvar" && (this.relativeOffset += 4);
|
|
4181
4181
|
const a = this.parseUShort(), o = !!(a & we.SHARED_POINT_NUMBERS), c = a & we.COUNT_MASK;
|
|
@@ -4221,7 +4221,7 @@ k.prototype.parseTupleVariationStore = function(t, e, n, r, s) {
|
|
|
4221
4221
|
};
|
|
4222
4222
|
return p.sharedPoints = f, p;
|
|
4223
4223
|
};
|
|
4224
|
-
|
|
4224
|
+
F.prototype.parseTupleVariationHeader = function(t, e) {
|
|
4225
4225
|
const n = this.parseUShort(), r = this.parseUShort(), s = !!(r & we.EMBEDDED_PEAK_TUPLE), i = !!(r & we.INTERMEDIATE_REGION), a = !!(r & we.PRIVATE_POINT_NUMBERS), o = s ? void 0 : r & we.TUPLE_INDEX_MASK, c = s ? this.parseTupleRecords(1, t)[0] : void 0, l = i ? this.parseTupleRecords(1, t)[0] : void 0, u = i ? this.parseTupleRecords(1, t)[0] : void 0, f = {
|
|
4226
4226
|
variationDataSize: n,
|
|
4227
4227
|
peakTuple: c,
|
|
@@ -4235,7 +4235,7 @@ k.prototype.parseTupleVariationHeader = function(t, e) {
|
|
|
4235
4235
|
};
|
|
4236
4236
|
return e === "gvar" && (f.sharedTupleRecordsIndex = o), f;
|
|
4237
4237
|
};
|
|
4238
|
-
|
|
4238
|
+
F.prototype.parsePackedPointNumbers = function() {
|
|
4239
4239
|
const t = this.parseByte(), e = [];
|
|
4240
4240
|
let n = t;
|
|
4241
4241
|
if (t >= 128) {
|
|
@@ -4253,7 +4253,7 @@ k.prototype.parsePackedPointNumbers = function() {
|
|
|
4253
4253
|
}
|
|
4254
4254
|
return e;
|
|
4255
4255
|
};
|
|
4256
|
-
|
|
4256
|
+
F.prototype.parsePackedDeltas = function(t) {
|
|
4257
4257
|
const e = [];
|
|
4258
4258
|
for (; e.length < t; ) {
|
|
4259
4259
|
const n = this.parseByte(), r = !!(n & we.DELTAS_ARE_ZERO), s = !!(n & we.DELTAS_ARE_WORDS), i = (n & we.DELTA_RUN_COUNT_MASK) + 1;
|
|
@@ -4262,20 +4262,20 @@ k.prototype.parsePackedDeltas = function(t) {
|
|
|
4262
4262
|
}
|
|
4263
4263
|
return e;
|
|
4264
4264
|
};
|
|
4265
|
-
var
|
|
4265
|
+
var D = {
|
|
4266
4266
|
getByte: Bs,
|
|
4267
4267
|
getCard8: Bs,
|
|
4268
4268
|
getUShort: Rn,
|
|
4269
4269
|
getCard16: Rn,
|
|
4270
4270
|
getShort: Pc,
|
|
4271
|
-
getUInt24:
|
|
4271
|
+
getUInt24: Fa,
|
|
4272
4272
|
getULong: jr,
|
|
4273
|
-
getFixed:
|
|
4273
|
+
getFixed: ka,
|
|
4274
4274
|
getTag: Gc,
|
|
4275
4275
|
getOffset: Hc,
|
|
4276
4276
|
getBytes: zc,
|
|
4277
4277
|
bytesToString: Wc,
|
|
4278
|
-
Parser:
|
|
4278
|
+
Parser: F
|
|
4279
4279
|
}, Bn = [
|
|
4280
4280
|
"copyright",
|
|
4281
4281
|
// 0
|
|
@@ -5023,7 +5023,7 @@ function Xc(t) {
|
|
|
5023
5023
|
return Oa[t];
|
|
5024
5024
|
}
|
|
5025
5025
|
function Kc(t, e, n) {
|
|
5026
|
-
const r = {}, s = new
|
|
5026
|
+
const r = {}, s = new D.Parser(t, e), i = s.parseUShort(), a = s.parseUShort(), o = s.offset + s.parseUShort();
|
|
5027
5027
|
for (let c = 0; c < a; c++) {
|
|
5028
5028
|
const l = s.parseUShort(), u = s.parseUShort(), f = s.parseUShort(), h = s.parseUShort(), p = Bn[h] || h, y = s.parseUShort(), m = s.parseUShort(), b = jc(l, f, n), v = $r(l, u, f), w = Xc(l);
|
|
5029
5029
|
if (v !== void 0 && b !== void 0 && w !== void 0) {
|
|
@@ -5044,7 +5044,7 @@ function dn(t) {
|
|
|
5044
5044
|
e[t[n]] = parseInt(n);
|
|
5045
5045
|
return e;
|
|
5046
5046
|
}
|
|
5047
|
-
function
|
|
5047
|
+
function Ds(t, e, n, r, s, i) {
|
|
5048
5048
|
return new O.Record("NameRecord", [
|
|
5049
5049
|
{ name: "platformID", type: "USHORT", value: t },
|
|
5050
5050
|
{ name: "encodingID", type: "USHORT", value: e },
|
|
@@ -5099,7 +5099,7 @@ function Jc(t, e) {
|
|
|
5099
5099
|
let E = B.MACSTRING(v, T);
|
|
5100
5100
|
if (p === 0 && (w = e.indexOf(b), w < 0 && (w = e.length, e.push(b)), C = 4, E = B.UTF16(v)), E !== void 0) {
|
|
5101
5101
|
const R = _s(E, a);
|
|
5102
|
-
i.push(
|
|
5102
|
+
i.push(Ds(
|
|
5103
5103
|
p,
|
|
5104
5104
|
C,
|
|
5105
5105
|
w,
|
|
@@ -5113,7 +5113,7 @@ function Jc(t, e) {
|
|
|
5113
5113
|
const w = s[b];
|
|
5114
5114
|
if (w !== void 0) {
|
|
5115
5115
|
const C = B.UTF16(v), T = _s(C, a);
|
|
5116
|
-
i.push(
|
|
5116
|
+
i.push(Ds(
|
|
5117
5117
|
3,
|
|
5118
5118
|
1,
|
|
5119
5119
|
w,
|
|
@@ -5138,7 +5138,7 @@ function Jc(t, e) {
|
|
|
5138
5138
|
o.fields.push({ name: "record_" + c, type: "RECORD", value: i[c] });
|
|
5139
5139
|
return o.fields.push({ name: "strings", type: "LITERAL", value: a }), o;
|
|
5140
5140
|
}
|
|
5141
|
-
function
|
|
5141
|
+
function Mn(t, e, n = []) {
|
|
5142
5142
|
if (e < 256 && e in Bn) {
|
|
5143
5143
|
if (n.length && !n.includes(parseInt(e)))
|
|
5144
5144
|
return;
|
|
@@ -5149,10 +5149,10 @@ function Dn(t, e, n = []) {
|
|
|
5149
5149
|
if (s === e || parseInt(s) === e)
|
|
5150
5150
|
return t[r][s];
|
|
5151
5151
|
}
|
|
5152
|
-
var La = { parse: Kc, make: Jc, getNameByID:
|
|
5152
|
+
var La = { parse: Kc, make: Jc, getNameByID: Mn };
|
|
5153
5153
|
function Qc(t, e, n, r) {
|
|
5154
5154
|
t.length = e.parseUShort(), t.language = e.parseUShort() - 1;
|
|
5155
|
-
const s = e.parseByteList(t.length), i = Object.assign({}, s), a = $r(n, r, t.language), o =
|
|
5155
|
+
const s = e.parseByteList(t.length), i = Object.assign({}, s), a = $r(n, r, t.language), o = kn[a];
|
|
5156
5156
|
for (let c = 0; c < o.length; c++)
|
|
5157
5157
|
i[o.charCodeAt(c)] = s[128 + c];
|
|
5158
5158
|
t.glyphIndexMap = i;
|
|
@@ -5172,13 +5172,13 @@ function tl(t, e, n, r, s) {
|
|
|
5172
5172
|
t.length = e.parseUShort(), t.language = e.parseUShort();
|
|
5173
5173
|
let i;
|
|
5174
5174
|
t.segCount = i = e.parseUShort() >> 1, e.skip("uShort", 3), t.glyphIndexMap = {};
|
|
5175
|
-
const a = new
|
|
5175
|
+
const a = new D.Parser(n, r + s + 14), o = new D.Parser(n, r + s + 16 + i * 2), c = new D.Parser(n, r + s + 16 + i * 4), l = new D.Parser(n, r + s + 16 + i * 6);
|
|
5176
5176
|
let u = r + s + 16 + i * 8;
|
|
5177
5177
|
for (let f = 0; f < i - 1; f += 1) {
|
|
5178
5178
|
let h;
|
|
5179
5179
|
const p = a.parseUShort(), y = o.parseUShort(), m = c.parseShort(), b = l.parseUShort();
|
|
5180
5180
|
for (let v = y; v <= p; v += 1)
|
|
5181
|
-
b !== 0 ? (u = l.offset + l.relativeOffset - 2, u += b, u += (v - y) * 2, h =
|
|
5181
|
+
b !== 0 ? (u = l.offset + l.relativeOffset - 2, u += b, u += (v - y) * 2, h = D.getUShort(n, u), h !== 0 && (h = h + m & 65535)) : h = v + m & 65535, t.glyphIndexMap[v] = h;
|
|
5182
5182
|
}
|
|
5183
5183
|
}
|
|
5184
5184
|
function nl(t, e) {
|
|
@@ -5212,23 +5212,23 @@ function nl(t, e) {
|
|
|
5212
5212
|
}
|
|
5213
5213
|
function rl(t, e) {
|
|
5214
5214
|
const n = {};
|
|
5215
|
-
n.version =
|
|
5215
|
+
n.version = D.getUShort(t, e), H.argument(n.version === 0, "cmap table version should be 0."), n.numTables = D.getUShort(t, e + 2);
|
|
5216
5216
|
let r = null, s = -1, i = -1, a = null, o = null;
|
|
5217
5217
|
const c = [0, 1, 2, 3, 4, 6], l = [0, 1, 10];
|
|
5218
5218
|
for (let f = n.numTables - 1; f >= 0; f -= 1)
|
|
5219
|
-
if (a =
|
|
5219
|
+
if (a = D.getUShort(t, e + 4 + f * 8), o = D.getUShort(t, e + 4 + f * 8 + 2), a === 3 && l.includes(o) || a === 0 && c.includes(o) || a === 1 && o === 0) {
|
|
5220
5220
|
if (i > 0) continue;
|
|
5221
|
-
if (i =
|
|
5221
|
+
if (i = D.getULong(t, e + 4 + f * 8 + 4), r)
|
|
5222
5222
|
break;
|
|
5223
5223
|
} else if (a === 0 && o === 5) {
|
|
5224
|
-
if (s =
|
|
5224
|
+
if (s = D.getULong(t, e + 4 + f * 8 + 4), r = new D.Parser(t, e + s), r.parseUShort() !== 14)
|
|
5225
5225
|
s = -1, r = null;
|
|
5226
5226
|
else if (i > 0)
|
|
5227
5227
|
break;
|
|
5228
5228
|
}
|
|
5229
5229
|
if (i === -1)
|
|
5230
5230
|
throw new Error("No valid cmap sub-tables found.");
|
|
5231
|
-
const u = new
|
|
5231
|
+
const u = new D.Parser(t, e + i);
|
|
5232
5232
|
if (n.format = u.parseUShort(), n.format === 0)
|
|
5233
5233
|
Qc(n, u, a, o);
|
|
5234
5234
|
else if (n.format === 12 || n.format === 13)
|
|
@@ -7002,10 +7002,10 @@ function Ba(t) {
|
|
|
7002
7002
|
Ba.prototype.charToGlyphIndex = function(t) {
|
|
7003
7003
|
return this.cmap.glyphIndexMap[t.codePointAt(0)] || 0;
|
|
7004
7004
|
};
|
|
7005
|
-
function
|
|
7005
|
+
function Ma(t, e) {
|
|
7006
7006
|
this.encoding = t, this.charset = e;
|
|
7007
7007
|
}
|
|
7008
|
-
|
|
7008
|
+
Ma.prototype.charToGlyphIndex = function(t) {
|
|
7009
7009
|
const e = t.codePointAt(0), n = this.encoding[e];
|
|
7010
7010
|
return this.charset.indexOf(n);
|
|
7011
7011
|
};
|
|
@@ -7067,7 +7067,7 @@ function gl(t, e, n, r, s) {
|
|
|
7067
7067
|
}
|
|
7068
7068
|
var vt = { line: gl };
|
|
7069
7069
|
function ml(t, e) {
|
|
7070
|
-
const n = new
|
|
7070
|
+
const n = new F(t, e), r = n.parseShort();
|
|
7071
7071
|
r !== 0 && console.warn("Only CPALv0 is currently fully supported.");
|
|
7072
7072
|
const s = n.parseShort(), i = n.parseShort(), a = n.parseShort(), o = n.parseOffset32(), c = n.parseUShortList(i);
|
|
7073
7073
|
n.relativeOffset = o;
|
|
@@ -7090,7 +7090,7 @@ function yl({ version: t = 0, numPaletteEntries: e = 0, colorRecords: n = [], co
|
|
|
7090
7090
|
...n.map((s, i) => ({ name: "colorRecords_" + i, type: "ULONG", value: s }))
|
|
7091
7091
|
]);
|
|
7092
7092
|
}
|
|
7093
|
-
function
|
|
7093
|
+
function Da(t) {
|
|
7094
7094
|
var e = (t & 4278190080) >> 24, n = (t & 16711680) >> 16, r = (t & 65280) >> 8, s = t & 255;
|
|
7095
7095
|
return e = e + 256 & 255, n = n + 256 & 255, r = r + 256 & 255, s = (s + 256 & 255) / 255, { b: e, g: n, r, a: s };
|
|
7096
7096
|
}
|
|
@@ -7106,7 +7106,7 @@ function Xr(t, e, n = 0, r = "hexa") {
|
|
|
7106
7106
|
const i = s.colorRecordIndices[n] + e;
|
|
7107
7107
|
if (i > s.colorRecords)
|
|
7108
7108
|
throw new Error(`Color index out of range (colorRecords.length: ${s.colorRecords.length}, lookupIndex: ${i})`);
|
|
7109
|
-
const a =
|
|
7109
|
+
const a = Da(s.colorRecords[i]);
|
|
7110
7110
|
return r === "bgra" ? a : zt(a, r);
|
|
7111
7111
|
}
|
|
7112
7112
|
function ze(t) {
|
|
@@ -7153,7 +7153,7 @@ function xl(t) {
|
|
|
7153
7153
|
function _a(t) {
|
|
7154
7154
|
return parseInt(`0x${ze(t.b)}${ze(t.g)}${ze(t.r)}${ze(t.a * 255)}`, 16);
|
|
7155
7155
|
}
|
|
7156
|
-
function
|
|
7156
|
+
function Dn(t, e = "hexa") {
|
|
7157
7157
|
const n = e == "raw" || e == "cpal", r = Number.isInteger(t);
|
|
7158
7158
|
let s = !0;
|
|
7159
7159
|
if (r && n || t === "currentColor")
|
|
@@ -7239,8 +7239,8 @@ function zt(t, e = "hexa") {
|
|
|
7239
7239
|
if (Number.isInteger(t)) {
|
|
7240
7240
|
if (e == "raw" || e == "cpal")
|
|
7241
7241
|
return t;
|
|
7242
|
-
t =
|
|
7243
|
-
} else typeof t != "object" && (t =
|
|
7242
|
+
t = Da(t);
|
|
7243
|
+
} else typeof t != "object" && (t = Dn(t, "bgra"));
|
|
7244
7244
|
let n = ["hsl", "hsla"].includes(e) ? bl(t) : null;
|
|
7245
7245
|
switch (e) {
|
|
7246
7246
|
case "rgba":
|
|
@@ -7268,7 +7268,7 @@ function zt(t, e = "hexa") {
|
|
|
7268
7268
|
throw new Error("Unknown color format: " + e);
|
|
7269
7269
|
}
|
|
7270
7270
|
}
|
|
7271
|
-
var Ua = { parse: ml, make: yl, getPaletteColor: Xr, parseColor:
|
|
7271
|
+
var Ua = { parse: ml, make: yl, getPaletteColor: Xr, parseColor: Dn, formatColor: zt };
|
|
7272
7272
|
function vl(t, e) {
|
|
7273
7273
|
let n = e || new Pt();
|
|
7274
7274
|
return {
|
|
@@ -7527,47 +7527,47 @@ function _n(t) {
|
|
|
7527
7527
|
return t.length < 1240 ? e = 107 : t.length < 33900 ? e = 1131 : e = 32768, e;
|
|
7528
7528
|
}
|
|
7529
7529
|
function $e(t, e, n, r) {
|
|
7530
|
-
const s = [], i = [], a = r > 1 ?
|
|
7530
|
+
const s = [], i = [], a = r > 1 ? D.getULong(t, e) : D.getCard16(t, e), o = r > 1 ? 4 : 2;
|
|
7531
7531
|
let c, l;
|
|
7532
7532
|
if (a !== 0) {
|
|
7533
|
-
const u =
|
|
7533
|
+
const u = D.getByte(t, e + o);
|
|
7534
7534
|
c = e + (a + 1) * u + o;
|
|
7535
7535
|
let f = e + o + 1;
|
|
7536
7536
|
for (let h = 0; h < a + 1; h += 1)
|
|
7537
|
-
s.push(
|
|
7537
|
+
s.push(D.getOffset(t, f, u)), f += u;
|
|
7538
7538
|
l = c + s[a];
|
|
7539
7539
|
} else
|
|
7540
7540
|
l = e + o;
|
|
7541
7541
|
for (let u = 0; u < s.length - 1; u += 1) {
|
|
7542
|
-
let f =
|
|
7542
|
+
let f = D.getBytes(t, c + s[u], c + s[u + 1]);
|
|
7543
7543
|
n && (f = n(f, t, e, r)), i.push(f);
|
|
7544
7544
|
}
|
|
7545
7545
|
return { objects: i, startOffset: e, endOffset: l };
|
|
7546
7546
|
}
|
|
7547
7547
|
function Tl(t, e, n) {
|
|
7548
|
-
const r = [], s = n > 1 ?
|
|
7548
|
+
const r = [], s = n > 1 ? D.getULong(t, e) : D.getCard16(t, e), i = n > 1 ? 4 : 2;
|
|
7549
7549
|
let a, o;
|
|
7550
7550
|
if (s !== 0) {
|
|
7551
|
-
const c =
|
|
7551
|
+
const c = D.getByte(t, e + i);
|
|
7552
7552
|
a = e + (s + 1) * c + i;
|
|
7553
7553
|
let l = e + i + 1;
|
|
7554
7554
|
for (let u = 0; u < s + 1; u += 1)
|
|
7555
|
-
r.push(
|
|
7555
|
+
r.push(D.getOffset(t, l, c)), l += c;
|
|
7556
7556
|
o = a + r[s];
|
|
7557
7557
|
} else
|
|
7558
7558
|
o = e + i;
|
|
7559
7559
|
return { offsets: r, startOffset: e, endOffset: o };
|
|
7560
7560
|
}
|
|
7561
|
-
function
|
|
7562
|
-
const a = i > 1 ?
|
|
7561
|
+
function Fl(t, e, n, r, s, i) {
|
|
7562
|
+
const a = i > 1 ? D.getULong(n, r) : D.getCard16(n, r), o = i > 1 ? 4 : 2;
|
|
7563
7563
|
let c = 0;
|
|
7564
7564
|
if (a !== 0) {
|
|
7565
|
-
const u =
|
|
7565
|
+
const u = D.getByte(n, r + o);
|
|
7566
7566
|
c = r + (a + 1) * u + o;
|
|
7567
7567
|
}
|
|
7568
|
-
return
|
|
7568
|
+
return D.getBytes(n, c + e[t], c + e[t + 1]);
|
|
7569
7569
|
}
|
|
7570
|
-
function
|
|
7570
|
+
function kl(t) {
|
|
7571
7571
|
let e = "";
|
|
7572
7572
|
const r = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"];
|
|
7573
7573
|
for (; ; ) {
|
|
@@ -7585,7 +7585,7 @@ function El(t, e) {
|
|
|
7585
7585
|
if (e === 29)
|
|
7586
7586
|
return n = t.parseByte(), r = t.parseByte(), s = t.parseByte(), i = t.parseByte(), n << 24 | r << 16 | s << 8 | i;
|
|
7587
7587
|
if (e === 30)
|
|
7588
|
-
return
|
|
7588
|
+
return kl(t);
|
|
7589
7589
|
if (e >= 32 && e <= 246)
|
|
7590
7590
|
return e - 139;
|
|
7591
7591
|
if (e >= 247 && e <= 250)
|
|
@@ -7607,7 +7607,7 @@ function Al(t) {
|
|
|
7607
7607
|
}
|
|
7608
7608
|
function Kr(t, e, n, r) {
|
|
7609
7609
|
e = e !== void 0 ? e : 0;
|
|
7610
|
-
const s = new
|
|
7610
|
+
const s = new D.Parser(t, e), i = [];
|
|
7611
7611
|
let a = [];
|
|
7612
7612
|
n = n !== void 0 ? n : t.byteLength;
|
|
7613
7613
|
let o = r < 2 ? 22 : 28;
|
|
@@ -7645,9 +7645,9 @@ function Zr(t, e, n) {
|
|
|
7645
7645
|
}
|
|
7646
7646
|
function Ol(t, e) {
|
|
7647
7647
|
const n = {};
|
|
7648
|
-
if (n.formatMajor =
|
|
7648
|
+
if (n.formatMajor = D.getCard8(t, e), n.formatMinor = D.getCard8(t, e + 1), n.formatMajor > 2)
|
|
7649
7649
|
throw new Error(`Unsupported CFF table version ${n.formatMajor}.${n.formatMinor}`);
|
|
7650
|
-
return n.size =
|
|
7650
|
+
return n.size = D.getCard8(t, e + 2), n.formatMajor < 2 ? (n.offsetSize = D.getCard8(t, e + 3), n.startOffset = e, n.endOffset = e + 4) : (n.topDictLength = D.getCard16(t, e + 3), n.endOffset = e + 8), n;
|
|
7651
7651
|
}
|
|
7652
7652
|
var Na = [
|
|
7653
7653
|
{ name: "version", op: 0, type: "SID" },
|
|
@@ -7728,14 +7728,14 @@ function Jr(t, e, n, r, s) {
|
|
|
7728
7728
|
const i = Kr(t, e, n, s);
|
|
7729
7729
|
return Zr(i, s > 1 ? Il : Ga, r);
|
|
7730
7730
|
}
|
|
7731
|
-
function
|
|
7731
|
+
function Ml(t, e, n) {
|
|
7732
7732
|
const r = Kr(t, e, void 0, n);
|
|
7733
7733
|
return Zr(r, Rl);
|
|
7734
7734
|
}
|
|
7735
|
-
function
|
|
7735
|
+
function Dl(t, e, n) {
|
|
7736
7736
|
const r = [];
|
|
7737
7737
|
for (let s = 0; s < n.length; s++) {
|
|
7738
|
-
const i = new DataView(new Uint8Array(n[s]).buffer), a =
|
|
7738
|
+
const i = new DataView(new Uint8Array(n[s]).buffer), a = Ml(i, 0, 2), o = a.private[0], c = a.private[1];
|
|
7739
7739
|
if (o !== 0 && c !== 0) {
|
|
7740
7740
|
const l = Jr(t, c + e, o, [], 2);
|
|
7741
7741
|
if (l.subrs) {
|
|
@@ -7768,7 +7768,7 @@ function Qn(t, e, n, r, s) {
|
|
|
7768
7768
|
}
|
|
7769
7769
|
function _l(t, e, n, r, s) {
|
|
7770
7770
|
let i, a;
|
|
7771
|
-
const o = new
|
|
7771
|
+
const o = new D.Parser(t, e);
|
|
7772
7772
|
n -= 1;
|
|
7773
7773
|
const c = [".notdef"], l = o.parseCard8();
|
|
7774
7774
|
if (l === 0)
|
|
@@ -7792,7 +7792,7 @@ function _l(t, e, n, r, s) {
|
|
|
7792
7792
|
}
|
|
7793
7793
|
function Ul(t, e) {
|
|
7794
7794
|
let n;
|
|
7795
|
-
const r = {}, s = new
|
|
7795
|
+
const r = {}, s = new D.Parser(t, e), i = s.parseCard8();
|
|
7796
7796
|
if (i === 0) {
|
|
7797
7797
|
const a = s.parseCard8();
|
|
7798
7798
|
for (let o = 0; o < a; o += 1)
|
|
@@ -7818,31 +7818,31 @@ function Ha(t, e) {
|
|
|
7818
7818
|
const n = t.tables.cff && t.tables.cff.topDict && t.tables.cff.topDict.paintType || 0;
|
|
7819
7819
|
return n === 2 && (e.fill = null, e.stroke = "black", e.strokeWidth = t.tables.cff.topDict.strokeWidth || 0), n;
|
|
7820
7820
|
}
|
|
7821
|
-
function
|
|
7821
|
+
function Mr(t, e, n, r, s) {
|
|
7822
7822
|
let i, a, o, c;
|
|
7823
7823
|
const l = new Pt(), u = [];
|
|
7824
7824
|
let f = 0, h = !1, p = !1, y = 0, m = 0, b, v, w, C, T = 0, E = [], R, P = 0;
|
|
7825
7825
|
const W = t.tables.cff2 || t.tables.cff;
|
|
7826
|
-
if (w = W.topDict._defaultWidthX, C = W.topDict._nominalWidthX, s = s || t.variation && t.variation.get(), e.getBlendPath || (e.getBlendPath = function(
|
|
7827
|
-
return
|
|
7826
|
+
if (w = W.topDict._defaultWidthX, C = W.topDict._nominalWidthX, s = s || t.variation && t.variation.get(), e.getBlendPath || (e.getBlendPath = function(M) {
|
|
7827
|
+
return Mr(t, e, n, r, M);
|
|
7828
7828
|
}), t.isCIDFont || r > 1) {
|
|
7829
|
-
const
|
|
7829
|
+
const M = W.topDict._fdSelect ? W.topDict._fdSelect[e.index] : 0, _ = W.topDict._fdArray[M];
|
|
7830
7830
|
b = _._subrs, v = _._subrsBias, r > 1 ? (E = W.topDict._vstore.itemVariationStore, T = _._privateDict.vsindex) : (w = _._defaultWidthX, C = _._nominalWidthX);
|
|
7831
7831
|
} else
|
|
7832
7832
|
b = W.topDict._subrs, v = W.topDict._subrsBias;
|
|
7833
7833
|
const j = Ha(t, l);
|
|
7834
7834
|
let N = w;
|
|
7835
|
-
function
|
|
7836
|
-
p && j !== 2 && l.closePath(), l.moveTo(
|
|
7835
|
+
function X(M, _) {
|
|
7836
|
+
p && j !== 2 && l.closePath(), l.moveTo(M, _), p = !0;
|
|
7837
7837
|
}
|
|
7838
7838
|
function ie() {
|
|
7839
|
-
let
|
|
7840
|
-
|
|
7839
|
+
let M;
|
|
7840
|
+
M = (u.length & 1) !== 0, M && !h && (N = u.shift() + C), f += u.length >> 1, u.length = 0, h = !0;
|
|
7841
7841
|
}
|
|
7842
|
-
function U(
|
|
7843
|
-
let _, re, Te, Qe, _e, me,
|
|
7844
|
-
for (; ce <
|
|
7845
|
-
let ve =
|
|
7842
|
+
function U(M) {
|
|
7843
|
+
let _, re, Te, Qe, _e, me, Y, ne, pe, be, ge, ye, ce = 0;
|
|
7844
|
+
for (; ce < M.length; ) {
|
|
7845
|
+
let ve = M[ce];
|
|
7846
7846
|
switch (ce += 1, ve) {
|
|
7847
7847
|
case 1:
|
|
7848
7848
|
ie();
|
|
@@ -7851,7 +7851,7 @@ function Dr(t, e, n, r, s) {
|
|
|
7851
7851
|
ie();
|
|
7852
7852
|
break;
|
|
7853
7853
|
case 4:
|
|
7854
|
-
u.length > 1 && !h && (N = u.shift() + C, h = !0), m += u.pop(),
|
|
7854
|
+
u.length > 1 && !h && (N = u.shift() + C, h = !0), m += u.pop(), X(y, m);
|
|
7855
7855
|
break;
|
|
7856
7856
|
case 5:
|
|
7857
7857
|
for (; u.length > 0; )
|
|
@@ -7885,18 +7885,18 @@ function Dr(t, e, n, r, s) {
|
|
|
7885
7885
|
}
|
|
7886
7886
|
return;
|
|
7887
7887
|
case 12:
|
|
7888
|
-
switch (ve =
|
|
7888
|
+
switch (ve = M[ce], ce += 1, ve) {
|
|
7889
7889
|
case 35:
|
|
7890
|
-
i = y + u.shift(), a = m + u.shift(), o = i + u.shift(), c = a + u.shift(),
|
|
7890
|
+
i = y + u.shift(), a = m + u.shift(), o = i + u.shift(), c = a + u.shift(), Y = o + u.shift(), ne = c + u.shift(), pe = Y + u.shift(), be = ne + u.shift(), ge = pe + u.shift(), ye = be + u.shift(), y = ge + u.shift(), m = ye + u.shift(), u.shift(), l.curveTo(i, a, o, c, Y, ne), l.curveTo(pe, be, ge, ye, y, m);
|
|
7891
7891
|
break;
|
|
7892
7892
|
case 34:
|
|
7893
|
-
i = y + u.shift(), a = m, o = i + u.shift(), c = a + u.shift(),
|
|
7893
|
+
i = y + u.shift(), a = m, o = i + u.shift(), c = a + u.shift(), Y = o + u.shift(), ne = c, pe = Y + u.shift(), be = c, ge = pe + u.shift(), ye = m, y = ge + u.shift(), l.curveTo(i, a, o, c, Y, ne), l.curveTo(pe, be, ge, ye, y, m);
|
|
7894
7894
|
break;
|
|
7895
7895
|
case 36:
|
|
7896
|
-
i = y + u.shift(), a = m + u.shift(), o = i + u.shift(), c = a + u.shift(),
|
|
7896
|
+
i = y + u.shift(), a = m + u.shift(), o = i + u.shift(), c = a + u.shift(), Y = o + u.shift(), ne = c, pe = Y + u.shift(), be = c, ge = pe + u.shift(), ye = be + u.shift(), y = ge + u.shift(), l.curveTo(i, a, o, c, Y, ne), l.curveTo(pe, be, ge, ye, y, m);
|
|
7897
7897
|
break;
|
|
7898
7898
|
case 37:
|
|
7899
|
-
i = y + u.shift(), a = m + u.shift(), o = i + u.shift(), c = a + u.shift(),
|
|
7899
|
+
i = y + u.shift(), a = m + u.shift(), o = i + u.shift(), c = a + u.shift(), Y = o + u.shift(), ne = c + u.shift(), pe = Y + u.shift(), be = ne + u.shift(), ge = pe + u.shift(), ye = be + u.shift(), Math.abs(ge - y) > Math.abs(ye - m) ? y = ge + u.shift() : m = ye + u.shift(), l.curveTo(i, a, o, c, Y, ne), l.curveTo(pe, be, ge, ye, y, m);
|
|
7900
7900
|
break;
|
|
7901
7901
|
default:
|
|
7902
7902
|
console.log("Glyph " + e.index + ": unknown operator 1200" + ve), u.length = 0;
|
|
@@ -7911,16 +7911,16 @@ function Dr(t, e, n, r, s) {
|
|
|
7911
7911
|
const et = Br[u.pop()], x = Br[u.pop()], d = u.pop(), g = u.pop();
|
|
7912
7912
|
if (et && x) {
|
|
7913
7913
|
e.isComposite = !0, e.components = [];
|
|
7914
|
-
const S = t.cffEncoding.charset.indexOf(et),
|
|
7914
|
+
const S = t.cffEncoding.charset.indexOf(et), k = t.cffEncoding.charset.indexOf(x);
|
|
7915
7915
|
e.components.push({
|
|
7916
|
-
glyphIndex:
|
|
7916
|
+
glyphIndex: k,
|
|
7917
7917
|
dx: 0,
|
|
7918
7918
|
dy: 0
|
|
7919
7919
|
}), e.components.push({
|
|
7920
7920
|
glyphIndex: S,
|
|
7921
7921
|
dx: g,
|
|
7922
7922
|
dy: d
|
|
7923
|
-
}), l.extend(t.glyphs.get(
|
|
7923
|
+
}), l.extend(t.glyphs.get(k).path);
|
|
7924
7924
|
const A = t.glyphs.get(S), L = JSON.parse(JSON.stringify(A.path.commands));
|
|
7925
7925
|
for (let q = 0; q < L.length; q += 1) {
|
|
7926
7926
|
const V = L[q];
|
|
@@ -7944,9 +7944,9 @@ function Dr(t, e, n, r, s) {
|
|
|
7944
7944
|
break;
|
|
7945
7945
|
}
|
|
7946
7946
|
R || (R = t.variation && s && t.variation.process.getBlendVector(E, T, s));
|
|
7947
|
-
var
|
|
7947
|
+
var Z = u.pop(), xe = R ? R.length : E.itemVariationSubtables[T].regionIndexes.length, Ee = Z * xe, Ae = u.length - Ee, Oe = Ae - Z;
|
|
7948
7948
|
if (R)
|
|
7949
|
-
for (let et = 0; et <
|
|
7949
|
+
for (let et = 0; et < Z; et++) {
|
|
7950
7950
|
var Re = u[Oe + et];
|
|
7951
7951
|
for (let x = 0; x < xe; x++)
|
|
7952
7952
|
Re += R[x] * u[Ae++];
|
|
@@ -7963,10 +7963,10 @@ function Dr(t, e, n, r, s) {
|
|
|
7963
7963
|
ie(), ce += f + 7 >> 3;
|
|
7964
7964
|
break;
|
|
7965
7965
|
case 21:
|
|
7966
|
-
u.length > 2 && !h && (N = u.shift() + C, h = !0), m += u.pop(), y += u.pop(),
|
|
7966
|
+
u.length > 2 && !h && (N = u.shift() + C, h = !0), m += u.pop(), y += u.pop(), X(y, m);
|
|
7967
7967
|
break;
|
|
7968
7968
|
case 22:
|
|
7969
|
-
u.length > 1 && !h && (N = u.shift() + C, h = !0), y += u.pop(),
|
|
7969
|
+
u.length > 1 && !h && (N = u.shift() + C, h = !0), y += u.pop(), X(y, m);
|
|
7970
7970
|
break;
|
|
7971
7971
|
case 23:
|
|
7972
7972
|
ie();
|
|
@@ -7990,7 +7990,7 @@ function Dr(t, e, n, r, s) {
|
|
|
7990
7990
|
i = y + u.shift(), a = m, o = i + u.shift(), c = a + u.shift(), y = o + u.shift(), m = c, l.curveTo(i, a, o, c, y, m);
|
|
7991
7991
|
break;
|
|
7992
7992
|
case 28:
|
|
7993
|
-
_ =
|
|
7993
|
+
_ = M[ce], re = M[ce + 1], u.push((_ << 24 | re << 16) >> 16), ce += 2;
|
|
7994
7994
|
break;
|
|
7995
7995
|
case 29:
|
|
7996
7996
|
if (_e = u.pop() + t.gsubrsBias, me = t.gsubrs[_e], me) {
|
|
@@ -8010,23 +8010,23 @@ function Dr(t, e, n, r, s) {
|
|
|
8010
8010
|
i = y, a = m + u.shift(), o = i + u.shift(), c = a + u.shift(), y = o + u.shift(), m = c + (u.length === 1 ? u.shift() : 0), l.curveTo(i, a, o, c, y, m);
|
|
8011
8011
|
break;
|
|
8012
8012
|
default:
|
|
8013
|
-
ve < 32 ? console.log("Glyph " + e.index + ": unknown operator " + ve) : ve < 247 ? u.push(ve - 139) : ve < 251 ? (_ =
|
|
8013
|
+
ve < 32 ? console.log("Glyph " + e.index + ": unknown operator " + ve) : ve < 247 ? u.push(ve - 139) : ve < 251 ? (_ = M[ce], ce += 1, u.push((ve - 247) * 256 + _ + 108)) : ve < 255 ? (_ = M[ce], ce += 1, u.push(-(ve - 251) * 256 - _ - 108)) : (_ = M[ce], re = M[ce + 1], Te = M[ce + 2], Qe = M[ce + 3], ce += 4, u.push((_ << 24 | re << 16 | Te << 8 | Qe) / 65536));
|
|
8014
8014
|
}
|
|
8015
8015
|
}
|
|
8016
8016
|
}
|
|
8017
|
-
return U(n), t.variation && s && (l.commands = l.commands.map((
|
|
8018
|
-
const _ = Object.keys(
|
|
8017
|
+
return U(n), t.variation && s && (l.commands = l.commands.map((M) => {
|
|
8018
|
+
const _ = Object.keys(M);
|
|
8019
8019
|
for (let re = 0; re < _.length; re++) {
|
|
8020
8020
|
const Te = _[re];
|
|
8021
|
-
Te !== "type" && (
|
|
8021
|
+
Te !== "type" && (M[Te] = Math.round(M[Te]));
|
|
8022
8022
|
}
|
|
8023
|
-
return
|
|
8023
|
+
return M;
|
|
8024
8024
|
})), h && (e.advanceWidth = N), l;
|
|
8025
8025
|
}
|
|
8026
8026
|
function Ps(t, e, n, r, s) {
|
|
8027
8027
|
const i = [];
|
|
8028
8028
|
let a;
|
|
8029
|
-
const o = new
|
|
8029
|
+
const o = new D.Parser(t, e), c = o.parseCard8();
|
|
8030
8030
|
if (c === 0)
|
|
8031
8031
|
for (let l = 0; l < n; l++) {
|
|
8032
8032
|
if (a = o.parseCard8(), a >= r)
|
|
@@ -8058,11 +8058,11 @@ function Nl(t, e, n, r) {
|
|
|
8058
8058
|
let s;
|
|
8059
8059
|
const i = Ol(t, e);
|
|
8060
8060
|
i.formatMajor === 2 ? s = n.tables.cff2 = {} : s = n.tables.cff = {};
|
|
8061
|
-
const a = i.formatMajor > 1 ? null : $e(t, i.endOffset,
|
|
8061
|
+
const a = i.formatMajor > 1 ? null : $e(t, i.endOffset, D.bytesToString), o = i.formatMajor > 1 ? null : $e(t, a.endOffset), c = i.formatMajor > 1 ? null : $e(t, o.endOffset, D.bytesToString), l = $e(t, i.formatMajor > 1 ? e + i.size + i.topDictLength : c.endOffset, void 0, i.formatMajor);
|
|
8062
8062
|
n.gsubrs = l.objects, n.gsubrsBias = _n(n.gsubrs);
|
|
8063
8063
|
let u;
|
|
8064
8064
|
if (i.formatMajor > 1) {
|
|
8065
|
-
const h = e + i.size, p =
|
|
8065
|
+
const h = e + i.size, p = D.getBytes(t, h, h + i.topDictLength);
|
|
8066
8066
|
u = Qn(t, 0, [p], void 0, i.formatMajor)[0];
|
|
8067
8067
|
} else {
|
|
8068
8068
|
const h = Qn(t, e, o.objects, c.objects, i.formatMajor);
|
|
@@ -8074,7 +8074,7 @@ function Nl(t, e, n, r) {
|
|
|
8074
8074
|
let h = u.fdArray, p = u.fdSelect;
|
|
8075
8075
|
if (!h)
|
|
8076
8076
|
throw new Error("This is a CFF2 font, but FDArray information is missing");
|
|
8077
|
-
const y = $e(t, e + h, null, i.formatMajor), m =
|
|
8077
|
+
const y = $e(t, e + h, null, i.formatMajor), m = Dl(t, e, y.objects);
|
|
8078
8078
|
u._fdArray = m, p && (u._fdSelect = Ps(t, e + p, n.numGlyphs, m.length, i.formatMajor));
|
|
8079
8079
|
} else if (n.isCIDFont) {
|
|
8080
8080
|
let h = u.fdArray, p = u.fdSelect;
|
|
@@ -8095,20 +8095,20 @@ function Nl(t, e, n, r) {
|
|
|
8095
8095
|
let f;
|
|
8096
8096
|
if (r.lowMemory ? (f = Tl(t, e + u.charStrings, i.formatMajor), n.nGlyphs = f.offsets.length - (i.formatMajor > 1 ? 1 : 0)) : (f = $e(t, e + u.charStrings, null, i.formatMajor), n.nGlyphs = f.objects.length), i.formatMajor > 1 && n.tables.maxp && n.nGlyphs !== n.tables.maxp.numGlyphs && console.error(`Glyph count in the CFF2 table (${n.nGlyphs}) must correspond to the glyph count in the maxp table (${n.tables.maxp.numGlyphs})`), i.formatMajor < 2) {
|
|
8097
8097
|
let h = [], p = [];
|
|
8098
|
-
u.charset === 0 ? h = cl : u.charset === 1 ? h = ll : u.charset === 2 ? h = ul : h = _l(t, e + u.charset, n.nGlyphs, c.objects, n.isCIDFont), u.encoding === 0 ? p = Br : u.encoding === 1 ? p = hl : p = Ul(t, e + u.encoding), n.cffEncoding = new
|
|
8098
|
+
u.charset === 0 ? h = cl : u.charset === 1 ? h = ll : u.charset === 2 ? h = ul : h = _l(t, e + u.charset, n.nGlyphs, c.objects, n.isCIDFont), u.encoding === 0 ? p = Br : u.encoding === 1 ? p = hl : p = Ul(t, e + u.encoding), n.cffEncoding = new Ma(p, h), n.encoding = n.encoding || n.cffEncoding;
|
|
8099
8099
|
}
|
|
8100
8100
|
if (n.glyphs = new Je.GlyphSet(n), r.lowMemory)
|
|
8101
8101
|
n._push = function(h) {
|
|
8102
|
-
const p =
|
|
8103
|
-
n.glyphs.push(h, Je.cffGlyphLoader(n, h,
|
|
8102
|
+
const p = Fl(h, f.offsets, t, e + u.charStrings, void 0, i.formatMajor);
|
|
8103
|
+
n.glyphs.push(h, Je.cffGlyphLoader(n, h, Mr, p, i.formatMajor));
|
|
8104
8104
|
};
|
|
8105
8105
|
else
|
|
8106
8106
|
for (let h = 0; h < n.nGlyphs; h += 1) {
|
|
8107
8107
|
const p = f.objects[h];
|
|
8108
|
-
n.glyphs.push(h, Je.cffGlyphLoader(n, h,
|
|
8108
|
+
n.glyphs.push(h, Je.cffGlyphLoader(n, h, Mr, p, i.formatMajor));
|
|
8109
8109
|
}
|
|
8110
8110
|
if (u.vstore) {
|
|
8111
|
-
const h = new
|
|
8111
|
+
const h = new D.Parser(t, e + u.vstore);
|
|
8112
8112
|
u._vstore = h.parseVariationStore();
|
|
8113
8113
|
}
|
|
8114
8114
|
}
|
|
@@ -8257,9 +8257,9 @@ function Yl(t, e) {
|
|
|
8257
8257
|
const f = n.header.sizeOf() + n.nameIndex.sizeOf() + n.topDictIndex.sizeOf() + n.stringIndex.sizeOf() + n.globalSubrIndex.sizeOf();
|
|
8258
8258
|
return s.charset = f, s.encoding = 0, s.charStrings = s.charset + n.charsets.sizeOf(), s.private[1] = s.charStrings + n.charStringsIndex.sizeOf(), u = Ns(s, l), n.topDictIndex = Gs(u), n;
|
|
8259
8259
|
}
|
|
8260
|
-
var
|
|
8260
|
+
var Dr = { parse: Nl, make: Yl };
|
|
8261
8261
|
function Xl(t, e) {
|
|
8262
|
-
const n = {}, r = new
|
|
8262
|
+
const n = {}, r = new D.Parser(t, e);
|
|
8263
8263
|
return n.version = r.parseVersion(), n.fontRevision = Math.round(r.parseFixed() * 1e3) / 1e3, n.checkSumAdjustment = r.parseULong(), n.magicNumber = r.parseULong(), H.argument(n.magicNumber === 1594834165, "Font header has wrong magic number."), n.flags = r.parseUShort(), n.unitsPerEm = r.parseUShort(), n.created = r.parseLongDateTime(), n.modified = r.parseLongDateTime(), n.xMin = r.parseShort(), n.yMin = r.parseShort(), n.xMax = r.parseShort(), n.yMax = r.parseShort(), n.macStyle = r.parseUShort(), n.lowestRecPPEM = r.parseUShort(), n.fontDirectionHint = r.parseShort(), n.indexToLocFormat = r.parseShort(), n.glyphDataFormat = r.parseShort(), n;
|
|
8264
8264
|
}
|
|
8265
8265
|
function Kl(t) {
|
|
@@ -8287,7 +8287,7 @@ function Kl(t) {
|
|
|
8287
8287
|
}
|
|
8288
8288
|
var Va = { parse: Xl, make: Kl };
|
|
8289
8289
|
function Zl(t, e) {
|
|
8290
|
-
const n = {}, r = new
|
|
8290
|
+
const n = {}, r = new D.Parser(t, e);
|
|
8291
8291
|
return n.version = r.parseVersion(), n.ascender = r.parseShort(), n.descender = r.parseShort(), n.lineGap = r.parseShort(), n.advanceWidthMax = r.parseUShort(), n.minLeftSideBearing = r.parseShort(), n.minRightSideBearing = r.parseShort(), n.xMaxExtent = r.parseShort(), n.caretSlopeRise = r.parseShort(), n.caretSlopeRun = r.parseShort(), n.caretOffset = r.parseShort(), r.relativeOffset += 8, n.metricDataFormat = r.parseShort(), n.numberOfHMetrics = r.parseUShort(), n;
|
|
8292
8292
|
}
|
|
8293
8293
|
function Jl(t) {
|
|
@@ -8314,7 +8314,7 @@ function Jl(t) {
|
|
|
8314
8314
|
var qa = { parse: Zl, make: Jl };
|
|
8315
8315
|
function Ql(t, e, n, r, s) {
|
|
8316
8316
|
let i, a;
|
|
8317
|
-
const o = new
|
|
8317
|
+
const o = new D.Parser(t, e);
|
|
8318
8318
|
for (let c = 0; c < r; c += 1) {
|
|
8319
8319
|
c < n && (i = o.parseUShort(), a = o.parseShort());
|
|
8320
8320
|
const l = s.get(c);
|
|
@@ -8324,7 +8324,7 @@ function Ql(t, e, n, r, s) {
|
|
|
8324
8324
|
function eu(t, e, n, r, s) {
|
|
8325
8325
|
t._hmtxTableData = {};
|
|
8326
8326
|
let i, a;
|
|
8327
|
-
const o = new
|
|
8327
|
+
const o = new D.Parser(e, n);
|
|
8328
8328
|
for (let c = 0; c < s; c += 1)
|
|
8329
8329
|
c < r && (i = o.parseUShort(), a = o.parseShort()), t._hmtxTableData[c] = {
|
|
8330
8330
|
advanceWidth: i,
|
|
@@ -8358,7 +8358,7 @@ function ru(t) {
|
|
|
8358
8358
|
return e.fields.push({ name: "stringPool", type: "CHARARRAY", value: n }), e;
|
|
8359
8359
|
}
|
|
8360
8360
|
function su(t, e) {
|
|
8361
|
-
const n = new
|
|
8361
|
+
const n = new D.Parser(t, e), r = n.parseULong();
|
|
8362
8362
|
H.argument(r === 1, "Unsupported ltag table version."), n.skip("uLong", 1);
|
|
8363
8363
|
const s = n.parseULong(), i = [];
|
|
8364
8364
|
for (let a = 0; a < s; a++) {
|
|
@@ -8372,7 +8372,7 @@ function su(t, e) {
|
|
|
8372
8372
|
}
|
|
8373
8373
|
var $a = { make: ru, parse: su };
|
|
8374
8374
|
function iu(t, e) {
|
|
8375
|
-
const n = {}, r = new
|
|
8375
|
+
const n = {}, r = new D.Parser(t, e);
|
|
8376
8376
|
return n.version = r.parseVersion(), n.numGlyphs = r.parseUShort(), n.version === 1 && (n.maxPoints = r.parseUShort(), n.maxContours = r.parseUShort(), n.maxCompositePoints = r.parseUShort(), n.maxCompositeContours = r.parseUShort(), n.maxZones = r.parseUShort(), n.maxTwilightPoints = r.parseUShort(), n.maxStorage = r.parseUShort(), n.maxFunctionDefs = r.parseUShort(), n.maxInstructionDefs = r.parseUShort(), n.maxStackElements = r.parseUShort(), n.maxSizeOfInstructions = r.parseUShort(), n.maxComponentElements = r.parseUShort(), n.maxComponentDepth = r.parseUShort()), n;
|
|
8377
8377
|
}
|
|
8378
8378
|
function au(t) {
|
|
@@ -8638,7 +8638,7 @@ function ou(t) {
|
|
|
8638
8638
|
return -1;
|
|
8639
8639
|
}
|
|
8640
8640
|
function cu(t, e) {
|
|
8641
|
-
const n = {}, r = new
|
|
8641
|
+
const n = {}, r = new D.Parser(t, e);
|
|
8642
8642
|
n.version = r.parseUShort(), n.xAvgCharWidth = r.parseShort(), n.usWeightClass = r.parseUShort(), n.usWidthClass = r.parseUShort(), n.fsType = r.parseUShort(), n.ySubscriptXSize = r.parseShort(), n.ySubscriptYSize = r.parseShort(), n.ySubscriptXOffset = r.parseShort(), n.ySubscriptYOffset = r.parseShort(), n.ySuperscriptXSize = r.parseShort(), n.ySuperscriptYSize = r.parseShort(), n.ySuperscriptXOffset = r.parseShort(), n.ySuperscriptYOffset = r.parseShort(), n.yStrikeoutSize = r.parseShort(), n.yStrikeoutPosition = r.parseShort(), n.sFamilyClass = r.parseShort(), n.panose = [];
|
|
8643
8643
|
for (let s = 0; s < 10; s++)
|
|
8644
8644
|
n.panose[s] = r.parseByte();
|
|
@@ -8696,7 +8696,7 @@ function lu(t) {
|
|
|
8696
8696
|
}
|
|
8697
8697
|
var Ur = { parse: cu, make: lu, unicodeRanges: _r, getUnicodeRange: ou };
|
|
8698
8698
|
function uu(t, e) {
|
|
8699
|
-
const n = {}, r = new
|
|
8699
|
+
const n = {}, r = new D.Parser(t, e);
|
|
8700
8700
|
switch (n.version = r.parseVersion(), n.italicAngle = r.parseFixed(), n.underlinePosition = r.parseShort(), n.underlineThickness = r.parseShort(), n.isFixedPitch = r.parseULong(), n.minMemType42 = r.parseULong(), n.maxMemType42 = r.parseULong(), n.minMemType1 = r.parseULong(), n.maxMemType1 = r.parseULong(), n.version) {
|
|
8701
8701
|
case 1:
|
|
8702
8702
|
n.names = wt.slice();
|
|
@@ -8749,13 +8749,13 @@ We[1] = function() {
|
|
|
8749
8749
|
if (n === 1)
|
|
8750
8750
|
return {
|
|
8751
8751
|
substFormat: 1,
|
|
8752
|
-
coverage: this.parsePointer(
|
|
8752
|
+
coverage: this.parsePointer(F.coverage),
|
|
8753
8753
|
deltaGlyphId: this.parseShort()
|
|
8754
8754
|
};
|
|
8755
8755
|
if (n === 2)
|
|
8756
8756
|
return {
|
|
8757
8757
|
substFormat: 2,
|
|
8758
|
-
coverage: this.parsePointer(
|
|
8758
|
+
coverage: this.parsePointer(F.coverage),
|
|
8759
8759
|
substitute: this.parseOffset16List()
|
|
8760
8760
|
};
|
|
8761
8761
|
H.assert(!1, "0x" + e.toString(16) + ": lookup type 1 format must be 1 or 2.");
|
|
@@ -8764,7 +8764,7 @@ We[2] = function() {
|
|
|
8764
8764
|
const e = this.parseUShort();
|
|
8765
8765
|
return H.argument(e === 1, "GSUB Multiple Substitution Subtable identifier-format must be 1"), {
|
|
8766
8766
|
substFormat: e,
|
|
8767
|
-
coverage: this.parsePointer(
|
|
8767
|
+
coverage: this.parsePointer(F.coverage),
|
|
8768
8768
|
sequences: this.parseListOfLists()
|
|
8769
8769
|
};
|
|
8770
8770
|
};
|
|
@@ -8772,7 +8772,7 @@ We[3] = function() {
|
|
|
8772
8772
|
const e = this.parseUShort();
|
|
8773
8773
|
return H.argument(e === 1, "GSUB Alternate Substitution Subtable identifier-format must be 1"), {
|
|
8774
8774
|
substFormat: e,
|
|
8775
|
-
coverage: this.parsePointer(
|
|
8775
|
+
coverage: this.parsePointer(F.coverage),
|
|
8776
8776
|
alternateSets: this.parseListOfLists()
|
|
8777
8777
|
};
|
|
8778
8778
|
};
|
|
@@ -8780,7 +8780,7 @@ We[4] = function() {
|
|
|
8780
8780
|
const e = this.parseUShort();
|
|
8781
8781
|
return H.argument(e === 1, "GSUB ligature table identifier-format must be 1"), {
|
|
8782
8782
|
substFormat: e,
|
|
8783
|
-
coverage: this.parsePointer(
|
|
8783
|
+
coverage: this.parsePointer(F.coverage),
|
|
8784
8784
|
ligatureSets: this.parseListOfLists(function() {
|
|
8785
8785
|
return {
|
|
8786
8786
|
ligGlyph: this.parseUShort(),
|
|
@@ -8789,34 +8789,34 @@ We[4] = function() {
|
|
|
8789
8789
|
})
|
|
8790
8790
|
};
|
|
8791
8791
|
};
|
|
8792
|
-
var
|
|
8793
|
-
sequenceIndex:
|
|
8794
|
-
lookupListIndex:
|
|
8792
|
+
var Mt = {
|
|
8793
|
+
sequenceIndex: F.uShort,
|
|
8794
|
+
lookupListIndex: F.uShort
|
|
8795
8795
|
};
|
|
8796
8796
|
We[5] = function() {
|
|
8797
8797
|
const e = this.offset + this.relativeOffset, n = this.parseUShort();
|
|
8798
8798
|
if (n === 1)
|
|
8799
8799
|
return {
|
|
8800
8800
|
substFormat: n,
|
|
8801
|
-
coverage: this.parsePointer(
|
|
8801
|
+
coverage: this.parsePointer(F.coverage),
|
|
8802
8802
|
ruleSets: this.parseListOfLists(function() {
|
|
8803
8803
|
const r = this.parseUShort(), s = this.parseUShort();
|
|
8804
8804
|
return {
|
|
8805
8805
|
input: this.parseUShortList(r - 1),
|
|
8806
|
-
lookupRecords: this.parseRecordList(s,
|
|
8806
|
+
lookupRecords: this.parseRecordList(s, Mt)
|
|
8807
8807
|
};
|
|
8808
8808
|
})
|
|
8809
8809
|
};
|
|
8810
8810
|
if (n === 2)
|
|
8811
8811
|
return {
|
|
8812
8812
|
substFormat: n,
|
|
8813
|
-
coverage: this.parsePointer(
|
|
8814
|
-
classDef: this.parsePointer(
|
|
8813
|
+
coverage: this.parsePointer(F.coverage),
|
|
8814
|
+
classDef: this.parsePointer(F.classDef),
|
|
8815
8815
|
classSets: this.parseListOfLists(function() {
|
|
8816
8816
|
const r = this.parseUShort(), s = this.parseUShort();
|
|
8817
8817
|
return {
|
|
8818
8818
|
classes: this.parseUShortList(r - 1),
|
|
8819
|
-
lookupRecords: this.parseRecordList(s,
|
|
8819
|
+
lookupRecords: this.parseRecordList(s, Mt)
|
|
8820
8820
|
};
|
|
8821
8821
|
})
|
|
8822
8822
|
};
|
|
@@ -8824,8 +8824,8 @@ We[5] = function() {
|
|
|
8824
8824
|
const r = this.parseUShort(), s = this.parseUShort();
|
|
8825
8825
|
return {
|
|
8826
8826
|
substFormat: n,
|
|
8827
|
-
coverages: this.parseList(r,
|
|
8828
|
-
lookupRecords: this.parseRecordList(s,
|
|
8827
|
+
coverages: this.parseList(r, F.pointer(F.coverage)),
|
|
8828
|
+
lookupRecords: this.parseRecordList(s, Mt)
|
|
8829
8829
|
};
|
|
8830
8830
|
}
|
|
8831
8831
|
H.assert(!1, "0x" + e.toString(16) + ": lookup type 5 format must be 1, 2 or 3.");
|
|
@@ -8835,46 +8835,46 @@ We[6] = function() {
|
|
|
8835
8835
|
if (n === 1)
|
|
8836
8836
|
return {
|
|
8837
8837
|
substFormat: 1,
|
|
8838
|
-
coverage: this.parsePointer(
|
|
8838
|
+
coverage: this.parsePointer(F.coverage),
|
|
8839
8839
|
chainRuleSets: this.parseListOfLists(function() {
|
|
8840
8840
|
return {
|
|
8841
8841
|
backtrack: this.parseUShortList(),
|
|
8842
8842
|
input: this.parseUShortList(this.parseShort() - 1),
|
|
8843
8843
|
lookahead: this.parseUShortList(),
|
|
8844
|
-
lookupRecords: this.parseRecordList(
|
|
8844
|
+
lookupRecords: this.parseRecordList(Mt)
|
|
8845
8845
|
};
|
|
8846
8846
|
})
|
|
8847
8847
|
};
|
|
8848
8848
|
if (n === 2)
|
|
8849
8849
|
return {
|
|
8850
8850
|
substFormat: 2,
|
|
8851
|
-
coverage: this.parsePointer(
|
|
8852
|
-
backtrackClassDef: this.parsePointer(
|
|
8853
|
-
inputClassDef: this.parsePointer(
|
|
8854
|
-
lookaheadClassDef: this.parsePointer(
|
|
8851
|
+
coverage: this.parsePointer(F.coverage),
|
|
8852
|
+
backtrackClassDef: this.parsePointer(F.classDef),
|
|
8853
|
+
inputClassDef: this.parsePointer(F.classDef),
|
|
8854
|
+
lookaheadClassDef: this.parsePointer(F.classDef),
|
|
8855
8855
|
chainClassSet: this.parseListOfLists(function() {
|
|
8856
8856
|
return {
|
|
8857
8857
|
backtrack: this.parseUShortList(),
|
|
8858
8858
|
input: this.parseUShortList(this.parseShort() - 1),
|
|
8859
8859
|
lookahead: this.parseUShortList(),
|
|
8860
|
-
lookupRecords: this.parseRecordList(
|
|
8860
|
+
lookupRecords: this.parseRecordList(Mt)
|
|
8861
8861
|
};
|
|
8862
8862
|
})
|
|
8863
8863
|
};
|
|
8864
8864
|
if (n === 3)
|
|
8865
8865
|
return {
|
|
8866
8866
|
substFormat: 3,
|
|
8867
|
-
backtrackCoverage: this.parseList(
|
|
8868
|
-
inputCoverage: this.parseList(
|
|
8869
|
-
lookaheadCoverage: this.parseList(
|
|
8870
|
-
lookupRecords: this.parseRecordList(
|
|
8867
|
+
backtrackCoverage: this.parseList(F.pointer(F.coverage)),
|
|
8868
|
+
inputCoverage: this.parseList(F.pointer(F.coverage)),
|
|
8869
|
+
lookaheadCoverage: this.parseList(F.pointer(F.coverage)),
|
|
8870
|
+
lookupRecords: this.parseRecordList(Mt)
|
|
8871
8871
|
};
|
|
8872
8872
|
H.assert(!1, "0x" + e.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
|
|
8873
8873
|
};
|
|
8874
8874
|
We[7] = function() {
|
|
8875
8875
|
const e = this.parseUShort();
|
|
8876
8876
|
H.argument(e === 1, "GSUB Extension Substitution subtable identifier-format must be 1");
|
|
8877
|
-
const n = this.parseUShort(), r = new
|
|
8877
|
+
const n = this.parseUShort(), r = new F(this.data, this.offset + this.parseULong());
|
|
8878
8878
|
return {
|
|
8879
8879
|
substFormat: 1,
|
|
8880
8880
|
lookupType: n,
|
|
@@ -8885,15 +8885,15 @@ We[8] = function() {
|
|
|
8885
8885
|
const e = this.parseUShort();
|
|
8886
8886
|
return H.argument(e === 1, "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"), {
|
|
8887
8887
|
substFormat: e,
|
|
8888
|
-
coverage: this.parsePointer(
|
|
8889
|
-
backtrackCoverage: this.parseList(
|
|
8890
|
-
lookaheadCoverage: this.parseList(
|
|
8888
|
+
coverage: this.parsePointer(F.coverage),
|
|
8889
|
+
backtrackCoverage: this.parseList(F.pointer(F.coverage)),
|
|
8890
|
+
lookaheadCoverage: this.parseList(F.pointer(F.coverage)),
|
|
8891
8891
|
substitutes: this.parseUShortList()
|
|
8892
8892
|
};
|
|
8893
8893
|
};
|
|
8894
8894
|
function fu(t, e) {
|
|
8895
8895
|
e = e || 0;
|
|
8896
|
-
const n = new
|
|
8896
|
+
const n = new F(t, e), r = n.parseVersion(1);
|
|
8897
8897
|
return H.argument(r === 1 || r === 1.1, "Unsupported GSUB table version."), r === 1 ? {
|
|
8898
8898
|
version: r,
|
|
8899
8899
|
scripts: n.parseScriptList(),
|
|
@@ -9054,7 +9054,7 @@ function pu(t) {
|
|
|
9054
9054
|
}
|
|
9055
9055
|
var Ka = { parse: fu, make: pu };
|
|
9056
9056
|
function du(t, e) {
|
|
9057
|
-
const n = new
|
|
9057
|
+
const n = new D.Parser(t, e), r = n.parseULong();
|
|
9058
9058
|
H.argument(r === 1, "Unsupported META table version."), n.parseULong(), n.parseULong();
|
|
9059
9059
|
const s = n.parseULong(), i = {};
|
|
9060
9060
|
for (let a = 0; a < s; a++) {
|
|
@@ -9083,19 +9083,19 @@ function gu(t) {
|
|
|
9083
9083
|
}
|
|
9084
9084
|
var Za = { parse: du, make: gu };
|
|
9085
9085
|
function mu(t, e) {
|
|
9086
|
-
const n = new
|
|
9086
|
+
const n = new F(t, e), r = n.parseUShort();
|
|
9087
9087
|
r !== 0 && console.warn("Only COLRv0 is currently fully supported. A subset of color glyphs might be available in this font if provided in the v0 format.");
|
|
9088
9088
|
const s = n.parseUShort(), i = n.parseOffset32(), a = n.parseOffset32(), o = n.parseUShort();
|
|
9089
9089
|
n.relativeOffset = i;
|
|
9090
9090
|
const c = n.parseRecordList(s, {
|
|
9091
|
-
glyphID:
|
|
9092
|
-
firstLayerIndex:
|
|
9093
|
-
numLayers:
|
|
9091
|
+
glyphID: F.uShort,
|
|
9092
|
+
firstLayerIndex: F.uShort,
|
|
9093
|
+
numLayers: F.uShort
|
|
9094
9094
|
});
|
|
9095
9095
|
n.relativeOffset = a;
|
|
9096
9096
|
const l = n.parseRecordList(o, {
|
|
9097
|
-
glyphID:
|
|
9098
|
-
paletteIndex:
|
|
9097
|
+
glyphID: F.uShort,
|
|
9098
|
+
paletteIndex: F.uShort
|
|
9099
9099
|
});
|
|
9100
9100
|
return {
|
|
9101
9101
|
version: r,
|
|
@@ -9135,10 +9135,10 @@ function bu(t, e) {
|
|
|
9135
9135
|
];
|
|
9136
9136
|
}
|
|
9137
9137
|
function xu(t, e, n) {
|
|
9138
|
-
const r = {}, s = new
|
|
9138
|
+
const r = {}, s = new D.Parser(t, e);
|
|
9139
9139
|
r.tag = s.parseTag(), r.minValue = s.parseFixed(), r.defaultValue = s.parseFixed(), r.maxValue = s.parseFixed(), s.skip("uShort", 1);
|
|
9140
9140
|
const i = s.parseUShort();
|
|
9141
|
-
return r.axisNameID = i, r.name =
|
|
9141
|
+
return r.axisNameID = i, r.name = Mn(n, i), r;
|
|
9142
9142
|
}
|
|
9143
9143
|
function vu(t, e, n, r = {}) {
|
|
9144
9144
|
const s = [
|
|
@@ -9160,14 +9160,14 @@ function vu(t, e, n, r = {}) {
|
|
|
9160
9160
|
}), s;
|
|
9161
9161
|
}
|
|
9162
9162
|
function Su(t, e, n, r, s) {
|
|
9163
|
-
const i = {}, a = new
|
|
9164
|
-
i.subfamilyNameID = o, i.name =
|
|
9163
|
+
const i = {}, a = new D.Parser(t, e), o = a.parseUShort();
|
|
9164
|
+
i.subfamilyNameID = o, i.name = Mn(r, o, [2, 17]), a.skip("uShort", 1), i.coordinates = {};
|
|
9165
9165
|
for (let l = 0; l < n.length; ++l)
|
|
9166
9166
|
i.coordinates[n[l].tag] = a.parseFixed();
|
|
9167
9167
|
if (a.relativeOffset === s)
|
|
9168
9168
|
return i.postScriptNameID = void 0, i.postScriptName = void 0, i;
|
|
9169
9169
|
const c = a.parseUShort();
|
|
9170
|
-
return i.postScriptNameID = c == 65535 ? void 0 : c, i.postScriptName = i.postScriptNameID !== void 0 ?
|
|
9170
|
+
return i.postScriptNameID = c == 65535 ? void 0 : c, i.postScriptName = i.postScriptNameID !== void 0 ? Mn(r, c, [6]) : "", i;
|
|
9171
9171
|
}
|
|
9172
9172
|
function wu(t, e) {
|
|
9173
9173
|
const n = new O.Table("fvar", [
|
|
@@ -9198,7 +9198,7 @@ function wu(t, e) {
|
|
|
9198
9198
|
return n;
|
|
9199
9199
|
}
|
|
9200
9200
|
function Cu(t, e, n) {
|
|
9201
|
-
const r = new
|
|
9201
|
+
const r = new D.Parser(t, e), s = r.parseULong();
|
|
9202
9202
|
H.argument(s === 65536, "Unsupported fvar table version.");
|
|
9203
9203
|
const i = r.parseOffset16();
|
|
9204
9204
|
r.skip("uShort", 1);
|
|
@@ -9211,9 +9211,9 @@ function Cu(t, e, n) {
|
|
|
9211
9211
|
return { axes: u, instances: f };
|
|
9212
9212
|
}
|
|
9213
9213
|
var Qa = { make: wu, parse: Cu }, Tu = {
|
|
9214
|
-
tag:
|
|
9215
|
-
nameID:
|
|
9216
|
-
ordering:
|
|
9214
|
+
tag: F.tag,
|
|
9215
|
+
nameID: F.uShort,
|
|
9216
|
+
ordering: F.uShort
|
|
9217
9217
|
}, nn = new Array(5);
|
|
9218
9218
|
nn[1] = function() {
|
|
9219
9219
|
return {
|
|
@@ -9255,15 +9255,15 @@ nn[4] = function() {
|
|
|
9255
9255
|
})
|
|
9256
9256
|
};
|
|
9257
9257
|
};
|
|
9258
|
-
function
|
|
9258
|
+
function Fu() {
|
|
9259
9259
|
const t = this.parseUShort(), e = nn[t], n = {
|
|
9260
9260
|
format: t
|
|
9261
9261
|
};
|
|
9262
9262
|
return e === void 0 ? (console.warn(`Unknown axis value table format ${t}`), n) : Object.assign(n, this.parseStruct(e.bind(this)));
|
|
9263
9263
|
}
|
|
9264
|
-
function
|
|
9264
|
+
function ku(t, e, n) {
|
|
9265
9265
|
e || (e = 0);
|
|
9266
|
-
const r = new
|
|
9266
|
+
const r = new D.Parser(t, e), s = r.parseUShort(), i = r.parseUShort();
|
|
9267
9267
|
s !== 1 && console.warn(`Unsupported STAT table version ${s}.${i}`);
|
|
9268
9268
|
const a = [
|
|
9269
9269
|
s,
|
|
@@ -9276,7 +9276,7 @@ function Fu(t, e, n) {
|
|
|
9276
9276
|
r.offset = e, r.relativeOffset = f;
|
|
9277
9277
|
const y = r.parseUShortList(u), m = [];
|
|
9278
9278
|
for (let b = 0; b < u; b++)
|
|
9279
|
-
r.offset = e + f, r.relativeOffset = y[b], m.push(
|
|
9279
|
+
r.offset = e + f, r.relativeOffset = y[b], m.push(Fu.apply(r));
|
|
9280
9280
|
return {
|
|
9281
9281
|
version: a,
|
|
9282
9282
|
axes: p,
|
|
@@ -9370,7 +9370,7 @@ function Ou(t) {
|
|
|
9370
9370
|
}
|
|
9371
9371
|
return e.fields = e.fields.concat(n), e.fields = e.fields.concat(r), e;
|
|
9372
9372
|
}
|
|
9373
|
-
var eo = { make: Ou, parse:
|
|
9373
|
+
var eo = { make: Ou, parse: ku };
|
|
9374
9374
|
function Lu(t, e) {
|
|
9375
9375
|
return new O.Record("axisValueMap_" + t, [
|
|
9376
9376
|
{ name: "fromCoordinate_" + t, type: "F2DOT14", value: e.fromCoordinate },
|
|
@@ -9404,7 +9404,7 @@ function Ru(t, e) {
|
|
|
9404
9404
|
}
|
|
9405
9405
|
function Bu(t, e, n) {
|
|
9406
9406
|
e || (e = 0);
|
|
9407
|
-
const r = new
|
|
9407
|
+
const r = new F(t, e), s = r.parseUShort(), i = r.parseUShort();
|
|
9408
9408
|
s !== 1 && console.warn(`Unsupported avar table version ${s}.${i}`), r.skip("uShort", 1);
|
|
9409
9409
|
const a = r.parseUShort();
|
|
9410
9410
|
H.argument(a === n.axes.length, "avar axis count must correspond to fvar axis count");
|
|
@@ -9428,8 +9428,8 @@ function Bu(t, e, n) {
|
|
|
9428
9428
|
};
|
|
9429
9429
|
}
|
|
9430
9430
|
var to = { make: Ru, parse: Bu };
|
|
9431
|
-
function
|
|
9432
|
-
const s = new
|
|
9431
|
+
function Mu(t, e, n, r) {
|
|
9432
|
+
const s = new D.Parser(t, e), i = s.parseTupleVariationStore(
|
|
9433
9433
|
s.relativeOffset,
|
|
9434
9434
|
n.axes.length,
|
|
9435
9435
|
"cvar",
|
|
@@ -9440,12 +9440,12 @@ function Du(t, e, n, r) {
|
|
|
9440
9440
|
...i
|
|
9441
9441
|
};
|
|
9442
9442
|
}
|
|
9443
|
-
function
|
|
9443
|
+
function Du() {
|
|
9444
9444
|
console.warn("Writing of cvar tables is not yet supported.");
|
|
9445
9445
|
}
|
|
9446
|
-
var no = { make:
|
|
9446
|
+
var no = { make: Du, parse: Mu };
|
|
9447
9447
|
function _u(t, e, n, r) {
|
|
9448
|
-
const s = new
|
|
9448
|
+
const s = new D.Parser(t, e), i = s.parseUShort(), a = s.parseUShort();
|
|
9449
9449
|
i !== 1 && console.warn(`Unsupported gvar table version ${i}.${a}`);
|
|
9450
9450
|
const o = s.parseUShort();
|
|
9451
9451
|
o !== n.axes.length && console.warn(`axisCount ${o} in gvar table does not match the number of axes ${n.axes.length} in the fvar table!`);
|
|
@@ -9463,7 +9463,7 @@ function Uu() {
|
|
|
9463
9463
|
}
|
|
9464
9464
|
var ro = { make: Uu, parse: _u };
|
|
9465
9465
|
function Pu(t, e) {
|
|
9466
|
-
const n = {}, r = new
|
|
9466
|
+
const n = {}, r = new D.Parser(t, e);
|
|
9467
9467
|
n.version = r.parseUShort(), H.argument(n.version <= 1, "Unsupported gasp table version."), n.numRanges = r.parseUShort(), n.gaspRanges = [];
|
|
9468
9468
|
for (let s = 0; s < n.numRanges; s++)
|
|
9469
9469
|
n.gaspRanges[s] = {
|
|
@@ -9483,7 +9483,7 @@ function Nu(t) {
|
|
|
9483
9483
|
}
|
|
9484
9484
|
var so = { parse: Pu, make: Nu };
|
|
9485
9485
|
function Gu(t, e) {
|
|
9486
|
-
const n = /* @__PURE__ */ new Map(), r = t.buffer, s = new
|
|
9486
|
+
const n = /* @__PURE__ */ new Map(), r = t.buffer, s = new F(t, e);
|
|
9487
9487
|
if (s.parseUShort() !== 0) return n;
|
|
9488
9488
|
s.relativeOffset = s.parseOffset32();
|
|
9489
9489
|
const a = t.byteOffset + e + s.relativeOffset, o = s.parseUShort(), c = /* @__PURE__ */ new Map();
|
|
@@ -9586,10 +9586,10 @@ function zu(t) {
|
|
|
9586
9586
|
function Wu(t) {
|
|
9587
9587
|
const e = [], n = [], r = [], s = [], i = [], a = [], o = [];
|
|
9588
9588
|
let c, l = 0, u = 0, f = 0, h = 0, p = 0;
|
|
9589
|
-
for (let
|
|
9590
|
-
const xe = t.glyphs.get(
|
|
9589
|
+
for (let Z = 0; Z < t.glyphs.length; Z += 1) {
|
|
9590
|
+
const xe = t.glyphs.get(Z), Ee = xe.unicode | 0;
|
|
9591
9591
|
if (isNaN(xe.advanceWidth))
|
|
9592
|
-
throw new Error("Glyph " + xe.name + " (" +
|
|
9592
|
+
throw new Error("Glyph " + xe.name + " (" + Z + "): advanceWidth is not a number.");
|
|
9593
9593
|
(c > Ee || c === void 0) && Ee > 0 && (c = Ee), l < Ee && (l = Ee);
|
|
9594
9594
|
const Ae = Ur.getUnicodeRange(Ee);
|
|
9595
9595
|
if (Ae < 32)
|
|
@@ -9668,19 +9668,19 @@ function Wu(t) {
|
|
|
9668
9668
|
let j = t.getEnglishName("postScriptName");
|
|
9669
9669
|
j || (j = R.replace(/\s/g, "") + "-" + P);
|
|
9670
9670
|
const N = {};
|
|
9671
|
-
for (let
|
|
9672
|
-
N[
|
|
9671
|
+
for (let Z in t.names)
|
|
9672
|
+
N[Z] = t.names[Z];
|
|
9673
9673
|
N.unicode = N.unicode || {}, N.macintosh = N.macintosh || {}, N.windows = N.windows || {};
|
|
9674
|
-
const
|
|
9675
|
-
for (const
|
|
9676
|
-
if (N[
|
|
9674
|
+
const X = t.names.unicode || {}, ie = t.names.macintosh || {}, U = t.names.windows || {};
|
|
9675
|
+
for (const Z in N) {
|
|
9676
|
+
if (N[Z] = N[Z] || {}, !N[Z].uniqueID) {
|
|
9677
9677
|
const xe = t.getEnglishName("manufacturer") || "";
|
|
9678
|
-
N[
|
|
9678
|
+
N[Z].uniqueID = { en: `${xe}: ${W}` };
|
|
9679
9679
|
}
|
|
9680
|
-
N[
|
|
9680
|
+
N[Z].postScriptName || (N[Z].postScriptName = { en: j });
|
|
9681
9681
|
}
|
|
9682
|
-
N.unicode.preferredFamily || (N.unicode.preferredFamily =
|
|
9683
|
-
const
|
|
9682
|
+
N.unicode.preferredFamily || (N.unicode.preferredFamily = X.fontFamily || ie.fontFamily || U.fontFamily), N.macintosh.preferredFamily || (N.macintosh.preferredFamily = ie.fontFamily || X.fontFamily || U.fontFamily), N.windows.preferredFamily || (N.windows.preferredFamily = U.fontFamily || X.fontFamily || ie.fontFamily), N.unicode.preferredSubfamily || (N.unicode.preferredSubfamily = X.fontSubfamily || ie.fontSubfamily || U.fontSubfamily), N.macintosh.preferredSubfamily || (N.macintosh.preferredSubfamily = ie.fontSubfamily || X.fontSubfamily || U.fontSubfamily), N.windows.preferredSubfamily || (N.windows.preferredSubfamily = U.fontSubfamily || X.fontSubfamily || ie.fontSubfamily);
|
|
9683
|
+
const M = [], _ = La.make(N, M), re = M.length > 0 ? $a.make(M) : void 0, Te = Xa.make(t), Qe = Dr.make(t.glyphs, {
|
|
9684
9684
|
version: t.getEnglishName("version"),
|
|
9685
9685
|
fullName: W,
|
|
9686
9686
|
familyName: R,
|
|
@@ -9691,7 +9691,7 @@ function Wu(t) {
|
|
|
9691
9691
|
topDict: t.tables.cff && t.tables.cff.topDict || {}
|
|
9692
9692
|
}), _e = t.metas && Object.keys(t.metas).length > 0 ? Za.make(t.metas) : void 0, me = [b, v, w, C, _, E, Te, Qe, T];
|
|
9693
9693
|
re && me.push(re);
|
|
9694
|
-
const
|
|
9694
|
+
const Y = {
|
|
9695
9695
|
gsub: Ka,
|
|
9696
9696
|
cpal: Ua,
|
|
9697
9697
|
colr: Ja,
|
|
@@ -9706,19 +9706,19 @@ function Wu(t) {
|
|
|
9706
9706
|
avar: [t.tables.fvar],
|
|
9707
9707
|
fvar: [t.names]
|
|
9708
9708
|
};
|
|
9709
|
-
for (let
|
|
9710
|
-
const xe = t.tables[
|
|
9709
|
+
for (let Z in Y) {
|
|
9710
|
+
const xe = t.tables[Z];
|
|
9711
9711
|
if (xe) {
|
|
9712
|
-
const Ee =
|
|
9712
|
+
const Ee = Y[Z].make.call(t, xe, ...ne[Z] || []);
|
|
9713
9713
|
Ee && me.push(Ee);
|
|
9714
9714
|
}
|
|
9715
9715
|
}
|
|
9716
9716
|
_e && me.push(_e);
|
|
9717
9717
|
const pe = ao(me), be = pe.encode(), ge = Qr(be), ye = pe.fields;
|
|
9718
9718
|
let ce = !1;
|
|
9719
|
-
for (let
|
|
9720
|
-
if (ye[
|
|
9721
|
-
ye[
|
|
9719
|
+
for (let Z = 0; Z < ye.length; Z += 1)
|
|
9720
|
+
if (ye[Z].name === "head table") {
|
|
9721
|
+
ye[Z].value.checkSumAdjustment = 2981146554 - ge, ce = !0;
|
|
9722
9722
|
break;
|
|
9723
9723
|
}
|
|
9724
9724
|
if (!ce)
|
|
@@ -10105,7 +10105,7 @@ function Zu(t) {
|
|
|
10105
10105
|
dy: t.dy
|
|
10106
10106
|
};
|
|
10107
10107
|
}
|
|
10108
|
-
function
|
|
10108
|
+
function Me(t) {
|
|
10109
10109
|
Wn.call(this, t, "gsub");
|
|
10110
10110
|
}
|
|
10111
10111
|
function es(t, e, n) {
|
|
@@ -10118,8 +10118,8 @@ function es(t, e, n) {
|
|
|
10118
10118
|
if (n)
|
|
10119
10119
|
return r.push(n), n;
|
|
10120
10120
|
}
|
|
10121
|
-
|
|
10122
|
-
|
|
10121
|
+
Me.prototype = Wn.prototype;
|
|
10122
|
+
Me.prototype.createDefaultTable = function() {
|
|
10123
10123
|
return {
|
|
10124
10124
|
version: 1,
|
|
10125
10125
|
scripts: [{
|
|
@@ -10133,7 +10133,7 @@ De.prototype.createDefaultTable = function() {
|
|
|
10133
10133
|
lookups: []
|
|
10134
10134
|
};
|
|
10135
10135
|
};
|
|
10136
|
-
|
|
10136
|
+
Me.prototype.getSingle = function(t, e, n) {
|
|
10137
10137
|
const r = [], s = this.getLookupTables(e, n, t, 1);
|
|
10138
10138
|
for (let i = 0; i < s.length; i++) {
|
|
10139
10139
|
const a = s[i].subtables;
|
|
@@ -10155,7 +10155,7 @@ De.prototype.getSingle = function(t, e, n) {
|
|
|
10155
10155
|
}
|
|
10156
10156
|
return r;
|
|
10157
10157
|
};
|
|
10158
|
-
|
|
10158
|
+
Me.prototype.getMultiple = function(t, e, n) {
|
|
10159
10159
|
const r = [], s = this.getLookupTables(e, n, t, 2);
|
|
10160
10160
|
for (let i = 0; i < s.length; i++) {
|
|
10161
10161
|
const a = s[i].subtables;
|
|
@@ -10170,7 +10170,7 @@ De.prototype.getMultiple = function(t, e, n) {
|
|
|
10170
10170
|
}
|
|
10171
10171
|
return r;
|
|
10172
10172
|
};
|
|
10173
|
-
|
|
10173
|
+
Me.prototype.getAlternates = function(t, e, n) {
|
|
10174
10174
|
const r = [], s = this.getLookupTables(e, n, t, 3);
|
|
10175
10175
|
for (let i = 0; i < s.length; i++) {
|
|
10176
10176
|
const a = s[i].subtables;
|
|
@@ -10182,7 +10182,7 @@ De.prototype.getAlternates = function(t, e, n) {
|
|
|
10182
10182
|
}
|
|
10183
10183
|
return r;
|
|
10184
10184
|
};
|
|
10185
|
-
|
|
10185
|
+
Me.prototype.getLigatures = function(t, e, n) {
|
|
10186
10186
|
const r = [], s = this.getLookupTables(e, n, t, 4);
|
|
10187
10187
|
for (let i = 0; i < s.length; i++) {
|
|
10188
10188
|
const a = s[i].subtables;
|
|
@@ -10202,7 +10202,7 @@ De.prototype.getLigatures = function(t, e, n) {
|
|
|
10202
10202
|
}
|
|
10203
10203
|
return r;
|
|
10204
10204
|
};
|
|
10205
|
-
|
|
10205
|
+
Me.prototype.addSingle = function(t, e, n, r) {
|
|
10206
10206
|
const s = this.getLookupTables(n, r, t, 1, !0)[0], i = es(s, 2, {
|
|
10207
10207
|
// lookup type 1 subtable, format 2, coverage format 1
|
|
10208
10208
|
substFormat: 2,
|
|
@@ -10214,7 +10214,7 @@ De.prototype.addSingle = function(t, e, n, r) {
|
|
|
10214
10214
|
let o = this.binSearch(i.coverage.glyphs, a);
|
|
10215
10215
|
o < 0 && (o = -1 - o, i.coverage.glyphs.splice(o, 0, a), i.substitute.splice(o, 0, 0)), i.substitute[o] = e.by;
|
|
10216
10216
|
};
|
|
10217
|
-
|
|
10217
|
+
Me.prototype.addMultiple = function(t, e, n, r) {
|
|
10218
10218
|
H.assert(e.by instanceof Array && e.by.length > 1, 'Multiple: "by" must be an array of two or more ids');
|
|
10219
10219
|
const s = this.getLookupTables(n, r, t, 2, !0)[0], i = es(s, 1, {
|
|
10220
10220
|
// lookup type 2 subtable, format 1, coverage format 1
|
|
@@ -10227,7 +10227,7 @@ De.prototype.addMultiple = function(t, e, n, r) {
|
|
|
10227
10227
|
let o = this.binSearch(i.coverage.glyphs, a);
|
|
10228
10228
|
o < 0 && (o = -1 - o, i.coverage.glyphs.splice(o, 0, a), i.sequences.splice(o, 0, 0)), i.sequences[o] = e.by;
|
|
10229
10229
|
};
|
|
10230
|
-
|
|
10230
|
+
Me.prototype.addAlternate = function(t, e, n, r) {
|
|
10231
10231
|
const s = this.getLookupTables(n, r, t, 3, !0)[0], i = es(s, 1, {
|
|
10232
10232
|
// lookup type 3 subtable, format 1, coverage format 1
|
|
10233
10233
|
substFormat: 1,
|
|
@@ -10239,7 +10239,7 @@ De.prototype.addAlternate = function(t, e, n, r) {
|
|
|
10239
10239
|
let o = this.binSearch(i.coverage.glyphs, a);
|
|
10240
10240
|
o < 0 && (o = -1 - o, i.coverage.glyphs.splice(o, 0, a), i.alternateSets.splice(o, 0, 0)), i.alternateSets[o] = e.by;
|
|
10241
10241
|
};
|
|
10242
|
-
|
|
10242
|
+
Me.prototype.addLigature = function(t, e, n, r) {
|
|
10243
10243
|
const s = this.getLookupTables(n, r, t, 4, !0)[0];
|
|
10244
10244
|
let i = s.subtables[0];
|
|
10245
10245
|
i || (i = {
|
|
@@ -10262,7 +10262,7 @@ De.prototype.addLigature = function(t, e, n, r) {
|
|
|
10262
10262
|
} else
|
|
10263
10263
|
l = -1 - l, i.coverage.glyphs.splice(l, 0, a), i.ligatureSets.splice(l, 0, [c]);
|
|
10264
10264
|
};
|
|
10265
|
-
|
|
10265
|
+
Me.prototype.getFeature = function(t, e, n) {
|
|
10266
10266
|
if (/ss\d\d/.test(t))
|
|
10267
10267
|
return this.getSingle(t, e, n);
|
|
10268
10268
|
switch (t) {
|
|
@@ -10279,7 +10279,7 @@ De.prototype.getFeature = function(t, e, n) {
|
|
|
10279
10279
|
return this.getMultiple(t, e, n);
|
|
10280
10280
|
}
|
|
10281
10281
|
};
|
|
10282
|
-
|
|
10282
|
+
Me.prototype.add = function(t, e, n, r) {
|
|
10283
10283
|
if (/ss\d\d/.test(t))
|
|
10284
10284
|
return this.addSingle(t, e, n, r);
|
|
10285
10285
|
switch (t) {
|
|
@@ -10294,7 +10294,7 @@ De.prototype.add = function(t, e, n, r) {
|
|
|
10294
10294
|
return e.by instanceof Array ? this.addMultiple(t, e, n, r) : this.addLigature(t, e, n, r);
|
|
10295
10295
|
}
|
|
10296
10296
|
};
|
|
10297
|
-
var Ju =
|
|
10297
|
+
var Ju = Me, lo = class {
|
|
10298
10298
|
// private properties don't work with reify
|
|
10299
10299
|
// @TODO: refactor once we migrated to ES6 modules, see https://github.com/opentypejs/opentype.js/pull/579
|
|
10300
10300
|
// #font = null;
|
|
@@ -10339,7 +10339,7 @@ var Ju = De, lo = class {
|
|
|
10339
10339
|
* @returns {integer}
|
|
10340
10340
|
*/
|
|
10341
10341
|
toCPALcolor(t) {
|
|
10342
|
-
return Array.isArray(t) ? t.map((e) =>
|
|
10342
|
+
return Array.isArray(t) ? t.map((e) => Dn(e, "raw")) : Dn(t, "raw");
|
|
10343
10343
|
}
|
|
10344
10344
|
/**
|
|
10345
10345
|
* Fills a set of palette colors (from palette index, or a provided array of CPAL color values) with a set of colors, falling back to the default color value, until a given count
|
|
@@ -10729,7 +10729,7 @@ function $s(t, e, n, r, s) {
|
|
|
10729
10729
|
return (e & r) > 0 ? (i = t.parseByte(), e & s || (i = -i), i = n + i) : (e & s) > 0 ? i = n : i = n + t.parseShort(), i;
|
|
10730
10730
|
}
|
|
10731
10731
|
function uo(t, e, n) {
|
|
10732
|
-
const r = new
|
|
10732
|
+
const r = new D.Parser(e, n);
|
|
10733
10733
|
t._numberOfContours = r.parseShort(), t._xMin = r.parseShort(), t._yMin = r.parseShort(), t._xMax = r.parseShort(), t._yMax = r.parseShort();
|
|
10734
10734
|
let s, i;
|
|
10735
10735
|
if (t._numberOfContours > 0) {
|
|
@@ -11338,7 +11338,7 @@ var fo = { getPath: ts, parse: hh }, fh = class {
|
|
|
11338
11338
|
hvar() {
|
|
11339
11339
|
return this.font.tables.hvar;
|
|
11340
11340
|
}
|
|
11341
|
-
}, Ys = 1e6, Un = 64, Pn = 1e4, po,
|
|
11341
|
+
}, Ys = 1e6, Un = 64, Pn = 1e4, po, Ft, go, Pr;
|
|
11342
11342
|
function mo(t) {
|
|
11343
11343
|
this.font = t, this.getCommands = function(e) {
|
|
11344
11344
|
return fo.getPath(e).commands;
|
|
@@ -11568,7 +11568,7 @@ mo.prototype.exec = function(t, e) {
|
|
|
11568
11568
|
if (!s) {
|
|
11569
11569
|
pt.prototype = xh, s = this._fpgmState = new pt("fpgm", n.tables.fpgm), s.funcs = [], s.font = n, s.instructionCount = 0, s.callDepth = 0;
|
|
11570
11570
|
try {
|
|
11571
|
-
|
|
11571
|
+
Ft(s);
|
|
11572
11572
|
} catch (a) {
|
|
11573
11573
|
console.log("Hinting error in FPGM:" + a), this._errorState = 3;
|
|
11574
11574
|
return;
|
|
@@ -11583,7 +11583,7 @@ mo.prototype.exec = function(t, e) {
|
|
|
11583
11583
|
} else
|
|
11584
11584
|
r.cvt = [];
|
|
11585
11585
|
try {
|
|
11586
|
-
|
|
11586
|
+
Ft(r);
|
|
11587
11587
|
} catch (a) {
|
|
11588
11588
|
this._errorState < 2 && console.log("Hinting error in PREP:" + a), this._errorState = 2;
|
|
11589
11589
|
}
|
|
@@ -11620,7 +11620,7 @@ go = function(t, e) {
|
|
|
11620
11620
|
t.instructions && !o.inhibitGridFit && (o = new pt("glyf", t.instructions), o.gZone = o.z0 = o.z1 = o.z2 = a, o.contours = i, a.push(
|
|
11621
11621
|
new at(0, 0),
|
|
11622
11622
|
new at(Math.round(t.advanceWidth * n), 0)
|
|
11623
|
-
),
|
|
11623
|
+
), Ft(o), a.length -= 2);
|
|
11624
11624
|
}
|
|
11625
11625
|
return a;
|
|
11626
11626
|
};
|
|
@@ -11640,9 +11640,9 @@ Pr = function(t, e, n, r) {
|
|
|
11640
11640
|
e.inhibitGridFit || (a.push(
|
|
11641
11641
|
new at(0, 0),
|
|
11642
11642
|
new at(Math.round(t.advanceWidth * n), 0)
|
|
11643
|
-
),
|
|
11643
|
+
), Ft(e), a.length -= 2);
|
|
11644
11644
|
};
|
|
11645
|
-
|
|
11645
|
+
Ft = function(t) {
|
|
11646
11646
|
let e = t.prog;
|
|
11647
11647
|
if (!e) return;
|
|
11648
11648
|
const n = e.length;
|
|
@@ -11723,11 +11723,11 @@ function Ch(t) {
|
|
|
11723
11723
|
function Th(t) {
|
|
11724
11724
|
t.fv = t.pv;
|
|
11725
11725
|
}
|
|
11726
|
-
function
|
|
11726
|
+
function Fh(t) {
|
|
11727
11727
|
const e = t.stack, n = e.pop(), r = e.pop(), s = e.pop(), i = e.pop(), a = e.pop(), o = t.z0, c = t.z1, l = o[n], u = o[r], f = c[s], h = c[i], p = t.z2[a], y = l.x, m = l.y, b = u.x, v = u.y, w = f.x, C = f.y, T = h.x, E = h.y, R = (y - b) * (C - E) - (m - v) * (w - T), P = y * v - m * b, W = w * E - C * T;
|
|
11728
11728
|
p.x = (P * (w - T) - W * (y - b)) / R, p.y = (P * (C - E) - W * (m - v)) / R;
|
|
11729
11729
|
}
|
|
11730
|
-
function
|
|
11730
|
+
function kh(t) {
|
|
11731
11731
|
t.rp0 = t.stack.pop();
|
|
11732
11732
|
}
|
|
11733
11733
|
function Eh(t) {
|
|
@@ -11791,10 +11791,10 @@ function Rh(t) {
|
|
|
11791
11791
|
function Bh(t) {
|
|
11792
11792
|
t.loop = t.stack.pop(), t.loop > Pn && (t.loop = Pn);
|
|
11793
11793
|
}
|
|
11794
|
-
function
|
|
11794
|
+
function Mh(t) {
|
|
11795
11795
|
t.round = yo;
|
|
11796
11796
|
}
|
|
11797
|
-
function
|
|
11797
|
+
function Dh(t) {
|
|
11798
11798
|
t.round = mh;
|
|
11799
11799
|
}
|
|
11800
11800
|
function _h(t) {
|
|
@@ -11838,7 +11838,7 @@ function Vh(t) {
|
|
|
11838
11838
|
const s = t.ip, i = t.prog;
|
|
11839
11839
|
t.prog = t.funcs[n];
|
|
11840
11840
|
for (let a = 0; a < r; a++)
|
|
11841
|
-
|
|
11841
|
+
Ft(t);
|
|
11842
11842
|
t.ip = s, t.prog = i, t.callDepth--;
|
|
11843
11843
|
}
|
|
11844
11844
|
function qh(t) {
|
|
@@ -11846,7 +11846,7 @@ function qh(t) {
|
|
|
11846
11846
|
if (++t.callDepth > Un)
|
|
11847
11847
|
throw new Error("Hinting call depth exceeded maximum of " + Un);
|
|
11848
11848
|
const n = t.ip, r = t.prog;
|
|
11849
|
-
t.prog = t.funcs[e],
|
|
11849
|
+
t.prog = t.funcs[e], Ft(t), t.ip = n, t.prog = r, t.callDepth--;
|
|
11850
11850
|
}
|
|
11851
11851
|
function jh(t) {
|
|
11852
11852
|
const e = t.stack, n = e.pop();
|
|
@@ -12078,11 +12078,11 @@ function Tf(t) {
|
|
|
12078
12078
|
const e = t.stack, n = e.pop(), r = e.pop();
|
|
12079
12079
|
e.push(r - n);
|
|
12080
12080
|
}
|
|
12081
|
-
function
|
|
12081
|
+
function Ff(t) {
|
|
12082
12082
|
const e = t.stack, n = e.pop(), r = e.pop();
|
|
12083
12083
|
e.push(r * 64 / n);
|
|
12084
12084
|
}
|
|
12085
|
-
function
|
|
12085
|
+
function kf(t) {
|
|
12086
12086
|
const e = t.stack, n = e.pop(), r = e.pop();
|
|
12087
12087
|
e.push(r * n / 64);
|
|
12088
12088
|
}
|
|
@@ -12192,10 +12192,10 @@ function Bf(t) {
|
|
|
12192
12192
|
}
|
|
12193
12193
|
e &= 15, e === 0 ? t.srThreshold = 0 : t.srThreshold = (e / 8 - 0.5) * n;
|
|
12194
12194
|
}
|
|
12195
|
-
function
|
|
12195
|
+
function Mf(t) {
|
|
12196
12196
|
t.round = dh;
|
|
12197
12197
|
}
|
|
12198
|
-
function
|
|
12198
|
+
function Df(t) {
|
|
12199
12199
|
t.round = yh;
|
|
12200
12200
|
}
|
|
12201
12201
|
function _f(t) {
|
|
@@ -12295,9 +12295,9 @@ po = [
|
|
|
12295
12295
|
/* 0x0E */
|
|
12296
12296
|
Th,
|
|
12297
12297
|
/* 0x0F */
|
|
12298
|
-
kh,
|
|
12299
|
-
/* 0x10 */
|
|
12300
12298
|
Fh,
|
|
12299
|
+
/* 0x10 */
|
|
12300
|
+
kh,
|
|
12301
12301
|
/* 0x11 */
|
|
12302
12302
|
Eh,
|
|
12303
12303
|
/* 0x12 */
|
|
@@ -12313,9 +12313,9 @@ po = [
|
|
|
12313
12313
|
/* 0x17 */
|
|
12314
12314
|
Bh,
|
|
12315
12315
|
/* 0x18 */
|
|
12316
|
-
Dh,
|
|
12317
|
-
/* 0x19 */
|
|
12318
12316
|
Mh,
|
|
12317
|
+
/* 0x19 */
|
|
12318
|
+
Dh,
|
|
12319
12319
|
/* 0x1A */
|
|
12320
12320
|
_h,
|
|
12321
12321
|
/* 0x1B */
|
|
@@ -12470,9 +12470,9 @@ po = [
|
|
|
12470
12470
|
/* 0x61 */
|
|
12471
12471
|
Tf,
|
|
12472
12472
|
/* 0x62 */
|
|
12473
|
-
kf,
|
|
12474
|
-
/* 0x63 */
|
|
12475
12473
|
Ff,
|
|
12474
|
+
/* 0x63 */
|
|
12475
|
+
kf,
|
|
12476
12476
|
/* 0x64 */
|
|
12477
12477
|
Ef,
|
|
12478
12478
|
/* 0x65 */
|
|
@@ -12524,11 +12524,11 @@ po = [
|
|
|
12524
12524
|
void 0,
|
|
12525
12525
|
// TODO JROF[]
|
|
12526
12526
|
/* 0x7A */
|
|
12527
|
-
|
|
12527
|
+
Mf,
|
|
12528
12528
|
/* 0x7B */
|
|
12529
12529
|
void 0,
|
|
12530
12530
|
/* 0x7C */
|
|
12531
|
-
|
|
12531
|
+
Df,
|
|
12532
12532
|
/* 0x7D */
|
|
12533
12533
|
_f,
|
|
12534
12534
|
/* 0x7E */
|
|
@@ -12808,7 +12808,7 @@ function ns(t, e, n) {
|
|
|
12808
12808
|
function qf(t, e, n) {
|
|
12809
12809
|
this.contextName = t, this.openRange = null, this.ranges = [], this.checkStart = e, this.checkEnd = n;
|
|
12810
12810
|
}
|
|
12811
|
-
function
|
|
12811
|
+
function ke(t, e) {
|
|
12812
12812
|
this.context = t, this.index = e, this.length = t.length, this.current = t[e], this.backtrack = t.slice(0, e), this.lookahead = t.slice(e + 1);
|
|
12813
12813
|
}
|
|
12814
12814
|
function qn(t) {
|
|
@@ -12931,10 +12931,10 @@ qn.prototype.subscribe = function(t) {
|
|
|
12931
12931
|
qn.prototype.unsubscribe = function(t) {
|
|
12932
12932
|
this.subscribers.splice(t, 1);
|
|
12933
12933
|
};
|
|
12934
|
-
|
|
12934
|
+
ke.prototype.setCurrentIndex = function(t) {
|
|
12935
12935
|
this.index = t, this.current = this.context[t], this.backtrack = this.context.slice(0, t), this.lookahead = this.context.slice(t + 1);
|
|
12936
12936
|
};
|
|
12937
|
-
|
|
12937
|
+
ke.prototype.get = function(t) {
|
|
12938
12938
|
switch (!0) {
|
|
12939
12939
|
case t === 0:
|
|
12940
12940
|
return this.current;
|
|
@@ -13006,7 +13006,7 @@ he.prototype.updateContextsRanges = function() {
|
|
|
13006
13006
|
this.resetContextsRanges();
|
|
13007
13007
|
const t = this.tokens.map((e) => e.char);
|
|
13008
13008
|
for (let e = 0; e < t.length; e++) {
|
|
13009
|
-
const n = new
|
|
13009
|
+
const n = new ke(t, e);
|
|
13010
13010
|
this.runContextCheck(n);
|
|
13011
13011
|
}
|
|
13012
13012
|
this.dispatch("updateContextsRanges", [this.registeredContexts]);
|
|
@@ -13033,7 +13033,7 @@ he.prototype.tokenize = function(t) {
|
|
|
13033
13033
|
let e = Array.from(t);
|
|
13034
13034
|
this.dispatch("start");
|
|
13035
13035
|
for (let n = 0; n < e.length; n++) {
|
|
13036
|
-
const r = e[n], s = new
|
|
13036
|
+
const r = e[n], s = new ke(e, n);
|
|
13037
13037
|
this.dispatch("next", [s]), this.runContextCheck(s);
|
|
13038
13038
|
let i = new Wt(r);
|
|
13039
13039
|
this.tokens.push(i), this.dispatch("newToken", [i, s]);
|
|
@@ -13059,7 +13059,7 @@ function wn(t) {
|
|
|
13059
13059
|
function Yf(t) {
|
|
13060
13060
|
return /\s/.test(t);
|
|
13061
13061
|
}
|
|
13062
|
-
function
|
|
13062
|
+
function De(t) {
|
|
13063
13063
|
this.font = t, this.features = {};
|
|
13064
13064
|
}
|
|
13065
13065
|
function ut(t) {
|
|
@@ -13117,7 +13117,7 @@ function Zf(t, e) {
|
|
|
13117
13117
|
let i = t.lookahead.slice(s);
|
|
13118
13118
|
for (; i.length && mt(i[0].char); )
|
|
13119
13119
|
i.shift();
|
|
13120
|
-
const a = new
|
|
13120
|
+
const a = new ke(i, 0);
|
|
13121
13121
|
let o = ir(
|
|
13122
13122
|
e.lookaheadCoverage,
|
|
13123
13123
|
a
|
|
@@ -13125,7 +13125,7 @@ function Zf(t, e) {
|
|
|
13125
13125
|
for (c.reverse(); c.length && mt(c[0].char); )
|
|
13126
13126
|
c.shift();
|
|
13127
13127
|
if (c.length < e.backtrackCoverage.length) return [];
|
|
13128
|
-
const l = new
|
|
13128
|
+
const l = new ke(c, 0);
|
|
13129
13129
|
let u = ir(
|
|
13130
13130
|
e.backtrackCoverage,
|
|
13131
13131
|
l
|
|
@@ -13222,7 +13222,7 @@ function tp(t, e) {
|
|
|
13222
13222
|
let n = yt(t, e.coverage);
|
|
13223
13223
|
return n === -1 ? null : e.sequences[n];
|
|
13224
13224
|
}
|
|
13225
|
-
|
|
13225
|
+
De.prototype.getDefaultScriptFeaturesIndexes = function() {
|
|
13226
13226
|
const t = this.font.tables.gsub.scripts;
|
|
13227
13227
|
for (let e = 0; e < t.length; e++) {
|
|
13228
13228
|
const n = t[e];
|
|
@@ -13230,7 +13230,7 @@ Me.prototype.getDefaultScriptFeaturesIndexes = function() {
|
|
|
13230
13230
|
}
|
|
13231
13231
|
return [];
|
|
13232
13232
|
};
|
|
13233
|
-
|
|
13233
|
+
De.prototype.getScriptFeaturesIndexes = function(t) {
|
|
13234
13234
|
if (!this.font.tables.gsub) return [];
|
|
13235
13235
|
if (!t) return this.getDefaultScriptFeaturesIndexes();
|
|
13236
13236
|
const n = this.font.tables.gsub.scripts;
|
|
@@ -13250,7 +13250,7 @@ Me.prototype.getScriptFeaturesIndexes = function(t) {
|
|
|
13250
13250
|
}
|
|
13251
13251
|
return this.getDefaultScriptFeaturesIndexes();
|
|
13252
13252
|
};
|
|
13253
|
-
|
|
13253
|
+
De.prototype.mapTagsToFeatures = function(t, e) {
|
|
13254
13254
|
let n = {};
|
|
13255
13255
|
for (let r = 0; r < t.length; r++) {
|
|
13256
13256
|
const s = t[r].tag, i = t[r].feature;
|
|
@@ -13258,7 +13258,7 @@ Me.prototype.mapTagsToFeatures = function(t, e) {
|
|
|
13258
13258
|
}
|
|
13259
13259
|
this.features[e].tags = n;
|
|
13260
13260
|
};
|
|
13261
|
-
|
|
13261
|
+
De.prototype.getScriptFeatures = function(t) {
|
|
13262
13262
|
let e = this.features[t];
|
|
13263
13263
|
if (Object.prototype.hasOwnProperty.call(this.features, t)) return e;
|
|
13264
13264
|
const n = this.getScriptFeaturesIndexes(t);
|
|
@@ -13266,11 +13266,11 @@ Me.prototype.getScriptFeatures = function(t) {
|
|
|
13266
13266
|
const r = this.font.tables.gsub;
|
|
13267
13267
|
return e = n.map((s) => r.features[s]), this.features[t] = e, this.mapTagsToFeatures(e, t), e;
|
|
13268
13268
|
};
|
|
13269
|
-
|
|
13269
|
+
De.prototype.getSubstitutionType = function(t, e) {
|
|
13270
13270
|
const n = t.lookupType.toString(), r = e.substFormat.toString();
|
|
13271
13271
|
return n + r;
|
|
13272
13272
|
};
|
|
13273
|
-
|
|
13273
|
+
De.prototype.getLookupMethod = function(t, e) {
|
|
13274
13274
|
let n = this.getSubstitutionType(t, e);
|
|
13275
13275
|
switch (n) {
|
|
13276
13276
|
case "11":
|
|
@@ -13314,7 +13314,7 @@ Me.prototype.getLookupMethod = function(t, e) {
|
|
|
13314
13314
|
);
|
|
13315
13315
|
}
|
|
13316
13316
|
};
|
|
13317
|
-
|
|
13317
|
+
De.prototype.lookupFeature = function(t) {
|
|
13318
13318
|
let e = t.contextParams, n = e.index;
|
|
13319
13319
|
const r = this.getFeature({
|
|
13320
13320
|
tag: t.tag,
|
|
@@ -13375,12 +13375,12 @@ Me.prototype.lookupFeature = function(t) {
|
|
|
13375
13375
|
}));
|
|
13376
13376
|
break;
|
|
13377
13377
|
}
|
|
13378
|
-
e = new
|
|
13378
|
+
e = new ke(i, n), !(Array.isArray(p) && !p.length) && (p = null);
|
|
13379
13379
|
}
|
|
13380
13380
|
}
|
|
13381
13381
|
return i.length ? i : null;
|
|
13382
13382
|
};
|
|
13383
|
-
|
|
13383
|
+
De.prototype.supports = function(t) {
|
|
13384
13384
|
if (!t.script) return !1;
|
|
13385
13385
|
this.getScriptFeatures(t.script);
|
|
13386
13386
|
const e = Object.prototype.hasOwnProperty.call(this.features, t.script);
|
|
@@ -13388,22 +13388,22 @@ Me.prototype.supports = function(t) {
|
|
|
13388
13388
|
const n = this.features[t.script].some((r) => r.tag === t.tag);
|
|
13389
13389
|
return e && n;
|
|
13390
13390
|
};
|
|
13391
|
-
|
|
13391
|
+
De.prototype.getLookupSubtables = function(t) {
|
|
13392
13392
|
return t.subtables || null;
|
|
13393
13393
|
};
|
|
13394
|
-
|
|
13394
|
+
De.prototype.getLookupByIndex = function(t) {
|
|
13395
13395
|
return this.font.tables.gsub.lookups[t] || null;
|
|
13396
13396
|
};
|
|
13397
|
-
|
|
13397
|
+
De.prototype.getFeatureLookups = function(t) {
|
|
13398
13398
|
return t.lookupListIndexes.map(this.getLookupByIndex.bind(this));
|
|
13399
13399
|
};
|
|
13400
|
-
|
|
13400
|
+
De.prototype.getFeature = function(e) {
|
|
13401
13401
|
if (!this.font) return { FAIL: "No font was found" };
|
|
13402
13402
|
Object.prototype.hasOwnProperty.call(this.features, e.script) || this.getScriptFeatures(e.script);
|
|
13403
13403
|
const n = this.features[e.script];
|
|
13404
13404
|
return n ? n.tags[e.tag] ? this.features[e.script].tags[e.tag] : null : { FAIL: `No feature for script ${e.script}` };
|
|
13405
13405
|
};
|
|
13406
|
-
var np =
|
|
13406
|
+
var np = De;
|
|
13407
13407
|
function rp(t) {
|
|
13408
13408
|
const e = t.current, n = t.get(-1);
|
|
13409
13409
|
return (
|
|
@@ -13510,13 +13510,13 @@ function dp(t) {
|
|
|
13510
13510
|
function gp(t) {
|
|
13511
13511
|
const e = "arab", n = this.featuresTags[e], r = this.tokenizer.getRangeTokens(t);
|
|
13512
13512
|
if (r.length === 1) return;
|
|
13513
|
-
let s = new
|
|
13513
|
+
let s = new ke(
|
|
13514
13514
|
r.map(
|
|
13515
13515
|
(a) => a.getState("glyphIndex")
|
|
13516
13516
|
),
|
|
13517
13517
|
0
|
|
13518
13518
|
);
|
|
13519
|
-
const i = new
|
|
13519
|
+
const i = new ke(
|
|
13520
13520
|
r.map(
|
|
13521
13521
|
(a) => a.char
|
|
13522
13522
|
),
|
|
@@ -13559,7 +13559,7 @@ function gp(t) {
|
|
|
13559
13559
|
var mp = gp;
|
|
13560
13560
|
function hi(t, e) {
|
|
13561
13561
|
const n = t.map((r) => r.activeState.value);
|
|
13562
|
-
return new
|
|
13562
|
+
return new ke(n, 0);
|
|
13563
13563
|
}
|
|
13564
13564
|
function yp(t) {
|
|
13565
13565
|
const e = "arab";
|
|
@@ -13593,7 +13593,7 @@ var Sp = {
|
|
|
13593
13593
|
};
|
|
13594
13594
|
function fi(t, e) {
|
|
13595
13595
|
const n = t.map((r) => r.activeState.value);
|
|
13596
|
-
return new
|
|
13596
|
+
return new ke(n, 0);
|
|
13597
13597
|
}
|
|
13598
13598
|
function wp(t) {
|
|
13599
13599
|
const e = "delf", n = "ccmp";
|
|
@@ -13625,7 +13625,7 @@ function Tp(t) {
|
|
|
13625
13625
|
!wn(n) && wn(e)
|
|
13626
13626
|
);
|
|
13627
13627
|
}
|
|
13628
|
-
function
|
|
13628
|
+
function Fp(t) {
|
|
13629
13629
|
const e = t.get(1);
|
|
13630
13630
|
return (
|
|
13631
13631
|
// ? last latin char
|
|
@@ -13633,13 +13633,13 @@ function kp(t) {
|
|
|
13633
13633
|
!wn(e)
|
|
13634
13634
|
);
|
|
13635
13635
|
}
|
|
13636
|
-
var
|
|
13636
|
+
var kp = {
|
|
13637
13637
|
startCheck: Tp,
|
|
13638
|
-
endCheck:
|
|
13638
|
+
endCheck: Fp
|
|
13639
13639
|
};
|
|
13640
13640
|
function pi(t, e) {
|
|
13641
13641
|
const n = t.map((r) => r.activeState.value);
|
|
13642
|
-
return new
|
|
13642
|
+
return new ke(n, 0);
|
|
13643
13643
|
}
|
|
13644
13644
|
function Ep(t) {
|
|
13645
13645
|
const e = "latn";
|
|
@@ -13683,7 +13683,7 @@ var Ip = {
|
|
|
13683
13683
|
};
|
|
13684
13684
|
function di(t, e) {
|
|
13685
13685
|
const n = t.map((r) => r.activeState.value);
|
|
13686
|
-
return new
|
|
13686
|
+
return new ke(n, e || 0);
|
|
13687
13687
|
}
|
|
13688
13688
|
function Rp(t) {
|
|
13689
13689
|
const e = "thai";
|
|
@@ -13707,9 +13707,9 @@ function Rp(t) {
|
|
|
13707
13707
|
var Bp = Rp;
|
|
13708
13708
|
function gi(t, e) {
|
|
13709
13709
|
const n = t.map((r) => r.activeState.value);
|
|
13710
|
-
return new
|
|
13710
|
+
return new ke(n, e || 0);
|
|
13711
13711
|
}
|
|
13712
|
-
function
|
|
13712
|
+
function Mp(t) {
|
|
13713
13713
|
const e = "thai";
|
|
13714
13714
|
let n = this.tokenizer.getRangeTokens(t), r = gi(n, 0);
|
|
13715
13715
|
for (let s = 0; s < r.context.length; s++) {
|
|
@@ -13728,10 +13728,10 @@ function Dp(t) {
|
|
|
13728
13728
|
}
|
|
13729
13729
|
}
|
|
13730
13730
|
}
|
|
13731
|
-
var
|
|
13731
|
+
var Dp = Mp;
|
|
13732
13732
|
function mi(t, e) {
|
|
13733
13733
|
const n = t.map((r) => r.activeState.value);
|
|
13734
|
-
return new
|
|
13734
|
+
return new ke(n, e || 0);
|
|
13735
13735
|
}
|
|
13736
13736
|
function _p(t) {
|
|
13737
13737
|
const e = "thai";
|
|
@@ -13797,7 +13797,7 @@ He.prototype.setText = function(t) {
|
|
|
13797
13797
|
};
|
|
13798
13798
|
He.prototype.contextChecks = {
|
|
13799
13799
|
ccmpReplacementCheck: Sp,
|
|
13800
|
-
latinWordCheck:
|
|
13800
|
+
latinWordCheck: kp,
|
|
13801
13801
|
arabicWordCheck: ip,
|
|
13802
13802
|
arabicSentenceCheck: cp,
|
|
13803
13803
|
thaiWordCheck: Ip,
|
|
@@ -13898,7 +13898,7 @@ function Kp() {
|
|
|
13898
13898
|
const t = this.tokenizer.getContextRanges("thaiWord");
|
|
13899
13899
|
for (let e = 0; e < t.length; e++) {
|
|
13900
13900
|
const n = t[e];
|
|
13901
|
-
this.hasFeatureEnabled("thai", "liga") &&
|
|
13901
|
+
this.hasFeatureEnabled("thai", "liga") && Dp.call(this, n), this.hasFeatureEnabled("thai", "rlig") && Up.call(this, n), this.hasFeatureEnabled("thai", "ccmp") && Bp.call(this, n);
|
|
13902
13902
|
}
|
|
13903
13903
|
}
|
|
13904
13904
|
He.prototype.checkContextReady = function(t) {
|
|
@@ -14216,7 +14216,7 @@ te.prototype.usWeightClasses = {
|
|
|
14216
14216
|
};
|
|
14217
14217
|
var Jp = te;
|
|
14218
14218
|
function Qp(t, e) {
|
|
14219
|
-
const n = new
|
|
14219
|
+
const n = new D.Parser(t, e), r = n.parseUShort(), s = n.parseUShort();
|
|
14220
14220
|
r !== 1 && console.warn(`Unsupported hvar table version ${r}.${s}`);
|
|
14221
14221
|
const i = [
|
|
14222
14222
|
r,
|
|
@@ -14243,8 +14243,8 @@ function ed() {
|
|
|
14243
14243
|
}
|
|
14244
14244
|
var td = { make: ed, parse: Qp }, nd = function() {
|
|
14245
14245
|
return {
|
|
14246
|
-
coverage: this.parsePointer(
|
|
14247
|
-
attachPoints: this.parseList(
|
|
14246
|
+
coverage: this.parsePointer(F.coverage),
|
|
14247
|
+
attachPoints: this.parseList(F.pointer(F.uShortList))
|
|
14248
14248
|
};
|
|
14249
14249
|
}, rd = function() {
|
|
14250
14250
|
var t = this.parseUShort();
|
|
@@ -14258,28 +14258,28 @@ var td = { make: ed, parse: Qp }, nd = function() {
|
|
|
14258
14258
|
if (t === 3)
|
|
14259
14259
|
return { coordinate: this.parseShort() };
|
|
14260
14260
|
}, sd = function() {
|
|
14261
|
-
return this.parseList(
|
|
14261
|
+
return this.parseList(F.pointer(rd));
|
|
14262
14262
|
}, id = function() {
|
|
14263
14263
|
return {
|
|
14264
|
-
coverage: this.parsePointer(
|
|
14265
|
-
ligGlyphs: this.parseList(
|
|
14264
|
+
coverage: this.parsePointer(F.coverage),
|
|
14265
|
+
ligGlyphs: this.parseList(F.pointer(sd))
|
|
14266
14266
|
};
|
|
14267
14267
|
}, ad = function() {
|
|
14268
|
-
return this.parseUShort(), this.parseList(
|
|
14268
|
+
return this.parseUShort(), this.parseList(F.pointer(F.coverage));
|
|
14269
14269
|
};
|
|
14270
14270
|
function od(t, e) {
|
|
14271
14271
|
e = e || 0;
|
|
14272
|
-
const n = new
|
|
14272
|
+
const n = new F(t, e), r = n.parseVersion(1);
|
|
14273
14273
|
H.argument(
|
|
14274
14274
|
r === 1 || r === 1.2 || r === 1.3,
|
|
14275
14275
|
"Unsupported GDEF table version."
|
|
14276
14276
|
);
|
|
14277
14277
|
var s = {
|
|
14278
14278
|
version: r,
|
|
14279
|
-
classDef: n.parsePointer(
|
|
14279
|
+
classDef: n.parsePointer(F.classDef),
|
|
14280
14280
|
attachList: n.parsePointer(nd),
|
|
14281
14281
|
ligCaretList: n.parsePointer(id),
|
|
14282
|
-
markAttachClassDef: n.parsePointer(
|
|
14282
|
+
markAttachClassDef: n.parsePointer(F.classDef)
|
|
14283
14283
|
};
|
|
14284
14284
|
return r >= 1.2 && (s.markGlyphSets = n.parsePointer(ad)), s;
|
|
14285
14285
|
}
|
|
@@ -14289,13 +14289,13 @@ Ve[1] = function() {
|
|
|
14289
14289
|
if (n === 1)
|
|
14290
14290
|
return {
|
|
14291
14291
|
posFormat: 1,
|
|
14292
|
-
coverage: this.parsePointer(
|
|
14292
|
+
coverage: this.parsePointer(F.coverage),
|
|
14293
14293
|
value: this.parseValueRecord()
|
|
14294
14294
|
};
|
|
14295
14295
|
if (n === 2)
|
|
14296
14296
|
return {
|
|
14297
14297
|
posFormat: 2,
|
|
14298
|
-
coverage: this.parsePointer(
|
|
14298
|
+
coverage: this.parsePointer(F.coverage),
|
|
14299
14299
|
values: this.parseValueRecordList()
|
|
14300
14300
|
};
|
|
14301
14301
|
H.assert(!1, "0x" + e.toString(16) + ": GPOS lookup type 1 format must be 1 or 2.");
|
|
@@ -14303,14 +14303,14 @@ Ve[1] = function() {
|
|
|
14303
14303
|
Ve[2] = function() {
|
|
14304
14304
|
const e = this.offset + this.relativeOffset, n = this.parseUShort();
|
|
14305
14305
|
H.assert(n === 1 || n === 2, "0x" + e.toString(16) + ": GPOS lookup type 2 format must be 1 or 2.");
|
|
14306
|
-
const r = this.parsePointer(
|
|
14306
|
+
const r = this.parsePointer(F.coverage), s = this.parseUShort(), i = this.parseUShort();
|
|
14307
14307
|
if (n === 1)
|
|
14308
14308
|
return {
|
|
14309
14309
|
posFormat: n,
|
|
14310
14310
|
coverage: r,
|
|
14311
14311
|
valueFormat1: s,
|
|
14312
14312
|
valueFormat2: i,
|
|
14313
|
-
pairSets: this.parseList(
|
|
14313
|
+
pairSets: this.parseList(F.pointer(F.list(function() {
|
|
14314
14314
|
return {
|
|
14315
14315
|
// pairValueRecord
|
|
14316
14316
|
secondGlyph: this.parseUShort(),
|
|
@@ -14320,7 +14320,7 @@ Ve[2] = function() {
|
|
|
14320
14320
|
})))
|
|
14321
14321
|
};
|
|
14322
14322
|
if (n === 2) {
|
|
14323
|
-
const a = this.parsePointer(
|
|
14323
|
+
const a = this.parsePointer(F.classDef), o = this.parsePointer(F.classDef), c = this.parseUShort(), l = this.parseUShort();
|
|
14324
14324
|
return {
|
|
14325
14325
|
// Class Pair Adjustment
|
|
14326
14326
|
posFormat: n,
|
|
@@ -14331,7 +14331,7 @@ Ve[2] = function() {
|
|
|
14331
14331
|
classDef2: o,
|
|
14332
14332
|
class1Count: c,
|
|
14333
14333
|
class2Count: l,
|
|
14334
|
-
classRecords: this.parseList(c,
|
|
14334
|
+
classRecords: this.parseList(c, F.list(l, function() {
|
|
14335
14335
|
return {
|
|
14336
14336
|
value1: this.parseValueRecord(s),
|
|
14337
14337
|
value2: this.parseValueRecord(i)
|
|
@@ -14363,7 +14363,7 @@ Ve[9] = function() {
|
|
|
14363
14363
|
};
|
|
14364
14364
|
function ld(t, e) {
|
|
14365
14365
|
e = e || 0;
|
|
14366
|
-
const n = new
|
|
14366
|
+
const n = new F(t, e), r = n.parseVersion(1);
|
|
14367
14367
|
return H.argument(r === 1 || r === 1.1, "Unsupported GPOS table version " + r), r === 1 ? {
|
|
14368
14368
|
version: r,
|
|
14369
14369
|
scripts: n.parseScriptList(),
|
|
@@ -14415,7 +14415,7 @@ function dd(t) {
|
|
|
14415
14415
|
return e;
|
|
14416
14416
|
}
|
|
14417
14417
|
function gd(t, e) {
|
|
14418
|
-
const n = new
|
|
14418
|
+
const n = new D.Parser(t, e), r = n.parseUShort();
|
|
14419
14419
|
if (r === 0)
|
|
14420
14420
|
return pd(n);
|
|
14421
14421
|
if (r === 1)
|
|
@@ -14424,7 +14424,7 @@ function gd(t, e) {
|
|
|
14424
14424
|
}
|
|
14425
14425
|
var md = { parse: gd };
|
|
14426
14426
|
function yd(t, e, n, r) {
|
|
14427
|
-
const s = new
|
|
14427
|
+
const s = new D.Parser(t, e), i = r ? s.parseUShort : s.parseULong, a = [];
|
|
14428
14428
|
for (let o = 0; o < n + 1; o += 1) {
|
|
14429
14429
|
let c = i.call(s);
|
|
14430
14430
|
r && (c *= 2), a.push(c);
|
|
@@ -14436,7 +14436,7 @@ function yi(t, e) {
|
|
|
14436
14436
|
const n = [];
|
|
14437
14437
|
let r = 12;
|
|
14438
14438
|
for (let s = 0; s < e; s += 1) {
|
|
14439
|
-
const i =
|
|
14439
|
+
const i = D.getTag(t, r), a = D.getULong(t, r + 4), o = D.getULong(t, r + 8), c = D.getULong(t, r + 12);
|
|
14440
14440
|
n.push({ tag: i, checksum: a, offset: o, length: c, compression: !1 }), r += 16;
|
|
14441
14441
|
}
|
|
14442
14442
|
return n;
|
|
@@ -14445,7 +14445,7 @@ function xd(t, e) {
|
|
|
14445
14445
|
const n = [];
|
|
14446
14446
|
let r = 44;
|
|
14447
14447
|
for (let s = 0; s < e; s += 1) {
|
|
14448
|
-
const i =
|
|
14448
|
+
const i = D.getTag(t, r), a = D.getULong(t, r + 4), o = D.getULong(t, r + 8), c = D.getULong(t, r + 12);
|
|
14449
14449
|
let l;
|
|
14450
14450
|
o < c ? l = "WOFF" : l = !1, n.push({
|
|
14451
14451
|
tag: i,
|
|
@@ -14457,7 +14457,7 @@ function xd(t, e) {
|
|
|
14457
14457
|
}
|
|
14458
14458
|
return n;
|
|
14459
14459
|
}
|
|
14460
|
-
function
|
|
14460
|
+
function J(t, e) {
|
|
14461
14461
|
if (e.compression === "WOFF") {
|
|
14462
14462
|
const n = new Uint8Array(t.buffer, e.offset + 2, e.compressedLength - 2), r = new Uint8Array(e.length);
|
|
14463
14463
|
if (va(n, r), r.byteLength !== e.length)
|
|
@@ -14472,20 +14472,20 @@ function vd(t, e = {}) {
|
|
|
14472
14472
|
t.constructor !== ArrayBuffer && (t = new Uint8Array(t).buffer);
|
|
14473
14473
|
const i = new DataView(t, 0);
|
|
14474
14474
|
let a, o = [];
|
|
14475
|
-
const c =
|
|
14475
|
+
const c = D.getTag(i, 0);
|
|
14476
14476
|
if (c === "\0\0\0" || c === "true" || c === "typ1")
|
|
14477
|
-
s.outlinesFormat = "truetype", a =
|
|
14477
|
+
s.outlinesFormat = "truetype", a = D.getUShort(i, 4), o = yi(i, a);
|
|
14478
14478
|
else if (c === "OTTO")
|
|
14479
|
-
s.outlinesFormat = "cff", a =
|
|
14479
|
+
s.outlinesFormat = "cff", a = D.getUShort(i, 4), o = yi(i, a);
|
|
14480
14480
|
else if (c === "wOFF") {
|
|
14481
|
-
const U =
|
|
14481
|
+
const U = D.getTag(i, 4);
|
|
14482
14482
|
if (U === "\0\0\0")
|
|
14483
14483
|
s.outlinesFormat = "truetype";
|
|
14484
14484
|
else if (U === "OTTO")
|
|
14485
14485
|
s.outlinesFormat = "cff";
|
|
14486
14486
|
else
|
|
14487
14487
|
throw new Error("Unsupported OpenType flavor " + c);
|
|
14488
|
-
a =
|
|
14488
|
+
a = D.getUShort(i, 12), o = xd(i, a);
|
|
14489
14489
|
} else if (c === "wOF2") {
|
|
14490
14490
|
const U = "https://github.com/opentypejs/opentype.js/issues/183#issuecomment-1147228025";
|
|
14491
14491
|
throw new Error("WOFF2 require an external decompressor library, see examples at: " + U);
|
|
@@ -14493,168 +14493,168 @@ function vd(t, e = {}) {
|
|
|
14493
14493
|
throw new Error("Unsupported OpenType signature " + c);
|
|
14494
14494
|
let l, u, f, h, p, y, m, b, v, w, C, T, E, R, P, W, j, N;
|
|
14495
14495
|
for (let U = 0; U < a; U += 1) {
|
|
14496
|
-
const
|
|
14496
|
+
const M = o[U];
|
|
14497
14497
|
let _;
|
|
14498
|
-
switch (
|
|
14498
|
+
switch (M.tag) {
|
|
14499
14499
|
case "avar":
|
|
14500
|
-
m =
|
|
14500
|
+
m = M;
|
|
14501
14501
|
break;
|
|
14502
14502
|
case "cmap":
|
|
14503
|
-
_ =
|
|
14503
|
+
_ = J(i, M), s.tables.cmap = Ia.parse(_.data, _.offset), s.encoding = new Ba(s.tables.cmap);
|
|
14504
14504
|
break;
|
|
14505
14505
|
case "cvt ":
|
|
14506
|
-
_ =
|
|
14506
|
+
_ = J(i, M), N = new D.Parser(_.data, _.offset), s.tables.cvt = N.parseShortList(M.length / 2);
|
|
14507
14507
|
break;
|
|
14508
14508
|
case "fvar":
|
|
14509
|
-
f =
|
|
14509
|
+
f = M;
|
|
14510
14510
|
break;
|
|
14511
14511
|
case "STAT":
|
|
14512
|
-
h =
|
|
14512
|
+
h = M;
|
|
14513
14513
|
break;
|
|
14514
14514
|
case "gvar":
|
|
14515
|
-
p =
|
|
14515
|
+
p = M;
|
|
14516
14516
|
break;
|
|
14517
14517
|
case "cvar":
|
|
14518
|
-
y =
|
|
14518
|
+
y = M;
|
|
14519
14519
|
break;
|
|
14520
14520
|
case "fpgm":
|
|
14521
|
-
_ =
|
|
14521
|
+
_ = J(i, M), N = new D.Parser(_.data, _.offset), s.tables.fpgm = N.parseByteList(M.length);
|
|
14522
14522
|
break;
|
|
14523
14523
|
case "head":
|
|
14524
|
-
_ =
|
|
14524
|
+
_ = J(i, M), s.tables.head = Va.parse(_.data, _.offset), s.unitsPerEm = s.tables.head.unitsPerEm, n = s.tables.head.indexToLocFormat;
|
|
14525
14525
|
break;
|
|
14526
14526
|
case "hhea":
|
|
14527
|
-
_ =
|
|
14527
|
+
_ = J(i, M), s.tables.hhea = qa.parse(_.data, _.offset), s.ascender = s.tables.hhea.ascender, s.descender = s.tables.hhea.descender, s.numberOfHMetrics = s.tables.hhea.numberOfHMetrics;
|
|
14528
14528
|
break;
|
|
14529
14529
|
case "HVAR":
|
|
14530
|
-
E =
|
|
14530
|
+
E = M;
|
|
14531
14531
|
break;
|
|
14532
14532
|
case "hmtx":
|
|
14533
|
-
T =
|
|
14533
|
+
T = M;
|
|
14534
14534
|
break;
|
|
14535
14535
|
case "ltag":
|
|
14536
|
-
_ =
|
|
14536
|
+
_ = J(i, M), r = $a.parse(_.data, _.offset);
|
|
14537
14537
|
break;
|
|
14538
14538
|
case "COLR":
|
|
14539
|
-
_ =
|
|
14539
|
+
_ = J(i, M), s.tables.colr = Ja.parse(_.data, _.offset);
|
|
14540
14540
|
break;
|
|
14541
14541
|
case "CPAL":
|
|
14542
|
-
_ =
|
|
14542
|
+
_ = J(i, M), s.tables.cpal = Ua.parse(_.data, _.offset);
|
|
14543
14543
|
break;
|
|
14544
14544
|
case "maxp":
|
|
14545
|
-
_ =
|
|
14545
|
+
_ = J(i, M), s.tables.maxp = Ya.parse(_.data, _.offset), s.numGlyphs = s.tables.maxp.numGlyphs;
|
|
14546
14546
|
break;
|
|
14547
14547
|
case "name":
|
|
14548
|
-
W =
|
|
14548
|
+
W = M;
|
|
14549
14549
|
break;
|
|
14550
14550
|
case "OS/2":
|
|
14551
|
-
_ =
|
|
14551
|
+
_ = J(i, M), s.tables.os2 = Ur.parse(_.data, _.offset);
|
|
14552
14552
|
break;
|
|
14553
14553
|
case "post":
|
|
14554
|
-
_ =
|
|
14554
|
+
_ = J(i, M), s.tables.post = Xa.parse(_.data, _.offset), s.glyphNames = new Yr(s.tables.post);
|
|
14555
14555
|
break;
|
|
14556
14556
|
case "prep":
|
|
14557
|
-
_ =
|
|
14557
|
+
_ = J(i, M), N = new D.Parser(_.data, _.offset), s.tables.prep = N.parseByteList(M.length);
|
|
14558
14558
|
break;
|
|
14559
14559
|
case "glyf":
|
|
14560
|
-
b =
|
|
14560
|
+
b = M;
|
|
14561
14561
|
break;
|
|
14562
14562
|
case "loca":
|
|
14563
|
-
P =
|
|
14563
|
+
P = M;
|
|
14564
14564
|
break;
|
|
14565
14565
|
case "CFF ":
|
|
14566
|
-
l =
|
|
14566
|
+
l = M;
|
|
14567
14567
|
break;
|
|
14568
14568
|
case "CFF2":
|
|
14569
|
-
u =
|
|
14569
|
+
u = M;
|
|
14570
14570
|
break;
|
|
14571
14571
|
case "kern":
|
|
14572
|
-
R =
|
|
14572
|
+
R = M;
|
|
14573
14573
|
break;
|
|
14574
14574
|
case "GDEF":
|
|
14575
|
-
v =
|
|
14575
|
+
v = M;
|
|
14576
14576
|
break;
|
|
14577
14577
|
case "GPOS":
|
|
14578
|
-
w =
|
|
14578
|
+
w = M;
|
|
14579
14579
|
break;
|
|
14580
14580
|
case "GSUB":
|
|
14581
|
-
C =
|
|
14581
|
+
C = M;
|
|
14582
14582
|
break;
|
|
14583
14583
|
case "meta":
|
|
14584
|
-
j =
|
|
14584
|
+
j = M;
|
|
14585
14585
|
break;
|
|
14586
14586
|
case "gasp":
|
|
14587
14587
|
try {
|
|
14588
|
-
_ =
|
|
14588
|
+
_ = J(i, M), s.tables.gasp = so.parse(_.data, _.offset);
|
|
14589
14589
|
} catch (re) {
|
|
14590
14590
|
console.warn("Failed to parse gasp table, skipping."), console.warn(re);
|
|
14591
14591
|
}
|
|
14592
14592
|
break;
|
|
14593
14593
|
case "SVG ":
|
|
14594
|
-
_ =
|
|
14594
|
+
_ = J(i, M), s.tables.svg = io.parse(_.data, _.offset);
|
|
14595
14595
|
break;
|
|
14596
14596
|
}
|
|
14597
14597
|
}
|
|
14598
|
-
const
|
|
14599
|
-
if (s.tables.name = La.parse(
|
|
14600
|
-
const U = n === 0,
|
|
14598
|
+
const X = J(i, W);
|
|
14599
|
+
if (s.tables.name = La.parse(X.data, X.offset, r), s.names = s.tables.name, b && P) {
|
|
14600
|
+
const U = n === 0, M = J(i, P), _ = bd.parse(M.data, M.offset, s.numGlyphs, U), re = J(i, b);
|
|
14601
14601
|
s.glyphs = fo.parse(re.data, re.offset, _, s, e);
|
|
14602
14602
|
} else if (l) {
|
|
14603
|
-
const U =
|
|
14604
|
-
|
|
14603
|
+
const U = J(i, l);
|
|
14604
|
+
Dr.parse(U.data, U.offset, s, e);
|
|
14605
14605
|
} else if (u) {
|
|
14606
|
-
const U =
|
|
14607
|
-
|
|
14606
|
+
const U = J(i, u);
|
|
14607
|
+
Dr.parse(U.data, U.offset, s, e);
|
|
14608
14608
|
} else
|
|
14609
14609
|
throw new Error("Font doesn't contain TrueType, CFF or CFF2 outlines.");
|
|
14610
|
-
const ie =
|
|
14610
|
+
const ie = J(i, T);
|
|
14611
14611
|
if (ja.parse(s, ie.data, ie.offset, s.numberOfHMetrics, s.numGlyphs, s.glyphs, e), dl(s, e), R) {
|
|
14612
|
-
const U =
|
|
14612
|
+
const U = J(i, R);
|
|
14613
14613
|
s.kerningPairs = md.parse(U.data, U.offset);
|
|
14614
14614
|
} else
|
|
14615
14615
|
s.kerningPairs = {};
|
|
14616
14616
|
if (v) {
|
|
14617
|
-
const U =
|
|
14617
|
+
const U = J(i, v);
|
|
14618
14618
|
s.tables.gdef = cd.parse(U.data, U.offset);
|
|
14619
14619
|
}
|
|
14620
14620
|
if (w) {
|
|
14621
|
-
const U =
|
|
14621
|
+
const U = J(i, w);
|
|
14622
14622
|
s.tables.gpos = fd.parse(U.data, U.offset), s.position.init();
|
|
14623
14623
|
}
|
|
14624
14624
|
if (C) {
|
|
14625
|
-
const U =
|
|
14625
|
+
const U = J(i, C);
|
|
14626
14626
|
s.tables.gsub = Ka.parse(U.data, U.offset);
|
|
14627
14627
|
}
|
|
14628
14628
|
if (f) {
|
|
14629
|
-
const U =
|
|
14629
|
+
const U = J(i, f);
|
|
14630
14630
|
s.tables.fvar = Qa.parse(U.data, U.offset, s.names);
|
|
14631
14631
|
}
|
|
14632
14632
|
if (h) {
|
|
14633
|
-
const U =
|
|
14633
|
+
const U = J(i, h);
|
|
14634
14634
|
s.tables.stat = eo.parse(U.data, U.offset, s.tables.fvar);
|
|
14635
14635
|
}
|
|
14636
14636
|
if (p) {
|
|
14637
14637
|
f || console.warn("This font provides a gvar table, but no fvar table, which is required for variable fonts."), b || console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");
|
|
14638
|
-
const U =
|
|
14638
|
+
const U = J(i, p);
|
|
14639
14639
|
s.tables.gvar = ro.parse(U.data, U.offset, s.tables.fvar, s.glyphs);
|
|
14640
14640
|
}
|
|
14641
14641
|
if (y) {
|
|
14642
14642
|
f || console.warn("This font provides a cvar table, but no fvar table, which is required for variable fonts."), s.tables.cvt || console.warn("This font provides a cvar table, but no cvt table which could be made variable."), b || console.warn("This font provides a gvar table, but no glyf table. Glyph variation only works with TrueType outlines.");
|
|
14643
|
-
const U =
|
|
14643
|
+
const U = J(i, y);
|
|
14644
14644
|
s.tables.cvar = no.parse(U.data, U.offset, s.tables.fvar, s.tables.cvt || []);
|
|
14645
14645
|
}
|
|
14646
14646
|
if (m) {
|
|
14647
14647
|
f || console.warn("This font provides an avar table, but no fvar table, which is required for variable fonts.");
|
|
14648
|
-
const U =
|
|
14648
|
+
const U = J(i, m);
|
|
14649
14649
|
s.tables.avar = to.parse(U.data, U.offset, s.tables.fvar);
|
|
14650
14650
|
}
|
|
14651
14651
|
if (E) {
|
|
14652
14652
|
f || console.warn("This font provides an HVAR table, but no fvar table, which is required for variable fonts."), T || console.warn("This font provides an HVAR table, but no hmtx table to vary.");
|
|
14653
|
-
const U =
|
|
14653
|
+
const U = J(i, E);
|
|
14654
14654
|
s.tables.hvar = td.parse(U.data, U.offset, s.tables.fvar);
|
|
14655
14655
|
}
|
|
14656
14656
|
if (j) {
|
|
14657
|
-
const U =
|
|
14657
|
+
const U = J(i, j);
|
|
14658
14658
|
s.tables.meta = Za.parse(U.data, U.offset), s.metas = s.tables.meta;
|
|
14659
14659
|
}
|
|
14660
14660
|
return s.palettes = new lo(s), s;
|
|
@@ -14787,12 +14787,12 @@ function wd(t, e = 1e-4) {
|
|
|
14787
14787
|
u.push(n[T]);
|
|
14788
14788
|
else {
|
|
14789
14789
|
for (let E = 0, R = o.length; E < R; E++) {
|
|
14790
|
-
const P = o[E], W = t.getAttribute(P), j = t.morphAttributes[P], N = W.itemSize,
|
|
14790
|
+
const P = o[E], W = t.getAttribute(P), j = t.morphAttributes[P], N = W.itemSize, X = c[P], ie = l[P];
|
|
14791
14791
|
for (let U = 0; U < N; U++) {
|
|
14792
|
-
const
|
|
14793
|
-
if (
|
|
14792
|
+
const M = f[U], _ = h[U];
|
|
14793
|
+
if (X[_](a, W[M](C)), j)
|
|
14794
14794
|
for (let re = 0, Te = j.length; re < Te; re++)
|
|
14795
|
-
ie[re][_](a, j[re][
|
|
14795
|
+
ie[re][_](a, j[re][M](C));
|
|
14796
14796
|
}
|
|
14797
14797
|
}
|
|
14798
14798
|
n[T] = a, u.push(a), a++;
|
|
@@ -14871,13 +14871,13 @@ class Td {
|
|
|
14871
14871
|
this.isFont = !0, this.type = "Font", this.data = e;
|
|
14872
14872
|
}
|
|
14873
14873
|
generateShapes(e, n = 100) {
|
|
14874
|
-
const r = [], s =
|
|
14874
|
+
const r = [], s = Fd(e, n, this.data);
|
|
14875
14875
|
for (let i = 0, a = s.length; i < a; i++)
|
|
14876
14876
|
r.push(...s[i].toShapes());
|
|
14877
14877
|
return r;
|
|
14878
14878
|
}
|
|
14879
14879
|
}
|
|
14880
|
-
function
|
|
14880
|
+
function Fd(t, e, n) {
|
|
14881
14881
|
const r = Array.from(t), s = e / n.resolution, i = (n.boundingBox.yMax - n.boundingBox.yMin + n.underlineThickness) * s, a = [];
|
|
14882
14882
|
let o = 0, c = 0;
|
|
14883
14883
|
for (let l = 0; l < r.length; l++) {
|
|
@@ -14886,13 +14886,13 @@ function kd(t, e, n) {
|
|
|
14886
14886
|
`)
|
|
14887
14887
|
o = 0, c -= i;
|
|
14888
14888
|
else {
|
|
14889
|
-
const f =
|
|
14889
|
+
const f = kd(u, s, o, c, n);
|
|
14890
14890
|
o += f.offsetX, a.push(f.path);
|
|
14891
14891
|
}
|
|
14892
14892
|
}
|
|
14893
14893
|
return a;
|
|
14894
14894
|
}
|
|
14895
|
-
function
|
|
14895
|
+
function kd(t, e, n, r, s) {
|
|
14896
14896
|
const i = s.glyphs[t] || s.glyphs["?"];
|
|
14897
14897
|
if (!i) {
|
|
14898
14898
|
console.error('THREE.Font: character "' + t + '" does not exists in font family ' + s.familyName + ".");
|
|
@@ -14963,7 +14963,7 @@ class Ed extends Td {
|
|
|
14963
14963
|
generateShapes(e, n = 100, r = "ltr") {
|
|
14964
14964
|
const s = [];
|
|
14965
14965
|
return Ad(e, n, this.data, r).forEach((a) => {
|
|
14966
|
-
s.push(...
|
|
14966
|
+
s.push(...Dd(a));
|
|
14967
14967
|
}), s;
|
|
14968
14968
|
}
|
|
14969
14969
|
}
|
|
@@ -15048,7 +15048,7 @@ function Rd(t) {
|
|
|
15048
15048
|
function Bd(t) {
|
|
15049
15049
|
return t.map((e, n) => e === null ? n : -1).filter((e) => e >= 0);
|
|
15050
15050
|
}
|
|
15051
|
-
function
|
|
15051
|
+
function Md(t) {
|
|
15052
15052
|
const e = [];
|
|
15053
15053
|
for (let n = t.length - 1; n >= 0; n--) {
|
|
15054
15054
|
const r = t[n];
|
|
@@ -15089,10 +15089,10 @@ function Dd(t) {
|
|
|
15089
15089
|
return e;
|
|
15090
15090
|
}
|
|
15091
15091
|
function vi(t, e) {
|
|
15092
|
-
const n = Qi.area(t.getPoints(32)) > 0, r = e === n ? t.curves.slice() :
|
|
15092
|
+
const n = Qi.area(t.getPoints(32)) > 0, r = e === n ? t.curves.slice() : Md(t.curves), s = new Lo();
|
|
15093
15093
|
return s.curves.push(...r), s;
|
|
15094
15094
|
}
|
|
15095
|
-
function
|
|
15095
|
+
function Dd(t, e = 32) {
|
|
15096
15096
|
const n = t.subPaths;
|
|
15097
15097
|
if (!n || n.length === 0) return [];
|
|
15098
15098
|
const r = n.map((p) => p.getPoints(e)), s = Id(r), i = Rd(s), a = Bd(s), o = n.length, c = Array(o).fill(-1), l = Array(o).fill(-1);
|
|
@@ -15300,7 +15300,7 @@ class Ud extends sa {
|
|
|
15300
15300
|
let n = 0;
|
|
15301
15301
|
const r = Object.keys(this.data.glyphs);
|
|
15302
15302
|
for (const o of r)
|
|
15303
|
-
n +=
|
|
15303
|
+
n += Mo((a = this.data.glyphs[o]) == null ? void 0 : a.o);
|
|
15304
15304
|
const s = Math.round(
|
|
15305
15305
|
this.sourceByteLength * wc
|
|
15306
15306
|
), i = s + n + e.estimatedBytes;
|
|
@@ -15490,8 +15490,8 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15490
15490
|
var S = x.valueOf && x.valueOf();
|
|
15491
15491
|
if (S != null && S !== x)
|
|
15492
15492
|
return o.from(S, d, g);
|
|
15493
|
-
var
|
|
15494
|
-
if (
|
|
15493
|
+
var k = b(x);
|
|
15494
|
+
if (k) return k;
|
|
15495
15495
|
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof x[Symbol.toPrimitive] == "function")
|
|
15496
15496
|
return o.from(
|
|
15497
15497
|
x[Symbol.toPrimitive]("string"),
|
|
@@ -15528,8 +15528,8 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15528
15528
|
function h(x, d) {
|
|
15529
15529
|
if ((typeof d != "string" || d === "") && (d = "utf8"), !o.isEncoding(d))
|
|
15530
15530
|
throw new TypeError("Unknown encoding: " + d);
|
|
15531
|
-
var g = C(x, d) | 0, S = a(g),
|
|
15532
|
-
return
|
|
15531
|
+
var g = C(x, d) | 0, S = a(g), k = S.write(x, d);
|
|
15532
|
+
return k !== g && (S = S.slice(0, k)), S;
|
|
15533
15533
|
}
|
|
15534
15534
|
function p(x) {
|
|
15535
15535
|
for (var d = x.length < 0 ? 0 : v(x.length) | 0, g = a(d), S = 0; S < d; S += 1)
|
|
@@ -15577,12 +15577,12 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15577
15577
|
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
15578
15578
|
);
|
|
15579
15579
|
if (d === g) return 0;
|
|
15580
|
-
for (var S = d.length,
|
|
15580
|
+
for (var S = d.length, k = g.length, A = 0, L = Math.min(S, k); A < L; ++A)
|
|
15581
15581
|
if (d[A] !== g[A]) {
|
|
15582
|
-
S = d[A],
|
|
15582
|
+
S = d[A], k = g[A];
|
|
15583
15583
|
break;
|
|
15584
15584
|
}
|
|
15585
|
-
return S <
|
|
15585
|
+
return S < k ? -1 : k < S ? 1 : 0;
|
|
15586
15586
|
}, o.isEncoding = function(d) {
|
|
15587
15587
|
switch (String(d).toLowerCase()) {
|
|
15588
15588
|
case "hex":
|
|
@@ -15609,22 +15609,22 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15609
15609
|
if (g === void 0)
|
|
15610
15610
|
for (g = 0, S = 0; S < d.length; ++S)
|
|
15611
15611
|
g += d[S].length;
|
|
15612
|
-
var
|
|
15612
|
+
var k = o.allocUnsafe(g), A = 0;
|
|
15613
15613
|
for (S = 0; S < d.length; ++S) {
|
|
15614
15614
|
var L = d[S];
|
|
15615
15615
|
if (Re(L, Uint8Array))
|
|
15616
|
-
A + L.length >
|
|
15617
|
-
|
|
15616
|
+
A + L.length > k.length ? o.from(L).copy(k, A) : Uint8Array.prototype.set.call(
|
|
15617
|
+
k,
|
|
15618
15618
|
L,
|
|
15619
15619
|
A
|
|
15620
15620
|
);
|
|
15621
15621
|
else if (o.isBuffer(L))
|
|
15622
|
-
L.copy(
|
|
15622
|
+
L.copy(k, A);
|
|
15623
15623
|
else
|
|
15624
15624
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
15625
15625
|
A += L.length;
|
|
15626
15626
|
}
|
|
15627
|
-
return
|
|
15627
|
+
return k;
|
|
15628
15628
|
};
|
|
15629
15629
|
function C(x, d) {
|
|
15630
15630
|
if (o.isBuffer(x))
|
|
@@ -15637,7 +15637,7 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15637
15637
|
);
|
|
15638
15638
|
var g = x.length, S = arguments.length > 2 && arguments[2] === !0;
|
|
15639
15639
|
if (!S && g === 0) return 0;
|
|
15640
|
-
for (var
|
|
15640
|
+
for (var k = !1; ; )
|
|
15641
15641
|
switch (d) {
|
|
15642
15642
|
case "ascii":
|
|
15643
15643
|
case "latin1":
|
|
@@ -15645,7 +15645,7 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15645
15645
|
return g;
|
|
15646
15646
|
case "utf8":
|
|
15647
15647
|
case "utf-8":
|
|
15648
|
-
return
|
|
15648
|
+
return Z(x).length;
|
|
15649
15649
|
case "ucs2":
|
|
15650
15650
|
case "ucs-2":
|
|
15651
15651
|
case "utf16le":
|
|
@@ -15656,9 +15656,9 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15656
15656
|
case "base64":
|
|
15657
15657
|
return Ae(x).length;
|
|
15658
15658
|
default:
|
|
15659
|
-
if (
|
|
15660
|
-
return S ? -1 :
|
|
15661
|
-
d = ("" + d).toLowerCase(),
|
|
15659
|
+
if (k)
|
|
15660
|
+
return S ? -1 : Z(x).length;
|
|
15661
|
+
d = ("" + d).toLowerCase(), k = !0;
|
|
15662
15662
|
}
|
|
15663
15663
|
}
|
|
15664
15664
|
o.byteLength = C;
|
|
@@ -15672,7 +15672,7 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15672
15672
|
return _e(this, d, g);
|
|
15673
15673
|
case "utf8":
|
|
15674
15674
|
case "utf-8":
|
|
15675
|
-
return
|
|
15675
|
+
return M(this, d, g);
|
|
15676
15676
|
case "ascii":
|
|
15677
15677
|
return Te(this, d, g);
|
|
15678
15678
|
case "latin1":
|
|
@@ -15718,49 +15718,49 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15718
15718
|
return this;
|
|
15719
15719
|
}, o.prototype.toString = function() {
|
|
15720
15720
|
var d = this.length;
|
|
15721
|
-
return d === 0 ? "" : arguments.length === 0 ?
|
|
15721
|
+
return d === 0 ? "" : arguments.length === 0 ? M(this, 0, d) : T.apply(this, arguments);
|
|
15722
15722
|
}, o.prototype.toLocaleString = o.prototype.toString, o.prototype.equals = function(d) {
|
|
15723
15723
|
if (!o.isBuffer(d)) throw new TypeError("Argument must be a Buffer");
|
|
15724
15724
|
return this === d ? !0 : o.compare(this, d) === 0;
|
|
15725
15725
|
}, o.prototype.inspect = function() {
|
|
15726
15726
|
var d = "", g = t.INSPECT_MAX_BYTES;
|
|
15727
15727
|
return d = this.toString("hex", 0, g).replace(/(.{2})/g, "$1 ").trim(), this.length > g && (d += " ... "), "<Buffer " + d + ">";
|
|
15728
|
-
}, r && (o.prototype[r] = o.prototype.inspect), o.prototype.compare = function(d, g, S,
|
|
15728
|
+
}, r && (o.prototype[r] = o.prototype.inspect), o.prototype.compare = function(d, g, S, k, A) {
|
|
15729
15729
|
if (Re(d, Uint8Array) && (d = o.from(d, d.offset, d.byteLength)), !o.isBuffer(d))
|
|
15730
15730
|
throw new TypeError(
|
|
15731
15731
|
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof d
|
|
15732
15732
|
);
|
|
15733
|
-
if (g === void 0 && (g = 0), S === void 0 && (S = d ? d.length : 0),
|
|
15733
|
+
if (g === void 0 && (g = 0), S === void 0 && (S = d ? d.length : 0), k === void 0 && (k = 0), A === void 0 && (A = this.length), g < 0 || S > d.length || k < 0 || A > this.length)
|
|
15734
15734
|
throw new RangeError("out of range index");
|
|
15735
|
-
if (
|
|
15735
|
+
if (k >= A && g >= S)
|
|
15736
15736
|
return 0;
|
|
15737
|
-
if (
|
|
15737
|
+
if (k >= A)
|
|
15738
15738
|
return -1;
|
|
15739
15739
|
if (g >= S)
|
|
15740
15740
|
return 1;
|
|
15741
|
-
if (g >>>= 0, S >>>= 0,
|
|
15742
|
-
for (var L = A -
|
|
15741
|
+
if (g >>>= 0, S >>>= 0, k >>>= 0, A >>>= 0, this === d) return 0;
|
|
15742
|
+
for (var L = A - k, q = S - g, V = Math.min(L, q), ae = this.slice(k, A), Se = d.slice(g, S), le = 0; le < V; ++le)
|
|
15743
15743
|
if (ae[le] !== Se[le]) {
|
|
15744
15744
|
L = ae[le], q = Se[le];
|
|
15745
15745
|
break;
|
|
15746
15746
|
}
|
|
15747
15747
|
return L < q ? -1 : q < L ? 1 : 0;
|
|
15748
15748
|
};
|
|
15749
|
-
function R(x, d, g, S,
|
|
15749
|
+
function R(x, d, g, S, k) {
|
|
15750
15750
|
if (x.length === 0) return -1;
|
|
15751
|
-
if (typeof g == "string" ? (S = g, g = 0) : g > 2147483647 ? g = 2147483647 : g < -2147483648 && (g = -2147483648), g = +g, ve(g) && (g =
|
|
15752
|
-
if (
|
|
15751
|
+
if (typeof g == "string" ? (S = g, g = 0) : g > 2147483647 ? g = 2147483647 : g < -2147483648 && (g = -2147483648), g = +g, ve(g) && (g = k ? 0 : x.length - 1), g < 0 && (g = x.length + g), g >= x.length) {
|
|
15752
|
+
if (k) return -1;
|
|
15753
15753
|
g = x.length - 1;
|
|
15754
15754
|
} else if (g < 0)
|
|
15755
|
-
if (
|
|
15755
|
+
if (k) g = 0;
|
|
15756
15756
|
else return -1;
|
|
15757
15757
|
if (typeof d == "string" && (d = o.from(d, S)), o.isBuffer(d))
|
|
15758
|
-
return d.length === 0 ? -1 : P(x, d, g, S,
|
|
15758
|
+
return d.length === 0 ? -1 : P(x, d, g, S, k);
|
|
15759
15759
|
if (typeof d == "number")
|
|
15760
|
-
return d = d & 255, typeof Uint8Array.prototype.indexOf == "function" ?
|
|
15760
|
+
return d = d & 255, typeof Uint8Array.prototype.indexOf == "function" ? k ? Uint8Array.prototype.indexOf.call(x, d, g) : Uint8Array.prototype.lastIndexOf.call(x, d, g) : P(x, [d], g, S, k);
|
|
15761
15761
|
throw new TypeError("val must be string, number or Buffer");
|
|
15762
15762
|
}
|
|
15763
|
-
function P(x, d, g, S,
|
|
15763
|
+
function P(x, d, g, S, k) {
|
|
15764
15764
|
var A = 1, L = x.length, q = d.length;
|
|
15765
15765
|
if (S !== void 0 && (S = String(S).toLowerCase(), S === "ucs2" || S === "ucs-2" || S === "utf16le" || S === "utf-16le")) {
|
|
15766
15766
|
if (x.length < 2 || d.length < 2)
|
|
@@ -15771,7 +15771,7 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15771
15771
|
return A === 1 ? us[hs] : us.readUInt16BE(hs * A);
|
|
15772
15772
|
}
|
|
15773
15773
|
var ae;
|
|
15774
|
-
if (
|
|
15774
|
+
if (k) {
|
|
15775
15775
|
var Se = -1;
|
|
15776
15776
|
for (ae = g; ae < L; ae++)
|
|
15777
15777
|
if (V(x, ae) === V(d, Se === -1 ? 0 : ae - Se)) {
|
|
@@ -15798,8 +15798,8 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15798
15798
|
};
|
|
15799
15799
|
function W(x, d, g, S) {
|
|
15800
15800
|
g = Number(g) || 0;
|
|
15801
|
-
var
|
|
15802
|
-
S ? (S = Number(S), S >
|
|
15801
|
+
var k = x.length - g;
|
|
15802
|
+
S ? (S = Number(S), S > k && (S = k)) : S = k;
|
|
15803
15803
|
var A = d.length;
|
|
15804
15804
|
S > A / 2 && (S = A / 2);
|
|
15805
15805
|
for (var L = 0; L < S; ++L) {
|
|
@@ -15810,24 +15810,24 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15810
15810
|
return L;
|
|
15811
15811
|
}
|
|
15812
15812
|
function j(x, d, g, S) {
|
|
15813
|
-
return Oe(
|
|
15813
|
+
return Oe(Z(d, x.length - g), x, g, S);
|
|
15814
15814
|
}
|
|
15815
15815
|
function N(x, d, g, S) {
|
|
15816
15816
|
return Oe(xe(d), x, g, S);
|
|
15817
15817
|
}
|
|
15818
|
-
function
|
|
15818
|
+
function X(x, d, g, S) {
|
|
15819
15819
|
return Oe(Ae(d), x, g, S);
|
|
15820
15820
|
}
|
|
15821
15821
|
function ie(x, d, g, S) {
|
|
15822
15822
|
return Oe(Ee(d, x.length - g), x, g, S);
|
|
15823
15823
|
}
|
|
15824
|
-
o.prototype.write = function(d, g, S,
|
|
15824
|
+
o.prototype.write = function(d, g, S, k) {
|
|
15825
15825
|
if (g === void 0)
|
|
15826
|
-
|
|
15826
|
+
k = "utf8", S = this.length, g = 0;
|
|
15827
15827
|
else if (S === void 0 && typeof g == "string")
|
|
15828
|
-
|
|
15828
|
+
k = g, S = this.length, g = 0;
|
|
15829
15829
|
else if (isFinite(g))
|
|
15830
|
-
g = g >>> 0, isFinite(S) ? (S = S >>> 0,
|
|
15830
|
+
g = g >>> 0, isFinite(S) ? (S = S >>> 0, k === void 0 && (k = "utf8")) : (k = S, S = void 0);
|
|
15831
15831
|
else
|
|
15832
15832
|
throw new Error(
|
|
15833
15833
|
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
@@ -15835,9 +15835,9 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15835
15835
|
var A = this.length - g;
|
|
15836
15836
|
if ((S === void 0 || S > A) && (S = A), d.length > 0 && (S < 0 || g < 0) || g > this.length)
|
|
15837
15837
|
throw new RangeError("Attempt to write outside buffer bounds");
|
|
15838
|
-
|
|
15838
|
+
k || (k = "utf8");
|
|
15839
15839
|
for (var L = !1; ; )
|
|
15840
|
-
switch (
|
|
15840
|
+
switch (k) {
|
|
15841
15841
|
case "hex":
|
|
15842
15842
|
return W(this, d, g, S);
|
|
15843
15843
|
case "utf8":
|
|
@@ -15848,15 +15848,15 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15848
15848
|
case "binary":
|
|
15849
15849
|
return N(this, d, g, S);
|
|
15850
15850
|
case "base64":
|
|
15851
|
-
return
|
|
15851
|
+
return X(this, d, g, S);
|
|
15852
15852
|
case "ucs2":
|
|
15853
15853
|
case "ucs-2":
|
|
15854
15854
|
case "utf16le":
|
|
15855
15855
|
case "utf-16le":
|
|
15856
15856
|
return ie(this, d, g, S);
|
|
15857
15857
|
default:
|
|
15858
|
-
if (L) throw new TypeError("Unknown encoding: " +
|
|
15859
|
-
|
|
15858
|
+
if (L) throw new TypeError("Unknown encoding: " + k);
|
|
15859
|
+
k = ("" + k).toLowerCase(), L = !0;
|
|
15860
15860
|
}
|
|
15861
15861
|
}, o.prototype.toJSON = function() {
|
|
15862
15862
|
return {
|
|
@@ -15867,27 +15867,27 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15867
15867
|
function U(x, d, g) {
|
|
15868
15868
|
return d === 0 && g === x.length ? e.fromByteArray(x) : e.fromByteArray(x.slice(d, g));
|
|
15869
15869
|
}
|
|
15870
|
-
function
|
|
15870
|
+
function M(x, d, g) {
|
|
15871
15871
|
g = Math.min(x.length, g);
|
|
15872
|
-
for (var S = [],
|
|
15873
|
-
var A = x[
|
|
15874
|
-
if (
|
|
15872
|
+
for (var S = [], k = d; k < g; ) {
|
|
15873
|
+
var A = x[k], L = null, q = A > 239 ? 4 : A > 223 ? 3 : A > 191 ? 2 : 1;
|
|
15874
|
+
if (k + q <= g) {
|
|
15875
15875
|
var V, ae, Se, le;
|
|
15876
15876
|
switch (q) {
|
|
15877
15877
|
case 1:
|
|
15878
15878
|
A < 128 && (L = A);
|
|
15879
15879
|
break;
|
|
15880
15880
|
case 2:
|
|
15881
|
-
V = x[
|
|
15881
|
+
V = x[k + 1], (V & 192) === 128 && (le = (A & 31) << 6 | V & 63, le > 127 && (L = le));
|
|
15882
15882
|
break;
|
|
15883
15883
|
case 3:
|
|
15884
|
-
V = x[
|
|
15884
|
+
V = x[k + 1], ae = x[k + 2], (V & 192) === 128 && (ae & 192) === 128 && (le = (A & 15) << 12 | (V & 63) << 6 | ae & 63, le > 2047 && (le < 55296 || le > 57343) && (L = le));
|
|
15885
15885
|
break;
|
|
15886
15886
|
case 4:
|
|
15887
|
-
V = x[
|
|
15887
|
+
V = x[k + 1], ae = x[k + 2], Se = x[k + 3], (V & 192) === 128 && (ae & 192) === 128 && (Se & 192) === 128 && (le = (A & 15) << 18 | (V & 63) << 12 | (ae & 63) << 6 | Se & 63, le > 65535 && le < 1114112 && (L = le));
|
|
15888
15888
|
}
|
|
15889
15889
|
}
|
|
15890
|
-
L === null ? (L = 65533, q = 1) : L > 65535 && (L -= 65536, S.push(L >>> 10 & 1023 | 55296), L = 56320 | L & 1023), S.push(L),
|
|
15890
|
+
L === null ? (L = 65533, q = 1) : L > 65535 && (L -= 65536, S.push(L >>> 10 & 1023 | 55296), L = 56320 | L & 1023), S.push(L), k += q;
|
|
15891
15891
|
}
|
|
15892
15892
|
return re(S);
|
|
15893
15893
|
}
|
|
@@ -15906,99 +15906,99 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
15906
15906
|
function Te(x, d, g) {
|
|
15907
15907
|
var S = "";
|
|
15908
15908
|
g = Math.min(x.length, g);
|
|
15909
|
-
for (var
|
|
15910
|
-
S += String.fromCharCode(x[
|
|
15909
|
+
for (var k = d; k < g; ++k)
|
|
15910
|
+
S += String.fromCharCode(x[k] & 127);
|
|
15911
15911
|
return S;
|
|
15912
15912
|
}
|
|
15913
15913
|
function Qe(x, d, g) {
|
|
15914
15914
|
var S = "";
|
|
15915
15915
|
g = Math.min(x.length, g);
|
|
15916
|
-
for (var
|
|
15917
|
-
S += String.fromCharCode(x[
|
|
15916
|
+
for (var k = d; k < g; ++k)
|
|
15917
|
+
S += String.fromCharCode(x[k]);
|
|
15918
15918
|
return S;
|
|
15919
15919
|
}
|
|
15920
15920
|
function _e(x, d, g) {
|
|
15921
15921
|
var S = x.length;
|
|
15922
15922
|
(!d || d < 0) && (d = 0), (!g || g < 0 || g > S) && (g = S);
|
|
15923
|
-
for (var
|
|
15924
|
-
|
|
15925
|
-
return
|
|
15923
|
+
for (var k = "", A = d; A < g; ++A)
|
|
15924
|
+
k += et[x[A]];
|
|
15925
|
+
return k;
|
|
15926
15926
|
}
|
|
15927
15927
|
function me(x, d, g) {
|
|
15928
|
-
for (var S = x.slice(d, g),
|
|
15929
|
-
|
|
15930
|
-
return
|
|
15928
|
+
for (var S = x.slice(d, g), k = "", A = 0; A < S.length - 1; A += 2)
|
|
15929
|
+
k += String.fromCharCode(S[A] + S[A + 1] * 256);
|
|
15930
|
+
return k;
|
|
15931
15931
|
}
|
|
15932
15932
|
o.prototype.slice = function(d, g) {
|
|
15933
15933
|
var S = this.length;
|
|
15934
15934
|
d = ~~d, g = g === void 0 ? S : ~~g, d < 0 ? (d += S, d < 0 && (d = 0)) : d > S && (d = S), g < 0 ? (g += S, g < 0 && (g = 0)) : g > S && (g = S), g < d && (g = d);
|
|
15935
|
-
var
|
|
15936
|
-
return Object.setPrototypeOf(
|
|
15935
|
+
var k = this.subarray(d, g);
|
|
15936
|
+
return Object.setPrototypeOf(k, o.prototype), k;
|
|
15937
15937
|
};
|
|
15938
|
-
function
|
|
15938
|
+
function Y(x, d, g) {
|
|
15939
15939
|
if (x % 1 !== 0 || x < 0) throw new RangeError("offset is not uint");
|
|
15940
15940
|
if (x + d > g) throw new RangeError("Trying to access beyond buffer length");
|
|
15941
15941
|
}
|
|
15942
15942
|
o.prototype.readUintLE = o.prototype.readUIntLE = function(d, g, S) {
|
|
15943
|
-
d = d >>> 0, g = g >>> 0, S ||
|
|
15944
|
-
for (var
|
|
15945
|
-
|
|
15946
|
-
return
|
|
15943
|
+
d = d >>> 0, g = g >>> 0, S || Y(d, g, this.length);
|
|
15944
|
+
for (var k = this[d], A = 1, L = 0; ++L < g && (A *= 256); )
|
|
15945
|
+
k += this[d + L] * A;
|
|
15946
|
+
return k;
|
|
15947
15947
|
}, o.prototype.readUintBE = o.prototype.readUIntBE = function(d, g, S) {
|
|
15948
|
-
d = d >>> 0, g = g >>> 0, S ||
|
|
15949
|
-
for (var
|
|
15950
|
-
|
|
15951
|
-
return
|
|
15948
|
+
d = d >>> 0, g = g >>> 0, S || Y(d, g, this.length);
|
|
15949
|
+
for (var k = this[d + --g], A = 1; g > 0 && (A *= 256); )
|
|
15950
|
+
k += this[d + --g] * A;
|
|
15951
|
+
return k;
|
|
15952
15952
|
}, o.prototype.readUint8 = o.prototype.readUInt8 = function(d, g) {
|
|
15953
|
-
return d = d >>> 0, g ||
|
|
15953
|
+
return d = d >>> 0, g || Y(d, 1, this.length), this[d];
|
|
15954
15954
|
}, o.prototype.readUint16LE = o.prototype.readUInt16LE = function(d, g) {
|
|
15955
|
-
return d = d >>> 0, g ||
|
|
15955
|
+
return d = d >>> 0, g || Y(d, 2, this.length), this[d] | this[d + 1] << 8;
|
|
15956
15956
|
}, o.prototype.readUint16BE = o.prototype.readUInt16BE = function(d, g) {
|
|
15957
|
-
return d = d >>> 0, g ||
|
|
15957
|
+
return d = d >>> 0, g || Y(d, 2, this.length), this[d] << 8 | this[d + 1];
|
|
15958
15958
|
}, o.prototype.readUint32LE = o.prototype.readUInt32LE = function(d, g) {
|
|
15959
|
-
return d = d >>> 0, g ||
|
|
15959
|
+
return d = d >>> 0, g || Y(d, 4, this.length), (this[d] | this[d + 1] << 8 | this[d + 2] << 16) + this[d + 3] * 16777216;
|
|
15960
15960
|
}, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(d, g) {
|
|
15961
|
-
return d = d >>> 0, g ||
|
|
15961
|
+
return d = d >>> 0, g || Y(d, 4, this.length), this[d] * 16777216 + (this[d + 1] << 16 | this[d + 2] << 8 | this[d + 3]);
|
|
15962
15962
|
}, o.prototype.readIntLE = function(d, g, S) {
|
|
15963
|
-
d = d >>> 0, g = g >>> 0, S ||
|
|
15964
|
-
for (var
|
|
15965
|
-
|
|
15966
|
-
return A *= 128,
|
|
15963
|
+
d = d >>> 0, g = g >>> 0, S || Y(d, g, this.length);
|
|
15964
|
+
for (var k = this[d], A = 1, L = 0; ++L < g && (A *= 256); )
|
|
15965
|
+
k += this[d + L] * A;
|
|
15966
|
+
return A *= 128, k >= A && (k -= Math.pow(2, 8 * g)), k;
|
|
15967
15967
|
}, o.prototype.readIntBE = function(d, g, S) {
|
|
15968
|
-
d = d >>> 0, g = g >>> 0, S ||
|
|
15969
|
-
for (var
|
|
15970
|
-
L += this[d + --
|
|
15968
|
+
d = d >>> 0, g = g >>> 0, S || Y(d, g, this.length);
|
|
15969
|
+
for (var k = g, A = 1, L = this[d + --k]; k > 0 && (A *= 256); )
|
|
15970
|
+
L += this[d + --k] * A;
|
|
15971
15971
|
return A *= 128, L >= A && (L -= Math.pow(2, 8 * g)), L;
|
|
15972
15972
|
}, o.prototype.readInt8 = function(d, g) {
|
|
15973
|
-
return d = d >>> 0, g ||
|
|
15973
|
+
return d = d >>> 0, g || Y(d, 1, this.length), this[d] & 128 ? (255 - this[d] + 1) * -1 : this[d];
|
|
15974
15974
|
}, o.prototype.readInt16LE = function(d, g) {
|
|
15975
|
-
d = d >>> 0, g ||
|
|
15975
|
+
d = d >>> 0, g || Y(d, 2, this.length);
|
|
15976
15976
|
var S = this[d] | this[d + 1] << 8;
|
|
15977
15977
|
return S & 32768 ? S | 4294901760 : S;
|
|
15978
15978
|
}, o.prototype.readInt16BE = function(d, g) {
|
|
15979
|
-
d = d >>> 0, g ||
|
|
15979
|
+
d = d >>> 0, g || Y(d, 2, this.length);
|
|
15980
15980
|
var S = this[d + 1] | this[d] << 8;
|
|
15981
15981
|
return S & 32768 ? S | 4294901760 : S;
|
|
15982
15982
|
}, o.prototype.readInt32LE = function(d, g) {
|
|
15983
|
-
return d = d >>> 0, g ||
|
|
15983
|
+
return d = d >>> 0, g || Y(d, 4, this.length), this[d] | this[d + 1] << 8 | this[d + 2] << 16 | this[d + 3] << 24;
|
|
15984
15984
|
}, o.prototype.readInt32BE = function(d, g) {
|
|
15985
|
-
return d = d >>> 0, g ||
|
|
15985
|
+
return d = d >>> 0, g || Y(d, 4, this.length), this[d] << 24 | this[d + 1] << 16 | this[d + 2] << 8 | this[d + 3];
|
|
15986
15986
|
}, o.prototype.readFloatLE = function(d, g) {
|
|
15987
|
-
return d = d >>> 0, g ||
|
|
15987
|
+
return d = d >>> 0, g || Y(d, 4, this.length), n.read(this, d, !0, 23, 4);
|
|
15988
15988
|
}, o.prototype.readFloatBE = function(d, g) {
|
|
15989
|
-
return d = d >>> 0, g ||
|
|
15989
|
+
return d = d >>> 0, g || Y(d, 4, this.length), n.read(this, d, !1, 23, 4);
|
|
15990
15990
|
}, o.prototype.readDoubleLE = function(d, g) {
|
|
15991
|
-
return d = d >>> 0, g ||
|
|
15991
|
+
return d = d >>> 0, g || Y(d, 8, this.length), n.read(this, d, !0, 52, 8);
|
|
15992
15992
|
}, o.prototype.readDoubleBE = function(d, g) {
|
|
15993
|
-
return d = d >>> 0, g ||
|
|
15993
|
+
return d = d >>> 0, g || Y(d, 8, this.length), n.read(this, d, !1, 52, 8);
|
|
15994
15994
|
};
|
|
15995
|
-
function ne(x, d, g, S,
|
|
15995
|
+
function ne(x, d, g, S, k, A) {
|
|
15996
15996
|
if (!o.isBuffer(x)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
15997
|
-
if (d >
|
|
15997
|
+
if (d > k || d < A) throw new RangeError('"value" argument is out of bounds');
|
|
15998
15998
|
if (g + S > x.length) throw new RangeError("Index out of range");
|
|
15999
15999
|
}
|
|
16000
|
-
o.prototype.writeUintLE = o.prototype.writeUIntLE = function(d, g, S,
|
|
16001
|
-
if (d = +d, g = g >>> 0, S = S >>> 0, !
|
|
16000
|
+
o.prototype.writeUintLE = o.prototype.writeUIntLE = function(d, g, S, k) {
|
|
16001
|
+
if (d = +d, g = g >>> 0, S = S >>> 0, !k) {
|
|
16002
16002
|
var A = Math.pow(2, 8 * S) - 1;
|
|
16003
16003
|
ne(this, d, g, S, A, 0);
|
|
16004
16004
|
}
|
|
@@ -16006,8 +16006,8 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
16006
16006
|
for (this[g] = d & 255; ++q < S && (L *= 256); )
|
|
16007
16007
|
this[g + q] = d / L & 255;
|
|
16008
16008
|
return g + S;
|
|
16009
|
-
}, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(d, g, S,
|
|
16010
|
-
if (d = +d, g = g >>> 0, S = S >>> 0, !
|
|
16009
|
+
}, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(d, g, S, k) {
|
|
16010
|
+
if (d = +d, g = g >>> 0, S = S >>> 0, !k) {
|
|
16011
16011
|
var A = Math.pow(2, 8 * S) - 1;
|
|
16012
16012
|
ne(this, d, g, S, A, 0);
|
|
16013
16013
|
}
|
|
@@ -16025,8 +16025,8 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
16025
16025
|
return d = +d, g = g >>> 0, S || ne(this, d, g, 4, 4294967295, 0), this[g + 3] = d >>> 24, this[g + 2] = d >>> 16, this[g + 1] = d >>> 8, this[g] = d & 255, g + 4;
|
|
16026
16026
|
}, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(d, g, S) {
|
|
16027
16027
|
return d = +d, g = g >>> 0, S || ne(this, d, g, 4, 4294967295, 0), this[g] = d >>> 24, this[g + 1] = d >>> 16, this[g + 2] = d >>> 8, this[g + 3] = d & 255, g + 4;
|
|
16028
|
-
}, o.prototype.writeIntLE = function(d, g, S,
|
|
16029
|
-
if (d = +d, g = g >>> 0, !
|
|
16028
|
+
}, o.prototype.writeIntLE = function(d, g, S, k) {
|
|
16029
|
+
if (d = +d, g = g >>> 0, !k) {
|
|
16030
16030
|
var A = Math.pow(2, 8 * S - 1);
|
|
16031
16031
|
ne(this, d, g, S, A - 1, -A);
|
|
16032
16032
|
}
|
|
@@ -16034,8 +16034,8 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
16034
16034
|
for (this[g] = d & 255; ++L < S && (q *= 256); )
|
|
16035
16035
|
d < 0 && V === 0 && this[g + L - 1] !== 0 && (V = 1), this[g + L] = (d / q >> 0) - V & 255;
|
|
16036
16036
|
return g + S;
|
|
16037
|
-
}, o.prototype.writeIntBE = function(d, g, S,
|
|
16038
|
-
if (d = +d, g = g >>> 0, !
|
|
16037
|
+
}, o.prototype.writeIntBE = function(d, g, S, k) {
|
|
16038
|
+
if (d = +d, g = g >>> 0, !k) {
|
|
16039
16039
|
var A = Math.pow(2, 8 * S - 1);
|
|
16040
16040
|
ne(this, d, g, S, A - 1, -A);
|
|
16041
16041
|
}
|
|
@@ -16054,48 +16054,48 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
16054
16054
|
}, o.prototype.writeInt32BE = function(d, g, S) {
|
|
16055
16055
|
return d = +d, g = g >>> 0, S || ne(this, d, g, 4, 2147483647, -2147483648), d < 0 && (d = 4294967295 + d + 1), this[g] = d >>> 24, this[g + 1] = d >>> 16, this[g + 2] = d >>> 8, this[g + 3] = d & 255, g + 4;
|
|
16056
16056
|
};
|
|
16057
|
-
function pe(x, d, g, S,
|
|
16057
|
+
function pe(x, d, g, S, k, A) {
|
|
16058
16058
|
if (g + S > x.length) throw new RangeError("Index out of range");
|
|
16059
16059
|
if (g < 0) throw new RangeError("Index out of range");
|
|
16060
16060
|
}
|
|
16061
|
-
function be(x, d, g, S,
|
|
16062
|
-
return d = +d, g = g >>> 0,
|
|
16061
|
+
function be(x, d, g, S, k) {
|
|
16062
|
+
return d = +d, g = g >>> 0, k || pe(x, d, g, 4), n.write(x, d, g, S, 23, 4), g + 4;
|
|
16063
16063
|
}
|
|
16064
16064
|
o.prototype.writeFloatLE = function(d, g, S) {
|
|
16065
16065
|
return be(this, d, g, !0, S);
|
|
16066
16066
|
}, o.prototype.writeFloatBE = function(d, g, S) {
|
|
16067
16067
|
return be(this, d, g, !1, S);
|
|
16068
16068
|
};
|
|
16069
|
-
function ge(x, d, g, S,
|
|
16070
|
-
return d = +d, g = g >>> 0,
|
|
16069
|
+
function ge(x, d, g, S, k) {
|
|
16070
|
+
return d = +d, g = g >>> 0, k || pe(x, d, g, 8), n.write(x, d, g, S, 52, 8), g + 8;
|
|
16071
16071
|
}
|
|
16072
16072
|
o.prototype.writeDoubleLE = function(d, g, S) {
|
|
16073
16073
|
return ge(this, d, g, !0, S);
|
|
16074
16074
|
}, o.prototype.writeDoubleBE = function(d, g, S) {
|
|
16075
16075
|
return ge(this, d, g, !1, S);
|
|
16076
|
-
}, o.prototype.copy = function(d, g, S,
|
|
16076
|
+
}, o.prototype.copy = function(d, g, S, k) {
|
|
16077
16077
|
if (!o.isBuffer(d)) throw new TypeError("argument should be a Buffer");
|
|
16078
|
-
if (S || (S = 0), !
|
|
16078
|
+
if (S || (S = 0), !k && k !== 0 && (k = this.length), g >= d.length && (g = d.length), g || (g = 0), k > 0 && k < S && (k = S), k === S || d.length === 0 || this.length === 0) return 0;
|
|
16079
16079
|
if (g < 0)
|
|
16080
16080
|
throw new RangeError("targetStart out of bounds");
|
|
16081
16081
|
if (S < 0 || S >= this.length) throw new RangeError("Index out of range");
|
|
16082
|
-
if (
|
|
16083
|
-
|
|
16084
|
-
var A =
|
|
16085
|
-
return this === d && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(g, S,
|
|
16082
|
+
if (k < 0) throw new RangeError("sourceEnd out of bounds");
|
|
16083
|
+
k > this.length && (k = this.length), d.length - g < k - S && (k = d.length - g + S);
|
|
16084
|
+
var A = k - S;
|
|
16085
|
+
return this === d && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(g, S, k) : Uint8Array.prototype.set.call(
|
|
16086
16086
|
d,
|
|
16087
|
-
this.subarray(S,
|
|
16087
|
+
this.subarray(S, k),
|
|
16088
16088
|
g
|
|
16089
16089
|
), A;
|
|
16090
|
-
}, o.prototype.fill = function(d, g, S,
|
|
16090
|
+
}, o.prototype.fill = function(d, g, S, k) {
|
|
16091
16091
|
if (typeof d == "string") {
|
|
16092
|
-
if (typeof g == "string" ? (
|
|
16092
|
+
if (typeof g == "string" ? (k = g, g = 0, S = this.length) : typeof S == "string" && (k = S, S = this.length), k !== void 0 && typeof k != "string")
|
|
16093
16093
|
throw new TypeError("encoding must be a string");
|
|
16094
|
-
if (typeof
|
|
16095
|
-
throw new TypeError("Unknown encoding: " +
|
|
16094
|
+
if (typeof k == "string" && !o.isEncoding(k))
|
|
16095
|
+
throw new TypeError("Unknown encoding: " + k);
|
|
16096
16096
|
if (d.length === 1) {
|
|
16097
16097
|
var A = d.charCodeAt(0);
|
|
16098
|
-
(
|
|
16098
|
+
(k === "utf8" && A < 128 || k === "latin1") && (d = A);
|
|
16099
16099
|
}
|
|
16100
16100
|
} else typeof d == "number" ? d = d & 255 : typeof d == "boolean" && (d = Number(d));
|
|
16101
16101
|
if (g < 0 || this.length < g || this.length < S)
|
|
@@ -16108,7 +16108,7 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
16108
16108
|
for (L = g; L < S; ++L)
|
|
16109
16109
|
this[L] = d;
|
|
16110
16110
|
else {
|
|
16111
|
-
var q = o.isBuffer(d) ? d : o.from(d,
|
|
16111
|
+
var q = o.isBuffer(d) ? d : o.from(d, k), V = q.length;
|
|
16112
16112
|
if (V === 0)
|
|
16113
16113
|
throw new TypeError('The value "' + d + '" is invalid for argument "value"');
|
|
16114
16114
|
for (L = 0; L < S - g; ++L)
|
|
@@ -16123,11 +16123,11 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
16123
16123
|
x = x + "=";
|
|
16124
16124
|
return x;
|
|
16125
16125
|
}
|
|
16126
|
-
function
|
|
16126
|
+
function Z(x, d) {
|
|
16127
16127
|
d = d || 1 / 0;
|
|
16128
|
-
for (var g, S = x.length,
|
|
16128
|
+
for (var g, S = x.length, k = null, A = [], L = 0; L < S; ++L) {
|
|
16129
16129
|
if (g = x.charCodeAt(L), g > 55295 && g < 57344) {
|
|
16130
|
-
if (!
|
|
16130
|
+
if (!k) {
|
|
16131
16131
|
if (g > 56319) {
|
|
16132
16132
|
(d -= 3) > -1 && A.push(239, 191, 189);
|
|
16133
16133
|
continue;
|
|
@@ -16135,16 +16135,16 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
16135
16135
|
(d -= 3) > -1 && A.push(239, 191, 189);
|
|
16136
16136
|
continue;
|
|
16137
16137
|
}
|
|
16138
|
-
|
|
16138
|
+
k = g;
|
|
16139
16139
|
continue;
|
|
16140
16140
|
}
|
|
16141
16141
|
if (g < 56320) {
|
|
16142
|
-
(d -= 3) > -1 && A.push(239, 191, 189),
|
|
16142
|
+
(d -= 3) > -1 && A.push(239, 191, 189), k = g;
|
|
16143
16143
|
continue;
|
|
16144
16144
|
}
|
|
16145
|
-
g = (
|
|
16146
|
-
} else
|
|
16147
|
-
if (
|
|
16145
|
+
g = (k - 55296 << 10 | g - 56320) + 65536;
|
|
16146
|
+
} else k && (d -= 3) > -1 && A.push(239, 191, 189);
|
|
16147
|
+
if (k = null, g < 128) {
|
|
16148
16148
|
if ((d -= 1) < 0) break;
|
|
16149
16149
|
A.push(g);
|
|
16150
16150
|
} else if (g < 2048) {
|
|
@@ -16179,17 +16179,17 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
16179
16179
|
return d;
|
|
16180
16180
|
}
|
|
16181
16181
|
function Ee(x, d) {
|
|
16182
|
-
for (var g, S,
|
|
16183
|
-
g = x.charCodeAt(L), S = g >> 8,
|
|
16182
|
+
for (var g, S, k, A = [], L = 0; L < x.length && !((d -= 2) < 0); ++L)
|
|
16183
|
+
g = x.charCodeAt(L), S = g >> 8, k = g % 256, A.push(k), A.push(S);
|
|
16184
16184
|
return A;
|
|
16185
16185
|
}
|
|
16186
16186
|
function Ae(x) {
|
|
16187
16187
|
return e.toByteArray(ce(x));
|
|
16188
16188
|
}
|
|
16189
16189
|
function Oe(x, d, g, S) {
|
|
16190
|
-
for (var
|
|
16191
|
-
d[
|
|
16192
|
-
return
|
|
16190
|
+
for (var k = 0; k < S && !(k + g >= d.length || k >= x.length); ++k)
|
|
16191
|
+
d[k + g] = x[k];
|
|
16192
|
+
return k;
|
|
16193
16193
|
}
|
|
16194
16194
|
function Re(x, d) {
|
|
16195
16195
|
return x instanceof d || x != null && x.constructor != null && x.constructor.name != null && x.constructor.name === d.name;
|
|
@@ -16199,31 +16199,31 @@ ss.write = function(t, e, n, r, s, i) {
|
|
|
16199
16199
|
}
|
|
16200
16200
|
var et = function() {
|
|
16201
16201
|
for (var x = "0123456789abcdef", d = new Array(256), g = 0; g < 16; ++g)
|
|
16202
|
-
for (var S = g * 16,
|
|
16203
|
-
d[S +
|
|
16202
|
+
for (var S = g * 16, k = 0; k < 16; ++k)
|
|
16203
|
+
d[S + k] = x[g] + x[k];
|
|
16204
16204
|
return d;
|
|
16205
16205
|
}();
|
|
16206
16206
|
})(rs);
|
|
16207
|
-
var Cn = rs,
|
|
16207
|
+
var Cn = rs, Dt = Cn.Buffer, Pe = {}, Ne;
|
|
16208
16208
|
for (Ne in Cn)
|
|
16209
16209
|
Cn.hasOwnProperty(Ne) && (Ne === "SlowBuffer" || Ne === "Buffer" || (Pe[Ne] = Cn[Ne]));
|
|
16210
16210
|
var _t = Pe.Buffer = {};
|
|
16211
|
-
for (Ne in
|
|
16212
|
-
|
|
16213
|
-
Pe.Buffer.prototype =
|
|
16211
|
+
for (Ne in Dt)
|
|
16212
|
+
Dt.hasOwnProperty(Ne) && (Ne === "allocUnsafe" || Ne === "allocUnsafeSlow" || (_t[Ne] = Dt[Ne]));
|
|
16213
|
+
Pe.Buffer.prototype = Dt.prototype;
|
|
16214
16214
|
(!_t.from || _t.from === Uint8Array.from) && (_t.from = function(t, e, n) {
|
|
16215
16215
|
if (typeof t == "number")
|
|
16216
16216
|
throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof t);
|
|
16217
16217
|
if (t && typeof t.length > "u")
|
|
16218
16218
|
throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof t);
|
|
16219
|
-
return
|
|
16219
|
+
return Dt(t, e, n);
|
|
16220
16220
|
});
|
|
16221
16221
|
_t.alloc || (_t.alloc = function(t, e, n) {
|
|
16222
16222
|
if (typeof t != "number")
|
|
16223
16223
|
throw new TypeError('The "size" argument must be of type number. Received type ' + typeof t);
|
|
16224
16224
|
if (t < 0 || t >= 2 * (1 << 30))
|
|
16225
16225
|
throw new RangeError('The value "' + t + '" is invalid for option "size"');
|
|
16226
|
-
var r =
|
|
16226
|
+
var r = Dt(t);
|
|
16227
16227
|
return !e || e.length === 0 ? r.fill(0) : typeof n == "string" ? r.fill(e, n) : r.fill(e), r;
|
|
16228
16228
|
});
|
|
16229
16229
|
if (!Pe.kStringMaxLength)
|
|
@@ -16659,10 +16659,10 @@ function Qd() {
|
|
|
16659
16659
|
}
|
|
16660
16660
|
return tt;
|
|
16661
16661
|
}
|
|
16662
|
-
var yn = {},
|
|
16662
|
+
var yn = {}, Fi;
|
|
16663
16663
|
function e0() {
|
|
16664
|
-
if (
|
|
16665
|
-
|
|
16664
|
+
if (Fi) return yn;
|
|
16665
|
+
Fi = 1;
|
|
16666
16666
|
var t = xt.Buffer;
|
|
16667
16667
|
yn.utf16be = e;
|
|
16668
16668
|
function e() {
|
|
@@ -16745,10 +16745,10 @@ function e0() {
|
|
|
16745
16745
|
}
|
|
16746
16746
|
return yn;
|
|
16747
16747
|
}
|
|
16748
|
-
var qt = {},
|
|
16748
|
+
var qt = {}, ki;
|
|
16749
16749
|
function t0() {
|
|
16750
|
-
if (
|
|
16751
|
-
|
|
16750
|
+
if (ki) return qt;
|
|
16751
|
+
ki = 1;
|
|
16752
16752
|
var t = xt.Buffer;
|
|
16753
16753
|
qt.utf7 = e, qt.unicode11utf7 = "utf7";
|
|
16754
16754
|
function e(m, b) {
|
|
@@ -17542,8 +17542,8 @@ function i0() {
|
|
|
17542
17542
|
j[T] = !0;
|
|
17543
17543
|
}
|
|
17544
17544
|
if (this._fillEncodeTable(0, 0, j), h.encodeAdd)
|
|
17545
|
-
for (var
|
|
17546
|
-
Object.prototype.hasOwnProperty.call(h.encodeAdd,
|
|
17545
|
+
for (var X in h.encodeAdd)
|
|
17546
|
+
Object.prototype.hasOwnProperty.call(h.encodeAdd, X) && this._setEncodeChar(X.charCodeAt(0), h.encodeAdd[X]);
|
|
17547
17547
|
this.defCharSB = this.encodeTable[0][p.defaultCharSingleByte.charCodeAt(0)], this.defCharSB === e && (this.defCharSB = this.encodeTable[0]["?"]), this.defCharSB === e && (this.defCharSB = 63);
|
|
17548
17548
|
}
|
|
17549
17549
|
c.prototype.encoder = l, c.prototype.decoder = u, c.prototype._getDecodeTrieNode = function(h) {
|
|
@@ -26240,9 +26240,9 @@ function p0() {
|
|
|
26240
26240
|
xxbig5: "big5hkscs"
|
|
26241
26241
|
}), yr;
|
|
26242
26242
|
}
|
|
26243
|
-
var
|
|
26243
|
+
var Mi;
|
|
26244
26244
|
function d0() {
|
|
26245
|
-
return
|
|
26245
|
+
return Mi || (Mi = 1, function(t) {
|
|
26246
26246
|
for (var e = To, n = [
|
|
26247
26247
|
Jd(),
|
|
26248
26248
|
Qd(),
|
|
@@ -26259,10 +26259,10 @@ function d0() {
|
|
|
26259
26259
|
}
|
|
26260
26260
|
}(lr)), lr;
|
|
26261
26261
|
}
|
|
26262
|
-
var br,
|
|
26262
|
+
var br, Di;
|
|
26263
26263
|
function g0() {
|
|
26264
|
-
if (
|
|
26265
|
-
|
|
26264
|
+
if (Di) return br;
|
|
26265
|
+
Di = 1;
|
|
26266
26266
|
var t = xt.Buffer;
|
|
26267
26267
|
return br = function(e) {
|
|
26268
26268
|
var n = e.Transform;
|
|
@@ -26591,7 +26591,7 @@ const ft = class ft extends sa {
|
|
|
26591
26591
|
* @returns The fallback shape, or undefined if it cannot be built.
|
|
26592
26592
|
*/
|
|
26593
26593
|
getNotFoundTextShape(e) {
|
|
26594
|
-
const n = this.font.fontData.header.fontType ===
|
|
26594
|
+
const n = this.font.fontData.header.fontType === K.BIGFONT ? "?" : "?";
|
|
26595
26595
|
return this.getCharShape(n, e);
|
|
26596
26596
|
}
|
|
26597
26597
|
/**
|
|
@@ -26656,14 +26656,14 @@ const ft = class ft extends sa {
|
|
|
26656
26656
|
return n;
|
|
26657
26657
|
const r = this.font.fontData.header.fontType;
|
|
26658
26658
|
let s;
|
|
26659
|
-
if (r ===
|
|
26659
|
+
if (r === K.BIGFONT && this.encoding) {
|
|
26660
26660
|
const i = _i.encode(e[0], this.encoding);
|
|
26661
26661
|
if (_i.decode(i, this.encoding) !== e[0])
|
|
26662
26662
|
return this.codeCache.set(e, ft.NOT_ENCODABLE), ft.NOT_ENCODABLE;
|
|
26663
26663
|
s = i.length === 1 ? i[0] : i[0] << 8 | i[1];
|
|
26664
26664
|
} else
|
|
26665
26665
|
s = e.charCodeAt(0);
|
|
26666
|
-
if (r ===
|
|
26666
|
+
if (r === K.BIGFONT && s >= 32 && s <= 126) {
|
|
26667
26667
|
const i = 41856 + s;
|
|
26668
26668
|
this.font.hasChar(i) && (s = i);
|
|
26669
26669
|
}
|
|
@@ -26698,7 +26698,7 @@ class Ke {
|
|
|
26698
26698
|
throw new Error("Unsupported font data type");
|
|
26699
26699
|
}
|
|
26700
26700
|
}
|
|
26701
|
-
class
|
|
26701
|
+
class $ {
|
|
26702
26702
|
constructor() {
|
|
26703
26703
|
this.fontMapping = {}, this.loadedFontMap = /* @__PURE__ */ new Map(), this.unsupportedChars = {}, this.missedFonts = {}, this.enableFontCache = !0, this.lazyFontLoading = !0, this.awaitFontsBeforeDraw = !1, this.defaultFonts = /* @__PURE__ */ new Set(["simsun"]), this.symbolFonts = /* @__PURE__ */ new Set(["simplex", "amgdt"]), this.events = {
|
|
26704
26704
|
/** Event triggered when a font cannot be found */
|
|
@@ -26712,7 +26712,7 @@ class ee {
|
|
|
26712
26712
|
* @returns The FontManager instance
|
|
26713
26713
|
*/
|
|
26714
26714
|
static get instance() {
|
|
26715
|
-
return
|
|
26715
|
+
return $._instance || ($._instance = new $()), $._instance;
|
|
26716
26716
|
}
|
|
26717
26717
|
/**
|
|
26718
26718
|
* Base URL to load fonts
|
|
@@ -26731,7 +26731,7 @@ class ee {
|
|
|
26731
26731
|
this.fontMapping = e;
|
|
26732
26732
|
}
|
|
26733
26733
|
setDefaultFonts(e) {
|
|
26734
|
-
if (typeof e == "string" &&
|
|
26734
|
+
if (typeof e == "string" && ks(e)) {
|
|
26735
26735
|
this.defaultFonts = new Set(Ar[e]), this.symbolFonts = new Set(Zn[e]);
|
|
26736
26736
|
return;
|
|
26737
26737
|
}
|
|
@@ -26739,7 +26739,7 @@ class ee {
|
|
|
26739
26739
|
this.defaultFonts = new Set(n);
|
|
26740
26740
|
}
|
|
26741
26741
|
setSymbolFonts(e) {
|
|
26742
|
-
if (typeof e == "string" &&
|
|
26742
|
+
if (typeof e == "string" && ks(e)) {
|
|
26743
26743
|
this.symbolFonts = new Set(Zn[e]);
|
|
26744
26744
|
return;
|
|
26745
26745
|
}
|
|
@@ -26988,28 +26988,34 @@ class ee {
|
|
|
26988
26988
|
}
|
|
26989
26989
|
/**
|
|
26990
26990
|
* Tries to find the specified font. If not found, uses a replacement font and returns its name.
|
|
26991
|
+
*
|
|
26992
|
+
* When the requested face is not loaded, the original name is recorded in
|
|
26993
|
+
* {@link missedFonts} and {@link events.fontNotFound} is dispatched (once per
|
|
26994
|
+
* miss cycle) so hosts can surface missing-font UI. Lazy loading still
|
|
26995
|
+
* schedules {@link requestFont} for the face that will be fetched.
|
|
26996
|
+
*
|
|
26991
26997
|
* @param fontName - The font name to find
|
|
26992
26998
|
* @returns The original font name if found, or the replacement font name if not found
|
|
26993
26999
|
*/
|
|
26994
27000
|
findAndReplaceFont(e) {
|
|
26995
|
-
const n = e == null ? "" : String(e);
|
|
26996
|
-
let
|
|
26997
|
-
if (r == null) {
|
|
26998
|
-
const
|
|
26999
|
-
if (
|
|
27000
|
-
return
|
|
27001
|
+
const n = e == null ? "" : String(e), r = this.stripFontFileExtension(n);
|
|
27002
|
+
let s = this.loadedFontMap.get(n.toLowerCase());
|
|
27003
|
+
if (s == null && r && r !== n && (s = this.loadedFontMap.get(r.toLowerCase())), s == null) {
|
|
27004
|
+
const c = this.fontMapping[n];
|
|
27005
|
+
if (c)
|
|
27006
|
+
return s = this.loadedFontMap.get(c.toLowerCase()), !s && this.lazyFontLoading && this.requestFont(c), this.recordMissedFonts(r, !1), c;
|
|
27001
27007
|
}
|
|
27002
|
-
if (r)
|
|
27003
|
-
return n;
|
|
27004
|
-
this.lazyFontLoading && n && this.requestFont(n);
|
|
27005
|
-
const s = this.pickLoadedDefaultFont(!0);
|
|
27006
27008
|
if (s)
|
|
27007
|
-
return
|
|
27008
|
-
|
|
27009
|
+
return n;
|
|
27010
|
+
this.recordMissedFonts(r, !0);
|
|
27011
|
+
const i = this.pickLoadedDefaultFont(!0);
|
|
27009
27012
|
if (i)
|
|
27010
27013
|
return i;
|
|
27011
|
-
const a =
|
|
27012
|
-
|
|
27014
|
+
const a = this.pickLoadedDefaultFont(!1);
|
|
27015
|
+
if (a)
|
|
27016
|
+
return a;
|
|
27017
|
+
const o = [...this.defaultFonts][0] ?? "";
|
|
27018
|
+
return o && this.lazyFontLoading && this.requestFont(o), o;
|
|
27013
27019
|
}
|
|
27014
27020
|
/**
|
|
27015
27021
|
* Returns the first loaded font from {@link defaultFonts}.
|
|
@@ -27021,7 +27027,7 @@ class ee {
|
|
|
27021
27027
|
var n;
|
|
27022
27028
|
for (const r of this.defaultFonts) {
|
|
27023
27029
|
const s = this.loadedFontMap.get(r.toLowerCase());
|
|
27024
|
-
if (s && !(e && s.type === "shx" && ((n = s.data.header) == null ? void 0 : n.fontType) ===
|
|
27030
|
+
if (s && !(e && s.type === "shx" && ((n = s.data.header) == null ? void 0 : n.fontType) === K.BIGFONT))
|
|
27025
27031
|
return r;
|
|
27026
27032
|
}
|
|
27027
27033
|
}
|
|
@@ -27156,15 +27162,72 @@ class ee {
|
|
|
27156
27162
|
isFontLoaded(e) {
|
|
27157
27163
|
return this.loadedFontMap.has(e.toLowerCase());
|
|
27158
27164
|
}
|
|
27165
|
+
/**
|
|
27166
|
+
* Applies a missed-font report from another isolate (e.g. a web worker).
|
|
27167
|
+
* Updates {@link missedFonts} and dispatches {@link events.fontNotFound} on
|
|
27168
|
+
* first sighting. Does not call {@link requestFont} — the remote isolate owns loading.
|
|
27169
|
+
*/
|
|
27170
|
+
applyRemoteFontNotFound(e, n = 1) {
|
|
27171
|
+
if (!e)
|
|
27172
|
+
return;
|
|
27173
|
+
const r = this.missedFonts[e] ?? 0;
|
|
27174
|
+
this.missedFonts[e] = Math.max(r, n), r === 0 && this.events.fontNotFound.dispatch({
|
|
27175
|
+
fontName: e,
|
|
27176
|
+
count: this.missedFonts[e]
|
|
27177
|
+
});
|
|
27178
|
+
}
|
|
27179
|
+
/**
|
|
27180
|
+
* Clears a missed-font entry after a remote isolate reports the font loaded.
|
|
27181
|
+
* Call before dispatching {@link events.fontLoaded} on the main thread.
|
|
27182
|
+
*/
|
|
27183
|
+
applyRemoteFontLoaded(e) {
|
|
27184
|
+
e && (this.clearMissedFontEntry(e), this.fontRequestFailed.delete(e.toLowerCase()));
|
|
27185
|
+
}
|
|
27186
|
+
/**
|
|
27187
|
+
* Replaces session-scoped missed-font bookkeeping without dispatching events.
|
|
27188
|
+
* Entries for faces that are already loaded are dropped.
|
|
27189
|
+
*/
|
|
27190
|
+
replaceMissedFonts(e) {
|
|
27191
|
+
const n = {};
|
|
27192
|
+
for (const [r, s] of Object.entries(e ?? {}))
|
|
27193
|
+
!r || this.isFontLoaded(r) || (n[r] = s);
|
|
27194
|
+
this.missedFonts = n;
|
|
27195
|
+
}
|
|
27196
|
+
/**
|
|
27197
|
+
* Clears {@link missedFonts}. Does not unload faces or cancel in-flight loads.
|
|
27198
|
+
*/
|
|
27199
|
+
clearMissedFonts() {
|
|
27200
|
+
this.missedFonts = {};
|
|
27201
|
+
}
|
|
27202
|
+
/**
|
|
27203
|
+
* Strips a trailing `.ttf` / `.otf` / `.woff` / `.shx` extension when present.
|
|
27204
|
+
* Matches the normalization used by {@link getFontByName}.
|
|
27205
|
+
*/
|
|
27206
|
+
stripFontFileExtension(e) {
|
|
27207
|
+
if (!e)
|
|
27208
|
+
return e;
|
|
27209
|
+
const n = e.lastIndexOf(".");
|
|
27210
|
+
return n > 0 && n == e.length - 4 || n == e.length - 5 ? e.substring(0, n) : e;
|
|
27211
|
+
}
|
|
27212
|
+
/**
|
|
27213
|
+
* Removes {@link missedFonts} entries whose name matches `fontName`
|
|
27214
|
+
* case-insensitively (CAD style names and loaded face names often differ in case).
|
|
27215
|
+
*/
|
|
27216
|
+
clearMissedFontEntry(e) {
|
|
27217
|
+
const n = e.toLowerCase();
|
|
27218
|
+
for (const r of Object.keys(this.missedFonts))
|
|
27219
|
+
r.toLowerCase() === n && delete this.missedFonts[r];
|
|
27220
|
+
}
|
|
27159
27221
|
/**
|
|
27160
27222
|
* Records a font that was requested but not found
|
|
27161
27223
|
* @param fontName - The name of the font that was not found
|
|
27224
|
+
* @param scheduleLoad - When true (default), also {@link requestFont} on first miss if lazy loading is on
|
|
27162
27225
|
*/
|
|
27163
|
-
recordMissedFonts(e) {
|
|
27226
|
+
recordMissedFonts(e, n = !0) {
|
|
27164
27227
|
e && (this.missedFonts[e] || (this.missedFonts[e] = 0), this.missedFonts[e]++, this.missedFonts[e] === 1 && (this.events.fontNotFound.dispatch({
|
|
27165
27228
|
fontName: e,
|
|
27166
27229
|
count: this.missedFonts[e]
|
|
27167
|
-
}), this.lazyFontLoading && this.requestFont(e)));
|
|
27230
|
+
}), n && this.lazyFontLoading && this.requestFont(e)));
|
|
27168
27231
|
}
|
|
27169
27232
|
/**
|
|
27170
27233
|
* Loads a single font
|
|
@@ -27190,7 +27253,7 @@ class ee {
|
|
|
27190
27253
|
const c = Ke.instance.createFont(r);
|
|
27191
27254
|
c && (e.name.forEach((l) => c.names.add(l)), this.registerFontInMap(s, c), this.enableFontCache && await st.instance.set(s, r));
|
|
27192
27255
|
}
|
|
27193
|
-
i !== this.loadEpoch || !this.isFontLoaded(s) || (
|
|
27256
|
+
i !== this.loadEpoch || !this.isFontLoaded(s) || (this.clearMissedFontEntry(s), this.fontRequestFailed.delete(s.toLowerCase()), this.events.fontLoaded.dispatch({
|
|
27194
27257
|
fontName: s
|
|
27195
27258
|
}));
|
|
27196
27259
|
}
|
|
@@ -27374,13 +27437,13 @@ class v0 {
|
|
|
27374
27437
|
const n = [], r = [], s = /* @__PURE__ */ new Map();
|
|
27375
27438
|
e.forEach((c) => {
|
|
27376
27439
|
const l = c.toLowerCase(), u = this._avaiableFontMap.get(l);
|
|
27377
|
-
u && (s.set(l, u),
|
|
27440
|
+
u && (s.set(l, u), $.instance.isFontLoaded(l) && n.push({
|
|
27378
27441
|
fontName: l,
|
|
27379
27442
|
url: u.url,
|
|
27380
27443
|
status: "Success"
|
|
27381
27444
|
}), r.push(u));
|
|
27382
27445
|
});
|
|
27383
|
-
const i = await
|
|
27446
|
+
const i = await $.instance.loadFonts(r), a = {};
|
|
27384
27447
|
[...n, ...i].forEach((c) => {
|
|
27385
27448
|
a[c.fontName] = c;
|
|
27386
27449
|
});
|
|
@@ -27393,7 +27456,7 @@ class v0 {
|
|
|
27393
27456
|
}
|
|
27394
27457
|
const f = s.get(l);
|
|
27395
27458
|
if (f) {
|
|
27396
|
-
if (
|
|
27459
|
+
if ($.instance.isFontLoaded(l)) {
|
|
27397
27460
|
o.push({
|
|
27398
27461
|
fontName: l,
|
|
27399
27462
|
url: f.url,
|
|
@@ -27413,7 +27476,7 @@ class v0 {
|
|
|
27413
27476
|
continue;
|
|
27414
27477
|
}
|
|
27415
27478
|
}
|
|
27416
|
-
if (await
|
|
27479
|
+
if (await $.instance.loadFontFromCache(c)) {
|
|
27417
27480
|
o.push({
|
|
27418
27481
|
fontName: l,
|
|
27419
27482
|
url: "",
|
|
@@ -27461,7 +27524,7 @@ class v0 {
|
|
|
27461
27524
|
function S0(t) {
|
|
27462
27525
|
return t && "getMaterialStats" in t && typeof t.getMaterialStats == "function" ? t.getMaterialStats() : pa();
|
|
27463
27526
|
}
|
|
27464
|
-
function
|
|
27527
|
+
function Fo(t, e) {
|
|
27465
27528
|
const n = e.materials ?? S0(e.styleManager);
|
|
27466
27529
|
return t.estimateMemoryUsage({
|
|
27467
27530
|
id: e.id,
|
|
@@ -27525,10 +27588,10 @@ function J0(t) {
|
|
|
27525
27588
|
return e.join(`
|
|
27526
27589
|
`);
|
|
27527
27590
|
}
|
|
27528
|
-
var
|
|
27591
|
+
var ee;
|
|
27529
27592
|
(function(t) {
|
|
27530
27593
|
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[t.PERCENT_SYMBOL = 10] = "PERCENT_SYMBOL";
|
|
27531
|
-
})(
|
|
27594
|
+
})(ee || (ee = {}));
|
|
27532
27595
|
var dt;
|
|
27533
27596
|
(function(t) {
|
|
27534
27597
|
t[t.BOTTOM = 0] = "BOTTOM", t[t.MIDDLE = 1] = "MIDDLE", t[t.TOP = 2] = "TOP";
|
|
@@ -27553,7 +27616,7 @@ const C0 = {
|
|
|
27553
27616
|
j: oe.JUSTIFIED,
|
|
27554
27617
|
d: oe.DISTRIBUTED
|
|
27555
27618
|
};
|
|
27556
|
-
function
|
|
27619
|
+
function F0(t) {
|
|
27557
27620
|
const [e, n, r] = t;
|
|
27558
27621
|
return e << 16 | n << 8 | r;
|
|
27559
27622
|
}
|
|
@@ -27564,11 +27627,11 @@ function Q0(t) {
|
|
|
27564
27627
|
function Pi(t) {
|
|
27565
27628
|
return Math.max(0, Math.min(255, Math.round(t)));
|
|
27566
27629
|
}
|
|
27567
|
-
function
|
|
27630
|
+
function ko(t) {
|
|
27568
27631
|
return Math.max(0, Math.min(16777215, Math.round(t)));
|
|
27569
27632
|
}
|
|
27570
|
-
function
|
|
27571
|
-
return t === null ? null : `#${
|
|
27633
|
+
function k0(t) {
|
|
27634
|
+
return t === null ? null : `#${ko(t).toString(16).padStart(6, "0")}`;
|
|
27572
27635
|
}
|
|
27573
27636
|
function E0(t) {
|
|
27574
27637
|
if (!t)
|
|
@@ -27596,7 +27659,7 @@ function A0(t) {
|
|
|
27596
27659
|
return null;
|
|
27597
27660
|
const n = E0(e);
|
|
27598
27661
|
if (n)
|
|
27599
|
-
return
|
|
27662
|
+
return ko(Number.parseInt(n.slice(1), 16));
|
|
27600
27663
|
const r = e.match(/^rgba?\((.*)\)$/);
|
|
27601
27664
|
if (!r)
|
|
27602
27665
|
return null;
|
|
@@ -27611,7 +27674,7 @@ function A0(t) {
|
|
|
27611
27674
|
const u = Number.parseFloat(l);
|
|
27612
27675
|
return Pi(u);
|
|
27613
27676
|
}, a = i(s[0]), o = i(s[1]), c = i(s[2]);
|
|
27614
|
-
return
|
|
27677
|
+
return F0([a, o, c]);
|
|
27615
27678
|
}
|
|
27616
27679
|
function e1(t) {
|
|
27617
27680
|
return t.replace(/\r\n|\r|\n/g, "\\P");
|
|
@@ -27817,7 +27880,7 @@ class I0 {
|
|
|
27817
27880
|
}
|
|
27818
27881
|
return l;
|
|
27819
27882
|
};
|
|
27820
|
-
return [n, s] = a(), s && (r = o(s === "^")), n === "" && r.includes("I/") ? [
|
|
27883
|
+
return [n, s] = a(), s && (r = o(s === "^")), n === "" && r.includes("I/") ? [ee.STACK, [" ", " ", "/"]] : s === "^" ? [ee.STACK, [n, r, "^"]] : [ee.STACK, [n, r, s]];
|
|
27821
27884
|
}
|
|
27822
27885
|
/**
|
|
27823
27886
|
* Parse MText properties
|
|
@@ -28151,7 +28214,7 @@ class I0 {
|
|
|
28151
28214
|
* @yields MTextToken objects
|
|
28152
28215
|
*/
|
|
28153
28216
|
*parse() {
|
|
28154
|
-
const e =
|
|
28217
|
+
const e = ee.WORD, n = ee.SPACE;
|
|
28155
28218
|
let r = null, s;
|
|
28156
28219
|
function i(o) {
|
|
28157
28220
|
const c = { ...o.paragraph };
|
|
@@ -28172,10 +28235,10 @@ class I0 {
|
|
|
28172
28235
|
const u = this.scanner.currentIndex;
|
|
28173
28236
|
if (l.charCodeAt(0) < 32) {
|
|
28174
28237
|
if (this.scanner.consume(1), l === " ")
|
|
28175
|
-
return [
|
|
28238
|
+
return [ee.TABULATOR, null];
|
|
28176
28239
|
if (l === `
|
|
28177
28240
|
`)
|
|
28178
|
-
return [
|
|
28241
|
+
return [ee.NEW_PARAGRAPH, null];
|
|
28179
28242
|
l = " ";
|
|
28180
28243
|
}
|
|
28181
28244
|
if (l === "\\")
|
|
@@ -28188,13 +28251,13 @@ class I0 {
|
|
|
28188
28251
|
const f = this.scanner.get();
|
|
28189
28252
|
switch (f) {
|
|
28190
28253
|
case "~":
|
|
28191
|
-
return [
|
|
28254
|
+
return [ee.NBSP, null];
|
|
28192
28255
|
case "P":
|
|
28193
|
-
return [
|
|
28256
|
+
return [ee.NEW_PARAGRAPH, null];
|
|
28194
28257
|
case "N":
|
|
28195
|
-
return [
|
|
28258
|
+
return [ee.NEW_COLUMN, null];
|
|
28196
28259
|
case "X":
|
|
28197
|
-
return [
|
|
28260
|
+
return [ee.WRAP_AT_DIMLINE, null];
|
|
28198
28261
|
case "S": {
|
|
28199
28262
|
this.inStackContext = !0;
|
|
28200
28263
|
const h = this.parseStacking();
|
|
@@ -28226,7 +28289,7 @@ class I0 {
|
|
|
28226
28289
|
try {
|
|
28227
28290
|
const h = this.parseProperties(f);
|
|
28228
28291
|
if (this.yieldPropertyCommands && h)
|
|
28229
|
-
return [
|
|
28292
|
+
return [ee.PROPERTIES_CHANGED, h];
|
|
28230
28293
|
continue;
|
|
28231
28294
|
} catch {
|
|
28232
28295
|
const h = this.scanner.tail.slice(u, this.scanner.currentIndex);
|
|
@@ -28241,7 +28304,7 @@ class I0 {
|
|
|
28241
28304
|
if (this.scanner.consume(3), this.yieldPercentSymbols) {
|
|
28242
28305
|
const p = this.buildPercentSymbolData(f, h);
|
|
28243
28306
|
if (p)
|
|
28244
|
-
return o ? (r =
|
|
28307
|
+
return o ? (r = ee.PERCENT_SYMBOL, s = p, [e, o]) : [ee.PERCENT_SYMBOL, p];
|
|
28245
28308
|
}
|
|
28246
28309
|
o += h;
|
|
28247
28310
|
continue;
|
|
@@ -28255,7 +28318,7 @@ class I0 {
|
|
|
28255
28318
|
charCode: y,
|
|
28256
28319
|
char: String.fromCharCode(y)
|
|
28257
28320
|
};
|
|
28258
|
-
return o ? (r =
|
|
28321
|
+
return o ? (r = ee.PERCENT_SYMBOL, s = m, [e, o]) : [ee.PERCENT_SYMBOL, m];
|
|
28259
28322
|
}
|
|
28260
28323
|
o += String.fromCharCode(y);
|
|
28261
28324
|
} else
|
|
@@ -28280,7 +28343,7 @@ class I0 {
|
|
|
28280
28343
|
const h = this.getPropertyChanges(f, this.ctxStack.current);
|
|
28281
28344
|
if (Object.keys(h).length > 0)
|
|
28282
28345
|
return [
|
|
28283
|
-
|
|
28346
|
+
ee.PROPERTIES_CHANGED,
|
|
28284
28347
|
{ command: void 0, changes: h, depth: this.ctxStack.depth }
|
|
28285
28348
|
];
|
|
28286
28349
|
} else
|
|
@@ -28296,9 +28359,9 @@ class I0 {
|
|
|
28296
28359
|
o += "^";
|
|
28297
28360
|
else {
|
|
28298
28361
|
if (h === 73)
|
|
28299
|
-
return o ? [e, o] : [
|
|
28362
|
+
return o ? [e, o] : [ee.TABULATOR, null];
|
|
28300
28363
|
if (h === 74)
|
|
28301
|
-
return o ? [e, o] : [
|
|
28364
|
+
return o ? [e, o] : [ee.NEW_PARAGRAPH, null];
|
|
28302
28365
|
if (h === 77)
|
|
28303
28366
|
continue;
|
|
28304
28367
|
o += "▯";
|
|
@@ -28308,14 +28371,14 @@ class I0 {
|
|
|
28308
28371
|
}
|
|
28309
28372
|
this.scanner.consume(1), l.charCodeAt(0) >= 32 && (o += l);
|
|
28310
28373
|
}
|
|
28311
|
-
return o ? [e, o] : [
|
|
28374
|
+
return o ? [e, o] : [ee.NONE, null];
|
|
28312
28375
|
};
|
|
28313
28376
|
for (; ; ) {
|
|
28314
28377
|
const [o, c] = a.call(this);
|
|
28315
28378
|
if (o) {
|
|
28316
|
-
if (yield new vr(o, this.ctxStack.current.copy(), c), o ===
|
|
28379
|
+
if (yield new vr(o, this.ctxStack.current.copy(), c), o === ee.NEW_PARAGRAPH && this.resetParagraphParameters) {
|
|
28317
28380
|
const l = this.ctxStack.current, u = i(l);
|
|
28318
|
-
this.yieldPropertyCommands && Object.keys(u).length > 0 && (yield new vr(
|
|
28381
|
+
this.yieldPropertyCommands && Object.keys(u).length > 0 && (yield new vr(ee.PROPERTIES_CHANGED, l.copy(), {
|
|
28319
28382
|
command: void 0,
|
|
28320
28383
|
changes: { paragraph: u },
|
|
28321
28384
|
depth: this.ctxStack.depth
|
|
@@ -28518,7 +28581,7 @@ class bt {
|
|
|
28518
28581
|
* Returns null if the color is ACI-based and has no RGB value.
|
|
28519
28582
|
*/
|
|
28520
28583
|
toCssColor() {
|
|
28521
|
-
return this._rgbValue !== null ?
|
|
28584
|
+
return this._rgbValue !== null ? k0(this._rgbValue) : null;
|
|
28522
28585
|
}
|
|
28523
28586
|
/**
|
|
28524
28587
|
* Create an MTextColor from a CSS color string.
|
|
@@ -28772,15 +28835,15 @@ function B0(t, e, n, r) {
|
|
|
28772
28835
|
color: a
|
|
28773
28836
|
};
|
|
28774
28837
|
}
|
|
28775
|
-
const
|
|
28776
|
-
var Ge = /* @__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))(Ge || {}),
|
|
28838
|
+
const M0 = 5 / 3, Ni = 1, bn = 0.3;
|
|
28839
|
+
var Ge = /* @__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))(Ge || {}), Q = /* @__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[t.BaselineLeft = 10] = "BaselineLeft", t[t.BaselineCenter = 11] = "BaselineCenter", t[t.BaselineRight = 12] = "BaselineRight", t))(Q || {}), ue = /* @__PURE__ */ ((t) => (t.CHAR = "CHAR", t.STACK = "STACK", t))(ue || {});
|
|
28777
28840
|
const Tn = "", Ie = () => ({
|
|
28778
28841
|
byLayerColor: 16777215,
|
|
28779
28842
|
byBlockColor: 16777215,
|
|
28780
28843
|
layer: "0",
|
|
28781
28844
|
color: new bt()
|
|
28782
28845
|
});
|
|
28783
|
-
function
|
|
28846
|
+
function D0(t) {
|
|
28784
28847
|
if (!(!t || [
|
|
28785
28848
|
t.min.x,
|
|
28786
28849
|
t.min.y,
|
|
@@ -28794,7 +28857,7 @@ function M0(t) {
|
|
|
28794
28857
|
function Hr(t, e, n) {
|
|
28795
28858
|
const r = [];
|
|
28796
28859
|
if (t.filter((h) => h.char !== Tn).forEach((h) => {
|
|
28797
|
-
const p =
|
|
28860
|
+
const p = D0(
|
|
28798
28861
|
new I.Box3().copy(h.box).applyMatrix4(e)
|
|
28799
28862
|
);
|
|
28800
28863
|
p && r.push({
|
|
@@ -29128,7 +29191,7 @@ class ji {
|
|
|
29128
29191
|
* affect this layout metric — use {@link currentLayoutFontSize}.
|
|
29129
29192
|
*/
|
|
29130
29193
|
get currentLineHeight() {
|
|
29131
|
-
return Math.max(this.defaultLineSpaceFactor, 0) * this.currentLayoutFontSize *
|
|
29194
|
+
return Math.max(this.defaultLineSpaceFactor, 0) * this.currentLayoutFontSize * M0;
|
|
29132
29195
|
}
|
|
29133
29196
|
/**
|
|
29134
29197
|
* The maximum font size in current line. Characters in one line may have different font and font
|
|
@@ -29549,7 +29612,7 @@ class ji {
|
|
|
29549
29612
|
this._lastCharBoxTarget = void 0, this._lineBatchEntries = [];
|
|
29550
29613
|
const n = [], r = [], s = [], i = [], a = new I.Group();
|
|
29551
29614
|
for (const o of e)
|
|
29552
|
-
if (o.type ===
|
|
29615
|
+
if (o.type === ee.NEW_PARAGRAPH)
|
|
29553
29616
|
this.startNewParagraph(
|
|
29554
29617
|
n,
|
|
29555
29618
|
r,
|
|
@@ -29557,7 +29620,7 @@ class ji {
|
|
|
29557
29620
|
i,
|
|
29558
29621
|
a
|
|
29559
29622
|
);
|
|
29560
|
-
else if (o.type ===
|
|
29623
|
+
else if (o.type === ee.WORD) {
|
|
29561
29624
|
const c = o.data;
|
|
29562
29625
|
Array.isArray(c) ? c.forEach(
|
|
29563
29626
|
(l) => this.processWord(
|
|
@@ -29574,9 +29637,9 @@ class ji {
|
|
|
29574
29637
|
s,
|
|
29575
29638
|
i
|
|
29576
29639
|
);
|
|
29577
|
-
} else if (o.type ===
|
|
29640
|
+
} else if (o.type === ee.SPACE)
|
|
29578
29641
|
this.processBlank(s, i);
|
|
29579
|
-
else if (o.type ===
|
|
29642
|
+
else if (o.type === ee.PERCENT_SYMBOL)
|
|
29580
29643
|
this.processPercentSymbol(
|
|
29581
29644
|
o.data,
|
|
29582
29645
|
n,
|
|
@@ -29584,7 +29647,7 @@ class ji {
|
|
|
29584
29647
|
s,
|
|
29585
29648
|
i
|
|
29586
29649
|
);
|
|
29587
|
-
else if (o.type ===
|
|
29650
|
+
else if (o.type === ee.PROPERTIES_CHANGED) {
|
|
29588
29651
|
this.processGeometries(
|
|
29589
29652
|
n,
|
|
29590
29653
|
r,
|
|
@@ -29602,7 +29665,7 @@ class ji {
|
|
|
29602
29665
|
this._contextStack.push(this._currentContext.clone());
|
|
29603
29666
|
this.processFormat(c);
|
|
29604
29667
|
}
|
|
29605
|
-
} else if (o.type ===
|
|
29668
|
+
} else if (o.type === ee.STACK) {
|
|
29606
29669
|
this.processGeometries(
|
|
29607
29670
|
n,
|
|
29608
29671
|
r,
|
|
@@ -29766,17 +29829,17 @@ class ji {
|
|
|
29766
29829
|
} else if (a && o) {
|
|
29767
29830
|
const C = this._currentContext.fontScaleFactor || 1, T = (this._maxFontSize || this.currentFontSize) / C, E = Math.abs(this.currentLayoutFontSize - T) < 1e-6;
|
|
29768
29831
|
E && (this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams());
|
|
29769
|
-
const R = Math.max(y, m), P = 0, W = 0, j = this.currentLayoutFontSize, N = u - T + j,
|
|
29770
|
-
this._hOffset = l + P, this._vOffset =
|
|
29832
|
+
const R = Math.max(y, m), P = 0, W = 0, j = this.currentLayoutFontSize, N = u - T + j, X = N + this.currentFontSize, ie = [], U = [], M = [], _ = [];
|
|
29833
|
+
this._hOffset = l + P, this._vOffset = X;
|
|
29771
29834
|
for (const me of a)
|
|
29772
29835
|
this.processChar(
|
|
29773
29836
|
me,
|
|
29774
29837
|
ie,
|
|
29775
29838
|
U,
|
|
29776
|
-
|
|
29839
|
+
M,
|
|
29777
29840
|
_
|
|
29778
29841
|
);
|
|
29779
|
-
n.push(...ie), r.push(...U), s.push(...
|
|
29842
|
+
n.push(...ie), r.push(...U), s.push(...M), i.push(..._);
|
|
29780
29843
|
const re = [], Te = [], Qe = [], _e = [];
|
|
29781
29844
|
this._hOffset = l + W, this._vOffset = N;
|
|
29782
29845
|
for (const me of o)
|
|
@@ -29795,9 +29858,9 @@ class ji {
|
|
|
29795
29858
|
u + this.currentFontSize * 0.3,
|
|
29796
29859
|
this.currentFontSize
|
|
29797
29860
|
);
|
|
29798
|
-
for (const
|
|
29861
|
+
for (const X of a)
|
|
29799
29862
|
this.processChar(
|
|
29800
|
-
|
|
29863
|
+
X,
|
|
29801
29864
|
C,
|
|
29802
29865
|
T,
|
|
29803
29866
|
E,
|
|
@@ -29815,16 +29878,16 @@ class ji {
|
|
|
29815
29878
|
u - this.currentFontSize * 0.6,
|
|
29816
29879
|
this.currentFontSize
|
|
29817
29880
|
);
|
|
29818
|
-
for (const
|
|
29881
|
+
for (const X of o)
|
|
29819
29882
|
this.processChar(
|
|
29820
|
-
|
|
29883
|
+
X,
|
|
29821
29884
|
P,
|
|
29822
29885
|
W,
|
|
29823
29886
|
j,
|
|
29824
29887
|
N
|
|
29825
29888
|
);
|
|
29826
29889
|
if (n.push(...P), r.push(...W), s.push(...j), i.push(...N), c === "/" || c === "#") {
|
|
29827
|
-
const
|
|
29890
|
+
const X = new I.BufferGeometry(), ie = new Float32Array([
|
|
29828
29891
|
l,
|
|
29829
29892
|
u - this.currentFontSize * 0.8 + this.defaultFontSize * bn,
|
|
29830
29893
|
0,
|
|
@@ -29832,10 +29895,10 @@ class ji {
|
|
|
29832
29895
|
u - this.currentFontSize * 0.8 + this.defaultFontSize * bn,
|
|
29833
29896
|
0
|
|
29834
29897
|
]);
|
|
29835
|
-
|
|
29898
|
+
X.setAttribute(
|
|
29836
29899
|
"position",
|
|
29837
29900
|
new I.BufferAttribute(ie, 3)
|
|
29838
|
-
),
|
|
29901
|
+
), X.setIndex([0, 1]), X.userData = { isDecoration: !0 }, r.push(X);
|
|
29839
29902
|
}
|
|
29840
29903
|
this._hOffset = l + b;
|
|
29841
29904
|
}
|
|
@@ -30633,7 +30696,7 @@ class tn extends I.Object3D {
|
|
|
30633
30696
|
n.drawingDirection
|
|
30634
30697
|
);
|
|
30635
30698
|
let c = { x: 0, y: 0 };
|
|
30636
|
-
(s == null ? void 0 : s.shxFontType) ===
|
|
30699
|
+
(s == null ? void 0 : s.shxFontType) === K.SHAPES ? c = { x: 0, y: 0 } : c = this.calculateAnchorPoint(o, n.attachmentPoint), e.userData.logicalBounds = {
|
|
30637
30700
|
minX: o.minX + c.x,
|
|
30638
30701
|
maxX: o.maxX + c.x,
|
|
30639
30702
|
minY: o.minY + c.y,
|
|
@@ -30664,7 +30727,7 @@ class tn extends I.Object3D {
|
|
|
30664
30727
|
), y.layers.enableAll();
|
|
30665
30728
|
});
|
|
30666
30729
|
let f = n.rotation || 0;
|
|
30667
|
-
if (n.directionVector && (s == null ? void 0 : s.shxFontType) !==
|
|
30730
|
+
if (n.directionVector && (s == null ? void 0 : s.shxFontType) !== K.SHAPES) {
|
|
30668
30731
|
const y = n.directionVector, m = new I.Vector3(y.x, y.y, y.z), b = m.clone().cross($i), v = $i.angleTo(m);
|
|
30669
30732
|
f = b.z > 0 ? -v : v;
|
|
30670
30733
|
}
|
|
@@ -30712,30 +30775,30 @@ class tn extends I.Object3D {
|
|
|
30712
30775
|
const r = Hi(e) || 0, s = Number.isFinite(r) && r > 0;
|
|
30713
30776
|
let i = oe.LEFT;
|
|
30714
30777
|
s && e.attachmentPoint && ([
|
|
30715
|
-
|
|
30716
|
-
|
|
30717
|
-
|
|
30718
|
-
|
|
30778
|
+
Q.TopLeft,
|
|
30779
|
+
Q.MiddleLeft,
|
|
30780
|
+
Q.BottomLeft,
|
|
30781
|
+
Q.BaselineLeft
|
|
30719
30782
|
].includes(e.attachmentPoint) ? i = oe.LEFT : [
|
|
30720
|
-
|
|
30721
|
-
|
|
30722
|
-
|
|
30723
|
-
|
|
30783
|
+
Q.TopCenter,
|
|
30784
|
+
Q.MiddleCenter,
|
|
30785
|
+
Q.BottomCenter,
|
|
30786
|
+
Q.BaselineCenter
|
|
30724
30787
|
].includes(e.attachmentPoint) ? i = oe.CENTER : [
|
|
30725
|
-
|
|
30726
|
-
|
|
30727
|
-
|
|
30728
|
-
|
|
30788
|
+
Q.TopRight,
|
|
30789
|
+
Q.MiddleRight,
|
|
30790
|
+
Q.BottomRight,
|
|
30791
|
+
Q.BaselineRight
|
|
30729
30792
|
].includes(e.attachmentPoint) && (i = oe.RIGHT));
|
|
30730
30793
|
let a = dt.BOTTOM;
|
|
30731
30794
|
e.attachmentPoint && ([
|
|
30732
|
-
|
|
30733
|
-
|
|
30734
|
-
|
|
30795
|
+
Q.TopLeft,
|
|
30796
|
+
Q.TopCenter,
|
|
30797
|
+
Q.TopRight
|
|
30735
30798
|
].includes(e.attachmentPoint) ? a = dt.TOP : [
|
|
30736
|
-
|
|
30737
|
-
|
|
30738
|
-
|
|
30799
|
+
Q.MiddleLeft,
|
|
30800
|
+
Q.MiddleCenter,
|
|
30801
|
+
Q.MiddleRight
|
|
30739
30802
|
].includes(e.attachmentPoint) ? a = dt.MIDDLE : a = dt.BOTTOM);
|
|
30740
30803
|
const o = e.height || n.fixedTextHeight || 0, c = e.widthFactor || n.widthFactor || 1, l = e.lineSpaceFactor ?? Ni, u = e.drawingDirection ?? Ge.LEFT_TO_RIGHT, f = {
|
|
30741
30804
|
fontSize: o,
|
|
@@ -30845,40 +30908,40 @@ class tn extends I.Object3D {
|
|
|
30845
30908
|
let i = 0, a = 0;
|
|
30846
30909
|
switch (n) {
|
|
30847
30910
|
case void 0:
|
|
30848
|
-
case
|
|
30911
|
+
case Q.TopLeft:
|
|
30849
30912
|
i = -e.minX, a = -e.maxY;
|
|
30850
30913
|
break;
|
|
30851
|
-
case
|
|
30914
|
+
case Q.TopCenter:
|
|
30852
30915
|
i = -r, a = -e.maxY;
|
|
30853
30916
|
break;
|
|
30854
|
-
case
|
|
30917
|
+
case Q.TopRight:
|
|
30855
30918
|
i = -e.maxX, a = -e.maxY;
|
|
30856
30919
|
break;
|
|
30857
|
-
case
|
|
30920
|
+
case Q.MiddleLeft:
|
|
30858
30921
|
i = -e.minX, a = -s;
|
|
30859
30922
|
break;
|
|
30860
|
-
case
|
|
30923
|
+
case Q.MiddleCenter:
|
|
30861
30924
|
i = -r, a = -s;
|
|
30862
30925
|
break;
|
|
30863
|
-
case
|
|
30926
|
+
case Q.MiddleRight:
|
|
30864
30927
|
i = -e.maxX, a = -s;
|
|
30865
30928
|
break;
|
|
30866
|
-
case
|
|
30929
|
+
case Q.BottomLeft:
|
|
30867
30930
|
i = -e.minX, a = -e.minY;
|
|
30868
30931
|
break;
|
|
30869
|
-
case
|
|
30932
|
+
case Q.BottomCenter:
|
|
30870
30933
|
i = -r, a = -e.minY;
|
|
30871
30934
|
break;
|
|
30872
|
-
case
|
|
30935
|
+
case Q.BottomRight:
|
|
30873
30936
|
i = -e.maxX, a = -e.minY;
|
|
30874
30937
|
break;
|
|
30875
|
-
case
|
|
30938
|
+
case Q.BaselineLeft:
|
|
30876
30939
|
i = -e.minX, a = -e.baselineY;
|
|
30877
30940
|
break;
|
|
30878
|
-
case
|
|
30941
|
+
case Q.BaselineCenter:
|
|
30879
30942
|
i = -r, a = -e.baselineY;
|
|
30880
30943
|
break;
|
|
30881
|
-
case
|
|
30944
|
+
case Q.BaselineRight:
|
|
30882
30945
|
i = -e.maxX, a = -e.baselineY;
|
|
30883
30946
|
break;
|
|
30884
30947
|
}
|
|
@@ -31172,25 +31235,33 @@ class X0 {
|
|
|
31172
31235
|
this.defaultStyleManager = e;
|
|
31173
31236
|
}
|
|
31174
31237
|
async ensureInitialized() {
|
|
31175
|
-
this.isInitialized || (
|
|
31238
|
+
this.isInitialized || ($.instance.lazyFontLoading || await this.loadFonts($.instance.getFontsToLoad()), this.isInitialized = !0);
|
|
31176
31239
|
}
|
|
31177
31240
|
/**
|
|
31178
31241
|
* Handles messages coming from any worker.
|
|
31179
31242
|
*/
|
|
31180
31243
|
handleWorkerMessage(e, n) {
|
|
31181
|
-
var c;
|
|
31244
|
+
var c, l, u;
|
|
31182
31245
|
if (e.type === "fontLoaded") {
|
|
31183
|
-
const
|
|
31184
|
-
|
|
31185
|
-
|
|
31186
|
-
}).catch((
|
|
31246
|
+
const f = (c = e.data) == null ? void 0 : c.fontName;
|
|
31247
|
+
f && this.syncFontToWorkerPool(f).then((h) => {
|
|
31248
|
+
h && ($.instance.applyRemoteFontLoaded(f), $.instance.events.fontLoaded.dispatch({ fontName: f }));
|
|
31249
|
+
}).catch((h) => {
|
|
31187
31250
|
console.warn(
|
|
31188
|
-
`Failed to sync lazy-loaded font "${
|
|
31189
|
-
|
|
31251
|
+
`Failed to sync lazy-loaded font "${f}" across worker pool:`,
|
|
31252
|
+
h
|
|
31190
31253
|
);
|
|
31191
31254
|
});
|
|
31192
31255
|
return;
|
|
31193
31256
|
}
|
|
31257
|
+
if (e.type === "fontNotFound") {
|
|
31258
|
+
const f = (l = e.data) == null ? void 0 : l.fontName;
|
|
31259
|
+
f && $.instance.applyRemoteFontNotFound(
|
|
31260
|
+
f,
|
|
31261
|
+
((u = e.data) == null ? void 0 : u.count) ?? 1
|
|
31262
|
+
);
|
|
31263
|
+
return;
|
|
31264
|
+
}
|
|
31194
31265
|
const { id: r, success: s, data: i, error: a } = e, o = this.pendingRequests.get(r);
|
|
31195
31266
|
o ? (this.pendingRequests.delete(r), this.inFlightPerWorker[n] = Math.max(
|
|
31196
31267
|
0,
|
|
@@ -31302,7 +31373,7 @@ class X0 {
|
|
|
31302
31373
|
* Syncs the default font fallback chain to all workers.
|
|
31303
31374
|
*/
|
|
31304
31375
|
async setDefaultFonts(e, n) {
|
|
31305
|
-
|
|
31376
|
+
$.instance.setDefaultFonts(e), $.instance.setSymbolFonts(n), await this.sendMessageToAllWorkers({
|
|
31306
31377
|
type: "setDefaultFonts",
|
|
31307
31378
|
data: {
|
|
31308
31379
|
fonts: [...e],
|
|
@@ -31314,7 +31385,7 @@ class X0 {
|
|
|
31314
31385
|
* Mirrors {@link FontManager.lazyFontLoading} into every worker isolate.
|
|
31315
31386
|
*/
|
|
31316
31387
|
async setLazyFontLoading(e) {
|
|
31317
|
-
|
|
31388
|
+
$.instance.lazyFontLoading = e, await this.sendMessageToAllWorkers({
|
|
31318
31389
|
type: "setLazyFontLoading",
|
|
31319
31390
|
data: { enabled: e }
|
|
31320
31391
|
});
|
|
@@ -31323,11 +31394,46 @@ class X0 {
|
|
|
31323
31394
|
* Mirrors {@link FontManager.awaitFontsBeforeDraw} into every worker isolate.
|
|
31324
31395
|
*/
|
|
31325
31396
|
async setAwaitFontsBeforeDraw(e) {
|
|
31326
|
-
|
|
31397
|
+
$.instance.awaitFontsBeforeDraw = e, await this.sendMessageToAllWorkers({
|
|
31327
31398
|
type: "setAwaitFontsBeforeDraw",
|
|
31328
31399
|
data: { enabled: e }
|
|
31329
31400
|
});
|
|
31330
31401
|
}
|
|
31402
|
+
/**
|
|
31403
|
+
* Replaces session-scoped {@link FontManager.missedFonts} on every worker,
|
|
31404
|
+
* then adopts the intersection of worker-filtered maps on the main thread.
|
|
31405
|
+
*
|
|
31406
|
+
* Workers drop faces they have already loaded; in worker-only mode the main
|
|
31407
|
+
* isolate often has an empty {@link FontManager.loadedFontMap}, so the
|
|
31408
|
+
* authoritative "still missing" set comes from the pool responses.
|
|
31409
|
+
*/
|
|
31410
|
+
async replaceMissedFonts(e) {
|
|
31411
|
+
var s;
|
|
31412
|
+
const n = await this.sendMessageToAllWorkers({
|
|
31413
|
+
type: "setMissedFonts",
|
|
31414
|
+
data: { missedFonts: { ...e ?? {} } }
|
|
31415
|
+
});
|
|
31416
|
+
if (n.length === 0) {
|
|
31417
|
+
$.instance.replaceMissedFonts(e ?? {});
|
|
31418
|
+
return;
|
|
31419
|
+
}
|
|
31420
|
+
const r = {};
|
|
31421
|
+
for (const i of Object.keys(((s = n[0]) == null ? void 0 : s.missedFonts) ?? {}))
|
|
31422
|
+
n.every((a) => {
|
|
31423
|
+
var o;
|
|
31424
|
+
return (((o = a == null ? void 0 : a.missedFonts) == null ? void 0 : o[i]) ?? 0) > 0;
|
|
31425
|
+
}) && (r[i] = Math.max(
|
|
31426
|
+
...n.map((a) => {
|
|
31427
|
+
var o;
|
|
31428
|
+
return ((o = a == null ? void 0 : a.missedFonts) == null ? void 0 : o[i]) ?? 0;
|
|
31429
|
+
})
|
|
31430
|
+
));
|
|
31431
|
+
$.instance.replaceMissedFonts(r);
|
|
31432
|
+
}
|
|
31433
|
+
/** Clears {@link FontManager.missedFonts} on the main thread and every worker. */
|
|
31434
|
+
async clearMissedFonts() {
|
|
31435
|
+
await this.replaceMissedFonts({});
|
|
31436
|
+
}
|
|
31331
31437
|
/**
|
|
31332
31438
|
* Render MText in one worker and return serialized data asynchronously.
|
|
31333
31439
|
*/
|
|
@@ -31563,7 +31669,7 @@ class X0 {
|
|
|
31563
31669
|
}
|
|
31564
31670
|
class K0 {
|
|
31565
31671
|
constructor() {
|
|
31566
|
-
this.fontManager =
|
|
31672
|
+
this.fontManager = $.instance, this.defaultStyleManager = new Eo(), this.isInitialized = !1;
|
|
31567
31673
|
}
|
|
31568
31674
|
/**
|
|
31569
31675
|
* Used to manage materials used by texts
|
|
@@ -31652,7 +31758,7 @@ class K0 {
|
|
|
31652
31758
|
* Estimates memory used by fonts and materials in the main-thread isolate.
|
|
31653
31759
|
*/
|
|
31654
31760
|
estimateMemoryUsage() {
|
|
31655
|
-
return
|
|
31761
|
+
return Fo(this.fontManager, {
|
|
31656
31762
|
id: "main",
|
|
31657
31763
|
styleManager: this.defaultStyleManager
|
|
31658
31764
|
});
|
|
@@ -31680,12 +31786,12 @@ class r1 {
|
|
|
31680
31786
|
async activateWebWorkerRenderer() {
|
|
31681
31787
|
const e = this.ensureWebWorkerRenderer();
|
|
31682
31788
|
this.webWorkerConfigured || (await e.setDefaultFonts(
|
|
31683
|
-
[
|
|
31684
|
-
[
|
|
31789
|
+
[...$.instance.defaultFonts],
|
|
31790
|
+
[...$.instance.symbolFonts]
|
|
31685
31791
|
), this.webWorkerConfigured = !0);
|
|
31686
|
-
const n =
|
|
31792
|
+
const n = $.instance.lazyFontLoading;
|
|
31687
31793
|
this.workerLazyFontLoading !== n && (await e.setLazyFontLoading(n), this.workerLazyFontLoading = n);
|
|
31688
|
-
const r =
|
|
31794
|
+
const r = $.instance.awaitFontsBeforeDraw;
|
|
31689
31795
|
return this.workerAwaitFontsBeforeDraw !== r && (await e.setAwaitFontsBeforeDraw(r), this.workerAwaitFontsBeforeDraw = r), e;
|
|
31690
31796
|
}
|
|
31691
31797
|
/**
|
|
@@ -31763,9 +31869,9 @@ class r1 {
|
|
|
31763
31869
|
* Sets the default font fallback chain on the active renderer and workers.
|
|
31764
31870
|
*/
|
|
31765
31871
|
async setDefaultFonts(e) {
|
|
31766
|
-
|
|
31767
|
-
[
|
|
31768
|
-
[
|
|
31872
|
+
$.instance.setDefaultFonts(e), this.webWorkerRenderer && (await this.webWorkerRenderer.setDefaultFonts(
|
|
31873
|
+
[...$.instance.defaultFonts],
|
|
31874
|
+
[...$.instance.symbolFonts]
|
|
31769
31875
|
), this.webWorkerConfigured = !0);
|
|
31770
31876
|
}
|
|
31771
31877
|
/**
|
|
@@ -31773,26 +31879,42 @@ class r1 {
|
|
|
31773
31879
|
* existing worker pool.
|
|
31774
31880
|
*/
|
|
31775
31881
|
async setLazyFontLoading(e) {
|
|
31776
|
-
|
|
31882
|
+
$.instance.lazyFontLoading = e, this.webWorkerRenderer && (await this.webWorkerRenderer.setLazyFontLoading(e), this.workerLazyFontLoading = e);
|
|
31777
31883
|
}
|
|
31778
31884
|
/**
|
|
31779
31885
|
* Mirrors {@link FontManager.awaitFontsBeforeDraw} onto the main thread and
|
|
31780
31886
|
* any existing worker pool.
|
|
31781
31887
|
*/
|
|
31782
31888
|
async setAwaitFontsBeforeDraw(e) {
|
|
31783
|
-
|
|
31889
|
+
$.instance.awaitFontsBeforeDraw = e, this.webWorkerRenderer && (await this.webWorkerRenderer.setAwaitFontsBeforeDraw(e), this.workerAwaitFontsBeforeDraw = e);
|
|
31890
|
+
}
|
|
31891
|
+
/**
|
|
31892
|
+
* Replaces session-scoped missed-font bookkeeping on the main thread and workers.
|
|
31893
|
+
* When a worker pool is active, {@link WebWorkerRenderer.replaceMissedFonts}
|
|
31894
|
+
* owns the final main-thread map (intersection of worker-filtered results).
|
|
31895
|
+
*/
|
|
31896
|
+
async replaceMissedFonts(e) {
|
|
31897
|
+
if (this.webWorkerRenderer) {
|
|
31898
|
+
await this.webWorkerRenderer.replaceMissedFonts(e);
|
|
31899
|
+
return;
|
|
31900
|
+
}
|
|
31901
|
+
$.instance.replaceMissedFonts(e);
|
|
31902
|
+
}
|
|
31903
|
+
/** Clears session-scoped missed-font bookkeeping on the main thread and workers. */
|
|
31904
|
+
async clearMissedFonts() {
|
|
31905
|
+
await this.replaceMissedFonts({});
|
|
31784
31906
|
}
|
|
31785
31907
|
/**
|
|
31786
31908
|
* Returns font names for a predefined default-font preset.
|
|
31787
31909
|
*/
|
|
31788
31910
|
getDefaultFontsPreset(e) {
|
|
31789
|
-
return
|
|
31911
|
+
return $.instance.getDefaultFontsPreset(e);
|
|
31790
31912
|
}
|
|
31791
31913
|
/**
|
|
31792
31914
|
* Returns symbol-font names for a predefined preset.
|
|
31793
31915
|
*/
|
|
31794
31916
|
getSymbolFontsPreset(e) {
|
|
31795
|
-
return
|
|
31917
|
+
return $.instance.getSymbolFontsPreset(e);
|
|
31796
31918
|
}
|
|
31797
31919
|
/**
|
|
31798
31920
|
* Load fonts using the current mode
|
|
@@ -31819,7 +31941,7 @@ class r1 {
|
|
|
31819
31941
|
* the JS heap.
|
|
31820
31942
|
*/
|
|
31821
31943
|
async estimateMemoryUsage() {
|
|
31822
|
-
const e =
|
|
31944
|
+
const e = Fo($.instance, {
|
|
31823
31945
|
id: "main",
|
|
31824
31946
|
styleManager: this.mainThreadRenderer.styleManager
|
|
31825
31947
|
}), n = this.webWorkerRenderer ? await this.webWorkerRenderer.estimateMemoryUsage() : [];
|
|
@@ -31848,7 +31970,7 @@ class r1 {
|
|
|
31848
31970
|
* with the web worker renderer.
|
|
31849
31971
|
*/
|
|
31850
31972
|
async cacheFont(e, n, r, s) {
|
|
31851
|
-
return
|
|
31973
|
+
return $.instance.cacheFont(e, n, r, s);
|
|
31852
31974
|
}
|
|
31853
31975
|
/**
|
|
31854
31976
|
* Terminate web workers and release their memory.
|
|
@@ -31878,15 +32000,15 @@ export {
|
|
|
31878
32000
|
v0 as DefaultFontLoader,
|
|
31879
32001
|
gs as EventManager,
|
|
31880
32002
|
Ke as FontFactory,
|
|
31881
|
-
|
|
31882
|
-
|
|
32003
|
+
$ as FontManager,
|
|
32004
|
+
M0 as LINE_SPACING_SCALE_FACTOR,
|
|
31883
32005
|
vc as MATERIAL_ESTIMATED_BYTES,
|
|
31884
32006
|
N0 as MAX_REASONABLE_MTEXT_WIDTH_CONTENT_EXCESS,
|
|
31885
32007
|
P0 as MAX_REASONABLE_MTEXT_WIDTH_HEIGHT_RATIO,
|
|
31886
32008
|
wc as MESH_PARSED_FONT_OVERHEAD,
|
|
31887
32009
|
_0 as MIN_REASONABLE_MTEXT_WIDTH_HEIGHT_RATIO,
|
|
31888
32010
|
tn as MText,
|
|
31889
|
-
|
|
32011
|
+
Q as MTextAttachmentPoint,
|
|
31890
32012
|
bt as MTextColor,
|
|
31891
32013
|
ln as MTextContext,
|
|
31892
32014
|
Ge as MTextFlowDirection,
|
|
@@ -31903,11 +32025,11 @@ export {
|
|
|
31903
32025
|
Yi as Shape,
|
|
31904
32026
|
ac as ShxParserFont,
|
|
31905
32027
|
xr as TextScanner,
|
|
31906
|
-
|
|
32028
|
+
ee as TokenType,
|
|
31907
32029
|
r1 as UnifiedRenderer,
|
|
31908
32030
|
X0 as WebWorkerRenderer,
|
|
31909
32031
|
B0 as buildWorkerMaterialColorSettings,
|
|
31910
|
-
|
|
32032
|
+
Fo as collectIsolateMemoryStats,
|
|
31911
32033
|
Ie as createDefaultColorSettings,
|
|
31912
32034
|
R0 as deserializeMTextColor,
|
|
31913
32035
|
pa as emptyMaterialStats,
|
|
@@ -31915,7 +32037,7 @@ export {
|
|
|
31915
32037
|
na as estimateGeometryBytes,
|
|
31916
32038
|
Gi as estimateMTextWrapWidth,
|
|
31917
32039
|
Sc as estimateMaterialBytes,
|
|
31918
|
-
|
|
32040
|
+
Mo as estimateStringBytes,
|
|
31919
32041
|
Le as formatBytes,
|
|
31920
32042
|
J0 as formatMemoryUsageReport,
|
|
31921
32043
|
ta as getColorByIndex,
|
|
@@ -31924,10 +32046,10 @@ export {
|
|
|
31924
32046
|
ra as getSourceByteLength,
|
|
31925
32047
|
t1 as hasInlineFormattingCodes,
|
|
31926
32048
|
Q0 as int2rgb,
|
|
31927
|
-
|
|
32049
|
+
ks as isDefaultFontsPreset,
|
|
31928
32050
|
w0 as readJsHeapStats,
|
|
31929
32051
|
Kt as resolveMTextColor,
|
|
31930
32052
|
Hi as resolveMTextWrapWidth,
|
|
31931
|
-
|
|
32053
|
+
F0 as rgb2int,
|
|
31932
32054
|
n1 as serializeMTextColor
|
|
31933
32055
|
};
|