Use font ascender height for baseline offset (#139)

## Summary

* Use font ascender height for baseline offset
* Previously was using font height, but when rendering the font (even
from y = 0), there would be a lot of top margin
* Font would also go below the "bottom of the line" as we were using the
full font height as the baseline

## Additional Context

* This caused some text to move around, I've fixed everything I can
* Notably it moves the first line of font a little closer to the top of
the page
This commit is contained in:
Dave Allie
2025-12-28 21:30:01 +10:00
committed by GitHub
parent 1c33162368
commit 41c93e4eba
6 changed files with 16 additions and 6 deletions

View File

@@ -74,6 +74,7 @@ class GfxRenderer {
void drawCenteredText(int fontId, int y, const char* text, bool black = true, EpdFontStyle style = REGULAR) const;
void drawText(int fontId, int x, int y, const char* text, bool black = true, EpdFontStyle style = REGULAR) const;
int getSpaceWidth(int fontId) const;
int getFontAscenderSize(int fontId) const;
int getLineHeight(int fontId) const;
// UI Components