@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.
@@ -1,8 +1,15 @@
1
1
  /**
2
- * Scale applied with `lineSpaceFactor` when computing the extra vertical gap
3
- * between MTEXT lines in {@link MTextProcessor}.
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 = 1.666666;
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
- * The line space factor.
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
- * The default line space factor
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
- * The height of current line of texts
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
  /**
@@ -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
- /** Factor that controls the spacing between text lines. Default is 1.0 */
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlightcad/mtext-renderer",
3
- "version": "0.11.10",
3
+ "version": "0.12.0",
4
4
  "description": "AutoCAD MText renderer based on Three.js",
5
5
  "license": "MIT",
6
6
  "author": "MLight Lee <mlight.lee@outlook.com>",