|
|
|
|
@ -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; |
|
|
|
|
|