Search Unity

Invalid AABB inAABB - Using underline on a custom font

Discussion in 'UGUI & TextMesh Pro' started by VoodooDetective, Apr 20, 2021.

  1. VoodooDetective

    VoodooDetective

    Joined:
    Oct 11, 2019
    Posts:
    239
    I'm getting the following error whenever I toggle underline for a custom font:

    Code (CSharp):
    1. Invalid AABB inAABB
    2. UnityEngine.StackTraceUtility:ExtractStackTrace ()
    3. TMPro.TextMeshProUGUI:GenerateTextMesh () (at Library/PackageCache/com.unity.textmeshpro@2.1.5/Scripts/Runtime/TMPro_UGUI_Private.cs:4444)
    4. TMPro.TextMeshProUGUI:OnPreRenderCanvas () (at Library/PackageCache/com.unity.textmeshpro@2.1.5/Scripts/Runtime/TMPro_UGUI_Private.cs:1670)
    5. TMPro.TextMeshProUGUI:Rebuild (UnityEngine.UI.CanvasUpdate) (at Library/PackageCache/com.unity.textmeshpro@2.1.5/Scripts/Runtime/TextMeshProUGUI.cs:216)
    6. UnityEngine.Canvas:SendWillRenderCanvases ()
    Is there some extra step required when you create a font to allow for underline?
     
  2. Stephan_B

    Stephan_B

    Joined:
    Feb 26, 2017
    Posts:
    6,595
    Any change you can provide the font file and steps to reproduce this issue?
     
  3. VoodooDetective

    VoodooDetective

    Joined:
    Oct 11, 2019
    Posts:
    239
    I think I figured it out. So this particular text was rotated -90 degrees. I was using anchor points to make sure the text fit inside the parent exactly. So some of the anchor points had negative values. I guess TMP didn't appreciate that. So instead, I'm expanding the text to fit the parent by directly manipulating the deltaSize.