RTL Support ARway App
Summary
In Unity, RTL (Right-to-Left) text is not supported by default and requires additional code or a Unity package to function properly. RTL support is included in Unity 6 (currently in beta); therefore, if the app is updated to this version in the future, RTL support will be included by default:
Adding RTL support directly to the ARway app could complicate development and maintenance with the inclusion of additional packages. Instead, providing instructions for implementing RTL support in our documentation allows developers who need this feature to tailor their setups, keeping the ARway app more efficient.
Using Unity Packages
For each of these Unity packages, the font used by the ARway app, Poppins, would need to be replaced with one that supports RTL text.
Package #1
This Unity package provides a new alternative component to the basic TextMeshPro in Unity. Each game object's Text component can be replaced with the new RTLTMPro component to add Arabic text.
Package #2
This Unity package adopts an alternative method by converting the existing text components to work with RTL writing systems.
Implementation using - Unity3DFarsi
Creating a New Script to Make the Components RTL
In the folder Assets\ARWay\ViewerMode\2_Scripts\, create a new script file called MakeRTL.cs. The script file's content is as follows:
Attaching the Script MakeRTL.cs to a Game Object
In the Dashboard-SDK and ARMapSession scenes, open the folder Assets\ARWay\ViewerMode\0_Scene\.
Create a new empty game object.
In that game object, "Add Component" and select the "MakeRTL" script you created.
Setting the Locale to Arabic
In the file Assets\ARWay\ViewerMode\2_Scripts\Localization\LocalizeManager.cs, modify the function at line 34 to be:
Next, select the text objects to add the Arabic text.
Output:
Conclusion
As including RTL support requires the installation of an additional Unity package, it would be advisable to include information about RTL text support in the documentation.
Last updated