Skip to main content
Zui
Senior
June 20, 2019
Solved

Change Font

  • June 20, 2019
  • 6 replies
  • 2726 views

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.
Best answer by Martin KJELDSEN

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
June 20, 2019

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
June 20, 2019
Zui
ZuiAuthor
Senior
June 21, 2019

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