Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Question Font size and Steam Deck

Discussion in 'UGUI & TextMesh Pro' started by Leslie-Young, May 27, 2023.

  1. Leslie-Young

    Leslie-Young

    Joined:
    Dec 24, 2008
    Posts:
    1,148
    I'm trying to get a game verified and the reason it is kept on "playable" is because of font size. How does 12 pixel height at 1280x800 on Steam Deck relate to the font size one can choose for TMP text in the inspector?
     
  2. karliss_coldwild

    karliss_coldwild

    Joined:
    Oct 1, 2020
    Posts:
    612
    Many different things which can influence font sizing.
    Stuff like:
    * font used -> a lot of fonts are very inconsistent with regards to precise sizing and having 3 different fonts all set to the same size will likely give you 3 different results.
    * canvas scaling configuration
    * any intermediate rect transforms with scale that isn't 1
    * material settings adding outline or other effect which influence the shape
    * TMP non canvas component vs TMP Canvas component
    * camera settings (for text that isn't in overlay canvas)

    Instead of trying to manually calculate how all those things add up, best things you can do is just make a screenshot and count pixels. Once you have measured it in a screenshot, you can use it to choose size for other text elements using the same font in similar GUI hierachy. If you have multiple fonts or different kind of text objects (TMP in overlay canvas, TMP in world space canvas, TMP non canvas object) you will have to measure each of them individually required font size for each of them can differ.


    If you don't have an actual steadmeck to test on, you can set the size to 1280x800 in the editor game panel. It should give you quite accurate results. Just make sure you have game panel scale is set to 1x. Also be careful if you are using high DPI monitors. Before counting pixels in screenshot verify that size of whole game area in the screenshot is as big as you expected.
     
  3. Leslie-Young

    Leslie-Young

    Joined:
    Dec 24, 2008
    Posts:
    1,148
    Ye, that is why it is so hard. Did not think of counting pixels though :p

    I tried a 1280x800 in game view before but everything looked very readable and that is why I was not sure what Steam might be complaining about. The "design" res is 1280x1080 and screen match mode set to height in canvas scaler. Using screen-space camera.

    I pushed everything up some more and submitted again. Will see how it goes. Guess best would be to save for and get a Steam Deck at some point to do proper testing.
     
    Last edited: May 29, 2023