imported font(s) : bold style looks like compressed

Hello every one,

i’ve a problem when I import font in unity.

Every time i put the bold style to my guiText (by inspector or with < b >), it looks like compressed, with no space between letters.

No problem at all with default font (arial)
[18656-font+problem.png|18656]

Does anybody allready have this problem and find a solution ?
since it’s impossible to change Font in ONE GUIText, it cause me a lots of problem.

Thank you in advance.

a simple solution is to import the bold version of the font as an individual font. if you’re on windows you can dig it out of C:\Windows\Fonts

Try using a bold version of the font:

EDIT:

Ok try this: [18669-text+example.zip*_|18669]

Its a script that will allow you to mix bold and normal fonts. Its something i just knocked up so feel free to optimise/improve. [18670-screen.png*_|18670]

using UnityEngine;
using System.Collections.Generic;

public class ScriptText : MonoBehaviour
{
    public string label;

    public Font normal, bold;

    public void OnGUI()
    {        
        // Split the string into normal/bold The first item will be normal, then bold alternating
        string[] split = label.Split( new string[] { "<b>", "</b>" }, System.StringSplitOptions.None );

        GUI.skin.label.alignment = TextAnchor.LowerLeft;

        // Normalised coords
        Rect labelRect = new Rect( transform.position.x * Screen.width, transform.position.y * Screen.height, 0, 30 );        

        GUI.skin.font = normal;
        for( int i = 0; i < split.Length; ++i )
        {
            if( i > 0 && !split*.StartsWith( " " ) )*

{
split = " " + split*;*
}

GUIContent labelGC = new GUIContent( split );

// Calculate the size of this item
Vector2 sz = GUI.skin.label.CalcSize( labelGC );

// Size of draw rect
labelRect.width = sz.x;

// Draw
GUI.Label( labelRect, labelGC );

// Move our rect along
labelRect.x += sz.x;

// Toggle fonts
GUI.skin.font = GUI.skin.font == normal ? bold : normal;
}
}
}
*
*

thank you for your anwsers,
but i want to use normal AND bold at the same time in ONE GUIText like this :
[18660-font+problem2.png|18660]

all the TTF Style are imported, but since we can’t change font on the same GUIText, i can’t use the bold version…

What can i do ?

Thanks again for your help !