Search Unity

TextMesh Pro Disabling emoji

Discussion in 'UGUI & TextMesh Pro' started by magmagma, Jun 21, 2018.

  1. magmagma

    magmagma

    Joined:
    Oct 27, 2017
    Posts:
    41
    Hello.
    What does the "Enable emoji support" option in the TMP settings do? I wrote a string with some emoji characters in a TMP object and I get emoji whether that option is checked or not. If I remove the default sprite asset then the emoji dissapear, but otherwise nothing seems to change. I also tested making a build but it was the same. How is that option intended to be used?

    Also, is it possible to enable/disable emoji on a more particular situation? For example, disable it for some font, enable it for others, or even enable/disable it in a particular TMP object. This could be useful if you have different textboxes in an application and emoji are acceptable in some but not in others.

    Thanks!
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    The "Enable Emoji Support" option needs to be renamed "Enable iOS keyboard Emoji support" which is really what it is.

    Sprites / Emojis contained in Sprite Assets can be referenced by using the <sprite> tag which is completely independent from font assets. In this case, there is no feature to disable the ability to use the <sprite> tag.

    Sprites Assets that contains Sprites to which you have assigned a Unicode value which are assigned in the TMP Settings (as Default Sprite Asset) or assigned to a text object will display those sprites if you reference their Unicode via UTF16 or "\u00FF" (2 hex pairs) or UTF32 "\U00FF00FF" (4 hex pairs). In this last case, if no Sprite Asset is assigned as the Default Sprite Asset or to any text object.

    In terms of control over this, you can via scripting and at runtime assign Sprite Assets to text objects or to the TMP Settings. This would enable to control when it is allows or not on a per text object basis.
     
  3. magmagma

    magmagma

    Joined:
    Oct 27, 2017
    Posts:
    41
    I see! Thank you for the quick response! Now I understand better.