As first task for the upcoming Weather Station Color project I wanted to adapt my online font generator. Easily creating fonts in various sizes will make work on the Weather Station code a lot easier. Since my own display library doesn’t support the color TFT screen I switched to Adafruit’s library. They provide a converter but it needs to be compiled and I wanted to have this feature available on my web based font converter. So I analyzed the Adafruit font files and the converter and ported it to Java.
To create fonts which you can use in the Adafruit library follow these steps:
- Go to: http://oleddisplay.squix.ch/
- Choose font family, style and size
- Now Choose “Adafruit GFX Font” from Library Version dropdown
- Click “Create”
- Copy the created font into a new file in your Arduino IDE, e.g. arial14.h and add a
#include "arial14.h"
in your ino-file
- Use the font by calling
tft.setFont(&ArialMT_14);
If you are missing fonts in the font creator please contact me. New fonts should have a license which allows me to add them to the font creator…
Very cool Daniel…I’ve found your font generator to come in handy, and you keep making it better! What about adding the Meteocons font to allow scaling this into sizes other than those that you’ve included by default in your weather display?
This is really great. Would it be possible to add some user defined characters to the font, like umlauts and the ° sign?
Arduino uno 32KB.
For this reason the font file must be small.
I just want to use the numbers.
I will not use letters.
I will use the Droid Sans 36
How do I do this for Adafruit GFX font.
So how can I make the letters ineffective?
You can manually cut out the unwanted characters but that is not easy. You might like to try the library here which has number only fonts and is designed for the limited resources of the UNO.
https://github.com/Bodmer/TFT_ILI9341
The larger fonts are only available in numbers and are “Run Length Encoded” so they render quickly to screen and don’t use up much space.
Some help also here:
http://www.instructables.com/id/Arduino-TFT-display-and-font-library/
Thank you so much.
And
I delayed the thanks. Sorry.
Hi, Firstly, that font generator is great, thanks,
There is a small bug in it though, I generated a font called Yellowtail in point size 32. There is no tilda character (~) which is code 0x7E, so the last character in the table is 0x7D. At the end of the file however the last character is declared as 0x7E, so if the ~ character is printed then garbage appears on the screen!
The last character should be 0x7D for that font, or the ~ symbol should be included.
Above post is for the Adafruit GFX fonts. The same problem seems to occur for other fonts too.
Hi, as of yesterday the generator isn’t working anymore, it does not seem to load the page. Any idea when it will be running again?
Thanks for the great tool!
Hi! thank you for letting me know. I restarted the server, now it seems to run ok. I’ll have to look at the logs to understand why it didn’t respond. Please let me know if you see it again…
Dani
It’s working now, thanks a lot man, great work! Appreciate it!
Hi Mr. Eichhorn
It turns out your 3D printing case cutout is too far away from the USB port. Need to modify the hole for the USB port. Currently I am living and working in china so google map wont work, I just can see a dot without a map. Is there anyway to turn this into your weather station colour ?
I have 12 PCBs in my hand, I wanna give them away. If you or your fans are interested let me know.
Hi Fred! Thank you for the feedback and your kind offer! About the map: is the dot on blue ground? This could also mean that the positioning based on WiFi did not work. You can also hard code the location if that is the case. The library also supports maps from MapQuest, you just need to change a few lines in the code. This project is using the exact same hardware as the WeatherStation Color, so you can just upload the WeatherStation code and you are good to go. About the PCBs: very much interested to give them away to fans. How should we do that? I announce it and they contact you or you send them to me and I ship them to the winners? Can you contact me on Twitter @squix78?
Hi, Thanks for your replay, I have changed the code a little bit and also changed the google api link : https://maps.googleapis.com/maps/….. ( DOES NOT WORK) . for china it should be changed to https://maps.google.cn/maps/…. . its woking well now.
If I upload the WeatherStation Color then LCD wont light up. I cant seam to get around with it.should i change the pin?
For the PCB if I send all of them together would cost me cost me an arm and a leg!!!
I can send you by ordinary post (one by one) or if someone interested to pay the post I can send them all.
The font generator seems to be down again (502 Proxy Error)
I can’t seem to access it either 🙁 [PS : great work – it’s exactly what I needed]
The font generator seems to be still down (502 Proxy Error).
Hi, can your converter adopt the whole unicode charset? I need those diacritics.
Something like here https://github.com/olikraus/u8g2/wiki/fntgrpunifont or here https://github.com/olikraus/u8g2/wiki/fntgrpcu12 …etc.
Thanks
Hi, the create button is only allowed to click once, the number of sources is lower before there were more and more quality, also and noticed that the generation seems different to what is seen ….
The create button of font generator is only allowed to click once and the fonts are less and of worse quality. I have the feeling that the generation is not correct.
Love that it generates GFX fonts now but I can’t find the fonts I used in my last project:
Walter_Turncoat_16
ArialMT_Plain_10
Permanent_Marker_24
Special_Elite_48
Special_Elite_20
Is it possible to convert them?
I used the code here to convert the ttf version of above fonts (all were available with apache license from fonts.google.com) –> https://github.com/adafruit/Adafruit-GFX-Library/pull/96
i wish we could have german symbol tables -.-
Or the € symbol, which is actually advertised in the demo picture right next to it 😉
Please add Liquid Crystal font. Such as http://www.fontineed.com/font/liquidcrystal_1
It’s great for digits in some cases.
Hey Bud,
AWESOME tool! I’m using a 240 x 400 display, can you make the font size max higher? Like say 96?
I’ll by you a full KEG of beer if you can can add this option.
I Promise
LOL, Thanks, Vince
Hi….i need the Mandalorian font wich you can get for free on dafont.com, i try to convert it by myself but i wasn´t very succesfull, it will help me very much. Could you do this or explain me how to do it by myself?
Hello! My fonts are generated at a height of 2 times more! What specific libraries should I use for this generator?
Very nice. How may I create letters (slovak/czech) “áäčďéěíľĺňóôŕřšťúůýž” or russian letters?
These letters are not in the ASCII range, correct? Sadly, that’s still an unresolved feature request. Font tables supporting UTF-8 or UTF-16 encoding can become quite big, too big for microcontrollers to handle. So I don’t really know how I can implement this in the bitmap fonts… Suggestions are code examples are welcome
Diacritic combination, maybe? I mean, to have at the end of the font array some codepoints for combining diacritics, then let the drawing logic solve the accent drawing on top of already drawn glyphs
See https://www.compart.com/en/unicode/U+030B about diacritic “◌̋” (U+030B)
Hi Gabor
I guess this should be possible, but the whole generator is based on pure ASCII (one byte) codes. To support Unicode you’d have to change the generator and the library. Also, which format do you use? The Adafruit or my format? The code of the generator is available here: https://github.com/squix78/esp8266-oled-ssd1306-font-converter
KR, Dani
It is not working anymore 🙁
Just found this from a link posted on the Adafruit Forum. I’ve been looking for something like this forever! Truied it out and it worked. Easy! The only catch was that the Adafruit stuff wanted a name for the font and I had to poke about in the code a bit to figure out what bit they were looking for. Other than that, this stuff is GREAT!
Thanks again for writing this!
-jim lee
Hello, I’ve used your web page to generate a font headfile, but Arduino reports an error while compiling, it’s said that the type of the font should be uint8_t* instead of char*. So I changed the type to uint_8 and it works. I want you to know because this may confuse other users. Thank you.
Great little tool to create fonts. MANY thanks for it !!!
I have been playing with it to create a font for an ePaper based little project I have.
using ePaper with an arduino leaves VERY LITTLE space for program code.
As the fonts are loaded in PROGMEM the smaller the fonts the more space there is for code.
Having the ability to edit what characters to include in the font file would help reduce further the font size in memory.
Hi – This is a great tool!
Unfortunately I can’t get it to work properly.
Perhaps I am missing something but the Adafruit GFX fonts generated do not seem to be compatible with the GFX library. The file structure requires Bitmaps and Glyphs and the data is formatted differently. Any clues?
Thanks
Oh – never mind – found the solution. TFT not Oled
My bad.
Thanks again for the tool.
Hi.
I love the font generator.
Thanks for your effort.
I think I’ve uncovered a bug, though, with the GFX mode.
At large font sizes (>100) the last number in the file goes negative.
This annoys the Arduino IDE.
It seems to happen when the number goes past 127, so it may be as simple as a type conversion error when the string is being generated.
I really like the font generator.
Thanks for your efforts.
I think I may have uncovered a bug in the GFX mode.
At large font sizes (>100), the last value in the file goes negative.
This annoys the Arduino IDE.
It seems to occur if the number would normally be > 127.
So it might be signed/unsigned integer issue
Great effort! Saved me a lot of work. Thanks.
Hi, great work. Would it be possible to cover more characters? I would need font covering the Hungarian alphabet. Your fonts lack the letters with double-long accents: ŐőŰű, i.e., I am looking to
* either cover the “Latin Extended-A” range of Unicode, see https://www.compart.com/en/unicode/block/U+0100
* or support some codepages, like https://www.compart.com/en/unicode/charsets/containing/U+0151
* or to support characters combination with diacritic “◌̋” (U+030B)