Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

UI [Case 744954]ContentSizeFitter clipped custom fonts incorrectly in 5.3.0f1

Discussion in '5.3 Beta' started by sanpats, Nov 16, 2015.

  1. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    1. What happened
    Using UI Scroll View with the content controlled by Vertical Layout Group and Content Size Fitter with some font will clipped the last line incorrectly. In 5.2 it displays correctly.

    2. How we can reproduce it using the example you attached
    Go to Scenes folder in Project tab.
    Load Test Scene 1.unity
    Go to Dialgue UI Canvas/Subtitle Scroll View/Viewport/Content/Text
    If turn on ContentSizeFitter, the text child GO will got clipped and the 2nd line will not shown.
    If turn off ContentSizeFitter and adjust the Text child gameObject, the text will display correctly (2 lines)

    The built-in Arial font works as expect, but Courier Prime Sans that I use won't. A workaround is to set vertical text to allow overflow.
     
  2. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    I sent the font that have issue and give more detail steps to reproduce in Case 746238.

    Courier Prime font family works with 5.2 fine. I test with open-source Liberation font family, that ones work fine. I think there is a height checking issue with Unity UI in 5.3
     
  3. pfreese

    pfreese

    Unity Technologies

    Joined:
    Feb 23, 2015
    Posts:
    85
    This issue is fixed in our development branch and the fix should be in the next 5.3 release.
     
  4. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Thanks
     
  5. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    Hi I tested with 5.3.0f2 that was released earlier today, and the problem is still exist.
     
  6. pfreese

    pfreese

    Unity Technologies

    Joined:
    Feb 23, 2015
    Posts:
    85
    Sorry, I'm not sure why this didn't make it into f2. I'm looking into this.
     
  7. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,301
    Noticed the same thing happens with text in a Layout Element within a vertical layout group. A single line of text will be clipped so that no text appears at all.
     
  8. AndrewChewie

    AndrewChewie

    Joined:
    Mar 23, 2015
    Posts:
    7
    Confirm - Unity 5.3.0f2 has issue with custom font clipping.

    Here is example:
    Button has HorizontalLayoutGroup & LayoutElement on it
    Text Layout properties says that Height/Weight affected by Text, but still it's rectTransform is rezised to "Fit" text, and it's clipped.

    If I change font size it's rectTransform height changes as well, but why?
    and at some point when Font size is 33 - rectTransform height becomes the same as the Button rectTransform height, and it's strange.

    Here is some screenshots:

    font21.png font30.png font33.png
     
  9. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,301
    I feel I should add that most of my game's UI is scrollboxes with Vertical Layout groups containing auto-sized text rows as LayoutElements, which means that in Unity 5.3.0f2 pretty much all of my text has disappeared. So please fix this before actual release, because I'm pretty sure there are a lot of people who have similar UI's that will be quite confused when all of it disappears.
     
  10. sanpats

    sanpats

    Joined:
    Aug 24, 2011
    Posts:
    343
    You can set the texts to allow overflow as a workaround in the mean while.
     
  11. makeshiftwings

    makeshiftwings

    Joined:
    May 28, 2011
    Posts:
    3,301
    True, but I was relying on it being truncated when the text actually was several lines long, so it doesn't really work in my case.
     
  12. fourdesire

    fourdesire

    Joined:
    Sep 26, 2014
    Posts:
    17
    we are facing the same issue with contentsizefilter in 5.3.0f2. Hope next release will fix this issue~~