@mlightcad/mtext-renderer 0.9.1 → 0.9.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/LICENSE +21 -21
- package/README.md +523 -523
- package/dist/index.js +1081 -1037
- package/dist/index.umd.cjs +9 -9
- package/dist/mtext-renderer-worker.js +222 -179
- package/lib/renderer/charBoxUtils.d.ts +4 -0
- package/lib/renderer/mtextProcessor.d.ts +3 -1
- package/lib/renderer/types.d.ts +4 -0
- package/package.json +5 -3
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { CharBox, CharBoxType } from './types';
|
|
2
|
+
import * as THREE from 'three';
|
|
3
|
+
export declare function normalizeBox(box?: THREE.Box3): THREE.Box3 | undefined;
|
|
4
|
+
export declare function buildCharBoxesFromObject(objectCharBoxes: CharBox[], matrixWorld: THREE.Matrix4, charBoxType?: CharBoxType): CharBox[];
|
|
@@ -3,7 +3,6 @@ import { FontManager } from '../font';
|
|
|
3
3
|
import { StyleManager } from './styleManager';
|
|
4
4
|
import { MTextFlowDirection, TextStyle } from './types';
|
|
5
5
|
import * as THREE from 'three';
|
|
6
|
-
export declare const STACK_DIVIDER_CHAR = "\uE000";
|
|
7
6
|
export interface MTextFormatOptions {
|
|
8
7
|
/**
|
|
9
8
|
* Font size.
|
|
@@ -73,6 +72,8 @@ export declare class MTextProcessor {
|
|
|
73
72
|
*/
|
|
74
73
|
private _currentHorizontalAlignment;
|
|
75
74
|
private _lastCharBoxTarget;
|
|
75
|
+
private _lineHasRenderableChar;
|
|
76
|
+
private _pendingEmptyLineFontSizeAdjust?;
|
|
76
77
|
private _currentIndent;
|
|
77
78
|
private _currentLeftMargin;
|
|
78
79
|
private _currentRightMargin;
|
|
@@ -215,6 +216,7 @@ export declare class MTextProcessor {
|
|
|
215
216
|
private getCharShape;
|
|
216
217
|
private startNewLine;
|
|
217
218
|
private advanceToNextLine;
|
|
219
|
+
private applyPendingEmptyLineYAdjust;
|
|
218
220
|
private resolveCharBoxTarget;
|
|
219
221
|
/**
|
|
220
222
|
* Apply translation on the specified buffer geometries according to text alignment setting
|
package/lib/renderer/types.d.ts
CHANGED
|
@@ -87,6 +87,10 @@ export declare enum CharBoxType {
|
|
|
87
87
|
/** Stack token (for fraction-style stacked expressions). */
|
|
88
88
|
STACK = "STACK"
|
|
89
89
|
}
|
|
90
|
+
/**
|
|
91
|
+
* Sentinel character used internally to represent a stack divider line.
|
|
92
|
+
*/
|
|
93
|
+
export declare const STACK_DIVIDER_CHAR = "\uE000";
|
|
90
94
|
export interface StyleTraits {
|
|
91
95
|
/**
|
|
92
96
|
* Optional layer name. Material is identified by layer and color. So it means different
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlightcad/mtext-renderer",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.3",
|
|
4
4
|
"description": "AutoCAD MText renderer based on Three.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "MLight Lee <mlight.lee@outlook.com>",
|
|
@@ -41,7 +41,8 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/opentype.js": "^1.3.8",
|
|
44
|
-
"@types/three": "^0.172.0"
|
|
44
|
+
"@types/three": "^0.172.0",
|
|
45
|
+
"vitest": "^3.2.4"
|
|
45
46
|
},
|
|
46
47
|
"peerDependencies": {
|
|
47
48
|
"three": "^0.172.0"
|
|
@@ -52,6 +53,7 @@
|
|
|
52
53
|
"build:worker": "vite build -c vite.config.worker.ts",
|
|
53
54
|
"clean": "rimraf dist lib tsconfig.tsbuildinfo",
|
|
54
55
|
"lint": "eslint src/",
|
|
55
|
-
"lint:fix": "eslint --fix --quiet src/"
|
|
56
|
+
"lint:fix": "eslint --fix --quiet src/",
|
|
57
|
+
"test": "vitest run"
|
|
56
58
|
}
|
|
57
59
|
}
|