Search Unity

TextMesh Pro Garbled Text after reimporting Custom Character List - Please help!

Discussion in 'UGUI & TextMesh Pro' started by boadleFTG, Oct 7, 2019.

  1. boadleFTG

    boadleFTG

    Joined:
    Nov 23, 2017
    Posts:
    18
    I've had a long-standing problem with Text Mesh Prop which has cost me a lot of rework, and I'm wondering if I'm missing something obvious...

    When we receive a new batch of localisations from our translators, I export the entire list of required language characters from i2Languages, and paste it into the Custom Character List. I hit 'Generate Font Atlas' and then Save the Asset. The problem is that in doing so, all Face Info values - carefully tweaked to ensure that the font looks good across the whole game - are lost! The means that the rendered text is completely garbled in-game.

    I then have to go through the game and reinput new values all over again. I've had to do this about 5 times now across all 6 of our supported languages. I appreciate that some values will change as there are more characters in the texture, but surely there has to be a better way than this?

    Please help!

    Lewis

    upload_2019-10-7_17-38-53.png

    upload_2019-10-7_17-38-38.png upload_2019-10-7_17-38-53.png
    upload_2019-10-7_17-38-38.png
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Updating a font asset will result in the Face Info as well as the other data like Character, Glyph, Adjustment Pair, etc. to also be updated.

    For instance, if you are adding new glyphs to the font asset, then most likely the Sampling Point Size will change which requires updating the Face Info.

    What specific data in the Face Info are you editing?

    Are you doing this to normalize these fonts so that multiple fonts and fallbacks blend well together?

    Can you post an image of this Garbled text?
     
  3. boadleFTG

    boadleFTG

    Joined:
    Nov 23, 2017
    Posts:
    18
    Thanks for the reply, Stephan!

    (I've realised the garbled text only appears when I save out and then re-import the Face Info values.)

    To answer your question about why we are doing this process... We have about 5 different fonts in our game, and support 8 different languages. I need all the fonts to behave similarly in terms of weight, kerning, leading etc, even though some of them are different font families (eg we have a stylish font for latin languages but use Google's Noto for all Asian languages).

    I can certainly understand why this process of manually adjusting Face Info every time we import a new batch of text is necessary (ie new characters have been added), but it feels like it shouldn't be necessary. Surely there should be a way to have the font asset recreate itself in line with previous values, and the key Face Info values remain consistent? As it stands, I have to spend a day tweaking the values off each font asset every time we import new text. Or am I missing a key setting somewhere?

    Thanks again,

    Lewis
     
  4. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    The challenge here is knowing when to override potential values for any of the data contained in the font asset.

    Furthermore, changes to Sampling Point Size would be very difficult to handle in order to try to preserve and re-compute what these edited values would represent at the new sampling point size. This would also be true for any edits done to characters, glyphs and glyph adjustments.

    I will certainly give some thoughts to this but most likely not something that would be added in the short term unless I figured out some clean / simple way to handle this.
     
  5. boadleFTG

    boadleFTG

    Joined:
    Nov 23, 2017
    Posts:
    18
    Just to follow up on this...

    I also notice the Glyph Adjustment Table, where I spent a long time adjusting the kerning for many character combinations, was lost when I rebaked the font asset. I know you warned me about this, but it's less than ideal, and surely something that could be prevented? I mean, I always want A and Y to kern together at (say) 10% overlap, regardless of how many new characters I introduce to the atlas.
     
  6. boadleFTG

    boadleFTG

    Joined:
    Nov 23, 2017
    Posts:
    18
    It seems to us that you need some kind of round-trip functionality, whereby when the Face Info or Glyph Adjustment data is added, it can be re-exported back to the Font Asset Creator as some kind of algorithm or data, so that it will be carried back into the Font Asset every time it is baked.

    Hopefully you'll be able to figure something out, because we'd be more inclined to go back to using AngelCode as things stand, such is concern around re-working these assets multiple times :(

    Appreciate your responses, Stephan.