Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

TextMesh Pro Mix Fonts together

Discussion in 'UGUI & TextMesh Pro' started by sidespin, Jun 21, 2019.

  1. sidespin

    sidespin

    Joined:
    Jun 22, 2018
    Posts:
    20
    I have Asian fonts for their characters but for the ASCII+ I'd really love to use the English Font. I know I can accomplish that by excluding ASCII+ from the Asian font asset and use English font asset as a fallback. But that would increase draw call.

    Is it possible to create a font asset that sources two different TTF?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,596
    Since fonts almost always have different metrics, it is problematic to try to combine fonts. An atlas texture could potentially be shared by multiple font assets but this quickly leads to management issues of these resources which quickly outweighs the benefits.

    Your best option is to use the fallback system. Using a fallback will increase the draw call but assuming you are only using one fallback, this should only increase the draw call count by 1.

    Mobile devices have come a long way where draw calls are no longer the bottleneck / issue they used to be on ancient devices like an iPhone 3GS for instance. On most mobiles devices now, the difference between 1 and 100 draw call is negligible. Fill rate is much more of an issue now and not draw calls.
     
  3. sidespin

    sidespin

    Joined:
    Jun 22, 2018
    Posts:
    20
    Thanks Stephan for the quick response. I'll continue using the fallback system.
    You're awesome!

    Cheers
     
    Stephan_B likes this.
  4. 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