U8x8 Fonts Guide
u8x8 fonts
u8x8 is a compact font and display helper used primarily with small monochrome OLED, LCD, and LED displays in embedded systems (especially Arduino and ESP-based projects). It’s part of the u8g2/u8x8 ecosystem but focuses on a minimal, byte-oriented interface and very small memory footprint.
C. Modern & Square
u8x8_font_chroma48mid8_r: A distinct, slightly rounded look.u8x8_font_px437wyse700b: A Wyse terminal font (very clean).u8x8_font_saikyosans):A thick, bold pixel font.
Memory Layout
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.
The beauty of u8x8 fonts is that this rendering math is simple. To draw an 'A' at column 5, row 2, the library simply copies 8 bytes of pre-defined font data to the display's memory at a specific offset. No bit-shifting, no clipping, no complex math.
Key points
- Purpose: Provide tiny bitmap fonts and a simple API for drawing text on low-resource displays.
- Format: Fonts are stored as arrays of bytes where each byte (or group of bytes) encodes glyph bitmaps row-by-row or column-by-column depending on display orientation. Glyph metadata (width, height, encoding) is minimal to save space.
- Memory profile: Designed for microcontrollers with limited RAM/flash — glyphs are typically stored in program flash and accessed directly with low RAM overhead.
- Supported glyph sizes: Common sizes include 6x8 and 8x8 pixels per glyph, plus a few proportional or taller variants; the naming convention often indicates glyph width × height (e.g., 8x8).
- Rendering: u8x8 uses byte-oriented writes and simple character mapping; it does not require complex graphics buffering. This enables direct writes to displays via I2C/SPI with small code.
- Use cases: Status messages, menus, numeric displays, small icons, or any UI where compact text is required and memory/CPU are constrained.
- Integration: Often used with the u8g2 library suite; u8x8 provides the minimal text-only backend while u8g2 offers richer graphics and larger font sets.
- Advantages:
- Extremely low RAM usage
- Fast, simple rendering
- Easy to port to new displays/drivers
- Limitations:
- Restricted to monochrome and small glyphs
- Limited international/Unicode support unless glyphs are added
- Lacks advanced typographic features (antialiasing, kerning)
Characteristics
- Resolution: 8x8 pixels per character
- Bitmapped: Each character is represented by a fixed bitmap
- Monospaced: All characters have the same width
- Limited scalability: Difficult to scale up or down without losing quality
Creating Your Own u8x8 Font
The standard fonts are great, but what if you need Japanese characters, custom icons, or a specific corporate logo? You can create custom u8x8 fonts. u8x8 fonts
The U8g2 library includes a tool called bdfconv (BDF Converter). BDF (Glyph Bitmap Distribution Format) is a standard text-based font format.
Workflow:
- Design your 8x8 glyphs in a font editor like FontForge or a simple online tool like Piskel.
- Export the glyphs as a BDF file.
- Use
bdfconvto convert the BDF into a C array compatible with U8x8. - Include the generated
.cfile in your project.
Alternatively, you can manually define a font in C: u8x8 fonts u8x8 is a compact font and
static const uint8_t my_custom_font[] =
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Space
0x00, 0x00, 0x5F, 0x00, 0x00, 0x00, 0x00, 0x00, // !
// ... and so on for 256 characters
;
(Note: The order of bytes depends on your display's page layout.)
The Bitmap Tile
A u8x8 font is essentially a lookup table of bitmaps. Each character (ASCII 0-255) corresponds to a specific pattern of bits.
- The "8" in u8x8: This implies the font tile is 8 pixels wide.
- The "x" in u8x8: This implies the font tile is 8 pixels high.
So, a standard u8x8 font map stores 256 characters, where each character is an 8x8 pixel bitmap (64 bits, or 8 bytes of data). u8x8_font_chroma48mid8_r : A distinct, slightly rounded look
D. Scaled Fonts
U8x8 allows you to use scaled fonts to make text larger without loading a different font file.
u8x8_font_px437wyse700a_2x2_r: A 2x scaled version. One character takes 16x16 pixels.u8x8_font_lucasarts_scumm_subtitle_r_2x2: Used for big subtitles.
U8x8 vs U8g2 Fonts – When to Use Which?
| Feature | U8x8 Fonts | U8g2 Fonts | |------------------------|--------------------------|---------------------------| | Width | Fixed (monospaced) | Proportional (variable) | | Pixel size | Usually 8x8 or 8x16 | Any size (e.g., 6x10, 12x16) | | RAM buffer | None (direct render) | Required (full frame buffer) | | Speed | Very fast | Slower (more data) | | Graphics drawing | No (text only) | Yes (lines, circles, bitmaps) | | Display orientation | Fixed grid | Pixel-perfect positioning | | Typical use | Menus, logs, terminals | Graphics, mixed text/shapes |
Rule of thumb: Use U8x8 for text-heavy, low-memory projects. Use U8g2 when you need graphics or precise positioning.