mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-16 08:06:38 +00:00
Two prototype polish fixes ahead of the website embed work: 1. Holding Enter (the sim's main way into "the rest of the options") did nothing -- the JS bridge's sim_enqueue_key() went straight to enqueueKey(), bypassing UITask::handleLongPress() entirely, so KEY_CONTEXT_MENU could never be reached. Add injectSimKeyLongPress()/ sim_enqueue_key_longpress(), which does route through the real handleLongPress() (same code a real MomentaryButton(pin, 1000, ...) reaches), and wire up press-and-hold (buttons + Enter/Space key) in both web harnesses with the same 1000ms threshold real hardware uses. 2. SimDisplayDriverCanvas::print() drew text with the browser's own system font (ctx.fillText, '8px monospace') instead of the real bitmap font a MeshCore-Solo board renders with OLED_MISC_FIXED_FONT=1 (see solo/heltec_v3/platformio.ini). Vendor the real Adafruit_GFX (unmodified, from the same PlatformIO registry package a real board build pulls) into variants/sim/thirdparty/gfx/, and render print() through the real, shared src/helpers/ui/MiscFixedRenderer.h + MiscFixedFont.h -- byte- identical glyphs to real hardware, not a look-alike. Verified in a real Chromium (Playwright): short Enter -> "CLOCK TOOLS", held Enter -> "CLOCK FIELDS" (gotoDashboardConfig(), proving KEY_CONTEXT_MENU is really reached); font renders as hard square pixels, inverse/selected-row text still punches correctly through a filled bar. Full regression re-run clean: all 3 native envs, wasm companion_radio, and the two-instance + repeater mesh demo (relay routing, DM delivery). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
30 lines
1.1 KiB
C
30 lines
1.1 KiB
C
// Font structures for newer Adafruit_GFX (1.1 and later).
|
|
// Example fonts are included in 'Fonts' directory.
|
|
// To use a font in your Arduino sketch, #include the corresponding .h
|
|
// file and pass address of GFXfont struct to setFont(). Pass NULL to
|
|
// revert to 'classic' fixed-space bitmap font.
|
|
|
|
#ifndef _GFXFONT_H_
|
|
#define _GFXFONT_H_
|
|
|
|
/// Font data stored PER GLYPH
|
|
typedef struct {
|
|
uint16_t bitmapOffset; ///< Pointer into GFXfont->bitmap
|
|
uint8_t width; ///< Bitmap dimensions in pixels
|
|
uint8_t height; ///< Bitmap dimensions in pixels
|
|
uint8_t xAdvance; ///< Distance to advance cursor (x axis)
|
|
int8_t xOffset; ///< X dist from cursor pos to UL corner
|
|
int8_t yOffset; ///< Y dist from cursor pos to UL corner
|
|
} GFXglyph;
|
|
|
|
/// Data stored for FONT AS A WHOLE
|
|
typedef struct {
|
|
uint8_t *bitmap; ///< Glyph bitmaps, concatenated
|
|
GFXglyph *glyph; ///< Glyph array
|
|
uint16_t first; ///< ASCII extents (first char)
|
|
uint16_t last; ///< ASCII extents (last char)
|
|
uint8_t yAdvance; ///< Newline distance (y axis)
|
|
} GFXfont;
|
|
|
|
#endif // _GFXFONT_H_
|