Bi-directional text in Unity TextMesh Pro

微笑、不失礼 提交于 2020-01-06 08:05:33

问题


I have recently discovered the TextMesh Pro in unity and it is amazing but I have 1 issue.

When I write rtl (right to left) text with English text (ltr) the English word gets flip with all the text.

What should I do? Is there a setting that I need to change?

Thanks in advance

Example: as שלום

would be: sa שלום


回答1:


You need this character: ‮

(There's a character there, trust me) ‮don't trust me? ;) ‭ Try highlighting this line.

It's called the right to left mark.

XKCD had a strip about it:

There's also the corresponding Left to Right mark to flip things back again. Actually getting either one in a place where you can copy it is hard, I've had the RTL one sitting in a draft email for years at this point (pretty much ever since that comic), though if I try to send the email, it gets stripped out. Similarly, I've failed four times now to capture the LTR mark to include in this post.

Got it: ‭

HTML ‮ and ‭, extracted from the HTML of this very answer (the numerical values given on wikipedia and two other sites were wrong, or at least, not giving the desired result).



来源:https://stackoverflow.com/questions/52294964/bi-directional-text-in-unity-textmesh-pro

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!