210 views
in GUI Development by
Hi,

I have external string s that use the '\r' as well as the '\n' notation for new line / eol.

Is there a simple modification I can make so '\r' is handled the same way as '\n'?

The error thrown is:

[20.1.2021 13:05:52] Runtime : EMWI ERROR: code: 180, info1: "Application::NotoMedium", info2: 13
For details please visit https://doc.embedded-wizard.de/errors
 

Platform is Raspberry Pi.

Thanks

Phil

1 Answer

0 votes
by

Hello Phil,

There are different conventions how to encode the EOL. Embedded Wizard follows the simple approach of using only \n as EOL sign and it does not provide any functionality to handle with \r. From Embedded Wizard's point of view \r is a regular character code, which should be displayed if found in the text. Since the font Application::NotoMedium is configured without the character \r (code 13), you get the error messages 180. You have following options to handle this:

Option 1: The best is to remove all superflous \r signs (code 13) from the extern string leaving \n as the unique EOL indicator. For this purpose you implement a C loop to process the extern string content sign-by-sign and remove all codes 13.

Option 2: As a quick workaround, you can map the character code 13 to a zero width space sign (code 0x200B). Thereupon Embedded Wizard will process \r as any other regular sign which in this case has no width. For this purpose add the expression 0x200B:13 to the attribute Ranges of the font resource Application::NotoMedium. For example:

I hope it helps you further.

Best regards

Paul Banach

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...