Giant Fonts, Limited Character set (small files for micros)

128x128 pixel 1.5" full colour OLED display with MicroSD card slot. [Product page]
Post Reply
Posts: 5
Joined: Fri Jul 26, 2013 2:17 pm

Giant Fonts, Limited Character set (small files for micros)

Post by mikehains » Sat Dec 12, 2015 6:36 am

Giant fonts take up a lot of space.

In the wiki for FTOLED there is a note at the bottom of the page about creating larger fonts (see ... aying-Text).

It isn't clear however, how to make a font with just a few characters. The answer wasn't obvious to Mr Google, so I went about experimenting.

If you use the suggested software (GLCDFontCreator2) you can:

-> Download GLCDFontCreator2 from ...
-> Extract
-> Run using start.bat
-> Select [File]/[New Font]
-> In the right hand column select [Import Font] and choose a font ! eg Batang
-> Just below that, select size (eg 64)
-> In the left hand column select "Start Index" as 48 (ie start with the '0' character)
-> Make "Character Count" 11 (ie all the numbers, plus the colon)
-> At the top of the column name the new font, eg Batang_64
-> Click [Export] / [Export font]
-> Put in the same name, eg Batang_64.h
-> Copy to the correct folder: C:\Users\DadsHP\Documents\Arduino\libraries\FTOLED-master\fonts
-> Open the file, and:
-> Replace:
#include <inttypes.h>
#include <avr/pgmspace.h>
#include <inttypes.h>
#ifdef __AVR__
#include <avr/pgmspace.h>
#define PROGMEM
-> Change: static uint8_t Batang_64
to static const uint8_t Batang_64

Now you should have a custom font with only the numbers and the colons, and very small size to load into your micro.

Works for me !

Freetronics Staff
Freetronics Staff
Posts: 853
Joined: Tue Apr 09, 2013 11:19 pm
Location: Melbourne, Australia

Re: Giant Fonts, Limited Character set (small files for micros)

Post by angusgr » Wed Dec 30, 2015 5:46 am

Thanks for posting these steps, very helpful!

Post Reply