diff --git a/ts/src/font/u8g2.ts b/ts/src/font/u8g2.ts index 8adf212..fc965c3 100644 --- a/ts/src/font/u8g2.ts +++ b/ts/src/font/u8g2.ts @@ -265,11 +265,11 @@ export function rasterizeText( const pixels = new Uint8Array(totalW * cellHeight); - // Centre the full font (ascent + |descent|) vertically in the cell. + // Top-align the full font (ascent + |descent|) within the cell. // header byte 14 is descent of 'g' - stored as a negative signed value. const descent = font.FONT_DATA[14]! > 127 ? font.FONT_DATA[14]! - 256 : font.FONT_DATA[14]!; const fontH = hdr.ascentA - descent; // total font height in pixels - const topPad = Math.floor((cellHeight - fontH) / 2); + const topPad = 0; const baseline = topPad + hdr.ascentA; let x = 0;