Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Pixel Perfect not working - fonts distorted

Discussion in 'General Graphics' started by SgtSargeMcFly, Apr 14, 2021.

  1. SgtSargeMcFly

    SgtSargeMcFly

    Joined:
    May 4, 2020
    Posts:
    20
    I'm trying to integrate a pixel font into my UI, but no matter what I can't get rid of this ugly effect created by what I assume are half-pixel positions.

    upload_2021-4-13_23-27-22.png

    It's a pain to read because of how the font weight keeps wobbling around. It's 2 pixels in some places, 1 pixel in others.

    upload_2021-4-13_23-29-36.png

    In the higher-resolution scene view, the font looks more like what I want it to. But I want to make this game at 320 x 240 resolution. From what I understand the "Pixel Perfect" option in the Canvas Renderer was made to solve this problem but it's not changing anything when enabled. I imported the font using RASTER_HINTED mode and put it on a TextMeshPro object. The Canvas' reference resolution is also set to the 320 x 240 resolution I'm working in. I've tried messing with the "Reference Pixels per Unit" but nothing changed.

    Is there anything I could try to get the font to look cleaner and more consistent? Thanks so much in advance for anyone who replies.
     
  2. SgtSargeMcFly

    SgtSargeMcFly

    Joined:
    May 4, 2020
    Posts:
    20
    Just thought I'd bump this thread with some new insight. Viewing the canvas in 2D view helped me visualize the problem.

    upload_2021-4-15_14-44-37.png

    This is a closeup of the character "Y" being printed. It doesn't quite fit in the pixel grid. Even When I try to manually move the pixels into place, I can't put one into place without throwing off another. Is there a solution to this?