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 https://github.com/freetronics/FTOLED/w ... 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 https://code.google.com/p/glcd-arduino/ ... eator2.zip
-> 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>
with
#include <inttypes.h>
#ifdef __AVR__
#include <avr/pgmspace.h>
#else
#define PROGMEM
#endif
-> 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 !
Giant Fonts, Limited Character set (small files for micros)
-
- Freetronics Staff
- Posts: 853
- Joined: Tue Apr 09, 2013 11:19 pm
- Location: Melbourne, Australia
- Contact:
Re: Giant Fonts, Limited Character set (small files for micros)
Thanks for posting these steps, very helpful!