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:
@@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user