cancel
Showing results for 
Search instead for 
Did you mean: 

When defining a typography how do you change the character spacing of a font?

GFeen.1
Associate
 
1 REPLY 1
Yoann KLEIN
ST Employee

Hello @GFeen.1​ ,

The short answer is that it is not possible within TouchGFX and that you should use another font.

But, if you really want to modify the spacing of this particular font, you have to open the font.cpp file related to your font and modify it for each character of your text.

For example, that is the .cpp file of my verdana_25_4bpp font :

0693W00000UFWNWQA5.png 

The spacing (called "advance" in TouchGFX variables) is the 7th element of the glyphs list.

So, if I want to modify the spacing of the 6th glyph here, I can increase the 7th element value (here from 17 to 30 for example) :

0693W00000UFWPSQA5.png 

The issue with this method is that every time you will change the text content (add or remove a character), it will overwrite this file again, so it is more a work-around than a real solution.

That's why I strongly recommend you to simply use a different font.

Hope that I answered the question.

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX