Search Unity

TextMesh Pro Issue with pixel font

Discussion in 'Unity UI (uGUI) & TextMesh Pro' started by PhilippCh, Mar 12, 2018.

  1. PhilippCh

    PhilippCh

    Joined:
    Jun 14, 2013
    Posts:
    16
    Hi there!

    (using Unity 2017.1.2f1 with TMP 1.0.54)

    After many hours of unsuccessfully fiddling with TextMeshPro's font settings, I've yet to achieve a proper look for my font.

    I've read through all suggestions regarding pixel fonts, including http://digitalnativestudios.com/forum/index.php?topic=1381.0

    The font I've chosen is Coder's Crux 2 (https://www.dafont.com/coders-crux-2.font), a 16px font. It works fine with Unity's built-in Text component, but importing the font as a bitmap font into TMP gives me the following result:



    My import settings should be fine (according to the forum post linked above):





    I've added the text component to a blank GameObject in a new Canvas set to pixel-perfect screen overlay.

    Additionally, sprites I've designed at 16x16 resolution only turn up in full resolution once I crank the font size up to 32, if that's of any concern.

    It'd be great if someone could help me out!

    [EDIT]

    I just found out that changing the aspect-ratio of the game preview window to 4:3 (e.g. 1024x768) fixes the issue. Could this be somehow related to my Canvas Scaler?

    Cheers
    Philipp
     
    Last edited: Mar 12, 2018
    Eater_Games likes this.
  2. Stephan_B

    Stephan_B

    Unity Technologies

    Joined:
    Feb 26, 2017
    Posts:
    3,603
    In order to render correctly, bitmap fonts (pixel fonts) have to be rendered at 1:1. So using a Canvas Scaler could certainly have an impact on this.
     
    Linkbyte likes this.
  3. PhilippCh

    PhilippCh

    Joined:
    Jun 14, 2013
    Posts:
    16
    Thanks for the quick answer! Turns out pixel fonts don't render well in the Editor's Free Aspect mode. Is that something you've encountered as well?

    In the standalone player, any aspect ratio renders fine.