Skip to main content
Zui
Senior
Jun 20, 2019 9:02 AM UTC
Solved

Change Font

Is there any way to change font of an application? I have a button that change the application style( buttons image ecc) but i need (graphic guy want) also to change the font, size and colout of the text. Is it that possible?

This topic has been closed for replies.
Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Jun 20, 2019 6:59 PM UTC

Hi @Zui​,

Yes. If you go the texts tab in TouchGFX designer you'll see that you associate specific fonts with "typographies". You reference these typographies when you create static texts or wildcard texts. So when you use these text ids in your text areas in code (generated for you based on text definitions) the font which was used to generate the glyphs is implicit.

Take look at the Texts tab in the designer and you should see what i mean.

EDIT: Check out this tutorial step on adding text: https://touchgfx.zendesk.com/hc/en-us/articles/205587571-Step-3-Adding-Text.

The color is changed programatically. TextArea::setColor(colortype). So, you see, fonts are just referenced behind the scenes to tell the fontconverter where to find the glyphs. You will only ever interface with the "names" that you give each text string.

e.g.

myTextArea.setTypedText(TypedText(T_MY_STRING_NAME));

/Martin

6 replies

Martin KJELDSEN
Martin KJELDSENBest answer
Principal III
Jun 20, 2019 6:59 PM UTC

Hi @Zui​,

Yes. If you go the texts tab in TouchGFX designer you'll see that you associate specific fonts with "typographies". You reference these typographies when you create static texts or wildcard texts. So when you use these text ids in your text areas in code (generated for you based on text definitions) the font which was used to generate the glyphs is implicit.

Take look at the Texts tab in the designer and you should see what i mean.

EDIT: Check out this tutorial step on adding text: https://touchgfx.zendesk.com/hc/en-us/articles/205587571-Step-3-Adding-Text.

The color is changed programatically. TextArea::setColor(colortype). So, you see, fonts are just referenced behind the scenes to tell the fontconverter where to find the glyphs. You will only ever interface with the "names" that you give each text string.

e.g.

myTextArea.setTypedText(TypedText(T_MY_STRING_NAME));

/Martin

Martin KJELDSEN
Principal III
Jun 20, 2019 7:46 PM UTC
Zui
ZuiAuthor
Senior
Jun 21, 2019 8:55 AM UTC

maybe i wasn't clear enough, i know how to change text font in touchGfx designer, but i need to change fonts with a button, programmatically