I’ve been trying to develop a custom rich text solution for UGUI, which is possible to display raw images alongside texts. (TextMesh Pro is probably the best choice for that, but I can’t use it for my project)
In order to do that, I have to use quads to generate space for raw images. To make space perfectly fit the image, I calculated it with font size and cachedTextGenerator.fontSizeUsedForBestFit while in BestFit mode.
The problem is, I couldn’t understand the logic behind fontSizeUsedForBestFit. While using the Canvas Scaler, the value of fontSizeUsedForBestFit can be smaller than Min Size or bigger than Max Size, but it still displays with the correct font size. (I compared it with another text in a different canvas without canvas scaler)
So obviously, the text is displayed correctly, but the space I created for quads is inaccurate or completely wrong.
Does anyone know what caused that difference for fontSizeUsedForBestFit?