- Home /
[UI Text] Half the font size but still keeping the same line height.
I'm making an in-game coding editor, using UGUI Text, where I want to put line numbers aside, with half font size.
I found it very hard to align the numbers with the full text.
What I have tried is using the >1 line spacing, it works well for a screen size:
However, when I change the screen size, it doesn't work anymore. And I couldn't find any pattern it can be related the screen size or ratio.
A screenshot video: https://monosnap.com/image/6hlaAesiNuJ9IVrrn6p9GXYBOZBWiT.png
I've also tried using getting the line height with this answer and GetPreferredHeight, but seems still doesn't work. Any idea?
Your answer
![](https://koobas.hobune.stream/wayback/20220612182539im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Text Preferred Height not expanding even with content size fitter 0 Answers
Kerning on Fonts Are Wrong 0 Answers
How to setup TextMesh Pro Font Asset to include characters from all languages? 1 Answer
How to generate a typing animation in a Text UI 0 Answers
How to reference a variable in the text(script) component 0 Answers