InputField (and anything that was designed to work with TextMeshProUGUI script) will not work.
Why it doesn’t work? We need to override the text property of TextMeshProUGUI. But the text property is not defined virtual. You need to manually make the property virtual.
Open TMP_Text.cs from TextMeshPro source code
add virtual keyword to text property.
Open RTLTextMeshPro.cs and uncomment the top line where it says //#define RTL_OVERRIDE
Now you can use InputFields (and Dropdowns in future)
Our Input Fields are not working. I followed your steps of making the text virual in TMP_ Text.cs
And then proceed to enable #define RTL_OVERRIDE
on the file RTLTextMeshPro.cs
We keep getting this error when we want to write something on the input field.
IndexOutOfRangeException: Index was outside the bounds of the array.
TMPro.TMP_InputField.GenerateCaret (UnityEngine.UI.VertexHelper vbo, UnityEngine.Vector2 roundingOffset) (at /Users/ghassanbarghouti/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.4/Scripts/Runtime/TMP_InputField.cs:2817)
TMPro.TMP_InputField.OnFillVBO (UnityEngine.Mesh vbo) (at /Users/ghassanbarghouti/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.4/Scripts/Runtime/TMP_InputField.cs:2771)
TMPro.TMP_InputField.UpdateGeometry () (at /Users/ghassanbarghouti/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.4/Scripts/Runtime/TMP_InputField.cs:2716)
TMPro.TMP_InputField.Rebuild (UnityEngine.UI.CanvasUpdate update) (at /Users/ghassanbarghouti/Library/Unity/cache/packages/packages.unity.com/com.unity.textmeshpro@1.2.4/Scripts/Runtime/TMP_InputField.cs:2670)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at /Users/builduser/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/UI/Core/CanvasUpdateRegistry.cs:150)
UnityEngine.Canvas:SendWillRenderCanvases()
Thank you, it’s working almost correctly. One problem I’m having is that I want to display the Arabic ي but instead I’m getting this ى (It’s probably Persian). The Farsi checkbox can’t be turned off, and I’m trying to disable it from the code but it also doesn’t work (It only does when I re-click it while on play mode and on the editor).
Hi
Dear @ the plugin you have written has an issue with HTML tags in Arabic and Persian Texts.
For example texts like the one below:
“سلام” + “<color=#A7DF40FF>” + یونیتی+ “”;
don’t display correctly.
could you please have a check and help me if possible.
When typing Arabic text into the RTL text input box (as shown above), is it possible to make the Arabic text input appear joined together? My question is referring to how the text appears in the Unity editor inspector window - not the rendered TextMeshPro element in the scene view. Please advise. Thanks.
Hi guys,
Sorry for late reply, I have been very busy these days.
There’s a bug in tag detection that it doesn’t detect tags with uppercase characters. It means that you need to write your color codes as #a7df40ff instead of #A7DF40FF.
This bug will be fixed in next release.
No. It’s really hard and complicated to fix the text as you write it.
In order for it to work, we need to track which characters have been fixed and which characters have not so we don’t refix characters.
Hi ,
Thanks for this great plug.
If I have a specific cheater that don’t connect to the other character’s, what can be the problem? is it a missing Unicode? Or something else?
Thanks Dror
Hi,
Please check if you have any compile errors or not. Compilation error causes unity to stop compiling RTLTMPro files.
However, You can add RTLTextMeshPro script to an empty gameobject to turn it into a text gameobject.
If it shows the character as a box it means that the unicode is missing, otherwise it’s more likely that plugin doesn’t know that character. Post the whole sentence and a picture of the character shown correctly.
@drordoit I have tried to solve the linked “Alef Maqsora” problem, the only thing that worked is using a font that the fontAssetCreator can generate the linked Alef Maqsoora character from, the following fonts have worked for me:
-Changa
-Markazi
I think this has to do with the range you set in the fontAssetCreator, so don’t forget to set the following range for the Arabic language:
0600-06FF,0750-077F,08A0-08FF,FB50-FDFF,FE70-FEFF,10E60-10E7F,1EE00-1EEFF
@
Thanks for providing this plugin for free and open sourcing it.
I have a question: how did you manage to get the Auto Font Size feature to work?
Updating the text whenever the Rect-Transform size changes didn’t work for me.
I just wanna know since I’m trying to build a custom solution while relying on the default TMPro component.
Any help would be appreciated.