- Home /
Problem is not reproducible or outdated
How do adjust GUI.Label lineHeight?
I am developing a GUI which uses a ScrollView and inside this scrollView i am displaying several texts. I'm using GUI.Label for displaying these texts, and it is well working on iOS using the imported Arial Unicode Font (i need to support cyrillic etc.).
However, it is using a completely wrong lineheight/linespacing setting so the letters of different lines are too close, partially overlapping.
How can this be fixed? lineHeight is read-only, and I've seen there is a lineSpacing for GUIText however i cannot use this because i'm inside a scroll view, right?
Do you use GUI.Label or GUILayout.Label? Also the different lines, are they generated automatically (by line breaks in the text) or do you use multiple labels? I never had overlapping issues, but i also never used any characters outside the ascii set, so it might be a problem of the font iself. Can you post a simple piece of code which reproduces the issue?
Select font in project and reduce font size and see whether you are getting required effect or you can scale up your label or both.
Answer by franky303 · Sep 25, 2012 at 12:02 PM
I'm using GUI.Label and the problem occurs with both self-defined newlines as well as automatic word wrapping. The font is arial unicode MS and the fonts aren't used in "dynamic" mode but as a font texture, because it is an iOS project. Overlapping happens with both cyrillic letters as well as western letters. I have now developed a workaround: i've written my own word wrapper class and insert enough newlines so it won't overlap anymore. but it only works because the newlines are small enough to roughly adjust the line spacing.
I would suggest to prepare a small test project which reproduces the issue and file a bug report. "Automatic wrapping" should always work otherwise it's pointless.
Yes, that's true! Especially as this is a very annoying issue. - I plan to do this right after passing the deadline for my project!