This plugin adds multi-lingual support to "TextMeshPro" Unity plugin.
You need to have TextMeshPro
plugin in your project if you have unity 2022 or older. You can install TMPro via Package Manager
.
Currently Arabic, Farsi and Hebrew are supported. If you find an issue with one of these languages or want support for another RTL language, open an issue. In this version of UTB, we're building upon the foundation laid out in the previous repository, enhancing it to support more languages and addressing minor bugs for a smoother user experience. A significant change involves renaming TMP log names for better practicality.
Looking for maintainers. Send email to solisadeq@gamil.com
-
Language Support: We're expanding language support to ensure a wider range of users can benefit from UTB. Whether it's English, Persian, or any other language, UTB strives to provide a seamless text input experience.
-
Bug Fixes: We're squashing minor bugs to enhance UTB's stability and reliability. Your experience with UTB should be smoother than ever before.
We welcome contributions to UTB! If you have ideas for improvements or want to fix bugs, feel free to submit pull requests. Together, we can make UTB even better.
Note: The documentation below requires updating to reference the new RTLTextMeshPro.
RTLTextMeshPro is a powerful component designed to support right-to-left (RTL) text, particularly for languages such as Persian. With RTLTextMeshPro, you can seamlessly integrate RTL text input into your Unity projects.
Features:
- Automatic RTL Detection: RTLTextMeshPro intelligently detects RTL text, ensuring proper rendering and alignment.
- Language Support: RTLTextMeshPro supports languages with RTL scripts, providing a versatile solution for diverse text input needs.
- Customization Options: Tailor RTLTextMeshPro to your requirements with options to preserve numbers, enable Farsi script support, fix tags, and force fixes as needed.
Usage:
- Attach RTLTextMeshPro to your TextMeshPro text component in Unity.
- Customize the component properties to suit your requirements, such as preserving numbers or enabling Farsi script support.
- RTLTextMeshPro will automatically handle RTL text rendering, ensuring a seamless experience for users.
We're committed to continuously improving UTB to meet the evolving needs of our users. Stay tuned for future updates, including additional language support and feature enhancements.
You don't need to convert, copy and paste texts. Start writing and texts will be converted right away.
All Text Mesh Pro
and RTL Text Mesh Pro
's tags are available in UTB - Universal Text Box
.
Multi-Lingual InputField (See known issues)
Realtime InputField is supported.
Multi-Lingual Dropdown (See known issues)
Yes, This plugin has no problem with multi-Line in multi-lingual texts.
Auto Font Size is fully supported.
more languages are in order.
Arabic tashkeel are supported.
You can insert Zero-Width No-Joiner character with Ctrl+Shift+2 hotkey.
- You need to have
TextMeshPro
plugin in your project. You can install TMPro viaPackage Manager
if you're using 2022 or older but there is no need for 2023 and newer versions.
Download the latest unitypackage file from the releases section and import it into your project from "Assets -> Import Package -> Custom Package..." menu in Unity.
SadeqSoltani maintains a package manager version of this repo on OpenUPM.
In Project Settings window, add OpenUPM as a scoped registry or if you have already added it, add the new scope to it.
Then in Package Manager window, change scope to My Registries. Select "RTL Text Mesh Pro" package and press Install.
The sample scenes and demo resources (fonts, shaders, etc.) are included in the package as a .unitypackage file. You need to import those into your Assets folder to use them. From the project window navigate to the package folder and double click "RTLTMPRo-demo-resources" file to import these assets into your project.
- Open one of the range files in
Assets/UniversalTextBox/Ranges/
folder using your favorite text editor. - Make sure you have copied the ranges that you want to use.
- Open the
Window/TextMeshPro/Font Asset Creator
window in Unity. - Assign your font in the
Font Source
field (ensure your font supports RTL characters). - Set
Character Set
toUnicode Range
. - Paste the copied ranges inside the
Character Sequence (Hex)
field. - Press the
Generate Font Atlas
button and wait for it to generate the atlas file. - Press the
Save TextMeshPro Font Asset
button and save the asset. - Use the
GameObject/UI/* - UTB
menu to create Multi-Lingual UI elements, or replaceText Mesh Pro UGUI
andRTL Text Mesh Pro
components withUTB - Universal Text Box
. - Assign your font asset to the
Font Asset
property in theUTB - Universal Text Box
component. - Enter text in the
UTB INPUT BOX
section.
When checked, English numbers will be converted to Farsi numbers. When unchecked, English numbers will be converted to Arabic numbers.
When checked numbers will not be converted.
RTL Text Mesh Pro does not fix texts that start with English characters.
Checking this checkbox forces RTL TextMeshPro to fix the text even when it starts with English character.
Multi-line English texts will have problem on components that have ForceFix
checked.
When checked, RTL Text Mesh Pro will try to fix rich text tags.
- Fixed in latest version. For older versions follow the steps below
We need to override the
text
property ofTextMeshProUGUI
. But thetext
property is not definedvirtual
. You need to manually make the property virtual.
Special Thanks to:
- pnarimani
- hk1ll3r All contributions are welcomed. Just make sure you follow the project's code style. also if you want to use RTL ONLY visit pnarimani or hk1ll3r. If you have any issues leave your comment here and if there was any question or contribution to Universal Text Box contact me on: solisadeq@gamil.com
Your feedback is invaluable to us! If you encounter any issues or have suggestions for improvement, please don't hesitate to reach out. Together, we can make UTB the best text input solution for Unity projects.
Thank you for choosing UTB - Universal Text Box!