U8x8 Fonts -
On a platform like an ATmega328P (Arduino Uno), you have only 2KB of SRAM. Rendering a full framebuffer for a 128x64 pixel display requires (128 * 64) / 8 = 1024 bytes — that's half your RAM gone in one shot.
Because every character fits neatly into a uniform 8-pixel by 8-pixel tile, the microcontroller does not need to calculate pixel-by-pixel layouts. Instead, it sends raw tile bytes directly to the display’s page memory.
void loop() {}
The choice between U8g2 and U8x8 involves meaningful trade-offs in terms of memory and performance: u8x8 fonts
Version 2.25.x of the U8g2 library introduced a new U8x8 font format to support fonts with larger glyphs while still maintaining compatibility with the 8×8 pixel grid requirement. Future versions are likely to continue improving font support while maintaining the library‘s core commitment to memory efficiency and ease of use.
Before we discuss the fonts, we must decode the name. is a graphics library primarily associated with the U8g2 project (the "Universal Graphics Library for 8-bit and 32-bit embedded devices").
Because microcontrollers are resource-constrained, u8x8 fonts store data vertically or horizontally depending on the display controller. For example, an OLED display (SSD1306) uses a vertical page layout. The 8 bytes for the letter 'A' might represent Column 0, Pages 0-7. On a platform like an ATmega328P (Arduino Uno),
As one source concisely puts it: “U8g2 also includes U8x8 library: U8g2 includes all graphics procedures (line/box/circle draw). Supports many fonts with almost no restriction on the font height. U8x8 is text output only (character) device, only fonts allowed with fit into a 8×8 pixel grid, writes directly to the display, no buffer required”.
While the U8g2 library includes hundreds of fonts, there are times when a custom font is needed—perhaps for a company logo, a special symbol set, or a display of unusual dimensions. The process typically involves:
A u8x8 font is essentially a lookup table of bitmaps. Each character (ASCII 0-255) corresponds to a specific pattern of bits. Instead, it sends raw tile bytes directly to
This efficiency means you can run a U8x8 font on an ATtiny85 with 512 bytes of RAM, something impossible with most other font engines.
Always start with _r unless you know your display has a specific memory layout quirk.
Some display controllers rotate data differently. If your text appears mirrored or garbled, you may need to use the setFlipMode() function. U8x8 fonts are stored in a specific byte order; if your display uses a different page addressing mode, it will look like static.