Search Unity

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,609
    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:
    8,281
    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:
    976
    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:
    8,281
  5. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    8,281