2020-07-09 02:37 AM
Hello, I want to write time on LCD in format 00:00:00 (hh:mm:ss). I use simple text area object and font I use is Proxima Nova Semibold. But the problem is that text is moving around because each char have different width. I would like to each char stay in the position.
I am new to Touch GFX framework.
I manage to achieve what I need using a monospace font. But I need to use Proxima Nova Semibold.
For now only though I have to write each character separately with different position, but is there some other option?
Thank you!
Solved! Go to Solution.
2020-07-10 11:22 AM
I recently edited a font's numerical characters using Font Forge and generated it as a new monospaced font ttf file and copied this into the assets\font TouchGFX directory.
Font Forge is a free program.
In Font Forge, find the characters you want to change. Right click on them to find the largest width (in my font, this was "0"), and set the width of the rest of the characters you want to change to that value. Then generate the font.
Hope that helps.
2020-07-09 03:17 AM
You can't achieve proper mono-space functionality with a non-mono space font unless you do as you're doing now.
/Martin
2020-07-10 11:22 AM
I recently edited a font's numerical characters using Font Forge and generated it as a new monospaced font ttf file and copied this into the assets\font TouchGFX directory.
Font Forge is a free program.
In Font Forge, find the characters you want to change. Right click on them to find the largest width (in my font, this was "0"), and set the width of the rest of the characters you want to change to that value. Then generate the font.
Hope that helps.
2020-07-13 12:46 AM
Great tip, @scottSD. We also use font forge here. Besides forcing "mono-space", you can also mix and match glyphs even in some of the reserved ranges and reference those, if you want to avoid using multiple TextAreas for a string with mixed regular, italic and bold glyphs. Fontforge gives you a range of options here.
/Martin