@mlightcad/mtext-renderer 0.10.7 → 0.10.9
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 +2748 -2689
- package/dist/index.umd.cjs +6 -6
- package/dist/mtext-renderer-worker.js +3587 -3534
- package/lib/renderer/mtextProcessor.d.ts +10 -0
- package/lib/renderer/types.d.ts +14 -1
- package/lib/worker/unifiedRenderer.d.ts +7 -1
- package/package.json +1 -1
|
@@ -132,6 +132,16 @@ export declare class MTextProcessor {
|
|
|
132
132
|
* Font size of current character
|
|
133
133
|
*/
|
|
134
134
|
get currentFontSize(): number;
|
|
135
|
+
/**
|
|
136
|
+
* The drawing-space text height used for layout calculations.
|
|
137
|
+
*
|
|
138
|
+
* `currentFontSize` includes a font-specific scale factor so glyph outlines
|
|
139
|
+
* from different font formats render at comparable visual sizes. That scale
|
|
140
|
+
* must not leak into CAD layout metrics such as line height and attachment
|
|
141
|
+
* offsets, otherwise middle/bottom aligned text shifts vertically depending
|
|
142
|
+
* on the active font.
|
|
143
|
+
*/
|
|
144
|
+
get currentLayoutFontSize(): number;
|
|
135
145
|
/**
|
|
136
146
|
* The height of current line of texts
|
|
137
147
|
*/
|
package/lib/renderer/types.d.ts
CHANGED
|
@@ -37,6 +37,13 @@ export declare enum MTextFlowDirection {
|
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Anchor position used to align rendered MText relative to its insertion point.
|
|
40
|
+
*
|
|
41
|
+
* Values 1-9 mirror DXF MText attachment points (group code 71). Values
|
|
42
|
+
* 10-12 are extensions used for AutoCAD TEXT/ATTRIB entities whose vertical
|
|
43
|
+
* alignment is the typographic baseline (DXF group 73 = 0). The baseline
|
|
44
|
+
* sits slightly above the bbox bottom by the descender height; using
|
|
45
|
+
* `Bottom*` for these cases offsets the text by the descender (~10% of cap
|
|
46
|
+
* height for SHX fonts).
|
|
40
47
|
*/
|
|
41
48
|
export declare enum MTextAttachmentPoint {
|
|
42
49
|
/** Top-left corner. */
|
|
@@ -56,7 +63,13 @@ export declare enum MTextAttachmentPoint {
|
|
|
56
63
|
/** Bottom-center point. */
|
|
57
64
|
BottomCenter = 8,
|
|
58
65
|
/** Bottom-right corner. */
|
|
59
|
-
BottomRight = 9
|
|
66
|
+
BottomRight = 9,
|
|
67
|
+
/** Baseline-left point (for DXF TEXT/ATTRIB with valign=BASELINE). */
|
|
68
|
+
BaselineLeft = 10,
|
|
69
|
+
/** Baseline-center point. */
|
|
70
|
+
BaselineCenter = 11,
|
|
71
|
+
/** Baseline-right point. */
|
|
72
|
+
BaselineRight = 12
|
|
60
73
|
}
|
|
61
74
|
/**
|
|
62
75
|
* Logical text token with optional pick box information.
|
|
@@ -20,7 +20,13 @@ export declare class UnifiedRenderer {
|
|
|
20
20
|
*/
|
|
21
21
|
constructor(defaultMode?: RenderMode, workerConfig?: WebWorkerRendererConfig);
|
|
22
22
|
/**
|
|
23
|
-
* Sets one new style manager to override the default style manager
|
|
23
|
+
* Sets one new style manager to override the default style manager.
|
|
24
|
+
*
|
|
25
|
+
* Both renderers receive the override so that `syncRenderMText`
|
|
26
|
+
* (which always uses `mainThreadRenderer`) and `asyncRenderMText`
|
|
27
|
+
* (which may use either renderer) produce materials from the same
|
|
28
|
+
* manager.
|
|
29
|
+
*
|
|
24
30
|
* @param value - New style manager
|
|
25
31
|
*/
|
|
26
32
|
setStyleManager(value: StyleManager): void;
|