You can technically use u8x8 for text and u8g2 for graphics simultaneously if you need both speed and complexity, though it uses more memory.
Setting up U8x8 is incredibly straightforward. Here is a bare-minimum, production-ready script to initialize a standard I2C SSD1306 OLED screen and display text. Use code with caution. Customizing and Optimizing U8x8 Typography Flipping and Inverting Text u8x8 fonts
| Feature | U8g2 (Graphics Mode) | U8x8 (Character Mode) | |---|---|---| | | Full graphics library | Text-only character device | | Memory Usage | Higher—requires display buffer | Minimal—no frame buffer required | | Capabilities | Lines, boxes, circles, custom fonts, UI elements | Simple text display | | Font Support | 700+ fonts, virtually unlimited height | Fixed to 8×8 pixel grid | | Buffer Strategy | Full buffer, page buffer, or line buffer | Direct output, no buffer | | Best Suited For | Graphics-intensive applications, animations, games | Text-only displays, memory-constrained systems | You can technically use u8x8 for text and
The name "U8x8" reveals the core principle of the system: it is built on an 8-by-8 pixel grid. Each character cell in the U8x8 library is typically 8 pixels wide and 8 pixels high, though this can vary depending on the specific font used. Use code with caution
u8x8_font_artie9x9_r : A 9x9 font, but fits within the text-based layout style.
Remember that u8x8.drawString(column, row, "text") uses tiles , not pixels. On a 128x64 display, you have 16 columns (0-15) and 8 rows (0-7). The "f" and "r" Suffixes:
When the provided fonts do not meet your specific requirements, you can create custom fonts. The typical workflow for generating a custom U8x8 font involves several key steps: