@mlightcad/mtext-renderer 0.4.1 → 0.4.3
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 +29 -9
- package/dist/index.umd.cjs +3 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9408,7 +9408,7 @@ class un extends gn {
|
|
|
9408
9408
|
return new Sr("?", e, this);
|
|
9409
9409
|
}
|
|
9410
9410
|
}
|
|
9411
|
-
|
|
9411
|
+
class Q {
|
|
9412
9412
|
/**
|
|
9413
9413
|
* Converts an unsigned byte to a signed byte as used in SHX format.
|
|
9414
9414
|
* Values > 127 are converted to their signed equivalent (-128 to -1).
|
|
@@ -9563,7 +9563,7 @@ let Q = class {
|
|
|
9563
9563
|
`Position ${e} is out of range for the data length ${this.data.byteLength}!`
|
|
9564
9564
|
);
|
|
9565
9565
|
}
|
|
9566
|
-
}
|
|
9566
|
+
}
|
|
9567
9567
|
var $ = /* @__PURE__ */ ((t) => (t.SHAPES = "shapes", t.BIGFONT = "bigfont", t.UNIFONT = "unifont", t))($ || {});
|
|
9568
9568
|
let nl = class {
|
|
9569
9569
|
parse(e) {
|
|
@@ -10537,7 +10537,7 @@ class hn extends gn {
|
|
|
10537
10537
|
}
|
|
10538
10538
|
getCode(e) {
|
|
10539
10539
|
if (this.font.fontData.header.fontType === $.BIGFONT)
|
|
10540
|
-
throw new Error(
|
|
10540
|
+
throw new Error(`Can't get font glyph for '${e}' because big font is not supported yet!`);
|
|
10541
10541
|
return e.charCodeAt(0);
|
|
10542
10542
|
}
|
|
10543
10543
|
}
|
|
@@ -10778,7 +10778,7 @@ class Ue {
|
|
|
10778
10778
|
return e == null ? (this.fontMap.clear(), !0) : this.fontMap.delete(e);
|
|
10779
10779
|
}
|
|
10780
10780
|
}
|
|
10781
|
-
class
|
|
10781
|
+
class Fl {
|
|
10782
10782
|
/**
|
|
10783
10783
|
* Creates a new instance of DefaultFontLoader
|
|
10784
10784
|
*/
|
|
@@ -11388,6 +11388,26 @@ class gl {
|
|
|
11388
11388
|
}
|
|
11389
11389
|
s += "\\M";
|
|
11390
11390
|
continue;
|
|
11391
|
+
case "U":
|
|
11392
|
+
if (this.scanner.peek() === "+") {
|
|
11393
|
+
this.scanner.consume(1);
|
|
11394
|
+
const c = this.scanner.tail.match(/^[0-9A-Fa-f]{4,8}/);
|
|
11395
|
+
if (c) {
|
|
11396
|
+
const f = c[0];
|
|
11397
|
+
this.scanner.consume(f.length);
|
|
11398
|
+
const h = parseInt(f, 16);
|
|
11399
|
+
let p = "";
|
|
11400
|
+
try {
|
|
11401
|
+
p = String.fromCodePoint(h);
|
|
11402
|
+
} catch {
|
|
11403
|
+
p = "▯";
|
|
11404
|
+
}
|
|
11405
|
+
return s ? [1, s] : [1, p];
|
|
11406
|
+
}
|
|
11407
|
+
this.scanner.consume(-1);
|
|
11408
|
+
}
|
|
11409
|
+
s += "\\U";
|
|
11410
|
+
continue;
|
|
11391
11411
|
default:
|
|
11392
11412
|
if (l)
|
|
11393
11413
|
try {
|
|
@@ -12489,7 +12509,7 @@ class xl {
|
|
|
12489
12509
|
}
|
|
12490
12510
|
}
|
|
12491
12511
|
const Bt = /* @__PURE__ */ new R.Vector3(), we = /* @__PURE__ */ new R.Vector3(), Pt = /* @__PURE__ */ new R.Vector3(), It = /* @__PURE__ */ new R.Quaternion(), Gt = /* @__PURE__ */ new R.Matrix4(), dn = /* @__PURE__ */ new R.Matrix4(), vn = /* @__PURE__ */ new R.Vector3(1, 0, 0);
|
|
12492
|
-
class
|
|
12512
|
+
class Cl extends R.Object3D {
|
|
12493
12513
|
/**
|
|
12494
12514
|
* Extracts all unique font names used in an MText string.
|
|
12495
12515
|
* This function searches for font commands in the format \f{fontname}| or \f{fontname}; and returns a set of unique font names.
|
|
@@ -12707,7 +12727,7 @@ class wl extends R.Object3D {
|
|
|
12707
12727
|
this.getBoxes(n[a], r);
|
|
12708
12728
|
}
|
|
12709
12729
|
}
|
|
12710
|
-
class
|
|
12730
|
+
class wl {
|
|
12711
12731
|
constructor() {
|
|
12712
12732
|
this.lineBasicMaterials = {}, this.meshBasicMaterials = {}, this.unsupportedTextStyles = {};
|
|
12713
12733
|
}
|
|
@@ -12725,12 +12745,12 @@ class El {
|
|
|
12725
12745
|
export {
|
|
12726
12746
|
gn as BaseFont,
|
|
12727
12747
|
yn as BaseTextShape,
|
|
12728
|
-
|
|
12748
|
+
Fl as DefaultFontLoader,
|
|
12729
12749
|
dr as EventManager,
|
|
12730
12750
|
Se as FontFactory,
|
|
12731
12751
|
Ue as FontManager,
|
|
12732
|
-
|
|
12752
|
+
Cl as MText,
|
|
12733
12753
|
hl as MTextAttachmentPoint,
|
|
12734
12754
|
Ze as MTextFlowDirection,
|
|
12735
|
-
|
|
12755
|
+
wl as StyleManager
|
|
12736
12756
|
};
|