Question about space character

166 views
asked May 15, 2018 in Embedded Wizard Studio by michele.darold
We are some problem with space character handling, using the Editor object when we press "SPACE" in the keyboard insert the NO-BREAK SPACE 0xA0 instead of SPACE 0x20.

The main problem is that some TTF Font haven't this character inside and so we see a missing character in our text view.

There is a reason to use NO-BREAK SPACE instead of SPACE? There is a way to handle this issue and resolve it for all fonts?

Thank you and best regards

Michele

1 Answer

0 votes
answered May 15, 2018 by Paul Banach
 
Best answer

Hello Michele,

you refer to the 'Text Editor' GUI component template. In fact, this component is implemented to use internally the 0xA0 sign instead of the blank 0x20. It is a kind of trick to simplify the implementation. The Text-View used by the component to display the entered text is optimized to automatically eliminate blank signs. Therefore, we replace blanks by the 0xA0 sign, which is not eliminated.

If your font does not contain any glyph for the sign 0xA0, you can configure the font resource to use another glyph instead. For this purpose you have to modify the attribute Ranges of the affected font ressource to map the code 0xA0 to e.g. 0x20. Assuming, the attribute was originally configured with the range 0x20-0xFF, then change it to the following expression:  0x20-0xBF,0x20:0xA0,0xA1-0xFF. For example:

Does it solve the problem?

Best regards

Paul Banach

commented May 15, 2018 by michele.darold
Thank you Paul,

seem to work fine.

best regards

Michele

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

...