Skip to main content
ari_v2
Senior
October 6, 2021
Solved

Show multiple lines in touchGFX text area

  • October 6, 2021
  • 2 replies
  • 1644 views

Hi,

I would like to show dynamic text in text area with wildcard. The text contains the 'new line' character (\n) to jump to next line. for example: "First Line \n Second Line " will be printed to screen:

First Line

Second Line

TouchGFX does not recognize the \n char, so how could this be done?

Thank you

This topic has been closed for replies.
Best answer by ari_v2

Hi, Thanks for reply.

My problem was that the '\n' character was not included in the wildcard range. Setting range to 0x0d-0x7f, solved the problem.

2 replies

Revanth
Associate II
October 6, 2021

Hello,

You can try by assigning the text first to a UnicodeChar using Unicode::strncpy and then write it to the wildcard buffer using Unicode::snprintf.

ari_v2
ari_v2AuthorBest answer
Senior
October 10, 2021

Hi, Thanks for reply.

My problem was that the '\n' character was not included in the wildcard range. Setting range to 0x0d-0x7f, solved the problem.