Adafruit GFX Font Converter — TTF to GFX Font Header

Convert any TTF/OTF or system font into an Adafruit GFX font header (.h) right in your browser — no fontconvert toolchain. Pick a size and character range, then display.setFont() and print. 100% client-side.

1
Step 1

Pick or Upload a Font

TTF · OTF · system fonts

👇 Choose your font in the Font Source panel on the left:

Upload a TTF/OTF file — loaded locally via the FontFace API, never uploaded to a server.

Or type a system font family already installed on your machine (e.g. Georgia, monospace).

Then set the size and character range, and click Generate Code.

2
Step 2

Preview

🖼Upload an image to see the live preview
3
Step 3

Generate GFX Font Header

This Adafruit GFX font converter turns any TTF/OTF or system font into a ready-to-include GFX font header (.h) — the GFXfont structure the Adafruit GFX library renders with display.setFont(). Normally you would have to compile Adafruit's fontconvert C tool against FreeType from the command line; this GFX font generator does the whole thing in your browser by rasterizing each glyph on a Canvas. Pick a size, choose a character range, and copy a font header that drops straight into your Arduino or ESP32 sketch.

What is a GFXfont and why generate one?

The Adafruit GFX library ships with a single built-in 5×7 pixel font. It is legible but tiny and not very pretty. Custom GFX fonts let you render any typeface — a bold heading, an elegant serif, a clean monospace clock face — on an SSD1306 OLED, ST7735 TFT or any GFX-compatible display. Each custom font is a GFXfont struct: a packed bitmap blob, a per-character GFXglyph table (width, height, cursor advance, x/y offset), and the first/last character codes plus a line-height (yAdvance). Building that by hand is impractical, which is why a converter is essential.

Convert a TTF in your browser

Upload a .ttf or .otf file and the tool loads it through the browser's FontFace API, then draws every character in your chosen range onto an off-screen canvas, finds each glyph's ink bounding box, and packs it MSB-first exactly as Adafruit GFX expects. Prefer a font already installed on your computer? Just type its family name (e.g. Georgia or monospace) instead. The default range is printable ASCII 0x200x7E, matching Adafruit's own fontconvert default; narrow it (say 0x300x3A for digits and a colon) to shrink the flash footprint of a clock or counter.

Using the font in your sketch

Save the generated output as, for example, MyFont18pt.h, place it beside your .ino, then:

#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "MyFont18pt.h"

Adafruit_SSD1306 display(128, 64, &Wire);

void setup() {
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  display.clearDisplay();
  display.setFont(&MyFont18pt);
  display.setTextColor(SSD1306_WHITE);
  display.setCursor(0, 24);   // baseline-anchored!
  display.print("Hello");
  display.display();
}

void loop() {}

The baseline gotcha

The single most common mistake with custom GFX fonts is the cursor anchor. The built-in font draws from the top-left corner, but custom fonts draw from the text baseline — the line letters sit on. If you call setCursor(0, 0) with a custom font, the text renders above the screen and you see nothing. Set the Y position roughly to the font's height (the yAdvance value printed in the output is a good starting point). Lines of text are spaced yAdvance pixels apart automatically.

Keeping the font small

Every glyph you include costs flash, so think about which characters you actually render. A clock only needs digits and a colon (0x300x3A); a temperature readout might add a degree sign and minus. Narrowing the range from the full ASCII set to a dozen glyphs can cut the font's footprint by 80 percent. Larger point sizes grow roughly with the square of the height, so a 36 px display font is far heavier than an 18 px one — generate only the sizes you truly need rather than one giant font you scale down. Bold and italic are separate fonts in GFX, so include them only when used.

Compatibility

The output is a standard GFXfont compatible with Adafruit GFX itself, TFT_eSPI (which accepts GFX fonts), and u8g2 via its GFX-font support. Because the bitmaps are stored in PROGMEM, the font lives in flash and uses no RAM. For images rather than fonts, use the image2cpp converter; for u8g2's own native bitmaps see the u8g2 converter.

Frequently Asked Questions

What is an Adafruit GFX font converter? +
An Adafruit GFX font converter turns a font into a C header (.h) file containing a GFXfont structure — a set of glyph bitmaps plus metrics that the Adafruit GFX library can render with display.setFont() and display.print(). Normally you would compile the official fontconvert C utility from a TTF; this tool generates a compatible GFXfont header right in your browser from any font your system can render, no toolchain needed.
How do I use the generated GFX font? +
Save the output as a .h file, place it next to your sketch, then #include it and call display.setFont(&YourFont); before display.print("text"). Call display.setFont() with no argument to return to the built-in 5x7 font. Remember GFX custom fonts draw from the baseline, so set the cursor Y a little below the top of the screen.
Can I convert a TTF file? +
Yes — upload a .ttf or .otf file and the converter loads it with the browser FontFace API, then rasterizes each character at your chosen size. You can also pick a font already installed on your system. Either way the output is a standard GFXfont header compatible with Adafruit GFX, u8g2 (via its GFX compatibility), and TFT_eSPI.
Which characters are included in the font? +
By default the printable ASCII range 0x20 (space) through 0x7E (~) is included, exactly like the Adafruit fontconvert default. This covers letters, digits and common punctuation. You can narrow the range to shrink the flash footprint if you only need digits for a clock, for example.
Is the GFX font converter free and private? +
Yes. Font rasterization happens entirely client-side using Canvas and the FontFace API. Your font file never leaves your browser. No signup, no watermark, no limits.
Why does my GFX font render too high or clipped? +
Adafruit GFX custom fonts use the text baseline as the cursor anchor, not the top-left corner like the built-in font. If the text is clipped at the top, increase the cursor Y position (e.g. display.setCursor(0, 20)). The generated yAdvance and glyph yOffset values follow the GFX convention so vertical spacing between lines is correct.

More embedded converters

Image to C++ Converter
The classic image2cpp — SSD1306, ST7735, Adafruit GFX & u8g2 byte arrays.
u8g2 Bitmap Converter
Image to u8g2 XBM / drawXBMP byte array for monochrome OLEDs.
LVGL Image Converter
Image to LVGL lv_img_dsc_t C array for ESP32 GUIs.
E-Paper Image Converter
Image to Waveshare e-paper byte array, incl. black/white/red 3-color.
Developer Calculators ↗
Bit/byte, hex, base, color & sizing calculators for embedded work.
JSON & Dev Tools ↗
Format, validate & convert JSON, CSV, base64 and more — 15 tools.