Search Unity

Inconsistent text scaling when changing screen aspect ratio.

Discussion in 'UGUI & TextMesh Pro' started by DanielVanches, Nov 14, 2014.

  1. DanielVanches

    DanielVanches

    Joined:
    Apr 19, 2012
    Posts:
    38
    Hi.

    I noticed if you set the Canvas Scaler to "Scale With Screen Size" and have a text field with it's contents spanning more than one line, the text size varies as it adjusts itself to the new screen size when you change the aspect ratio.

    Is this an expected behaviour?
    Here's a GIF that better explains the situation.

    Cheers.

    text.gif
     
  2. runevision

    runevision

    Joined:
    Nov 28, 2007
    Posts:
    1,892
    Yes, this is expected behavior.

    The text renderer we use in 4.6 is fully bitmap based and can only render fonts in size increments of one whole pixels at a time. So we pick the nearest size for the given Canvas scaleFactor.

    This solution is far from optimal, but it was out of scope to rewrite the text renderer for 4.6. We're planning to replace it with a better approach in a future release.
     
  3. DanielVanches

    DanielVanches

    Joined:
    Apr 19, 2012
    Posts:
    38
    Thanks, runevision. That's good to know.