@mlightcad/mtext-renderer 0.3.2 → 0.3.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 +52 -15
- package/dist/index.umd.cjs +2 -2
- package/dist/renderer/mtext.d.ts +16 -0
- package/dist/renderer/mtextProcessor.d.ts +4 -1
- package/package.json +1 -1
package/dist/renderer/mtext.d.ts
CHANGED
|
@@ -20,6 +20,22 @@ export declare class MText extends THREE.Object3D {
|
|
|
20
20
|
private _box;
|
|
21
21
|
/** Array of bounding boxes for individual text elements */
|
|
22
22
|
private _boxes;
|
|
23
|
+
/**
|
|
24
|
+
* Extracts all unique font names used in an MText string.
|
|
25
|
+
* This function searches for font commands in the format \f{fontname}| or \f{fontname}; and returns a set of unique font names.
|
|
26
|
+
* Font names are converted to lowercase to ensure case-insensitive uniqueness.
|
|
27
|
+
*
|
|
28
|
+
* @param mtext - The MText string to analyze for font names
|
|
29
|
+
* @param removeExtension - Whether to remove font file extensions (e.g., .ttf, .shx) from font names. Defaults to false.
|
|
30
|
+
* @returns A Set containing all unique font names found in the MText string, converted to lowercase
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const mtext = "\\fArial.ttf|Hello\\fTimes New Roman.otf|World";
|
|
34
|
+
* const fonts = getFonts(mtext, true);
|
|
35
|
+
* // Returns: Set(2) { "arial", "times new roman" }
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
static getFonts(mtext: string, removeExtension?: boolean): Set<string>;
|
|
23
39
|
/**
|
|
24
40
|
* Creates a new instance of MText.
|
|
25
41
|
* @param text - The MText data containing text content and properties
|
|
@@ -130,7 +130,10 @@ export declare class MTextProcessor {
|
|
|
130
130
|
*/
|
|
131
131
|
get currentMaxFontSize(): number;
|
|
132
132
|
/**
|
|
133
|
-
* The current space setting between two characters
|
|
133
|
+
* The current space setting between two characters. The meaning of this value is as follows.
|
|
134
|
+
* - 1: no extra spacing (default tracking)
|
|
135
|
+
* - 1.2: increases spacing by 20% of the text height
|
|
136
|
+
* - 0.8: decreases spacing by 20% of the text height
|
|
134
137
|
*/
|
|
135
138
|
get currentWordSpace(): number;
|
|
136
139
|
/**
|