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.

TextMesh Pro Ascent Line Fix at Generation

Discussion in 'UGUI & TextMesh Pro' started by MeronSuki, Jun 27, 2022.

  1. MeronSuki

    MeronSuki

    Joined:
    Jan 4, 2022
    Posts:
    2
    TextMeshPro v3.0.6

    I'm having an issue where the Ascent Line for the text asset is too high compared to the default font given by TextMeshPro (LiberationSans). I am generating it with default settings. (CTRL+SHIFT+F12)
    While I can fix this issue manually, I was wondering if there was some setting that I could save me the trouble of doing this for every font. Perhaps there's a simpler change?
    *LiberationSans on the Left, NotoSans on the Right
     
    Last edited: Jun 27, 2022
  2. rhys_vdw

    rhys_vdw

    Joined:
    Mar 9, 2012
    Posts:
    84
    How did you visualize the lines?
     
  3. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    @MeronSuki My apology for missing you posting back in June.

    There is no property or setting to override the face metrics of a fallback font asset to match those of the primary.

    As you stated, this is normally done manually but now that you bring this up, I could see a use case for this. This new feature would be controlled via a new property in the Extra Settings of a text object where if enabled, it would match the metrics of the primary font asset.

    This would be set on a per text object basis as we would not want to alter the face metrics of the fallback font asset as it might be used with more than one text object using different primary font assets.

    This is an interesting idea.
     
    MeronSuki likes this.
  4. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    6,588
    Included in the TMP Examples & Extras, there is a script called TMP_TextInfoDebugTool.cs which can be added to any text object. I created this tool to enable me to visualize the content of the textInfo and indirectly metrics of any given font asset.

    Below is an example of some text in the scene view with Show Characters enabled.
    upload_2022-8-23_23-50-8.png

    Below is the name of the script and what properties are available on it.

    upload_2022-8-23_23-50-55.png
     
    rhys_vdw likes this.
  5. rhys_vdw

    rhys_vdw

    Joined:
    Mar 9, 2012
    Posts:
    84
    Thank you!