Search Unity

Turkish Culture missing characters

Discussion in 'UGUI & TextMesh Pro' started by futurlab_xbox, Mar 26, 2020.

  1. futurlab_xbox

    futurlab_xbox

    Joined:
    Nov 5, 2018
    Posts:
    22
    Hi all,

    We currently use TextMeshPro and i2 localization to show text in our game. We target a few languages, but don't support Turkish. However, if we set an xbox one to Turkish and play the game, the game correctly defaults to English. However, I'm guessing the culture on the device is being set to Turkish. We get these strange results in some of our text, where we expect a capital i (see image).



    Do you know what might be causing this issue? During the generate font atlas process, we include characters scanned from all the text we find in the localisation document. None of the localisation text is in Turkish because we don't support it.

    Do you know if this problem lies with the way text mesh pro is rendering the text with culture in mind, or I2 with the way it's getting the text from our localisation?

    Matt
     

    Attached Files:

  2. futurlab_xbox

    futurlab_xbox

    Joined:
    Nov 5, 2018
    Posts:
    22
    Does anyone have any ideas?
     
  3. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Looks like one of the characters is missing from the font asset / fallback chain. Easiest way to figure that out if to add one dynamic font asset as fallback in there (one that contains Turkish characters and that will tell you what unicode that is and hopefully provide more insight on what is going on.

    BTW: Do you know what character is missing?
     
  4. futurlab_xbox

    futurlab_xbox

    Joined:
    Nov 5, 2018
    Posts:
    22
    Hi Stephan,

    That's what so curious about this. We have english strings ("Show Hints") being rendered perfectly when the xbox one is set to english. But when the xbox one is set to Turkish, we still default to english localisation, containing the normal letter 'i' (in h_i_nts) shows as missing. It's strange.

    Because the "hints" letter i isn't Turkish, I'm confused. And this only seems to happen on xbox one but not on ps4, switch or PC.
     
  5. TheSheyper

    TheSheyper

    Joined:
    Jul 3, 2013
    Posts:
    22
    Hi @futurlab_xbox,

    I don't know if you have found a solution, I had almost the same problem today : our project is entierly in french, but when running it on a turkish windows pc, we had the capital i replace by a space (no fallback font) so to fix this I regenerate the TMP font with this charater added (reference charater : http://www.fileformat.info/info/unicode/char/0130/index.htm)

    @Stephan_B do you know a better solution ? You mentioned a dynamic fallback font ?

    Thanks in advance,
    Jeremy
     
  6. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Adding a dynamic fallback to your primary asset should do the trick as the requested character would get added to the fallback as needed.

    Please be sure to use the latest release which is Preview 8. Preview 9 will be available within the next few days.
     
    toopballgame likes this.
  7. TheSheyper

    TheSheyper

    Joined:
    Jul 3, 2013
    Posts:
    22
    Hi @Stephan_B !

    Thanks for your quick reply !
     
  8. gzckrg1

    gzckrg1

    Joined:
    Jun 24, 2020
    Posts:
    14
    Hi all, I know it's an old thread but I don't think the "Adding a dynamic fallback" will actually solve the problem. Because it doesn't address the core of the problem but simply try to mask it.

    The core of the problem is related to culture settings on the system.
    If the system culture is Turkish (tr-TR), then the uppercase i will be I with a dot or İ. That's very normal as that's how Turkish works. Since your fonts don't have this character, you see blank or strange symbols.

    My guess is that you don't set the culture in your script, so your app uses the default culture setting, which is Turkish.
    In order to overcome this issue, you should set the culture within Unity when the user changes the language or when you start your app.

    Here is an example on how to change culture settings for your unity project.
    Code (CSharp):
    1.         using System.Globalization;
    2.         .......
    3.         CultureInfo culture;
    4.  
    5.         culture = new System.Globalization.CultureInfo("en-US");//change "en-US" to match your app language
    6.         CultureInfo.DefaultThreadCurrentCulture = culture;
    7.         CultureInfo.DefaultThreadCurrentUICulture = culture;
     
    Last edited: Nov 14, 2020
    ASemch and Stephan_B like this.
  9. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The following thread might also be worth reading as it contains additional information.
     
    gzckrg1 likes this.