2020-02-20 08:20 AM
I have a latin font without chinese symbols and want to show the "Chinese" selection (中文) with a font that contains all chinese symbols but no latin characters and vice versa.
To select just the latin font for the texts that should be shown while chinese font is acitve seems not to work (in excel table)
Also to switch wildcard text field with two wild card settings (chinese / latin) seems not to work too.
e.g.:
CRText.setTypedText(touchgfx::TypedText(T_ALIGNRIGHTTEXT_BIG_WILDCARDID_CHINESE));
or
CRText.setTypedText(touchgfx::TypedText(T_ALIGNRIGHTTEXT_BIG_WILDCARDID_LATIN));
What could I do?
2020-02-20 01:31 PM
Maybe have a second textArea2 with wildcard? Then you can set visibility to true/false to textArea1 and vise versa.
2020-02-21 02:38 AM
I had a similar issue, where we also needed to display both Latin and Chinese from two different fonts, in the same text area.
We ended up merging the fonts into one "super" font using the program FontForge: https://superuser.com/questions/490922/merging-two-fonts
To change font sizes, we change the TypedText just like in your example above, and that works fine, so not sure why that doesn't work in your case.
I know this is simple but just double checking: You of cause have to call invalidate after calling setTypedText to get the screen updated.
CRText.invalidate();
2020-02-21 05:44 AM
There's no way to mix two fonts in one textarea (wildcard or otherwise) at the moment.
You could construct a font that has both chinese and latin characters in it (Using FontForge, e.g.).
/Martin
2020-02-24 03:52 AM
I do not want to mix the fonts in one textarea I just want to switch the wildcard ressource ID from latin to chinese font.
The problem is that wild card ressource does not switch automatically with the language setting but I have to set a fix font there ...
The idea is that I use the same screen design (including custom containers) but with latin and chinese font (depend on language selection)
It seems that if I try to switch it with setTypedText that this does not work correctly.
Also it does not work if I select a different font in the Designer Text table. I only get Chinese font (when Chinese is selected) even if I set the latin font (Selection on the right side of the text entry)
A mix of the fonts in a new font file is not possible because it seems that the typographic horizontal lines are not the same in latin and chinese?
Bernd
2020-02-24 08:49 AM
I still don't understand why you can't you have two textArea with wildcards? One textArea will be right on top of the other textArea. Turn the visibility of one to false while the other visibility is true, and vise versa depending if you want Latin showing or Chinese showing
2020-02-28 12:16 AM
The problem was that it is possible to select a font for the wildcard (TYPOGRAPHY NAME) itself and also for every string in the Chinese language column (CHI-TYPOGRAPHY).
The Excel file is generated by us and the Chinese font was added for the complete language row (CHI-TYPOGRAPHY) therefore also for the wildcards rows (TYPOGRAPHY NAME), including the latin ones.
It seems that the special font selection (CHI-TYPOGRAPHY) overrides the wildcard selection (TYPOGRAPHY NAME)?