@mlightcad/cad-simple-viewer 1.0.15 → 1.0.18
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 +691 -614
- package/dist/index.umd.cjs +8 -8
- package/dist/libredwg-parser-worker.js +339 -339
- package/lib/app/AcApContext.d.ts.map +1 -1
- package/lib/app/AcApContext.js +6 -0
- package/lib/app/AcApContext.js.map +1 -1
- package/lib/editor/view/AcEdBaseView.d.ts +25 -6
- package/lib/editor/view/AcEdBaseView.d.ts.map +1 -1
- package/lib/editor/view/AcEdBaseView.js.map +1 -1
- package/lib/view/AcTrView2d.d.ts +21 -4
- package/lib/view/AcTrView2d.d.ts.map +1 -1
- package/lib/view/AcTrView2d.js +92 -42
- package/lib/view/AcTrView2d.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { AcCmEventManager as te, AcGePoint2d as V, AcGeBox2d as ue, AcCmColor as lr, AcGeBox3d as
|
|
1
|
+
import { AcDbLayout as Ws, AcCmEventManager as te, AcGePoint2d as V, AcGeBox2d as ue, AcCmColor as lr, AcGeBox3d as Xs, AcDbDatabase as fo, AcDbFileType as rn, AcGeMathUtil as vt, AcGeVector3d as Kt, AcGeGeometryUtil as go, AcGeVector2d as jn, acdbHostApplicationServices as $s, AcDbViewport as Ys, AcDbRasterImage as qs, AcDbRay as Zs, AcDbXline as Qs, AcDbHatch as Wn, AcGePolyline2d as Js, AcDbLine as Ks, AcDbTextStyleTableRecord as ei, AcDbMText as ti, AcGiMTextAttachmentPoint as mo, AcGePoint3d as Xn, AcGeLoop2d as ni, AcGeCircArc2d as ri, AcGeLine2d as si, AcDbArc as ii, AcGeLine3d as dt, AcDbDatabaseConverter as yo, createWorkerApi as vo, AcDbLinetypeTableRecord as bo, AcDbDimStyleTableRecord as xo, AcDbLayerTableRecord as So, AcDbViewportTableRecord as wo, AcDbBlockTableRecord as _o, AcDbBatchProcessing as To, AcDbRasterImageDef as Co, AcDbCircle as Io, AcDbEllipse as ko, AcDbSpline as Er, AcDbPoint as Eo, AcDbTrace as Mo, AcDbPolyline as Mr, AcGeEllipseArc2d as Ao, AcGeSpline3d as Ar, AcDbTable as Bo, AcDbText as Lo, AcDbLeader as Oo, AcDbAlignedDimension as Do, AcDb3PointAngularDimension as Ro, AcDbOrdinateDimension as Uo, AcDbRadialDimension as Fo, AcDbDiametricDimension as Po, AcDbBlockReference as Go, AcDbDxfConverter as No, AcDbDatabaseConverterManager as Br } from "@mlightcad/data-model";
|
|
2
2
|
import { find as zo, findIndex as Vo, defaults as Ho } from "lodash-es";
|
|
3
3
|
import * as g from "three";
|
|
4
|
-
import { BufferGeometry as sn, ExtrudeGeometry as
|
|
4
|
+
import { BufferGeometry as sn, ExtrudeGeometry as jo, BufferAttribute as Wo, ShapePath as Xo } from "three";
|
|
5
5
|
import { mergeGeometries as $o } from "three/examples/jsm/utils/BufferGeometryUtils.js";
|
|
6
6
|
import { OrbitControls as Yo } from "three/examples/jsm/controls/OrbitControls";
|
|
7
7
|
import qo from "three/examples/jsm/libs/stats.module";
|
|
@@ -27,6 +27,8 @@ class Zo {
|
|
|
27
27
|
this._view.setLayerVisibility(r.layer.name, !r.layer.isOff);
|
|
28
28
|
}), t.database.events.headerSysVarChanged.addEventListener((r) => {
|
|
29
29
|
r.name == "pdmode" && this._view.rerenderPoints(r.database.pdmode);
|
|
30
|
+
}), t.database.events.dictObjetSet.addEventListener((r) => {
|
|
31
|
+
r.object instanceof Ws && this._view.addLayout(r.object);
|
|
30
32
|
}), e.selectionSet.events.selectionAdded.addEventListener((r) => {
|
|
31
33
|
e.highlight(r.ids);
|
|
32
34
|
}), e.selectionSet.events.selectionRemoved.addEventListener((r) => {
|
|
@@ -1029,7 +1031,7 @@ class ca {
|
|
|
1029
1031
|
unhover: new te()
|
|
1030
1032
|
}, this._canvas = e;
|
|
1031
1033
|
const t = e.getBoundingClientRect();
|
|
1032
|
-
this._bbox = new
|
|
1034
|
+
this._bbox = new Xs(), this._width = t.width, this._height = t.height, this._curPos = new V(), this._curScreenPos = new V(), this._selectionSet = new aa(), this._editor = new oa(this), this._canvas.addEventListener("mousemove", (r) => this.onMouseMove(r)), this._canvas.addEventListener("mousedown", (r) => {
|
|
1033
1035
|
r.button === 1 && this._editor.setCursor(Lt.Grab);
|
|
1034
1036
|
}), this._canvas.addEventListener("mouseup", (r) => {
|
|
1035
1037
|
r.button === 1 && this._editor.restoreCursor();
|
|
@@ -1189,7 +1191,7 @@ class la {
|
|
|
1189
1191
|
* The document is initialized with an "Untitled" title and read-only mode enabled.
|
|
1190
1192
|
*/
|
|
1191
1193
|
constructor() {
|
|
1192
|
-
this._fileName = "", this._docTitle = "", this._isReadOnly = !0, this._database = new
|
|
1194
|
+
this._fileName = "", this._docTitle = "", this._isReadOnly = !0, this._database = new fo(), this.docTitle = "Untitled";
|
|
1193
1195
|
}
|
|
1194
1196
|
/**
|
|
1195
1197
|
* Opens a CAD document from a URI.
|
|
@@ -1779,7 +1781,7 @@ class _a {
|
|
|
1779
1781
|
return `${e}_${t}`;
|
|
1780
1782
|
}
|
|
1781
1783
|
}
|
|
1782
|
-
class
|
|
1784
|
+
class oi {
|
|
1783
1785
|
constructor() {
|
|
1784
1786
|
this.unsupportedChars = {}, this.cache = new _a();
|
|
1785
1787
|
}
|
|
@@ -1792,7 +1794,7 @@ class ii {
|
|
|
1792
1794
|
this.unsupportedChars[e] || (this.unsupportedChars[e] = 0), this.unsupportedChars[e]++;
|
|
1793
1795
|
}
|
|
1794
1796
|
}
|
|
1795
|
-
class
|
|
1797
|
+
class ai extends g.Shape {
|
|
1796
1798
|
/**
|
|
1797
1799
|
* Creates a new instance of BaseTextShape
|
|
1798
1800
|
* @param char - The character this shape represents */
|
|
@@ -1811,7 +1813,7 @@ function Ta() {
|
|
|
1811
1813
|
IDBTransaction
|
|
1812
1814
|
]);
|
|
1813
1815
|
}
|
|
1814
|
-
function
|
|
1816
|
+
function Ca() {
|
|
1815
1817
|
return Dr || (Dr = [
|
|
1816
1818
|
IDBCursor.prototype.advance,
|
|
1817
1819
|
IDBCursor.prototype.continue,
|
|
@@ -1819,12 +1821,12 @@ function Ia() {
|
|
|
1819
1821
|
]);
|
|
1820
1822
|
}
|
|
1821
1823
|
const Yn = /* @__PURE__ */ new WeakMap(), wn = /* @__PURE__ */ new WeakMap(), mn = /* @__PURE__ */ new WeakMap();
|
|
1822
|
-
function
|
|
1824
|
+
function Ia(n) {
|
|
1823
1825
|
const e = new Promise((t, r) => {
|
|
1824
1826
|
const s = () => {
|
|
1825
1827
|
n.removeEventListener("success", i), n.removeEventListener("error", o);
|
|
1826
1828
|
}, i = () => {
|
|
1827
|
-
t(
|
|
1829
|
+
t(je(n.result)), s();
|
|
1828
1830
|
}, o = () => {
|
|
1829
1831
|
r(n.error), s();
|
|
1830
1832
|
};
|
|
@@ -1855,7 +1857,7 @@ let qn = {
|
|
|
1855
1857
|
if (e === "store")
|
|
1856
1858
|
return t.objectStoreNames[1] ? void 0 : t.objectStore(t.objectStoreNames[0]);
|
|
1857
1859
|
}
|
|
1858
|
-
return
|
|
1860
|
+
return je(n[e]);
|
|
1859
1861
|
},
|
|
1860
1862
|
set(n, e, t) {
|
|
1861
1863
|
return n[e] = t, !0;
|
|
@@ -1864,32 +1866,32 @@ let qn = {
|
|
|
1864
1866
|
return n instanceof IDBTransaction && (e === "done" || e === "store") ? !0 : e in n;
|
|
1865
1867
|
}
|
|
1866
1868
|
};
|
|
1867
|
-
function
|
|
1869
|
+
function ci(n) {
|
|
1868
1870
|
qn = n(qn);
|
|
1869
1871
|
}
|
|
1870
1872
|
function Ea(n) {
|
|
1871
|
-
return
|
|
1872
|
-
return n.apply(Zn(this), e),
|
|
1873
|
+
return Ca().includes(n) ? function(...e) {
|
|
1874
|
+
return n.apply(Zn(this), e), je(this.request);
|
|
1873
1875
|
} : function(...e) {
|
|
1874
|
-
return
|
|
1876
|
+
return je(n.apply(Zn(this), e));
|
|
1875
1877
|
};
|
|
1876
1878
|
}
|
|
1877
1879
|
function Ma(n) {
|
|
1878
1880
|
return typeof n == "function" ? Ea(n) : (n instanceof IDBTransaction && ka(n), $n(n, Ta()) ? new Proxy(n, qn) : n);
|
|
1879
1881
|
}
|
|
1880
|
-
function
|
|
1882
|
+
function je(n) {
|
|
1881
1883
|
if (n instanceof IDBRequest)
|
|
1882
|
-
return
|
|
1884
|
+
return Ia(n);
|
|
1883
1885
|
if (wn.has(n))
|
|
1884
1886
|
return wn.get(n);
|
|
1885
1887
|
const e = Ma(n);
|
|
1886
1888
|
return e !== n && (wn.set(n, e), mn.set(e, n)), e;
|
|
1887
1889
|
}
|
|
1888
1890
|
const Zn = (n) => mn.get(n);
|
|
1889
|
-
function
|
|
1890
|
-
const o = indexedDB.open(n, e), a =
|
|
1891
|
+
function Aa(n, e, { blocked: t, upgrade: r, blocking: s, terminated: i } = {}) {
|
|
1892
|
+
const o = indexedDB.open(n, e), a = je(o);
|
|
1891
1893
|
return r && o.addEventListener("upgradeneeded", (c) => {
|
|
1892
|
-
r(
|
|
1894
|
+
r(je(o.result), c.oldVersion, c.newVersion, je(o.transaction), c);
|
|
1893
1895
|
}), t && o.addEventListener("blocked", (c) => t(
|
|
1894
1896
|
// Casting due to https://github.com/microsoft/TypeScript-DOM-lib-generator/pull/1405
|
|
1895
1897
|
c.oldVersion,
|
|
@@ -1900,7 +1902,7 @@ function Ba(n, e, { blocked: t, upgrade: r, blocking: s, terminated: i } = {}) {
|
|
|
1900
1902
|
}).catch(() => {
|
|
1901
1903
|
}), a;
|
|
1902
1904
|
}
|
|
1903
|
-
const
|
|
1905
|
+
const Ba = ["get", "getKey", "getAll", "getAllKeys", "count"], La = ["put", "add", "delete", "clear"], _n = /* @__PURE__ */ new Map();
|
|
1904
1906
|
function Rr(n, e) {
|
|
1905
1907
|
if (!(n instanceof IDBDatabase && !(e in n) && typeof e == "string"))
|
|
1906
1908
|
return;
|
|
@@ -1909,7 +1911,7 @@ function Rr(n, e) {
|
|
|
1909
1911
|
const t = e.replace(/FromIndex$/, ""), r = e !== t, s = La.includes(t);
|
|
1910
1912
|
if (
|
|
1911
1913
|
// Bail if the target doesn't exist on the target. Eg, getAll isn't in Edge.
|
|
1912
|
-
!(t in (r ? IDBIndex : IDBObjectStore).prototype) || !(s ||
|
|
1914
|
+
!(t in (r ? IDBIndex : IDBObjectStore).prototype) || !(s || Ba.includes(t))
|
|
1913
1915
|
)
|
|
1914
1916
|
return;
|
|
1915
1917
|
const i = async function(o, ...a) {
|
|
@@ -1922,18 +1924,18 @@ function Rr(n, e) {
|
|
|
1922
1924
|
};
|
|
1923
1925
|
return _n.set(e, i), i;
|
|
1924
1926
|
}
|
|
1925
|
-
|
|
1927
|
+
ci((n) => ({
|
|
1926
1928
|
...n,
|
|
1927
1929
|
get: (e, t, r) => Rr(e, t) || n.get(e, t, r),
|
|
1928
1930
|
has: (e, t) => !!Rr(e, t) || n.has(e, t)
|
|
1929
1931
|
}));
|
|
1930
|
-
const Oa = ["continue", "continuePrimaryKey", "advance"], Ur = {}, Qn = /* @__PURE__ */ new WeakMap(),
|
|
1932
|
+
const Oa = ["continue", "continuePrimaryKey", "advance"], Ur = {}, Qn = /* @__PURE__ */ new WeakMap(), li = /* @__PURE__ */ new WeakMap(), Da = {
|
|
1931
1933
|
get(n, e) {
|
|
1932
1934
|
if (!Oa.includes(e))
|
|
1933
1935
|
return n[e];
|
|
1934
1936
|
let t = Ur[e];
|
|
1935
1937
|
return t || (t = Ur[e] = function(...r) {
|
|
1936
|
-
Qn.set(this,
|
|
1938
|
+
Qn.set(this, li.get(this)[e](...r));
|
|
1937
1939
|
}), t;
|
|
1938
1940
|
}
|
|
1939
1941
|
};
|
|
@@ -1943,13 +1945,13 @@ async function* Ra(...n) {
|
|
|
1943
1945
|
return;
|
|
1944
1946
|
e = e;
|
|
1945
1947
|
const t = new Proxy(e, Da);
|
|
1946
|
-
for (
|
|
1948
|
+
for (li.set(t, e), mn.set(t, Zn(e)); e; )
|
|
1947
1949
|
yield t, e = await (Qn.get(t) || e.continue()), Qn.delete(t);
|
|
1948
1950
|
}
|
|
1949
1951
|
function Fr(n, e) {
|
|
1950
1952
|
return e === Symbol.asyncIterator && $n(n, [IDBIndex, IDBObjectStore, IDBCursor]) || e === "iterate" && $n(n, [IDBIndex, IDBObjectStore]);
|
|
1951
1953
|
}
|
|
1952
|
-
|
|
1954
|
+
ci((n) => ({
|
|
1953
1955
|
...n,
|
|
1954
1956
|
get(e, t, r) {
|
|
1955
1957
|
return Fr(e, t) ? Ra : n.get(e, t, r);
|
|
@@ -2050,7 +2052,7 @@ const nt = {
|
|
|
2050
2052
|
async getDatabase() {
|
|
2051
2053
|
if (this.isClosing)
|
|
2052
2054
|
throw new Error("Cannot perform operation while database is closing");
|
|
2053
|
-
return this.db ? this.db : (this.db = await
|
|
2055
|
+
return this.db ? this.db : (this.db = await Aa(
|
|
2054
2056
|
Se.DATABASE_NAME,
|
|
2055
2057
|
Se.DATABASE_VERSION,
|
|
2056
2058
|
{
|
|
@@ -2089,8 +2091,8 @@ const nt = {
|
|
|
2089
2091
|
};
|
|
2090
2092
|
Kn.DATABASE_NAME = "mlightcad", Kn.DATABASE_VERSION = Jn[Jn.length - 1].version;
|
|
2091
2093
|
let Tn = Kn;
|
|
2092
|
-
const Ua = (n) => n.substring(n.lastIndexOf(".") + 1),
|
|
2093
|
-
const e =
|
|
2094
|
+
const Ua = (n) => n.substring(n.lastIndexOf(".") + 1), hi = (n) => n.split("/").pop(), Pr = (n) => {
|
|
2095
|
+
const e = hi(n);
|
|
2094
2096
|
if (e) {
|
|
2095
2097
|
const t = e.lastIndexOf(".");
|
|
2096
2098
|
return t === -1 ? e : e.substring(0, t);
|
|
@@ -2489,7 +2491,7 @@ function Nr(n) {
|
|
|
2489
2491
|
return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."), null;
|
|
2490
2492
|
i += h.count * t;
|
|
2491
2493
|
}
|
|
2492
|
-
const o = new e(i), a = new
|
|
2494
|
+
const o = new e(i), a = new Wo(o, t, r);
|
|
2493
2495
|
let c = 0;
|
|
2494
2496
|
for (let l = 0; l < n.length; ++l) {
|
|
2495
2497
|
const h = n[l];
|
|
@@ -2519,9 +2521,9 @@ function Va(n, e = 1e-4) {
|
|
|
2519
2521
|
w.normalized
|
|
2520
2522
|
);
|
|
2521
2523
|
const L = n.morphAttributes[_];
|
|
2522
|
-
L && (l[_] || (l[_] = []), L.forEach((T,
|
|
2524
|
+
L && (l[_] || (l[_] = []), L.forEach((T, I) => {
|
|
2523
2525
|
const O = new T.array.constructor(T.count * T.itemSize);
|
|
2524
|
-
l[_][
|
|
2526
|
+
l[_][I] = new T.constructor(O, T.itemSize, T.normalized);
|
|
2525
2527
|
}));
|
|
2526
2528
|
}
|
|
2527
2529
|
const p = e * 0.5, f = Math.log10(1 / e), m = Math.pow(10, f), y = p * m;
|
|
@@ -2529,18 +2531,18 @@ function Va(n, e = 1e-4) {
|
|
|
2529
2531
|
const x = r ? r.getX(S) : S;
|
|
2530
2532
|
let _ = "";
|
|
2531
2533
|
for (let w = 0, L = a.length; w < L; w++) {
|
|
2532
|
-
const T = a[w],
|
|
2534
|
+
const T = a[w], I = n.getAttribute(T), O = I.itemSize;
|
|
2533
2535
|
for (let G = 0; G < O; G++)
|
|
2534
|
-
_ += `${~~(
|
|
2536
|
+
_ += `${~~(I[d[G]](x) * m + y)},`;
|
|
2535
2537
|
}
|
|
2536
2538
|
if (_ in t)
|
|
2537
2539
|
h.push(t[_]);
|
|
2538
2540
|
else {
|
|
2539
2541
|
for (let w = 0, L = a.length; w < L; w++) {
|
|
2540
|
-
const T = a[w],
|
|
2542
|
+
const T = a[w], I = n.getAttribute(T), O = n.morphAttributes[T], G = I.itemSize, Q = c[T], ee = l[T];
|
|
2541
2543
|
for (let Y = 0; Y < G; Y++) {
|
|
2542
2544
|
const U = d[Y], N = u[Y];
|
|
2543
|
-
if (Q[N](o,
|
|
2545
|
+
if (Q[N](o, I[U](x)), O)
|
|
2544
2546
|
for (let F = 0, H = O.length; F < H; F++)
|
|
2545
2547
|
ee[F][N](o, O[F][U](x));
|
|
2546
2548
|
}
|
|
@@ -2567,7 +2569,7 @@ function Va(n, e = 1e-4) {
|
|
|
2567
2569
|
}
|
|
2568
2570
|
return v.setIndex(h), v;
|
|
2569
2571
|
}
|
|
2570
|
-
class Ha extends
|
|
2572
|
+
class Ha extends jo {
|
|
2571
2573
|
constructor(e, t = {}) {
|
|
2572
2574
|
const r = t.font;
|
|
2573
2575
|
if (r === void 0)
|
|
@@ -2579,7 +2581,7 @@ class Ha extends Wo {
|
|
|
2579
2581
|
this.type = "TextGeometry";
|
|
2580
2582
|
}
|
|
2581
2583
|
}
|
|
2582
|
-
const
|
|
2584
|
+
const ui = class {
|
|
2583
2585
|
/**
|
|
2584
2586
|
* Dummy replacement for `computeVertexNormals` that does nothing.
|
|
2585
2587
|
*/
|
|
@@ -2625,10 +2627,10 @@ const hi = class {
|
|
|
2625
2627
|
}
|
|
2626
2628
|
}
|
|
2627
2629
|
};
|
|
2628
|
-
|
|
2629
|
-
let
|
|
2630
|
+
ui.originalComputeVertexNormals = sn.prototype.computeVertexNormals;
|
|
2631
|
+
let ja = ui;
|
|
2630
2632
|
const Ge = new g.Vector2();
|
|
2631
|
-
class zr extends
|
|
2633
|
+
class zr extends ai {
|
|
2632
2634
|
constructor(e, t, r) {
|
|
2633
2635
|
super(e), this.isFound = !1, this.fontSize = t, this.font = r, this.width = this.getCharWidth(e, t, r);
|
|
2634
2636
|
}
|
|
@@ -2639,7 +2641,7 @@ class zr extends oi {
|
|
|
2639
2641
|
*/
|
|
2640
2642
|
toGeometry() {
|
|
2641
2643
|
let e = this.font.cache.getGeometry(this.char, this.fontSize);
|
|
2642
|
-
return e == null && (e =
|
|
2644
|
+
return e == null && (e = ja.runWithoutNormals(() => {
|
|
2643
2645
|
const t = new Ha(this.char, {
|
|
2644
2646
|
font: this.font.font,
|
|
2645
2647
|
depth: 0,
|
|
@@ -2696,14 +2698,14 @@ String.prototype.codePointAt || function() {
|
|
|
2696
2698
|
writable: !0
|
|
2697
2699
|
}) : String.prototype.codePointAt = e;
|
|
2698
2700
|
}();
|
|
2699
|
-
var ur = 0,
|
|
2700
|
-
function
|
|
2701
|
+
var ur = 0, di = -3;
|
|
2702
|
+
function Ct() {
|
|
2701
2703
|
this.table = new Uint16Array(16), this.trans = new Uint16Array(288);
|
|
2702
2704
|
}
|
|
2703
|
-
function
|
|
2704
|
-
this.source = n, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = e, this.destLen = 0, this.ltree = new
|
|
2705
|
+
function Wa(n, e) {
|
|
2706
|
+
this.source = n, this.sourceIndex = 0, this.tag = 0, this.bitcount = 0, this.dest = e, this.destLen = 0, this.ltree = new Ct(), this.dtree = new Ct();
|
|
2705
2707
|
}
|
|
2706
|
-
var
|
|
2708
|
+
var pi = new Ct(), fi = new Ct(), dr = new Uint8Array(30), pr = new Uint16Array(30), gi = new Uint8Array(30), mi = new Uint16Array(30), Xa = new Uint8Array([
|
|
2707
2709
|
16,
|
|
2708
2710
|
17,
|
|
2709
2711
|
18,
|
|
@@ -2723,8 +2725,8 @@ var di = new It(), pi = new It(), dr = new Uint8Array(30), pr = new Uint16Array(
|
|
|
2723
2725
|
14,
|
|
2724
2726
|
1,
|
|
2725
2727
|
15
|
|
2726
|
-
]), Vr = new
|
|
2727
|
-
function
|
|
2728
|
+
]), Vr = new Ct(), ve = new Uint8Array(320);
|
|
2729
|
+
function yi(n, e, t, r) {
|
|
2728
2730
|
var s, i;
|
|
2729
2731
|
for (s = 0; s < t; ++s)
|
|
2730
2732
|
n[s] = 0;
|
|
@@ -2751,7 +2753,7 @@ function $a(n, e) {
|
|
|
2751
2753
|
e.trans[t] = t;
|
|
2752
2754
|
}
|
|
2753
2755
|
var Hr = new Uint16Array(16);
|
|
2754
|
-
function
|
|
2756
|
+
function Cn(n, e, t, r) {
|
|
2755
2757
|
var s, i;
|
|
2756
2758
|
for (s = 0; s < 16; ++s)
|
|
2757
2759
|
n.table[s] = 0;
|
|
@@ -2792,7 +2794,7 @@ function qa(n, e, t) {
|
|
|
2792
2794
|
var l = _e(n, 3, 0);
|
|
2793
2795
|
ve[Xa[o]] = l;
|
|
2794
2796
|
}
|
|
2795
|
-
for (
|
|
2797
|
+
for (Cn(Vr, ve, 0, 19), a = 0; a < r + s; ) {
|
|
2796
2798
|
var h = er(n, Vr);
|
|
2797
2799
|
switch (h) {
|
|
2798
2800
|
case 16:
|
|
@@ -2813,9 +2815,9 @@ function qa(n, e, t) {
|
|
|
2813
2815
|
break;
|
|
2814
2816
|
}
|
|
2815
2817
|
}
|
|
2816
|
-
|
|
2818
|
+
Cn(e, ve, 0, r), Cn(t, ve, r, s);
|
|
2817
2819
|
}
|
|
2818
|
-
function
|
|
2820
|
+
function jr(n, e, t) {
|
|
2819
2821
|
for (; ; ) {
|
|
2820
2822
|
var r = er(n, e);
|
|
2821
2823
|
if (r === 256)
|
|
@@ -2824,7 +2826,7 @@ function Wr(n, e, t) {
|
|
|
2824
2826
|
n.dest[n.destLen++] = r;
|
|
2825
2827
|
else {
|
|
2826
2828
|
var s, i, o, a;
|
|
2827
|
-
for (r -= 257, s = _e(n, dr[r], pr[r]), i = er(n, t), o = n.destLen - _e(n,
|
|
2829
|
+
for (r -= 257, s = _e(n, dr[r], pr[r]), i = er(n, t), o = n.destLen - _e(n, gi[i], mi[i]), a = o; a < o + s; ++a)
|
|
2828
2830
|
n.dest[n.destLen++] = n.dest[a];
|
|
2829
2831
|
}
|
|
2830
2832
|
}
|
|
@@ -2833,35 +2835,35 @@ function Za(n) {
|
|
|
2833
2835
|
for (var e, t, r; n.bitcount > 8; )
|
|
2834
2836
|
n.sourceIndex--, n.bitcount -= 8;
|
|
2835
2837
|
if (e = n.source[n.sourceIndex + 1], e = 256 * e + n.source[n.sourceIndex], t = n.source[n.sourceIndex + 3], t = 256 * t + n.source[n.sourceIndex + 2], e !== (~t & 65535))
|
|
2836
|
-
return
|
|
2838
|
+
return di;
|
|
2837
2839
|
for (n.sourceIndex += 4, r = e; r; --r)
|
|
2838
2840
|
n.dest[n.destLen++] = n.source[n.sourceIndex++];
|
|
2839
2841
|
return n.bitcount = 0, ur;
|
|
2840
2842
|
}
|
|
2841
2843
|
function Qa(n, e) {
|
|
2842
|
-
var t = new
|
|
2844
|
+
var t = new Wa(n, e), r, s, i;
|
|
2843
2845
|
do {
|
|
2844
2846
|
switch (r = Ya(t), s = _e(t, 2, 0), s) {
|
|
2845
2847
|
case 0:
|
|
2846
2848
|
i = Za(t);
|
|
2847
2849
|
break;
|
|
2848
2850
|
case 1:
|
|
2849
|
-
i =
|
|
2851
|
+
i = jr(t, pi, fi);
|
|
2850
2852
|
break;
|
|
2851
2853
|
case 2:
|
|
2852
|
-
qa(t, t.ltree, t.dtree), i =
|
|
2854
|
+
qa(t, t.ltree, t.dtree), i = jr(t, t.ltree, t.dtree);
|
|
2853
2855
|
break;
|
|
2854
2856
|
default:
|
|
2855
|
-
i =
|
|
2857
|
+
i = di;
|
|
2856
2858
|
}
|
|
2857
2859
|
if (i !== ur)
|
|
2858
2860
|
throw new Error("Data error");
|
|
2859
2861
|
} while (!r);
|
|
2860
2862
|
return t.destLen < t.dest.length ? typeof t.dest.slice == "function" ? t.dest.slice(0, t.destLen) : t.dest.subarray(0, t.destLen) : t.dest;
|
|
2861
2863
|
}
|
|
2862
|
-
$a(
|
|
2863
|
-
|
|
2864
|
-
|
|
2864
|
+
$a(pi, fi);
|
|
2865
|
+
yi(dr, pr, 4, 3);
|
|
2866
|
+
yi(gi, mi, 2, 1);
|
|
2865
2867
|
dr[28] = 0;
|
|
2866
2868
|
pr[28] = 258;
|
|
2867
2869
|
var Ja = Qa;
|
|
@@ -2908,24 +2910,24 @@ Pe.prototype.addQuad = function(n, e, t, r, s, i) {
|
|
|
2908
2910
|
var o = n + 0.6666666666666666 * (t - n), a = e + 2 / 3 * (r - e), c = o + 1 / 3 * (s - n), l = a + 1 / 3 * (i - e);
|
|
2909
2911
|
this.addBezier(n, e, o, a, c, l, s, i);
|
|
2910
2912
|
};
|
|
2911
|
-
function
|
|
2913
|
+
function W() {
|
|
2912
2914
|
this.commands = [], this.fill = "black", this.stroke = null, this.strokeWidth = 1;
|
|
2913
2915
|
}
|
|
2914
|
-
|
|
2916
|
+
W.prototype.moveTo = function(n, e) {
|
|
2915
2917
|
this.commands.push({
|
|
2916
2918
|
type: "M",
|
|
2917
2919
|
x: n,
|
|
2918
2920
|
y: e
|
|
2919
2921
|
});
|
|
2920
2922
|
};
|
|
2921
|
-
|
|
2923
|
+
W.prototype.lineTo = function(n, e) {
|
|
2922
2924
|
this.commands.push({
|
|
2923
2925
|
type: "L",
|
|
2924
2926
|
x: n,
|
|
2925
2927
|
y: e
|
|
2926
2928
|
});
|
|
2927
2929
|
};
|
|
2928
|
-
|
|
2930
|
+
W.prototype.curveTo = W.prototype.bezierCurveTo = function(n, e, t, r, s, i) {
|
|
2929
2931
|
this.commands.push({
|
|
2930
2932
|
type: "C",
|
|
2931
2933
|
x1: n,
|
|
@@ -2936,7 +2938,7 @@ j.prototype.curveTo = j.prototype.bezierCurveTo = function(n, e, t, r, s, i) {
|
|
|
2936
2938
|
y: i
|
|
2937
2939
|
});
|
|
2938
2940
|
};
|
|
2939
|
-
|
|
2941
|
+
W.prototype.quadTo = W.prototype.quadraticCurveTo = function(n, e, t, r) {
|
|
2940
2942
|
this.commands.push({
|
|
2941
2943
|
type: "Q",
|
|
2942
2944
|
x1: n,
|
|
@@ -2945,12 +2947,12 @@ j.prototype.quadTo = j.prototype.quadraticCurveTo = function(n, e, t, r) {
|
|
|
2945
2947
|
y: r
|
|
2946
2948
|
});
|
|
2947
2949
|
};
|
|
2948
|
-
|
|
2950
|
+
W.prototype.close = W.prototype.closePath = function() {
|
|
2949
2951
|
this.commands.push({
|
|
2950
2952
|
type: "Z"
|
|
2951
2953
|
});
|
|
2952
2954
|
};
|
|
2953
|
-
|
|
2955
|
+
W.prototype.extend = function(n) {
|
|
2954
2956
|
if (n.commands)
|
|
2955
2957
|
n = n.commands;
|
|
2956
2958
|
else if (n instanceof Pe) {
|
|
@@ -2960,7 +2962,7 @@ j.prototype.extend = function(n) {
|
|
|
2960
2962
|
}
|
|
2961
2963
|
Array.prototype.push.apply(this.commands, n);
|
|
2962
2964
|
};
|
|
2963
|
-
|
|
2965
|
+
W.prototype.getBoundingBox = function() {
|
|
2964
2966
|
for (var n = new Pe(), e = 0, t = 0, r = 0, s = 0, i = 0; i < this.commands.length; i++) {
|
|
2965
2967
|
var o = this.commands[i];
|
|
2966
2968
|
switch (o.type) {
|
|
@@ -2985,7 +2987,7 @@ j.prototype.getBoundingBox = function() {
|
|
|
2985
2987
|
}
|
|
2986
2988
|
return n.isEmpty() && n.addPoint(0, 0), n;
|
|
2987
2989
|
};
|
|
2988
|
-
|
|
2990
|
+
W.prototype.draw = function(n) {
|
|
2989
2991
|
n.beginPath();
|
|
2990
2992
|
for (var e = 0; e < this.commands.length; e += 1) {
|
|
2991
2993
|
var t = this.commands[e];
|
|
@@ -2993,7 +2995,7 @@ j.prototype.draw = function(n) {
|
|
|
2993
2995
|
}
|
|
2994
2996
|
this.fill && (n.fillStyle = this.fill, n.fill()), this.stroke && (n.strokeStyle = this.stroke, n.lineWidth = this.strokeWidth, n.stroke());
|
|
2995
2997
|
};
|
|
2996
|
-
|
|
2998
|
+
W.prototype.toPathData = function(n) {
|
|
2997
2999
|
n = n !== void 0 ? n : 2;
|
|
2998
3000
|
function e(o) {
|
|
2999
3001
|
return Math.round(o) === o ? "" + Math.round(o) : o.toFixed(n);
|
|
@@ -3011,105 +3013,105 @@ j.prototype.toPathData = function(n) {
|
|
|
3011
3013
|
}
|
|
3012
3014
|
return r;
|
|
3013
3015
|
};
|
|
3014
|
-
|
|
3016
|
+
W.prototype.toSVG = function(n) {
|
|
3015
3017
|
var e = '<path d="';
|
|
3016
3018
|
return e += this.toPathData(n), e += '"', this.fill && this.fill !== "black" && (this.fill === null ? e += ' fill="none"' : e += ' fill="' + this.fill + '"'), this.stroke && (e += ' stroke="' + this.stroke + '" stroke-width="' + this.strokeWidth + '"'), e += "/>", e;
|
|
3017
3019
|
};
|
|
3018
|
-
|
|
3020
|
+
W.prototype.toDOMElement = function(n) {
|
|
3019
3021
|
var e = this.toPathData(n), t = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3020
3022
|
return t.setAttribute("d", e), t;
|
|
3021
3023
|
};
|
|
3022
|
-
function
|
|
3024
|
+
function vi(n) {
|
|
3023
3025
|
throw new Error(n);
|
|
3024
3026
|
}
|
|
3025
|
-
function
|
|
3026
|
-
n ||
|
|
3027
|
+
function Wr(n, e) {
|
|
3028
|
+
n || vi(e);
|
|
3027
3029
|
}
|
|
3028
|
-
var
|
|
3030
|
+
var A = { fail: vi, argument: Wr, assert: Wr }, Xr = 32768, $r = 2147483648, ct = {}, C = {}, B = {};
|
|
3029
3031
|
function me(n) {
|
|
3030
3032
|
return function() {
|
|
3031
3033
|
return n;
|
|
3032
3034
|
};
|
|
3033
3035
|
}
|
|
3034
|
-
|
|
3035
|
-
return
|
|
3036
|
+
C.BYTE = function(n) {
|
|
3037
|
+
return A.argument(n >= 0 && n <= 255, "Byte value should be between 0 and 255."), [n];
|
|
3036
3038
|
};
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
+
B.BYTE = me(1);
|
|
3040
|
+
C.CHAR = function(n) {
|
|
3039
3041
|
return [n.charCodeAt(0)];
|
|
3040
3042
|
};
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
+
B.CHAR = me(1);
|
|
3044
|
+
C.CHARARRAY = function(n) {
|
|
3043
3045
|
typeof n > "u" && (n = "", console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));
|
|
3044
3046
|
for (var e = [], t = 0; t < n.length; t += 1)
|
|
3045
3047
|
e[t] = n.charCodeAt(t);
|
|
3046
3048
|
return e;
|
|
3047
3049
|
};
|
|
3048
|
-
|
|
3050
|
+
B.CHARARRAY = function(n) {
|
|
3049
3051
|
return typeof n > "u" ? 0 : n.length;
|
|
3050
3052
|
};
|
|
3051
|
-
|
|
3053
|
+
C.USHORT = function(n) {
|
|
3052
3054
|
return [n >> 8 & 255, n & 255];
|
|
3053
3055
|
};
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
+
B.USHORT = me(2);
|
|
3057
|
+
C.SHORT = function(n) {
|
|
3056
3058
|
return n >= Xr && (n = -(2 * Xr - n)), [n >> 8 & 255, n & 255];
|
|
3057
3059
|
};
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
+
B.SHORT = me(2);
|
|
3061
|
+
C.UINT24 = function(n) {
|
|
3060
3062
|
return [n >> 16 & 255, n >> 8 & 255, n & 255];
|
|
3061
3063
|
};
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
+
B.UINT24 = me(3);
|
|
3065
|
+
C.ULONG = function(n) {
|
|
3064
3066
|
return [n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255];
|
|
3065
3067
|
};
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
+
B.ULONG = me(4);
|
|
3069
|
+
C.LONG = function(n) {
|
|
3068
3070
|
return n >= $r && (n = -(2 * $r - n)), [n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255];
|
|
3069
3071
|
};
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3072
|
+
B.LONG = me(4);
|
|
3073
|
+
C.FIXED = C.ULONG;
|
|
3074
|
+
B.FIXED = B.ULONG;
|
|
3075
|
+
C.FWORD = C.SHORT;
|
|
3076
|
+
B.FWORD = B.SHORT;
|
|
3077
|
+
C.UFWORD = C.USHORT;
|
|
3078
|
+
B.UFWORD = B.USHORT;
|
|
3079
|
+
C.LONGDATETIME = function(n) {
|
|
3078
3080
|
return [0, 0, 0, 0, n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255];
|
|
3079
3081
|
};
|
|
3080
|
-
|
|
3081
|
-
|
|
3082
|
-
return
|
|
3082
|
+
B.LONGDATETIME = me(8);
|
|
3083
|
+
C.TAG = function(n) {
|
|
3084
|
+
return A.argument(n.length === 4, "Tag should be exactly 4 ASCII characters."), [
|
|
3083
3085
|
n.charCodeAt(0),
|
|
3084
3086
|
n.charCodeAt(1),
|
|
3085
3087
|
n.charCodeAt(2),
|
|
3086
3088
|
n.charCodeAt(3)
|
|
3087
3089
|
];
|
|
3088
3090
|
};
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
return n >= -107 && n <= 107 ? [n + 139] : n >= 108 && n <= 1131 ? (n = n - 108, [(n >> 8) + 247, n & 255]) : n >= -1131 && n <= -108 ? (n = -n - 108, [(n >> 8) + 251, n & 255]) : n >= -32768 && n <= 32767 ?
|
|
3100
|
-
};
|
|
3101
|
-
|
|
3102
|
-
return
|
|
3103
|
-
};
|
|
3104
|
-
|
|
3091
|
+
B.TAG = me(4);
|
|
3092
|
+
C.Card8 = C.BYTE;
|
|
3093
|
+
B.Card8 = B.BYTE;
|
|
3094
|
+
C.Card16 = C.USHORT;
|
|
3095
|
+
B.Card16 = B.USHORT;
|
|
3096
|
+
C.OffSize = C.BYTE;
|
|
3097
|
+
B.OffSize = B.BYTE;
|
|
3098
|
+
C.SID = C.USHORT;
|
|
3099
|
+
B.SID = B.USHORT;
|
|
3100
|
+
C.NUMBER = function(n) {
|
|
3101
|
+
return n >= -107 && n <= 107 ? [n + 139] : n >= 108 && n <= 1131 ? (n = n - 108, [(n >> 8) + 247, n & 255]) : n >= -1131 && n <= -108 ? (n = -n - 108, [(n >> 8) + 251, n & 255]) : n >= -32768 && n <= 32767 ? C.NUMBER16(n) : C.NUMBER32(n);
|
|
3102
|
+
};
|
|
3103
|
+
B.NUMBER = function(n) {
|
|
3104
|
+
return C.NUMBER(n).length;
|
|
3105
|
+
};
|
|
3106
|
+
C.NUMBER16 = function(n) {
|
|
3105
3107
|
return [28, n >> 8 & 255, n & 255];
|
|
3106
3108
|
};
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
+
B.NUMBER16 = me(3);
|
|
3110
|
+
C.NUMBER32 = function(n) {
|
|
3109
3111
|
return [29, n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255];
|
|
3110
3112
|
};
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
+
B.NUMBER32 = me(5);
|
|
3114
|
+
C.REAL = function(n) {
|
|
3113
3115
|
var e = n.toString(), t = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);
|
|
3114
3116
|
if (t) {
|
|
3115
3117
|
var r = parseFloat("1e" + ((t[2] ? +t[2] : 0) + t[1].length));
|
|
@@ -3124,13 +3126,13 @@ I.REAL = function(n) {
|
|
|
3124
3126
|
c.push(parseInt(s.substr(l, 2), 16));
|
|
3125
3127
|
return c;
|
|
3126
3128
|
};
|
|
3127
|
-
|
|
3128
|
-
return
|
|
3129
|
+
B.REAL = function(n) {
|
|
3130
|
+
return C.REAL(n).length;
|
|
3129
3131
|
};
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3132
|
+
C.NAME = C.CHARARRAY;
|
|
3133
|
+
B.NAME = B.CHARARRAY;
|
|
3134
|
+
C.STRING = C.CHARARRAY;
|
|
3135
|
+
B.STRING = B.CHARARRAY;
|
|
3134
3136
|
ct.UTF8 = function(n, e, t) {
|
|
3135
3137
|
for (var r = [], s = t, i = 0; i < s; i++, e += 1)
|
|
3136
3138
|
r[i] = n.getUint8(e);
|
|
@@ -3141,14 +3143,14 @@ ct.UTF16 = function(n, e, t) {
|
|
|
3141
3143
|
r[i] = n.getUint16(e);
|
|
3142
3144
|
return String.fromCharCode.apply(null, r);
|
|
3143
3145
|
};
|
|
3144
|
-
|
|
3146
|
+
C.UTF16 = function(n) {
|
|
3145
3147
|
for (var e = [], t = 0; t < n.length; t += 1) {
|
|
3146
3148
|
var r = n.charCodeAt(t);
|
|
3147
3149
|
e[e.length] = r >> 8 & 255, e[e.length] = r & 255;
|
|
3148
3150
|
}
|
|
3149
3151
|
return e;
|
|
3150
3152
|
};
|
|
3151
|
-
|
|
3153
|
+
B.UTF16 = function(n) {
|
|
3152
3154
|
return n.length * 2;
|
|
3153
3155
|
};
|
|
3154
3156
|
var tr = {
|
|
@@ -3224,7 +3226,7 @@ var zt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), Vt, Ka =
|
|
|
3224
3226
|
}
|
|
3225
3227
|
}
|
|
3226
3228
|
};
|
|
3227
|
-
|
|
3229
|
+
C.MACSTRING = function(n, e) {
|
|
3228
3230
|
var t = Ka(e);
|
|
3229
3231
|
if (t !== void 0) {
|
|
3230
3232
|
for (var r = [], s = 0; s < n.length; s++) {
|
|
@@ -3236,8 +3238,8 @@ I.MACSTRING = function(n, e) {
|
|
|
3236
3238
|
return r;
|
|
3237
3239
|
}
|
|
3238
3240
|
};
|
|
3239
|
-
|
|
3240
|
-
var t =
|
|
3241
|
+
B.MACSTRING = function(n, e) {
|
|
3242
|
+
var t = C.MACSTRING(n, e);
|
|
3241
3243
|
return t !== void 0 ? t.length : 0;
|
|
3242
3244
|
};
|
|
3243
3245
|
function nr(n) {
|
|
@@ -3274,68 +3276,68 @@ function nc(n, e, t) {
|
|
|
3274
3276
|
}
|
|
3275
3277
|
return i;
|
|
3276
3278
|
}
|
|
3277
|
-
|
|
3279
|
+
C.VARDELTAS = function(n) {
|
|
3278
3280
|
for (var e = 0, t = []; e < n.length; ) {
|
|
3279
3281
|
var r = n[e];
|
|
3280
3282
|
r === 0 ? e = ec(n, e, t) : r >= -128 && r <= 127 ? e = tc(n, e, t) : e = nc(n, e, t);
|
|
3281
3283
|
}
|
|
3282
3284
|
return t;
|
|
3283
3285
|
};
|
|
3284
|
-
|
|
3286
|
+
C.INDEX = function(n) {
|
|
3285
3287
|
for (var e = 1, t = [e], r = [], s = 0; s < n.length; s += 1) {
|
|
3286
|
-
var i =
|
|
3288
|
+
var i = C.OBJECT(n[s]);
|
|
3287
3289
|
Array.prototype.push.apply(r, i), e += i.length, t.push(e);
|
|
3288
3290
|
}
|
|
3289
3291
|
if (r.length === 0)
|
|
3290
3292
|
return [0, 0];
|
|
3291
|
-
for (var o = [], a = 1 + Math.floor(Math.log(e) / Math.log(2)) / 8 | 0, c = [void 0,
|
|
3293
|
+
for (var o = [], a = 1 + Math.floor(Math.log(e) / Math.log(2)) / 8 | 0, c = [void 0, C.BYTE, C.USHORT, C.UINT24, C.ULONG][a], l = 0; l < t.length; l += 1) {
|
|
3292
3294
|
var h = c(t[l]);
|
|
3293
3295
|
Array.prototype.push.apply(o, h);
|
|
3294
3296
|
}
|
|
3295
3297
|
return Array.prototype.concat(
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
+
C.Card16(n.length),
|
|
3299
|
+
C.OffSize(a),
|
|
3298
3300
|
o,
|
|
3299
3301
|
r
|
|
3300
3302
|
);
|
|
3301
3303
|
};
|
|
3302
|
-
|
|
3303
|
-
return
|
|
3304
|
+
B.INDEX = function(n) {
|
|
3305
|
+
return C.INDEX(n).length;
|
|
3304
3306
|
};
|
|
3305
|
-
|
|
3307
|
+
C.DICT = function(n) {
|
|
3306
3308
|
for (var e = [], t = Object.keys(n), r = t.length, s = 0; s < r; s += 1) {
|
|
3307
3309
|
var i = parseInt(t[s], 0), o = n[i];
|
|
3308
|
-
e = e.concat(
|
|
3310
|
+
e = e.concat(C.OPERAND(o.value, o.type)), e = e.concat(C.OPERATOR(i));
|
|
3309
3311
|
}
|
|
3310
3312
|
return e;
|
|
3311
3313
|
};
|
|
3312
|
-
|
|
3313
|
-
return
|
|
3314
|
+
B.DICT = function(n) {
|
|
3315
|
+
return C.DICT(n).length;
|
|
3314
3316
|
};
|
|
3315
|
-
|
|
3317
|
+
C.OPERATOR = function(n) {
|
|
3316
3318
|
return n < 1200 ? [n] : [12, n - 1200];
|
|
3317
3319
|
};
|
|
3318
|
-
|
|
3320
|
+
C.OPERAND = function(n, e) {
|
|
3319
3321
|
var t = [];
|
|
3320
3322
|
if (Array.isArray(e))
|
|
3321
3323
|
for (var r = 0; r < e.length; r += 1)
|
|
3322
|
-
|
|
3324
|
+
A.argument(n.length === e.length, "Not enough arguments given for type" + e), t = t.concat(C.OPERAND(n[r], e[r]));
|
|
3323
3325
|
else if (e === "SID")
|
|
3324
|
-
t = t.concat(
|
|
3326
|
+
t = t.concat(C.NUMBER(n));
|
|
3325
3327
|
else if (e === "offset")
|
|
3326
|
-
t = t.concat(
|
|
3328
|
+
t = t.concat(C.NUMBER32(n));
|
|
3327
3329
|
else if (e === "number")
|
|
3328
|
-
t = t.concat(
|
|
3330
|
+
t = t.concat(C.NUMBER(n));
|
|
3329
3331
|
else if (e === "real")
|
|
3330
|
-
t = t.concat(
|
|
3332
|
+
t = t.concat(C.REAL(n));
|
|
3331
3333
|
else
|
|
3332
3334
|
throw new Error("Unknown operand type " + e);
|
|
3333
3335
|
return t;
|
|
3334
3336
|
};
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
+
C.OP = C.BYTE;
|
|
3338
|
+
B.OP = B.BYTE;
|
|
3337
3339
|
var Ht = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap();
|
|
3338
|
-
|
|
3340
|
+
C.CHARSTRING = function(n) {
|
|
3339
3341
|
if (Ht) {
|
|
3340
3342
|
var e = Ht.get(n);
|
|
3341
3343
|
if (e !== void 0)
|
|
@@ -3343,25 +3345,25 @@ I.CHARSTRING = function(n) {
|
|
|
3343
3345
|
}
|
|
3344
3346
|
for (var t = [], r = n.length, s = 0; s < r; s += 1) {
|
|
3345
3347
|
var i = n[s];
|
|
3346
|
-
t = t.concat(
|
|
3348
|
+
t = t.concat(C[i.type](i.value));
|
|
3347
3349
|
}
|
|
3348
3350
|
return Ht && Ht.set(n, t), t;
|
|
3349
3351
|
};
|
|
3350
|
-
|
|
3351
|
-
return
|
|
3352
|
+
B.CHARSTRING = function(n) {
|
|
3353
|
+
return C.CHARSTRING(n).length;
|
|
3352
3354
|
};
|
|
3353
|
-
|
|
3354
|
-
var e =
|
|
3355
|
-
return
|
|
3355
|
+
C.OBJECT = function(n) {
|
|
3356
|
+
var e = C[n.type];
|
|
3357
|
+
return A.argument(e !== void 0, "No encoding function for type " + n.type), e(n.value);
|
|
3356
3358
|
};
|
|
3357
|
-
|
|
3358
|
-
var e =
|
|
3359
|
-
return
|
|
3359
|
+
B.OBJECT = function(n) {
|
|
3360
|
+
var e = B[n.type];
|
|
3361
|
+
return A.argument(e !== void 0, "No sizeOf function for type " + n.type), e(n.value);
|
|
3360
3362
|
};
|
|
3361
|
-
|
|
3363
|
+
C.TABLE = function(n) {
|
|
3362
3364
|
for (var e = [], t = n.fields.length, r = [], s = [], i = 0; i < t; i += 1) {
|
|
3363
|
-
var o = n.fields[i], a =
|
|
3364
|
-
|
|
3365
|
+
var o = n.fields[i], a = C[o.type];
|
|
3366
|
+
A.argument(a !== void 0, "No encoding function for field type " + o.type + " (" + o.name + ")");
|
|
3365
3367
|
var c = n[o.name];
|
|
3366
3368
|
c === void 0 && (c = o.value);
|
|
3367
3369
|
var l = a(c);
|
|
@@ -3369,25 +3371,25 @@ I.TABLE = function(n) {
|
|
|
3369
3371
|
}
|
|
3370
3372
|
for (var h = 0; h < r.length; h += 1) {
|
|
3371
3373
|
var d = s[h], u = e.length;
|
|
3372
|
-
|
|
3374
|
+
A.argument(u < 65536, "Table " + n.tableName + " too big."), e[d] = u >> 8, e[d + 1] = u & 255, e = e.concat(r[h]);
|
|
3373
3375
|
}
|
|
3374
3376
|
return e;
|
|
3375
3377
|
};
|
|
3376
|
-
|
|
3378
|
+
B.TABLE = function(n) {
|
|
3377
3379
|
for (var e = 0, t = n.fields.length, r = 0; r < t; r += 1) {
|
|
3378
|
-
var s = n.fields[r], i =
|
|
3379
|
-
|
|
3380
|
+
var s = n.fields[r], i = B[s.type];
|
|
3381
|
+
A.argument(i !== void 0, "No sizeOf function for field type " + s.type + " (" + s.name + ")");
|
|
3380
3382
|
var o = n[s.name];
|
|
3381
3383
|
o === void 0 && (o = s.value), e += i(o), s.type === "TABLE" && (e += 2);
|
|
3382
3384
|
}
|
|
3383
3385
|
return e;
|
|
3384
3386
|
};
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3387
|
+
C.RECORD = C.TABLE;
|
|
3388
|
+
B.RECORD = B.TABLE;
|
|
3389
|
+
C.LITERAL = function(n) {
|
|
3388
3390
|
return n;
|
|
3389
3391
|
};
|
|
3390
|
-
|
|
3392
|
+
B.LITERAL = function(n) {
|
|
3391
3393
|
return n.length;
|
|
3392
3394
|
};
|
|
3393
3395
|
function $(n, e, t) {
|
|
@@ -3403,12 +3405,12 @@ function $(n, e, t) {
|
|
|
3403
3405
|
}
|
|
3404
3406
|
}
|
|
3405
3407
|
$.prototype.encode = function() {
|
|
3406
|
-
return
|
|
3408
|
+
return C.TABLE(this);
|
|
3407
3409
|
};
|
|
3408
3410
|
$.prototype.sizeOf = function() {
|
|
3409
|
-
return
|
|
3411
|
+
return B.TABLE(this);
|
|
3410
3412
|
};
|
|
3411
|
-
function
|
|
3413
|
+
function It(n, e, t) {
|
|
3412
3414
|
t === void 0 && (t = e.length);
|
|
3413
3415
|
var r = new Array(e.length + 1);
|
|
3414
3416
|
r[0] = { name: n + "Count", type: "USHORT", value: t };
|
|
@@ -3434,7 +3436,7 @@ function on(n) {
|
|
|
3434
3436
|
n.format === 1 ? $.call(
|
|
3435
3437
|
this,
|
|
3436
3438
|
"coverageTable",
|
|
3437
|
-
[{ name: "coverageFormat", type: "USHORT", value: 1 }].concat(
|
|
3439
|
+
[{ name: "coverageFormat", type: "USHORT", value: 1 }].concat(It("glyph", n.glyphs))
|
|
3438
3440
|
) : n.format === 2 ? $.call(
|
|
3439
3441
|
this,
|
|
3440
3442
|
"coverageTable",
|
|
@@ -3445,7 +3447,7 @@ function on(n) {
|
|
|
3445
3447
|
{ name: "startCoverageIndex", type: "USHORT", value: e.index }
|
|
3446
3448
|
];
|
|
3447
3449
|
}))
|
|
3448
|
-
) :
|
|
3450
|
+
) : A.assert(!1, "Coverage format must be 1 or 2.");
|
|
3449
3451
|
}
|
|
3450
3452
|
on.prototype = Object.create($.prototype);
|
|
3451
3453
|
on.prototype.constructor = on;
|
|
@@ -3455,13 +3457,13 @@ function an(n) {
|
|
|
3455
3457
|
"scriptListTable",
|
|
3456
3458
|
kt("scriptRecord", n, function(e, t) {
|
|
3457
3459
|
var r = e.script, s = r.defaultLangSys;
|
|
3458
|
-
return
|
|
3460
|
+
return A.assert(!!s, "Unable to write GSUB: script " + e.tag + " has no default language system."), [
|
|
3459
3461
|
{ name: "scriptTag" + t, type: "TAG", value: e.tag },
|
|
3460
3462
|
{ name: "script" + t, type: "TABLE", value: new $("scriptTable", [
|
|
3461
3463
|
{ name: "defaultLangSys", type: "TABLE", value: new $("defaultLangSys", [
|
|
3462
3464
|
{ name: "lookupOrder", type: "USHORT", value: 0 },
|
|
3463
3465
|
{ name: "reqFeatureIndex", type: "USHORT", value: s.reqFeatureIndex }
|
|
3464
|
-
].concat(
|
|
3466
|
+
].concat(It("featureIndex", s.featureIndexes))) }
|
|
3465
3467
|
].concat(kt("langSys", r.langSysRecords, function(i, o) {
|
|
3466
3468
|
var a = i.langSys;
|
|
3467
3469
|
return [
|
|
@@ -3469,7 +3471,7 @@ function an(n) {
|
|
|
3469
3471
|
{ name: "langSys" + o, type: "TABLE", value: new $("langSys", [
|
|
3470
3472
|
{ name: "lookupOrder", type: "USHORT", value: 0 },
|
|
3471
3473
|
{ name: "reqFeatureIndex", type: "USHORT", value: a.reqFeatureIndex }
|
|
3472
|
-
].concat(
|
|
3474
|
+
].concat(It("featureIndex", a.featureIndexes))) }
|
|
3473
3475
|
];
|
|
3474
3476
|
}))) }
|
|
3475
3477
|
];
|
|
@@ -3488,7 +3490,7 @@ function cn(n) {
|
|
|
3488
3490
|
{ name: "featureTag" + t, type: "TAG", value: e.tag },
|
|
3489
3491
|
{ name: "feature" + t, type: "TABLE", value: new $("featureTable", [
|
|
3490
3492
|
{ name: "featureParams", type: "USHORT", value: r.featureParams }
|
|
3491
|
-
].concat(
|
|
3493
|
+
].concat(It("lookupListIndex", r.lookupListIndexes))) }
|
|
3492
3494
|
];
|
|
3493
3495
|
})
|
|
3494
3496
|
);
|
|
@@ -3498,7 +3500,7 @@ cn.prototype.constructor = cn;
|
|
|
3498
3500
|
function ln(n, e) {
|
|
3499
3501
|
$.call(this, "lookupListTable", rr("lookup", n, function(t) {
|
|
3500
3502
|
var r = e[t.lookupType];
|
|
3501
|
-
return
|
|
3503
|
+
return A.assert(!!r, "Unable to write GSUB lookup type " + t.lookupType + " tables."), new $("lookupTable", [
|
|
3502
3504
|
{ name: "lookupType", type: "USHORT", value: t.lookupType },
|
|
3503
3505
|
{ name: "lookupFlag", type: "USHORT", value: t.lookupFlag }
|
|
3504
3506
|
].concat(rr("subtable", t.subtables, r)));
|
|
@@ -3513,7 +3515,7 @@ var k = {
|
|
|
3513
3515
|
ScriptList: an,
|
|
3514
3516
|
FeatureList: cn,
|
|
3515
3517
|
LookupList: ln,
|
|
3516
|
-
ushortList:
|
|
3518
|
+
ushortList: It,
|
|
3517
3519
|
tableList: rr,
|
|
3518
3520
|
recordList: kt
|
|
3519
3521
|
};
|
|
@@ -3529,7 +3531,7 @@ function rc(n, e) {
|
|
|
3529
3531
|
function fr(n, e) {
|
|
3530
3532
|
return n.getUint32(e, !1);
|
|
3531
3533
|
}
|
|
3532
|
-
function
|
|
3534
|
+
function bi(n, e) {
|
|
3533
3535
|
var t = n.getInt16(e, !1), r = n.getUint16(e + 2, !1);
|
|
3534
3536
|
return t + r / 65535;
|
|
3535
3537
|
}
|
|
@@ -3595,7 +3597,7 @@ b.prototype.parseULong = function() {
|
|
|
3595
3597
|
};
|
|
3596
3598
|
b.prototype.parseOffset32 = b.prototype.parseULong;
|
|
3597
3599
|
b.prototype.parseFixed = function() {
|
|
3598
|
-
var n =
|
|
3600
|
+
var n = bi(this.data, this.offset + this.relativeOffset);
|
|
3599
3601
|
return this.relativeOffset += 4, n;
|
|
3600
3602
|
};
|
|
3601
3603
|
b.prototype.parseString = function(n) {
|
|
@@ -3829,7 +3831,7 @@ b.prototype.parseFeatureList = function() {
|
|
|
3829
3831
|
b.prototype.parseLookupList = function(n) {
|
|
3830
3832
|
return this.parsePointer(b.list(b.pointer(function() {
|
|
3831
3833
|
var e = this.parseUShort();
|
|
3832
|
-
|
|
3834
|
+
A.argument(1 <= e && e <= 9, "GPOS/GSUB lookup type " + e + " unknown.");
|
|
3833
3835
|
var t = this.parseUShort(), r = t & 16;
|
|
3834
3836
|
return {
|
|
3835
3837
|
lookupType: e,
|
|
@@ -3842,7 +3844,7 @@ b.prototype.parseLookupList = function(n) {
|
|
|
3842
3844
|
b.prototype.parseFeatureVariationsList = function() {
|
|
3843
3845
|
return this.parsePointer32(function() {
|
|
3844
3846
|
var n = this.parseUShort(), e = this.parseUShort();
|
|
3845
|
-
|
|
3847
|
+
A.argument(n === 1 && e < 1, "GPOS/GSUB feature variations table unknown.");
|
|
3846
3848
|
var t = this.parseRecordList32({
|
|
3847
3849
|
conditionSetOffset: b.offset32,
|
|
3848
3850
|
featureTableSubstitutionOffset: b.offset32
|
|
@@ -3857,7 +3859,7 @@ var M = {
|
|
|
3857
3859
|
getCard16: hn,
|
|
3858
3860
|
getShort: rc,
|
|
3859
3861
|
getULong: fr,
|
|
3860
|
-
getFixed:
|
|
3862
|
+
getFixed: bi,
|
|
3861
3863
|
getTag: sc,
|
|
3862
3864
|
getOffset: ic,
|
|
3863
3865
|
getBytes: oc,
|
|
@@ -3882,7 +3884,7 @@ function hc(n, e, t, r, s) {
|
|
|
3882
3884
|
}
|
|
3883
3885
|
function uc(n, e) {
|
|
3884
3886
|
var t = {};
|
|
3885
|
-
t.version = M.getUShort(n, e),
|
|
3887
|
+
t.version = M.getUShort(n, e), A.argument(t.version === 0, "cmap table version should be 0."), t.numTables = M.getUShort(n, e + 2);
|
|
3886
3888
|
for (var r = -1, s = t.numTables - 1; s >= 0; s -= 1) {
|
|
3887
3889
|
var i = M.getUShort(n, e + 4 + s * 8), o = M.getUShort(n, e + 4 + s * 8 + 2);
|
|
3888
3890
|
if (i === 3 && (o === 0 || o === 1 || o === 10) || i === 0 && (o === 0 || o === 1 || o === 2 || o === 3 || o === 4)) {
|
|
@@ -3980,7 +3982,7 @@ function fc(n) {
|
|
|
3980
3982
|
}
|
|
3981
3983
|
return i;
|
|
3982
3984
|
}
|
|
3983
|
-
var
|
|
3985
|
+
var xi = { parse: uc, make: fc }, en = [
|
|
3984
3986
|
".notdef",
|
|
3985
3987
|
"space",
|
|
3986
3988
|
"exclam",
|
|
@@ -5141,10 +5143,10 @@ var bi = { parse: uc, make: fc }, en = [
|
|
|
5141
5143
|
"ccaron",
|
|
5142
5144
|
"dcroat"
|
|
5143
5145
|
];
|
|
5144
|
-
function
|
|
5146
|
+
function Si(n) {
|
|
5145
5147
|
this.font = n;
|
|
5146
5148
|
}
|
|
5147
|
-
|
|
5149
|
+
Si.prototype.charToGlyphIndex = function(n) {
|
|
5148
5150
|
var e = n.codePointAt(0), t = this.font.glyphs;
|
|
5149
5151
|
if (t) {
|
|
5150
5152
|
for (var r = 0; r < t.length; r += 1)
|
|
@@ -5154,10 +5156,10 @@ xi.prototype.charToGlyphIndex = function(n) {
|
|
|
5154
5156
|
}
|
|
5155
5157
|
return null;
|
|
5156
5158
|
};
|
|
5157
|
-
function
|
|
5159
|
+
function wi(n) {
|
|
5158
5160
|
this.cmap = n;
|
|
5159
5161
|
}
|
|
5160
|
-
|
|
5162
|
+
wi.prototype.charToGlyphIndex = function(n) {
|
|
5161
5163
|
return this.cmap.glyphIndexMap[n.codePointAt(0)] || 0;
|
|
5162
5164
|
};
|
|
5163
5165
|
function un(n, e) {
|
|
@@ -5221,7 +5223,7 @@ function xc(n, e, t, r, s) {
|
|
|
5221
5223
|
}
|
|
5222
5224
|
var Ne = { line: xc };
|
|
5223
5225
|
function Sc(n, e) {
|
|
5224
|
-
var t = e || new
|
|
5226
|
+
var t = e || new W();
|
|
5225
5227
|
return {
|
|
5226
5228
|
configurable: !0,
|
|
5227
5229
|
get: function() {
|
|
@@ -5256,7 +5258,7 @@ oe.prototype.getPath = function(n, e, t, r, s) {
|
|
|
5256
5258
|
var l = 1 / (this.path.unitsPerEm || 1e3) * t;
|
|
5257
5259
|
a === void 0 && (a = l), c === void 0 && (c = l);
|
|
5258
5260
|
}
|
|
5259
|
-
for (var h = new
|
|
5261
|
+
for (var h = new W(), d = 0; d < i.length; d += 1) {
|
|
5260
5262
|
var u = i[d];
|
|
5261
5263
|
u.type === "M" ? h.moveTo(n + u.x * a, e + -u.y * c) : u.type === "L" ? h.lineTo(n + u.x * a, e + -u.y * c) : u.type === "Q" ? h.quadraticCurveTo(
|
|
5262
5264
|
n + u.x1 * a,
|
|
@@ -5281,7 +5283,7 @@ oe.prototype.getContours = function() {
|
|
|
5281
5283
|
var r = this.points[t];
|
|
5282
5284
|
e.push(r), r.lastPointOfContour && (n.push(e), e = []);
|
|
5283
5285
|
}
|
|
5284
|
-
return
|
|
5286
|
+
return A.argument(e.length === 0, "There are still points left in the current contour."), n;
|
|
5285
5287
|
};
|
|
5286
5288
|
oe.prototype.getMetrics = function() {
|
|
5287
5289
|
for (var n = this.path.commands, e = [], t = [], r = 0; r < n.length; r += 1) {
|
|
@@ -5320,7 +5322,7 @@ oe.prototype.drawMetrics = function(n, e, t, r) {
|
|
|
5320
5322
|
var i = this.xMin || 0, o = this.yMin || 0, a = this.xMax || 0, c = this.yMax || 0, l = this.advanceWidth || 0;
|
|
5321
5323
|
n.strokeStyle = "blue", Ne.line(n, e + i * s, -1e4, e + i * s, 1e4), Ne.line(n, e + a * s, -1e4, e + a * s, 1e4), Ne.line(n, -1e4, t + -o * s, 1e4, t + -o * s), Ne.line(n, -1e4, t + -c * s, 1e4, t + -c * s), n.strokeStyle = "green", Ne.line(n, e + l * s, -1e4, e + l * s, 1e4);
|
|
5322
5324
|
};
|
|
5323
|
-
function
|
|
5325
|
+
function jt(n, e, t) {
|
|
5324
5326
|
Object.defineProperty(n, e, {
|
|
5325
5327
|
get: function() {
|
|
5326
5328
|
return n.path, n[t];
|
|
@@ -5365,7 +5367,7 @@ function _c(n, e, t, r, s, i) {
|
|
|
5365
5367
|
t(o, r, s);
|
|
5366
5368
|
var a = i(n.glyphs, o);
|
|
5367
5369
|
return a.unitsPerEm = n.unitsPerEm, a;
|
|
5368
|
-
},
|
|
5370
|
+
}, jt(o, "xMin", "_xMin"), jt(o, "xMax", "_xMax"), jt(o, "yMin", "_yMin"), jt(o, "yMax", "_yMax"), o;
|
|
5369
5371
|
};
|
|
5370
5372
|
}
|
|
5371
5373
|
function Tc(n, e, t, r) {
|
|
@@ -5377,15 +5379,15 @@ function Tc(n, e, t, r) {
|
|
|
5377
5379
|
}, s;
|
|
5378
5380
|
};
|
|
5379
5381
|
}
|
|
5380
|
-
var
|
|
5381
|
-
function
|
|
5382
|
+
var Ce = { GlyphSet: mr, glyphLoader: wc, ttfGlyphLoader: _c, cffGlyphLoader: Tc };
|
|
5383
|
+
function _i(n, e) {
|
|
5382
5384
|
if (n === e)
|
|
5383
5385
|
return !0;
|
|
5384
5386
|
if (Array.isArray(n) && Array.isArray(e)) {
|
|
5385
5387
|
if (n.length !== e.length)
|
|
5386
5388
|
return !1;
|
|
5387
5389
|
for (var t = 0; t < n.length; t += 1)
|
|
5388
|
-
if (!
|
|
5390
|
+
if (!_i(n[t], e[t]))
|
|
5389
5391
|
return !1;
|
|
5390
5392
|
return !0;
|
|
5391
5393
|
} else
|
|
@@ -5395,7 +5397,7 @@ function sr(n) {
|
|
|
5395
5397
|
var e;
|
|
5396
5398
|
return n.length < 1240 ? e = 107 : n.length < 33900 ? e = 1131 : e = 32768, e;
|
|
5397
5399
|
}
|
|
5398
|
-
function
|
|
5400
|
+
function Ae(n, e, t) {
|
|
5399
5401
|
var r = [], s = [], i = M.getCard16(n, e), o, a;
|
|
5400
5402
|
if (i !== 0) {
|
|
5401
5403
|
var c = M.getByte(n, e + 2);
|
|
@@ -5411,7 +5413,7 @@ function Be(n, e, t) {
|
|
|
5411
5413
|
}
|
|
5412
5414
|
return { objects: s, startOffset: e, endOffset: a };
|
|
5413
5415
|
}
|
|
5414
|
-
function
|
|
5416
|
+
function Cc(n, e) {
|
|
5415
5417
|
var t = [], r = M.getCard16(n, e), s, i;
|
|
5416
5418
|
if (r !== 0) {
|
|
5417
5419
|
var o = M.getByte(n, e + 2);
|
|
@@ -5423,7 +5425,7 @@ function Ic(n, e) {
|
|
|
5423
5425
|
i = e + 2;
|
|
5424
5426
|
return { offsets: t, startOffset: e, endOffset: i };
|
|
5425
5427
|
}
|
|
5426
|
-
function
|
|
5428
|
+
function Ic(n, e, t, r, s) {
|
|
5427
5429
|
var i = M.getCard16(t, r), o = 0;
|
|
5428
5430
|
if (i !== 0) {
|
|
5429
5431
|
var a = M.getByte(t, r + 2);
|
|
@@ -5466,7 +5468,7 @@ function Mc(n) {
|
|
|
5466
5468
|
}
|
|
5467
5469
|
return e;
|
|
5468
5470
|
}
|
|
5469
|
-
function
|
|
5471
|
+
function Ti(n, e, t) {
|
|
5470
5472
|
e = e !== void 0 ? e : 0;
|
|
5471
5473
|
var r = new M.Parser(n, e), s = [], i = [];
|
|
5472
5474
|
for (t = t !== void 0 ? t : n.length; r.relativeOffset < t; ) {
|
|
@@ -5478,7 +5480,7 @@ function _i(n, e, t) {
|
|
|
5478
5480
|
function _t(n, e) {
|
|
5479
5481
|
return e <= 390 ? e = en[e] : e = n[e - 391], e;
|
|
5480
5482
|
}
|
|
5481
|
-
function
|
|
5483
|
+
function Ci(n, e, t) {
|
|
5482
5484
|
for (var r = {}, s, i = 0; i < e.length; i += 1) {
|
|
5483
5485
|
var o = e[i];
|
|
5484
5486
|
if (Array.isArray(o.type)) {
|
|
@@ -5492,7 +5494,7 @@ function Ti(n, e, t) {
|
|
|
5492
5494
|
}
|
|
5493
5495
|
return r;
|
|
5494
5496
|
}
|
|
5495
|
-
function
|
|
5497
|
+
function Ac(n, e) {
|
|
5496
5498
|
var t = {};
|
|
5497
5499
|
return t.formatMajor = M.getCard8(n, e), t.formatMinor = M.getCard8(n, e + 1), t.size = M.getCard8(n, e + 2), t.offsetSize = M.getCard8(n, e + 3), t.startOffset = e, t.endOffset = e + 4, t;
|
|
5498
5500
|
}
|
|
@@ -5532,28 +5534,28 @@ var Ii = [
|
|
|
5532
5534
|
{ name: "fdArray", op: 1236, type: "offset" },
|
|
5533
5535
|
{ name: "fdSelect", op: 1237, type: "offset" },
|
|
5534
5536
|
{ name: "fontName", op: 1238, type: "SID" }
|
|
5535
|
-
],
|
|
5537
|
+
], ki = [
|
|
5536
5538
|
{ name: "subrs", op: 19, type: "offset", value: 0 },
|
|
5537
5539
|
{ name: "defaultWidthX", op: 20, type: "number", value: 0 },
|
|
5538
5540
|
{ name: "nominalWidthX", op: 21, type: "number", value: 0 }
|
|
5539
5541
|
];
|
|
5540
|
-
function
|
|
5541
|
-
var t =
|
|
5542
|
-
return
|
|
5542
|
+
function Bc(n, e) {
|
|
5543
|
+
var t = Ti(n, 0, n.byteLength);
|
|
5544
|
+
return Ci(t, Ii, e);
|
|
5543
5545
|
}
|
|
5544
|
-
function
|
|
5545
|
-
var s =
|
|
5546
|
-
return
|
|
5546
|
+
function Ei(n, e, t, r) {
|
|
5547
|
+
var s = Ti(n, e, t);
|
|
5548
|
+
return Ci(s, ki, r);
|
|
5547
5549
|
}
|
|
5548
5550
|
function Zr(n, e, t, r) {
|
|
5549
5551
|
for (var s = [], i = 0; i < t.length; i += 1) {
|
|
5550
|
-
var o = new DataView(new Uint8Array(t[i]).buffer), a =
|
|
5552
|
+
var o = new DataView(new Uint8Array(t[i]).buffer), a = Bc(o, r);
|
|
5551
5553
|
a._subrs = [], a._subrsBias = 0, a._defaultWidthX = 0, a._nominalWidthX = 0;
|
|
5552
5554
|
var c = a.private[0], l = a.private[1];
|
|
5553
5555
|
if (c !== 0 && l !== 0) {
|
|
5554
|
-
var h =
|
|
5556
|
+
var h = Ei(n, l + e, c, r);
|
|
5555
5557
|
if (a._defaultWidthX = h.defaultWidthX, a._nominalWidthX = h.nominalWidthX, h.subrs !== 0) {
|
|
5556
|
-
var d = l + h.subrs, u =
|
|
5558
|
+
var d = l + h.subrs, u = Ae(n, d + e);
|
|
5557
5559
|
a._subrs = u.objects, a._subrsBias = sr(a._subrs);
|
|
5558
5560
|
}
|
|
5559
5561
|
a._privateDict = h;
|
|
@@ -5601,23 +5603,23 @@ function Oc(n, e, t) {
|
|
|
5601
5603
|
return new un(s, t);
|
|
5602
5604
|
}
|
|
5603
5605
|
function Qr(n, e, t) {
|
|
5604
|
-
var r, s, i, o, a = new
|
|
5606
|
+
var r, s, i, o, a = new W(), c = [], l = 0, h = !1, d = !1, u = 0, p = 0, f, m, y, v;
|
|
5605
5607
|
if (n.isCIDFont) {
|
|
5606
5608
|
var S = n.tables.cff.topDict._fdSelect[e.index], x = n.tables.cff.topDict._fdArray[S];
|
|
5607
5609
|
f = x._subrs, m = x._subrsBias, y = x._defaultWidthX, v = x._nominalWidthX;
|
|
5608
5610
|
} else
|
|
5609
5611
|
f = n.tables.cff.topDict._subrs, m = n.tables.cff.topDict._subrsBias, y = n.tables.cff.topDict._defaultWidthX, v = n.tables.cff.topDict._nominalWidthX;
|
|
5610
5612
|
var _ = y;
|
|
5611
|
-
function w(
|
|
5612
|
-
d && a.closePath(), a.moveTo(
|
|
5613
|
+
function w(I, O) {
|
|
5614
|
+
d && a.closePath(), a.moveTo(I, O), d = !0;
|
|
5613
5615
|
}
|
|
5614
5616
|
function L() {
|
|
5615
|
-
var
|
|
5616
|
-
|
|
5617
|
+
var I;
|
|
5618
|
+
I = c.length % 2 !== 0, I && !h && (_ = c.shift() + v), l += c.length >> 1, c.length = 0, h = !0;
|
|
5617
5619
|
}
|
|
5618
|
-
function T(
|
|
5619
|
-
for (var O, G, Q, ee, Y, U, N, F, H, q, X, J, R = 0; R <
|
|
5620
|
-
var Z =
|
|
5620
|
+
function T(I) {
|
|
5621
|
+
for (var O, G, Q, ee, Y, U, N, F, H, q, X, J, R = 0; R < I.length; ) {
|
|
5622
|
+
var Z = I[R];
|
|
5621
5623
|
switch (R += 1, Z) {
|
|
5622
5624
|
case 1:
|
|
5623
5625
|
L();
|
|
@@ -5650,7 +5652,7 @@ function Qr(n, e, t) {
|
|
|
5650
5652
|
case 11:
|
|
5651
5653
|
return;
|
|
5652
5654
|
case 12:
|
|
5653
|
-
switch (Z =
|
|
5655
|
+
switch (Z = I[R], R += 1, Z) {
|
|
5654
5656
|
case 35:
|
|
5655
5657
|
r = u + c.shift(), s = p + c.shift(), i = r + c.shift(), o = s + c.shift(), N = i + c.shift(), F = o + c.shift(), H = N + c.shift(), q = F + c.shift(), X = H + c.shift(), J = q + c.shift(), u = X + c.shift(), p = J + c.shift(), c.shift(), a.curveTo(r, s, i, o, N, F), a.curveTo(H, q, X, J, u, p);
|
|
5656
5658
|
break;
|
|
@@ -5705,7 +5707,7 @@ function Qr(n, e, t) {
|
|
|
5705
5707
|
r = u + c.shift(), s = p, i = r + c.shift(), o = s + c.shift(), u = i + c.shift(), p = o, a.curveTo(r, s, i, o, u, p);
|
|
5706
5708
|
break;
|
|
5707
5709
|
case 28:
|
|
5708
|
-
O =
|
|
5710
|
+
O = I[R], G = I[R + 1], c.push((O << 24 | G << 16) >> 16), R += 2;
|
|
5709
5711
|
break;
|
|
5710
5712
|
case 29:
|
|
5711
5713
|
Y = c.pop() + n.gsubrsBias, U = n.gsubrs[Y], U && T(U);
|
|
@@ -5719,7 +5721,7 @@ function Qr(n, e, t) {
|
|
|
5719
5721
|
r = u, s = p + c.shift(), i = r + c.shift(), o = s + c.shift(), u = i + c.shift(), p = o + (c.length === 1 ? c.shift() : 0), a.curveTo(r, s, i, o, u, p);
|
|
5720
5722
|
break;
|
|
5721
5723
|
default:
|
|
5722
|
-
Z < 32 ? console.log("Glyph " + e.index + ": unknown operator " + Z) : Z < 247 ? c.push(Z - 139) : Z < 251 ? (O =
|
|
5724
|
+
Z < 32 ? console.log("Glyph " + e.index + ": unknown operator " + Z) : Z < 247 ? c.push(Z - 139) : Z < 251 ? (O = I[R], R += 1, c.push((Z - 247) * 256 + O + 108)) : Z < 255 ? (O = I[R], R += 1, c.push(-(Z - 251) * 256 - O - 108)) : (O = I[R], G = I[R + 1], Q = I[R + 2], ee = I[R + 3], R += 4, c.push((O << 24 | G << 16 | Q << 8 | ee) / 65536));
|
|
5723
5725
|
}
|
|
5724
5726
|
}
|
|
5725
5727
|
}
|
|
@@ -5754,7 +5756,7 @@ function Dc(n, e, t, r) {
|
|
|
5754
5756
|
}
|
|
5755
5757
|
function Rc(n, e, t, r) {
|
|
5756
5758
|
t.tables.cff = {};
|
|
5757
|
-
var s =
|
|
5759
|
+
var s = Ac(n, e), i = Ae(n, s.endOffset, M.bytesToString), o = Ae(n, i.endOffset), a = Ae(n, o.endOffset, M.bytesToString), c = Ae(n, a.endOffset);
|
|
5758
5760
|
t.gsubrs = c.objects, t.gsubrsBias = sr(t.gsubrs);
|
|
5759
5761
|
var l = Zr(n, e, o.objects, a.objects);
|
|
5760
5762
|
if (l.length !== 1)
|
|
@@ -5765,30 +5767,30 @@ function Rc(n, e, t, r) {
|
|
|
5765
5767
|
if (d === 0 || u === 0)
|
|
5766
5768
|
throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
|
|
5767
5769
|
d += e;
|
|
5768
|
-
var p =
|
|
5770
|
+
var p = Ae(n, d), f = Zr(n, e, p.objects, a.objects);
|
|
5769
5771
|
h._fdArray = f, u += e, h._fdSelect = Dc(n, u, t.numGlyphs, f.length);
|
|
5770
5772
|
}
|
|
5771
|
-
var m = e + h.private[1], y =
|
|
5773
|
+
var m = e + h.private[1], y = Ei(n, m, h.private[0], a.objects);
|
|
5772
5774
|
if (t.defaultWidthX = y.defaultWidthX, t.nominalWidthX = y.nominalWidthX, y.subrs !== 0) {
|
|
5773
|
-
var v = m + y.subrs, S =
|
|
5775
|
+
var v = m + y.subrs, S = Ae(n, v);
|
|
5774
5776
|
t.subrs = S.objects, t.subrsBias = sr(t.subrs);
|
|
5775
5777
|
} else
|
|
5776
5778
|
t.subrs = [], t.subrsBias = 0;
|
|
5777
5779
|
var x;
|
|
5778
|
-
r.lowMemory ? (x =
|
|
5780
|
+
r.lowMemory ? (x = Cc(n, e + h.charStrings), t.nGlyphs = x.offsets.length) : (x = Ae(n, e + h.charStrings), t.nGlyphs = x.objects.length);
|
|
5779
5781
|
var _ = Lc(n, e + h.charset, t.nGlyphs, a.objects);
|
|
5780
|
-
if (h.encoding === 0 ? t.cffEncoding = new un(gc, _) : h.encoding === 1 ? t.cffEncoding = new un(mc, _) : t.cffEncoding = Oc(n, e + h.encoding, _), t.encoding = t.encoding || t.cffEncoding, t.glyphs = new
|
|
5782
|
+
if (h.encoding === 0 ? t.cffEncoding = new un(gc, _) : h.encoding === 1 ? t.cffEncoding = new un(mc, _) : t.cffEncoding = Oc(n, e + h.encoding, _), t.encoding = t.encoding || t.cffEncoding, t.glyphs = new Ce.GlyphSet(t), r.lowMemory)
|
|
5781
5783
|
t._push = function(T) {
|
|
5782
|
-
var
|
|
5783
|
-
t.glyphs.push(T,
|
|
5784
|
+
var I = Ic(T, x.offsets, n, e + h.charStrings);
|
|
5785
|
+
t.glyphs.push(T, Ce.cffGlyphLoader(t, T, Qr, I));
|
|
5784
5786
|
};
|
|
5785
5787
|
else
|
|
5786
5788
|
for (var w = 0; w < t.nGlyphs; w += 1) {
|
|
5787
5789
|
var L = x.objects[w];
|
|
5788
|
-
t.glyphs.push(w,
|
|
5790
|
+
t.glyphs.push(w, Ce.cffGlyphLoader(t, w, Qr, L));
|
|
5789
5791
|
}
|
|
5790
5792
|
}
|
|
5791
|
-
function
|
|
5793
|
+
function Mi(n, e) {
|
|
5792
5794
|
var t, r = en.indexOf(n);
|
|
5793
5795
|
return r >= 0 && (t = r), r = e.indexOf(n), r >= 0 ? t = r + en.length : (t = en.length + e.length, e.push(n)), t;
|
|
5794
5796
|
}
|
|
@@ -5809,10 +5811,10 @@ function Fc(n) {
|
|
|
5809
5811
|
e.names.push({ name: "name_" + t, type: "NAME", value: n[t] });
|
|
5810
5812
|
return e;
|
|
5811
5813
|
}
|
|
5812
|
-
function
|
|
5814
|
+
function Ai(n, e, t) {
|
|
5813
5815
|
for (var r = {}, s = 0; s < n.length; s += 1) {
|
|
5814
5816
|
var i = n[s], o = e[i.name];
|
|
5815
|
-
o !== void 0 && !
|
|
5817
|
+
o !== void 0 && !_i(o, i.value) && (i.type === "SID" && (o = Mi(o, t)), r[i.op] = { name: i.name, type: i.type, value: o });
|
|
5816
5818
|
}
|
|
5817
5819
|
return r;
|
|
5818
5820
|
}
|
|
@@ -5820,7 +5822,7 @@ function Jr(n, e) {
|
|
|
5820
5822
|
var t = new k.Record("Top DICT", [
|
|
5821
5823
|
{ name: "dict", type: "DICT", value: {} }
|
|
5822
5824
|
]);
|
|
5823
|
-
return t.dict =
|
|
5825
|
+
return t.dict = Ai(Ii, n, e), t;
|
|
5824
5826
|
}
|
|
5825
5827
|
function Kr(n) {
|
|
5826
5828
|
var e = new k.Record("Top DICT INDEX", [
|
|
@@ -5846,7 +5848,7 @@ function Nc(n, e) {
|
|
|
5846
5848
|
for (var t = new k.Record("Charsets", [
|
|
5847
5849
|
{ name: "format", type: "Card8", value: 0 }
|
|
5848
5850
|
]), r = 0; r < n.length; r += 1) {
|
|
5849
|
-
var s = n[r], i =
|
|
5851
|
+
var s = n[r], i = Mi(s, e);
|
|
5850
5852
|
t.fields.push({ name: "glyph_" + r, type: "SID", value: i });
|
|
5851
5853
|
}
|
|
5852
5854
|
return t;
|
|
@@ -5892,9 +5894,9 @@ function Hc(n, e) {
|
|
|
5892
5894
|
var t = new k.Record("Private DICT", [
|
|
5893
5895
|
{ name: "dict", type: "DICT", value: {} }
|
|
5894
5896
|
]);
|
|
5895
|
-
return t.dict =
|
|
5897
|
+
return t.dict = Ai(ki, n, e), t;
|
|
5896
5898
|
}
|
|
5897
|
-
function
|
|
5899
|
+
function jc(n, e) {
|
|
5898
5900
|
for (var t = new k.Table("CFF ", [
|
|
5899
5901
|
{ name: "header", type: "RECORD" },
|
|
5900
5902
|
{ name: "nameIndex", type: "RECORD" },
|
|
@@ -5924,10 +5926,10 @@ function Wc(n, e) {
|
|
|
5924
5926
|
var d = t.header.sizeOf() + t.nameIndex.sizeOf() + t.topDictIndex.sizeOf() + t.stringIndex.sizeOf() + t.globalSubrIndex.sizeOf();
|
|
5925
5927
|
return s.charset = d, s.encoding = 0, s.charStrings = s.charset + t.charsets.sizeOf(), s.private[1] = s.charStrings + t.charStringsIndex.sizeOf(), h = Jr(s, l), t.topDictIndex = Kr(h), t;
|
|
5926
5928
|
}
|
|
5927
|
-
var Bi = { parse: Rc, make:
|
|
5928
|
-
function
|
|
5929
|
+
var Bi = { parse: Rc, make: jc };
|
|
5930
|
+
function Wc(n, e) {
|
|
5929
5931
|
var t = {}, r = new M.Parser(n, e);
|
|
5930
|
-
return t.version = r.parseVersion(), t.fontRevision = Math.round(r.parseFixed() * 1e3) / 1e3, t.checkSumAdjustment = r.parseULong(), t.magicNumber = r.parseULong(),
|
|
5932
|
+
return t.version = r.parseVersion(), t.fontRevision = Math.round(r.parseFixed() * 1e3) / 1e3, t.checkSumAdjustment = r.parseULong(), t.magicNumber = r.parseULong(), A.argument(t.magicNumber === 1594834165, "Font header has wrong magic number."), t.flags = r.parseUShort(), t.unitsPerEm = r.parseUShort(), t.created = r.parseLongDateTime(), t.modified = r.parseLongDateTime(), t.xMin = r.parseShort(), t.yMin = r.parseShort(), t.xMax = r.parseShort(), t.yMax = r.parseShort(), t.macStyle = r.parseUShort(), t.lowestRecPPEM = r.parseUShort(), t.fontDirectionHint = r.parseShort(), t.indexToLocFormat = r.parseShort(), t.glyphDataFormat = r.parseShort(), t;
|
|
5931
5933
|
}
|
|
5932
5934
|
function Xc(n) {
|
|
5933
5935
|
var e = Math.round((/* @__PURE__ */ new Date()).getTime() / 1e3) + 2082844800, t = e;
|
|
@@ -5951,7 +5953,7 @@ function Xc(n) {
|
|
|
5951
5953
|
{ name: "glyphDataFormat", type: "SHORT", value: 0 }
|
|
5952
5954
|
], n);
|
|
5953
5955
|
}
|
|
5954
|
-
var
|
|
5956
|
+
var Li = { parse: Wc, make: Xc };
|
|
5955
5957
|
function $c(n, e) {
|
|
5956
5958
|
var t = {}, r = new M.Parser(n, e);
|
|
5957
5959
|
return t.version = r.parseVersion(), t.ascender = r.parseShort(), t.descender = r.parseShort(), t.lineGap = r.parseShort(), t.advanceWidthMax = r.parseUShort(), t.minLeftSideBearing = r.parseShort(), t.minRightSideBearing = r.parseShort(), t.xMaxExtent = r.parseShort(), t.caretSlopeRise = r.parseShort(), t.caretSlopeRun = r.parseShort(), t.caretOffset = r.parseShort(), r.relativeOffset += 8, t.metricDataFormat = r.parseShort(), t.numberOfHMetrics = r.parseUShort(), t;
|
|
@@ -5977,7 +5979,7 @@ function Yc(n) {
|
|
|
5977
5979
|
{ name: "numberOfHMetrics", type: "USHORT", value: 0 }
|
|
5978
5980
|
], n);
|
|
5979
5981
|
}
|
|
5980
|
-
var
|
|
5982
|
+
var Oi = { parse: $c, make: Yc };
|
|
5981
5983
|
function qc(n, e, t, r, s) {
|
|
5982
5984
|
for (var i, o, a = new M.Parser(n, e), c = 0; c < r; c += 1) {
|
|
5983
5985
|
c < t && (i = a.parseUShort(), o = a.parseShort());
|
|
@@ -6003,7 +6005,7 @@ function Jc(n) {
|
|
|
6003
6005
|
}
|
|
6004
6006
|
return e;
|
|
6005
6007
|
}
|
|
6006
|
-
var
|
|
6008
|
+
var Di = { parse: Qc, make: Jc };
|
|
6007
6009
|
function Kc(n) {
|
|
6008
6010
|
for (var e = new k.Table("ltag", [
|
|
6009
6011
|
{ name: "version", type: "ULONG", value: 1 },
|
|
@@ -6017,7 +6019,7 @@ function Kc(n) {
|
|
|
6017
6019
|
}
|
|
6018
6020
|
function el(n, e) {
|
|
6019
6021
|
var t = new M.Parser(n, e), r = t.parseULong();
|
|
6020
|
-
|
|
6022
|
+
A.argument(r === 1, "Unsupported ltag table version."), t.skip("uLong", 1);
|
|
6021
6023
|
for (var s = t.parseULong(), i = [], o = 0; o < s; o++) {
|
|
6022
6024
|
for (var a = "", c = e + t.parseUShort(), l = t.parseUShort(), h = c; h < c + l; ++h)
|
|
6023
6025
|
a += String.fromCharCode(n.getInt8(h));
|
|
@@ -6025,7 +6027,7 @@ function el(n, e) {
|
|
|
6025
6027
|
}
|
|
6026
6028
|
return i;
|
|
6027
6029
|
}
|
|
6028
|
-
var
|
|
6030
|
+
var Ri = { make: Kc, parse: el };
|
|
6029
6031
|
function tl(n, e) {
|
|
6030
6032
|
var t = {}, r = new M.Parser(n, e);
|
|
6031
6033
|
return t.version = r.parseVersion(), t.numGlyphs = r.parseUShort(), t.version === 1 && (t.maxPoints = r.parseUShort(), t.maxContours = r.parseUShort(), t.maxCompositePoints = r.parseUShort(), t.maxCompositeContours = r.parseUShort(), t.maxZones = r.parseUShort(), t.maxTwilightPoints = r.parseUShort(), t.maxStorage = r.parseUShort(), t.maxFunctionDefs = r.parseUShort(), t.maxInstructionDefs = r.parseUShort(), t.maxStackElements = r.parseUShort(), t.maxSizeOfInstructions = r.parseUShort(), t.maxComponentElements = r.parseUShort(), t.maxComponentDepth = r.parseUShort()), t;
|
|
@@ -6036,7 +6038,7 @@ function nl(n) {
|
|
|
6036
6038
|
{ name: "numGlyphs", type: "USHORT", value: n }
|
|
6037
6039
|
]);
|
|
6038
6040
|
}
|
|
6039
|
-
var
|
|
6041
|
+
var Ui = { parse: tl, make: nl }, Fi = [
|
|
6040
6042
|
"copyright",
|
|
6041
6043
|
// 0
|
|
6042
6044
|
"fontFamily",
|
|
@@ -6083,7 +6085,7 @@ var Ri = { parse: tl, make: nl }, Ui = [
|
|
|
6083
6085
|
// 21
|
|
6084
6086
|
"wwsSubfamily"
|
|
6085
6087
|
// 22
|
|
6086
|
-
],
|
|
6088
|
+
], Pi = {
|
|
6087
6089
|
0: "en",
|
|
6088
6090
|
1: "fr",
|
|
6089
6091
|
2: "de",
|
|
@@ -6442,7 +6444,7 @@ var Ri = { parse: tl, make: nl }, Ui = [
|
|
|
6442
6444
|
// langAzerbaijanRoman → smRoman
|
|
6443
6445
|
151: 0
|
|
6444
6446
|
// langNynorsk → smRoman
|
|
6445
|
-
},
|
|
6447
|
+
}, Gi = {
|
|
6446
6448
|
1078: "af",
|
|
6447
6449
|
1052: "sq",
|
|
6448
6450
|
1156: "gsw",
|
|
@@ -6665,9 +6667,9 @@ function sl(n, e, t) {
|
|
|
6665
6667
|
return t[e];
|
|
6666
6668
|
break;
|
|
6667
6669
|
case 1:
|
|
6668
|
-
return Fi[e];
|
|
6669
|
-
case 3:
|
|
6670
6670
|
return Pi[e];
|
|
6671
|
+
case 3:
|
|
6672
|
+
return Gi[e];
|
|
6671
6673
|
}
|
|
6672
6674
|
}
|
|
6673
6675
|
var ir = "utf-16", il = {
|
|
@@ -6761,7 +6763,7 @@ var ir = "utf-16", il = {
|
|
|
6761
6763
|
146: "x-mac-gaelic"
|
|
6762
6764
|
// langIrishGaelicScript
|
|
6763
6765
|
};
|
|
6764
|
-
function
|
|
6766
|
+
function Ni(n, e, t) {
|
|
6765
6767
|
switch (n) {
|
|
6766
6768
|
case 0:
|
|
6767
6769
|
return ir;
|
|
@@ -6775,7 +6777,7 @@ function Gi(n, e, t) {
|
|
|
6775
6777
|
}
|
|
6776
6778
|
function al(n, e, t) {
|
|
6777
6779
|
for (var r = {}, s = new M.Parser(n, e), i = s.parseUShort(), o = s.parseUShort(), a = s.offset + s.parseUShort(), c = 0; c < o; c++) {
|
|
6778
|
-
var l = s.parseUShort(), h = s.parseUShort(), d = s.parseUShort(), u = s.parseUShort(), p =
|
|
6780
|
+
var l = s.parseUShort(), h = s.parseUShort(), d = s.parseUShort(), u = s.parseUShort(), p = Fi[u] || u, f = s.parseUShort(), m = s.parseUShort(), y = sl(l, d, t), v = Ni(l, h, d);
|
|
6779
6781
|
if (v !== void 0 && y !== void 0) {
|
|
6780
6782
|
var S = void 0;
|
|
6781
6783
|
if (v === ir ? S = ct.UTF16(n, a + m, f) : S = ct.MACSTRING(n, a + m, f, v), S) {
|
|
@@ -6786,7 +6788,7 @@ function al(n, e, t) {
|
|
|
6786
6788
|
}
|
|
6787
6789
|
return i === 1 && s.parseUShort(), r;
|
|
6788
6790
|
}
|
|
6789
|
-
function
|
|
6791
|
+
function In(n) {
|
|
6790
6792
|
var e = {};
|
|
6791
6793
|
for (var t in n)
|
|
6792
6794
|
e[n[t]] = parseInt(t);
|
|
@@ -6824,19 +6826,19 @@ function ts(n, e) {
|
|
|
6824
6826
|
return t;
|
|
6825
6827
|
}
|
|
6826
6828
|
function ll(n, e) {
|
|
6827
|
-
var t, r = [], s = {}, i =
|
|
6829
|
+
var t, r = [], s = {}, i = In(Fi);
|
|
6828
6830
|
for (var o in n) {
|
|
6829
6831
|
var a = i[o];
|
|
6830
6832
|
if (a === void 0 && (a = o), t = parseInt(a), isNaN(t))
|
|
6831
6833
|
throw new Error('Name table entry "' + o + '" does not exist, see nameTableNames for complete list.');
|
|
6832
6834
|
s[t] = n[o], r.push(t);
|
|
6833
6835
|
}
|
|
6834
|
-
for (var c =
|
|
6836
|
+
for (var c = In(Pi), l = In(Gi), h = [], d = [], u = 0; u < r.length; u++) {
|
|
6835
6837
|
t = r[u];
|
|
6836
6838
|
var p = s[t];
|
|
6837
6839
|
for (var f in p) {
|
|
6838
|
-
var m = p[f], y = 1, v = c[f], S = rl[v], x =
|
|
6839
|
-
_ === void 0 && (y = 0, v = e.indexOf(f), v < 0 && (v = e.length, e.push(f)), S = 4, _ =
|
|
6840
|
+
var m = p[f], y = 1, v = c[f], S = rl[v], x = Ni(y, S, v), _ = C.MACSTRING(m, x);
|
|
6841
|
+
_ === void 0 && (y = 0, v = e.indexOf(f), v < 0 && (v = e.length, e.push(f)), S = 4, _ = C.UTF16(m));
|
|
6840
6842
|
var w = ts(_, d);
|
|
6841
6843
|
h.push(es(
|
|
6842
6844
|
y,
|
|
@@ -6848,14 +6850,14 @@ function ll(n, e) {
|
|
|
6848
6850
|
));
|
|
6849
6851
|
var L = l[f];
|
|
6850
6852
|
if (L !== void 0) {
|
|
6851
|
-
var T =
|
|
6853
|
+
var T = C.UTF16(m), I = ts(T, d);
|
|
6852
6854
|
h.push(es(
|
|
6853
6855
|
3,
|
|
6854
6856
|
1,
|
|
6855
6857
|
L,
|
|
6856
6858
|
t,
|
|
6857
6859
|
T.length,
|
|
6858
|
-
|
|
6860
|
+
I
|
|
6859
6861
|
));
|
|
6860
6862
|
}
|
|
6861
6863
|
}
|
|
@@ -6871,7 +6873,7 @@ function ll(n, e) {
|
|
|
6871
6873
|
O.fields.push({ name: "record_" + G, type: "RECORD", value: h[G] });
|
|
6872
6874
|
return O.fields.push({ name: "strings", type: "LITERAL", value: d }), O;
|
|
6873
6875
|
}
|
|
6874
|
-
var
|
|
6876
|
+
var zi = { parse: al, make: ll }, or = [
|
|
6875
6877
|
{ begin: 0, end: 127 },
|
|
6876
6878
|
// Basic Latin
|
|
6877
6879
|
{ begin: 128, end: 255 },
|
|
@@ -7223,7 +7225,7 @@ function fl() {
|
|
|
7223
7225
|
{ name: "maxMemType1", type: "ULONG", value: 0 }
|
|
7224
7226
|
]);
|
|
7225
7227
|
}
|
|
7226
|
-
var
|
|
7228
|
+
var Vi = { parse: pl, make: fl }, de = new Array(9);
|
|
7227
7229
|
de[1] = function() {
|
|
7228
7230
|
var n = this.offset + this.relativeOffset, e = this.parseUShort();
|
|
7229
7231
|
if (e === 1)
|
|
@@ -7238,11 +7240,11 @@ de[1] = function() {
|
|
|
7238
7240
|
coverage: this.parsePointer(b.coverage),
|
|
7239
7241
|
substitute: this.parseOffset16List()
|
|
7240
7242
|
};
|
|
7241
|
-
|
|
7243
|
+
A.assert(!1, "0x" + n.toString(16) + ": lookup type 1 format must be 1 or 2.");
|
|
7242
7244
|
};
|
|
7243
7245
|
de[2] = function() {
|
|
7244
7246
|
var n = this.parseUShort();
|
|
7245
|
-
return
|
|
7247
|
+
return A.argument(n === 1, "GSUB Multiple Substitution Subtable identifier-format must be 1"), {
|
|
7246
7248
|
substFormat: n,
|
|
7247
7249
|
coverage: this.parsePointer(b.coverage),
|
|
7248
7250
|
sequences: this.parseListOfLists()
|
|
@@ -7250,7 +7252,7 @@ de[2] = function() {
|
|
|
7250
7252
|
};
|
|
7251
7253
|
de[3] = function() {
|
|
7252
7254
|
var n = this.parseUShort();
|
|
7253
|
-
return
|
|
7255
|
+
return A.argument(n === 1, "GSUB Alternate Substitution Subtable identifier-format must be 1"), {
|
|
7254
7256
|
substFormat: n,
|
|
7255
7257
|
coverage: this.parsePointer(b.coverage),
|
|
7256
7258
|
alternateSets: this.parseListOfLists()
|
|
@@ -7258,7 +7260,7 @@ de[3] = function() {
|
|
|
7258
7260
|
};
|
|
7259
7261
|
de[4] = function() {
|
|
7260
7262
|
var n = this.parseUShort();
|
|
7261
|
-
return
|
|
7263
|
+
return A.argument(n === 1, "GSUB ligature table identifier-format must be 1"), {
|
|
7262
7264
|
substFormat: n,
|
|
7263
7265
|
coverage: this.parsePointer(b.coverage),
|
|
7264
7266
|
ligatureSets: this.parseListOfLists(function() {
|
|
@@ -7308,7 +7310,7 @@ de[5] = function() {
|
|
|
7308
7310
|
lookupRecords: this.parseRecordList(r, ot)
|
|
7309
7311
|
};
|
|
7310
7312
|
}
|
|
7311
|
-
|
|
7313
|
+
A.assert(!1, "0x" + n.toString(16) + ": lookup type 5 format must be 1, 2 or 3.");
|
|
7312
7314
|
};
|
|
7313
7315
|
de[6] = function() {
|
|
7314
7316
|
var n = this.offset + this.relativeOffset, e = this.parseUShort();
|
|
@@ -7349,11 +7351,11 @@ de[6] = function() {
|
|
|
7349
7351
|
lookaheadCoverage: this.parseList(b.pointer(b.coverage)),
|
|
7350
7352
|
lookupRecords: this.parseRecordList(ot)
|
|
7351
7353
|
};
|
|
7352
|
-
|
|
7354
|
+
A.assert(!1, "0x" + n.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
|
|
7353
7355
|
};
|
|
7354
7356
|
de[7] = function() {
|
|
7355
7357
|
var n = this.parseUShort();
|
|
7356
|
-
|
|
7358
|
+
A.argument(n === 1, "GSUB Extension Substitution subtable identifier-format must be 1");
|
|
7357
7359
|
var e = this.parseUShort(), t = new b(this.data, this.offset + this.parseULong());
|
|
7358
7360
|
return {
|
|
7359
7361
|
substFormat: 1,
|
|
@@ -7363,7 +7365,7 @@ de[7] = function() {
|
|
|
7363
7365
|
};
|
|
7364
7366
|
de[8] = function() {
|
|
7365
7367
|
var n = this.parseUShort();
|
|
7366
|
-
return
|
|
7368
|
+
return A.argument(n === 1, "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"), {
|
|
7367
7369
|
substFormat: n,
|
|
7368
7370
|
coverage: this.parsePointer(b.coverage),
|
|
7369
7371
|
backtrackCoverage: this.parseList(b.pointer(b.coverage)),
|
|
@@ -7374,7 +7376,7 @@ de[8] = function() {
|
|
|
7374
7376
|
function gl(n, e) {
|
|
7375
7377
|
e = e || 0;
|
|
7376
7378
|
var t = new b(n, e), r = t.parseVersion(1);
|
|
7377
|
-
return
|
|
7379
|
+
return A.argument(r === 1 || r === 1.1, "Unsupported GSUB table version."), r === 1 ? {
|
|
7378
7380
|
version: r,
|
|
7379
7381
|
scripts: t.parseScriptList(),
|
|
7380
7382
|
features: t.parseFeatureList(),
|
|
@@ -7399,7 +7401,7 @@ ht[1] = function(n) {
|
|
|
7399
7401
|
].concat(k.ushortList("substitute", n.substitute)));
|
|
7400
7402
|
};
|
|
7401
7403
|
ht[2] = function(n) {
|
|
7402
|
-
return
|
|
7404
|
+
return A.assert(n.substFormat === 1, "Lookup type 2 substFormat must be 1."), new k.Table("substitutionTable", [
|
|
7403
7405
|
{ name: "substFormat", type: "USHORT", value: 1 },
|
|
7404
7406
|
{ name: "coverage", type: "TABLE", value: new k.Coverage(n.coverage) }
|
|
7405
7407
|
].concat(k.tableList("seqSet", n.sequences, function(e) {
|
|
@@ -7407,7 +7409,7 @@ ht[2] = function(n) {
|
|
|
7407
7409
|
})));
|
|
7408
7410
|
};
|
|
7409
7411
|
ht[3] = function(n) {
|
|
7410
|
-
return
|
|
7412
|
+
return A.assert(n.substFormat === 1, "Lookup type 3 substFormat must be 1."), new k.Table("substitutionTable", [
|
|
7411
7413
|
{ name: "substFormat", type: "USHORT", value: 1 },
|
|
7412
7414
|
{ name: "coverage", type: "TABLE", value: new k.Coverage(n.coverage) }
|
|
7413
7415
|
].concat(k.tableList("altSet", n.alternateSets, function(e) {
|
|
@@ -7415,7 +7417,7 @@ ht[3] = function(n) {
|
|
|
7415
7417
|
})));
|
|
7416
7418
|
};
|
|
7417
7419
|
ht[4] = function(n) {
|
|
7418
|
-
return
|
|
7420
|
+
return A.assert(n.substFormat === 1, "Lookup type 4 substFormat must be 1."), new k.Table("substitutionTable", [
|
|
7419
7421
|
{ name: "substFormat", type: "USHORT", value: 1 },
|
|
7420
7422
|
{ name: "coverage", type: "TABLE", value: new k.Coverage(n.coverage) }
|
|
7421
7423
|
].concat(k.tableList("ligSet", n.ligatureSets, function(e) {
|
|
@@ -7442,7 +7444,7 @@ ht[6] = function(n) {
|
|
|
7442
7444
|
})));
|
|
7443
7445
|
return e;
|
|
7444
7446
|
} else if (n.substFormat === 2)
|
|
7445
|
-
|
|
7447
|
+
A.assert(!1, "lookup type 6 format 2 is not yet supported.");
|
|
7446
7448
|
else if (n.substFormat === 3) {
|
|
7447
7449
|
var t = [
|
|
7448
7450
|
{ name: "substFormat", type: "USHORT", value: n.substFormat }
|
|
@@ -7459,7 +7461,7 @@ ht[6] = function(n) {
|
|
|
7459
7461
|
var r = new k.Table("chainContextTable", t);
|
|
7460
7462
|
return r;
|
|
7461
7463
|
}
|
|
7462
|
-
|
|
7464
|
+
A.assert(!1, "lookup type 6 format must be 1, 2 or 3.");
|
|
7463
7465
|
};
|
|
7464
7466
|
function ml(n) {
|
|
7465
7467
|
return new k.Table("GSUB", [
|
|
@@ -7469,10 +7471,10 @@ function ml(n) {
|
|
|
7469
7471
|
{ name: "lookups", type: "TABLE", value: new k.LookupList(n.lookups, ht) }
|
|
7470
7472
|
]);
|
|
7471
7473
|
}
|
|
7472
|
-
var
|
|
7474
|
+
var Hi = { parse: gl, make: ml };
|
|
7473
7475
|
function yl(n, e) {
|
|
7474
7476
|
var t = new M.Parser(n, e), r = t.parseULong();
|
|
7475
|
-
|
|
7477
|
+
A.argument(r === 1, "Unsupported META table version."), t.parseULong(), t.parseULong();
|
|
7476
7478
|
for (var s = t.parseULong(), i = {}, o = 0; o < s; o++) {
|
|
7477
7479
|
var a = t.parseTag(), c = t.parseULong(), l = t.parseULong(), h = ct.UTF8(n, e + c, l);
|
|
7478
7480
|
i[a] = h;
|
|
@@ -7492,7 +7494,7 @@ function vl(n) {
|
|
|
7492
7494
|
}
|
|
7493
7495
|
return s.fields.push({ name: "stringPool", type: "CHARARRAY", value: t }), s;
|
|
7494
7496
|
}
|
|
7495
|
-
var
|
|
7497
|
+
var ji = { parse: yl, make: vl };
|
|
7496
7498
|
function ns(n) {
|
|
7497
7499
|
return Math.log(n) / Math.log(2) | 0;
|
|
7498
7500
|
}
|
|
@@ -7526,9 +7528,9 @@ function Wi(n) {
|
|
|
7526
7528
|
i += 1, s.push({ name: "padding", type: "BYTE", value: 0 });
|
|
7527
7529
|
for (var o = 0; o < n.length; o += 1) {
|
|
7528
7530
|
var a = n[o];
|
|
7529
|
-
|
|
7531
|
+
A.argument(a.tableName.length === 4, "Table name" + a.tableName + " is invalid.");
|
|
7530
7532
|
var c = a.sizeOf(), l = rs(a.tableName, yr(a.encode()), i, c);
|
|
7531
|
-
for (r.push({ name: l.tag + " Table Record", type: "RECORD", value: l }), s.push({ name: a.tableName + " table", type: "RECORD", value: a }), i += c,
|
|
7533
|
+
for (r.push({ name: l.tag + " Table Record", type: "RECORD", value: l }), s.push({ name: a.tableName + " table", type: "RECORD", value: a }), i += c, A.argument(!isNaN(i), "Something went wrong calculating the offset."); i % 4 !== 0; )
|
|
7532
7534
|
i += 1, s.push({ name: "padding", type: "BYTE", value: 0 });
|
|
7533
7535
|
}
|
|
7534
7536
|
return r.sort(function(h, d) {
|
|
@@ -7584,7 +7586,7 @@ function xl(n) {
|
|
|
7584
7586
|
minRightSideBearing: Math.min.apply(null, a)
|
|
7585
7587
|
};
|
|
7586
7588
|
x.ascender = n.ascender, x.descender = n.descender;
|
|
7587
|
-
var _ =
|
|
7589
|
+
var _ = Li.make({
|
|
7588
7590
|
flags: 3,
|
|
7589
7591
|
// 00000011 (baseline for font at y=0; left sidebearing point at x=0)
|
|
7590
7592
|
unitsPerEm: n.unitsPerEm,
|
|
@@ -7594,7 +7596,7 @@ function xl(n) {
|
|
|
7594
7596
|
yMax: x.yMax,
|
|
7595
7597
|
lowestRecPPEM: 3,
|
|
7596
7598
|
createdTimestamp: n.createdTimestamp
|
|
7597
|
-
}), w =
|
|
7599
|
+
}), w = Oi.make({
|
|
7598
7600
|
ascender: x.ascender,
|
|
7599
7601
|
descender: x.descender,
|
|
7600
7602
|
advanceWidthMax: x.advanceWidthMax,
|
|
@@ -7602,7 +7604,7 @@ function xl(n) {
|
|
|
7602
7604
|
minRightSideBearing: x.minRightSideBearing,
|
|
7603
7605
|
xMaxExtent: x.maxLeftSideBearing + (x.xMax - x.xMin),
|
|
7604
7606
|
numberOfHMetrics: n.glyphs.length
|
|
7605
|
-
}), L =
|
|
7607
|
+
}), L = Ui.make(n.glyphs.length), T = ar.make(Object.assign({
|
|
7606
7608
|
xAvgCharWidth: Math.round(x.advanceWidthAvg),
|
|
7607
7609
|
usFirstCharIndex: c,
|
|
7608
7610
|
usLastCharIndex: l,
|
|
@@ -7627,13 +7629,13 @@ function xl(n) {
|
|
|
7627
7629
|
// Use space as the default character, if available.
|
|
7628
7630
|
usBreakChar: n.hasChar(" ") ? 32 : 0
|
|
7629
7631
|
// Use space as the break character, if available.
|
|
7630
|
-
}, n.tables.os2)),
|
|
7632
|
+
}, n.tables.os2)), I = Di.make(n.glyphs), O = xi.make(n.glyphs), G = n.getEnglishName("fontFamily"), Q = n.getEnglishName("fontSubfamily"), ee = G + " " + Q, Y = n.getEnglishName("postScriptName");
|
|
7631
7633
|
Y || (Y = G.replace(/\s/g, "") + "-" + Q);
|
|
7632
7634
|
var U = {};
|
|
7633
7635
|
for (var N in n.names)
|
|
7634
7636
|
U[N] = n.names[N];
|
|
7635
7637
|
U.uniqueID || (U.uniqueID = { en: n.getEnglishName("manufacturer") + ":" + ee }), U.postScriptName || (U.postScriptName = { en: Y }), U.preferredFamily || (U.preferredFamily = n.names.fontFamily), U.preferredSubfamily || (U.preferredSubfamily = n.names.fontSubfamily);
|
|
7636
|
-
var F = [], H =
|
|
7638
|
+
var F = [], H = zi.make(U, F), q = F.length > 0 ? Ri.make(F) : void 0, X = Vi.make(), J = Bi.make(n.glyphs, {
|
|
7637
7639
|
version: n.getEnglishName("version"),
|
|
7638
7640
|
fullName: ee,
|
|
7639
7641
|
familyName: G,
|
|
@@ -7641,11 +7643,11 @@ function xl(n) {
|
|
|
7641
7643
|
postScriptName: Y,
|
|
7642
7644
|
unitsPerEm: n.unitsPerEm,
|
|
7643
7645
|
fontBBox: [0, x.yMin, x.ascender, x.advanceWidthMax]
|
|
7644
|
-
}), R = n.metas && Object.keys(n.metas).length > 0 ?
|
|
7645
|
-
q && Z.push(q), n.tables.gsub && Z.push(
|
|
7646
|
-
for (var xn = Wi(Z),
|
|
7646
|
+
}), R = n.metas && Object.keys(n.metas).length > 0 ? ji.make(n.metas) : void 0, Z = [_, w, L, T, H, O, X, J, I];
|
|
7647
|
+
q && Z.push(q), n.tables.gsub && Z.push(Hi.make(n.tables.gsub)), R && Z.push(R);
|
|
7648
|
+
for (var xn = Wi(Z), uo = xn.encode(), po = yr(uo), Sn = xn.fields, kr = !1, Nt = 0; Nt < Sn.length; Nt += 1)
|
|
7647
7649
|
if (Sn[Nt].name === "head table") {
|
|
7648
|
-
Sn[Nt].value.checkSumAdjustment = 2981146554 -
|
|
7650
|
+
Sn[Nt].value.checkSumAdjustment = 2981146554 - po, kr = !0;
|
|
7649
7651
|
break;
|
|
7650
7652
|
}
|
|
7651
7653
|
if (!kr)
|
|
@@ -7814,7 +7816,7 @@ Ot.prototype = {
|
|
|
7814
7816
|
return i.feature;
|
|
7815
7817
|
if (r) {
|
|
7816
7818
|
var l = a.length;
|
|
7817
|
-
return
|
|
7819
|
+
return A.assert(l === 0 || t >= a[l - 1].tag, "Features must be added in alphabetical order."), i = {
|
|
7818
7820
|
tag: t,
|
|
7819
7821
|
feature: { params: 0, lookupListIndexes: [] }
|
|
7820
7822
|
}, a.push(i), o.push(l), i.feature;
|
|
@@ -8023,19 +8025,19 @@ se.prototype.addSingle = function(n, e, t, r) {
|
|
|
8023
8025
|
coverage: { format: 1, glyphs: [] },
|
|
8024
8026
|
substitute: []
|
|
8025
8027
|
});
|
|
8026
|
-
|
|
8028
|
+
A.assert(i.coverage.format === 1, "Single: unable to modify coverage table format " + i.coverage.format);
|
|
8027
8029
|
var o = e.sub, a = this.binSearch(i.coverage.glyphs, o);
|
|
8028
8030
|
a < 0 && (a = -1 - a, i.coverage.glyphs.splice(a, 0, o), i.substitute.splice(a, 0, 0)), i.substitute[a] = e.by;
|
|
8029
8031
|
};
|
|
8030
8032
|
se.prototype.addMultiple = function(n, e, t, r) {
|
|
8031
|
-
|
|
8033
|
+
A.assert(e.by instanceof Array && e.by.length > 1, 'Multiple: "by" must be an array of two or more ids');
|
|
8032
8034
|
var s = this.getLookupTables(t, r, n, 2, !0)[0], i = vr(s, 1, {
|
|
8033
8035
|
// lookup type 2 subtable, format 1, coverage format 1
|
|
8034
8036
|
substFormat: 1,
|
|
8035
8037
|
coverage: { format: 1, glyphs: [] },
|
|
8036
8038
|
sequences: []
|
|
8037
8039
|
});
|
|
8038
|
-
|
|
8040
|
+
A.assert(i.coverage.format === 1, "Multiple: unable to modify coverage table format " + i.coverage.format);
|
|
8039
8041
|
var o = e.sub, a = this.binSearch(i.coverage.glyphs, o);
|
|
8040
8042
|
a < 0 && (a = -1 - a, i.coverage.glyphs.splice(a, 0, o), i.sequences.splice(a, 0, 0)), i.sequences[a] = e.by;
|
|
8041
8043
|
};
|
|
@@ -8046,7 +8048,7 @@ se.prototype.addAlternate = function(n, e, t, r) {
|
|
|
8046
8048
|
coverage: { format: 1, glyphs: [] },
|
|
8047
8049
|
alternateSets: []
|
|
8048
8050
|
});
|
|
8049
|
-
|
|
8051
|
+
A.assert(i.coverage.format === 1, "Alternate: unable to modify coverage table format " + i.coverage.format);
|
|
8050
8052
|
var o = e.sub, a = this.binSearch(i.coverage.glyphs, o);
|
|
8051
8053
|
a < 0 && (a = -1 - a, i.coverage.glyphs.splice(a, 0, o), i.alternateSets.splice(a, 0, 0)), i.alternateSets[a] = e.by;
|
|
8052
8054
|
};
|
|
@@ -8057,7 +8059,7 @@ se.prototype.addLigature = function(n, e, t, r) {
|
|
|
8057
8059
|
substFormat: 1,
|
|
8058
8060
|
coverage: { format: 1, glyphs: [] },
|
|
8059
8061
|
ligatureSets: []
|
|
8060
|
-
}, s.subtables[0] = i),
|
|
8062
|
+
}, s.subtables[0] = i), A.assert(i.coverage.format === 1, "Ligature: unable to modify coverage table format " + i.coverage.format);
|
|
8061
8063
|
var o = e.sub[0], a = e.sub.slice(1), c = {
|
|
8062
8064
|
ligGlyph: e.by,
|
|
8063
8065
|
components: a
|
|
@@ -8118,7 +8120,7 @@ function as(n, e, t, r, s) {
|
|
|
8118
8120
|
var i;
|
|
8119
8121
|
return (e & r) > 0 ? (i = n.parseByte(), e & s || (i = -i), i = t + i) : (e & s) > 0 ? i = t : i = t + n.parseShort(), i;
|
|
8120
8122
|
}
|
|
8121
|
-
function
|
|
8123
|
+
function Xi(n, e, t) {
|
|
8122
8124
|
var r = new M.Parser(e, t);
|
|
8123
8125
|
n.numberOfContours = r.parseShort(), n._xMin = r.parseShort(), n._yMin = r.parseShort(), n._xMax = r.parseShort(), n._yMax = r.parseShort();
|
|
8124
8126
|
var s, i;
|
|
@@ -8134,7 +8136,7 @@ function ji(n, e, t) {
|
|
|
8134
8136
|
if (i = r.parseByte(), s.push(i), (i & 8) > 0)
|
|
8135
8137
|
for (var d = r.parseByte(), u = 0; u < d; u += 1)
|
|
8136
8138
|
s.push(i), h += 1;
|
|
8137
|
-
if (
|
|
8139
|
+
if (A.argument(s.length === l, "Bad flags."), o.length > 0) {
|
|
8138
8140
|
var p = [], f;
|
|
8139
8141
|
if (l > 0) {
|
|
8140
8142
|
for (var m = 0; m < l; m += 1)
|
|
@@ -8183,18 +8185,18 @@ function En(n, e) {
|
|
|
8183
8185
|
}
|
|
8184
8186
|
return t;
|
|
8185
8187
|
}
|
|
8186
|
-
function
|
|
8188
|
+
function Cl(n) {
|
|
8187
8189
|
for (var e = [], t = [], r = 0; r < n.length; r += 1) {
|
|
8188
8190
|
var s = n[r];
|
|
8189
8191
|
t.push(s), s.lastPointOfContour && (e.push(t), t = []);
|
|
8190
8192
|
}
|
|
8191
|
-
return
|
|
8193
|
+
return A.argument(t.length === 0, "There are still points left in the current contour."), e;
|
|
8192
8194
|
}
|
|
8193
|
-
function
|
|
8194
|
-
var e = new
|
|
8195
|
+
function $i(n) {
|
|
8196
|
+
var e = new W();
|
|
8195
8197
|
if (!n)
|
|
8196
8198
|
return e;
|
|
8197
|
-
for (var t =
|
|
8199
|
+
for (var t = Cl(n), r = 0; r < t.length; ++r) {
|
|
8198
8200
|
var s = t[r], i = null, o = s[s.length - 1], a = s[0];
|
|
8199
8201
|
if (o.onCurve)
|
|
8200
8202
|
e.moveTo(o.x, o.y);
|
|
@@ -8215,7 +8217,7 @@ function Xi(n) {
|
|
|
8215
8217
|
}
|
|
8216
8218
|
return e;
|
|
8217
8219
|
}
|
|
8218
|
-
function
|
|
8220
|
+
function Yi(n, e) {
|
|
8219
8221
|
if (e.isComposite)
|
|
8220
8222
|
for (var t = 0; t < e.components.length; t += 1) {
|
|
8221
8223
|
var r = e.components[t], s = n.get(r.glyphIndex);
|
|
@@ -8239,41 +8241,41 @@ function $i(n, e) {
|
|
|
8239
8241
|
e.points = e.points.concat(i);
|
|
8240
8242
|
}
|
|
8241
8243
|
}
|
|
8242
|
-
return
|
|
8244
|
+
return $i(e.points);
|
|
8243
8245
|
}
|
|
8244
|
-
function
|
|
8245
|
-
for (var s = new
|
|
8246
|
+
function Il(n, e, t, r) {
|
|
8247
|
+
for (var s = new Ce.GlyphSet(r), i = 0; i < t.length - 1; i += 1) {
|
|
8246
8248
|
var o = t[i], a = t[i + 1];
|
|
8247
|
-
o !== a ? s.push(i,
|
|
8249
|
+
o !== a ? s.push(i, Ce.ttfGlyphLoader(r, i, Xi, n, e + o, Yi)) : s.push(i, Ce.glyphLoader(r, i));
|
|
8248
8250
|
}
|
|
8249
8251
|
return s;
|
|
8250
8252
|
}
|
|
8251
8253
|
function kl(n, e, t, r) {
|
|
8252
|
-
var s = new
|
|
8254
|
+
var s = new Ce.GlyphSet(r);
|
|
8253
8255
|
return r._push = function(i) {
|
|
8254
8256
|
var o = t[i], a = t[i + 1];
|
|
8255
|
-
o !== a ? s.push(i,
|
|
8257
|
+
o !== a ? s.push(i, Ce.ttfGlyphLoader(r, i, Xi, n, e + o, Yi)) : s.push(i, Ce.glyphLoader(r, i));
|
|
8256
8258
|
}, s;
|
|
8257
8259
|
}
|
|
8258
8260
|
function El(n, e, t, r, s) {
|
|
8259
|
-
return s.lowMemory ? kl(n, e, t, r) :
|
|
8261
|
+
return s.lowMemory ? kl(n, e, t, r) : Il(n, e, t, r);
|
|
8260
8262
|
}
|
|
8261
|
-
var
|
|
8262
|
-
function
|
|
8263
|
+
var qi = { getPath: $i, parse: El }, Zi, We, Qi, cr;
|
|
8264
|
+
function Ji(n) {
|
|
8263
8265
|
this.font = n, this.getCommands = function(e) {
|
|
8264
|
-
return
|
|
8266
|
+
return qi.getPath(e).commands;
|
|
8265
8267
|
}, this._fpgmState = this._prepState = void 0, this._errorState = 0;
|
|
8266
8268
|
}
|
|
8267
8269
|
function Ml(n) {
|
|
8268
8270
|
return n;
|
|
8269
8271
|
}
|
|
8270
|
-
function
|
|
8272
|
+
function Ki(n) {
|
|
8271
8273
|
return Math.sign(n) * Math.round(Math.abs(n));
|
|
8272
8274
|
}
|
|
8273
|
-
function
|
|
8275
|
+
function Al(n) {
|
|
8274
8276
|
return Math.sign(n) * Math.round(Math.abs(n * 2)) / 2;
|
|
8275
8277
|
}
|
|
8276
|
-
function
|
|
8278
|
+
function Bl(n) {
|
|
8277
8279
|
return Math.sign(n) * (Math.round(Math.abs(n) + 0.5) - 0.5);
|
|
8278
8280
|
}
|
|
8279
8281
|
function Ll(n) {
|
|
@@ -8282,7 +8284,7 @@ function Ll(n) {
|
|
|
8282
8284
|
function Ol(n) {
|
|
8283
8285
|
return Math.sign(n) * Math.floor(Math.abs(n));
|
|
8284
8286
|
}
|
|
8285
|
-
var
|
|
8287
|
+
var eo = function(n) {
|
|
8286
8288
|
var e = this.srPeriod, t = this.srPhase, r = this.srThreshold, s = 1;
|
|
8287
8289
|
return n < 0 && (n = -n, s = -1), n += r - t, n = Math.trunc(n / e) * e, n += t, n < 0 ? t * s : n * s;
|
|
8288
8290
|
}, Te = {
|
|
@@ -8349,7 +8351,7 @@ var Ki = function(n) {
|
|
|
8349
8351
|
untouch: function(n) {
|
|
8350
8352
|
n.xTouched = !1;
|
|
8351
8353
|
}
|
|
8352
|
-
},
|
|
8354
|
+
}, Ie = {
|
|
8353
8355
|
x: 0,
|
|
8354
8356
|
y: 1,
|
|
8355
8357
|
axis: "y",
|
|
@@ -8374,10 +8376,10 @@ var Ki = function(n) {
|
|
|
8374
8376
|
return;
|
|
8375
8377
|
}
|
|
8376
8378
|
if (s = r.distance(n, e, !0, !0), i = r.distance(n, t, !0, !0), c = r.distance(e, e, !1, !0), l = r.distance(t, t, !1, !0), o = Math.abs(s), a = Math.abs(i), h = o + a, h === 0) {
|
|
8377
|
-
|
|
8379
|
+
Ie.setRelative(n, n, (c + l) / 2, r, !0);
|
|
8378
8380
|
return;
|
|
8379
8381
|
}
|
|
8380
|
-
|
|
8382
|
+
Ie.setRelative(n, n, (c * a + l * o) / h, r, !0);
|
|
8381
8383
|
},
|
|
8382
8384
|
// Slope of line normal to this.
|
|
8383
8385
|
normalSlope: 0,
|
|
@@ -8415,12 +8417,12 @@ var Ki = function(n) {
|
|
|
8415
8417
|
}
|
|
8416
8418
|
};
|
|
8417
8419
|
Object.freeze(Te);
|
|
8418
|
-
Object.freeze(
|
|
8420
|
+
Object.freeze(Ie);
|
|
8419
8421
|
function Rt(n, e) {
|
|
8420
8422
|
this.x = n, this.y = e, this.axis = void 0, this.slope = e / n, this.normalSlope = -n / e, Object.freeze(this);
|
|
8421
8423
|
}
|
|
8422
8424
|
Rt.prototype.distance = function(n, e, t, r) {
|
|
8423
|
-
return this.x * Te.distance(n, e, t, r) + this.y *
|
|
8425
|
+
return this.x * Te.distance(n, e, t, r) + this.y * Ie.distance(n, e, t, r);
|
|
8424
8426
|
};
|
|
8425
8427
|
Rt.prototype.interpolate = function(n, e, t, r) {
|
|
8426
8428
|
var s, i, o, a, c, l, h;
|
|
@@ -8440,7 +8442,7 @@ Rt.prototype.touch = function(n) {
|
|
|
8440
8442
|
};
|
|
8441
8443
|
function Ut(n, e) {
|
|
8442
8444
|
var t = Math.sqrt(n * n + e * e);
|
|
8443
|
-
return n /= t, e /= t, n === 1 && e === 0 ? Te : n === 0 && e === 1 ?
|
|
8445
|
+
return n /= t, e /= t, n === 1 && e === 0 ? Te : n === 0 && e === 1 ? Ie : new Rt(n, e);
|
|
8444
8446
|
}
|
|
8445
8447
|
function ke(n, e, t, r) {
|
|
8446
8448
|
this.x = this.xo = Math.round(n * 64) / 64, this.y = this.yo = Math.round(e * 64) / 64, this.lastPointOfContour = t, this.onCurve = r, this.prevPointOnContour = void 0, this.nextPointOnContour = void 0, this.xTouched = !1, this.yTouched = !1, Object.preventExtensions(this);
|
|
@@ -8466,15 +8468,15 @@ var Et = Object.freeze(new ke(0, 0)), Dl = {
|
|
|
8466
8468
|
// minimum distance
|
|
8467
8469
|
autoFlip: !0
|
|
8468
8470
|
};
|
|
8469
|
-
function
|
|
8471
|
+
function Be(n, e) {
|
|
8470
8472
|
switch (this.env = n, this.stack = [], this.prog = e, n) {
|
|
8471
8473
|
case "glyf":
|
|
8472
8474
|
this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
|
|
8473
8475
|
case "prep":
|
|
8474
|
-
this.fv = this.pv = this.dpv = Te, this.round =
|
|
8476
|
+
this.fv = this.pv = this.dpv = Te, this.round = Ki;
|
|
8475
8477
|
}
|
|
8476
8478
|
}
|
|
8477
|
-
|
|
8479
|
+
Ji.prototype.exec = function(n, e) {
|
|
8478
8480
|
if (typeof e != "number")
|
|
8479
8481
|
throw new Error("Point size is not a number!");
|
|
8480
8482
|
if (!(this._errorState > 2)) {
|
|
@@ -8482,15 +8484,15 @@ Qi.prototype.exec = function(n, e) {
|
|
|
8482
8484
|
if (!r || r.ppem !== e) {
|
|
8483
8485
|
var s = this._fpgmState;
|
|
8484
8486
|
if (!s) {
|
|
8485
|
-
|
|
8487
|
+
Be.prototype = Dl, s = this._fpgmState = new Be("fpgm", t.tables.fpgm), s.funcs = [], s.font = t, exports.DEBUG && (console.log("---EXEC FPGM---"), s.step = -1);
|
|
8486
8488
|
try {
|
|
8487
|
-
|
|
8489
|
+
We(s);
|
|
8488
8490
|
} catch (l) {
|
|
8489
8491
|
console.log("Hinting error in FPGM:" + l), this._errorState = 3;
|
|
8490
8492
|
return;
|
|
8491
8493
|
}
|
|
8492
8494
|
}
|
|
8493
|
-
|
|
8495
|
+
Be.prototype = s, r = this._prepState = new Be("prep", t.tables.prep), r.ppem = e;
|
|
8494
8496
|
var i = t.tables.cvt;
|
|
8495
8497
|
if (i)
|
|
8496
8498
|
for (var o = r.cvt = new Array(i.length), a = e / t.unitsPerEm, c = 0; c < i.length; c++)
|
|
@@ -8499,30 +8501,30 @@ Qi.prototype.exec = function(n, e) {
|
|
|
8499
8501
|
r.cvt = [];
|
|
8500
8502
|
exports.DEBUG && (console.log("---EXEC PREP---"), r.step = -1);
|
|
8501
8503
|
try {
|
|
8502
|
-
|
|
8504
|
+
We(r);
|
|
8503
8505
|
} catch (l) {
|
|
8504
8506
|
this._errorState < 2 && console.log("Hinting error in PREP:" + l), this._errorState = 2;
|
|
8505
8507
|
}
|
|
8506
8508
|
}
|
|
8507
8509
|
if (!(this._errorState > 1))
|
|
8508
8510
|
try {
|
|
8509
|
-
return
|
|
8511
|
+
return Qi(n, r);
|
|
8510
8512
|
} catch (l) {
|
|
8511
8513
|
this._errorState < 1 && (console.log("Hinting error:" + l), console.log("Note: further hinting errors are silenced")), this._errorState = 1;
|
|
8512
8514
|
return;
|
|
8513
8515
|
}
|
|
8514
8516
|
}
|
|
8515
8517
|
};
|
|
8516
|
-
|
|
8518
|
+
Qi = function(n, e) {
|
|
8517
8519
|
var t = e.ppem / e.font.unitsPerEm, r = t, s = n.components, i, o, a;
|
|
8518
|
-
if (
|
|
8519
|
-
a = new
|
|
8520
|
+
if (Be.prototype = e, !s)
|
|
8521
|
+
a = new Be("glyf", n.instructions), exports.DEBUG && (console.log("---EXEC GLYPH---"), a.step = -1), cr(n, a, t, r), o = a.gZone;
|
|
8520
8522
|
else {
|
|
8521
8523
|
var c = e.font;
|
|
8522
8524
|
o = [], i = [];
|
|
8523
8525
|
for (var l = 0; l < s.length; l++) {
|
|
8524
8526
|
var h = s[l], d = c.glyphs.get(h.glyphIndex);
|
|
8525
|
-
a = new
|
|
8527
|
+
a = new Be("glyf", d.instructions), exports.DEBUG && (console.log("---EXEC COMP " + l + "---"), a.step = -1), cr(d, a, t, r);
|
|
8526
8528
|
for (var u = Math.round(h.dx * t), p = Math.round(h.dy * r), f = a.gZone, m = a.contours, y = 0; y < f.length; y++) {
|
|
8527
8529
|
var v = f[y];
|
|
8528
8530
|
v.xTouched = v.yTouched = !1, v.xo = v.x = v.x + u, v.yo = v.y = v.y + p;
|
|
@@ -8532,10 +8534,10 @@ Zi = function(n, e) {
|
|
|
8532
8534
|
for (var x = 0; x < m.length; x++)
|
|
8533
8535
|
i.push(m[x] + S);
|
|
8534
8536
|
}
|
|
8535
|
-
n.instructions && !a.inhibitGridFit && (a = new
|
|
8537
|
+
n.instructions && !a.inhibitGridFit && (a = new Be("glyf", n.instructions), a.gZone = a.z0 = a.z1 = a.z2 = o, a.contours = i, o.push(
|
|
8536
8538
|
new ke(0, 0),
|
|
8537
8539
|
new ke(Math.round(n.advanceWidth * t), 0)
|
|
8538
|
-
), exports.DEBUG && (console.log("---EXEC COMPOSITE---"), a.step = -1),
|
|
8540
|
+
), exports.DEBUG && (console.log("---EXEC COMPOSITE---"), a.step = -1), We(a), o.length -= 2);
|
|
8539
8541
|
}
|
|
8540
8542
|
return o;
|
|
8541
8543
|
};
|
|
@@ -8558,19 +8560,19 @@ cr = function(n, e, t, r) {
|
|
|
8558
8560
|
if (o.push(
|
|
8559
8561
|
new ke(0, 0),
|
|
8560
8562
|
new ke(Math.round(n.advanceWidth * t), 0)
|
|
8561
|
-
),
|
|
8563
|
+
), We(e), o.length -= 2, exports.DEBUG) {
|
|
8562
8564
|
console.log("FINISHED GLYPH", e.stack);
|
|
8563
8565
|
for (var f = 0; f < i; f++)
|
|
8564
8566
|
console.log(f, o[f].x, o[f].y);
|
|
8565
8567
|
}
|
|
8566
8568
|
}
|
|
8567
8569
|
};
|
|
8568
|
-
|
|
8570
|
+
We = function(n) {
|
|
8569
8571
|
var e = n.prog;
|
|
8570
8572
|
if (e) {
|
|
8571
8573
|
var t = e.length, r;
|
|
8572
8574
|
for (n.ip = 0; n.ip < t; n.ip++) {
|
|
8573
|
-
if (exports.DEBUG && n.step++, r =
|
|
8575
|
+
if (exports.DEBUG && n.step++, r = Zi[e[n.ip]], !r)
|
|
8574
8576
|
throw new Error(
|
|
8575
8577
|
"unknown instruction: 0x" + Number(e[n.ip]).toString(16)
|
|
8576
8578
|
);
|
|
@@ -8582,7 +8584,7 @@ function yn(n) {
|
|
|
8582
8584
|
for (var e = n.tZone = new Array(n.gZone.length), t = 0; t < e.length; t++)
|
|
8583
8585
|
e[t] = new ke(0, 0);
|
|
8584
8586
|
}
|
|
8585
|
-
function
|
|
8587
|
+
function to(n, e) {
|
|
8586
8588
|
var t = n.prog, r = n.ip, s = 1, i;
|
|
8587
8589
|
do
|
|
8588
8590
|
if (i = t[++r], i === 88)
|
|
@@ -8645,8 +8647,8 @@ function Gl(n) {
|
|
|
8645
8647
|
function Nl(n) {
|
|
8646
8648
|
var e = n.stack, t = e.pop(), r = e.pop(), s = e.pop(), i = e.pop(), o = e.pop(), a = n.z0, c = n.z1, l = a[t], h = a[r], d = c[s], u = c[i], p = n.z2[o];
|
|
8647
8649
|
exports.DEBUG && console.log("ISECT[], ", t, r, s, i, o);
|
|
8648
|
-
var f = l.x, m = l.y, y = h.x, v = h.y, S = d.x, x = d.y, _ = u.x, w = u.y, L = (f - y) * (x - w) - (m - v) * (S - _), T = f * v - m * y,
|
|
8649
|
-
p.x = (T * (S - _) -
|
|
8650
|
+
var f = l.x, m = l.y, y = h.x, v = h.y, S = d.x, x = d.y, _ = u.x, w = u.y, L = (f - y) * (x - w) - (m - v) * (S - _), T = f * v - m * y, I = S * w - x * _;
|
|
8651
|
+
p.x = (T * (S - _) - I * (f - y)) / L, p.y = (T * (x - w) - I * (m - v)) / L;
|
|
8650
8652
|
}
|
|
8651
8653
|
function zl(n) {
|
|
8652
8654
|
n.rp0 = n.stack.pop(), exports.DEBUG && console.log(n.step, "SRP0[]", n.rp0);
|
|
@@ -8657,7 +8659,7 @@ function Vl(n) {
|
|
|
8657
8659
|
function Hl(n) {
|
|
8658
8660
|
n.rp2 = n.stack.pop(), exports.DEBUG && console.log(n.step, "SRP2[]", n.rp2);
|
|
8659
8661
|
}
|
|
8660
|
-
function
|
|
8662
|
+
function jl(n) {
|
|
8661
8663
|
var e = n.stack.pop();
|
|
8662
8664
|
switch (exports.DEBUG && console.log(n.step, "SZP0[]", e), n.zp0 = e, e) {
|
|
8663
8665
|
case 0:
|
|
@@ -8670,7 +8672,7 @@ function Wl(n) {
|
|
|
8670
8672
|
throw new Error("Invalid zone pointer");
|
|
8671
8673
|
}
|
|
8672
8674
|
}
|
|
8673
|
-
function
|
|
8675
|
+
function Wl(n) {
|
|
8674
8676
|
var e = n.stack.pop();
|
|
8675
8677
|
switch (exports.DEBUG && console.log(n.step, "SZP1[]", e), n.zp1 = e, e) {
|
|
8676
8678
|
case 0:
|
|
@@ -8713,17 +8715,17 @@ function Yl(n) {
|
|
|
8713
8715
|
n.loop = n.stack.pop(), exports.DEBUG && console.log(n.step, "SLOOP[]", n.loop);
|
|
8714
8716
|
}
|
|
8715
8717
|
function ql(n) {
|
|
8716
|
-
exports.DEBUG && console.log(n.step, "RTG[]"), n.round =
|
|
8718
|
+
exports.DEBUG && console.log(n.step, "RTG[]"), n.round = Ki;
|
|
8717
8719
|
}
|
|
8718
8720
|
function Zl(n) {
|
|
8719
|
-
exports.DEBUG && console.log(n.step, "RTHG[]"), n.round =
|
|
8721
|
+
exports.DEBUG && console.log(n.step, "RTHG[]"), n.round = Bl;
|
|
8720
8722
|
}
|
|
8721
8723
|
function Ql(n) {
|
|
8722
8724
|
var e = n.stack.pop();
|
|
8723
8725
|
exports.DEBUG && console.log(n.step, "SMD[]", e), n.minDis = e / 64;
|
|
8724
8726
|
}
|
|
8725
8727
|
function Jl(n) {
|
|
8726
|
-
exports.DEBUG && console.log(n.step, "ELSE[]"),
|
|
8728
|
+
exports.DEBUG && console.log(n.step, "ELSE[]"), to(n, !1);
|
|
8727
8729
|
}
|
|
8728
8730
|
function Kl(n) {
|
|
8729
8731
|
var e = n.stack.pop();
|
|
@@ -8757,7 +8759,7 @@ function ih(n) {
|
|
|
8757
8759
|
var s = n.ip, i = n.prog;
|
|
8758
8760
|
n.prog = n.funcs[t];
|
|
8759
8761
|
for (var o = 0; o < r; o++)
|
|
8760
|
-
|
|
8762
|
+
We(n), exports.DEBUG && console.log(
|
|
8761
8763
|
++n.step,
|
|
8762
8764
|
o + 1 < r ? "next loopcall" : "done loopcall",
|
|
8763
8765
|
o
|
|
@@ -8768,7 +8770,7 @@ function oh(n) {
|
|
|
8768
8770
|
var e = n.stack.pop();
|
|
8769
8771
|
exports.DEBUG && console.log(n.step, "CALL[]", e);
|
|
8770
8772
|
var t = n.ip, r = n.prog;
|
|
8771
|
-
n.prog = n.funcs[e],
|
|
8773
|
+
n.prog = n.funcs[e], We(n), n.ip = t, n.prog = r, exports.DEBUG && console.log(++n.step, "returning from", e);
|
|
8772
8774
|
}
|
|
8773
8775
|
function ah(n) {
|
|
8774
8776
|
var e = n.stack, t = e.pop();
|
|
@@ -8876,7 +8878,7 @@ function dh(n) {
|
|
|
8876
8878
|
n.loop = 1;
|
|
8877
8879
|
}
|
|
8878
8880
|
function ph(n) {
|
|
8879
|
-
exports.DEBUG && console.log(n.step, "RTDG[]"), n.round =
|
|
8881
|
+
exports.DEBUG && console.log(n.step, "RTDG[]"), n.round = Al;
|
|
8880
8882
|
}
|
|
8881
8883
|
function bs(n, e) {
|
|
8882
8884
|
var t = e.stack, r = t.pop(), s = t.pop(), i = e.z0[s], o = e.fv, a = e.pv, c = e.cvt[r];
|
|
@@ -8954,11 +8956,11 @@ function Th(n) {
|
|
|
8954
8956
|
var e = n.stack, t = e.pop(), r = e.pop();
|
|
8955
8957
|
exports.DEBUG && console.log(n.step, "GT[]", t, r), e.push(r > t ? 1 : 0);
|
|
8956
8958
|
}
|
|
8957
|
-
function
|
|
8959
|
+
function Ch(n) {
|
|
8958
8960
|
var e = n.stack, t = e.pop(), r = e.pop();
|
|
8959
8961
|
exports.DEBUG && console.log(n.step, "GTEQ[]", t, r), e.push(r >= t ? 1 : 0);
|
|
8960
8962
|
}
|
|
8961
|
-
function
|
|
8963
|
+
function Ih(n) {
|
|
8962
8964
|
var e = n.stack, t = e.pop(), r = e.pop();
|
|
8963
8965
|
exports.DEBUG && console.log(n.step, "EQ[]", t, r), e.push(t === r ? 1 : 0);
|
|
8964
8966
|
}
|
|
@@ -8974,11 +8976,11 @@ function Mh(n) {
|
|
|
8974
8976
|
var e = n.stack, t = e.pop();
|
|
8975
8977
|
exports.DEBUG && console.log(n.step, "EVEN[]", t), e.push(Math.trunc(t) % 2 ? 0 : 1);
|
|
8976
8978
|
}
|
|
8977
|
-
function
|
|
8979
|
+
function Ah(n) {
|
|
8978
8980
|
var e = n.stack.pop();
|
|
8979
|
-
exports.DEBUG && console.log(n.step, "IF[]", e), e || (
|
|
8981
|
+
exports.DEBUG && console.log(n.step, "IF[]", e), e || (to(n, !0), exports.DEBUG && console.log(n.step, "EIF[]"));
|
|
8980
8982
|
}
|
|
8981
|
-
function
|
|
8983
|
+
function Bh(n) {
|
|
8982
8984
|
exports.DEBUG && console.log(n.step, "EIF[]");
|
|
8983
8985
|
}
|
|
8984
8986
|
function Lh(n) {
|
|
@@ -8993,7 +8995,7 @@ function Dh(n) {
|
|
|
8993
8995
|
var e = n.stack, t = e.pop();
|
|
8994
8996
|
exports.DEBUG && console.log(n.step, "NOT[]", t), e.push(t ? 0 : 1);
|
|
8995
8997
|
}
|
|
8996
|
-
function
|
|
8998
|
+
function An(n, e) {
|
|
8997
8999
|
var t = e.stack, r = t.pop(), s = e.fv, i = e.pv, o = e.ppem, a = e.deltaBase + (n - 1) * 16, c = e.deltaShift, l = e.z0;
|
|
8998
9000
|
exports.DEBUG && console.log(e.step, "DELTAP[" + n + "]", r, t);
|
|
8999
9001
|
for (var h = 0; h < r; h++) {
|
|
@@ -9042,19 +9044,19 @@ function Hh(n) {
|
|
|
9042
9044
|
var e = n.stack, t = e.pop();
|
|
9043
9045
|
exports.DEBUG && console.log(n.step, "FLOOR[]", t), e.push(Math.floor(t / 64) * 64);
|
|
9044
9046
|
}
|
|
9045
|
-
function
|
|
9047
|
+
function jh(n) {
|
|
9046
9048
|
var e = n.stack, t = e.pop();
|
|
9047
9049
|
exports.DEBUG && console.log(n.step, "CEILING[]", t), e.push(Math.ceil(t / 64) * 64);
|
|
9048
9050
|
}
|
|
9049
|
-
function
|
|
9051
|
+
function Wt(n, e) {
|
|
9050
9052
|
var t = e.stack, r = t.pop();
|
|
9051
9053
|
exports.DEBUG && console.log(e.step, "ROUND[]"), t.push(e.round(r / 64) * 64);
|
|
9052
9054
|
}
|
|
9053
|
-
function
|
|
9055
|
+
function Wh(n) {
|
|
9054
9056
|
var e = n.stack, t = e.pop(), r = e.pop();
|
|
9055
9057
|
exports.DEBUG && console.log(n.step, "WCVTF[]", t, r), n.cvt[r] = t * n.ppem / n.font.unitsPerEm;
|
|
9056
9058
|
}
|
|
9057
|
-
function
|
|
9059
|
+
function Bn(n, e) {
|
|
9058
9060
|
var t = e.stack, r = t.pop(), s = e.ppem, i = e.deltaBase + (n - 1) * 16, o = e.deltaShift;
|
|
9059
9061
|
exports.DEBUG && console.log(e.step, "DELTAC[" + n + "]", r, t);
|
|
9060
9062
|
for (var a = 0; a < r; a++) {
|
|
@@ -9069,7 +9071,7 @@ function An(n, e) {
|
|
|
9069
9071
|
}
|
|
9070
9072
|
function Xh(n) {
|
|
9071
9073
|
var e = n.stack.pop();
|
|
9072
|
-
exports.DEBUG && console.log(n.step, "SROUND[]", e), n.round =
|
|
9074
|
+
exports.DEBUG && console.log(n.step, "SROUND[]", e), n.round = eo;
|
|
9073
9075
|
var t;
|
|
9074
9076
|
switch (e & 192) {
|
|
9075
9077
|
case 0:
|
|
@@ -9104,7 +9106,7 @@ function Xh(n) {
|
|
|
9104
9106
|
}
|
|
9105
9107
|
function $h(n) {
|
|
9106
9108
|
var e = n.stack.pop();
|
|
9107
|
-
exports.DEBUG && console.log(n.step, "S45ROUND[]", e), n.round =
|
|
9109
|
+
exports.DEBUG && console.log(n.step, "S45ROUND[]", e), n.round = eo;
|
|
9108
9110
|
var t;
|
|
9109
9111
|
switch (e & 192) {
|
|
9110
9112
|
case 0:
|
|
@@ -9219,17 +9221,17 @@ function E(n, e, t, r, s, i) {
|
|
|
9219
9221
|
")"
|
|
9220
9222
|
), i.rp1 = i.rp0, i.rp2 = c, e && (i.rp0 = c);
|
|
9221
9223
|
}
|
|
9222
|
-
|
|
9224
|
+
Zi = [
|
|
9223
9225
|
/* 0x00 */
|
|
9224
|
-
cs.bind(void 0,
|
|
9226
|
+
cs.bind(void 0, Ie),
|
|
9225
9227
|
/* 0x01 */
|
|
9226
9228
|
cs.bind(void 0, Te),
|
|
9227
9229
|
/* 0x02 */
|
|
9228
|
-
ls.bind(void 0,
|
|
9230
|
+
ls.bind(void 0, Ie),
|
|
9229
9231
|
/* 0x03 */
|
|
9230
9232
|
ls.bind(void 0, Te),
|
|
9231
9233
|
/* 0x04 */
|
|
9232
|
-
hs.bind(void 0,
|
|
9234
|
+
hs.bind(void 0, Ie),
|
|
9233
9235
|
/* 0x05 */
|
|
9234
9236
|
hs.bind(void 0, Te),
|
|
9235
9237
|
/* 0x06 */
|
|
@@ -9259,9 +9261,9 @@ qi = [
|
|
|
9259
9261
|
/* 0x12 */
|
|
9260
9262
|
Hl,
|
|
9261
9263
|
/* 0x13 */
|
|
9262
|
-
Wl,
|
|
9263
|
-
/* 0x14 */
|
|
9264
9264
|
jl,
|
|
9265
|
+
/* 0x14 */
|
|
9266
|
+
Wl,
|
|
9265
9267
|
/* 0x15 */
|
|
9266
9268
|
Xl,
|
|
9267
9269
|
/* 0x16 */
|
|
@@ -9322,7 +9324,7 @@ qi = [
|
|
|
9322
9324
|
/* 0x2F */
|
|
9323
9325
|
ps.bind(void 0, 1),
|
|
9324
9326
|
/* 0x30 */
|
|
9325
|
-
fs.bind(void 0,
|
|
9327
|
+
fs.bind(void 0, Ie),
|
|
9326
9328
|
/* 0x31 */
|
|
9327
9329
|
fs.bind(void 0, Te),
|
|
9328
9330
|
/* 0x32 */
|
|
@@ -9396,9 +9398,9 @@ qi = [
|
|
|
9396
9398
|
/* 0x52 */
|
|
9397
9399
|
Th,
|
|
9398
9400
|
/* 0x53 */
|
|
9399
|
-
Ih,
|
|
9400
|
-
/* 0x54 */
|
|
9401
9401
|
Ch,
|
|
9402
|
+
/* 0x54 */
|
|
9403
|
+
Ih,
|
|
9402
9404
|
/* 0x55 */
|
|
9403
9405
|
kh,
|
|
9404
9406
|
/* 0x56 */
|
|
@@ -9406,9 +9408,9 @@ qi = [
|
|
|
9406
9408
|
/* 0x57 */
|
|
9407
9409
|
Mh,
|
|
9408
9410
|
/* 0x58 */
|
|
9409
|
-
Bh,
|
|
9410
|
-
/* 0x59 */
|
|
9411
9411
|
Ah,
|
|
9412
|
+
/* 0x59 */
|
|
9413
|
+
Bh,
|
|
9412
9414
|
/* 0x5A */
|
|
9413
9415
|
Lh,
|
|
9414
9416
|
/* 0x5B */
|
|
@@ -9416,7 +9418,7 @@ qi = [
|
|
|
9416
9418
|
/* 0x5C */
|
|
9417
9419
|
Dh,
|
|
9418
9420
|
/* 0x5D */
|
|
9419
|
-
|
|
9421
|
+
An.bind(void 0, 1),
|
|
9420
9422
|
/* 0x5E */
|
|
9421
9423
|
Rh,
|
|
9422
9424
|
/* 0x5F */
|
|
@@ -9436,15 +9438,15 @@ qi = [
|
|
|
9436
9438
|
/* 0x66 */
|
|
9437
9439
|
Hh,
|
|
9438
9440
|
/* 0x67 */
|
|
9439
|
-
|
|
9441
|
+
jh,
|
|
9440
9442
|
/* 0x68 */
|
|
9441
|
-
|
|
9443
|
+
Wt.bind(void 0, 0),
|
|
9442
9444
|
/* 0x69 */
|
|
9443
|
-
|
|
9445
|
+
Wt.bind(void 0, 1),
|
|
9444
9446
|
/* 0x6A */
|
|
9445
|
-
|
|
9447
|
+
Wt.bind(void 0, 2),
|
|
9446
9448
|
/* 0x6B */
|
|
9447
|
-
|
|
9449
|
+
Wt.bind(void 0, 3),
|
|
9448
9450
|
/* 0x6C */
|
|
9449
9451
|
void 0,
|
|
9450
9452
|
// TODO NROUND[ab]
|
|
@@ -9458,17 +9460,17 @@ qi = [
|
|
|
9458
9460
|
void 0,
|
|
9459
9461
|
// TODO NROUND[ab]
|
|
9460
9462
|
/* 0x70 */
|
|
9461
|
-
|
|
9463
|
+
Wh,
|
|
9462
9464
|
/* 0x71 */
|
|
9463
|
-
|
|
9465
|
+
An.bind(void 0, 2),
|
|
9464
9466
|
/* 0x72 */
|
|
9465
|
-
|
|
9467
|
+
An.bind(void 0, 3),
|
|
9466
9468
|
/* 0x73 */
|
|
9467
|
-
|
|
9469
|
+
Bn.bind(void 0, 1),
|
|
9468
9470
|
/* 0x74 */
|
|
9469
|
-
|
|
9471
|
+
Bn.bind(void 0, 2),
|
|
9470
9472
|
/* 0x75 */
|
|
9471
|
-
|
|
9473
|
+
Bn.bind(void 0, 3),
|
|
9472
9474
|
/* 0x76 */
|
|
9473
9475
|
Xh,
|
|
9474
9476
|
/* 0x77 */
|
|
@@ -10010,7 +10012,7 @@ P.prototype.tokenize = function(n) {
|
|
|
10010
10012
|
function Re(n) {
|
|
10011
10013
|
return /[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(n);
|
|
10012
10014
|
}
|
|
10013
|
-
function
|
|
10015
|
+
function no(n) {
|
|
10014
10016
|
return /[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(n);
|
|
10015
10017
|
}
|
|
10016
10018
|
function Fe(n) {
|
|
@@ -10386,7 +10388,7 @@ function xr(n, e, t) {
|
|
|
10386
10388
|
}
|
|
10387
10389
|
function wu(n) {
|
|
10388
10390
|
for (var e = [].concat(n.backtrack), t = e.length - 1; t >= 0; t--) {
|
|
10389
|
-
var r = e[t], s =
|
|
10391
|
+
var r = e[t], s = no(r), i = Fe(r);
|
|
10390
10392
|
if (!s && !i)
|
|
10391
10393
|
return !0;
|
|
10392
10394
|
if (s)
|
|
@@ -10395,7 +10397,7 @@ function wu(n) {
|
|
|
10395
10397
|
return !1;
|
|
10396
10398
|
}
|
|
10397
10399
|
function _u(n) {
|
|
10398
|
-
if (
|
|
10400
|
+
if (no(n.current))
|
|
10399
10401
|
return !1;
|
|
10400
10402
|
for (var e = 0; e < n.lookahead.length; e++) {
|
|
10401
10403
|
var t = n.lookahead[e], r = Fe(t);
|
|
@@ -10461,7 +10463,7 @@ function Ts(n, e) {
|
|
|
10461
10463
|
});
|
|
10462
10464
|
return new pe(t, 0);
|
|
10463
10465
|
}
|
|
10464
|
-
function
|
|
10466
|
+
function Cu(n) {
|
|
10465
10467
|
var e = this, t = "arab", r = this.tokenizer.getRangeTokens(n), s = Ts(r);
|
|
10466
10468
|
s.context.forEach(function(i, o) {
|
|
10467
10469
|
s.setCurrentIndex(o);
|
|
@@ -10477,7 +10479,7 @@ function Iu(n) {
|
|
|
10477
10479
|
), s = Ts(r));
|
|
10478
10480
|
});
|
|
10479
10481
|
}
|
|
10480
|
-
function
|
|
10482
|
+
function Iu(n) {
|
|
10481
10483
|
var e = n.current, t = n.get(-1);
|
|
10482
10484
|
return (
|
|
10483
10485
|
// ? latin first char
|
|
@@ -10494,17 +10496,17 @@ function ku(n) {
|
|
|
10494
10496
|
);
|
|
10495
10497
|
}
|
|
10496
10498
|
var Eu = {
|
|
10497
|
-
startCheck:
|
|
10499
|
+
startCheck: Iu,
|
|
10498
10500
|
endCheck: ku
|
|
10499
10501
|
};
|
|
10500
|
-
function
|
|
10502
|
+
function Cs(n, e) {
|
|
10501
10503
|
var t = n.map(function(r) {
|
|
10502
10504
|
return r.activeState.value;
|
|
10503
10505
|
});
|
|
10504
10506
|
return new pe(t, 0);
|
|
10505
10507
|
}
|
|
10506
10508
|
function Mu(n) {
|
|
10507
|
-
var e = this, t = "latn", r = this.tokenizer.getRangeTokens(n), s =
|
|
10509
|
+
var e = this, t = "latn", r = this.tokenizer.getRangeTokens(n), s = Cs(r);
|
|
10508
10510
|
s.context.forEach(function(i, o) {
|
|
10509
10511
|
s.setCurrentIndex(o);
|
|
10510
10512
|
var a = e.query.lookupFeature({
|
|
@@ -10516,7 +10518,7 @@ function Mu(n) {
|
|
|
10516
10518
|
function(c) {
|
|
10517
10519
|
return xr(c, r, o);
|
|
10518
10520
|
}
|
|
10519
|
-
), s =
|
|
10521
|
+
), s = Cs(r));
|
|
10520
10522
|
});
|
|
10521
10523
|
}
|
|
10522
10524
|
function ye(n) {
|
|
@@ -10538,10 +10540,10 @@ function On(n) {
|
|
|
10538
10540
|
e.endCheck
|
|
10539
10541
|
);
|
|
10540
10542
|
}
|
|
10541
|
-
function
|
|
10543
|
+
function Au() {
|
|
10542
10544
|
return On.call(this, "latinWord"), On.call(this, "arabicWord"), On.call(this, "arabicSentence"), this.tokenizer.tokenize(this.text);
|
|
10543
10545
|
}
|
|
10544
|
-
function
|
|
10546
|
+
function Bu() {
|
|
10545
10547
|
var n = this, e = this.tokenizer.getContextRanges("arabicSentence");
|
|
10546
10548
|
e.forEach(function(t) {
|
|
10547
10549
|
var r = n.tokenizer.getRangeTokens(t);
|
|
@@ -10598,7 +10600,7 @@ function Ou() {
|
|
|
10598
10600
|
Sr.call(this);
|
|
10599
10601
|
var r = this.tokenizer.getContextRanges("arabicWord");
|
|
10600
10602
|
r.forEach(function(s) {
|
|
10601
|
-
|
|
10603
|
+
Cu.call(n, s);
|
|
10602
10604
|
});
|
|
10603
10605
|
}
|
|
10604
10606
|
}
|
|
@@ -10620,10 +10622,10 @@ ye.prototype.checkContextReady = function(n) {
|
|
|
10620
10622
|
return !!this.tokenizer.getContext(n);
|
|
10621
10623
|
};
|
|
10622
10624
|
ye.prototype.applyFeaturesToContexts = function() {
|
|
10623
|
-
this.checkContextReady("arabicWord") && (Lu.call(this), Ou.call(this)), this.checkContextReady("latinWord") && Du.call(this), this.checkContextReady("arabicSentence") &&
|
|
10625
|
+
this.checkContextReady("arabicWord") && (Lu.call(this), Ou.call(this)), this.checkContextReady("latinWord") && Du.call(this), this.checkContextReady("arabicSentence") && Bu.call(this);
|
|
10624
10626
|
};
|
|
10625
10627
|
ye.prototype.processText = function(n) {
|
|
10626
|
-
(!this.text || this.text !== n) && (this.setText(n),
|
|
10628
|
+
(!this.text || this.text !== n) && (this.setText(n), Au.call(this), this.applyFeaturesToContexts());
|
|
10627
10629
|
};
|
|
10628
10630
|
ye.prototype.getBidiText = function(n) {
|
|
10629
10631
|
return this.processText(n), this.tokenizer.getText();
|
|
@@ -10662,12 +10664,12 @@ function D(n) {
|
|
|
10662
10664
|
usWidthClass: n.widthClass || this.usWidthClasses.MEDIUM,
|
|
10663
10665
|
fsSelection: n.fsSelection || this.fsSelectionValues.REGULAR
|
|
10664
10666
|
}, n.tables.os2)
|
|
10665
|
-
})), this.supported = !0, this.glyphs = new
|
|
10667
|
+
})), this.supported = !0, this.glyphs = new Ce.GlyphSet(this, n.glyphs || []), this.encoding = new Si(this), this.position = new Dt(this), this.substitution = new se(this), this.tables = this.tables || {}, this._push = null, this._hmtxTableData = {}, Object.defineProperty(this, "hinting", {
|
|
10666
10668
|
get: function() {
|
|
10667
10669
|
if (this._hinting)
|
|
10668
10670
|
return this._hinting;
|
|
10669
10671
|
if (this.outlinesFormat === "truetype")
|
|
10670
|
-
return this._hinting = new
|
|
10672
|
+
return this._hinting = new Ji(this);
|
|
10671
10673
|
}
|
|
10672
10674
|
});
|
|
10673
10675
|
}
|
|
@@ -10746,7 +10748,7 @@ D.prototype.forEachGlyph = function(n, e, t, r, s, i) {
|
|
|
10746
10748
|
return e;
|
|
10747
10749
|
};
|
|
10748
10750
|
D.prototype.getPath = function(n, e, t, r, s) {
|
|
10749
|
-
var i = new
|
|
10751
|
+
var i = new W();
|
|
10750
10752
|
return this.forEachGlyph(n, e, t, r, s, function(o, a, c, l) {
|
|
10751
10753
|
var h = o.getPath(a, c, l, s, this);
|
|
10752
10754
|
i.extend(h);
|
|
@@ -10861,7 +10863,7 @@ D.prototype.usWeightClasses = {
|
|
|
10861
10863
|
EXTRA_BOLD: 800,
|
|
10862
10864
|
BLACK: 900
|
|
10863
10865
|
};
|
|
10864
|
-
function
|
|
10866
|
+
function ro(n, e) {
|
|
10865
10867
|
var t = JSON.stringify(n), r = 256;
|
|
10866
10868
|
for (var s in e) {
|
|
10867
10869
|
var i = parseInt(s);
|
|
@@ -10874,7 +10876,7 @@ function no(n, e) {
|
|
|
10874
10876
|
return e[r] = n, r;
|
|
10875
10877
|
}
|
|
10876
10878
|
function Ru(n, e, t) {
|
|
10877
|
-
var r =
|
|
10879
|
+
var r = ro(e.name, t);
|
|
10878
10880
|
return [
|
|
10879
10881
|
{ name: "tag_" + n, type: "TAG", value: e.tag },
|
|
10880
10882
|
{ name: "minValue_" + n, type: "FIXED", value: e.minValue << 16 },
|
|
@@ -10889,7 +10891,7 @@ function Uu(n, e, t) {
|
|
|
10889
10891
|
return r.tag = s.parseTag(), r.minValue = s.parseFixed(), r.defaultValue = s.parseFixed(), r.maxValue = s.parseFixed(), s.skip("uShort", 1), r.name = t[s.parseUShort()] || {}, r;
|
|
10890
10892
|
}
|
|
10891
10893
|
function Fu(n, e, t, r) {
|
|
10892
|
-
for (var s =
|
|
10894
|
+
for (var s = ro(e.name, r), i = [
|
|
10893
10895
|
{ name: "nameID_" + n, type: "USHORT", value: s },
|
|
10894
10896
|
{ name: "flags_" + n, type: "USHORT", value: 0 }
|
|
10895
10897
|
], o = 0; o < t.length; ++o) {
|
|
@@ -10928,7 +10930,7 @@ function Gu(n, e) {
|
|
|
10928
10930
|
}
|
|
10929
10931
|
function Nu(n, e, t) {
|
|
10930
10932
|
var r = new M.Parser(n, e), s = r.parseULong();
|
|
10931
|
-
|
|
10933
|
+
A.argument(s === 65536, "Unsupported fvar table version.");
|
|
10932
10934
|
var i = r.parseOffset16();
|
|
10933
10935
|
r.skip("uShort", 1);
|
|
10934
10936
|
for (var o = r.parseUShort(), a = r.parseUShort(), c = r.parseUShort(), l = r.parseUShort(), h = [], d = 0; d < o; d++)
|
|
@@ -10944,7 +10946,7 @@ var zu = { make: Gu, parse: Nu }, Vu = function() {
|
|
|
10944
10946
|
};
|
|
10945
10947
|
}, Hu = function() {
|
|
10946
10948
|
var n = this.parseUShort();
|
|
10947
|
-
if (
|
|
10949
|
+
if (A.argument(
|
|
10948
10950
|
n === 1 || n === 2 || n === 3,
|
|
10949
10951
|
"Unsupported CaretValue table version."
|
|
10950
10952
|
), n === 1)
|
|
@@ -10953,12 +10955,12 @@ var zu = { make: Gu, parse: Nu }, Vu = function() {
|
|
|
10953
10955
|
return { pointindex: this.parseShort() };
|
|
10954
10956
|
if (n === 3)
|
|
10955
10957
|
return { coordinate: this.parseShort() };
|
|
10956
|
-
}, Wu = function() {
|
|
10957
|
-
return this.parseList(b.pointer(Hu));
|
|
10958
10958
|
}, ju = function() {
|
|
10959
|
+
return this.parseList(b.pointer(Hu));
|
|
10960
|
+
}, Wu = function() {
|
|
10959
10961
|
return {
|
|
10960
10962
|
coverage: this.parsePointer(b.coverage),
|
|
10961
|
-
ligGlyphs: this.parseList(b.pointer(
|
|
10963
|
+
ligGlyphs: this.parseList(b.pointer(ju))
|
|
10962
10964
|
};
|
|
10963
10965
|
}, Xu = function() {
|
|
10964
10966
|
return this.parseUShort(), this.parseList(b.pointer(b.coverage));
|
|
@@ -10966,7 +10968,7 @@ var zu = { make: Gu, parse: Nu }, Vu = function() {
|
|
|
10966
10968
|
function $u(n, e) {
|
|
10967
10969
|
e = e || 0;
|
|
10968
10970
|
var t = new b(n, e), r = t.parseVersion(1);
|
|
10969
|
-
|
|
10971
|
+
A.argument(
|
|
10970
10972
|
r === 1 || r === 1.2 || r === 1.3,
|
|
10971
10973
|
"Unsupported GDEF table version."
|
|
10972
10974
|
);
|
|
@@ -10974,7 +10976,7 @@ function $u(n, e) {
|
|
|
10974
10976
|
version: r,
|
|
10975
10977
|
classDef: t.parsePointer(b.classDef),
|
|
10976
10978
|
attachList: t.parsePointer(Vu),
|
|
10977
|
-
ligCaretList: t.parsePointer(
|
|
10979
|
+
ligCaretList: t.parsePointer(Wu),
|
|
10978
10980
|
markAttachClassDef: t.parsePointer(b.classDef)
|
|
10979
10981
|
};
|
|
10980
10982
|
return r >= 1.2 && (s.markGlyphSets = t.parsePointer(Xu)), s;
|
|
@@ -10994,11 +10996,11 @@ fe[1] = function() {
|
|
|
10994
10996
|
coverage: this.parsePointer(b.coverage),
|
|
10995
10997
|
values: this.parseValueRecordList()
|
|
10996
10998
|
};
|
|
10997
|
-
|
|
10999
|
+
A.assert(!1, "0x" + n.toString(16) + ": GPOS lookup type 1 format must be 1 or 2.");
|
|
10998
11000
|
};
|
|
10999
11001
|
fe[2] = function() {
|
|
11000
11002
|
var n = this.offset + this.relativeOffset, e = this.parseUShort();
|
|
11001
|
-
|
|
11003
|
+
A.assert(e === 1 || e === 2, "0x" + n.toString(16) + ": GPOS lookup type 2 format must be 1 or 2.");
|
|
11002
11004
|
var t = this.parsePointer(b.coverage), r = this.parseUShort(), s = this.parseUShort();
|
|
11003
11005
|
if (e === 1)
|
|
11004
11006
|
return {
|
|
@@ -11060,7 +11062,7 @@ fe[9] = function() {
|
|
|
11060
11062
|
function qu(n, e) {
|
|
11061
11063
|
e = e || 0;
|
|
11062
11064
|
var t = new b(n, e), r = t.parseVersion(1);
|
|
11063
|
-
return
|
|
11065
|
+
return A.argument(r === 1 || r === 1.1, "Unsupported GPOS table version " + r), r === 1 ? {
|
|
11064
11066
|
version: r,
|
|
11065
11067
|
scripts: t.parseScriptList(),
|
|
11066
11068
|
features: t.parseFeatureList(),
|
|
@@ -11087,7 +11089,7 @@ function Ku(n) {
|
|
|
11087
11089
|
var e = {};
|
|
11088
11090
|
n.skip("uShort");
|
|
11089
11091
|
var t = n.parseUShort();
|
|
11090
|
-
|
|
11092
|
+
A.argument(t === 0, "Unsupported kern sub-table version."), n.skip("uShort", 2);
|
|
11091
11093
|
var r = n.parseUShort();
|
|
11092
11094
|
n.skip("uShort", 3);
|
|
11093
11095
|
for (var s = 0; s < r; s += 1) {
|
|
@@ -11129,7 +11131,7 @@ function rd(n, e, t, r) {
|
|
|
11129
11131
|
return o;
|
|
11130
11132
|
}
|
|
11131
11133
|
var sd = { parse: rd };
|
|
11132
|
-
function
|
|
11134
|
+
function Is(n, e) {
|
|
11133
11135
|
for (var t = [], r = 12, s = 0; s < e; s += 1) {
|
|
11134
11136
|
var i = M.getTag(n, r), o = M.getULong(n, r + 4), a = M.getULong(n, r + 8), c = M.getULong(n, r + 12);
|
|
11135
11137
|
t.push({ tag: i, checksum: o, offset: a, length: c, compression: !1 }), r += 16;
|
|
@@ -11163,9 +11165,9 @@ function od(n, e) {
|
|
|
11163
11165
|
e = e ?? {};
|
|
11164
11166
|
var t, r, s = new D({ empty: !0 }), i = new DataView(n, 0), o, a = [], c = M.getTag(i, 0);
|
|
11165
11167
|
if (c === "\0\0\0" || c === "true" || c === "typ1")
|
|
11166
|
-
s.outlinesFormat = "truetype", o = M.getUShort(i, 4), a =
|
|
11168
|
+
s.outlinesFormat = "truetype", o = M.getUShort(i, 4), a = Is(i, o);
|
|
11167
11169
|
else if (c === "OTTO")
|
|
11168
|
-
s.outlinesFormat = "cff", o = M.getUShort(i, 4), a =
|
|
11170
|
+
s.outlinesFormat = "cff", o = M.getUShort(i, 4), a = Is(i, o);
|
|
11169
11171
|
else if (c === "wOFF") {
|
|
11170
11172
|
var l = M.getTag(i, 4);
|
|
11171
11173
|
if (l === "\0\0\0")
|
|
@@ -11178,46 +11180,46 @@ function od(n, e) {
|
|
|
11178
11180
|
} else
|
|
11179
11181
|
throw new Error("Unsupported OpenType signature " + c);
|
|
11180
11182
|
for (var h, d, u, p, f, m, y, v, S, x, _, w, L = 0; L < o; L += 1) {
|
|
11181
|
-
var T = a[L],
|
|
11183
|
+
var T = a[L], I = void 0;
|
|
11182
11184
|
switch (T.tag) {
|
|
11183
11185
|
case "cmap":
|
|
11184
|
-
|
|
11186
|
+
I = z(i, T), s.tables.cmap = xi.parse(I.data, I.offset), s.encoding = new wi(s.tables.cmap);
|
|
11185
11187
|
break;
|
|
11186
11188
|
case "cvt ":
|
|
11187
|
-
|
|
11189
|
+
I = z(i, T), w = new M.Parser(I.data, I.offset), s.tables.cvt = w.parseShortList(T.length / 2);
|
|
11188
11190
|
break;
|
|
11189
11191
|
case "fvar":
|
|
11190
11192
|
d = T;
|
|
11191
11193
|
break;
|
|
11192
11194
|
case "fpgm":
|
|
11193
|
-
|
|
11195
|
+
I = z(i, T), w = new M.Parser(I.data, I.offset), s.tables.fpgm = w.parseByteList(T.length);
|
|
11194
11196
|
break;
|
|
11195
11197
|
case "head":
|
|
11196
|
-
|
|
11198
|
+
I = z(i, T), s.tables.head = Li.parse(I.data, I.offset), s.unitsPerEm = s.tables.head.unitsPerEm, t = s.tables.head.indexToLocFormat;
|
|
11197
11199
|
break;
|
|
11198
11200
|
case "hhea":
|
|
11199
|
-
|
|
11201
|
+
I = z(i, T), s.tables.hhea = Oi.parse(I.data, I.offset), s.ascender = s.tables.hhea.ascender, s.descender = s.tables.hhea.descender, s.numberOfHMetrics = s.tables.hhea.numberOfHMetrics;
|
|
11200
11202
|
break;
|
|
11201
11203
|
case "hmtx":
|
|
11202
11204
|
y = T;
|
|
11203
11205
|
break;
|
|
11204
11206
|
case "ltag":
|
|
11205
|
-
|
|
11207
|
+
I = z(i, T), r = Ri.parse(I.data, I.offset);
|
|
11206
11208
|
break;
|
|
11207
11209
|
case "maxp":
|
|
11208
|
-
|
|
11210
|
+
I = z(i, T), s.tables.maxp = Ui.parse(I.data, I.offset), s.numGlyphs = s.tables.maxp.numGlyphs;
|
|
11209
11211
|
break;
|
|
11210
11212
|
case "name":
|
|
11211
11213
|
x = T;
|
|
11212
11214
|
break;
|
|
11213
11215
|
case "OS/2":
|
|
11214
|
-
|
|
11216
|
+
I = z(i, T), s.tables.os2 = ar.parse(I.data, I.offset);
|
|
11215
11217
|
break;
|
|
11216
11218
|
case "post":
|
|
11217
|
-
|
|
11219
|
+
I = z(i, T), s.tables.post = Vi.parse(I.data, I.offset), s.glyphNames = new gr(s.tables.post);
|
|
11218
11220
|
break;
|
|
11219
11221
|
case "prep":
|
|
11220
|
-
|
|
11222
|
+
I = z(i, T), w = new M.Parser(I.data, I.offset), s.tables.prep = w.parseByteList(T.length);
|
|
11221
11223
|
break;
|
|
11222
11224
|
case "glyf":
|
|
11223
11225
|
u = T;
|
|
@@ -11246,16 +11248,16 @@ function od(n, e) {
|
|
|
11246
11248
|
}
|
|
11247
11249
|
}
|
|
11248
11250
|
var O = z(i, x);
|
|
11249
|
-
if (s.tables.name =
|
|
11251
|
+
if (s.tables.name = zi.parse(O.data, O.offset, r), s.names = s.tables.name, u && S) {
|
|
11250
11252
|
var G = t === 0, Q = z(i, S), ee = sd.parse(Q.data, Q.offset, s.numGlyphs, G), Y = z(i, u);
|
|
11251
|
-
s.glyphs =
|
|
11253
|
+
s.glyphs = qi.parse(Y.data, Y.offset, ee, s, e);
|
|
11252
11254
|
} else if (h) {
|
|
11253
11255
|
var U = z(i, h);
|
|
11254
11256
|
Bi.parse(U.data, U.offset, s, e);
|
|
11255
11257
|
} else
|
|
11256
11258
|
throw new Error("Font doesn't contain TrueType or CFF outlines.");
|
|
11257
11259
|
var N = z(i, y);
|
|
11258
|
-
if (
|
|
11260
|
+
if (Di.parse(s, N.data, N.offset, s.numberOfHMetrics, s.numGlyphs, s.glyphs, e), bc(s, e), v) {
|
|
11259
11261
|
var F = z(i, v);
|
|
11260
11262
|
s.kerningPairs = nd.parse(F.data, F.offset);
|
|
11261
11263
|
} else
|
|
@@ -11270,7 +11272,7 @@ function od(n, e) {
|
|
|
11270
11272
|
}
|
|
11271
11273
|
if (m) {
|
|
11272
11274
|
var X = z(i, m);
|
|
11273
|
-
s.tables.gsub =
|
|
11275
|
+
s.tables.gsub = Hi.parse(X.data, X.offset);
|
|
11274
11276
|
}
|
|
11275
11277
|
if (d) {
|
|
11276
11278
|
var J = z(i, d);
|
|
@@ -11278,7 +11280,7 @@ function od(n, e) {
|
|
|
11278
11280
|
}
|
|
11279
11281
|
if (_) {
|
|
11280
11282
|
var R = z(i, _);
|
|
11281
|
-
s.tables.meta =
|
|
11283
|
+
s.tables.meta = ji.parse(R.data, R.offset), s.metas = s.tables.meta;
|
|
11282
11284
|
}
|
|
11283
11285
|
return s;
|
|
11284
11286
|
}
|
|
@@ -11320,7 +11322,7 @@ function ad(n) {
|
|
|
11320
11322
|
};
|
|
11321
11323
|
})(od(n));
|
|
11322
11324
|
}
|
|
11323
|
-
class ks extends
|
|
11325
|
+
class ks extends oi {
|
|
11324
11326
|
/**
|
|
11325
11327
|
* Creates a new instance of MeshFont.
|
|
11326
11328
|
* @param data - Either a MeshFontData object containing font information or an ArrayBuffer containing raw font data
|
|
@@ -11757,7 +11759,7 @@ class dd {
|
|
|
11757
11759
|
}
|
|
11758
11760
|
}
|
|
11759
11761
|
}
|
|
11760
|
-
let
|
|
11762
|
+
let j = class so {
|
|
11761
11763
|
/**
|
|
11762
11764
|
* Creates a new Point instance.
|
|
11763
11765
|
* @param x - The x-coordinate (defaults to 0)
|
|
@@ -11795,7 +11797,7 @@ let W = class ro {
|
|
|
11795
11797
|
* @returns A new Point instance with the same x and y values
|
|
11796
11798
|
*/
|
|
11797
11799
|
clone() {
|
|
11798
|
-
return new
|
|
11800
|
+
return new so(this.x, this.y);
|
|
11799
11801
|
}
|
|
11800
11802
|
/**
|
|
11801
11803
|
* Adds another point's coordinates to this point.
|
|
@@ -11900,18 +11902,18 @@ class Mt {
|
|
|
11900
11902
|
}
|
|
11901
11903
|
const s = 4 * Math.atan(Math.abs(this.bulge));
|
|
11902
11904
|
this.radius = r / (2 * Math.sin(s / 2));
|
|
11903
|
-
const i = this.start.clone().add(t.clone().divide(2)), o = new
|
|
11905
|
+
const i = this.start.clone().add(t.clone().divide(2)), o = new j(-t.y, t.x);
|
|
11904
11906
|
o.normalize(), o.multiply(Math.abs(this.radius * Math.cos(s / 2))), this.center = i.clone(), this.isClockwise ? this.center.subtract(o) : this.center.add(o), 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);
|
|
11905
11907
|
} else if (e.center && e.radius !== void 0 && e.startOctant !== void 0 && e.octantCount !== void 0 && e.isClockwise !== void 0) {
|
|
11906
11908
|
this.center = e.center.clone(), this.radius = e.radius, this.isClockwise = e.isClockwise, this.startAngle = e.startOctant * Es;
|
|
11907
11909
|
const t = (e.octantCount === 0 ? 8 : e.octantCount) * Es;
|
|
11908
11910
|
this.endAngle = this.startAngle + (this.isClockwise ? -t : t), this.start = this.center.clone().add(
|
|
11909
|
-
new
|
|
11911
|
+
new j(
|
|
11910
11912
|
this.radius * Math.cos(this.startAngle),
|
|
11911
11913
|
this.radius * Math.sin(this.startAngle)
|
|
11912
11914
|
)
|
|
11913
11915
|
), this.end = this.center.clone().add(
|
|
11914
|
-
new
|
|
11916
|
+
new j(this.radius * Math.cos(this.endAngle), this.radius * Math.sin(this.endAngle))
|
|
11915
11917
|
);
|
|
11916
11918
|
} else
|
|
11917
11919
|
throw new Error("Invalid arc parameters");
|
|
@@ -11928,12 +11930,12 @@ class Mt {
|
|
|
11928
11930
|
for (let i = 1; i < s; i++) {
|
|
11929
11931
|
const o = i / s, a = this.isClockwise ? this.startAngle - o * r : this.startAngle + o * r;
|
|
11930
11932
|
t.push(
|
|
11931
|
-
this.center.clone().add(new
|
|
11933
|
+
this.center.clone().add(new j(this.radius * Math.cos(a), this.radius * Math.sin(a)))
|
|
11932
11934
|
);
|
|
11933
11935
|
}
|
|
11934
11936
|
return t.push(
|
|
11935
11937
|
this.end ? this.end.clone() : this.center.clone().add(
|
|
11936
|
-
new
|
|
11938
|
+
new j(
|
|
11937
11939
|
this.radius * Math.cos(this.endAngle),
|
|
11938
11940
|
this.radius * Math.sin(this.endAngle)
|
|
11939
11941
|
)
|
|
@@ -11941,7 +11943,7 @@ class Mt {
|
|
|
11941
11943
|
), t;
|
|
11942
11944
|
}
|
|
11943
11945
|
}
|
|
11944
|
-
let Dn = class
|
|
11946
|
+
let Dn = class io {
|
|
11945
11947
|
constructor(e, t = []) {
|
|
11946
11948
|
this.lastPoint = e, this.polylines = t;
|
|
11947
11949
|
}
|
|
@@ -11965,7 +11967,7 @@ let Dn = class so {
|
|
|
11965
11967
|
*/
|
|
11966
11968
|
offset(e, t = !0) {
|
|
11967
11969
|
var r, s;
|
|
11968
|
-
return t ? new
|
|
11970
|
+
return t ? new io(
|
|
11969
11971
|
(r = this.lastPoint) == null ? void 0 : r.clone().add(e),
|
|
11970
11972
|
this.polylines.map((i) => i.map((o) => o.clone().add(e)))
|
|
11971
11973
|
) : ((s = this.lastPoint) == null || s.add(e), this.polylines.forEach((i) => i.forEach((o) => o.add(e))), this);
|
|
@@ -12045,7 +12047,7 @@ let fd = class {
|
|
|
12045
12047
|
*/
|
|
12046
12048
|
parseShape(n, e) {
|
|
12047
12049
|
const t = {
|
|
12048
|
-
currentPoint: new
|
|
12050
|
+
currentPoint: new j(),
|
|
12049
12051
|
polylines: [],
|
|
12050
12052
|
currentPolyline: [],
|
|
12051
12053
|
sp: [],
|
|
@@ -12131,7 +12133,7 @@ let fd = class {
|
|
|
12131
12133
|
* @returns Returns the vector for the given direction code
|
|
12132
12134
|
*/
|
|
12133
12135
|
getVectorForDirection(n) {
|
|
12134
|
-
const e = new
|
|
12136
|
+
const e = new j();
|
|
12135
12137
|
switch (n) {
|
|
12136
12138
|
case 0:
|
|
12137
12139
|
e.x = 1;
|
|
@@ -12202,13 +12204,13 @@ let fd = class {
|
|
|
12202
12204
|
}
|
|
12203
12205
|
handleXYDisplacement(n, e, t) {
|
|
12204
12206
|
let r = e;
|
|
12205
|
-
const s = new
|
|
12207
|
+
const s = new j();
|
|
12206
12208
|
return s.x = ne.byteToSByte(n[++r]), s.y = ne.byteToSByte(n[++r]), t.currentPoint.add(s.multiply(t.scale)), t.isPenDown && t.currentPolyline.push(t.currentPoint.clone()), r;
|
|
12207
12209
|
}
|
|
12208
12210
|
handleMultipleXYDisplacements(n, e, t) {
|
|
12209
12211
|
let r = e;
|
|
12210
12212
|
for (; ; ) {
|
|
12211
|
-
const s = new
|
|
12213
|
+
const s = new j();
|
|
12212
12214
|
if (s.x = ne.byteToSByte(n[++r]), s.y = ne.byteToSByte(n[++r]), s.x === 0 && s.y === 0)
|
|
12213
12215
|
break;
|
|
12214
12216
|
t.currentPoint.add(s.multiply(t.scale)), t.isPenDown && t.currentPolyline.push(t.currentPoint.clone());
|
|
@@ -12220,7 +12222,7 @@ let fd = class {
|
|
|
12220
12222
|
let s = e;
|
|
12221
12223
|
const i = n[++s] * t.scale, o = ne.byteToSByte(n[++s]), a = (o & 112) >> 4;
|
|
12222
12224
|
let c = o & 7;
|
|
12223
|
-
const l = o < 0, h = Math.PI / 4 * a, d = t.currentPoint.clone().subtract(new
|
|
12225
|
+
const l = o < 0, h = Math.PI / 4 * a, d = t.currentPoint.clone().subtract(new j(Math.cos(h) * i, Math.sin(h) * i)), u = Mt.fromOctant(d, i, a, c, l);
|
|
12224
12226
|
if (t.isPenDown) {
|
|
12225
12227
|
const p = u.tessellate();
|
|
12226
12228
|
t.currentPolyline.pop(), t.currentPolyline.push(...p.slice());
|
|
@@ -12237,29 +12239,29 @@ let fd = class {
|
|
|
12237
12239
|
l < 0 && (f = -f, p = -p, m = -1);
|
|
12238
12240
|
let y = u * h, v = y + p;
|
|
12239
12241
|
y += u * s / 256 * m, v += u * i / 256 * m;
|
|
12240
|
-
const S = t.currentPoint.clone().subtract(new
|
|
12241
|
-
if (t.currentPoint = S.clone().add(new
|
|
12242
|
+
const S = t.currentPoint.clone().subtract(new j(c * Math.cos(y), c * Math.sin(y)));
|
|
12243
|
+
if (t.currentPoint = S.clone().add(new j(c * Math.cos(v), c * Math.sin(v))), t.isPenDown) {
|
|
12242
12244
|
let x = y;
|
|
12243
12245
|
const _ = [];
|
|
12244
12246
|
if (_.push(
|
|
12245
|
-
S.clone().add(new
|
|
12247
|
+
S.clone().add(new j(c * Math.cos(x), c * Math.sin(x)))
|
|
12246
12248
|
), f > 0)
|
|
12247
12249
|
for (; x + f < v; )
|
|
12248
12250
|
x += f, _.push(
|
|
12249
|
-
S.clone().add(new
|
|
12251
|
+
S.clone().add(new j(c * Math.cos(x), c * Math.sin(x)))
|
|
12250
12252
|
);
|
|
12251
12253
|
else
|
|
12252
12254
|
for (; x + f > v; )
|
|
12253
12255
|
x += f, _.push(
|
|
12254
|
-
S.clone().add(new
|
|
12256
|
+
S.clone().add(new j(c * Math.cos(x), c * Math.sin(x)))
|
|
12255
12257
|
);
|
|
12256
|
-
_.push(S.clone().add(new
|
|
12258
|
+
_.push(S.clone().add(new j(c * Math.cos(v), c * Math.sin(v)))), t.currentPolyline.push(..._);
|
|
12257
12259
|
}
|
|
12258
12260
|
return r;
|
|
12259
12261
|
}
|
|
12260
12262
|
handleBulgeArc(n, e, t) {
|
|
12261
12263
|
let r = e;
|
|
12262
|
-
const s = new
|
|
12264
|
+
const s = new j();
|
|
12263
12265
|
s.x = ne.byteToSByte(n[++r]), s.y = ne.byteToSByte(n[++r]);
|
|
12264
12266
|
const i = ne.byteToSByte(n[++r]);
|
|
12265
12267
|
return t.currentPoint = this.handleArcSegment(
|
|
@@ -12274,7 +12276,7 @@ let fd = class {
|
|
|
12274
12276
|
handleMultipleBulgeArcs(n, e, t) {
|
|
12275
12277
|
let r = e;
|
|
12276
12278
|
for (; ; ) {
|
|
12277
|
-
const s = new
|
|
12279
|
+
const s = new j();
|
|
12278
12280
|
if (s.x = ne.byteToSByte(n[++r]), s.y = ne.byteToSByte(n[++r]), s.x === 0 && s.y === 0)
|
|
12279
12281
|
break;
|
|
12280
12282
|
const i = ne.byteToSByte(n[++r]);
|
|
@@ -12430,7 +12432,7 @@ class gd {
|
|
|
12430
12432
|
this.shapeParser.release();
|
|
12431
12433
|
}
|
|
12432
12434
|
}
|
|
12433
|
-
class wr extends
|
|
12435
|
+
class wr extends ai {
|
|
12434
12436
|
/**
|
|
12435
12437
|
* Creates a new instance of ShxTextShape
|
|
12436
12438
|
* @param char - The character this shape represents
|
|
@@ -12468,7 +12470,7 @@ class wr extends oi {
|
|
|
12468
12470
|
return e;
|
|
12469
12471
|
}
|
|
12470
12472
|
}
|
|
12471
|
-
class
|
|
12473
|
+
class As extends oi {
|
|
12472
12474
|
constructor(e) {
|
|
12473
12475
|
super(), this.type = "shx", this.font = new gd(e), this.data = this.font.fontData;
|
|
12474
12476
|
}
|
|
@@ -12495,7 +12497,7 @@ class Bs extends ii {
|
|
|
12495
12497
|
s += t, this.addUnsupportedChar(o);
|
|
12496
12498
|
continue;
|
|
12497
12499
|
}
|
|
12498
|
-
r.push(a.offset(new
|
|
12500
|
+
r.push(a.offset(new j(s, 0))), s += a.width;
|
|
12499
12501
|
}
|
|
12500
12502
|
return r;
|
|
12501
12503
|
}
|
|
@@ -12550,7 +12552,7 @@ class Le {
|
|
|
12550
12552
|
*/
|
|
12551
12553
|
createFont(e) {
|
|
12552
12554
|
if (e.type === "shx")
|
|
12553
|
-
return new
|
|
12555
|
+
return new As(e.data);
|
|
12554
12556
|
if (e.type === "mesh")
|
|
12555
12557
|
return new ks(e.data);
|
|
12556
12558
|
throw new Error("Unsupported font data type");
|
|
@@ -12567,7 +12569,7 @@ class Le {
|
|
|
12567
12569
|
createFontFromBuffer(e, t) {
|
|
12568
12570
|
const r = Ua(e).toLowerCase();
|
|
12569
12571
|
if (r === "shx")
|
|
12570
|
-
return new
|
|
12572
|
+
return new As(t);
|
|
12571
12573
|
if (["ttf", "otf", "woff"].includes(r))
|
|
12572
12574
|
return new ks(t);
|
|
12573
12575
|
throw new Error(`Unsupported font file type: ${r}`);
|
|
@@ -12727,7 +12729,7 @@ class he {
|
|
|
12727
12729
|
* @param url - The URL of the font file to load
|
|
12728
12730
|
*/
|
|
12729
12731
|
async loadFont(e) {
|
|
12730
|
-
const t =
|
|
12732
|
+
const t = hi(e);
|
|
12731
12733
|
if (!t)
|
|
12732
12734
|
throw new Error(`Invalid font url: ${e}`);
|
|
12733
12735
|
const r = Pr(e).toLowerCase(), s = await Tn.instance.get(r);
|
|
@@ -12786,7 +12788,7 @@ class he {
|
|
|
12786
12788
|
return e == null ? (this.fontMap.clear(), !0) : this.fontMap.delete(e);
|
|
12787
12789
|
}
|
|
12788
12790
|
}
|
|
12789
|
-
var
|
|
12791
|
+
var At = /* @__PURE__ */ ((n) => (n[n.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", n[n.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", n[n.TOP_TO_BOTTOM = 3] = "TOP_TO_BOTTOM", n[n.BOTTOM_TO_TOP = 4] = "BOTTOM_TO_TOP", n[n.BY_STYLE = 5] = "BY_STYLE", n))(At || {}), rt = /* @__PURE__ */ ((n) => (n[n.NONE = 0] = "NONE", n[n.WORD = 1] = "WORD", n[n.STACK = 2] = "STACK", n[n.SPACE = 3] = "SPACE", n[n.NBSP = 4] = "NBSP", n[n.TABULATOR = 5] = "TABULATOR", n[n.NEW_PARAGRAPH = 6] = "NEW_PARAGRAPH", n[n.NEW_COLUMN = 7] = "NEW_COLUMN", n[n.WRAP_AT_DIMLINE = 8] = "WRAP_AT_DIMLINE", n[n.PROPERTIES_CHANGED = 9] = "PROPERTIES_CHANGED", n))(rt || {}), bt = /* @__PURE__ */ ((n) => (n[n.BOTTOM = 0] = "BOTTOM", n[n.MIDDLE = 1] = "MIDDLE", n[n.TOP = 2] = "TOP", n))(bt || {}), le = /* @__PURE__ */ ((n) => (n[n.DEFAULT = 0] = "DEFAULT", n[n.LEFT = 1] = "LEFT", n[n.RIGHT = 2] = "RIGHT", n[n.CENTER = 3] = "CENTER", n[n.JUSTIFIED = 4] = "JUSTIFIED", n[n.DISTRIBUTED = 5] = "DISTRIBUTED", n))(le || {});
|
|
12790
12792
|
const md = {
|
|
12791
12793
|
c: "Ø",
|
|
12792
12794
|
d: "°",
|
|
@@ -14194,7 +14196,7 @@ class _d {
|
|
|
14194
14196
|
}
|
|
14195
14197
|
const a = this.fontManager.getFontType(this.currentFont);
|
|
14196
14198
|
this._currentContext.bold && a === "mesh" && i.scale(1.06, 1.06, 1), this.hOffset > (this.maxLineWidth || 1 / 0) && this.startNewLine();
|
|
14197
|
-
let c = this.hOffset, l = this.flowDirection ==
|
|
14199
|
+
let c = this.hOffset, l = this.flowDirection == At.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.currentFontSize, h = s.width * this.currentWidthFactor, d = this.currentFontSize;
|
|
14198
14200
|
i.translate(c, l, 0), this.currentHorizontalAlignment == le.DISTRIBUTED ? this._hOffset += s.width * this.currentWidthFactor : this._hOffset += s.width * this.currentWordSpace * this.currentWidthFactor, t.push(i);
|
|
14199
14201
|
const u = d * 0.05, p = 1e-3;
|
|
14200
14202
|
if (this._currentContext.underline) {
|
|
@@ -14259,7 +14261,7 @@ class _d {
|
|
|
14259
14261
|
return this.textStyle.bigFont && !t && (t = this.fontManager.getCharShape(e, this.textStyle.bigFont, this.currentFontSize)), t || (t = this.fontManager.getCharShape(e, "", this.currentFontSize)), t || (t = this.fontManager.getNotFoundTextShape(this.currentFontSize)), this.currentFontSize > this._maxFontSize && (this._maxFontSize = this.currentFontSize), t;
|
|
14260
14262
|
}
|
|
14261
14263
|
startNewLine() {
|
|
14262
|
-
this._hOffset = 0, this.flowDirection ==
|
|
14264
|
+
this._hOffset = 0, this.flowDirection == At.BOTTOM_TO_TOP ? this._vOffset += this.currentLineHeight : this._vOffset -= this.currentLineHeight, this._lineCount++, this.processAlignment(), this._currentLineObjects = [], this._lineCount == 2 ? this._totalHeight = this.currentMaxFontSize : this._totalHeight = this._totalHeight + this.currentLineHeight, this._maxFontSize = 0;
|
|
14263
14265
|
}
|
|
14264
14266
|
/**
|
|
14265
14267
|
* Apply translation on the specified buffer geometries according to text alignment setting
|
|
@@ -14346,7 +14348,7 @@ class _d {
|
|
|
14346
14348
|
this._currentContext.fontSize = e * this._currentContext.fontScaleFactor * this._currentContext.fontSizeScaleFactor, this.calcuateLineParams();
|
|
14347
14349
|
}
|
|
14348
14350
|
}
|
|
14349
|
-
const Fn = /* @__PURE__ */ new g.Vector3(), ze = /* @__PURE__ */ new g.Vector3(), Pn = /* @__PURE__ */ new g.Vector3(), Gn = /* @__PURE__ */ new g.Quaternion(), Nn = /* @__PURE__ */ new g.Matrix4(),
|
|
14351
|
+
const Fn = /* @__PURE__ */ new g.Vector3(), ze = /* @__PURE__ */ new g.Vector3(), Pn = /* @__PURE__ */ new g.Vector3(), Gn = /* @__PURE__ */ new g.Quaternion(), Nn = /* @__PURE__ */ new g.Matrix4(), Bs = /* @__PURE__ */ new g.Matrix4(), Ls = /* @__PURE__ */ new g.Vector3(1, 0, 0);
|
|
14350
14352
|
class Td extends g.Object3D {
|
|
14351
14353
|
/**
|
|
14352
14354
|
* Extracts all unique font names used in an MText string.
|
|
@@ -14462,7 +14464,7 @@ class Td extends g.Object3D {
|
|
|
14462
14464
|
}
|
|
14463
14465
|
r.matrix.compose(ze, Gn, Pn);
|
|
14464
14466
|
const c = e.position ? ze.clone().sub(e.position) : ze;
|
|
14465
|
-
return Nn.makeTranslation(-c.x, -c.y, 0),
|
|
14467
|
+
return Nn.makeTranslation(-c.x, -c.y, 0), Bs.makeRotationZ(a), r.matrix.multiply(Nn), r.matrix.multiply(Bs), r.matrix.multiply(Nn.invert()), r.matrix.decompose(r.position, r.quaternion, r.scale), r;
|
|
14466
14468
|
}
|
|
14467
14469
|
/**
|
|
14468
14470
|
* Creates a group of text elements from MText data.
|
|
@@ -14480,7 +14482,7 @@ class Td extends g.Object3D {
|
|
|
14480
14482
|
e.width && e.attachmentPoint && ([1, 4, 7].includes(e.attachmentPoint) ? s = le.LEFT : [2, 5, 8].includes(e.attachmentPoint) ? s = le.CENTER : [3, 6, 9].includes(e.attachmentPoint) && (s = le.RIGHT));
|
|
14481
14483
|
let i = bt.BOTTOM;
|
|
14482
14484
|
e.attachmentPoint && ([1, 2, 3].includes(e.attachmentPoint) ? i = bt.TOP : [4, 5, 6].includes(e.attachmentPoint) ? i = bt.MIDDLE : [7, 8, 9].includes(e.attachmentPoint) && (i = bt.BOTTOM));
|
|
14483
|
-
const o = e.height || 0, a = e.lineSpaceFactor || 0.3, c = e.drawingDirection ??
|
|
14485
|
+
const o = e.height || 0, a = e.lineSpaceFactor || 0.3, c = e.drawingDirection ?? At.LEFT_TO_RIGHT, l = {
|
|
14484
14486
|
fontSize: o,
|
|
14485
14487
|
widthFactor: e.widthFactor ?? 1,
|
|
14486
14488
|
lineSpaceFactor: a,
|
|
@@ -14546,7 +14548,7 @@ class Td extends g.Object3D {
|
|
|
14546
14548
|
i -= e, o += t;
|
|
14547
14549
|
break;
|
|
14548
14550
|
}
|
|
14549
|
-
return s ==
|
|
14551
|
+
return s == At.BOTTOM_TO_TOP && (o -= t), { x: i, y: o };
|
|
14550
14552
|
}
|
|
14551
14553
|
/**
|
|
14552
14554
|
* Recursively calculates bounding boxes for an object and its children.
|
|
@@ -14569,7 +14571,7 @@ var K;
|
|
|
14569
14571
|
(function(n) {
|
|
14570
14572
|
n[n.BeforeStart = 0] = "BeforeStart", n[n.EqualStart = 1] = "EqualStart", n[n.BetweenStartAndEnd = 2] = "BetweenStartAndEnd", n[n.EqualEnd = 3] = "EqualEnd", n[n.AfterEnd = 4] = "AfterEnd";
|
|
14571
14573
|
})(K || (K = {}));
|
|
14572
|
-
class
|
|
14574
|
+
class Cd {
|
|
14573
14575
|
pointsSame(e, t) {
|
|
14574
14576
|
return this.pointsSameX(e, t) && this.pointsSameY(e, t);
|
|
14575
14577
|
}
|
|
@@ -14577,7 +14579,7 @@ class Id {
|
|
|
14577
14579
|
return this.pointsSameX(e, t) ? this.pointsSameY(e, t) ? 0 : e[1] < t[1] ? -1 : 1 : e[0] < t[0] ? -1 : 1;
|
|
14578
14580
|
}
|
|
14579
14581
|
}
|
|
14580
|
-
class
|
|
14582
|
+
class oo extends Cd {
|
|
14581
14583
|
constructor(e = 1e-10) {
|
|
14582
14584
|
super(), this.epsilon = e;
|
|
14583
14585
|
}
|
|
@@ -14827,7 +14829,7 @@ class gt {
|
|
|
14827
14829
|
return ft(e, [0, 2, 1, 0, 2, 0, 0, 1, 1, 0, 0, 2, 0, 1, 2, 0], t);
|
|
14828
14830
|
}
|
|
14829
14831
|
}
|
|
14830
|
-
function
|
|
14832
|
+
function Id(n, e, t) {
|
|
14831
14833
|
const r = [], s = [];
|
|
14832
14834
|
for (const i of n) {
|
|
14833
14835
|
let d = function(v, S, x) {
|
|
@@ -14837,8 +14839,8 @@ function Cd(n, e, t) {
|
|
|
14837
14839
|
}, p = function(v, S) {
|
|
14838
14840
|
const x = r[v], _ = r[S];
|
|
14839
14841
|
let w = x[x.length - 1];
|
|
14840
|
-
const L = x[x.length - 2], T = _[0],
|
|
14841
|
-
e.pointsCollinear(L, w, T) && (t == null || t.chainRemoveTail(v, w), x.pop(), w = L), e.pointsCollinear(w, T,
|
|
14842
|
+
const L = x[x.length - 2], T = _[0], I = _[1];
|
|
14843
|
+
e.pointsCollinear(L, w, T) && (t == null || t.chainRemoveTail(v, w), x.pop(), w = L), e.pointsCollinear(w, T, I) && (t == null || t.chainRemoveHead(S, T), _.shift()), t == null || t.chainJoin(v, S), r[v] = x.concat(_), r.splice(S, 1);
|
|
14842
14844
|
};
|
|
14843
14845
|
const o = i.start, a = i.end;
|
|
14844
14846
|
if (e.pointsSame(o, a)) {
|
|
@@ -14878,9 +14880,9 @@ function Cd(n, e, t) {
|
|
|
14878
14880
|
t == null || t.chainMatch(c.index);
|
|
14879
14881
|
const v = c.index, S = c.matches_pt1 ? a : o, x = c.matches_head, _ = r[v];
|
|
14880
14882
|
let w = x ? _[0] : _[_.length - 1];
|
|
14881
|
-
const L = x ? _[1] : _[_.length - 2], T = x ? _[_.length - 1] : _[0],
|
|
14883
|
+
const L = x ? _[1] : _[_.length - 2], T = x ? _[_.length - 1] : _[0], I = x ? _[_.length - 2] : _[1];
|
|
14882
14884
|
if (e.pointsCollinear(L, w, S) && (x ? (t == null || t.chainRemoveHead(c.index, S), _.shift()) : (t == null || t.chainRemoveTail(c.index, S), _.pop()), w = L), e.pointsSame(T, S)) {
|
|
14883
|
-
r.splice(v, 1), e.pointsCollinear(
|
|
14885
|
+
r.splice(v, 1), e.pointsCollinear(I, T, w) && (x ? (t == null || t.chainRemoveTail(c.index, w), _.pop()) : (t == null || t.chainRemoveHead(c.index, w), _.shift())), t == null || t.chainClose(c.index), s.push(_);
|
|
14884
14886
|
continue;
|
|
14885
14887
|
}
|
|
14886
14888
|
x ? (t == null || t.chainAddHead(c.index, S), _.unshift(S)) : (t == null || t.chainAddTail(c.index, S), _.push(S));
|
|
@@ -14973,7 +14975,7 @@ class kd {
|
|
|
14973
14975
|
this.push("done", null);
|
|
14974
14976
|
}
|
|
14975
14977
|
}
|
|
14976
|
-
class
|
|
14978
|
+
class ao {
|
|
14977
14979
|
constructor(e) {
|
|
14978
14980
|
this.log = null, this.geo = e;
|
|
14979
14981
|
}
|
|
@@ -15034,7 +15036,7 @@ class oo {
|
|
|
15034
15036
|
}
|
|
15035
15037
|
polygon(e) {
|
|
15036
15038
|
return {
|
|
15037
|
-
regions:
|
|
15039
|
+
regions: Id(e.segments, this.geo, this.log),
|
|
15038
15040
|
inverted: e.inverted
|
|
15039
15041
|
};
|
|
15040
15042
|
}
|
|
@@ -15060,7 +15062,7 @@ class oo {
|
|
|
15060
15062
|
return this.polygon(o);
|
|
15061
15063
|
}
|
|
15062
15064
|
}
|
|
15063
|
-
new
|
|
15065
|
+
new ao(new oo());
|
|
15064
15066
|
class dn extends g.Object3D {
|
|
15065
15067
|
/**
|
|
15066
15068
|
* Flatten the hierarchy of the specified object so that all children are moved to be direct
|
|
@@ -15798,10 +15800,10 @@ class Gt {
|
|
|
15798
15800
|
return e;
|
|
15799
15801
|
}
|
|
15800
15802
|
}
|
|
15801
|
-
function
|
|
15803
|
+
function Cr(n, e) {
|
|
15802
15804
|
return n - e;
|
|
15803
15805
|
}
|
|
15804
|
-
function
|
|
15806
|
+
function Ir(n, e, t = 0) {
|
|
15805
15807
|
const r = e.itemSize;
|
|
15806
15808
|
if (n.isInterleavedBufferAttribute || n.array.constructor !== e.array.constructor) {
|
|
15807
15809
|
const s = n.count;
|
|
@@ -15823,7 +15825,7 @@ function lt(n, e) {
|
|
|
15823
15825
|
}
|
|
15824
15826
|
}
|
|
15825
15827
|
const Fs = /* @__PURE__ */ new g.Box3(), qe = /* @__PURE__ */ new g.Vector3(), Ze = /* @__PURE__ */ new g.LineSegments(), Xt = [];
|
|
15826
|
-
class
|
|
15828
|
+
class Ad extends g.LineSegments {
|
|
15827
15829
|
constructor(e = 1e3, t = e * 2, r) {
|
|
15828
15830
|
super(new g.BufferGeometry(), r), this.boundingBox = null, this.boundingSphere = null, this._geometryInfo = [], this._availableGeometryIds = [], this._nextIndexStart = 0, this._nextVertexStart = 0, this._geometryCount = 0, this._geometryInitialized = !1, this.frustumCulled = !1, this._maxVertexCount = e, this._maxIndexCount = t;
|
|
15829
15831
|
}
|
|
@@ -15967,7 +15969,7 @@ class Bd extends g.LineSegments {
|
|
|
15967
15969
|
"AcTrBatchedLine: Reserved space request exceeds the maximum buffer size."
|
|
15968
15970
|
);
|
|
15969
15971
|
let a;
|
|
15970
|
-
return this._availableGeometryIds.length > 0 ? (this._availableGeometryIds.sort(
|
|
15972
|
+
return this._availableGeometryIds.length > 0 ? (this._availableGeometryIds.sort(Cr), a = this._availableGeometryIds.shift(), i[a] = s) : (a = this._geometryCount, this._geometryCount++, i.push(s)), this.setGeometryAt(a, e), this._nextIndexStart = s.indexStart + s.reservedIndexCount, this._nextVertexStart = s.vertexStart + s.reservedVertexCount, a;
|
|
15971
15973
|
}
|
|
15972
15974
|
setGeometryInfo(e, t) {
|
|
15973
15975
|
if (e >= this._geometryCount)
|
|
@@ -15990,7 +15992,7 @@ class Bd extends g.LineSegments {
|
|
|
15990
15992
|
const d = t.getAttribute(h), u = r.getAttribute(
|
|
15991
15993
|
h
|
|
15992
15994
|
);
|
|
15993
|
-
|
|
15995
|
+
Ir(d, u, c);
|
|
15994
15996
|
const p = d.itemSize;
|
|
15995
15997
|
for (let f = d.count, m = l; f < m; f++) {
|
|
15996
15998
|
const y = c + f;
|
|
@@ -16188,7 +16190,7 @@ class Bd extends g.LineSegments {
|
|
|
16188
16190
|
}
|
|
16189
16191
|
}
|
|
16190
16192
|
const Ps = /* @__PURE__ */ new g.Box3(), Qe = /* @__PURE__ */ new g.Vector3(), Je = /* @__PURE__ */ new g.Mesh(), $t = [];
|
|
16191
|
-
class
|
|
16193
|
+
class Bd extends g.Mesh {
|
|
16192
16194
|
constructor(e = 1e3, t = e * 2, r) {
|
|
16193
16195
|
super(new g.BufferGeometry(), r), this.boundingBox = null, this.boundingSphere = null, this._geometryInfo = [], this._availableGeometryIds = [], this._nextIndexStart = 0, this._nextVertexStart = 0, this._geometryCount = 0, this._geometryInitialized = !1, this.frustumCulled = !1, this._maxVertexCount = e, this._maxIndexCount = t;
|
|
16194
16196
|
}
|
|
@@ -16302,7 +16304,7 @@ class Ad extends g.Mesh {
|
|
|
16302
16304
|
"AcTrBatchedMesh: Reserved space request exceeds the maximum buffer size."
|
|
16303
16305
|
);
|
|
16304
16306
|
let a;
|
|
16305
|
-
return this._availableGeometryIds.length > 0 ? (this._availableGeometryIds.sort(
|
|
16307
|
+
return this._availableGeometryIds.length > 0 ? (this._availableGeometryIds.sort(Cr), a = this._availableGeometryIds.shift(), i[a] = s) : (a = this._geometryCount, this._geometryCount++, i.push(s)), this.setGeometryAt(a, e), this._nextIndexStart = s.indexStart + s.reservedIndexCount, this._nextVertexStart = s.vertexStart + s.reservedVertexCount, a;
|
|
16306
16308
|
}
|
|
16307
16309
|
setGeometryInfo(e, t) {
|
|
16308
16310
|
if (e >= this._geometryCount)
|
|
@@ -16325,7 +16327,7 @@ class Ad extends g.Mesh {
|
|
|
16325
16327
|
const d = t.getAttribute(h), u = r.getAttribute(
|
|
16326
16328
|
h
|
|
16327
16329
|
);
|
|
16328
|
-
|
|
16330
|
+
Ir(d, u, c);
|
|
16329
16331
|
const p = d.itemSize;
|
|
16330
16332
|
for (let f = d.count, m = l; f < m; f++) {
|
|
16331
16333
|
const y = c + f;
|
|
@@ -16618,7 +16620,7 @@ class Ld extends g.Points {
|
|
|
16618
16620
|
}, s = this._geometryInfo;
|
|
16619
16621
|
r.vertexStart = this._nextVertexStart, r.reservedVertexCount = t === -1 ? e.getAttribute("position").count : t;
|
|
16620
16622
|
let i;
|
|
16621
|
-
return this._availableGeometryIds.length > 0 ? (this._availableGeometryIds.sort(
|
|
16623
|
+
return this._availableGeometryIds.length > 0 ? (this._availableGeometryIds.sort(Cr), i = this._availableGeometryIds.shift(), s[i] = r) : (i = this._geometryCount, this._geometryCount++, s.push(r)), this.setGeometryAt(i, e), this._nextVertexStart = r.vertexStart + r.reservedVertexCount, this.geometry.setDrawRange(0, this._nextVertexStart), i;
|
|
16622
16624
|
}
|
|
16623
16625
|
setGeometryInfo(e, t) {
|
|
16624
16626
|
if (e >= this._geometryCount)
|
|
@@ -16636,7 +16638,7 @@ class Ld extends g.Points {
|
|
|
16636
16638
|
const c = t.getAttribute(a), l = r.getAttribute(
|
|
16637
16639
|
a
|
|
16638
16640
|
);
|
|
16639
|
-
|
|
16641
|
+
Ir(c, l, i);
|
|
16640
16642
|
const h = c.itemSize;
|
|
16641
16643
|
for (let d = c.count, u = o; d < u; d++) {
|
|
16642
16644
|
const p = i + d;
|
|
@@ -16978,7 +16980,7 @@ class Od extends g.Group {
|
|
|
16978
16980
|
addLine(e, t) {
|
|
16979
16981
|
const r = e.material, s = this.getMatchedLineBatches(e);
|
|
16980
16982
|
let i = s.get(r.id);
|
|
16981
|
-
i == null && (i = new
|
|
16983
|
+
i == null && (i = new Ad(1e3, 2e3, r), s.set(r.id, i), this.add(i)), e.geometry.applyMatrix4(e.matrixWorld);
|
|
16982
16984
|
const o = i.addGeometry(e.geometry);
|
|
16983
16985
|
return i.setGeometryInfo(o, t), {
|
|
16984
16986
|
batchedObjectId: i.id,
|
|
@@ -16988,7 +16990,7 @@ class Od extends g.Group {
|
|
|
16988
16990
|
addMesh(e, t) {
|
|
16989
16991
|
const r = e.material, s = this.getMatchedMeshBatches(e);
|
|
16990
16992
|
let i = s.get(r.id);
|
|
16991
|
-
i == null && (i = new
|
|
16993
|
+
i == null && (i = new Bd(1e3, 2e3, r), s.set(r.id, i), this.add(i)), e.geometry.applyMatrix4(e.matrixWorld);
|
|
16992
16994
|
const o = i.addGeometry(e.geometry);
|
|
16993
16995
|
return i.setGeometryInfo(o, t), {
|
|
16994
16996
|
batchedObjectId: i.id,
|
|
@@ -17045,7 +17047,7 @@ class Od extends g.Group {
|
|
|
17045
17047
|
return t;
|
|
17046
17048
|
}
|
|
17047
17049
|
}
|
|
17048
|
-
class
|
|
17050
|
+
class co extends dn {
|
|
17049
17051
|
constructor(e) {
|
|
17050
17052
|
super(), this._styleManager = e;
|
|
17051
17053
|
}
|
|
@@ -17059,7 +17061,7 @@ class ao extends dn {
|
|
|
17059
17061
|
return this._styleManager = e._styleManager, super.copy(e, t);
|
|
17060
17062
|
}
|
|
17061
17063
|
}
|
|
17062
|
-
class ge extends
|
|
17064
|
+
class ge extends co {
|
|
17063
17065
|
constructor(e) {
|
|
17064
17066
|
super(e), this._objectId = "", this._ownerId = "", this._layerName = "", this._box = new g.Box3();
|
|
17065
17067
|
}
|
|
@@ -17232,7 +17234,7 @@ class Rd extends ge {
|
|
|
17232
17234
|
}
|
|
17233
17235
|
}
|
|
17234
17236
|
const qt = /* @__PURE__ */ new g.Vector3(), Zt = /* @__PURE__ */ new g.Vector3();
|
|
17235
|
-
class
|
|
17237
|
+
class Bt {
|
|
17236
17238
|
/**
|
|
17237
17239
|
* Release memeory occupied by buffer geometry
|
|
17238
17240
|
* @param geometry
|
|
@@ -17250,7 +17252,7 @@ class At {
|
|
|
17250
17252
|
for (const s in e.attributes)
|
|
17251
17253
|
t.setAttribute(
|
|
17252
17254
|
s,
|
|
17253
|
-
|
|
17255
|
+
Bt.createGeometryAttributeByIndex(
|
|
17254
17256
|
e.attributes[s],
|
|
17255
17257
|
r
|
|
17256
17258
|
)
|
|
@@ -17294,7 +17296,7 @@ class At {
|
|
|
17294
17296
|
const t = e.isLineSegments === !0;
|
|
17295
17297
|
let r = e.geometry;
|
|
17296
17298
|
const s = e.matrixWorld;
|
|
17297
|
-
if (r.index && (r =
|
|
17299
|
+
if (r.index && (r = Bt.toNonIndexed(r)), r.index === null) {
|
|
17298
17300
|
const i = r.attributes.position;
|
|
17299
17301
|
if (!i || i.count === 0)
|
|
17300
17302
|
return;
|
|
@@ -17372,7 +17374,7 @@ class Ud extends ge {
|
|
|
17372
17374
|
const l = new g.BufferGeometry();
|
|
17373
17375
|
l.setAttribute("position", new g.BufferAttribute(a, 3)), l.setIndex(new g.BufferAttribute(c, 1)), this.setBoundingBox(l), this.geometry = l;
|
|
17374
17376
|
const h = new g.LineSegments(l, s);
|
|
17375
|
-
|
|
17377
|
+
Bt.computeLineDistances(h), this.add(h);
|
|
17376
17378
|
}
|
|
17377
17379
|
setBoundingBox(e) {
|
|
17378
17380
|
e.computeBoundingBox(), this.box = e.boundingBox;
|
|
@@ -17389,7 +17391,7 @@ class Fd extends ge {
|
|
|
17389
17391
|
new g.BufferAttribute(e, t)
|
|
17390
17392
|
), a.setIndex(new g.BufferAttribute(r, 1)), a.computeBoundingBox(), this.box = a.boundingBox;
|
|
17391
17393
|
const c = new g.LineSegments(a, o);
|
|
17392
|
-
|
|
17394
|
+
Bt.computeLineDistances(c), this.add(c);
|
|
17393
17395
|
}
|
|
17394
17396
|
}
|
|
17395
17397
|
class Pd extends ge {
|
|
@@ -17505,7 +17507,7 @@ class zd extends ge {
|
|
|
17505
17507
|
try {
|
|
17506
17508
|
p.forEach((y, v) => {
|
|
17507
17509
|
m = Math.min(e[y][0].relativeEps(), 1e-6);
|
|
17508
|
-
const S = new
|
|
17510
|
+
const S = new ao(new oo(m));
|
|
17509
17511
|
if (v === 0)
|
|
17510
17512
|
f = S.segments({
|
|
17511
17513
|
regions: [a(e[y])],
|
|
@@ -17553,7 +17555,7 @@ class zd extends ge {
|
|
|
17553
17555
|
const c = [];
|
|
17554
17556
|
for (let l = i + 1; l < r; l++) {
|
|
17555
17557
|
const h = e[t[l]];
|
|
17556
|
-
|
|
17558
|
+
go.isPolygonIntersect(
|
|
17557
17559
|
o,
|
|
17558
17560
|
h
|
|
17559
17561
|
) && (a = !0, c.push(t[l]));
|
|
@@ -17946,8 +17948,8 @@ const nn = class xt {
|
|
|
17946
17948
|
const m = u.dashPattern.length;
|
|
17947
17949
|
let y = !0, v = 0;
|
|
17948
17950
|
for (let T = 0; T < m; ++T) {
|
|
17949
|
-
const
|
|
17950
|
-
|
|
17951
|
+
const I = u.dashPattern[T];
|
|
17952
|
+
I > 0 && (y = !1), v += Math.abs(I);
|
|
17951
17953
|
}
|
|
17952
17954
|
const S = y ? o : i, x = [], _ = [];
|
|
17953
17955
|
let w = 0;
|
|
@@ -18012,12 +18014,12 @@ const nn = class xt {
|
|
|
18012
18014
|
}
|
|
18013
18015
|
};
|
|
18014
18016
|
nn.CameraZoomUniform = { value: 1 }, nn.ViewportScaleUniform = { value: 1 }, nn.MaxFragmentUniforms = 1024;
|
|
18015
|
-
let
|
|
18016
|
-
class
|
|
18017
|
+
let jd = nn;
|
|
18018
|
+
class Wd {
|
|
18017
18019
|
constructor(e) {
|
|
18018
18020
|
this.events = {
|
|
18019
18021
|
fontNotFound: new te()
|
|
18020
|
-
}, this._renderer = e, this._styleManager = new
|
|
18022
|
+
}, this._renderer = e, this._styleManager = new jd(), he.instance.events.fontNotFound.addEventListener((t) => {
|
|
18021
18023
|
this.events.fontNotFound.dispatch(t);
|
|
18022
18024
|
});
|
|
18023
18025
|
}
|
|
@@ -18048,6 +18050,36 @@ class jd {
|
|
|
18048
18050
|
render(e, t) {
|
|
18049
18051
|
this._renderer.render(e, t.internalCamera);
|
|
18050
18052
|
}
|
|
18053
|
+
/**
|
|
18054
|
+
* Sets the clear color used when clearing the canvas.
|
|
18055
|
+
*
|
|
18056
|
+
* @param color - Background color as 24-bit hexadecimal RGB number
|
|
18057
|
+
* @param alpha - Optional alpha value (0.0 - 1.0)
|
|
18058
|
+
*/
|
|
18059
|
+
setClearColor(e, t) {
|
|
18060
|
+
this._renderer.setClearColor(e, t);
|
|
18061
|
+
}
|
|
18062
|
+
/**
|
|
18063
|
+
* Gets the current clear color as a 24-bit hexadecimal RGB number.
|
|
18064
|
+
*/
|
|
18065
|
+
getClearColor() {
|
|
18066
|
+
const e = new g.Color();
|
|
18067
|
+
return this._renderer.getClearColor(e), e.getHex();
|
|
18068
|
+
}
|
|
18069
|
+
/**
|
|
18070
|
+
* Sets the clear alpha used when clearing the canvas.
|
|
18071
|
+
*
|
|
18072
|
+
* @param alpha - Alpha value (0.0 - 1.0)
|
|
18073
|
+
*/
|
|
18074
|
+
setClearAlpha(e) {
|
|
18075
|
+
this._renderer.setClearAlpha(e);
|
|
18076
|
+
}
|
|
18077
|
+
/**
|
|
18078
|
+
* Gets the current clear alpha value.
|
|
18079
|
+
*/
|
|
18080
|
+
getClearAlpha() {
|
|
18081
|
+
return this._renderer.getClearAlpha();
|
|
18082
|
+
}
|
|
18051
18083
|
/**
|
|
18052
18084
|
* The internal THREE.js webgl renderer
|
|
18053
18085
|
*/
|
|
@@ -18079,7 +18111,7 @@ class jd {
|
|
|
18079
18111
|
* Create one empty drawable object
|
|
18080
18112
|
*/
|
|
18081
18113
|
createObject() {
|
|
18082
|
-
return new
|
|
18114
|
+
return new co(this._styleManager);
|
|
18083
18115
|
}
|
|
18084
18116
|
/**
|
|
18085
18117
|
* Create one empty entity
|
|
@@ -18251,7 +18283,7 @@ class Xd {
|
|
|
18251
18283
|
);
|
|
18252
18284
|
}
|
|
18253
18285
|
}
|
|
18254
|
-
class
|
|
18286
|
+
class lo {
|
|
18255
18287
|
/**
|
|
18256
18288
|
* Construct one instance of this class
|
|
18257
18289
|
* @param renderer Input renderer
|
|
@@ -18356,9 +18388,9 @@ class co {
|
|
|
18356
18388
|
), this._raycaster.params.Line.threshold = t, this._raycaster.params.Points.threshold = t, this._raycaster;
|
|
18357
18389
|
}
|
|
18358
18390
|
zoomTo(e, t = 1.1) {
|
|
18359
|
-
const r = new
|
|
18391
|
+
const r = new jn();
|
|
18360
18392
|
e.getSize(r);
|
|
18361
|
-
const s = new
|
|
18393
|
+
const s = new jn();
|
|
18362
18394
|
e.getCenter(s);
|
|
18363
18395
|
const i = new g.Vector3(s.x, s.y, 0);
|
|
18364
18396
|
this._camera.position.set(s.x, s.y, this._camera.position.z), this._camera.lookAt(i), this._camera.setRotationFromEuler(new g.Euler(0, 0, 0));
|
|
@@ -18390,7 +18422,7 @@ class co {
|
|
|
18390
18422
|
}, e.update(), e;
|
|
18391
18423
|
}
|
|
18392
18424
|
}
|
|
18393
|
-
class fn extends
|
|
18425
|
+
class fn extends lo {
|
|
18394
18426
|
/**
|
|
18395
18427
|
* Calcuate the bounding box of this viewport in client window coordinate system
|
|
18396
18428
|
*/
|
|
@@ -18448,7 +18480,7 @@ class fn extends co {
|
|
|
18448
18480
|
}
|
|
18449
18481
|
}
|
|
18450
18482
|
}
|
|
18451
|
-
const $d = (n) => new
|
|
18483
|
+
const $d = (n) => new Xs(n.min, n.max), Yd = (n) => new ue(
|
|
18452
18484
|
n.min,
|
|
18453
18485
|
n.max
|
|
18454
18486
|
), qd = (n) => new g.Box3(
|
|
@@ -18637,7 +18669,7 @@ class sp extends tp {
|
|
|
18637
18669
|
this.axes.geometry.dispose(), this.axes.material.dispose(), this.xText.geometry.dispose(), this.xText.material.dispose(), this.yText.geometry.dispose(), this.yText.material.dispose(), this.hasZAxis && ((e = this.zText) == null || e.geometry.dispose(), (t = this.zText) == null || t.material.dispose());
|
|
18638
18670
|
}
|
|
18639
18671
|
}
|
|
18640
|
-
class ip extends
|
|
18672
|
+
class ip extends lo {
|
|
18641
18673
|
/**
|
|
18642
18674
|
* Construct one instance of this class.
|
|
18643
18675
|
*
|
|
@@ -18845,11 +18877,11 @@ class op {
|
|
|
18845
18877
|
(t = this.activeLayoutView) == null || t.render(e);
|
|
18846
18878
|
}
|
|
18847
18879
|
}
|
|
18848
|
-
function
|
|
18880
|
+
function ho(n, e, t = 0, r = n.length - 1, s = ap) {
|
|
18849
18881
|
for (; r > t; ) {
|
|
18850
18882
|
if (r - t > 600) {
|
|
18851
18883
|
const c = r - t + 1, l = e - t + 1, h = Math.log(c), d = 0.5 * Math.exp(2 * h / 3), u = 0.5 * Math.sqrt(h * d * (c - d) / c) * (l - c / 2 < 0 ? -1 : 1), p = Math.max(t, Math.floor(e - l * d / c + u)), f = Math.min(r, Math.floor(e + (c - l) * d / c + u));
|
|
18852
|
-
|
|
18884
|
+
ho(n, e, p, f, s);
|
|
18853
18885
|
}
|
|
18854
18886
|
const i = n[e];
|
|
18855
18887
|
let o = t, a = r;
|
|
@@ -19110,7 +19142,7 @@ function Ns(n, e, t, r, s) {
|
|
|
19110
19142
|
for (; i.length; ) {
|
|
19111
19143
|
if (t = i.pop(), e = i.pop(), t - e <= r) continue;
|
|
19112
19144
|
const o = e + Math.ceil((t - e) / r / 2) * r;
|
|
19113
|
-
|
|
19145
|
+
ho(n, o, e, t, s), i.push(e, o, o, t);
|
|
19114
19146
|
}
|
|
19115
19147
|
}
|
|
19116
19148
|
class fp {
|
|
@@ -19689,22 +19721,22 @@ class yp extends ca {
|
|
|
19689
19721
|
alpha: !0,
|
|
19690
19722
|
canvas: e.canvas
|
|
19691
19723
|
});
|
|
19692
|
-
t.canvas == null && (t.canvas = r.domElement), super(t.canvas), e.calculateSizeCallback && this.setCalculateSizeCallback(e.calculateSizeCallback), r.setPixelRatio(Math.min(window.devicePixelRatio, 2)), r.setSize(this.width, this.height),
|
|
19724
|
+
t.canvas == null && (t.canvas = r.domElement), super(t.canvas), e.calculateSizeCallback && this.setCalculateSizeCallback(e.calculateSizeCallback), r.setPixelRatio(Math.min(window.devicePixelRatio, 2)), r.setSize(this.width, this.height), this._renderer = new Wd(r);
|
|
19693
19725
|
const s = Tt.instance.fontMapping;
|
|
19694
19726
|
this._renderer.setFontMapping(s), this._renderer.events.fontNotFound.addEventListener((i) => {
|
|
19695
19727
|
Ue.emit("font-not-found", {
|
|
19696
19728
|
fontName: i.fontName,
|
|
19697
19729
|
count: i.count ?? 0
|
|
19698
19730
|
});
|
|
19699
|
-
}), this._scene = this.createScene(), this._stats = this.createStats(Tt.instance.isShowStats), Tt.instance.events.modified.addEventListener((i) => {
|
|
19731
|
+
}), this._scene = this.createScene(), this._renderer.setClearColor(t.background || 0), this._stats = this.createStats(Tt.instance.isShowStats), Tt.instance.events.modified.addEventListener((i) => {
|
|
19700
19732
|
i.key == "isShowStats" && this.toggleStatsVisibility(this._stats, i.value);
|
|
19701
19733
|
}), this.canvas.addEventListener("click", () => {
|
|
19702
19734
|
this.mode == De.SELECTION && this.select();
|
|
19703
19735
|
}), document.addEventListener("keydown", (i) => {
|
|
19704
19736
|
i.code === "Escape" && this.selectionSet.clear();
|
|
19705
|
-
}),
|
|
19737
|
+
}), $s().layoutManager.events.layoutSwitched.addEventListener(
|
|
19706
19738
|
(i) => {
|
|
19707
|
-
this.activeLayoutBtrId = i.
|
|
19739
|
+
this.activeLayoutBtrId = i.layout.blockTableRecordId;
|
|
19708
19740
|
}
|
|
19709
19741
|
), this._missedImages = /* @__PURE__ */ new Map(), this._layoutViewManager = new op(), this.initialize(), this.onWindowResize(), this.animate(), this._isDirty = !0;
|
|
19710
19742
|
}
|
|
@@ -19778,6 +19810,23 @@ class yp extends ca {
|
|
|
19778
19810
|
set center(e) {
|
|
19779
19811
|
this.activeLayoutView.center = e;
|
|
19780
19812
|
}
|
|
19813
|
+
/**
|
|
19814
|
+
* Gets the background color of the view.
|
|
19815
|
+
*
|
|
19816
|
+
* The color is represented as a 24-bit hexadecimal RGB number, e.g.,
|
|
19817
|
+
* `0x000000` for black.
|
|
19818
|
+
*/
|
|
19819
|
+
get backgroundColor() {
|
|
19820
|
+
return this._renderer.getClearColor();
|
|
19821
|
+
}
|
|
19822
|
+
/**
|
|
19823
|
+
* Sets the background color of the view.
|
|
19824
|
+
*
|
|
19825
|
+
* @param value - The background color as a 24-bit hexadecimal RGB number
|
|
19826
|
+
*/
|
|
19827
|
+
set backgroundColor(e) {
|
|
19828
|
+
this._renderer.setClearColor(e), this._isDirty = !0;
|
|
19829
|
+
}
|
|
19781
19830
|
/**
|
|
19782
19831
|
* The block table record id of the model space
|
|
19783
19832
|
*/
|
|
@@ -19888,27 +19937,34 @@ class yp extends ca {
|
|
|
19888
19937
|
* @inheritdoc
|
|
19889
19938
|
*/
|
|
19890
19939
|
addEntity(e) {
|
|
19891
|
-
|
|
19892
|
-
|
|
19893
|
-
|
|
19894
|
-
|
|
19895
|
-
|
|
19896
|
-
|
|
19897
|
-
|
|
19898
|
-
|
|
19899
|
-
|
|
19900
|
-
|
|
19901
|
-
|
|
19902
|
-
|
|
19903
|
-
|
|
19904
|
-
|
|
19905
|
-
this.
|
|
19906
|
-
|
|
19907
|
-
|
|
19940
|
+
let t = [];
|
|
19941
|
+
Array.isArray(e) ? t = e : t.push(e);
|
|
19942
|
+
for (let r = 0; r < t.length; ++r) {
|
|
19943
|
+
const s = t[r];
|
|
19944
|
+
let i = s.draw(
|
|
19945
|
+
this._renderer
|
|
19946
|
+
);
|
|
19947
|
+
if (i) {
|
|
19948
|
+
i.objectId = s.objectId, i.ownerId = s.ownerId, i.layerName = s.layer, i.visible = s.visibility;
|
|
19949
|
+
const o = !(s instanceof Zs || s instanceof Qs);
|
|
19950
|
+
this._scene.addEntity(i, o), this._isDirty = !0, i.dispose(), i = null;
|
|
19951
|
+
}
|
|
19952
|
+
if (s instanceof Ys) {
|
|
19953
|
+
if (s.number > 1) {
|
|
19954
|
+
const o = this._layoutViewManager.getAt(s.ownerId);
|
|
19955
|
+
if (o) {
|
|
19956
|
+
const a = new fn(
|
|
19957
|
+
o,
|
|
19958
|
+
s.toGiViewport(),
|
|
19959
|
+
this._renderer
|
|
19960
|
+
);
|
|
19961
|
+
o.addViewport(a);
|
|
19962
|
+
}
|
|
19963
|
+
}
|
|
19964
|
+
} else if (s instanceof qs) {
|
|
19965
|
+
const o = s.imageFileName;
|
|
19966
|
+
o && this._missedImages.set(s.objectId, o);
|
|
19908
19967
|
}
|
|
19909
|
-
} else if (e instanceof Ys) {
|
|
19910
|
-
const s = e.imageFileName;
|
|
19911
|
-
s && this._missedImages.set(e.objectId, s);
|
|
19912
19968
|
}
|
|
19913
19969
|
}
|
|
19914
19970
|
/**
|
|
@@ -19922,10 +19978,21 @@ class yp extends ca {
|
|
|
19922
19978
|
* @inheritdoc
|
|
19923
19979
|
*/
|
|
19924
19980
|
updateEntity(e) {
|
|
19925
|
-
|
|
19926
|
-
|
|
19981
|
+
let t = [];
|
|
19982
|
+
Array.isArray(e) ? t = e : t.push(e);
|
|
19983
|
+
for (let r = 0; r < t.length; ++r) {
|
|
19984
|
+
const s = t[r], i = s.draw(this._renderer);
|
|
19985
|
+
i && (i.objectId = s.objectId, i.ownerId = s.ownerId, i.layerName = s.layer, i.visible = s.visibility, this._scene.update(i));
|
|
19986
|
+
}
|
|
19987
|
+
this._isDirty = !0, setTimeout(() => {
|
|
19927
19988
|
this._isDirty = !0;
|
|
19928
|
-
}, 100)
|
|
19989
|
+
}, 100);
|
|
19990
|
+
}
|
|
19991
|
+
/**
|
|
19992
|
+
* @inheritdoc
|
|
19993
|
+
*/
|
|
19994
|
+
addLayout(e) {
|
|
19995
|
+
this._scene.addEmptyLayout(e.blockTableRecordId), this.createLayoutViewIfNeeded(e.blockTableRecordId);
|
|
19929
19996
|
}
|
|
19930
19997
|
/**
|
|
19931
19998
|
* @inheritdoc
|
|
@@ -20031,7 +20098,7 @@ class it {
|
|
|
20031
20098
|
createExampleDoc1(e) {
|
|
20032
20099
|
for (let s = 0; s < 2; ++s)
|
|
20033
20100
|
for (let i = 0; i < 2; ++i) {
|
|
20034
|
-
const o = new
|
|
20101
|
+
const o = new Wn(), a = new Js();
|
|
20035
20102
|
a.addVertexAt(0, { x: i * 100, y: s * 100, bulge: 1 }), a.addVertexAt(1, { x: i * 100 + 100, y: s * 100, bulge: 1 }), a.closed = !0, o.add(a), e.tables.blockTable.modelSpace.appendEntity(o);
|
|
20036
20103
|
}
|
|
20037
20104
|
}
|
|
@@ -20061,7 +20128,7 @@ class it {
|
|
|
20061
20128
|
const t = e.tables.blockTable.modelSpace;
|
|
20062
20129
|
t.appendEntity(this.createArc()), this.createLines().forEach((s) => {
|
|
20063
20130
|
e.tables.blockTable.modelSpace.appendEntity(
|
|
20064
|
-
new
|
|
20131
|
+
new Ks(s.startPoint, s.endPoint)
|
|
20065
20132
|
);
|
|
20066
20133
|
}), t.appendEntity(this.createHatch()), e.tables.textStyleTable.add(this.createTextStyle()), t.appendEntity(this.createMText());
|
|
20067
20134
|
}
|
|
@@ -20079,16 +20146,16 @@ class it {
|
|
|
20079
20146
|
textGenerationFlag: 0,
|
|
20080
20147
|
widthFactor: 0.667
|
|
20081
20148
|
};
|
|
20082
|
-
return new
|
|
20149
|
+
return new ei(e);
|
|
20083
20150
|
}
|
|
20084
20151
|
createMText() {
|
|
20085
|
-
const e = new
|
|
20086
|
-
return e.attachmentPoint =
|
|
20152
|
+
const e = new ti();
|
|
20153
|
+
return e.attachmentPoint = mo.MiddleLeft, e.color = new lr().setColorName("red"), e.layer = "0", e.location = new Xn(9850, 86773, 0), e.contents = "{\\W0.667;\\T1.1;智慧8081}", e.height = 200, e.width = 1e3, e.styleName = "Standard", e;
|
|
20087
20154
|
}
|
|
20088
20155
|
createHatch() {
|
|
20089
|
-
const e = this.createLines(), t = new
|
|
20156
|
+
const e = this.createLines(), t = new Wn(), r = new ni();
|
|
20090
20157
|
return r.add(
|
|
20091
|
-
new
|
|
20158
|
+
new ri(
|
|
20092
20159
|
{ x: 20241.23355899991, y: 174118.6312674369 },
|
|
20093
20160
|
89258.30757455899,
|
|
20094
20161
|
vt.degToRad(262.2471115358437),
|
|
@@ -20096,11 +20163,11 @@ class it {
|
|
|
20096
20163
|
!1
|
|
20097
20164
|
)
|
|
20098
20165
|
), e.forEach((s) => {
|
|
20099
|
-
r.add(new
|
|
20166
|
+
r.add(new si(s.startPoint, s.endPoint));
|
|
20100
20167
|
}), t.add(r), t;
|
|
20101
20168
|
}
|
|
20102
20169
|
createArc() {
|
|
20103
|
-
return new
|
|
20170
|
+
return new ii(
|
|
20104
20171
|
{ x: 20241.23355899991, y: 174118.6312674369, z: 0 },
|
|
20105
20172
|
89258.30757455899,
|
|
20106
20173
|
vt.degToRad(262.2471115358437),
|
|
@@ -20260,7 +20327,7 @@ class ce {
|
|
|
20260
20327
|
width: window.innerWidth,
|
|
20261
20328
|
height: window.innerHeight - 30
|
|
20262
20329
|
}), s = new yp({ canvas: e, calculateSizeCallback: r });
|
|
20263
|
-
this._context = new Zo(s, t), this._fontLoader = new vp(s.renderer),
|
|
20330
|
+
this._context = new Zo(s, t), this._fontLoader = new vp(s.renderer), $s().workingDatabase = t.database, this.registerCommands();
|
|
20264
20331
|
}
|
|
20265
20332
|
/**
|
|
20266
20333
|
* Creates the singleton instance with an optional canvas element.
|
|
@@ -20594,7 +20661,7 @@ class Hs {
|
|
|
20594
20661
|
return e.type == "ARC" ? this.convertArc(e) : e.type == "CIRCLE" ? this.convertCirle(e) : e.type == "DIMENSION" ? this.convertDimension(e) : e.type == "ELLIPSE" ? this.convertEllipse(e) : e.type == "HATCH" ? this.convertHatch(e) : e.type == "IMAGE" ? this.convertImage(e) : e.type == "LEADER" ? this.convertLeader(e) : e.type == "LINE" ? this.convertLine(e) : e.type == "LWPOLYLINE" ? this.convertLWPolyline(e) : e.type == "MTEXT" ? this.convertMText(e) : e.type == "POINT" ? this.convertPoint(e) : e.type == "POLYLINE" ? this.convertPolyline(e) : e.type == "RAY" ? this.convertRay(e) : e.type == "SPLINE" ? this.convertSpline(e) : e.type == "ACAD_TABLE" ? this.convertTable(e) : e.type == "TEXT" ? this.convertText(e) : e.type == "SOLID" ? this.convertSolid(e) : e.type == "VIEWPORT" ? this.convertViewport(e) : e.type == "XLINE" ? this.convertXline(e) : e.type == "INSERT" ? this.convertBlockReference(e) : null;
|
|
20595
20662
|
}
|
|
20596
20663
|
convertArc(e) {
|
|
20597
|
-
return new
|
|
20664
|
+
return new ii(
|
|
20598
20665
|
e.center,
|
|
20599
20666
|
e.radius,
|
|
20600
20667
|
e.startAngle,
|
|
@@ -20602,7 +20669,7 @@ class Hs {
|
|
|
20602
20669
|
);
|
|
20603
20670
|
}
|
|
20604
20671
|
convertCirle(e) {
|
|
20605
|
-
return new
|
|
20672
|
+
return new Io(e.center, e.radius);
|
|
20606
20673
|
}
|
|
20607
20674
|
convertEllipse(e) {
|
|
20608
20675
|
const t = new Kt(e.majorAxisEndPoint), r = t.length();
|
|
@@ -20618,7 +20685,7 @@ class Hs {
|
|
|
20618
20685
|
}
|
|
20619
20686
|
convertLine(e) {
|
|
20620
20687
|
const t = e.startPoint, r = e.endPoint;
|
|
20621
|
-
return new
|
|
20688
|
+
return new Ks(
|
|
20622
20689
|
new Xn(t.x, t.y, t.z),
|
|
20623
20690
|
new Xn(r.x, r.y, r.z)
|
|
20624
20691
|
);
|
|
@@ -20674,7 +20741,7 @@ class Hs {
|
|
|
20674
20741
|
}
|
|
20675
20742
|
convertHatch(e) {
|
|
20676
20743
|
var t;
|
|
20677
|
-
const r = new
|
|
20744
|
+
const r = new Wn();
|
|
20678
20745
|
return (t = e.definitionLines) == null || t.forEach((s) => {
|
|
20679
20746
|
r.definitionLines.push({
|
|
20680
20747
|
angle: s.angle,
|
|
@@ -20684,7 +20751,7 @@ class Hs {
|
|
|
20684
20751
|
});
|
|
20685
20752
|
}), r.hatchStyle = e.hatchStyle, r.patternName = e.patternName, r.patternType = e.patternType, r.patternAngle = e.patternAngle == null ? 0 : e.patternAngle, r.patternScale = e.patternScale == null ? 0 : e.patternScale, e.boundaryPaths.forEach((s) => {
|
|
20686
20753
|
if (s.boundaryPathTypeFlag & 2) {
|
|
20687
|
-
const i = s, o = new
|
|
20754
|
+
const i = s, o = new Js();
|
|
20688
20755
|
o.closed = i.isClosed, i.vertices.forEach((a, c) => {
|
|
20689
20756
|
o.addVertexAt(c, {
|
|
20690
20757
|
x: a.x,
|
|
@@ -20693,15 +20760,15 @@ class Hs {
|
|
|
20693
20760
|
});
|
|
20694
20761
|
}), r.add(o);
|
|
20695
20762
|
} else {
|
|
20696
|
-
const i = s, o = new
|
|
20763
|
+
const i = s, o = new ni();
|
|
20697
20764
|
i.edges.forEach((a) => {
|
|
20698
20765
|
if (a.type == 1) {
|
|
20699
20766
|
const c = a;
|
|
20700
|
-
o.add(new
|
|
20767
|
+
o.add(new si(c.start, c.end));
|
|
20701
20768
|
} else if (a.type == 2) {
|
|
20702
20769
|
const c = a;
|
|
20703
20770
|
o.add(
|
|
20704
|
-
new
|
|
20771
|
+
new ri(
|
|
20705
20772
|
c.center,
|
|
20706
20773
|
c.radius,
|
|
20707
20774
|
c.startAngle,
|
|
@@ -20711,14 +20778,14 @@ class Hs {
|
|
|
20711
20778
|
);
|
|
20712
20779
|
} else if (a.type == 3) {
|
|
20713
20780
|
const c = a;
|
|
20714
|
-
new
|
|
20781
|
+
new jn().subVectors(c.end, c.center);
|
|
20715
20782
|
const l = Math.sqrt(
|
|
20716
20783
|
Math.pow(c.end.x, 2) + Math.pow(c.end.y, 2)
|
|
20717
20784
|
), h = l * c.lengthOfMinorAxis;
|
|
20718
20785
|
let d = c.startAngle, u = c.endAngle;
|
|
20719
20786
|
const p = Math.atan2(c.end.y, c.end.x);
|
|
20720
20787
|
c.isCCW || (d = Math.PI * 2 - d, u = Math.PI * 2 - u), o.add(
|
|
20721
|
-
new
|
|
20788
|
+
new Ao(
|
|
20722
20789
|
{ ...c.center, z: 0 },
|
|
20723
20790
|
l,
|
|
20724
20791
|
h,
|
|
@@ -20741,7 +20808,7 @@ class Hs {
|
|
|
20741
20808
|
let h = !0;
|
|
20742
20809
|
const d = c.controlPoints.map((u) => (u.weight == null && (h = !1), u.weight || 1));
|
|
20743
20810
|
o.add(
|
|
20744
|
-
new
|
|
20811
|
+
new Ar(
|
|
20745
20812
|
l,
|
|
20746
20813
|
c.knots,
|
|
20747
20814
|
h ? d : void 0
|
|
@@ -20753,7 +20820,7 @@ class Hs {
|
|
|
20753
20820
|
y: h.y,
|
|
20754
20821
|
z: 0
|
|
20755
20822
|
}));
|
|
20756
|
-
o.add(new
|
|
20823
|
+
o.add(new Ar(l, "Uniform"));
|
|
20757
20824
|
}
|
|
20758
20825
|
}
|
|
20759
20826
|
}), r.add(o);
|
|
@@ -20761,7 +20828,7 @@ class Hs {
|
|
|
20761
20828
|
}), r;
|
|
20762
20829
|
}
|
|
20763
20830
|
convertTable(e) {
|
|
20764
|
-
const t = new
|
|
20831
|
+
const t = new Bo(
|
|
20765
20832
|
e.name,
|
|
20766
20833
|
e.rowCount,
|
|
20767
20834
|
e.columnCount
|
|
@@ -20779,7 +20846,7 @@ class Hs {
|
|
|
20779
20846
|
return t.textString = e.text, t.styleName = e.styleName, t.height = e.textHeight, t.position.copy(e.startPoint), t.rotation = e.rotation, t.oblique = e.obliqueAngle ?? 0, t.thickness = e.thickness, t.horizontalMode = e.halign, t.verticalMode = e.valign, t.widthFactor = e.xScale ?? 1, t;
|
|
20780
20847
|
}
|
|
20781
20848
|
convertMText(e) {
|
|
20782
|
-
const t = new
|
|
20849
|
+
const t = new ti();
|
|
20783
20850
|
return t.contents = e.text, e.styleName != null && (t.styleName = e.styleName), t.height = e.textHeight, t.width = e.rectWidth, t.rotation = e.rotation || 0, t.location = e.insertionPoint, t.attachmentPoint = e.attachmentPoint, e.direction && (t.direction = new Kt(e.direction)), t.drawingDirection = e.drawingDirection, t;
|
|
20784
20851
|
}
|
|
20785
20852
|
convertLeader(e) {
|
|
@@ -20837,7 +20904,7 @@ class Hs {
|
|
|
20837
20904
|
) * e.imageSize.y, t.rotation = Math.atan2(e.uPixel.y, e.uPixel.x);
|
|
20838
20905
|
}
|
|
20839
20906
|
convertImage(e) {
|
|
20840
|
-
const t = new
|
|
20907
|
+
const t = new qs();
|
|
20841
20908
|
return this.processImage(e, t), t;
|
|
20842
20909
|
}
|
|
20843
20910
|
// private convertWipeout(wipeout: WipeoutEntity) {
|
|
@@ -20846,15 +20913,15 @@ class Hs {
|
|
|
20846
20913
|
// return dbWipeout
|
|
20847
20914
|
// }
|
|
20848
20915
|
convertViewport(e) {
|
|
20849
|
-
const t = new
|
|
20916
|
+
const t = new Ys();
|
|
20850
20917
|
return t.number = e.viewportId, t.centerPoint.copy(e.viewportCenter), t.height = e.height, t.width = e.width, t.viewCenter.copy(e.displayCenter), t.viewHeight = e.viewHeight, t;
|
|
20851
20918
|
}
|
|
20852
20919
|
convertRay(e) {
|
|
20853
|
-
const t = new
|
|
20920
|
+
const t = new Zs();
|
|
20854
20921
|
return t.basePoint.copy(e.firstPoint), t.unitDir.copy(e.unitDirection), t;
|
|
20855
20922
|
}
|
|
20856
20923
|
convertXline(e) {
|
|
20857
|
-
const t = new
|
|
20924
|
+
const t = new Qs();
|
|
20858
20925
|
return t.basePoint.copy(e.firstPoint), t.unitDir.copy(e.unitDirection), t;
|
|
20859
20926
|
}
|
|
20860
20927
|
convertBlockReference(e) {
|
|
@@ -20868,13 +20935,13 @@ class Hs {
|
|
|
20868
20935
|
t.layer = e.layer, t.objectId = e.handle.toString(), t.ownerId = e.ownerBlockRecordSoftId.toString(), e.lineType != null && (t.lineType = e.lineType), e.lineweight != null && (t.lineWeight = e.lineweight), e.lineTypeScale != null && (t.linetypeScale = e.lineTypeScale), e.color != null && (t.color.color = e.color), e.colorIndex != null && (t.color.colorIndex = e.colorIndex), e.colorName != null && (t.color.colorName = e.colorName), e.isVisible != null && (t.visibility = e.isVisible), e.transparency != null && (t.transparency = e.transparency);
|
|
20869
20936
|
}
|
|
20870
20937
|
}
|
|
20871
|
-
class bp extends
|
|
20938
|
+
class bp extends yo {
|
|
20872
20939
|
constructor(e = {}) {
|
|
20873
20940
|
super(e), e.useWorker = !0, e.parserWorkerUrl || (e.parserWorkerUrl = "/assets/libredwg-parser-worker.js");
|
|
20874
20941
|
}
|
|
20875
20942
|
async parse(e) {
|
|
20876
20943
|
if (this.config.useWorker && this.config.parserWorkerUrl)
|
|
20877
|
-
return (await
|
|
20944
|
+
return (await vo({ workerUrl: this.config.parserWorkerUrl }).execute(e)).data;
|
|
20878
20945
|
throw new Error("dwg converter can run in web worker only!");
|
|
20879
20946
|
}
|
|
20880
20947
|
/**
|
|
@@ -20931,13 +20998,13 @@ class bp extends mo {
|
|
|
20931
20998
|
standardFlag: r.standardFlag,
|
|
20932
20999
|
totalPatternLength: r.totalPatternLength,
|
|
20933
21000
|
pattern: r.pattern
|
|
20934
|
-
}, i = new
|
|
21001
|
+
}, i = new bo(s);
|
|
20935
21002
|
this.processCommonTableEntryAttrs(r, i), i.name = r.name, t.tables.linetypeTable.add(i);
|
|
20936
21003
|
});
|
|
20937
21004
|
}
|
|
20938
21005
|
processTextStyles(e, t) {
|
|
20939
21006
|
e.tables.STYLE.entries.forEach((r) => {
|
|
20940
|
-
const s = new
|
|
21007
|
+
const s = new ei(r);
|
|
20941
21008
|
this.processCommonTableEntryAttrs(r, s), t.tables.textStyleTable.add(s);
|
|
20942
21009
|
});
|
|
20943
21010
|
}
|
|
@@ -21017,7 +21084,7 @@ class bp extends mo {
|
|
|
21017
21084
|
// TODO: Set correct value
|
|
21018
21085
|
dimlwd: r.DIMLWD,
|
|
21019
21086
|
dimlwe: r.DIMLWE
|
|
21020
|
-
}, i = new
|
|
21087
|
+
}, i = new xo(s);
|
|
21021
21088
|
this.processCommonTableEntryAttrs(r, i), t.tables.dimStyleTable.add(i);
|
|
21022
21089
|
});
|
|
21023
21090
|
}
|
|
@@ -21025,7 +21092,7 @@ class bp extends mo {
|
|
|
21025
21092
|
e.tables.LAYER.entries.forEach((r) => {
|
|
21026
21093
|
const s = new lr();
|
|
21027
21094
|
s.colorIndex = r.colorIndex;
|
|
21028
|
-
const i = new
|
|
21095
|
+
const i = new So({
|
|
21029
21096
|
name: r.name,
|
|
21030
21097
|
standardFlags: r.standardFlag,
|
|
21031
21098
|
linetype: r.lineType,
|
|
@@ -21039,24 +21106,25 @@ class bp extends mo {
|
|
|
21039
21106
|
}
|
|
21040
21107
|
processViewports(e, t) {
|
|
21041
21108
|
e.tables.VPORT.entries.forEach((r) => {
|
|
21042
|
-
const s = new
|
|
21109
|
+
const s = new wo();
|
|
21043
21110
|
this.processCommonTableEntryAttrs(r, s), r.circleSides && (s.circleSides = r.circleSides), s.standardFlag = r.standardFlag, s.center.copy(r.center), s.lowerLeftCorner.copy(r.lowerLeftCorner), s.upperRightCorner.copy(r.upperRightCorner), r.snapBasePoint && s.snapBase.copy(r.snapBasePoint), r.snapRotationAngle && (s.snapAngle = r.snapRotationAngle), r.snapSpacing && s.snapIncrements.copy(r.snapSpacing), r.majorGridLines && (s.gridMajor = r.majorGridLines), r.gridSpacing && s.gridIncrements.copy(r.gridSpacing), r.backgroundObjectId && (s.backgroundObjectId = r.backgroundObjectId), s.gsView.center.copy(r.center), s.gsView.viewDirectionFromTarget.copy(r.viewDirectionFromTarget), s.gsView.viewTarget.copy(r.viewTarget), r.lensLength && (s.gsView.lensLength = r.lensLength), r.frontClippingPlane && (s.gsView.frontClippingPlane = r.frontClippingPlane), r.backClippingPlane && (s.gsView.backClippingPlane = r.backClippingPlane), r.viewHeight && (s.gsView.viewHeight = r.viewHeight), r.viewTwistAngle && (s.gsView.viewTwistAngle = r.viewTwistAngle), r.frozenLayers && (s.gsView.frozenLayers = r.frozenLayers), r.styleSheet && (s.gsView.styleSheet = r.styleSheet), r.renderMode && (s.gsView.renderMode = r.renderMode), r.viewMode && (s.gsView.viewMode = r.viewMode), r.ucsIconSetting && (s.gsView.ucsIconSetting = r.ucsIconSetting), r.ucsOrigin && s.gsView.ucsOrigin.copy(r.ucsOrigin), r.ucsXAxis && s.gsView.ucsXAxis.copy(r.ucsXAxis), r.ucsYAxis && s.gsView.ucsYAxis.copy(r.ucsYAxis), r.orthographicType && (s.gsView.orthographicType = r.orthographicType), r.shadePlotSetting && (s.gsView.shadePlotSetting = r.shadePlotSetting), r.shadePlotObjectId && (s.gsView.shadePlotObjectId = r.shadePlotObjectId), r.visualStyleObjectId && (s.gsView.visualStyleObjectId = r.visualStyleObjectId), r.isDefaultLightingOn && (s.gsView.isDefaultLightingOn = r.isDefaultLightingOn), r.defaultLightingType && (s.gsView.defaultLightingType = r.defaultLightingType), r.brightness && (s.gsView.brightness = r.brightness), r.contrast && (s.gsView.contrast = r.contrast), r.ambientColor && (s.gsView.ambientColor = r.ambientColor), t.tables.viewportTable.add(s);
|
|
21044
21111
|
});
|
|
21045
21112
|
}
|
|
21046
21113
|
processBlockTables(e, t) {
|
|
21047
21114
|
e.tables.BLOCK_RECORD.entries.forEach((r) => {
|
|
21048
21115
|
let s = t.tables.blockTable.getAt(r.name);
|
|
21049
|
-
s || (s = new
|
|
21116
|
+
s || (s = new _o(), s.objectId = r.handle.toString(), s.name = r.name, s.ownerId = r.ownerHandle.toString(), s.origin.copy(r.basePoint), s.layoutId = r.layout.toString(), t.tables.blockTable.add(s)), !s.isModelSapce && !s.isPaperSapce && r.entities && r.entities.length > 0 && this.processEntitiesInBlock(r.entities, s);
|
|
21050
21117
|
});
|
|
21051
21118
|
}
|
|
21052
21119
|
processBlocks(e, t) {
|
|
21053
21120
|
}
|
|
21054
21121
|
async processEntitiesInBlock(e, t) {
|
|
21055
|
-
const r = new Hs(), s = e.length;
|
|
21056
|
-
for (let
|
|
21057
|
-
const
|
|
21058
|
-
|
|
21122
|
+
const r = new Hs(), s = e.length, i = [];
|
|
21123
|
+
for (let o = 0; o < s; o++) {
|
|
21124
|
+
const a = e[o], c = r.convert(a);
|
|
21125
|
+
c && i.push(c);
|
|
21059
21126
|
}
|
|
21127
|
+
t.appendEntity(i);
|
|
21060
21128
|
}
|
|
21061
21129
|
/**
|
|
21062
21130
|
* Breaks up the work into smaller chunks that are executed asynchronously. This is often referred to
|
|
@@ -21064,19 +21132,20 @@ class bp extends mo {
|
|
|
21064
21132
|
* smaller pieces and executed in small intervals to allow the UI to remain responsive.
|
|
21065
21133
|
*/
|
|
21066
21134
|
async processEntities(e, t, r, s, i) {
|
|
21067
|
-
const o = new Hs(), a = e.entities, c = a.length, l = new
|
|
21135
|
+
const o = new Hs(), a = e.entities, c = a.length, l = new To(
|
|
21068
21136
|
c,
|
|
21069
21137
|
100 - s.value,
|
|
21070
21138
|
r
|
|
21071
21139
|
), h = t.tables.blockTable.modelSpace;
|
|
21072
21140
|
await l.processChunk(async (d, u) => {
|
|
21073
|
-
|
|
21074
|
-
|
|
21075
|
-
m
|
|
21141
|
+
const p = [];
|
|
21142
|
+
for (let f = d; f < u; f++) {
|
|
21143
|
+
const m = a[f], y = o.convert(m);
|
|
21144
|
+
y && p.push(y);
|
|
21076
21145
|
}
|
|
21077
|
-
if (i) {
|
|
21078
|
-
let
|
|
21079
|
-
|
|
21146
|
+
if (h.appendEntity(p), i) {
|
|
21147
|
+
let f = s.value + u / c * (100 - s.value);
|
|
21148
|
+
f > 100 && (f = 100), await i(f, "ENTITY", "IN-PROGRESS");
|
|
21080
21149
|
}
|
|
21081
21150
|
});
|
|
21082
21151
|
}
|
|
@@ -21093,14 +21162,22 @@ class bp extends mo {
|
|
|
21093
21162
|
processLayouts(e, t) {
|
|
21094
21163
|
const r = t.dictionaries.layouts;
|
|
21095
21164
|
e.objects.LAYOUT.forEach((s) => {
|
|
21096
|
-
const i = new
|
|
21097
|
-
i.layoutName = s.layoutName, i.tabOrder = s.tabOrder
|
|
21165
|
+
const i = new Ws();
|
|
21166
|
+
i.layoutName = s.layoutName, i.tabOrder = s.tabOrder;
|
|
21167
|
+
const o = t.tables.blockTable.newIterator();
|
|
21168
|
+
i.objectId = s.handle.toString();
|
|
21169
|
+
for (const a of o)
|
|
21170
|
+
if (a.layoutId === i.objectId) {
|
|
21171
|
+
i.blockTableRecordId = a.objectId;
|
|
21172
|
+
break;
|
|
21173
|
+
}
|
|
21174
|
+
i.limits.min.copy(s.minLimit), i.limits.max.copy(s.maxLimit), i.extents.min.copy(s.minExtent), i.extents.max.copy(s.maxExtent), this.processCommonObjectAttrs(s, i), r.setAt(i.layoutName, i);
|
|
21098
21175
|
});
|
|
21099
21176
|
}
|
|
21100
21177
|
processImageDefs(e, t) {
|
|
21101
21178
|
const r = t.dictionaries.imageDefs;
|
|
21102
21179
|
e.objects.IMAGEDEF.forEach((s) => {
|
|
21103
|
-
const i = new
|
|
21180
|
+
const i = new Co();
|
|
21104
21181
|
i.sourceFileName = s.fileName, this.processCommonObjectAttrs(s, i), r.setAt(i.objectId, i);
|
|
21105
21182
|
});
|
|
21106
21183
|
}
|
|
@@ -21114,7 +21191,7 @@ async function Lp() {
|
|
|
21114
21191
|
useWorker: !0,
|
|
21115
21192
|
parserWorkerUrl: "./assets/dxf-parser-worker.js"
|
|
21116
21193
|
});
|
|
21117
|
-
|
|
21194
|
+
Br.instance.register(rn.DXF, n);
|
|
21118
21195
|
} catch (n) {
|
|
21119
21196
|
console.error("Failed to register dxf converter: ", n);
|
|
21120
21197
|
}
|
|
@@ -21123,7 +21200,7 @@ async function Lp() {
|
|
|
21123
21200
|
useWorker: !0,
|
|
21124
21201
|
parserWorkerUrl: "./assets/libredwg-parser-worker.js"
|
|
21125
21202
|
});
|
|
21126
|
-
|
|
21203
|
+
Br.instance.register(rn.DWG, n);
|
|
21127
21204
|
} catch (n) {
|
|
21128
21205
|
console.error("Failed to register dwg converter: ", n);
|
|
21129
21206
|
}
|
|
@@ -21135,7 +21212,7 @@ const xp = {
|
|
|
21135
21212
|
isShowToolbar: !0,
|
|
21136
21213
|
isShowStats: !1,
|
|
21137
21214
|
fontMapping: {}
|
|
21138
|
-
},
|
|
21215
|
+
}, js = "settings";
|
|
21139
21216
|
class Tt {
|
|
21140
21217
|
constructor() {
|
|
21141
21218
|
this.events = {
|
|
@@ -21170,7 +21247,7 @@ class Tt {
|
|
|
21170
21247
|
*/
|
|
21171
21248
|
set(e, t) {
|
|
21172
21249
|
const r = this.settings;
|
|
21173
|
-
r[e] = t, localStorage.setItem(
|
|
21250
|
+
r[e] = t, localStorage.setItem(js, JSON.stringify(r)), this.events.modified.dispatch({
|
|
21174
21251
|
key: e,
|
|
21175
21252
|
value: t
|
|
21176
21253
|
});
|
|
@@ -21325,7 +21402,7 @@ class Tt {
|
|
|
21325
21402
|
* @returns The current settings object
|
|
21326
21403
|
*/
|
|
21327
21404
|
get settings() {
|
|
21328
|
-
const e = localStorage.getItem(
|
|
21405
|
+
const e = localStorage.getItem(js), t = e == null ? {} : JSON.parse(e);
|
|
21329
21406
|
return Ho(t, xp);
|
|
21330
21407
|
}
|
|
21331
21408
|
}
|