Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Sylafrs · Aug 23, 2013 at 09:21 AM · characterfonttextmeshnameunicode

How to Get a Char from his name ?

Hi,

I'm trying to type arabic strings within a TextMesh (font : arial Unicode MS). The problem is that Unity don't use the right characters : it always use Isolated form.

Is there a way to get a character from his name ? (exemple : ARABIC LETTER TTEHEH MEDIAL FORM)

Thanks in advance :)

Comment
Add comment · Show 4
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Linus · Aug 23, 2013 at 12:39 PM 1
Share

See this question

http://answers.unity3d.com/questions/343716/how-to-write-in-arabic-in-unity-.html (But that is more about displaying it on the screen)

and http://docs.unity3d.com/Documentation/Components/class-Font.html it has a section about Unicode support

I do not understand what you mean by from his name. Do you mean getting a character from a string?

avatar image Sylafrs · Aug 23, 2013 at 12:47 PM 0
Share

Thank you for your comment :)

Yeah that's it : Each character has a 'name' : http://www.unicode.org/charts/PDF/UFB50.pdf

And I wanted to know if it was possible to get the good character from the string (maybe I should create my own dictionary from these lists (look at ranges : http://en.wikipedia.org/wiki/Arabic_alphabet ))

For RTL Converter, i've already seen it, I wanted to try something before buying it, but it's not expensive, so I think I will buy it..

Edit : (no i don't want to convert a one-letter string to a char :p)

avatar image Linus · Aug 23, 2013 at 01:55 PM 1
Share
 #pragma strict
 
 
 function Start () {
     var txt : Text$$anonymous$$esh = GetComponent(Text$$anonymous$$esh);
     var rawString : String = "ææå أنا العبارة العربية";
     var endString : String = "";
     var utfInt : int;
     
     for (ch in rawString){
         utfInt = System.Convert.ToInt32(ch);
         endString += Char.ConvertFromUtf32(utfInt);
         Debug.Log(utfInt.ToString()+" "+ Char.ConvertFromUtf32(utfInt) );
     }
     
     txt.text = endString; 
 }

Did some testing, this worked for me. I can not verify how the Arabic text turned out. But the letters æøå I am familiar with.

I made this by using the examples at:

http://msdn.microsoft.com/en-us/library/ww9t2871.aspx and http://msdn.microsoft.com/en-us/library/system.char.convertfromutf32.aspx

If I am way off here, I apologize. And hope someone can give a better answer.

I also found a free package that might be worth a look into http://u3d.as/content/abdullah-konash/unity-arabic-support/2B8

avatar image Sylafrs · Aug 23, 2013 at 02:07 PM 0
Share

Don't worry, thanks for your answers :)

I've tested Char.ConvertFromUtf32 before to print the characters I have in my font, and it worked.

But my goal is to get these characters from their name (not code) in order to give the initial/medial/final or isolated forms to the characters (the names seems to have a little standard, that's why I wanted to use them)

I will buy the library, it will be better, but I keep the question open if someone has an idea :)

I think the solution is to create our own dictionary, or to find one..

1 Reply

· Add your reply
  • Sort: 
avatar image
-1

Answer by SkyRamon · Aug 23, 2013 at 12:31 PM

just dont type arabic strings just use English strings

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Sylafrs · Aug 23, 2013 at 12:51 PM 1
Share

If I had the choice :p

I'm currently working on the translation of my game in many languages such as the arabic one ^^

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Dynamic vs Unicode fonts 1 Answer

3D Text Mesh produces wrong letters 1 Answer

Multiple Language Support Not Working in TextMesh Pro 0 Answers

TextMeshPro font behaviour 0 Answers

TextMesh multiplayer/network issue 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges