1
0
mirror of https://github.com/thooge/esp32-nmea2000-obp60.git synced 2026-08-18 18:32:30 +02:00

Fix for font using

This commit is contained in:
Norbert Walter
2026-02-28 18:06:40 +00:00
parent 253aaa5b2e
commit 270642ad7c
+17 -2
View File
@@ -130,12 +130,27 @@ public:
} }
// compatibility helpers -------------------------------------------------- // compatibility helpers --------------------------------------------------
// Adafruit GFX fonts support: ignore on TFT, use base on E-Ink using lgfx::LGFX_Device::setFont;
void setFont(const GFXfont *font) { (void)font; } // Adafruit GFX fonts support on TFT via LovyanGFX bridge
void setFont(const GFXfont *font) {
if (font == nullptr) {
lgfx::LGFX_Device::setFont(nullptr);
return;
}
_adfFontBridge = lgfx::GFXfont(
const_cast<uint8_t*>(font->bitmap),
reinterpret_cast<lgfx::GFXglyph*>(const_cast<GFXglyph*>(font->glyph)),
font->first,
font->last,
font->yAdvance
);
lgfx::LGFX_Device::setFont(&_adfFontBridge);
}
// E-Ink interface compatibility // E-Ink interface compatibility
void setFullWindow() { /* no-op on TFT */ } void setFullWindow() { /* no-op on TFT */ }
private: private:
lgfx::GFXfont _adfFontBridge { nullptr, nullptr, 0, 0, 0 };
lgfx::Panel_ST7796 _panel_instance; lgfx::Panel_ST7796 _panel_instance;
}; };