Search Unity

TextMesh Pro Multi fonts still supported?

Discussion in 'UGUI & TextMesh Pro' started by ciathyza, Feb 19, 2019.

  1. ciathyza

    ciathyza

    Joined:
    Aug 16, 2015
    Posts:
    112
    Are multi fonts in same text field still supported? If so, is there anything else that needs to be done other than having the SDF fonts/materials ready and use them in font tags in the text? Because it's not working for me.
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    It is indeed still supported.

    In order to be able to load resources at runtime, these resources must be placed in a Resources folder and at the location specified in the TMP Settings. The default location for font assets is "Resources/Fonts & Materials/..."
     
  3. ciathyza

    ciathyza

    Joined:
    Aug 16, 2015
    Posts:
    112
    This was the missing info, thanks!
     
  4. ciathyza

    ciathyza

    Joined:
    Aug 16, 2015
    Posts:
    112
    If I could make a suggestion about the naming convention ...

    Would it OK to change the "Resources/Fonts & Materials" folder name to "Resources/SDF" in a future version instead?
    The rationale is that "Fonts & Materials" is rather ambiguous a I assume that the path set in the TMPro settings searches trough all folders under resources it finds by the set name. So I could make a folder named "SDF" under my own framework/project resources folder and TMPro picks up additional fonts from its own SDF folder and also from my SDF folder.
     
  5. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    TextMesh Pro will search for Font Assets and Materials in whatever location you specify in the TMP Settings. If your project contains 4 Resources folder with sub folders matching the same name then it will look through all of those.

    "Resources/Fonts & Materials/..." makes it pretty clear what is contained in that folder.
     
  6. ciathyza

    ciathyza

    Joined:
    Aug 16, 2015
    Posts:
    112
    Sorry but I disagree. The name isn't very clear, it's ambiguous. "Fonts" could mean any fonts, not only SDF fonts, "Materials" could mean any materials, not just SDF font materials.

    The reason why I'm asking for this request is this use case scenario:

    Releasing a framework as a Unity asset that uses several dedicated SDF fonts and I don't want users of it having to change the TMPro settings for it and I think a default-named folder for SDF fonts and materials would better be "SDF". That would be very clear to any user.
     
  7. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    This "Resources/Fonts & Materials" may also contain font assets and materials that are using Bitmap render modes so it should not be specific to SDF.

    To be more specific, this folder could be named "Resources/Font Assets & Material Presets" which is exactly what this folder is expected to contain. But since TextMesh Pro is the only tool using "Resources/Fonts & Materials", I feel that making this folder name longer is not necessary.

    I understand that if you are making an Asset / tool that you expect to provide via the Asset Store, that unlike normal users who can change this default "Resources/Fonts & Materials" in their TMP Settings, that in your case, you cannot / should not change their TMP Settings and as such have to follow the "Resources/Fonts & Materials" convention in your own package and the Resources folder it may contain.
     
  8. ciathyza

    ciathyza

    Joined:
    Aug 16, 2015
    Posts:
    112
    Well OK, it's a minor issue but I can live with the current naming convention. In this case I place all fonts, incl. non-SDF into that folder.
     
  9. atulvi

    atulvi

    Joined:
    Oct 28, 2020
    Posts:
    35
    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]
    GeneralCurrency.png