cancel
Showing results for 
Search instead for 
Did you mean: 

Resource ID vs. Typography or "Using the same ID with different Typography"

jimmii
Senior II

Hi there

Is there a way to have one ID with different Fonts?

I don't see the point in generating the same string multiple times with different fonts. That is event cumbersome with the translation offices who have to translate the same string multiple times.

We use a lot of the same strings in different places in the GUI.

For example I get a String ID from a TCP/PI packet and want to display it on the screen.

The sender of the packet does not care which font / typography is used, but I do, so with our old GUI library I could do something like "show_text(TEXT_ID, FONT_A_30px)"

How can I do that with TouchGFX? Is there a workaround?

Thanks,

jimmii

11 REPLIES 11

Hi Jimmi,

Thanks for the reply can you guide me as to how can I get the function created the custom one

TEXTS GetText(TEXTS baseId, touchgfx::FontId FONT) {
	return TEXTS(baseId + FONT);

when copying this as it is it cant perform TEXTS show error

You have to include:

#include <touchgfx\Texts.hpp>
#include <texts\TextKeysAndLanguages.hpp>