This seems to be fixed when I change line 513 on UILabel.cs from this:
else if (mMaxLineWidth > 0)
{
mProcessedText = mFont.WrapText(mText, mMaxLineWidth / scale, mShrinkToFit ? 0 : mMaxLineCount, mEncoding, mSymbols);
}
to this:
else if (!mShrinkToFit && mMaxLineWidth > 0)
{
mProcessedText = mFont.WrapText(mText, mMaxLineWidth / scale, mShrinkToFit ? 0 : mMaxLineCount, mEncoding, mSymbols);
}
Also, somewhat unrelated: there's somewhat of a bug with the MaxWidth. I had a large font that, due to the scale of it's parent, ended up having a very small max width: I noticed that I was changing the max width between 8-10px and there was no change in the actual size of the font.
Ultimately, the scale for the font was 1.7, which due to line 544 on UILabel.cs:
scale = Mathf.Round(scale);
It was being kicked up to 2.0, and thus, appearing outside of the maxWidth that I desired. Changing
Round to
Floor fixed that discrepancy in that it will always make the font smaller than my max width, and never larger.
This seems like a much more attractive position to be in, if you definitely don't want any fonts jumping outside any UI.