RTL Arabic problems with rich text
5 years 1 week ago #4030
by nzgreg
RTL Arabic problems with rich text was created by nzgreg
hey Frank,
we're having problems with RTL / Arabic and rich text. It looks like rich text is being reversed when it shouldn't before being applied to a Text Mesh Pro field. We're seeing problems with normal data that has been imported via csv, and trying to use things like prefixes, eg. adding a <sprite name="xxx"> in a prefix doesn't work.
Are you aware of problems like this with the current version v2.8.13f2 and are any fixes being worked on? We've been trying to swap the character ordering depending on LocalizationManager.IsRight2Left etc. but it's whack-a-mole, one problem gets fixed and just shifts problems to another method further down the chain.
Thanks for any info.
cheers,
// greg
we're having problems with RTL / Arabic and rich text. It looks like rich text is being reversed when it shouldn't before being applied to a Text Mesh Pro field. We're seeing problems with normal data that has been imported via csv, and trying to use things like prefixes, eg. adding a <sprite name="xxx"> in a prefix doesn't work.
Are you aware of problems like this with the current version v2.8.13f2 and are any fixes being worked on? We've been trying to swap the character ordering depending on LocalizationManager.IsRight2Left etc. but it's whack-a-mole, one problem gets fixed and just shifts problems to another method further down the chain.
Thanks for any info.
cheers,
// greg
Please Log in or Create an account to join the conversation.
5 years 2 days ago - 5 years 2 days ago #4039
by nzgreg
Replied by nzgreg on topic RTL Arabic problems with rich text
Update: We have tested replacing the I2 Arabic fixer (looks like it was based on
https://github.com/Konash/arabic-support-unity
) with methods from
https://github.com/mnarimani/RTLTMPro
.
The glyphs have slightly better rendering in some cases, some things like text containing paragraphs with \n etc. render in the expected order instead of being fully reversed, and some rich text is preserved instead of being reversed in body copy.
We also added some fixes for using rich text in prefixes and suffixes in the Localize component.
We are still hitting some strange errors like the first time a scene is entered the TextMesh Pro fields are changing from left-aligned to right-aligned in Arabic as expected, but the next time the scene is entered they do not change alignment. I think we are probably hitting an Awake/Start race somewhere with the language selection and I2 checking the language and saving/updating the original and intended alignment of textfields.
The glyphs have slightly better rendering in some cases, some things like text containing paragraphs with \n etc. render in the expected order instead of being fully reversed, and some rich text is preserved instead of being reversed in body copy.
We also added some fixes for using rich text in prefixes and suffixes in the Localize component.
We are still hitting some strange errors like the first time a scene is entered the TextMesh Pro fields are changing from left-aligned to right-aligned in Arabic as expected, but the next time the scene is entered they do not change alignment. I think we are probably hitting an Awake/Start race somewhere with the language selection and I2 checking the language and saving/updating the original and intended alignment of textfields.
Last edit: 5 years 2 days ago by nzgreg. Reason: working around spam protection
The following user(s) said Thank You: UltraRat
Please Log in or Create an account to join the conversation.
4 years 1 month ago #4193
by UltraRat
Replied by UltraRat on topic RTL Arabic problems with rich text
We also just started hitting this problem. So +1 that it should be fixed in I2.
In the end did you have to grab most of RTLTMPro and replacing everything or was it fairly isolated to RichTextFixer?
In the end did you have to grab most of RTLTMPro and replacing everything or was it fairly isolated to RichTextFixer?
Please Log in or Create an account to join the conversation.
4 years 1 month ago #4194
by nzgreg
Replied by nzgreg on topic RTL Arabic problems with rich text
At the moment we are using a few mods to I2 in some places, eg. fixing the handling of prefixes and suffixes on localised text, and we are using the 'fixer' call of RTLTMPro instead of the I2 one to handle reversing and glyph adjusting the final text being applied to TMPro fields.
We also have an editor script to reset the language when stopping else the editor gets confused about language and text field alignment which starts messing things up.
We also have an editor script to reset the language when stopping else the editor gets confused about language and text field alignment which starts messing things up.
Please Log in or Create an account to join the conversation.
Time to create page: 0.153 seconds