Search Unity

Pi Symbol Not Showing Up

Discussion in 'UGUI & TextMesh Pro' started by John-B, Dec 4, 2019.

  1. John-B

    John-B

    Joined:
    Nov 14, 2009
    Posts:
    1,262
    Isn't Pi part of the regular character set? I can type it π (option-p) and it shows correctly in the Inspector, but it shows up as a box in TMP text on screen. My font is Helvetica Neue. How can I get Pi (or other Greek letters) to show in TMP?
     
  2. Hosnkobf

    Hosnkobf

    Joined:
    Aug 23, 2016
    Posts:
    1,096
    when you generate a font you have several options which characters to include. You could also specify the letters you want to include directly. Maybe you try this option to see if the character is part of your font.
     
  3. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The Unicode character for Pi is \u03C0.

    Assuming it exists in your source font file, it can be added in the Font Asset Creator by using some of the mode like Unicode Hex Range or Custom Characters, etc. If your font asset is dynamic, the character will be automatically added to the font asset (again assuming it exists in the font file).

    My recommendation to manage additional languages like Greek or Cyrillic whose character sets are still small in terms of quantity of characters, is to create / use a Primary Font Asset that is static and contains the Extended ASCII set. Then create a dynamic fallback which you assign to the primary to capture characters from those other languages.

    Take a look at the structure of the LiberationSans SDF font asset included with the latest releases of TMP. This primary font asset has a dynamic fallback assigned to it. As such if I was to create a TMP text object and type any greek character (available in this LiberationSans font file) those characters will be added to the fallback and displayed appropriately.

    upload_2019-12-9_16-45-17.png