@mlightcad/mtext-renderer 0.11.10 → 0.12.0
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 +1205 -1200
- package/dist/index.umd.cjs +9 -9
- package/dist/mtext-renderer-worker.js +1137 -1133
- package/lib/renderer/constants.d.ts +10 -3
- package/lib/renderer/mtextProcessor.d.ts +9 -3
- package/lib/renderer/types.d.ts +5 -1
- package/package.json +1 -1
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* AutoCAD single-line spacing as a multiple of text height ("3-on-5").
|
|
3
|
+
*
|
|
4
|
+
* DXF group 44 (`lineSpaceFactor`) is a ratio relative to this single spacing,
|
|
5
|
+
* so baseline-to-baseline distance =
|
|
6
|
+
* `lineSpaceFactor × LINE_SPACING_SCALE_FACTOR × textHeight`.
|
|
4
7
|
*/
|
|
5
|
-
export declare const LINE_SPACING_SCALE_FACTOR
|
|
8
|
+
export declare const LINE_SPACING_SCALE_FACTOR: number;
|
|
9
|
+
/**
|
|
10
|
+
* Default DXF group-44 line spacing factor (AutoCAD single spacing).
|
|
11
|
+
*/
|
|
12
|
+
export declare const DEFAULT_LINE_SPACE_FACTOR = 1;
|
|
6
13
|
/**
|
|
7
14
|
* Vertical compensation needed after switching normal glyph placement from
|
|
8
15
|
* top-anchored to baseline-anchored coordinates.
|
|
@@ -16,7 +16,8 @@ export interface MTextFormatOptions {
|
|
|
16
16
|
*/
|
|
17
17
|
widthFactor: number;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* AutoCAD DXF group-44 line spacing factor: ratio of actual line spacing to
|
|
20
|
+
* single spacing (`5/3` of text height). Default is `1.0`.
|
|
20
21
|
*/
|
|
21
22
|
lineSpaceFactor: number;
|
|
22
23
|
/**
|
|
@@ -165,7 +166,8 @@ export declare class MTextProcessor {
|
|
|
165
166
|
*/
|
|
166
167
|
get defaultFontSize(): number;
|
|
167
168
|
/**
|
|
168
|
-
*
|
|
169
|
+
* AutoCAD DXF group-44 line spacing factor (multiple of single spacing).
|
|
170
|
+
* Single spacing is {@link LINE_SPACING_SCALE_FACTOR} × text height.
|
|
169
171
|
*/
|
|
170
172
|
get defaultLineSpaceFactor(): number;
|
|
171
173
|
/**
|
|
@@ -191,7 +193,11 @@ export declare class MTextProcessor {
|
|
|
191
193
|
*/
|
|
192
194
|
get currentLayoutFontSize(): number;
|
|
193
195
|
/**
|
|
194
|
-
*
|
|
196
|
+
* Baseline-to-baseline advance for the current line (AutoCAD MTEXT semantics).
|
|
197
|
+
*
|
|
198
|
+
* Single spacing is `5/3` of the drawing-space text height; `lineSpaceFactor`
|
|
199
|
+
* (DXF group 44) scales that distance. Font glyph scale factors must not
|
|
200
|
+
* affect this layout metric — use {@link currentLayoutFontSize}.
|
|
195
201
|
*/
|
|
196
202
|
get currentLineHeight(): number;
|
|
197
203
|
/**
|
package/lib/renderer/types.d.ts
CHANGED
|
@@ -170,7 +170,11 @@ export interface MTextData {
|
|
|
170
170
|
attachmentPoint?: MTextAttachmentPoint;
|
|
171
171
|
/** Determines the primary direction in which text flows */
|
|
172
172
|
drawingDirection?: MTextFlowDirection;
|
|
173
|
-
/**
|
|
173
|
+
/**
|
|
174
|
+
* AutoCAD DXF group-44 line spacing factor.
|
|
175
|
+
* Ratio of actual baseline spacing to single spacing (`5/3` of text height).
|
|
176
|
+
* Default is `1.0`.
|
|
177
|
+
*/
|
|
174
178
|
lineSpaceFactor?: number;
|
|
175
179
|
/** The width scaling factor applied to each character. Default is 1.0 */
|
|
176
180
|
widthFactor?: number;
|