@mlightcad/mtext-renderer 0.6.0 → 0.6.1
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 +171 -171
- package/dist/index.umd.cjs +3 -3
- package/lib/worker/unifiedRenderer.d.ts +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -129,7 +129,7 @@ function Ua() {
|
|
|
129
129
|
IDBCursor.prototype.continuePrimaryKey
|
|
130
130
|
]);
|
|
131
131
|
}
|
|
132
|
-
const
|
|
132
|
+
const Wt = /* @__PURE__ */ new WeakMap(), kt = /* @__PURE__ */ new WeakMap(), yt = /* @__PURE__ */ new WeakMap();
|
|
133
133
|
function La(t) {
|
|
134
134
|
const e = new Promise((r, n) => {
|
|
135
135
|
const a = () => {
|
|
@@ -144,7 +144,7 @@ function La(t) {
|
|
|
144
144
|
return yt.set(e, t), e;
|
|
145
145
|
}
|
|
146
146
|
function Ra(t) {
|
|
147
|
-
if (
|
|
147
|
+
if (Wt.has(t))
|
|
148
148
|
return;
|
|
149
149
|
const e = new Promise((r, n) => {
|
|
150
150
|
const a = () => {
|
|
@@ -156,13 +156,13 @@ function Ra(t) {
|
|
|
156
156
|
};
|
|
157
157
|
t.addEventListener("complete", s), t.addEventListener("error", i), t.addEventListener("abort", i);
|
|
158
158
|
});
|
|
159
|
-
|
|
159
|
+
Wt.set(t, e);
|
|
160
160
|
}
|
|
161
|
-
let
|
|
161
|
+
let zt = {
|
|
162
162
|
get(t, e, r) {
|
|
163
163
|
if (t instanceof IDBTransaction) {
|
|
164
164
|
if (e === "done")
|
|
165
|
-
return
|
|
165
|
+
return Wt.get(t);
|
|
166
166
|
if (e === "store")
|
|
167
167
|
return r.objectStoreNames[1] ? void 0 : r.objectStore(r.objectStoreNames[0]);
|
|
168
168
|
}
|
|
@@ -176,24 +176,24 @@ let Wt = {
|
|
|
176
176
|
}
|
|
177
177
|
};
|
|
178
178
|
function wn(t) {
|
|
179
|
-
|
|
179
|
+
zt = t(zt);
|
|
180
180
|
}
|
|
181
|
-
function
|
|
181
|
+
function Aa(t) {
|
|
182
182
|
return Ua().includes(t) ? function(...e) {
|
|
183
183
|
return t.apply(Vt(this), e), Re(this.request);
|
|
184
184
|
} : function(...e) {
|
|
185
185
|
return Re(t.apply(Vt(this), e));
|
|
186
186
|
};
|
|
187
187
|
}
|
|
188
|
-
function
|
|
189
|
-
return typeof t == "function" ?
|
|
188
|
+
function Ma(t) {
|
|
189
|
+
return typeof t == "function" ? Aa(t) : (t instanceof IDBTransaction && Ra(t), Ht(t, Oa()) ? new Proxy(t, zt) : t);
|
|
190
190
|
}
|
|
191
191
|
function Re(t) {
|
|
192
192
|
if (t instanceof IDBRequest)
|
|
193
193
|
return La(t);
|
|
194
194
|
if (kt.has(t))
|
|
195
195
|
return kt.get(t);
|
|
196
|
-
const e =
|
|
196
|
+
const e = Ma(t);
|
|
197
197
|
return e !== t && (kt.set(t, e), yt.set(e, t)), e;
|
|
198
198
|
}
|
|
199
199
|
const Vt = (t) => yt.get(t);
|
|
@@ -401,7 +401,7 @@ const Be = {
|
|
|
401
401
|
}
|
|
402
402
|
};
|
|
403
403
|
ee.DATABASE_NAME = "mlightcad", ee.DATABASE_VERSION = Tt[Tt.length - 1].version;
|
|
404
|
-
let
|
|
404
|
+
let We = ee;
|
|
405
405
|
const _a = (t) => t.substring(t.lastIndexOf(".") + 1), En = (t) => t.split("/").pop(), wr = (t) => {
|
|
406
406
|
const e = En(t);
|
|
407
407
|
if (e) {
|
|
@@ -667,8 +667,8 @@ const _a = (t) => t.substring(t.lastIndexOf(".") + 1), En = (t) => t.split("/").
|
|
|
667
667
|
14079702,
|
|
668
668
|
16777215,
|
|
669
669
|
0
|
|
670
|
-
],
|
|
671
|
-
let
|
|
670
|
+
], Wa = (t) => Ha[t];
|
|
671
|
+
let za = class {
|
|
672
672
|
constructor(e) {
|
|
673
673
|
this.isFont = !0, this.type = "Font", this.data = e;
|
|
674
674
|
}
|
|
@@ -756,7 +756,7 @@ function Ve() {
|
|
|
756
756
|
function Xa(t, e) {
|
|
757
757
|
this.source = t, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = e, this.destLen = 0, this.ltree = new Ve(), this.dtree = new Ve();
|
|
758
758
|
}
|
|
759
|
-
var Un = new Ve(), Ln = new Ve(), ar = new Uint8Array(30), sr = new Uint16Array(30), Rn = new Uint8Array(30),
|
|
759
|
+
var Un = new Ve(), Ln = new Ve(), ar = new Uint8Array(30), sr = new Uint16Array(30), Rn = new Uint8Array(30), An = new Uint16Array(30), Ya = new Uint8Array([
|
|
760
760
|
16,
|
|
761
761
|
17,
|
|
762
762
|
18,
|
|
@@ -777,7 +777,7 @@ var Un = new Ve(), Ln = new Ve(), ar = new Uint8Array(30), sr = new Uint16Array(
|
|
|
777
777
|
1,
|
|
778
778
|
15
|
|
779
779
|
]), Cr = new Ve(), ce = new Uint8Array(320);
|
|
780
|
-
function
|
|
780
|
+
function Mn(t, e, r, n) {
|
|
781
781
|
var a, s;
|
|
782
782
|
for (a = 0; a < r; ++a)
|
|
783
783
|
t[a] = 0;
|
|
@@ -877,7 +877,7 @@ function Or(t, e, r) {
|
|
|
877
877
|
t.dest[t.destLen++] = n;
|
|
878
878
|
else {
|
|
879
879
|
var a, s, i, o;
|
|
880
|
-
for (n -= 257, a = fe(t, ar[n], sr[n]), s = Xt(t, r), i = t.destLen - fe(t, Rn[s],
|
|
880
|
+
for (n -= 257, a = fe(t, ar[n], sr[n]), s = Xt(t, r), i = t.destLen - fe(t, Rn[s], An[s]), o = i; o < i + a; ++o)
|
|
881
881
|
t.dest[t.destLen++] = t.dest[o];
|
|
882
882
|
}
|
|
883
883
|
}
|
|
@@ -913,12 +913,12 @@ function $a(t, e) {
|
|
|
913
913
|
return r.destLen < r.dest.length ? typeof r.dest.slice == "function" ? r.dest.slice(0, r.destLen) : r.dest.subarray(0, r.destLen) : r.dest;
|
|
914
914
|
}
|
|
915
915
|
Za(Un, Ln);
|
|
916
|
-
|
|
917
|
-
|
|
916
|
+
Mn(ar, sr, 4, 3);
|
|
917
|
+
Mn(Rn, An, 2, 1);
|
|
918
918
|
ar[28] = 0;
|
|
919
919
|
sr[28] = 258;
|
|
920
920
|
var Ja = $a;
|
|
921
|
-
function
|
|
921
|
+
function Me(t, e, r, n, a) {
|
|
922
922
|
return Math.pow(1 - a, 3) * t + 3 * Math.pow(1 - a, 2) * a * e + 3 * (1 - a) * Math.pow(a, 2) * r + Math.pow(a, 3) * n;
|
|
923
923
|
}
|
|
924
924
|
function we() {
|
|
@@ -945,15 +945,15 @@ we.prototype.addBezier = function(t, e, r, n, a, s, i, o) {
|
|
|
945
945
|
if (p === 0)
|
|
946
946
|
continue;
|
|
947
947
|
var m = -v / p;
|
|
948
|
-
0 < m && m < 1 && (c === 0 && this.addX(
|
|
948
|
+
0 < m && m < 1 && (c === 0 && this.addX(Me(u[c], l[c], h[c], f[c], m)), c === 1 && this.addY(Me(u[c], l[c], h[c], f[c], m)));
|
|
949
949
|
continue;
|
|
950
950
|
}
|
|
951
951
|
var y = Math.pow(p, 2) - 4 * v * d;
|
|
952
952
|
if (!(y < 0)) {
|
|
953
953
|
var b = (-p + Math.sqrt(y)) / (2 * d);
|
|
954
|
-
0 < b && b < 1 && (c === 0 && this.addX(
|
|
954
|
+
0 < b && b < 1 && (c === 0 && this.addX(Me(u[c], l[c], h[c], f[c], b)), c === 1 && this.addY(Me(u[c], l[c], h[c], f[c], b)));
|
|
955
955
|
var x = (-p - Math.sqrt(y)) / (2 * d);
|
|
956
|
-
0 < x && x < 1 && (c === 0 && this.addX(
|
|
956
|
+
0 < x && x < 1 && (c === 0 && this.addX(Me(u[c], l[c], h[c], f[c], x)), c === 1 && this.addY(Me(u[c], l[c], h[c], f[c], x)));
|
|
957
957
|
}
|
|
958
958
|
}
|
|
959
959
|
};
|
|
@@ -1570,7 +1570,7 @@ var F = {
|
|
|
1570
1570
|
tableList: jt,
|
|
1571
1571
|
recordList: Xe
|
|
1572
1572
|
};
|
|
1573
|
-
function
|
|
1573
|
+
function Ar(t, e) {
|
|
1574
1574
|
return t.getUint8(e);
|
|
1575
1575
|
}
|
|
1576
1576
|
function dt(t, e) {
|
|
@@ -1853,7 +1853,7 @@ g.uLongList = g.prototype.parseULongList;
|
|
|
1853
1853
|
g.struct = g.prototype.parseStruct;
|
|
1854
1854
|
g.coverage = g.prototype.parseCoverage;
|
|
1855
1855
|
g.classDef = g.prototype.parseClassDef;
|
|
1856
|
-
var
|
|
1856
|
+
var Mr = {
|
|
1857
1857
|
reserved: g.uShort,
|
|
1858
1858
|
reqFeatureIndex: g.uShort,
|
|
1859
1859
|
featureIndexes: g.uShortList
|
|
@@ -1862,10 +1862,10 @@ g.prototype.parseScriptList = function() {
|
|
|
1862
1862
|
return this.parsePointer(g.recordList({
|
|
1863
1863
|
tag: g.tag,
|
|
1864
1864
|
script: g.pointer({
|
|
1865
|
-
defaultLangSys: g.pointer(
|
|
1865
|
+
defaultLangSys: g.pointer(Mr),
|
|
1866
1866
|
langSysRecords: g.recordList({
|
|
1867
1867
|
tag: g.tag,
|
|
1868
|
-
langSys: g.pointer(
|
|
1868
|
+
langSys: g.pointer(Mr)
|
|
1869
1869
|
})
|
|
1870
1870
|
})
|
|
1871
1871
|
})) || [];
|
|
@@ -1904,8 +1904,8 @@ g.prototype.parseFeatureVariationsList = function() {
|
|
|
1904
1904
|
}) || [];
|
|
1905
1905
|
};
|
|
1906
1906
|
var E = {
|
|
1907
|
-
getByte:
|
|
1908
|
-
getCard8:
|
|
1907
|
+
getByte: Ar,
|
|
1908
|
+
getCard8: Ar,
|
|
1909
1909
|
getUShort: dt,
|
|
1910
1910
|
getCard16: dt,
|
|
1911
1911
|
getShort: as,
|
|
@@ -3528,7 +3528,7 @@ function _n(t, e, r) {
|
|
|
3528
3528
|
}
|
|
3529
3529
|
return Ls(a);
|
|
3530
3530
|
}
|
|
3531
|
-
function
|
|
3531
|
+
function ze(t, e) {
|
|
3532
3532
|
return e <= 390 ? e = ut[e] : e = t[e - 391], e;
|
|
3533
3533
|
}
|
|
3534
3534
|
function Hn(t, e, r) {
|
|
@@ -3538,10 +3538,10 @@ function Hn(t, e, r) {
|
|
|
3538
3538
|
var o = [];
|
|
3539
3539
|
o.length = i.type.length;
|
|
3540
3540
|
for (var u = 0; u < i.type.length; u++)
|
|
3541
|
-
a = t[i.op] !== void 0 ? t[i.op][u] : void 0, a === void 0 && (a = i.value !== void 0 && i.value[u] !== void 0 ? i.value[u] : null), i.type[u] === "SID" && (a =
|
|
3541
|
+
a = t[i.op] !== void 0 ? t[i.op][u] : void 0, a === void 0 && (a = i.value !== void 0 && i.value[u] !== void 0 ? i.value[u] : null), i.type[u] === "SID" && (a = ze(r, a)), o[u] = a;
|
|
3542
3542
|
n[i.name] = o;
|
|
3543
3543
|
} else
|
|
3544
|
-
a = t[i.op], a === void 0 && (a = i.value !== void 0 ? i.value : null), i.type === "SID" && (a =
|
|
3544
|
+
a = t[i.op], a === void 0 && (a = i.value !== void 0 ? i.value : null), i.type === "SID" && (a = ze(r, a)), n[i.name] = a;
|
|
3545
3545
|
}
|
|
3546
3546
|
return n;
|
|
3547
3547
|
}
|
|
@@ -3549,7 +3549,7 @@ function Rs(t, e) {
|
|
|
3549
3549
|
var r = {};
|
|
3550
3550
|
return r.formatMajor = E.getCard8(t, e), r.formatMinor = E.getCard8(t, e + 1), r.size = E.getCard8(t, e + 2), r.offsetSize = E.getCard8(t, e + 3), r.startOffset = e, r.endOffset = e + 4, r;
|
|
3551
3551
|
}
|
|
3552
|
-
var
|
|
3552
|
+
var Wn = [
|
|
3553
3553
|
{ name: "version", op: 0, type: "SID" },
|
|
3554
3554
|
{ name: "notice", op: 1, type: "SID" },
|
|
3555
3555
|
{ name: "copyright", op: 1200, type: "SID" },
|
|
@@ -3585,22 +3585,22 @@ var zn = [
|
|
|
3585
3585
|
{ name: "fdArray", op: 1236, type: "offset" },
|
|
3586
3586
|
{ name: "fdSelect", op: 1237, type: "offset" },
|
|
3587
3587
|
{ name: "fontName", op: 1238, type: "SID" }
|
|
3588
|
-
],
|
|
3588
|
+
], zn = [
|
|
3589
3589
|
{ name: "subrs", op: 19, type: "offset", value: 0 },
|
|
3590
3590
|
{ name: "defaultWidthX", op: 20, type: "number", value: 0 },
|
|
3591
3591
|
{ name: "nominalWidthX", op: 21, type: "number", value: 0 }
|
|
3592
3592
|
];
|
|
3593
|
-
function
|
|
3593
|
+
function As(t, e) {
|
|
3594
3594
|
var r = _n(t, 0, t.byteLength);
|
|
3595
|
-
return Hn(r,
|
|
3595
|
+
return Hn(r, Wn, e);
|
|
3596
3596
|
}
|
|
3597
3597
|
function Vn(t, e, r, n) {
|
|
3598
3598
|
var a = _n(t, e, r);
|
|
3599
|
-
return Hn(a,
|
|
3599
|
+
return Hn(a, zn, n);
|
|
3600
3600
|
}
|
|
3601
3601
|
function Br(t, e, r, n) {
|
|
3602
3602
|
for (var a = [], s = 0; s < r.length; s += 1) {
|
|
3603
|
-
var i = new DataView(new Uint8Array(r[s]).buffer), o =
|
|
3603
|
+
var i = new DataView(new Uint8Array(r[s]).buffer), o = As(i, n);
|
|
3604
3604
|
o._subrs = [], o._subrsBias = 0, o._defaultWidthX = 0, o._nominalWidthX = 0;
|
|
3605
3605
|
var u = o.private[0], l = o.private[1];
|
|
3606
3606
|
if (u !== 0 && l !== 0) {
|
|
@@ -3615,24 +3615,24 @@ function Br(t, e, r, n) {
|
|
|
3615
3615
|
}
|
|
3616
3616
|
return a;
|
|
3617
3617
|
}
|
|
3618
|
-
function
|
|
3618
|
+
function Ms(t, e, r, n) {
|
|
3619
3619
|
var a, s, i = new E.Parser(t, e);
|
|
3620
3620
|
r -= 1;
|
|
3621
3621
|
var o = [".notdef"], u = i.parseCard8();
|
|
3622
3622
|
if (u === 0)
|
|
3623
3623
|
for (var l = 0; l < r; l += 1)
|
|
3624
|
-
a = i.parseSID(), o.push(
|
|
3624
|
+
a = i.parseSID(), o.push(ze(n, a));
|
|
3625
3625
|
else if (u === 1)
|
|
3626
3626
|
for (; o.length <= r; ) {
|
|
3627
3627
|
a = i.parseSID(), s = i.parseCard8();
|
|
3628
3628
|
for (var h = 0; h <= s; h += 1)
|
|
3629
|
-
o.push(
|
|
3629
|
+
o.push(ze(n, a)), a += 1;
|
|
3630
3630
|
}
|
|
3631
3631
|
else if (u === 2)
|
|
3632
3632
|
for (; o.length <= r; ) {
|
|
3633
3633
|
a = i.parseSID(), s = i.parseCard16();
|
|
3634
3634
|
for (var f = 0; f <= s; f += 1)
|
|
3635
|
-
o.push(
|
|
3635
|
+
o.push(ze(n, a)), a += 1;
|
|
3636
3636
|
}
|
|
3637
3637
|
else
|
|
3638
3638
|
throw new Error("Unknown charset format " + u);
|
|
@@ -3661,22 +3661,22 @@ function Pr(t, e, r) {
|
|
|
3661
3661
|
} else
|
|
3662
3662
|
d = t.tables.cff.topDict._subrs, v = t.tables.cff.topDict._subrsBias, m = t.tables.cff.topDict._defaultWidthX, y = t.tables.cff.topDict._nominalWidthX;
|
|
3663
3663
|
var T = m;
|
|
3664
|
-
function S(w,
|
|
3665
|
-
f && o.closePath(), o.moveTo(w,
|
|
3664
|
+
function S(w, M) {
|
|
3665
|
+
f && o.closePath(), o.moveTo(w, M), f = !0;
|
|
3666
3666
|
}
|
|
3667
|
-
function
|
|
3667
|
+
function A() {
|
|
3668
3668
|
var w;
|
|
3669
3669
|
w = u.length % 2 !== 0, w && !h && (T = u.shift() + y), l += u.length >> 1, u.length = 0, h = !0;
|
|
3670
3670
|
}
|
|
3671
3671
|
function O(w) {
|
|
3672
|
-
for (var
|
|
3672
|
+
for (var M, N, K, $, Y, I, _, D, z, Z, q, Q, P = 0; P < w.length; ) {
|
|
3673
3673
|
var j = w[P];
|
|
3674
3674
|
switch (P += 1, j) {
|
|
3675
3675
|
case 1:
|
|
3676
|
-
|
|
3676
|
+
A();
|
|
3677
3677
|
break;
|
|
3678
3678
|
case 3:
|
|
3679
|
-
|
|
3679
|
+
A();
|
|
3680
3680
|
break;
|
|
3681
3681
|
case 4:
|
|
3682
3682
|
u.length > 1 && !h && (T = u.shift() + y, h = !0), p += u.pop(), S(c, p);
|
|
@@ -3705,16 +3705,16 @@ function Pr(t, e, r) {
|
|
|
3705
3705
|
case 12:
|
|
3706
3706
|
switch (j = w[P], P += 1, j) {
|
|
3707
3707
|
case 35:
|
|
3708
|
-
n = c + u.shift(), a = p + u.shift(), s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i + u.shift(),
|
|
3708
|
+
n = c + u.shift(), a = p + u.shift(), s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i + u.shift(), z = _ + u.shift(), Z = D + u.shift(), q = z + u.shift(), Q = Z + u.shift(), c = q + u.shift(), p = Q + u.shift(), u.shift(), o.curveTo(n, a, s, i, _, D), o.curveTo(z, Z, q, Q, c, p);
|
|
3709
3709
|
break;
|
|
3710
3710
|
case 34:
|
|
3711
|
-
n = c + u.shift(), a = p, s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i,
|
|
3711
|
+
n = c + u.shift(), a = p, s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i, z = _ + u.shift(), Z = i, q = z + u.shift(), Q = p, c = q + u.shift(), o.curveTo(n, a, s, i, _, D), o.curveTo(z, Z, q, Q, c, p);
|
|
3712
3712
|
break;
|
|
3713
3713
|
case 36:
|
|
3714
|
-
n = c + u.shift(), a = p + u.shift(), s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i,
|
|
3714
|
+
n = c + u.shift(), a = p + u.shift(), s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i, z = _ + u.shift(), Z = i, q = z + u.shift(), Q = Z + u.shift(), c = q + u.shift(), o.curveTo(n, a, s, i, _, D), o.curveTo(z, Z, q, Q, c, p);
|
|
3715
3715
|
break;
|
|
3716
3716
|
case 37:
|
|
3717
|
-
n = c + u.shift(), a = p + u.shift(), s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i + u.shift(),
|
|
3717
|
+
n = c + u.shift(), a = p + u.shift(), s = n + u.shift(), i = a + u.shift(), _ = s + u.shift(), D = i + u.shift(), z = _ + u.shift(), Z = D + u.shift(), q = z + u.shift(), Q = Z + u.shift(), Math.abs(q - c) > Math.abs(Q - p) ? c = q + u.shift() : p = Q + u.shift(), o.curveTo(n, a, s, i, _, D), o.curveTo(z, Z, q, Q, c, p);
|
|
3718
3718
|
break;
|
|
3719
3719
|
default:
|
|
3720
3720
|
console.log("Glyph " + e.index + ": unknown operator 1200" + j), u.length = 0;
|
|
@@ -3724,11 +3724,11 @@ function Pr(t, e, r) {
|
|
|
3724
3724
|
u.length > 0 && !h && (T = u.shift() + y, h = !0), f && (o.closePath(), f = !1);
|
|
3725
3725
|
break;
|
|
3726
3726
|
case 18:
|
|
3727
|
-
|
|
3727
|
+
A();
|
|
3728
3728
|
break;
|
|
3729
3729
|
case 19:
|
|
3730
3730
|
case 20:
|
|
3731
|
-
|
|
3731
|
+
A(), P += l + 7 >> 3;
|
|
3732
3732
|
break;
|
|
3733
3733
|
case 21:
|
|
3734
3734
|
u.length > 2 && !h && (T = u.shift() + y, h = !0), p += u.pop(), c += u.pop(), S(c, p);
|
|
@@ -3737,7 +3737,7 @@ function Pr(t, e, r) {
|
|
|
3737
3737
|
u.length > 1 && !h && (T = u.shift() + y, h = !0), c += u.pop(), S(c, p);
|
|
3738
3738
|
break;
|
|
3739
3739
|
case 23:
|
|
3740
|
-
|
|
3740
|
+
A();
|
|
3741
3741
|
break;
|
|
3742
3742
|
case 24:
|
|
3743
3743
|
for (; u.length > 2; )
|
|
@@ -3758,7 +3758,7 @@ function Pr(t, e, r) {
|
|
|
3758
3758
|
n = c + u.shift(), a = p, s = n + u.shift(), i = a + u.shift(), c = s + u.shift(), p = i, o.curveTo(n, a, s, i, c, p);
|
|
3759
3759
|
break;
|
|
3760
3760
|
case 28:
|
|
3761
|
-
|
|
3761
|
+
M = w[P], N = w[P + 1], u.push((M << 24 | N << 16) >> 16), P += 2;
|
|
3762
3762
|
break;
|
|
3763
3763
|
case 29:
|
|
3764
3764
|
Y = u.pop() + t.gsubrsBias, I = t.gsubrs[Y], I && O(I);
|
|
@@ -3772,7 +3772,7 @@ function Pr(t, e, r) {
|
|
|
3772
3772
|
n = c, a = p + u.shift(), s = n + u.shift(), i = a + u.shift(), c = s + u.shift(), p = i + (u.length === 1 ? u.shift() : 0), o.curveTo(n, a, s, i, c, p);
|
|
3773
3773
|
break;
|
|
3774
3774
|
default:
|
|
3775
|
-
j < 32 ? console.log("Glyph " + e.index + ": unknown operator " + j) : j < 247 ? u.push(j - 139) : j < 251 ? (
|
|
3775
|
+
j < 32 ? console.log("Glyph " + e.index + ": unknown operator " + j) : j < 247 ? u.push(j - 139) : j < 251 ? (M = w[P], P += 1, u.push((j - 247) * 256 + M + 108)) : j < 255 ? (M = w[P], P += 1, u.push(-(j - 251) * 256 - M - 108)) : (M = w[P], N = w[P + 1], K = w[P + 2], $ = w[P + 3], P += 4, u.push((M << 24 | N << 16 | K << 8 | $) / 65536));
|
|
3776
3776
|
}
|
|
3777
3777
|
}
|
|
3778
3778
|
}
|
|
@@ -3829,7 +3829,7 @@ function Is(t, e, r, n) {
|
|
|
3829
3829
|
r.subrs = [], r.subrsBias = 0;
|
|
3830
3830
|
var x;
|
|
3831
3831
|
n.lowMemory ? (x = Cs(t, e + h.charStrings), r.nGlyphs = x.offsets.length) : (x = be(t, e + h.charStrings), r.nGlyphs = x.objects.length);
|
|
3832
|
-
var T =
|
|
3832
|
+
var T = Ms(t, e + h.charset, r.nGlyphs, o.objects);
|
|
3833
3833
|
if (h.encoding === 0 ? r.cffEncoding = new gt(vs, T) : h.encoding === 1 ? r.cffEncoding = new gt(ys, T) : r.cffEncoding = Bs(t, e + h.encoding, T), r.encoding = r.encoding || r.cffEncoding, r.glyphs = new ge.GlyphSet(r), n.lowMemory)
|
|
3834
3834
|
r._push = function(O) {
|
|
3835
3835
|
var w = Es(O, x.offsets, t, e + h.charStrings);
|
|
@@ -3837,8 +3837,8 @@ function Is(t, e, r, n) {
|
|
|
3837
3837
|
};
|
|
3838
3838
|
else
|
|
3839
3839
|
for (var S = 0; S < r.nGlyphs; S += 1) {
|
|
3840
|
-
var
|
|
3841
|
-
r.glyphs.push(S, ge.cffGlyphLoader(r, S, Pr,
|
|
3840
|
+
var A = x.objects[S];
|
|
3841
|
+
r.glyphs.push(S, ge.cffGlyphLoader(r, S, Pr, A));
|
|
3842
3842
|
}
|
|
3843
3843
|
}
|
|
3844
3844
|
function qn(t, e) {
|
|
@@ -3873,7 +3873,7 @@ function Ir(t, e) {
|
|
|
3873
3873
|
var r = new F.Record("Top DICT", [
|
|
3874
3874
|
{ name: "dict", type: "DICT", value: {} }
|
|
3875
3875
|
]);
|
|
3876
|
-
return r.dict = Xn(
|
|
3876
|
+
return r.dict = Xn(Wn, t, e), r;
|
|
3877
3877
|
}
|
|
3878
3878
|
function Dr(t) {
|
|
3879
3879
|
var e = new F.Record("Top DICT INDEX", [
|
|
@@ -3904,7 +3904,7 @@ function Hs(t, e) {
|
|
|
3904
3904
|
}
|
|
3905
3905
|
return r;
|
|
3906
3906
|
}
|
|
3907
|
-
function
|
|
3907
|
+
function Ws(t) {
|
|
3908
3908
|
var e = [], r = t.path;
|
|
3909
3909
|
e.push({ name: "width", type: "NUMBER", value: t.advanceWidth });
|
|
3910
3910
|
for (var n = 0, a = 0, s = 0; s < r.commands.length; s += 1) {
|
|
@@ -3932,11 +3932,11 @@ function zs(t) {
|
|
|
3932
3932
|
}
|
|
3933
3933
|
return e.push({ name: "endchar", type: "OP", value: 14 }), e;
|
|
3934
3934
|
}
|
|
3935
|
-
function
|
|
3935
|
+
function zs(t) {
|
|
3936
3936
|
for (var e = new F.Record("CharStrings INDEX", [
|
|
3937
3937
|
{ name: "charStrings", type: "INDEX", value: [] }
|
|
3938
3938
|
]), r = 0; r < t.length; r += 1) {
|
|
3939
|
-
var n = t.get(r), a =
|
|
3939
|
+
var n = t.get(r), a = Ws(n);
|
|
3940
3940
|
e.charStrings.push({ name: n.name, type: "CHARSTRING", value: a });
|
|
3941
3941
|
}
|
|
3942
3942
|
return e;
|
|
@@ -3945,7 +3945,7 @@ function Vs(t, e) {
|
|
|
3945
3945
|
var r = new F.Record("Private DICT", [
|
|
3946
3946
|
{ name: "dict", type: "DICT", value: {} }
|
|
3947
3947
|
]);
|
|
3948
|
-
return r.dict = Xn(
|
|
3948
|
+
return r.dict = Xn(zn, t, e), r;
|
|
3949
3949
|
}
|
|
3950
3950
|
function qs(t, e) {
|
|
3951
3951
|
for (var r = new F.Table("CFF ", [
|
|
@@ -3973,7 +3973,7 @@ function qs(t, e) {
|
|
|
3973
3973
|
var l = [];
|
|
3974
3974
|
r.header = Ds(), r.nameIndex = Gs([e.postScriptName]);
|
|
3975
3975
|
var h = Ir(a, l);
|
|
3976
|
-
r.topDictIndex = Dr(h), r.globalSubrIndex = _s(), r.charsets = Hs(i, l), r.charStringsIndex =
|
|
3976
|
+
r.topDictIndex = Dr(h), r.globalSubrIndex = _s(), r.charsets = Hs(i, l), r.charStringsIndex = zs(t), r.privateDict = Vs(s, l), r.stringIndex = Ns(l);
|
|
3977
3977
|
var f = r.header.sizeOf() + r.nameIndex.sizeOf() + r.topDictIndex.sizeOf() + r.stringIndex.sizeOf() + r.globalSubrIndex.sizeOf();
|
|
3978
3978
|
return a.charset = f, a.encoding = 0, a.charStrings = a.charset + r.charsets.sizeOf(), a.private[1] = a.charStrings + r.charStringsIndex.sizeOf(), h = Ir(a, l), r.topDictIndex = Dr(h), r;
|
|
3979
3979
|
}
|
|
@@ -4899,13 +4899,13 @@ function hi(t, e) {
|
|
|
4899
4899
|
T.length,
|
|
4900
4900
|
S
|
|
4901
4901
|
));
|
|
4902
|
-
var
|
|
4903
|
-
if (
|
|
4902
|
+
var A = l[d];
|
|
4903
|
+
if (A !== void 0) {
|
|
4904
4904
|
var O = k.UTF16(v), w = Nr(O, f);
|
|
4905
4905
|
h.push(Gr(
|
|
4906
4906
|
3,
|
|
4907
4907
|
1,
|
|
4908
|
-
|
|
4908
|
+
A,
|
|
4909
4909
|
r,
|
|
4910
4910
|
O.length,
|
|
4911
4911
|
w
|
|
@@ -4916,13 +4916,13 @@ function hi(t, e) {
|
|
|
4916
4916
|
h.sort(function(K, $) {
|
|
4917
4917
|
return K.platformID - $.platformID || K.encodingID - $.encodingID || K.languageID - $.languageID || K.nameID - $.nameID;
|
|
4918
4918
|
});
|
|
4919
|
-
for (var
|
|
4919
|
+
for (var M = new F.Table("name", [
|
|
4920
4920
|
{ name: "format", type: "USHORT", value: 0 },
|
|
4921
4921
|
{ name: "count", type: "USHORT", value: h.length },
|
|
4922
4922
|
{ name: "stringOffset", type: "USHORT", value: 6 + h.length * 12 }
|
|
4923
4923
|
]), N = 0; N < h.length; N++)
|
|
4924
|
-
|
|
4925
|
-
return
|
|
4924
|
+
M.fields.push({ name: "record_" + N, type: "RECORD", value: h[N] });
|
|
4925
|
+
return M.fields.push({ name: "strings", type: "LITERAL", value: f }), M;
|
|
4926
4926
|
}
|
|
4927
4927
|
var na = { parse: ui, make: hi }, $t = [
|
|
4928
4928
|
{ begin: 0, end: 127 },
|
|
@@ -5588,7 +5588,7 @@ function oa(t) {
|
|
|
5588
5588
|
return h.value.tag > f.value.tag ? 1 : -1;
|
|
5589
5589
|
}), e.fields = e.fields.concat(n), e.fields = e.fields.concat(a), e;
|
|
5590
5590
|
}
|
|
5591
|
-
function
|
|
5591
|
+
function Wr(t, e, r) {
|
|
5592
5592
|
for (var n = 0; n < e.length; n += 1) {
|
|
5593
5593
|
var a = t.charToGlyphIndex(e[n]);
|
|
5594
5594
|
if (a > 0) {
|
|
@@ -5655,7 +5655,7 @@ function Si(t) {
|
|
|
5655
5655
|
minRightSideBearing: x.minRightSideBearing,
|
|
5656
5656
|
xMaxExtent: x.maxLeftSideBearing + (x.xMax - x.xMin),
|
|
5657
5657
|
numberOfHMetrics: t.glyphs.length
|
|
5658
|
-
}),
|
|
5658
|
+
}), A = $n.make(t.glyphs.length), O = Jt.make(Object.assign({
|
|
5659
5659
|
xAvgCharWidth: Math.round(x.advanceWidthAvg),
|
|
5660
5660
|
usFirstCharIndex: u,
|
|
5661
5661
|
usLastCharIndex: l,
|
|
@@ -5674,19 +5674,19 @@ function Si(t) {
|
|
|
5674
5674
|
usWinDescent: Math.abs(x.yMin),
|
|
5675
5675
|
ulCodePageRange1: 1,
|
|
5676
5676
|
// FIXME: hard-code Latin 1 support for now
|
|
5677
|
-
sxHeight:
|
|
5678
|
-
sCapHeight:
|
|
5677
|
+
sxHeight: Wr(t, "xyvw", { yMax: Math.round(x.ascender / 2) }).yMax,
|
|
5678
|
+
sCapHeight: Wr(t, "HIKLEFJMNTZBDPRAGOQSUVWXY", x).yMax,
|
|
5679
5679
|
usDefaultChar: t.hasChar(" ") ? 32 : 0,
|
|
5680
5680
|
// Use space as the default character, if available.
|
|
5681
5681
|
usBreakChar: t.hasChar(" ") ? 32 : 0
|
|
5682
5682
|
// Use space as the break character, if available.
|
|
5683
|
-
}, t.tables.os2)), w = Kn.make(t.glyphs),
|
|
5683
|
+
}, t.tables.os2)), w = Kn.make(t.glyphs), M = In.make(t.glyphs), N = t.getEnglishName("fontFamily"), K = t.getEnglishName("fontSubfamily"), $ = N + " " + K, Y = t.getEnglishName("postScriptName");
|
|
5684
5684
|
Y || (Y = N.replace(/\s/g, "") + "-" + K);
|
|
5685
5685
|
var I = {};
|
|
5686
5686
|
for (var _ in t.names)
|
|
5687
5687
|
I[_] = t.names[_];
|
|
5688
5688
|
I.uniqueID || (I.uniqueID = { en: t.getEnglishName("manufacturer") + ":" + $ }), I.postScriptName || (I.postScriptName = { en: Y }), I.preferredFamily || (I.preferredFamily = t.names.fontFamily), I.preferredSubfamily || (I.preferredSubfamily = t.names.fontSubfamily);
|
|
5689
|
-
var D = [],
|
|
5689
|
+
var D = [], z = na.make(I, D), Z = D.length > 0 ? Qn.make(D) : void 0, q = aa.make(), Q = Yn.make(t.glyphs, {
|
|
5690
5690
|
version: t.getEnglishName("version"),
|
|
5691
5691
|
fullName: $,
|
|
5692
5692
|
familyName: N,
|
|
@@ -5694,7 +5694,7 @@ function Si(t) {
|
|
|
5694
5694
|
postScriptName: Y,
|
|
5695
5695
|
unitsPerEm: t.unitsPerEm,
|
|
5696
5696
|
fontBBox: [0, x.yMin, x.ascender, x.advanceWidthMax]
|
|
5697
|
-
}), P = t.metas && Object.keys(t.metas).length > 0 ? ia.make(t.metas) : void 0, j = [T, S,
|
|
5697
|
+
}), P = t.metas && Object.keys(t.metas).length > 0 ? ia.make(t.metas) : void 0, j = [T, S, A, O, z, M, q, Q, w];
|
|
5698
5698
|
Z && j.push(Z), t.tables.gsub && j.push(sa.make(t.tables.gsub)), P && j.push(P);
|
|
5699
5699
|
for (var bt = oa(j), ka = bt.encode(), Fa = lr(ka), St = bt.fields, mr = !1, tt = 0; tt < St.length; tt += 1)
|
|
5700
5700
|
if (St[tt].name === "head table") {
|
|
@@ -5715,7 +5715,7 @@ function Et(t, e) {
|
|
|
5715
5715
|
}
|
|
5716
5716
|
return -r - 1;
|
|
5717
5717
|
}
|
|
5718
|
-
function
|
|
5718
|
+
function zr(t, e) {
|
|
5719
5719
|
for (var r = 0, n = t.length - 1; r <= n; ) {
|
|
5720
5720
|
var a = r + n >>> 1, s = t[a];
|
|
5721
5721
|
if (s === e)
|
|
@@ -5759,7 +5759,7 @@ je.prototype = {
|
|
|
5759
5759
|
* @param {number} value
|
|
5760
5760
|
* @return {number}
|
|
5761
5761
|
*/
|
|
5762
|
-
binSearch:
|
|
5762
|
+
binSearch: zr,
|
|
5763
5763
|
/**
|
|
5764
5764
|
* Get or create the Layout table (GSUB, GPOS etc).
|
|
5765
5765
|
* @param {boolean} create - Whether to create a new one.
|
|
@@ -5928,7 +5928,7 @@ je.prototype = {
|
|
|
5928
5928
|
getCoverageIndex: function(t, e) {
|
|
5929
5929
|
switch (t.format) {
|
|
5930
5930
|
case 1:
|
|
5931
|
-
var r =
|
|
5931
|
+
var r = zr(t.glyphs, e);
|
|
5932
5932
|
return r >= 0 ? r : -1;
|
|
5933
5933
|
case 2:
|
|
5934
5934
|
var n = Vr(t.ranges, e);
|
|
@@ -6219,7 +6219,7 @@ function ua(t, e, r) {
|
|
|
6219
6219
|
}
|
|
6220
6220
|
if (a & 256) {
|
|
6221
6221
|
t.instructionLength = n.parseUShort(), t.instructions = [];
|
|
6222
|
-
for (var
|
|
6222
|
+
for (var A = 0; A < t.instructionLength; A += 1)
|
|
6223
6223
|
t.instructions.push(n.parseByte());
|
|
6224
6224
|
}
|
|
6225
6225
|
}
|
|
@@ -6311,7 +6311,7 @@ function Oi(t, e, r, n) {
|
|
|
6311
6311
|
function Ui(t, e, r, n, a) {
|
|
6312
6312
|
return a.lowMemory ? Oi(t, e, r, n) : Ei(t, e, r, n);
|
|
6313
6313
|
}
|
|
6314
|
-
var ca = { getPath: la, parse: Ui }, fa,
|
|
6314
|
+
var ca = { getPath: la, parse: Ui }, fa, Ae, pa, er;
|
|
6315
6315
|
function da(t) {
|
|
6316
6316
|
this.font = t, this.getCommands = function(e) {
|
|
6317
6317
|
return ca.getPath(e).commands;
|
|
@@ -6326,10 +6326,10 @@ function ga(t) {
|
|
|
6326
6326
|
function Ri(t) {
|
|
6327
6327
|
return Math.sign(t) * Math.round(Math.abs(t * 2)) / 2;
|
|
6328
6328
|
}
|
|
6329
|
-
function
|
|
6329
|
+
function Ai(t) {
|
|
6330
6330
|
return Math.sign(t) * (Math.round(Math.abs(t) + 0.5) - 0.5);
|
|
6331
6331
|
}
|
|
6332
|
-
function
|
|
6332
|
+
function Mi(t) {
|
|
6333
6333
|
return Math.sign(t) * Math.ceil(Math.abs(t));
|
|
6334
6334
|
}
|
|
6335
6335
|
function Bi(t) {
|
|
@@ -6537,7 +6537,7 @@ da.prototype.exec = function(t, e) {
|
|
|
6537
6537
|
if (!a) {
|
|
6538
6538
|
Se.prototype = Pi, a = this._fpgmState = new Se("fpgm", r.tables.fpgm), a.funcs = [], a.font = r, exports.DEBUG && (console.log("---EXEC FPGM---"), a.step = -1);
|
|
6539
6539
|
try {
|
|
6540
|
-
|
|
6540
|
+
Ae(a);
|
|
6541
6541
|
} catch (l) {
|
|
6542
6542
|
console.log("Hinting error in FPGM:" + l), this._errorState = 3;
|
|
6543
6543
|
return;
|
|
@@ -6552,7 +6552,7 @@ da.prototype.exec = function(t, e) {
|
|
|
6552
6552
|
n.cvt = [];
|
|
6553
6553
|
exports.DEBUG && (console.log("---EXEC PREP---"), n.step = -1);
|
|
6554
6554
|
try {
|
|
6555
|
-
|
|
6555
|
+
Ae(n);
|
|
6556
6556
|
} catch (l) {
|
|
6557
6557
|
this._errorState < 2 && console.log("Hinting error in PREP:" + l), this._errorState = 2;
|
|
6558
6558
|
}
|
|
@@ -6588,7 +6588,7 @@ pa = function(t, e) {
|
|
|
6588
6588
|
t.instructions && !o.inhibitGridFit && (o = new Se("glyf", t.instructions), o.gZone = o.z0 = o.z1 = o.z2 = i, o.contours = s, i.push(
|
|
6589
6589
|
new ye(0, 0),
|
|
6590
6590
|
new ye(Math.round(t.advanceWidth * r), 0)
|
|
6591
|
-
), exports.DEBUG && (console.log("---EXEC COMPOSITE---"), o.step = -1),
|
|
6591
|
+
), exports.DEBUG && (console.log("---EXEC COMPOSITE---"), o.step = -1), Ae(o), i.length -= 2);
|
|
6592
6592
|
}
|
|
6593
6593
|
return i;
|
|
6594
6594
|
};
|
|
@@ -6611,14 +6611,14 @@ er = function(t, e, r, n) {
|
|
|
6611
6611
|
if (i.push(
|
|
6612
6612
|
new ye(0, 0),
|
|
6613
6613
|
new ye(Math.round(t.advanceWidth * r), 0)
|
|
6614
|
-
),
|
|
6614
|
+
), Ae(e), i.length -= 2, exports.DEBUG) {
|
|
6615
6615
|
console.log("FINISHED GLYPH", e.stack);
|
|
6616
6616
|
for (var d = 0; d < s; d++)
|
|
6617
6617
|
console.log(d, i[d].x, i[d].y);
|
|
6618
6618
|
}
|
|
6619
6619
|
}
|
|
6620
6620
|
};
|
|
6621
|
-
|
|
6621
|
+
Ae = function(t) {
|
|
6622
6622
|
var e = t.prog;
|
|
6623
6623
|
if (e) {
|
|
6624
6624
|
var r = e.length, n;
|
|
@@ -6698,13 +6698,13 @@ function _i(t) {
|
|
|
6698
6698
|
function Hi(t) {
|
|
6699
6699
|
var e = t.stack, r = e.pop(), n = e.pop(), a = e.pop(), s = e.pop(), i = e.pop(), o = t.z0, u = t.z1, l = o[r], h = o[n], f = u[a], c = u[s], p = t.z2[i];
|
|
6700
6700
|
exports.DEBUG && console.log("ISECT[], ", r, n, a, s, i);
|
|
6701
|
-
var d = l.x, v = l.y, m = h.x, y = h.y, b = f.x, x = f.y, T = c.x, S = c.y,
|
|
6702
|
-
p.x = (O * (b - T) - w * (d - m)) /
|
|
6701
|
+
var d = l.x, v = l.y, m = h.x, y = h.y, b = f.x, x = f.y, T = c.x, S = c.y, A = (d - m) * (x - S) - (v - y) * (b - T), O = d * y - v * m, w = b * S - x * T;
|
|
6702
|
+
p.x = (O * (b - T) - w * (d - m)) / A, p.y = (O * (x - S) - w * (v - y)) / A;
|
|
6703
6703
|
}
|
|
6704
|
-
function
|
|
6704
|
+
function Wi(t) {
|
|
6705
6705
|
t.rp0 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP0[]", t.rp0);
|
|
6706
6706
|
}
|
|
6707
|
-
function
|
|
6707
|
+
function zi(t) {
|
|
6708
6708
|
t.rp1 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP1[]", t.rp1);
|
|
6709
6709
|
}
|
|
6710
6710
|
function Vi(t) {
|
|
@@ -6769,7 +6769,7 @@ function Ki(t) {
|
|
|
6769
6769
|
exports.DEBUG && console.log(t.step, "RTG[]"), t.round = ga;
|
|
6770
6770
|
}
|
|
6771
6771
|
function Qi(t) {
|
|
6772
|
-
exports.DEBUG && console.log(t.step, "RTHG[]"), t.round =
|
|
6772
|
+
exports.DEBUG && console.log(t.step, "RTHG[]"), t.round = Ai;
|
|
6773
6773
|
}
|
|
6774
6774
|
function $i(t) {
|
|
6775
6775
|
var e = t.stack.pop();
|
|
@@ -6810,7 +6810,7 @@ function io(t) {
|
|
|
6810
6810
|
var a = t.ip, s = t.prog;
|
|
6811
6811
|
t.prog = t.funcs[r];
|
|
6812
6812
|
for (var i = 0; i < n; i++)
|
|
6813
|
-
|
|
6813
|
+
Ae(t), exports.DEBUG && console.log(
|
|
6814
6814
|
++t.step,
|
|
6815
6815
|
i + 1 < n ? "next loopcall" : "done loopcall",
|
|
6816
6816
|
i
|
|
@@ -6821,7 +6821,7 @@ function oo(t) {
|
|
|
6821
6821
|
var e = t.stack.pop();
|
|
6822
6822
|
exports.DEBUG && console.log(t.step, "CALL[]", e);
|
|
6823
6823
|
var r = t.ip, n = t.prog;
|
|
6824
|
-
t.prog = t.funcs[e],
|
|
6824
|
+
t.prog = t.funcs[e], Ae(t), t.ip = r, t.prog = n, exports.DEBUG && console.log(++t.step, "returning from", e);
|
|
6825
6825
|
}
|
|
6826
6826
|
function uo(t) {
|
|
6827
6827
|
var e = t.stack, r = e.pop();
|
|
@@ -7027,11 +7027,11 @@ function Ro(t) {
|
|
|
7027
7027
|
var e = t.stack, r = e.pop();
|
|
7028
7028
|
exports.DEBUG && console.log(t.step, "EVEN[]", r), e.push(Math.trunc(r) % 2 ? 0 : 1);
|
|
7029
7029
|
}
|
|
7030
|
-
function
|
|
7030
|
+
function Ao(t) {
|
|
7031
7031
|
var e = t.stack.pop();
|
|
7032
7032
|
exports.DEBUG && console.log(t.step, "IF[]", e), e || (ya(t, !0), exports.DEBUG && console.log(t.step, "EIF[]"));
|
|
7033
7033
|
}
|
|
7034
|
-
function
|
|
7034
|
+
function Mo(t) {
|
|
7035
7035
|
exports.DEBUG && console.log(t.step, "EIF[]");
|
|
7036
7036
|
}
|
|
7037
7037
|
function Bo(t) {
|
|
@@ -7079,11 +7079,11 @@ function Ho(t) {
|
|
|
7079
7079
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
7080
7080
|
exports.DEBUG && console.log(t.step, "DIV[]", r, n), e.push(n * 64 / r);
|
|
7081
7081
|
}
|
|
7082
|
-
function
|
|
7082
|
+
function Wo(t) {
|
|
7083
7083
|
var e = t.stack, r = e.pop(), n = e.pop();
|
|
7084
7084
|
exports.DEBUG && console.log(t.step, "MUL[]", r, n), e.push(n * r / 64);
|
|
7085
7085
|
}
|
|
7086
|
-
function
|
|
7086
|
+
function zo(t) {
|
|
7087
7087
|
var e = t.stack, r = e.pop();
|
|
7088
7088
|
exports.DEBUG && console.log(t.step, "ABS[]", r), e.push(Math.abs(r));
|
|
7089
7089
|
}
|
|
@@ -7194,7 +7194,7 @@ function Ko(t) {
|
|
|
7194
7194
|
exports.DEBUG && console.log(t.step, "ROFF[]"), t.round = Li;
|
|
7195
7195
|
}
|
|
7196
7196
|
function Qo(t) {
|
|
7197
|
-
exports.DEBUG && console.log(t.step, "RUTG[]"), t.round =
|
|
7197
|
+
exports.DEBUG && console.log(t.step, "RUTG[]"), t.round = Mi;
|
|
7198
7198
|
}
|
|
7199
7199
|
function $o(t) {
|
|
7200
7200
|
exports.DEBUG && console.log(t.step, "RDTG[]"), t.round = Bi;
|
|
@@ -7306,9 +7306,9 @@ fa = [
|
|
|
7306
7306
|
/* 0x0F */
|
|
7307
7307
|
Hi,
|
|
7308
7308
|
/* 0x10 */
|
|
7309
|
-
zi,
|
|
7310
|
-
/* 0x11 */
|
|
7311
7309
|
Wi,
|
|
7310
|
+
/* 0x11 */
|
|
7311
|
+
zi,
|
|
7312
7312
|
/* 0x12 */
|
|
7313
7313
|
Vi,
|
|
7314
7314
|
/* 0x13 */
|
|
@@ -7459,9 +7459,9 @@ fa = [
|
|
|
7459
7459
|
/* 0x57 */
|
|
7460
7460
|
Ro,
|
|
7461
7461
|
/* 0x58 */
|
|
7462
|
-
Mo,
|
|
7463
|
-
/* 0x59 */
|
|
7464
7462
|
Ao,
|
|
7463
|
+
/* 0x59 */
|
|
7464
|
+
Mo,
|
|
7465
7465
|
/* 0x5A */
|
|
7466
7466
|
Bo,
|
|
7467
7467
|
/* 0x5B */
|
|
@@ -7481,9 +7481,9 @@ fa = [
|
|
|
7481
7481
|
/* 0x62 */
|
|
7482
7482
|
Ho,
|
|
7483
7483
|
/* 0x63 */
|
|
7484
|
-
zo,
|
|
7485
|
-
/* 0x64 */
|
|
7486
7484
|
Wo,
|
|
7485
|
+
/* 0x64 */
|
|
7486
|
+
zo,
|
|
7487
7487
|
/* 0x65 */
|
|
7488
7488
|
Vo,
|
|
7489
7489
|
/* 0x66 */
|
|
@@ -8109,7 +8109,7 @@ function hu(t, e) {
|
|
|
8109
8109
|
var r = Je(t, e.coverage);
|
|
8110
8110
|
return r === -1 ? null : e.substitute[r];
|
|
8111
8111
|
}
|
|
8112
|
-
function
|
|
8112
|
+
function At(t, e) {
|
|
8113
8113
|
for (var r = [], n = 0; n < t.length; n++) {
|
|
8114
8114
|
var a = t[n], s = e.current;
|
|
8115
8115
|
s = Array.isArray(s) ? s[0] : s;
|
|
@@ -8122,7 +8122,7 @@ function cu(t, e) {
|
|
|
8122
8122
|
var r = e.inputCoverage.length + e.lookaheadCoverage.length + e.backtrackCoverage.length;
|
|
8123
8123
|
if (t.context.length < r)
|
|
8124
8124
|
return [];
|
|
8125
|
-
var n =
|
|
8125
|
+
var n = At(
|
|
8126
8126
|
e.inputCoverage,
|
|
8127
8127
|
t
|
|
8128
8128
|
);
|
|
@@ -8133,7 +8133,7 @@ function cu(t, e) {
|
|
|
8133
8133
|
return [];
|
|
8134
8134
|
for (var s = t.lookahead.slice(a); s.length && Te(s[0].char); )
|
|
8135
8135
|
s.shift();
|
|
8136
|
-
var i = new oe(s, 0), o =
|
|
8136
|
+
var i = new oe(s, 0), o = At(
|
|
8137
8137
|
e.lookaheadCoverage,
|
|
8138
8138
|
i
|
|
8139
8139
|
), u = [].concat(t.backtrack);
|
|
@@ -8141,7 +8141,7 @@ function cu(t, e) {
|
|
|
8141
8141
|
u.shift();
|
|
8142
8142
|
if (u.length < e.backtrackCoverage.length)
|
|
8143
8143
|
return [];
|
|
8144
|
-
var l = new oe(u, 0), h =
|
|
8144
|
+
var l = new oe(u, 0), h = At(
|
|
8145
8145
|
e.backtrackCoverage,
|
|
8146
8146
|
l
|
|
8147
8147
|
), f = n.length === e.inputCoverage.length && o.length === e.lookaheadCoverage.length && h.length === e.backtrackCoverage.length, c = [];
|
|
@@ -8151,7 +8151,7 @@ function cu(t, e) {
|
|
|
8151
8151
|
var b = m.subtables[y], x = this.getLookupMethod(m, b), T = this.getSubstitutionType(m, b);
|
|
8152
8152
|
if (T === "12")
|
|
8153
8153
|
for (var S = 0; S < n.length; S++) {
|
|
8154
|
-
var
|
|
8154
|
+
var A = t.get(S), O = x(A);
|
|
8155
8155
|
O && c.push(O);
|
|
8156
8156
|
}
|
|
8157
8157
|
}
|
|
@@ -8583,7 +8583,7 @@ he.prototype.contextChecks = {
|
|
|
8583
8583
|
arabicWordCheck: vu,
|
|
8584
8584
|
arabicSentenceCheck: xu
|
|
8585
8585
|
};
|
|
8586
|
-
function
|
|
8586
|
+
function Mt(t) {
|
|
8587
8587
|
var e = this.contextChecks[t + "Check"];
|
|
8588
8588
|
return this.tokenizer.registerContextChecker(
|
|
8589
8589
|
t,
|
|
@@ -8591,10 +8591,10 @@ function At(t) {
|
|
|
8591
8591
|
e.endCheck
|
|
8592
8592
|
);
|
|
8593
8593
|
}
|
|
8594
|
-
function Mu() {
|
|
8595
|
-
return At.call(this, "latinWord"), At.call(this, "arabicWord"), At.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
|
|
8596
|
-
}
|
|
8597
8594
|
function Au() {
|
|
8595
|
+
return Mt.call(this, "latinWord"), Mt.call(this, "arabicWord"), Mt.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
|
|
8596
|
+
}
|
|
8597
|
+
function Mu() {
|
|
8598
8598
|
var t = this, e = this.tokenizer.getContextRanges("arabicSentence");
|
|
8599
8599
|
e.forEach(function(r) {
|
|
8600
8600
|
var n = t.tokenizer.getRangeTokens(r);
|
|
@@ -8673,10 +8673,10 @@ he.prototype.checkContextReady = function(t) {
|
|
|
8673
8673
|
return !!this.tokenizer.getContext(t);
|
|
8674
8674
|
};
|
|
8675
8675
|
he.prototype.applyFeaturesToContexts = function() {
|
|
8676
|
-
this.checkContextReady("arabicWord") && (Bu.call(this), Pu.call(this)), this.checkContextReady("latinWord") && Iu.call(this), this.checkContextReady("arabicSentence") &&
|
|
8676
|
+
this.checkContextReady("arabicWord") && (Bu.call(this), Pu.call(this)), this.checkContextReady("latinWord") && Iu.call(this), this.checkContextReady("arabicSentence") && Mu.call(this);
|
|
8677
8677
|
};
|
|
8678
8678
|
he.prototype.processText = function(t) {
|
|
8679
|
-
(!this.text || this.text !== t) && (this.setText(t),
|
|
8679
|
+
(!this.text || this.text !== t) && (this.setText(t), Au.call(this), this.applyFeaturesToContexts());
|
|
8680
8680
|
};
|
|
8681
8681
|
he.prototype.getBidiText = function(t) {
|
|
8682
8682
|
return this.processText(t), this.tokenizer.getText();
|
|
@@ -8981,7 +8981,7 @@ function Hu(t, e) {
|
|
|
8981
8981
|
r.fields = r.fields.concat(Nu(a, t.instances[a], t.axes, e));
|
|
8982
8982
|
return r;
|
|
8983
8983
|
}
|
|
8984
|
-
function
|
|
8984
|
+
function Wu(t, e, r) {
|
|
8985
8985
|
var n = new E.Parser(t, e), a = n.parseULong();
|
|
8986
8986
|
U.argument(a === 65536, "Unsupported fvar table version.");
|
|
8987
8987
|
var s = n.parseOffset16();
|
|
@@ -8992,7 +8992,7 @@ function zu(t, e, r) {
|
|
|
8992
8992
|
c.push(_u(t, p + d * l, h, r));
|
|
8993
8993
|
return { axes: h, instances: c };
|
|
8994
8994
|
}
|
|
8995
|
-
var
|
|
8995
|
+
var zu = { make: Hu, parse: Wu }, Vu = function() {
|
|
8996
8996
|
return {
|
|
8997
8997
|
coverage: this.parsePointer(g.coverage),
|
|
8998
8998
|
attachPoints: this.parseList(g.pointer(g.uShortList))
|
|
@@ -9232,8 +9232,8 @@ function ul(t, e) {
|
|
|
9232
9232
|
i = E.getUShort(s, 12), o = ol(s, i);
|
|
9233
9233
|
} else
|
|
9234
9234
|
throw new Error("Unsupported OpenType signature " + u);
|
|
9235
|
-
for (var h, f, c, p, d, v, m, y, b, x, T, S,
|
|
9236
|
-
var O = o[
|
|
9235
|
+
for (var h, f, c, p, d, v, m, y, b, x, T, S, A = 0; A < i; A += 1) {
|
|
9236
|
+
var O = o[A], w = void 0;
|
|
9237
9237
|
switch (O.tag) {
|
|
9238
9238
|
case "cmap":
|
|
9239
9239
|
w = H(s, O), a.tables.cmap = In.parse(w.data, w.offset), a.encoding = new Gn(a.tables.cmap);
|
|
@@ -9300,8 +9300,8 @@ function ul(t, e) {
|
|
|
9300
9300
|
break;
|
|
9301
9301
|
}
|
|
9302
9302
|
}
|
|
9303
|
-
var
|
|
9304
|
-
if (a.tables.name = na.parse(
|
|
9303
|
+
var M = H(s, x);
|
|
9304
|
+
if (a.tables.name = na.parse(M.data, M.offset, n), a.names = a.tables.name, c && b) {
|
|
9305
9305
|
var N = r === 0, K = H(s, b), $ = il.parse(K.data, K.offset, a.numGlyphs, N), Y = H(s, c);
|
|
9306
9306
|
a.glyphs = ca.parse(Y.data, Y.offset, $, a, e);
|
|
9307
9307
|
} else if (h) {
|
|
@@ -9316,8 +9316,8 @@ function ul(t, e) {
|
|
|
9316
9316
|
} else
|
|
9317
9317
|
a.kerningPairs = {};
|
|
9318
9318
|
if (p) {
|
|
9319
|
-
var
|
|
9320
|
-
a.tables.gdef = Ku.parse(
|
|
9319
|
+
var z = H(s, p);
|
|
9320
|
+
a.tables.gdef = Ku.parse(z.data, z.offset);
|
|
9321
9321
|
}
|
|
9322
9322
|
if (d) {
|
|
9323
9323
|
var Z = H(s, d);
|
|
@@ -9329,7 +9329,7 @@ function ul(t, e) {
|
|
|
9329
9329
|
}
|
|
9330
9330
|
if (f) {
|
|
9331
9331
|
var Q = H(s, f);
|
|
9332
|
-
a.tables.fvar =
|
|
9332
|
+
a.tables.fvar = zu.parse(Q.data, Q.offset, a.names);
|
|
9333
9333
|
}
|
|
9334
9334
|
if (T) {
|
|
9335
9335
|
var P = H(s, T);
|
|
@@ -9496,31 +9496,31 @@ function cl(t, e = 1e-4) {
|
|
|
9496
9496
|
S.itemSize,
|
|
9497
9497
|
S.normalized
|
|
9498
9498
|
);
|
|
9499
|
-
const
|
|
9500
|
-
|
|
9501
|
-
const
|
|
9502
|
-
l[T][w] = new O.constructor(
|
|
9499
|
+
const A = t.morphAttributes[T];
|
|
9500
|
+
A && (l[T] || (l[T] = []), A.forEach((O, w) => {
|
|
9501
|
+
const M = new O.array.constructor(O.count * O.itemSize);
|
|
9502
|
+
l[T][w] = new O.constructor(M, O.itemSize, O.normalized);
|
|
9503
9503
|
}));
|
|
9504
9504
|
}
|
|
9505
9505
|
const p = e * 0.5, d = Math.log10(1 / e), v = Math.pow(10, d), m = p * v;
|
|
9506
9506
|
for (let b = 0; b < s; b++) {
|
|
9507
9507
|
const x = n ? n.getX(b) : b;
|
|
9508
9508
|
let T = "";
|
|
9509
|
-
for (let S = 0,
|
|
9510
|
-
const O = o[S], w = t.getAttribute(O),
|
|
9511
|
-
for (let N = 0; N <
|
|
9509
|
+
for (let S = 0, A = o.length; S < A; S++) {
|
|
9510
|
+
const O = o[S], w = t.getAttribute(O), M = w.itemSize;
|
|
9511
|
+
for (let N = 0; N < M; N++)
|
|
9512
9512
|
T += `${~~(w[f[N]](x) * v + m)},`;
|
|
9513
9513
|
}
|
|
9514
9514
|
if (T in r)
|
|
9515
9515
|
h.push(r[T]);
|
|
9516
9516
|
else {
|
|
9517
|
-
for (let S = 0,
|
|
9518
|
-
const O = o[S], w = t.getAttribute(O),
|
|
9517
|
+
for (let S = 0, A = o.length; S < A; S++) {
|
|
9518
|
+
const O = o[S], w = t.getAttribute(O), M = t.morphAttributes[O], N = w.itemSize, K = u[O], $ = l[O];
|
|
9519
9519
|
for (let Y = 0; Y < N; Y++) {
|
|
9520
9520
|
const I = f[Y], _ = c[Y];
|
|
9521
|
-
if (K[_](i, w[I](x)),
|
|
9522
|
-
for (let D = 0,
|
|
9523
|
-
$[D][_](i,
|
|
9521
|
+
if (K[_](i, w[I](x)), M)
|
|
9522
|
+
for (let D = 0, z = M.length; D < z; D++)
|
|
9523
|
+
$[D][_](i, M[D][I](x));
|
|
9524
9524
|
}
|
|
9525
9525
|
}
|
|
9526
9526
|
r[T] = i, h.push(i), i++;
|
|
@@ -9641,7 +9641,7 @@ class gn extends Fn {
|
|
|
9641
9641
|
* @param data - Either a MeshFontData object containing font information or an ArrayBuffer containing raw font data
|
|
9642
9642
|
*/
|
|
9643
9643
|
constructor(e) {
|
|
9644
|
-
super(), this.type = "mesh", e instanceof ArrayBuffer ? this.data = ll(e) : this.data = e, this.font = new
|
|
9644
|
+
super(), this.type = "mesh", e instanceof ArrayBuffer ? this.data = ll(e) : this.data = e, this.font = new za(this.data);
|
|
9645
9645
|
}
|
|
9646
9646
|
/**
|
|
9647
9647
|
* Return true if this font contains glyph of the specified character. Otherwise, return false.
|
|
@@ -10080,7 +10080,7 @@ class vl {
|
|
|
10080
10080
|
}
|
|
10081
10081
|
}
|
|
10082
10082
|
}
|
|
10083
|
-
class
|
|
10083
|
+
class W {
|
|
10084
10084
|
/**
|
|
10085
10085
|
* Creates a new Point instance.
|
|
10086
10086
|
* @param x - The x-coordinate (defaults to 0)
|
|
@@ -10118,7 +10118,7 @@ class z {
|
|
|
10118
10118
|
* @returns A new Point instance with the same x and y values
|
|
10119
10119
|
*/
|
|
10120
10120
|
clone() {
|
|
10121
|
-
return new
|
|
10121
|
+
return new W(this.x, this.y);
|
|
10122
10122
|
}
|
|
10123
10123
|
/**
|
|
10124
10124
|
* Adds another point's coordinates to this point.
|
|
@@ -10223,18 +10223,18 @@ let yn = class rr {
|
|
|
10223
10223
|
}
|
|
10224
10224
|
const a = 4 * Math.atan(Math.abs(this.bulge));
|
|
10225
10225
|
this.radius = n / (2 * Math.sin(a / 2));
|
|
10226
|
-
const s = this.start.clone().add(r.clone().divide(2)), i = new
|
|
10226
|
+
const s = this.start.clone().add(r.clone().divide(2)), i = new W(-r.y, r.x);
|
|
10227
10227
|
i.normalize(), i.multiply(Math.abs(this.radius * Math.cos(a / 2))), this.center = s.clone(), this.isClockwise ? this.center.subtract(i) : this.center.add(i), this.startAngle = Math.atan2(this.start.y - this.center.y, this.start.x - this.center.x), this.endAngle = Math.atan2(this.end.y - this.center.y, this.end.x - this.center.x), this.isClockwise ? this.endAngle >= this.startAngle && (this.endAngle -= 2 * Math.PI) : this.endAngle <= this.startAngle && (this.endAngle += 2 * Math.PI);
|
|
10228
10228
|
} else if (e.center && e.radius !== void 0 && e.startOctant !== void 0 && e.octantCount !== void 0 && e.isClockwise !== void 0) {
|
|
10229
10229
|
this.center = e.center.clone(), this.radius = e.radius, this.isClockwise = e.isClockwise, this.startAngle = e.startOctant * vn;
|
|
10230
10230
|
const r = (e.octantCount === 0 ? 8 : e.octantCount) * vn;
|
|
10231
10231
|
this.endAngle = this.startAngle + (this.isClockwise ? -r : r), this.start = this.center.clone().add(
|
|
10232
|
-
new
|
|
10232
|
+
new W(
|
|
10233
10233
|
this.radius * Math.cos(this.startAngle),
|
|
10234
10234
|
this.radius * Math.sin(this.startAngle)
|
|
10235
10235
|
)
|
|
10236
10236
|
), this.end = this.center.clone().add(
|
|
10237
|
-
new
|
|
10237
|
+
new W(this.radius * Math.cos(this.endAngle), this.radius * Math.sin(this.endAngle))
|
|
10238
10238
|
);
|
|
10239
10239
|
} else
|
|
10240
10240
|
throw new Error("Invalid arc parameters");
|
|
@@ -10251,12 +10251,12 @@ let yn = class rr {
|
|
|
10251
10251
|
for (let s = 1; s < a; s++) {
|
|
10252
10252
|
const i = s / a, o = this.isClockwise ? this.startAngle - i * n : this.startAngle + i * n;
|
|
10253
10253
|
r.push(
|
|
10254
|
-
this.center.clone().add(new
|
|
10254
|
+
this.center.clone().add(new W(this.radius * Math.cos(o), this.radius * Math.sin(o)))
|
|
10255
10255
|
);
|
|
10256
10256
|
}
|
|
10257
10257
|
return r.push(
|
|
10258
10258
|
this.end ? this.end.clone() : this.center.clone().add(
|
|
10259
|
-
new
|
|
10259
|
+
new W(
|
|
10260
10260
|
this.radius * Math.cos(this.endAngle),
|
|
10261
10261
|
this.radius * Math.sin(this.endAngle)
|
|
10262
10262
|
)
|
|
@@ -10367,7 +10367,7 @@ let ml = class {
|
|
|
10367
10367
|
*/
|
|
10368
10368
|
parseShape(e, r) {
|
|
10369
10369
|
const n = {
|
|
10370
|
-
currentPoint: new
|
|
10370
|
+
currentPoint: new W(),
|
|
10371
10371
|
polylines: [],
|
|
10372
10372
|
currentPolyline: [],
|
|
10373
10373
|
sp: [],
|
|
@@ -10453,7 +10453,7 @@ let ml = class {
|
|
|
10453
10453
|
* @returns Returns the vector for the given direction code
|
|
10454
10454
|
*/
|
|
10455
10455
|
getVectorForDirection(e) {
|
|
10456
|
-
const r = new
|
|
10456
|
+
const r = new W();
|
|
10457
10457
|
switch (e) {
|
|
10458
10458
|
case 0:
|
|
10459
10459
|
r.x = 1;
|
|
@@ -10524,13 +10524,13 @@ let ml = class {
|
|
|
10524
10524
|
}
|
|
10525
10525
|
handleXYDisplacement(e, r, n) {
|
|
10526
10526
|
let a = r;
|
|
10527
|
-
const s = new
|
|
10527
|
+
const s = new W();
|
|
10528
10528
|
return s.x = J.byteToSByte(e[++a]), s.y = J.byteToSByte(e[++a]), n.currentPoint.add(s.multiply(n.scale)), n.isPenDown && n.currentPolyline.push(n.currentPoint.clone()), a;
|
|
10529
10529
|
}
|
|
10530
10530
|
handleMultipleXYDisplacements(e, r, n) {
|
|
10531
10531
|
let a = r;
|
|
10532
10532
|
for (; ; ) {
|
|
10533
|
-
const s = new
|
|
10533
|
+
const s = new W();
|
|
10534
10534
|
if (s.x = J.byteToSByte(e[++a]), s.y = J.byteToSByte(e[++a]), s.x === 0 && s.y === 0)
|
|
10535
10535
|
break;
|
|
10536
10536
|
n.currentPoint.add(s.multiply(n.scale)), n.isPenDown && n.currentPolyline.push(n.currentPoint.clone());
|
|
@@ -10542,7 +10542,7 @@ let ml = class {
|
|
|
10542
10542
|
let s = r;
|
|
10543
10543
|
const i = e[++s] * n.scale, o = J.byteToSByte(e[++s]), u = (o & 112) >> 4;
|
|
10544
10544
|
let l = o & 7;
|
|
10545
|
-
const h = o < 0, f = Math.PI / 4 * u, c = n.currentPoint.clone().subtract(new
|
|
10545
|
+
const h = o < 0, f = Math.PI / 4 * u, c = n.currentPoint.clone().subtract(new W(Math.cos(f) * i, Math.sin(f) * i)), p = yn.fromOctant(c, i, u, l, h);
|
|
10546
10546
|
if (n.isPenDown) {
|
|
10547
10547
|
const d = p.tessellate();
|
|
10548
10548
|
n.currentPolyline.pop(), n.currentPolyline.push(...d.slice());
|
|
@@ -10559,29 +10559,29 @@ let ml = class {
|
|
|
10559
10559
|
h < 0 && (v = -v, d = -d, m = -1);
|
|
10560
10560
|
let y = p * f, b = y + d;
|
|
10561
10561
|
y += p * s / 256 * m, b += p * i / 256 * m;
|
|
10562
|
-
const x = n.currentPoint.clone().subtract(new
|
|
10563
|
-
if (n.currentPoint = x.clone().add(new
|
|
10562
|
+
const x = n.currentPoint.clone().subtract(new W(l * Math.cos(y), l * Math.sin(y)));
|
|
10563
|
+
if (n.currentPoint = x.clone().add(new W(l * Math.cos(b), l * Math.sin(b))), n.isPenDown) {
|
|
10564
10564
|
let T = y;
|
|
10565
10565
|
const S = [];
|
|
10566
10566
|
if (S.push(
|
|
10567
|
-
x.clone().add(new
|
|
10567
|
+
x.clone().add(new W(l * Math.cos(T), l * Math.sin(T)))
|
|
10568
10568
|
), v > 0)
|
|
10569
10569
|
for (; T + v < b; )
|
|
10570
10570
|
T += v, S.push(
|
|
10571
|
-
x.clone().add(new
|
|
10571
|
+
x.clone().add(new W(l * Math.cos(T), l * Math.sin(T)))
|
|
10572
10572
|
);
|
|
10573
10573
|
else
|
|
10574
10574
|
for (; T + v > b; )
|
|
10575
10575
|
T += v, S.push(
|
|
10576
|
-
x.clone().add(new
|
|
10576
|
+
x.clone().add(new W(l * Math.cos(T), l * Math.sin(T)))
|
|
10577
10577
|
);
|
|
10578
|
-
S.push(x.clone().add(new
|
|
10578
|
+
S.push(x.clone().add(new W(l * Math.cos(b), l * Math.sin(b)))), n.currentPolyline.push(...S);
|
|
10579
10579
|
}
|
|
10580
10580
|
return a;
|
|
10581
10581
|
}
|
|
10582
10582
|
handleBulgeArc(e, r, n) {
|
|
10583
10583
|
let a = r;
|
|
10584
|
-
const s = new
|
|
10584
|
+
const s = new W();
|
|
10585
10585
|
s.x = J.byteToSByte(e[++a]), s.y = J.byteToSByte(e[++a]);
|
|
10586
10586
|
const i = J.byteToSByte(e[++a]);
|
|
10587
10587
|
return n.currentPoint = this.handleArcSegment(
|
|
@@ -10596,7 +10596,7 @@ let ml = class {
|
|
|
10596
10596
|
handleMultipleBulgeArcs(e, r, n) {
|
|
10597
10597
|
let a = r;
|
|
10598
10598
|
for (; ; ) {
|
|
10599
|
-
const s = new
|
|
10599
|
+
const s = new W();
|
|
10600
10600
|
if (s.x = J.byteToSByte(e[++a]), s.y = J.byteToSByte(e[++a]), s.x === 0 && s.y === 0)
|
|
10601
10601
|
break;
|
|
10602
10602
|
const i = J.byteToSByte(e[++a]);
|
|
@@ -10825,7 +10825,7 @@ class xn extends Fn {
|
|
|
10825
10825
|
a += r, this.addUnsupportedChar(i);
|
|
10826
10826
|
continue;
|
|
10827
10827
|
}
|
|
10828
|
-
n.push(o.offset(new
|
|
10828
|
+
n.push(o.offset(new W(a, 0))), a += o.width;
|
|
10829
10829
|
}
|
|
10830
10830
|
return n;
|
|
10831
10831
|
}
|
|
@@ -11099,13 +11099,13 @@ class de {
|
|
|
11099
11099
|
const r = En(e);
|
|
11100
11100
|
if (!r)
|
|
11101
11101
|
throw new Error(`Invalid font url: ${e}`);
|
|
11102
|
-
const n = wr(e).toLowerCase(), a = await
|
|
11102
|
+
const n = wr(e).toLowerCase(), a = await We.instance.get(n);
|
|
11103
11103
|
if (a) {
|
|
11104
11104
|
const s = ke.instance.createFont(a);
|
|
11105
11105
|
this.fontMap.set(n, s);
|
|
11106
11106
|
} else {
|
|
11107
11107
|
const s = await this.loader.loadAsync(e), i = ke.instance.createFontFromBuffer(r, s);
|
|
11108
|
-
i && (this.fontMap.set(n, i), this.enableFontCache && await
|
|
11108
|
+
i && (this.fontMap.set(n, i), this.enableFontCache && await We.instance.set(n, {
|
|
11109
11109
|
name: n,
|
|
11110
11110
|
type: i.type,
|
|
11111
11111
|
data: i.data
|
|
@@ -11121,7 +11121,7 @@ class de {
|
|
|
11121
11121
|
async getAllFontsFromCache() {
|
|
11122
11122
|
if (this.fontMap.size !== 0)
|
|
11123
11123
|
return;
|
|
11124
|
-
const e = await
|
|
11124
|
+
const e = await We.instance.getAll();
|
|
11125
11125
|
for (const r of e) {
|
|
11126
11126
|
const { name: n } = r;
|
|
11127
11127
|
if (this.fileNames && !this.fileNames.includes(n))
|
|
@@ -12281,7 +12281,7 @@ class vr extends et {
|
|
|
12281
12281
|
* @returns The color as a hex number (0xRRGGBB)
|
|
12282
12282
|
*/
|
|
12283
12283
|
getColorAsHex() {
|
|
12284
|
-
return this.color.isRgb && this.color.rgbValue !== null ? this.color.rgbValue : this.color.isAci && this.color.aci !== null ?
|
|
12284
|
+
return this.color.isRgb && this.color.rgbValue !== null ? this.color.rgbValue : this.color.isAci && this.color.aci !== null ? Wa(this.color.aci) : 16777215;
|
|
12285
12285
|
}
|
|
12286
12286
|
/**
|
|
12287
12287
|
* Set the color using a hex value for rendering purposes.
|
|
@@ -12627,7 +12627,7 @@ class Ul {
|
|
|
12627
12627
|
T
|
|
12628
12628
|
);
|
|
12629
12629
|
if (r.push(...x), n.push(...T), i === "/" || i === "#") {
|
|
12630
|
-
const S = new R.BufferGeometry(),
|
|
12630
|
+
const S = new R.BufferGeometry(), A = new Float32Array([
|
|
12631
12631
|
o,
|
|
12632
12632
|
u - this.currentFontSize * 0.8,
|
|
12633
12633
|
0,
|
|
@@ -12637,7 +12637,7 @@ class Ul {
|
|
|
12637
12637
|
]);
|
|
12638
12638
|
S.setAttribute(
|
|
12639
12639
|
"position",
|
|
12640
|
-
new R.BufferAttribute(
|
|
12640
|
+
new R.BufferAttribute(A, 3)
|
|
12641
12641
|
), S.setIndex(null), n.push(S);
|
|
12642
12642
|
}
|
|
12643
12643
|
this._hOffset = o + d;
|
|
@@ -13433,14 +13433,14 @@ class Pl {
|
|
|
13433
13433
|
* when render mode is 'worker'.
|
|
13434
13434
|
*/
|
|
13435
13435
|
constructor(e = "main", r = {}) {
|
|
13436
|
-
this.
|
|
13436
|
+
this.webWorkerRenderer = null, this.currentMode = e, this.mainThreadRenderer = new Ll(), this.adapter = this.mainThreadRenderer, this.webWorkerConfig = r, e === "worker" && (this.webWorkerRenderer = new kn(r), this.adapter = this.webWorkerRenderer);
|
|
13437
13437
|
}
|
|
13438
13438
|
/**
|
|
13439
13439
|
* Switch between main thread and worker rendering modes
|
|
13440
13440
|
* @param mode The rendering mode to switch to
|
|
13441
13441
|
*/
|
|
13442
13442
|
switchMode(e) {
|
|
13443
|
-
this.currentMode !== e && (this.currentMode
|
|
13443
|
+
this.currentMode !== e && (this.currentMode = e, e === "worker" ? this.webWorkerRenderer || (this.webWorkerRenderer = new kn(this.webWorkerConfig), this.adapter = this.webWorkerRenderer) : this.adapter = this.mainThreadRenderer);
|
|
13444
13444
|
}
|
|
13445
13445
|
/**
|
|
13446
13446
|
* Get current rendering mode
|
|
@@ -13486,7 +13486,7 @@ class Pl {
|
|
|
13486
13486
|
* Clean up resources
|
|
13487
13487
|
*/
|
|
13488
13488
|
destroy() {
|
|
13489
|
-
this.
|
|
13489
|
+
this.webWorkerRenderer && (this.webWorkerRenderer.terminate(), this.webWorkerRenderer = null), this.mainThreadRenderer.destroy();
|
|
13490
13490
|
}
|
|
13491
13491
|
}
|
|
13492
13492
|
export {
|