Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Question Best practice for using different fonts for different languages?

Discussion in 'Localization Tools' started by Peter77, Nov 18, 2022.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,324
    I wonder what's currently considered best practice to support different fonts for different languages. I'm using TextMesh Pro and the Localization package.

    A few years ago, I asked the TextMesh Pro developer the same question (see here), but since almost 3 years have passed and with the existence of the Localization package, I guess it's already supported out-of-the box somehow?

    My current approach is basically to assign the font asset to the font component at runtime, depending on the active language. This gets ugly the more font materials you have, because these must be switched too.
     
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,049
    We don't have anything other than using the localized property variants which it sounds like you are doing. You could set up the text as a prefab and then use that everywhere so you don't have to set the fonts up each time, just do it for the prefab.
     
  3. mrCharli3

    mrCharli3

    Joined:
    Mar 22, 2017
    Posts:
    810
    I dont really understand this, what do you mean create a prefab? For what?

    Kind of blows my mind that I cant change the font easily in a localization package, literally every asset on the store provides this function.
     
    Last edited: Nov 25, 2022
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,049
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,049