Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Letter spacing in Text

Discussion in 'UGUI & TextMesh Pro' started by marf, Sep 11, 2014.

  1. marf

    marf

    Joined:
    Jul 20, 2011
    Posts:
    124
    Hi guys, I'm using the new Unity 4.6 GUI but I noticed a problem with the Text component. I don't find the option of adding space (in pixels) between a letter and the other. Previously I used NGUI and with it there was the possibility to set a certain space between letters.

    I believe that this feature isn't implemented yet because this is a beta!

    Tell me if there's a solution, thanks,

    Marco
     
  2. Stephan-B

    Stephan-B

    Joined:
    Feb 23, 2011
    Posts:
    2,269
    Character Spacing ins't available in Unity 4.6 GUI. However, if you need control over character spacing, check out TextMesh Pro which gives you control over Character, Line and Paragraph spacing as well as Kerning.

    TextMesh Pro does a lot more than that so to learn more about it see the links in my signature or check out this video.

     
    hernan_arga likes this.
  3. Deeperbeige

    Deeperbeige

    Joined:
    May 12, 2013
    Posts:
    17
    GameDevMig, Brathnann and K0ndor like this.
  4. QI

    QI

    Joined:
    Oct 27, 2012
    Posts:
    229
  5. marf

    marf

    Joined:
    Jul 20, 2011
    Posts:
    124
  6. trooper

    trooper

    Joined:
    Aug 21, 2009
    Posts:
    748
  7. Pratap-Dafedar

    Pratap-Dafedar

    Joined:
    Aug 30, 2013
    Posts:
    22
  8. cAyouMontreal

    cAyouMontreal

    Joined:
    Jun 30, 2011
    Posts:
    315
  9. BrunoHGouveia

    BrunoHGouveia

    Joined:
    Mar 13, 2014
    Posts:
    1
    If you do
    '#if UNITY_5_2 || UNITY_5_3_OR_NEWER'
    then you don't have to change it in the next versions (unless you really have to change the code itself).
     
  10. JuLanoiselee

    JuLanoiselee

    Joined:
    Jan 9, 2017
    Posts:
    1
    Still from this code:
    http://pratapdafedar.blogspot.in/2015/10/unity-ui-line-spacing-adjustable.html

    It works well, except I get an error while I'm using it with a text containing more than 2 lines :
    upload_2017-1-9_10-1-34.png

    I fixed it by replacing line 125 :
    Code (CSharp):
    1.  
    2. //lines[i] = this.text.text.Substring(lineInfos[i].startCharIdx, lineInfos[i + 1].startCharIdx - 1);
    3.   lines[i] = this.text.text.Substring(lineInfos[i].startCharIdx, (lineInfos[i + 1].startCharIdx - lineInfos[i].startCharIdx) - 1);
    4.  
     
    Last edited: Jan 9, 2017
    Trungdv likes this.