Search Unity

Question Preferred Width uses max font size

Discussion in 'UGUI & TextMesh Pro' started by TheValar, Mar 4, 2021.

  1. TheValar

    TheValar

    Joined:
    Nov 12, 2012
    Posts:
    760
    I've run into some use cases where I have auto-sizing text in a layout where I want to use the text's preferred width. The issue is that the layout constrains the height of the text element thus reducing the "actual" font size but the preferred width has already been calculated based on the maximum font size.

    Is there any workaround for getting this kind of behavior?