@myrmidon/gve-snapshot-rendition 2.0.6 → 2.0.7

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.
@@ -37,6 +37,9 @@ export declare class HintRenderer {
37
37
  /**
38
38
  * Calculate Reference Bounding Rectangles (RBRs) from reference nodes.
39
39
  * Nodes on different lines create separate RBRs.
40
+ *
41
+ * @param rootSvg - Root SVG element, used to read each character's laid-out
42
+ * baseline `y` attribute for line-break detection (see below).
40
43
  */
41
44
  private calculateRBRs;
42
45
  /**
@@ -123,6 +123,22 @@ export declare function getRectCenter(rect: DOMRect | {
123
123
  * If not provided, falls back to document.body (legacy behavior).
124
124
  */
125
125
  export declare function getTextWidth(text: string, fontFamily: string, fontSize: number, bold?: boolean, italic?: boolean, measurementRoot?: SVGElement): number;
126
+ /**
127
+ * Reference character used to compute the "average character width/height"
128
+ * that the "tw"/"th" offset units resolve against (see getAverageCharWidth).
129
+ * This is the same reference character used to size the space character.
130
+ */
131
+ export declare const REFERENCE_CHAR = "m";
132
+ /**
133
+ * Get the average character width for the given font settings, using
134
+ * REFERENCE_CHAR ("m") as the reference glyph. This is the basis for the
135
+ * "tw" (text width) unit used by r_char-offsets, r_t-offset-x/y, and
136
+ * r_h-offset-x/y — NOT the bounding box of a whole reference text span.
137
+ *
138
+ * @param measurementRoot - Optional SVG element to use as measurement context
139
+ * (see getTextWidth for why this matters).
140
+ */
141
+ export declare function getAverageCharWidth(fontFamily: string, fontSize: number, bold?: boolean, italic?: boolean, measurementRoot?: SVGElement): number;
126
142
  /**
127
143
  * Move an element to the back (lowest z-index in SVG).
128
144
  */
@@ -72,6 +72,9 @@ export declare class TextRenderer {
72
72
  /**
73
73
  * Calculate RBRs from reference nodes.
74
74
  * Nodes on different lines create separate RBRs.
75
+ *
76
+ * @param rootSvg - Root SVG element, used to read each character's laid-out
77
+ * baseline `y` attribute for line-break detection (see below).
75
78
  */
76
79
  private calculateRBRs;
77
80
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myrmidon/gve-snapshot-rendition",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "homepage": "https://github.com/vedph/gve-snapshot-rendition",
5
5
  "repository": {
6
6
  "type": "git",