A Zig font library for SSD1306 OLED screens, designed to print text using GDDRAM.
This library provides easy-to-use font routines compatible with Zig-based firmware for embedded devices.
- 8x8 pixel font for SSD1306 OLED screens
- Draws text directly to a buffer or via allocator
- Designed for Zig firmware targeting microcontrollers
- Simple integration with Zig's package manager
- Supports Zig v0.14+
Fetch the library and save it to your dependencies:
zig fetch --save=font8x8 git+https://github.com/Gnyblast/zig-ssd1306-gddram-fontsAdd to your build.zig:
const font8x8 = b.dependency("font8x8", .{});
firmware.add_app_import("font8x8", font8x8.module("font8x8"), .{})const font8x8 = @import("font8x8").Fonts;var buff: [88]u8 = undefined; // 8*str.len because it's 1 byte font
var printable = font8x8.draw(&buff, "Hello World");
lcd.write_gdram(printable);var da = std.heap.DebugAllocator(.{}){};
var alloc = da.allocator();
var printable = font8x8.drawAlloc(alloc, "Hello World");
defer alloc.free(printable);
lcd.write_gdram(printable);- Zig v0.14 or later
- SSD1306-compatible display
- Zig build system (
build.zig)
MIT