Skip to content
DisplayBSDv1.11.9

Adafruit GFX Library

by Adafruit

Adafruit GFX is the shared graphics engine underneath nearly every Adafruit display driver (SSD1306 OLEDs, ILI9341 TFTs, ST7735, e-paper via GxEPD2, and more). It provides the drawing primitives — lines, rectangles, circles, text rendering with custom fonts, and bitmap blitting — while the display-specific driver library only has to implement low-level pixel writes. You never call GFX functions directly by itself; instead a display driver library (like Adafruit_SSD1306) inherits from it, so once GFX is installed, all the familiar `drawPixel()`, `println()`, and `fillRect()` calls become available on your display object automatically.

Installation

Arduino IDE — Library Manager

Sketch → Include Library → Manage Libraries → search Adafruit GFX Library

PlatformIO

lib_deps = adafruit/Adafruit GFX Library

Supported boards

Arduino UnoESP32STM32 Blue Pill

Examples

Draw scaled text

GFX text primitives work identically across every display driver that inherits from it.

display.setTextSize(2);
display.setTextColor(SSD1306_WHITE);
display.setCursor(0, 0);
display.println("SolderHub");
display.display();

Draw shapes

Basic shape primitives — rectangles, circles, lines — shared across all GFX-based displays.

display.drawRect(10, 10, 50, 30, SSD1306_WHITE);
display.fillCircle(80, 25, 12, SSD1306_WHITE);
display.display();