Creating your own fonts for Adafruit TFT

Hello,

so I've installed GLCD Font Creator and I have generated the uint8_t code for a font that I want to use in my project (using a 7-segment "digital" font to imitate a classic seven-segment LCD display). It looks something like this_

//Font Generated by MikroElektronika GLCD Font Creator 1.2.0.0
//MikroElektrnika 2011 
//http://www.mikroe.com 

//GLCD FontName : Digital7
//GLCD FontSize : 16 x 27

const unsigned short Digital7[] PROGMEM = {
   0x00,
   0x00,
   0x20,0x00,
   0x7F,0x00,
   0x1B,
   0x00,
   0x01,0x88,0x01,0x00,
 

// yadayadayada...

        };

So now what do I actually do with it? I've tried simply saving this file as "Digital7.h" in the fonts folder in the Adafruit GFX library, but when I try to incorporate this font into my sketches, I get error messages.

What is the correct code syntax within your own "myOwnFont.h"-type files that the Arduino IDE needs in order to compile a sketch?

Sorry, really still kinda new at using fonts and displays.

The official Adafruit GFX library only handles two font formats. A basic 7x5 character in file "glcdfont.c" file and specially encoded fonts in the "Fonts" folder.

Adafruit provide a utility in the fontconvert folder to make you own from the FreeFonts library or TrueType fonts which are available on the internet. However you will need to be a bit of a Linux Guru to get the fontconvert program running and I have not seen a tutorial on this.

If you want to create fonts in another format and use them, then you will have to write your own code to render them to the screen.

bodmer,

I need to get a custom font as well... The sizes for the ones included wont work, I need something a smidgen smaller. Who do we have to start nagging to get a solution other than that fontconverter nightmare. not all of us are linux weenies.

yeah, sadly, I don't know the first thing about Linux.

Maybe I will try another approach - I've seen pictures online of displays hooked up to an Arduino where somebody actually had seven-segment LCD font on their TFT.

Is there a ready to use, Adafruit compatible font like that?

Adafruit_GFX supports the historic 7x5 font. And the FreeFonts style.

I have converted the default UTFT Fonts to the Free format. i.e. Small, Big, SevenSegment.
Just copy FreeDefaultFonts.c from my GitHub site.

I have a sketch somewhere that converts the UTFT font style.
And can convert the Codevision's style of font.
It does not convert MikroElektronika fonts. I suppose I could support them if people genuinely wanted them.

Note that the GFX rendering is a bit of a pain. i.e. it is always transparent. It draws from a baseline and not from the top.

Someone said they wanted something smaller than 7x5. I think I did a 5x3 into Free style. Heaven knows why anyone would want 5x3. It looks horrible.

David.

david_prentice:
Someone said they wanted something smaller than 7x5. I think I did a 5x3 into Free style. Heaven knows why anyone would want 5x3. It looks horrible.

The new Adafruit_GFX library has a TomThumb 3x5 font in the Fonts folder but it is not one I have used.

Your convert utilities sound promising :slight_smile:

I finally got that font converter working. Installed VMware Player, created a ubuntu VM and then made sure the two dependencies were installed. After that the program complied and started working like a charm.

sudo apt-get install libfreetype6-dev was the key in my case.

I know the GFX rendering is a pain in the arse for fonts and I prefer how bodmer's works with the background color of the font but sadly his renders a LOT slower on my ST7735R.

WillCut:
I know the GFX rendering is a pain in the arse for fonts and I prefer how bodmer's works with the background color of the font but sadly his renders a LOT slower on my ST7735R.

Something must be wrong with your setup if this library is running slow. As a performance comparison if all the delays are taken out the graphicstest example that is built into the Adafruit_ST7735 library it completes the test in 8.62s, if you run the same test on the TFT_ST7735 library (called graphicstest_small) it runs in 1.707s which is a remarkable 5x faster.

Running the TFT_Char_Time example in the TFT_ST7735 library should give figures in the range 0.2ms per character for a numeral the small adafruit GLCD font, up to 10.1ms for the extra large custom Font 8 which has 72 pixel high characters.

At the moment the TFT_ST7735 library does not support the FreeFonts format, however the Mega and Due 16 bit libraries do.

The Adafruit FreeFont format does something no other TFT library does and that is handle characters that overlap, ie in an italic font the tail of a "y" tucks under the previous character. This makes rendering background too a pain but this is achieved in the 16bit libraries mentioned above by determining the string length in pixels then doing a block erase.

I'm using a teensy, I assumed that had something to do with it being slower. I guess its not optimized for it. Also, was getting some font corruption if my sketch hit a certain size.

WillCut:
I'm using a teensy, I assumed that had something to do with it being slower. I guess its not optimized for it. Also, was getting some font corruption if my sketch hit a certain size.

Ah! I am amazed it worked at all on a Teensy!

The library is written purely for 8 bit AVR processors (UNO, Mega or Leonardo and variants).

I guess the IDE you are using ignored the avr architecture constraint in the library.properties file.

@david_prentice:

Somehow, I couldn't get your font library to work... and I have to say the font rendering of Adafruit's own free fonts that come with this display looks very disappointing, even taking into consideration the obvious limitations of a stamp-sized TFT display (I used to be a web site programmer and graphics designer, so it jumps out at me when fonts are poorly rendered or displayed).

And I've thought of another approach that would be slightly more flexible and reusable... a slightly crazy idea; what if I write a function that converts an integer into a series of small bmp files that show the numbers from 0 to 9?

That function would then convert an integer or float into a character string, and go down the string, array member by array member, and load the corresponding .bmp file to display that digit on the screen.

The advantage would be that if well written, such a function would also make it possible to use various different fonts.

Or would this slow down display refresh times by too much?

This is all for a CarDuino, and I plan to update the display every three seconds with new data.

@carguy,

Which Arduino model?
Which Adafruit_GFX version?
Which MCUFRIEND_kbv version?

Note that the Library Manager does not seem to install the current GFX Master branch from GitHub.

The FreeFonts render just fine with the current GFX library.
I am not sure how the Manger chooses what to install.

I would expect a Manager to install a Release (if available)
Or the current "master" branch which is likely to be Beta in progress.

David.

carguy:
... and I have to say the font rendering of Adafruit's own free fonts that come with this display looks very disappointing, even taking into consideration the obvious limitations of a stamp-sized TFT display (I used to be a web site programmer and graphics designer, so it jumps out at me when fonts are poorly rendered or displayed).

The small size freefonts do look a bit ugly due to the way they are automatically digitised by software. The larger ones render quite well.

Your quality expectations are high so look at this library which supports anti-aliased fonts, but you won't match the high end graphics performance seen in Web pages. There is a PC display design GUI too. I have not used either myself.

Due to other project characteristics, I have decided to migrate from a 328P-PU to a 1284P-PU. Which hasn't arrived in the mail yet... but any day now.

So right now, my work hypothesis of how to best display my gauge readings on my TFT display is to convert bitmaps with the characters that I need, which are really just the numbers from 0 to 9, into LCD compatible code. And then type up a function which parses the numbers from my sensor readings to display them as the images from 0-9 stored in progmem. Because I am moving up to the 1284, I figure I will have much more memory to toy with.

I spent tonight trying to make drawing bitmaps from PROGMEM work, with a simple sketch, but somehow, the character only comes out completely garbled. I used the "LCDAssistant" that is recommended by Adafruit themselves.

This sketch compiles and uploads fine to my Uno board, but on the TFT screen, it's a dog's dinner.

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>

#define TFT_CS  10
#define TFT_RST 9
#define TFT_DC  8
#define SD_CS 4

Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS,  TFT_DC, TFT_RST);

#define TFT_SCLK 13
#define TFT_MOSI 11

const unsigned char myBitmap [] PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xB8, 0xB8, 0x00,
0xB9, 0xB9, 0xB9, 0x00, 0xBA, 0xBA, 0xBA, 0x00, 0xBB, 0xBB, 0xBB, 0x00, 0xBC, 0xBC, 0xBC, 0x00,
0xBD, 0xBD, 0xBD, 0x00, 0xBE, 0xBE, 0xBE, 0x00, 0xBF, 0xBF, 0xBF, 0x00, 0xC0, 0xC0, 0xC0, 0x00,
0xC1, 0xC1, 0xC1, 0x00, 0xC2, 0xC2, 0xC2, 0x00, 0xC3, 0xC3, 0xC3, 0x00, 0xC4, 0xC4, 0xC4, 
};

void setup() {

  tft.initR(INITR_144GREENTAB);
  tft.setRotation(1);
  tft.fillScreen(ST7735_WHITE);
}

void loop() {
  tft.drawBitmap(10,10, myBitmap, 39,59, 0x8841);
}

What's wrong here? :frowning:

Attached to this post, you will find the bitmap that I have been trying to display.

9.png

Why not use the new FreeFont style?

FreeSevenSegNumFont.h:

const uint8_t FreeSevenSegNumFontBitmaps[] PROGMEM = {
// 27x46 [0x30 '0']
0x03,0xFF,0xF8,0x00,0xFF,0xFF,0x80,0x3F,0xFF,0xF8,0x03,0xFF,0xFE,0xC3,0x3F,0xFF,
0xBC,0xF0,0x00,0x0F,0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,0x80,
0x00,0xFF,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,0x7F,0xF8,0x00,0x0F,0xFF,
0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,0x80,0x00,0xFF,0xF0,0x00,0x1F,
0xFC,0x00,0x00,0xFE,0x00,0x00,0x07,0x00,0x00,0x00,0x40,0x00,0x00,0x04,0x00,0x00,
0x00,0xE0,0x00,0x00,0x7F,0x00,0x00,0x3F,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,
0x00,0x7F,0xF8,0x00,0x0F,0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,
0x80,0x00,0xFF,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,0x7F,0xF8,0x00,0x0F,
0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0x78,0x00,0x03,0xC6,0x7F,0xFF,0x30,0x1F,0xFF,
0xF0,0x07,0xFF,0xFF,0x00,0x7F,0xFF,0xC0,0x07,0xFF,0xF0,0x00,
// 6x39 [0x31 '1']
0x31,0xEF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x3C,0x30,0x40,0x00,
0x33,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFD,0xE3,0x00,
// 27x46 [0x32 '2']
0x03,0xFF,0xF8,0x00,0xFF,0xFF,0x80,0x3F,0xFF,0xF8,0x03,0xFF,0xFE,0xC0,0x3F,0xFF,
0xBC,0x00,0x00,0x0F,0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0,0x00,
0x00,0xFC,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x0F,0xC0,
0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0,0x00,0x00,0xFC,0x00,0x00,0x1F,
0x80,0x00,0x00,0xF0,0x7F,0xFF,0x86,0x1F,0xFF,0xFC,0x4F,0xFF,0xFF,0xE4,0xFF,0xFF,
0xF8,0xE7,0xFF,0xFC,0x1F,0x00,0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x0F,0xC0,
0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0,0x00,0x00,0xFC,0x00,0x00,0x1F,
0x80,0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x0F,0xC0,0x00,0x01,0xF8,0x00,0x00,
0x3F,0x00,0x00,0x07,0xE0,0x00,0x00,0x78,0x00,0x00,0x06,0x7F,0xFF,0x00,0x1F,0xFF,
0xF0,0x07,0xFF,0xFF,0x00,0x7F,0xFF,0xC0,0x07,0xFF,0xF0,0x00,
// 25x46 [0x33 '3']
0x0F,0xFF,0xE0,0x0F,0xFF,0xF8,0x0F,0xFF,0xFE,0x03,0xFF,0xFE,0xC0,0xFF,0xFE,0xF0,
0x00,0x00,0xFC,0x00,0x00,0x7E,0x00,0x00,0x3F,0x00,0x00,0x1F,0x80,0x00,0x0F,0xC0,
0x00,0x07,0xE0,0x00,0x03,0xF0,0x00,0x01,0xF8,0x00,0x00,0xFC,0x00,0x00,0x7E,0x00,
0x00,0x3F,0x00,0x00,0x1F,0x80,0x00,0x0F,0xC0,0x00,0x07,0xE0,0x00,0x00,0xF1,0xFF,
0xFE,0x19,0xFF,0xFF,0xC7,0xFF,0xFF,0xF8,0xFF,0xFF,0xF8,0x1F,0xFF,0xF1,0x80,0x00,
0x03,0xC0,0x00,0x07,0xE0,0x00,0x03,0xF0,0x00,0x01,0xF8,0x00,0x00,0xFC,0x00,0x00,
0x7E,0x00,0x00,0x3F,0x00,0x00,0x1F,0x80,0x00,0x0F,0xC0,0x00,0x07,0xE0,0x00,0x03,
0xF0,0x00,0x01,0xF8,0x00,0x00,0xFC,0x00,0x00,0x7E,0x00,0x00,0x3F,0x00,0x00,0x0F,
0x07,0xFF,0xF3,0x07,0xFF,0xFC,0x07,0xFF,0xFF,0x01,0xFF,0xFF,0x00,0x7F,0xFF,0x00,
// 27x39 [0x34 '4']
0x00,0x00,0x01,0x86,0x00,0x00,0x79,0xE0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,
0x7F,0xF8,0x00,0x0F,0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,0x80,
0x00,0xFF,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,0x7F,0xF8,0x00,0x0F,0xFF,
0x00,0x01,0xFF,0xE0,0x00,0x3F,0xF8,0x00,0x01,0xFC,0xFF,0xFF,0x0E,0x3F,0xFF,0xF8,
0x9F,0xFF,0xFF,0xC1,0xFF,0xFF,0xF0,0x0F,0xFF,0xF8,0xC0,0x00,0x00,0x78,0x00,0x00,
0x3F,0x00,0x00,0x07,0xE0,0x00,0x00,0xFC,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,
0x00,0x7E,0x00,0x00,0x0F,0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0,
0x00,0x00,0xFC,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x07,
0x80,0x00,0x00,0x60,
// 27x46 [0x35 '5']
0x03,0xFF,0xF8,0x00,0xFF,0xFF,0x80,0x3F,0xFF,0xF8,0x03,0xFF,0xFE,0x03,0x3F,0xFF,
0x80,0xF0,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0,0x00,0x00,0xFC,0x00,0x00,0x1F,0x80,
0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x0F,0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F,
0x00,0x00,0x07,0xE0,0x00,0x00,0xFC,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,0x00,
0x7C,0x00,0x00,0x0E,0x7F,0xFF,0x81,0x1F,0xFF,0xFC,0x0F,0xFF,0xFF,0xE0,0xFF,0xFF,
0xF8,0x07,0xFF,0xFC,0x60,0x00,0x00,0x3C,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,
0x00,0x7E,0x00,0x00,0x0F,0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0,
0x00,0x00,0xFC,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x0F,
0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x03,0xC0,0x7F,0xFF,0x30,0x1F,0xFF,
0xF0,0x07,0xFF,0xFF,0x00,0x7F,0xFF,0xC0,0x07,0xFF,0xF0,0x00,
// 27x46 [0x36 '6']
0x03,0xFF,0xF8,0x00,0xFF,0xFF,0x80,0x3F,0xFF,0xF8,0x03,0xFF,0xFE,0x03,0x3F,0xFF,
0x80,0xF0,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0,0x00,0x00,0xFC,0x00,0x00,0x1F,0x80,
0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x0F,0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F,
0x00,0x00,0x07,0xE0,0x00,0x00,0xFC,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,0x00,
0x7C,0x00,0x00,0x0E,0x7F,0xFF,0x81,0x1F,0xFF,0xFC,0x0F,0xFF,0xFF,0xE4,0xFF,0xFF,
0xF8,0xE7,0xFF,0xFC,0x7F,0x00,0x00,0x3F,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,
0x00,0x7F,0xF8,0x00,0x0F,0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,
0x80,0x00,0xFF,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,0x7F,0xF8,0x00,0x0F,
0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0x78,0x00,0x03,0xC6,0x7F,0xFF,0x30,0x1F,0xFF,
0xF0,0x07,0xFF,0xFF,0x00,0x7F,0xFF,0xC0,0x07,0xFF,0xF0,0x00,
// 23x42 [0x37 '7']
0x3F,0xFF,0x80,0xFF,0xFF,0x83,0xFF,0xFF,0x83,0xFF,0xFE,0xC3,0xFF,0xFB,0xC0,0x00,
0x0F,0xC0,0x00,0x1F,0x80,0x00,0x3F,0x00,0x00,0x7E,0x00,0x00,0xFC,0x00,0x01,0xF8,
0x00,0x03,0xF0,0x00,0x07,0xE0,0x00,0x0F,0xC0,0x00,0x1F,0x80,0x00,0x3F,0x00,0x00,
0x7E,0x00,0x00,0xFC,0x00,0x01,0xF8,0x00,0x00,0xF0,0x00,0x00,0x60,0x00,0x00,0x40,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x3C,0x00,0x01,0xF8,0x00,0x03,
0xF0,0x00,0x07,0xE0,0x00,0x0F,0xC0,0x00,0x1F,0x80,0x00,0x3F,0x00,0x00,0x7E,0x00,
0x00,0xFC,0x00,0x01,0xF8,0x00,0x03,0xF0,0x00,0x07,0xE0,0x00,0x0F,0xC0,0x00,0x1F,
0x80,0x00,0x3F,0x00,0x00,0x3C,0x00,0x00,0x30,
// 27x46 [0x38 '8']
0x03,0xFF,0xF8,0x00,0xFF,0xFF,0x80,0x3F,0xFF,0xF8,0x03,0xFF,0xFE,0xC3,0x3F,0xFF,
0xBC,0xF0,0x00,0x0F,0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,0x80,
0x00,0xFF,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,0x7F,0xF8,0x00,0x0F,0xFF,
0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,0x80,0x00,0xFF,0xF0,0x00,0x1F,
0xFC,0x00,0x00,0xFE,0x7F,0xFF,0x87,0x1F,0xFF,0xFC,0x4F,0xFF,0xFF,0xE4,0xFF,0xFF,
0xF8,0xE7,0xFF,0xFC,0x7F,0x00,0x00,0x3F,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,
0x00,0x7F,0xF8,0x00,0x0F,0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,
0x80,0x00,0xFF,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,0x7F,0xF8,0x00,0x0F,
0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0x78,0x00,0x03,0xC6,0x7F,0xFF,0x30,0x1F,0xFF,
0xF0,0x07,0xFF,0xFF,0x00,0x7F,0xFF,0xC0,0x07,0xFF,0xF0,0x00,
// 27x46 [0x39 '9']
0x03,0xFF,0xF8,0x00,0xFF,0xFF,0x80,0x3F,0xFF,0xF8,0x03,0xFF,0xFE,0xC3,0x3F,0xFF,
0xBC,0xF0,0x00,0x0F,0xFF,0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,0x80,
0x00,0xFF,0xF0,0x00,0x1F,0xFE,0x00,0x03,0xFF,0xC0,0x00,0x7F,0xF8,0x00,0x0F,0xFF,
0x00,0x01,0xFF,0xE0,0x00,0x3F,0xFC,0x00,0x07,0xFF,0x80,0x00,0xFF,0xF0,0x00,0x1F,
0xFC,0x00,0x00,0xFE,0x7F,0xFF,0x87,0x1F,0xFF,0xFC,0x4F,0xFF,0xFF,0xE0,0xFF,0xFF,
0xF8,0x07,0xFF,0xFC,0x60,0x00,0x00,0x3C,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,
0x00,0x7E,0x00,0x00,0x0F,0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x07,0xE0,
0x00,0x00,0xFC,0x00,0x00,0x1F,0x80,0x00,0x03,0xF0,0x00,0x00,0x7E,0x00,0x00,0x0F,
0xC0,0x00,0x01,0xF8,0x00,0x00,0x3F,0x00,0x00,0x03,0xC0,0x7F,0xFF,0x30,0x1F,0xFF,
0xF0,0x07,0xFF,0xFF,0x00,0x7F,0xFF,0xC0,0x07,0xFF,0xF0,0x00,
};
const GFXglyph FreeSevenSegNumFontGlyphs[] PROGMEM = {
    {   0, 27, 46, 32,  2, -48 }, // 0x30 '0'
    { 156,  6, 39, 32, 23, -45 }, // 0x31 '1'
    { 186, 27, 46, 32,  2, -48 }, // 0x32 '2'
    { 342, 25, 46, 32,  4, -48 }, // 0x33 '3'
    { 486, 27, 39, 32,  2, -45 }, // 0x34 '4'
    { 618, 27, 46, 32,  2, -48 }, // 0x35 '5'
    { 774, 27, 46, 32,  2, -48 }, // 0x36 '6'
    { 930, 23, 42, 32,  6, -48 }, // 0x37 '7'
    {1051, 27, 46, 32,  2, -48 }, // 0x38 '8'
    {1207, 27, 46, 32,  2, -48 }, // 0x39 '9'
};
const GFXfont FreeSevenSegNumFont PROGMEM = {
    (uint8_t  *)FreeSevenSegNumFontBitmaps,
    (GFXglyph *)FreeSevenSegNumFontGlyphs,
    48, 58, 50
};
// FreeSevenSegNumFont bitmap size = 1363 [1433] [2014]

carguy.ino

#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>

//#include "FreeDefaultFonts.h"
#include "FreeSevenSegNumFont.h"

#define TFT_CS  10
#define TFT_RST 9
#define TFT_DC  8
#define SD_CS 4

Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS,  TFT_DC, TFT_RST);

#define TFT_SCLK 13
#define TFT_MOSI 11

void setup() 
{
    tft.initR(INITR_GREENTAB);
    tft.setRotation(1);
    tft.fillScreen(ST7735_WHITE);
    tft.setFont(&FreeSevenSegNumFont);
}

void loop() 
{
    tft.fillScreen(ST7735_RED);
    tft.setCursor(0, 50);   //start at base line
    tft.print("123456789");
    delay(1000);
}

David.

That's actually really not bad, thank you...

Also, are there any GLCD font creating applications that don't look quite as crap as GLCD Font Creator?

I tried creating a front both from the Windows ttf fonts "Digital-7" and "DS-Digital", and they both just looked horrible.

You are using a tiny display. Most PC fonts will look pretty horrible. Individual pixels are visible.

However there are some Arial12 and Arial14 that look ok.
The Adafruit 7x5 looks pretty reasonable to me.
The UTFT BigFont looks pretty ugly.

Have you investigated the FreeFonts that come with Adafruit?

It sounds as if you like "ugly" fonts. Every opinion is personal !
Find a specific font. Edit it until it looks attractive to you.

David.

I'm sorry that I've been an unsatisfiable customer here. Again, coming from a web design background, you are used to certain things being possible in a certain way. There just aren't the same graphic design limitations in web development as there appear to be within the Arduino world.

Having to scale down your expectations from that to an 8-bit microcontroller environment is only a gradual process, I guess.

I'm going to have to see if there are better fonts for my purposes. Or just live with their limitations.

bodmer:
The official Adafruit GFX library only handles two font formats. A basic 7x5 character in file "glcdfont.c" file and specially encoded fonts in the "Fonts" folder.

Adafruit provide a utility in the fontconvert folder to make you own from the FreeFonts library or TrueType fonts which are available on the internet. However you will need to be a bit of a Linux Guru to get the fontconvert program running and I have not seen a tutorial on this.

If you want to create fonts in another format and use them, then you will have to write your own code to render them to the screen.

Greeatings.

I will make one new font for adafruit library , can you explane my how can i do that
which software i can use o r somthing else ?.
Have you some bigger font ?

t0r30rs:
I will make one new font for adafruit library , can you explane my how can i do that
which software i can use o r somthing else ?.
Have you some bigger font ?

Hello!

You can use my font editor for AdafruitGFX and UTFT. As the easiest option, you can save the fonts from the UTFT to the Adafruit format.

To create a new C font from any font format you will need a font editor FontForge. With his help you need to create a BDF file. When converting to a raster, specify the font size you need and select the desired code page in case you use additional symbols. To fully support the regional language in the font, you will need to create a character mapping table between the encodings in my editor. In the editor there is an example for the encodings of the Russian language, I can help if there are any questions.

Open the resulting BDF file in my editor. You can make changes to the received symbols, there are tools for simultaneously changing the size and position of all the characters. If you create a proportional font, set the width for each character yourself. You can do this quickly by moving the right mouse button mode to "Set Width".
Save the result in the desired format. Correctly specify font width and offset.