0
\$\begingroup\$

I made my pixel font and imported it into Unity using TextMeshPro. It works perfectly everywhere except InputFields. When I change Font Asset to my font, the input looks like in the picture. I don't think that the problem is in font, because it works with text, buttons, toggles and dropdowns perfectly. What might have caused this?

TextSmashPro

I'm trying to use this font (pixel font .TTF).

\$\endgroup\$

2 Answers 2

0
\$\begingroup\$

Downloading the font, applying it to the Font Generator from TextMeshPro and using the resulting font asset works without a problem.

enter image description here

This generates a *SDF.asset file which you can apply to your input field.

enter image description here

The result is this

enter image description here

\$\endgroup\$
1
  • \$\begingroup\$ Also I set character set to custom, render type to Hinted Raster (in unity ttf import settings), in TMP import settings I set font size to 8 and type to Hinted Raster \$\endgroup\$
    – medveed
    Commented Aug 21 at 3:20
0
\$\begingroup\$

I finally fixed it, the problem was with Extra Padding property turned on in TextMeshPro component. With it turned off, everything works as expected.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ Which you did not include in your question \$\endgroup\$
    – Zibelas
    Commented Aug 24 at 7:47
  • 1
    \$\begingroup\$ This is why it's important for questions to contain a Minimal Complete Verifiable Example — all the setup/settings needed to reproduce the problem in a new project. Be sure to include that detail in future so we can be more effective in helping you fix issues. \$\endgroup\$
    – DMGregory
    Commented Aug 24 at 8:10
  • \$\begingroup\$ @Zibelas it is turned on by default \$\endgroup\$
    – medveed
    Commented Aug 26 at 4:40
  • \$\begingroup\$ If that was the only reason, in the answer I linked it should have failed as well since I only used the steps as described. \$\endgroup\$
    – Zibelas
    Commented Aug 26 at 5:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .