19void drawHeaderLeft(Gdey029T94* gfx,
const char* title,
int x,
int y,
20 uint16_t width,
int underlineOffset = 18);
23void drawFooterBar(Gdey029T94* gfx, uint16_t width, uint16_t height,
24 const char* prefix,
const char* hint,
bool force =
false);
27 uint16_t totalItems, uint16_t visibleItems,
40void printTruncated(Gdey029T94* gfx,
const char* text,
int maxWidthPx);
102void drawText(Gdey029T94* gfx,
const char* text,
const GFXfont* font);
114void printText(Gdey029T94* gfx,
const char* text);
130void measureText(Gdey029T94* gfx,
const char* text,
const GFXfont* font,
131 int16_t x0, int16_t y0, int16_t* x1, int16_t* y1,
132 uint16_t* w, uint16_t* h);
154 const GFXfont*
const* candidates,
169void measureCp437Text(Gdey029T94* gfx,
const char* text, int16_t x0, int16_t y0,
170 int16_t* x1, int16_t* y1, uint16_t* w, uint16_t* h);
constexpr int SCROLL_INDICATOR_WIDTH
Scroll indicator column width in pixels.
constexpr int FOOTER_HEIGHT
Footer bar height in pixels (used by drawFooterBar).
void drawFooterBar(Gdey029T94 *gfx, uint16_t width, uint16_t height, const char *prefix, const char *hint, bool force=false)
Draws footer bar with optional prefix and hint text.
void drawText(Gdey029T94 *gfx, const char *text, const GFXfont *font)
Draws CP437-encoded text correctly for the given font: the built-in glcdfont (font == nullptr) is CP4...
void drawDialogFrame(Gdey029T94 *gfx, int x, int y, int w, int h)
Draws a framed dialog box with double border.
void drawHeaderCentered(Gdey029T94 *gfx, const char *title, int y, uint16_t width)
Draws a centered header title.
void utf8ToCp437Inplace(char *buf)
Decodes a UTF-8 string in place to CP437 single bytes. Truncates if the buffer is too small....
void drawHeaderLeft(Gdey029T94 *gfx, const char *title, int x, int y, uint16_t width, int underlineOffset=18)
void measureText(Gdey029T94 *gfx, const char *text, const GFXfont *font, int16_t x0, int16_t y0, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h)
Measures CP437 text exactly as drawText would render it with font, so width-based layout (centering,...
uint8_t cp437ToLatin1(uint8_t c)
Maps a CP437 byte to the equivalent Latin-1 byte for use with Unicode/Latin-1 indexed GFX fonts (e....
void decodeWebText(const char *in, char *out, size_t out_size, DisplayTarget target=DisplayTarget::Cp437)
Normalises a web payload for display: HTML named/numeric entities decode first, then UTF-8 multibyte ...
constexpr int SCROLL_INDICATOR_WIDTH
const GFXfont * pickFontThatFits(Gdey029T94 *gfx, const char *text, int maxWidthPx, const GFXfont *const *candidates, size_t count, bool cp437=false)
Picks the largest font from candidates whose rendered width of text fits within maxWidthPx....
void measureCp437Text(Gdey029T94 *gfx, const char *text, int16_t x0, int16_t y0, int16_t *x1, int16_t *y1, uint16_t *w, uint16_t *h)
Measures a CP437 string using the current font (via Latin-1 mapping).
void printTruncated(Gdey029T94 *gfx, const char *text, int maxWidthPx)
Print text at the current cursor, truncated with an ellipsis to fit maxWidthPx. Caller must have alre...
void printText(Gdey029T94 *gfx, const char *text)
Draws CP437 text with the built-in 6x8 glyph font, byte-for-byte.
DisplayTarget
Display encoding targets for decodeWebText().
@ Cp437
GFX builtin glcdfont (default after setFont(nullptr)).
@ Latin1
FreeMonoBold*pt8b fonts (Latin-1 indexed, 0x20..0xFF).
constexpr int FOOTER_HEIGHT
void drawCp437Text(Gdey029T94 *gfx, const char *text)
Prints a CP437 string by mapping each byte to Latin-1 before drawing. Use with TTF-derived GFX fonts ...
void drawScrollIndicator(Gdey029T94 *gfx, int x, int y, int listHeight, uint16_t totalItems, uint16_t visibleItems, uint16_t scrollPos)
Draws scroll arrows and scrollbar thumb.