Add UI font

This commit is contained in:
Dave Allie
2025-12-06 01:37:20 +11:00
parent 248af4b8fb
commit 7198d943b0
13 changed files with 4222 additions and 24 deletions

View File

@@ -3,13 +3,12 @@
#include <EpdRenderer.h>
void FullScreenMessageScreen::onEnter() {
const auto width = renderer->getTextWidth(text.c_str(), style);
const auto width = renderer->getUiTextWidth(text.c_str(), style);
const auto height = renderer->getLineHeight();
const auto left = (renderer->getPageWidth() - width) / 2;
const auto top = (renderer->getPageHeight() - height) / 2;
renderer->clearScreen(invert);
renderer->drawText(left, top, text.c_str(), invert ? 0 : 1, style);
// If inverted, do a full screen update to ensure no ghosting
renderer->flushDisplay(!invert);
renderer->drawUiText(left, top, text.c_str(), invert ? 0 : 1, style);
renderer->flushDisplay(partialUpdate);
}