Search Unity

Support RTL languages in Unity Engine

Discussion in 'General Discussion' started by abdosarmini92, Aug 23, 2020.

  1. abdosarmini92

    abdosarmini92

    Joined:
    May 25, 2020
    Posts:
    11

    BEFORE YOU REPLY: I know that there are many scripts and assets for writing in RTL languages, but all of them contain problems and do not support multilingual games. Also, the RTL option in TMP does not work.

    Unity Engine gets bigger and bigger with time. It is the most popular game engine. And a lot of game developers use it to make their games and spread them to the whole world. Unfortunately, there is one problem, which is that it does not support RTL Languages. This is sad, especially since Unity is the most popular engine now, yet it does not support languages such as Arabic, Persian, etc. And other engines such as Unreal Engine and Game Maker support them.

    The image shows how the text should be and how it appears in the Unity engine.

    We write hundreds of lines of code and use scripts only to be able to write in Arabic and similar languages, but we face many errors and obstacles in some cases. For example, we cannot do a multilingual game with Arabic included because the engine not showing the letters correctly, and a lot of other problems.

    So, we ask you to support RTL languages as soon as possible so that we can create games that we can spread to the whole world without exception.

    Thanks, Unity.
     
    Ukounu, neginfinity and angrypenguin like this.
  2. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    Please forgive me for having no understanding of what I'm looking at there... are you saying that both images have the same text content, font, etc. and still display that differently in Unity?

    Either way, while I've no way to evaluate it myself I'm broadly aware of the lack of RTL support and agree it'd be great to address that. It's also perfectly in line with Unity's whole "democratizing game development" thing.
     
    abdosarmini92 likes this.
  3. abdosarmini92

    abdosarmini92

    Joined:
    May 25, 2020
    Posts:
    11
    Yes. In Arabic the letters must be connected and start from the right. But in Unity, the letters are separate and starting from the left.

    I don't think it will be impossible thing to add because RTL already supported in other engines like Unreal or Game Maker.
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,190
    Last I heard a few months ago the TMP development team (@Stephan_B) was working on getting it implemented.
     
    abdosarmini92 likes this.
  5. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,571
    Fonts have a feature called ligatures, which combines multiple characters into a single glyph. Here's a good example:

    upload_2020-8-23_16-43-8.png
    source: https://www.fonts.com/content/learning/fontology/level-3/signs-and-symbols/ligatures-1

    Judging by the mess on the original poster's screen, I'd guess this isn't done by whatever font renderer he is using. That's in addition to right to left layout of letters.

    Freetype library can handle thsi kind of thing, but freetype is full software renderer.
     
  6. abdosarmini92

    abdosarmini92

    Joined:
    May 25, 2020
    Posts:
    11
    This is good !
     
  7. Neto_Kokku

    Neto_Kokku

    Joined:
    Feb 15, 2018
    Posts:
    1,751
    This is supposedly being worked on, not sure in an actual TMP update or if only for the upcoming new text renderer that is supposed to replace it.

    Basically, neither Unity's internal text renderer nor TMP support glyph substitution, which is required for ligature support. Cursive western fonts also don't work properly because of this. The plugins/scripts to work around this perform substitution directly in the text string, using the ligatures' unicode numbers directly.
     
    Deleted User and abdosarmini92 like this.
  8. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,620
    That approach could still be useful though, right? I'm thinking about the insane number of glyphs which might be required if all potential combinations of characters are covered. Some way to create those glyphs dynamicly would surely be desirable, or potentially even required.
     
    abdosarmini92 likes this.
  9. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I will have support for reading / extracting OpenType data from GPOS and GSUB tables in the FontEngine in a future release of Unity 2019.4 or newer. This is internal functionality that TMP will be able to access in the future.

    I am currently adding support for Diacritical Marks in the next release of TMP which will be version 1.6.x for Unity 2018.4, version 2.2.x for Unity 2019.4 and version 3.2.x for Unity 2020.x. However, since the required functionality to read / extract this new font feature data is not available in 2018.4, you will have to define Mark to Base or Mark to Mark records manually.

    I will also be adding support for extracting glyph adjustment data from GPOS tables in this next release of TMP for 2019.4 and 2020.x.

    Support for Ligatures will follow as well as for other font features from GPOS and GSUB tables.

    A preview of these new release should be available within the next 30 days or so.
     
  10. abdosarmini92

    abdosarmini92

    Joined:
    May 25, 2020
    Posts:
    11
    Thank you very much for the hard work you do. That'll be great
    Unity is my favorite engine because it supports 3D and 2D and is easy to use and uncomplicated. I was just missing the RTL language support.
    Thank you very much again for your work.
     
    angrypenguin likes this.
  11. amjaliks

    amjaliks

    Joined:
    Jul 11, 2015
    Posts:
    159
    What is current status for this? There are no previews for 2.2 and/or 3.2 available. Does it mean there is still no support for ligatures and RTL?
     
    Last edited: Apr 2, 2021
  12. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I am still working on those preview releases which were delayed by the previous releases.

    Support for features such as Diacritical Marks will be in those new releases but not the extraction of OpenType data as this is part of Unity itself and not the package.

    This is still planned before these new preview releases come out of preview. Most of the work has been done but I need to get these new releases out first.

    In terms of RTL, I will be exploring making some improvements to support BIDI independently of the OpenType features. This should help improve the functionality of addon such as the RTL plugin as per this thread.

    Unfortunately, everything is taking longer than expected. Improving and providing full RTL support is getting increasingly more important.
     
    amjaliks and Joe-Censored like this.
  13. amjaliks

    amjaliks

    Joined:
    Jul 11, 2015
    Posts:
    159
    Thank you, @Stephan_B, for the status update!

    I'm wondering, are you the only one Unity who works on this?
    Honestly, it is quite annoying to realize that Unity still has no reliable way to display texts in languages that are native for more than 10% of global population.
     
    white_sparrow likes this.
  14. ice_frogN

    ice_frogN

    Joined:
    Nov 8, 2020
    Posts:
    2
    Hope Unity to support RTL language. @Stephan_B