+ Meshtastic is an open source project for creating off-grid, affordable, and resilient communication with LoRa mesh networks. +
+
+
An overview:
@@ -281,11 +287,14 @@ ${esp32s3_base.lib_deps}
### nicheGraphics.h
-⚠ Wrap this file in `#ifdef MESHTASTIC_INCLUDE_NICHE_GRAPHICS`
+Should contain a `setupNicheGraphics` method, which creates and configures the various components for InkHUD.
-`nicheGraphics.h` should be placed in the same folder as your variant's `platformio.ini`. If this is not possible, modify `build_src_filter`.
+For well commented examples, see:
-`nicheGraphics.h` should contain a `setupNicheGraphics` method, which creates and configures the various components for InkHUD.
+- `/variants/heltec_vision_master_e290/nicheGraphics.h` (ESP32)
+- `/variants/ELECROW-ThinkNode-M1/nicheGraphics.h` (NRF52)
+
+As a general overview:
- Display
- Start SPI
@@ -301,10 +310,80 @@ ${esp32s3_base.lib_deps}
- Setup `TwoButton` driver (user button, optional "auxiliary" button)
- Connect to InkHUD handlers (use lambdas)
-For well commented examples, see:
+## Fonts
-- `variants/heltec_vision_master_e290/nicheGraphics.h` (ESP32)
-- `variants/t-echo/nicheGraphics.h` (NRF52)
+InkHUD uses AdafruitGFX fonts. The large and small font which are shared by all applets are set in nicheGraphics.h.
+
+```cpp
+// Prepare fonts
+InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1252;
+InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1252;
+
+// Using a generic AdafruitGFX font instead:
+// InkHUD::Applet::fontLarge = FreeSerif9pt7b;
+```
+
+Any generic AdafruitGFX font may be used, but the fonts which are bundled with InkHUD have been customized with extended-ASCII character sets.
+
+### Parsing Unicode Text
+
+Text received by the firmware is encoded as UTF-8.
+
+Applets must manually parse any text which may contain non-ASCII characters. Strings like text-messages and node names should be parsed.
+
+```cpp
+std::string greeting = "Góðan daginn!";
+std::string parsed = parse(greeting);
+```
+
+This will re-encode the characters to match whichever extended-ASCII font InkHUD has been built with.
+
+### Localization
+
+InkHUD is bundled with extended-ASCII fonts for:
+
+- Windows-1250 (Central European)
+- Windows-1251 (Cyrillic)
+- Windows-1252 (Western European)
+
+The default builds use Windows-1252 encoding. This can be changed in nicheGraphics.h.
+
+```cpp
+InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1250;
+InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1250;
+
+InkHUD::Applet::fontLarge = FREESANS_9PT_WIN1251;
+InkHUD::Applet::fontSmall = FREESANS_6PT_WIN1251;
+```
+
+### Creating / Modifying
+
+For basic conversion and editing, online tools might be sufficient:
+
+- [https://rop.nl/truetype2gfx/](https://rop.nl/truetype2gfx/) - converting from ttf
+- [https://tchapi.github.io/Adafruit-GFX-Font-Customiser/](https://tchapi.github.io/Adafruit-GFX-Font-Customiser/) - editing glyphs
+
+For heavy editing, this offline workflow is suggested:
+
+- [FontForge](https://fontforge.org/en-US/)
+ - re-ordering glyphs
+ - Encoding > Load Encoding
+ - Encoding > Reencode
+ - .ttf to .bdf conversion
+ - Element > Bitmap Strikes Available..
+ - File > Generate Fonts
+- [GFXFontEditor](https://github.com/ScottFerg56/GFXFontEditor)
+ - manual glyph correction
+ - .bdf to AdafruitGFX .h conversion
+ - File > Edit Font Properties
+ - right-click glyph list, flatten font
+ - File > Save As
+ - manually edit exported .h
+ - remove `#include