chore: follow the general comments style

This commit is contained in:
Ilia Mashkov
2026-04-17 12:14:55 +03:00
parent 0ebf75b24e
commit cfaff46d59
56 changed files with 1600 additions and 499 deletions
@@ -12,20 +12,37 @@ import {
* each font's actual advance widths independently.
*/
export interface ComparisonLine {
/** Full text of this line as returned by pretext. */
/**
* Full text of this line as returned by pretext.
*/
text: string;
/** Rendered width of this line in pixels — maximum across font A and font B. */
/**
* Rendered width of this line in pixels — maximum across font A and font B.
*/
width: number;
/**
* Individual character metadata for both fonts in this line
*/
chars: Array<{
/** The grapheme cluster string (may be >1 code unit for emoji, etc.). */
/**
* The grapheme cluster string (may be >1 code unit for emoji, etc.).
*/
char: string;
/** X offset from the start of the line in font A, in pixels. */
/**
* X offset from the start of the line in font A, in pixels.
*/
xA: number;
/** Advance width of this grapheme in font A, in pixels. */
/**
* Advance width of this grapheme in font A, in pixels.
*/
widthA: number;
/** X offset from the start of the line in font B, in pixels. */
/**
* X offset from the start of the line in font B, in pixels.
*/
xB: number;
/** Advance width of this grapheme in font B, in pixels. */
/**
* Advance width of this grapheme in font B, in pixels.
*/
widthB: number;
}>;
}
@@ -34,9 +51,13 @@ export interface ComparisonLine {
* Aggregated output of a dual-font layout pass.
*/
export interface ComparisonResult {
/** Per-line grapheme data for both fonts. Empty when input text is empty. */
/**
* Per-line grapheme data for both fonts. Empty when input text is empty.
*/
lines: ComparisonLine[];
/** Total height in pixels. Equals `lines.length * lineHeight` (pretext guarantee). */
/**
* Total height in pixels. Equals `lines.length * lineHeight` (pretext guarantee).
*/
totalHeight: number;
}