@mlightcad/mtext-renderer 0.10.12 → 0.10.13

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.
@@ -29031,7 +29031,7 @@ var P1 = Fc((L) => {
29031
29031
  ...c
29032
29032
  ];
29033
29033
  }
29034
- const B1 = /* @__PURE__ */ new E(), L1 = 1.666666, Wn = 0.3;
29034
+ const B1 = 1.666666, Wn = 0.3, L1 = /* @__PURE__ */ new E();
29035
29035
  class $s extends Qr {
29036
29036
  /**
29037
29037
  * Creates a new RenderContext instance with optional initial values.
@@ -29177,7 +29177,7 @@ var P1 = Fc((L) => {
29177
29177
  * The height of current line of texts
29178
29178
  */
29179
29179
  get currentLineHeight() {
29180
- const e = this.defaultLineSpaceFactor * this.currentFontSize * L1, t = this.currentMaxFontSize > 0 ? this.currentMaxFontSize : this.currentFontSize;
29180
+ const e = this.defaultLineSpaceFactor * this.currentFontSize * B1, t = this.currentMaxFontSize > 0 ? this.currentMaxFontSize : this.currentFontSize;
29181
29181
  return e + t;
29182
29182
  }
29183
29183
  /**
@@ -29901,7 +29901,7 @@ var P1 = Fc((L) => {
29901
29901
  if (e.forEach((a, o) => {
29902
29902
  a.geometry.boundingBox || a.geometry.computeBoundingBox(), o === 0 ? t = a.geometry.boundingBox : t.union(a.geometry.boundingBox);
29903
29903
  }), !t) return;
29904
- const r = t, i = r.getSize(B1), s = (a, o) => {
29904
+ const r = t, i = r.getSize(L1), s = (a, o) => {
29905
29905
  var c, u;
29906
29906
  const h = (u = (c = a.userData) == null ? void 0 : c.layout) == null ? void 0 : u.chars;
29907
29907
  if (h && h.length > 0) {
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Scale applied with `lineSpaceFactor` when computing the extra vertical gap
3
+ * between MTEXT lines in {@link MTextProcessor}.
4
+ */
5
+ export declare const LINE_SPACING_SCALE_FACTOR = 1.666666;
6
+ /**
7
+ * Vertical compensation needed after switching normal glyph placement from
8
+ * top-anchored to baseline-anchored coordinates.
9
+ */
10
+ export declare const STACK_VERTICAL_SHIFT_FACTOR = 0.3;
@@ -1,4 +1,5 @@
1
1
  export * from './colorUtils';
2
+ export * from './constants';
2
3
  export * from './mtext';
3
4
  export * from './styleManager';
4
5
  export * from './types';
@@ -3,6 +3,9 @@ import { FontManager } from '../font';
3
3
  import { StyleManager } from './styleManager';
4
4
  import { ColorSettings, LineLayout, MTextFlowDirection, TextStyle } from './types';
5
5
  import * as THREE from 'three';
6
+ /**
7
+ * Options for formatting MText.
8
+ */
6
9
  export interface MTextFormatOptions {
7
10
  /**
8
11
  * Font size.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mlightcad/mtext-renderer",
3
- "version": "0.10.12",
3
+ "version": "0.10.13",
4
4
  "description": "AutoCAD MText renderer based on Three.js",
5
5
  "license": "MIT",
6
6
  "author": "MLight Lee <mlight.lee@outlook.com>",