feat(eink): 4.2" 400x300 build with the misc-fixed 9x15 font, wide sim

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-10-06 13:44:11 +02:00
co-authored by Claude Opus 5.5
parent 44ccd47a12
commit 5864e556ff
8 changed files with 2493 additions and 21 deletions
+2 -1
View File
@@ -14,7 +14,8 @@ class Adafruit_GFX;
// (GxEPDDisplay.cpp on a board, the sim's target.cpp): it pulls in the font
// tables.
// EINK_LARGE_FONT: a landscape panel writes in the 8x13 at its own resolution.
// EINK_LARGE_FONT: a landscape panel writes in the 8x13 at its own resolution
// (1), or the 9x15 (2, the 4.2" 400x300).
// Without it a landscape panel doubles the 6x9 (every pixel 2x2) -- for small
// dense panels where 8x13 would be too fine. A portrait panel always uses the
// 6x9: its narrow width wants the smaller cell.
+8 -2
View File
@@ -4,7 +4,13 @@
#include "EinkGfxDisplay.h"
#include "MiscFixedRenderer.h"
#include "MiscFixed8x13Font.h"
#if EINK_LARGE_FONT == 2
#include "MiscFixed9x15Font.h"
#define EINK_LARGE_GFXFONT MiscFixed9x15
#else
#include "MiscFixed8x13Font.h"
#define EINK_LARGE_GFXFONT MiscFixed8x13
#endif
EinkGfxDisplay::EinkGfxDisplay(int w, int h, Adafruit_GFX& gfx, uint16_t ink, uint16_t paper)
: DisplayDriver(w, h), _gfx(gfx), _ink(ink), _paper(paper), _curr(ink), _font(&MiscFixed) {
@@ -13,7 +19,7 @@ EinkGfxDisplay::EinkGfxDisplay(int w, int h, Adafruit_GFX& gfx, uint16_t ink, ui
void EinkGfxDisplay::updateLayout() {
const bool landscape = width() >= height();
_font = (EINK_LARGE_FONT && landscape) ? &MiscFixed8x13 : &MiscFixed;
_font = (EINK_LARGE_FONT && landscape) ? &EINK_LARGE_GFXFONT : &MiscFixed;
_px = (!EINK_LARGE_FONT && landscape) ? 2 : 1;
_cell_w = miscFixedCellW(*_font);
_cell_h = _font->yAdvance;
File diff suppressed because it is too large Load Diff