About UI fonts

I am learning to create UI.
I added a font and made some changes.
But for some reason, I can’t get it to the right size using “Size To Content”.
I want to do something about the space above the font.
What should I do?

UI作成の勉強をしています。
フォントを追加し、変更をしてみました。
しかし何故か「Size To Content」を使用してもぴったりのサイズになりません。
フォントの上にスペースができてしまうのを何とかしたいです。
どのようにすればよいでしょうか?

There’s a Margin option for text, it’s under Advanced → Margin in the Details Panel. You can adjust the top margin to remove the space above the text.
image

1 Like

Thanks for the reply.
Do you mean that I have to add Margin for some types of FONT?
Like when I imported the font, the Margin is 0.
I am wondering because with English font, this blank space is not possible.

Yes, the blank space around the text depends on the Font. The initial bounds (the green rectangle) is calculated based on the Font. You can use margin to increase or decrease the size of the bounds.

So, if you adjust the margin for the current font, but later change the font, you’ll have to adjust the margin again to match that font.

1 Like

I see.
Can I center it relative to the size of the text box?

I Don’t think so.
You could try changing settings in the Font asset itself, found this in the docs:

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.