Font Creator Now Creates Adafruit GFX Fonts

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.

fontpreview
The Font Creator Preview

To create fonts which you can use in the Adafruit library follow these steps:

  1. Go to: http://oleddisplay.squix.ch/
  2. Choose font family, style and size
  3. Now Choose “Adafruit GFX Font” from Library Version dropdown
  4. Click “Create”
  5. 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

  6. 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…

Posted by Daniel Eichhorn

Daniel Eichhorn is a software engineer and an enthusiastic maker. He loves working on projects related to the Internet of Things, electronics, and embedded software. He owns two 3D printers: a Creality Ender 3 V2 and an Elegoo Mars 3. In 2018, he co-founded ThingPulse along with Marcel Stör. Together, they develop IoT hardware and distribute it to various locations around the world.

42 comments

  1. 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?

  2. This is really great. Would it be possible to add some user defined characters to the font, like umlauts and the ° sign?

  3. 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?

  4. 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.

  5. 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

  6. 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.

  7. 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 ….

  8. 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.

  9. 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?

  10. 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

  11. 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?

  12. Hello! My fonts are generated at a height of 2 times more! What specific libraries should I use for this generator?

  13. 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

  14. 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.

  15. 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.

  16. 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

  17. 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.

  18. 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

  19. 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)

Leave a Reply to Gábor ZieglerCancel reply