ILI9341_t3 font editor

This is a superb tool!
I was able to print special characters like ñ and á by opening a Windows font, then copying from the original 'n' or 'a', then hand-drawing the rest. Adjust the vertical offset for your new character. Reduce delta by a couple of pixels for all characters. Increase the delta for space (0x20) by 2 or 3 pixels. Done.
Thank you so much.

You're welcome :) I'm always glad to hear that my tool simplified someone's life :)

Best regards -- Spook.
 
Hi all,
First time I'm using this tool, and it is amazing, very flexible and easy too use.
I just have some questions:
1- The result is a little bit different from PaulStoffregen's fonts right? Not a big deal, only the corners look different when comparing on the display. I notice when I committed my code, is that expected?
2- Even after pressing "Optimize all", I have to adjust manually the origin and offset of all letters, one at a time. Is this normal or I'm missing something?
3- I need the extended characters for accentuation, but the software does not import chars after 127. Is this expected? Do I have to create them manually?
I downloaded the software from https://spooksoft.pl/en/download-3/ so I imagine it's the last version.

I just want to reinforce that I'm not criticizing, I'm just learning how to use this amazing tool.
Thank you very much
 
Last edited:
And, when using the extended chars (above 127), the display always shows 2 chars. For example, when using:
ç it shows char 195 and 167
ã it shows char 195 and 163
â it shows char 195 and 162
Same result using the accents from keyboard or typing ALT+code.
Is this behavior because of the software or the ILI_9341 library?
Thanks again
 
Last edited:
Hi all,
First time I'm using this tool, and it is amazing, very flexible and easy too use.
I just have some questions:
1- The result is a little bit different from PaulStoffregen's fonts right? Not a big deal, only the corners look different when comparing on the display. I notice when I committed my code, is that expected?
2- Even after pressing "Optimize all", I have to adjust manually the origin and offset of all letters, one at a time. Is this normal or I'm missing something?
3- I need the extended characters for accentuation, but the software does not import chars after 127. Is this expected? Do I have to create them manually?
I downloaded the software from https://spooksoft.pl/en/download-3/ so I imagine it's the last version.

I just want to reinforce that I'm not criticizing, I'm just learning how to use this amazing tool.
Thank you very much

Hi Chuckero,

1. The format of Paul's fonts is defined in such way that the same result (e.g. character) may be achieved in multiple ways. For instance if you add an empty column on the right of the character, it will look exactly the same, but binary-wise it will be different. Moreover, nowadays fonts use some form of anti-aliasing, which obviously is not available in the case of ILI9341_t3. My editor tries to guess where the pixel should be and where not, but it may pick different pixels than Paul's tools did (and also Paul might have adjusted them manually). That's why in the end you always need to review the font char by char and fix any errors you spot (or just adjust the shape of characters to your liking).

Long story short, if it works, then don't worry about the differences :)

2. Optimization causes all the characters to shrink in such way that they occupy the least space possible (they are stripped of all border empty rows and columns, but offsets and deltas are kept unchanged). In general what I did when I was creating fonts for the ILI9341_t3 library was adjusting the offsets and deltas first, correcting the chars and finally using the optimize to minimize the output font file size.

Note that there is an option to adjust delta and offset to all characters at the same time. Very often when you adjust all characters by looking only at a single one, most of them will get adjusted correctly as well. So that's the approach I'd suggest before cleaning up and finally optimizing the whole font.

3. This is a matter of encoding.

Nowadays (almost) everything uses UTF-8. It encodes character with variable number of bytes. Long story short, for characters 0~127 it uses single byte, then for the next batch it uses two bytes (110xxxxx 10xxxxxx), then for the next batch three bytes (1110xxxx 10xxxxxx 10xxxxxx) and so on. It is constructed in quite a smart way, so that if one spots a byte below 128, it *must* be a single-byte character.

In past times characters were encoded with a single-byte ASCII format. It caused a lot of trouble, because there were multiple standards for encoding special characters. In Poland, for instance, two most used were ISO 8859-2 (Latin-2) and Windows-1250. By the way, the part before 128 was constant regardless of the encoding and UTF-8's first 128 characters (0~127 perfectly matches the ASCII ones for a form of backwards compatibility).

Since I don't know upfront, which encoding would you like to use, I just omit the characters 128-255, so that you may define them by yourself. One of the easy ways is to copy a letter (you can copy a character into another) and then add appropriate modifiers, such as ą, ę, ś, ć etc.

I don't plan on implementing any fixed encoding in the application, but if I have some free time (I don't work too much with ILI-s anymore), I'll add an option to render an arbitrary character into the canvas, so that you will be able to prepare special characters more quickly.

I hope this explanation helps somewhat :) I'm also happy that you like my editor. Hope it will help you somewhat :)

Best regards -- Wojciech "Spook" Sura.
 
And, when using the extended chars (above 127), the display always shows 2 chars. For example, when using:
ç it shows char 195 and 167
ã it shows char 195 and 163
â it shows char 195 and 162
Same result using the accents from keyboard or typing ALT+code.
Is this behavior because of the software or the ILI_9341 library?
Thanks again

This behavior is actually because of the text editor in which you write the source code of your application - it encodes it in UTF-8. Open your source file in any hex-editor, you'll see. You either have to use an editor, which explicitly encodes file in ASCII in some encoding or enter characters as bytes manually.

Best regards -- Spook.
 
Thank you so much @spook, all that information was very helpful.
At the end, I figured out two solutions to use accentuation:

1- Concatenates literal with octal code back slash (escape sequence). That's not too elegant, but not bad, and it works.

Code:
// For the word "Atenção".
char msg[] = "Aten\x87\x84o";
and, evolving to:
Code:
#define ã   "\x84"  // ASCII 132
#define ç   "\x87"  // ASCII 135
...
char msg[] = "Aten" ç ã "o";

2- I changed the file encoding in my code editor to ISO-8856-1. As a consequence, the ASCII char number above 127 changed for the ILI9341 fonts, it changed all accents in the project files and in the Git tool (the first commit had a lot of differences). But the good thing is that I can write the messages in exactly the same way as they will appear on the LCD, which was the goal :cool:

Code:
char msg[] = "Atenção";
 
Hey @spook,
Is there a way to import a font from c code, make some changes and save it back?
I fount a very interesting font but is missing some chars, and there is no reference (no name, no origin, nothing relevant).
Thanks again
 
Hey @spook,
Is there a way to import a custom font from c code, make some changes and save it back?
I fount a very interesting font but is missing some chars, and there is no reference (no name, no origin, nothing relevant).
Thanks again
Hello, @spook. Your tool is very helpful and thank you so much for sharing.
May you also please answer it.
 
Back
Top