Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

TextMesh Pro The Russian letters aren't shown. Instead of them blocks. Help please!

Discussion in 'UGUI & TextMesh Pro' started by MramidK1, Apr 28, 2017.

  1. MramidK1

    MramidK1

    Joined:
    Jul 16, 2016
    Posts:
    6
    Hi, everybody! I apologize for my English) Google the translator)


    2017-04-28_10-38-40.png 2017-04-28_10-38-58.png 2017-04-28_10-38-40.png 2017-04-28_10-38-40.png
    If it is short, then the Russian letters and symbols aren't displayed. I tried to generate shrit via the generator, but also he doesn't see the Russian symbols. Don't prompt as it is possible to solve this problem? I apply screenshots.
     
    Minerva-IT-Solutions and mchts like this.
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    In the Font Asset Creator - Character Set, you have selected ASCII which will only include the ASCII character set in the font asset.

    To include characters for different languages like Russian which uses the Cyrillic character set, you have to include those in your selection. According to the Unicode Chart where you can learn about the Unicode range for all languages, Cyrillic is located in the range of 0400-04FF.

    Here is an example of an SDF Font Asset that I can use as Fallback using Unicode Range 400-4FF which include the Cyrillic set.

    upload_2017-4-28_1-24-10.png

    Please take the time to watch the video about Font Asset Creation as all these options are explained including localization. I also strongly suggest you watch the video about Material Presets which is equally important.

    I also suggest you use SDF 16 or SDF 32 as this will give you the most flexibility and allow you to use Material Presets to define different visual styles for your text.
     
  3. MramidK1

    MramidK1

    Joined:
    Jul 16, 2016
    Posts:
    6
    thanks for the help
     
  4. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    To the creator, respectfully, you are making this way too difficult.

    There are a handful of common languages that should be simple to implement, with standard instructions:

    Extended ASCII (Latin-based languages) + Cyrillic covers 95%+ of games and fonts

    Then separate instructions for Chinese, Japanese, Korean.

    We shouldn't need to hunt down font tables in obscure PDFs.

    So:

    What are the precise settings I need to enter to have Extended ASCII + Cyrillic?

    Edit: Here are the settings that worked for me:

    0000 - 4FF

    Giving English, German, Russian.

    Easy right!? No need to watch a 20 minute tutorial :)

    Edit: you'll probably need a 4k Atlas for this. Zooming in I can see a lot of font simplifcation
     
    Last edited: May 21, 2019
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    If you are using the latest release of the TextMesh Pro package which is version 1.4.1 for Unity 2018.3 and Unity 2018.4 or version 2.0.1 for Unity 2019.x with the new Dynamic SDF support, you simply need to create a dynamic font asset and make sure your select font contains the appropriate characters and that is it.

    If you are using the previous version, you need to define the range of characters you wish to include which would be extended ASCII and then create a fallback font asset that contains the Cyrillic character set which is unicode range 0400-04FF as shown in my previous post. Then assign this Cyrillic font asset as fallback to your primary Extended ASCII one.
     
    irontal likes this.
  6. Rich_A

    Rich_A

    Joined:
    Nov 22, 2016
    Posts:
    338
    Thanks for the reply. I'm using I2 Localisation, so I can just set a separate font.

    I tried with 0000-4FF with a 4K Atlas and 32 render setting, but it crashed the editor.
     
  7. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    0000-04FFF would result in adding a bunch of undesired characters. Each language exists in a given unicode block so it is best to either use the dynamic SDF system (if you don't want to worry about any of this) or to specify the unicode block you really need.

    I realize the learning about Unicode is boring but it is there for a reason.

    P.S. I will consider adding an addition option in the Font Asset Creator to include something like Extended ASCII + Cyrillic.
     
    yuliyF, Skyblade and Rich_A like this.
  8. Skyblade

    Skyblade

    Joined:
    Nov 19, 2013
    Posts:
    77
    Ok, where I can get Arial font with Cyrillic characters? I see only LiberationSans.
     
    Last edited: Jun 6, 2019
  9. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    A good place to look for fonts is Google Fonts where you can select which language you are interested in.

    Commercial fonts such as Arial are available from MyFonts.com where the appropriate license must be acquired.
     
    Skyblade likes this.
  10. Skyblade

    Skyblade

    Joined:
    Nov 19, 2013
    Posts:
    77
    I have similar problem when copying cyrillic text to a clipboard.
    Instead of the text I see some garbage:
    upload_2019-6-9_19-44-11.png
    What's happening?

    If I check scene asset, I can see pretty normal Unicode sequence:
     
  11. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    What text are you copy / pasting? Provide me with the exact text please.

    Can you post an image of the font atlas texture of your font asset or provide me with the font asset and font file?
     
  12. Skyblade

    Skyblade

    Joined:
    Nov 19, 2013
    Posts:
    77
    I'm copying "Текст" string.
    If I paste it into any text field, say, Notepad, it's corrupted.

    Here is the atlas (Arial SDF).
     

    Attached Files:

  13. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I looked at your font asset and everything appears to be working as expected. Copying the text from the input field into Notepad works fine. Copying from Notepad back to the text field works fine on my end as well.

    Can you post images or some video of what you are experiencing?

    What version of Unity and TextMesh Pro are you using again?
     
  14. Skyblade

    Skyblade

    Joined:
    Nov 19, 2013
    Posts:
    77
    I'm using Unity 2019.1.5.f1 (also applies to newer versions up to 2019.3.0a5) and TextMeshPro 2.0.1.
    Here is the sample project below.
    Here is the sample video:
     

    Attached Files:

  15. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Thank you for the video.

    This appears to be a bug in the Editor related to the Copy / Clipboard function. This appears to be an issue introduced at some point in 2019.1 and still present in early alpha of 2019.3 but not in the latest.

    There are a few bug reports about this already. I'll check internally to see when the fix for this will be back ported to previous version of 2019.x.
     
    JavlonFattoev and Skyblade like this.
  16. alex_unity140

    alex_unity140

    Joined:
    Nov 30, 2017
    Posts:
    1
    Same issue with any copy/paste actions and cyrillic symbols in Editor. Using 2019.2.0b7 :(
     
  17. LexaMV

    LexaMV

    Joined:
    Feb 20, 2018
    Posts:
    28
    Hi, I also had this problem before. And I realized that it is easier to set the TestMeshPro characters that I need in Russian. I ask 33 uppercase letters, 33 ordinary letters, 10 digits, and all punctuation, math, etc. Almost always, I do not find 2 - 3 characters, but this is not essential.

    Привет, я то же раньше сталкивался с этой проблемой. И понял что проще задать TestMeshPro символы которые мне нужны в русском языке. Я задаю 33 заглавные буквы, 33 обычные буквы, 10 цифр, и все знаки препинания, математические и т. д. Практически всегда у меня не находит 2 - 3 символа, но это не существенно.
     
  18. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Provided the requested characters are present in the source font file, you can always create / assign a dynamic fallback font asset to the primary font asset. See how the LiberationSans SDF and its fallback are setup in the latest version of TMP which is 1.4.1 for Unity 2018.4 and 2.0.1 for Unity 2019.x.
     
  19. LexaMV

    LexaMV

    Joined:
    Feb 20, 2018
    Posts:
    28
    I don’t know about
    TMP 2.0.1 for Unity 2019.x.))))
     
  20. kumade

    kumade

    Joined:
    Nov 3, 2016
    Posts:
    52
    Speaking of Liberation Fallback. It has letters of Cyrillic alphabet but for some reason it misses the capital Russian "Р" (it looks like capital English "P" but it's not). So every time you have capital Р - it shows a square. Or you have to manually replace all Russian P with English P. I believe that's a weird bug :) I'm on Unity 2019.3.6 btw.
     
  21. vselockov

    vselockov

    Joined:
    May 10, 2018
    Posts:
    10
    Latin+Cyrillic+Underline+Strikeout:
    Unicode Range (HEX)
    0030-007F,0400-04FF
     
    Last edited: Apr 19, 2020
  22. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    I would suggest getting a font editor / tool that will enable you to look at the font file to known exactly what characters and glyphs are present. In this particular, it would enable you to verify if the "P" is in fact missing from LiberationSans.

    It is very common for font files to be missing support for certain languages, having partial support for languages or missing some characters for languages they mostly support.

    There are a lot of font tools available like BMFont, FontForge and High-Logic Font Creator. Font Creator is not free but there is a trial version.

    BMFont is a good tool to quickly check for character and language coverage but I personally use Font Creator which is a much more powerful and sophisticated tool font creation and editing tool.
     
  23. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    322
    I have a problem with Font Fallback and Russian Letters when I use "Uppercase" or "Smallcaps" with TextMeshPro.

    My Font Fallback does use the ume-ugo5 font, which supports almost everything.

    The default text is - Меню

    If I did'nt check the "Uppercase" or "Smallcaps" on the settings it works.

    But it shows a square If I'm using "Uppercase" or "Smallcaps".

    Is this an expected bug?
     
  24. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Just tested with that font file and it appears to be working as expected as seen below

    upload_2020-10-28_13-11-28.png
    Normal, Uppercase and Smallcaps.

    Is your font asset dynamic or static? If it is static, you might not have included those uppercase variant characters in the font asset.

    Here is an image of the Character Table from my dynamic font asset that includes those characters. Check if your font asset contains those unicodes / characters.

    upload_2020-10-28_13-13-43.png
     
  25. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    322
    To make it work, I had to manually select "Unicode Range (Hex)" and then add the code 042E to it!

    I'm using dynamic font and that should not be necessary.

    I normally use "Characters from File" and I use a file text with all my game texts in lowercase and uppercase, but this doesn't worked for me.
     
  26. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Dynamic Font or Dynamic Font Asset?

    Since you are using the Font Asset Creator, I presume dynamic font and not font asset.

    Characters from File would not necessarily include this character unless it was in that list. Lowercase, Uppercase variants are unique characters and thus have to be listed as well.

    Note: To handle similar situations in the future, I would recommend adding a dynamic fallback and assigning to your primary static font asset. This way, this dynamic fallback will be able to handle any potential characters and glyphs contained in that font file without having to specifically add them to your static font asset.

    Make sure the sampling point size to padding ratio is the same between the primary and fallback(s).

    Also make sure to Reset the dynamic fallback prior to creating your build to clear its data which will also reset its atlas texture to size zero where it will not contribute to the build size.
     
  27. irontal

    irontal

    Joined:
    Aug 23, 2017
    Posts:
    10
    This solved my problem, thank you Stephan!
    I added a text with my needed characters (Hebrew here) and it worked like a charm :D
     
    Stephan_B likes this.
  28. Kaldrin

    Kaldrin

    Joined:
    Jul 10, 2018
    Posts:
    45
    Thank you very much this was very useful!
     
  29. atulvi

    atulvi

    Joined:
    Oct 28, 2020
    Posts:
    35
    It works in TextMeshPro.

    Step 01: Download Font
    -----------------------------------

    open the link https://fonts.google.com/ . Click right on corner Browse fonts click. and type the font in search box.
    Font List
    1. Noto Sans [find On Google fonts]
    2. Roboto [find On Google fonts] 3)
    3. Code2000 [But it's not open source.]
    4. Futura
    5. Arial
    Download Family for your favorite font.

    Step 02: Install TextMeshPro plugin
    -----------------------------------------------------
    from Package manager. After copy the font file NotoSans-Regular.ttf and paste to this directory. [Ex. Asset > TextMesh Pro > Resources > Fonts & Materials > paste NotoSans-Regular.ttf file]

    Step 03: Create SDF for font. if any one
    -----------------------------------------------------
    1. **Select NotoSans-Regular.ttf file** and create font asset SDF from menu bar Assets > Create > TextMeshPro > Font Asset OR
    2. Short Cut-> Shift + Ctrl + F12 OR
    3. **Select NotoSans-Regular.ttf file** and click mouse right button and create SDF from Create > TextMeshPro > Font Asset
    1.Currency.png

    Step 04: Add Other font SDF in to your primary or existing font SDF.
    ----------------------------------------------------------------------------------------------------------

    Select primary font SDF and show the inspector go to Fallback Font Assets. Added the NotoSans-Regular SDF in to Fallback list. [Multiple fonts added in to primary font SDF]
    1.Currency.png
     

    Attached Files:

    Futuroller and freyajik like this.
  30. vselockov

    vselockov

    Joined:
    May 10, 2018
    Posts:
    10
    Cyrillic + ASCII Punctuation & Symbols + Numbers: 0400-04FF,0020-007E
     
  31. Minerva-IT-Solutions

    Minerva-IT-Solutions

    Joined:
    Jan 24, 2014
    Posts:
    8
    I have still the same issue. Dont know why it have to be so complicated in unity. is there in 2022 a easy solution? I think localization should be the highest prioty für unity
     
    MaximKom and konsti1994 like this.
  32. Eloren

    Eloren

    Joined:
    Jul 17, 2019
    Posts:
    24
    That is why Legacy Text is superior. How do I even include Ukrainian and Belarusian symbols?

    Also Elipsis does not work, you need to include "2026" symbol for three dots.