cancel
Showing results for 
Search instead for 
Did you mean: 

Force LTR text orientation

MKsen.1
Associate II

Hi all,

I am struggling how to force a LTR text direction from a certain point onwards. For example in the image the version is written backwards as the first text has a RTL direction. I saw that it exists a specific LTR Marker with a code U+200E but I am not sure how to use it with a buffer. Whatever I tried was not working. Any Ideas?

Here is a also a copy of this code that places in text and version number.

// Convert to touchGFX and display it
  Unicode::UnicodeChar appVersion[verAndMacLen];
  Unicode::strncpy(appVersion, verAndMac, verAndMacLen);
  Unicode::snprintf(infoAreaBuffer, INFOAREA_SIZE, "%s\n%s", touchgfx::TypedText(T_DEVICE_FW_VERSION).getText(), appVersion);

0693W00000KboqfQAB.png

2 REPLIES 2
Yoann KLEIN
ST Employee

Hello @MKsen.1​ ,

Text markers are not supported in TouchGFX.

What I could recommend to you is to create 2 TextAreas placed at the same position on the screen.

Then, enable wildcards and put your RTL text in one of them, and your LTR text in the other one.

Please look at this documentation if you are not familiar with the use of wildcards.

After that, you can use the setVisible(bool) method to show the appropriate orientation of your text.

Hope that this helps,

/Yoann

Yoann KLEIN
ST Software Developer | TouchGFX
MKsen.1
Associate II

Hi,

I thought of that, but then again this text field is used for 40+ languages and it is a dynamic + I implemented it to be upwards scrollable if the text does not fit + all of the automatic tests would need to be updated. The workaround I have come up with is it to reorder the string to 51(P)-1.0.5, which is at the end displayed as 1.0.5-51(P). It is not perfect, but still usable.

Regards,

Matej