Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Line-Height of text (CSS property)

Does anyone know how to set the line-height (which is a CSS property) of text with Titanium?

This is the same thing as leading in traditional graphic design terms.

Right now, the line-height looks terrible on the iPhone, as lines o text in paragraphs are jammed up next to each other.

Any help is appreciated!

— asked June 24th 2010 by Keith Harper
  • css
  • design
  • line-height
0 Comments

8 Answers

  • right now, you'll have to use a webview to control line-height with that level of granularity. however, we're hoping to add better native text capabilities in a future release.

    — answered July 2nd 2010 by Jeff Haynie
    permalink
    0 Comments
  • I thirst for line-height property.

    — answered January 23rd 2012 by Koji Ishimoto
    permalink
    0 Comments
  • 12 months later… is it possible yet to control the line height of a label?

    — answered June 19th 2011 by Andrew Scofield
    permalink
    5 Comments
    • Another 5 months later, still not possible I suppose?

      — commented November 3rd 2011 by Ted Sundin
    • 11 months later… ??

      — commented May 17th 2012 by Sean Cannon
    • 18 months later?

      — commented December 14th 2012 by Josiah Hester
    • 23months later :D

      — commented May 5th 2013 by Edgars Tubelis
    • Is this every going to happen?

      — commented September 9th 2013 by Zak Weiland
  • I, too, am incredibly thirsty for a line-height property.

    — answered January 23rd 2012 by Mikey Casalaina
    permalink
    0 Comments
  • Has there been any progress on this as in some cases the spacing is terrible and I need to be able to control this.

    — answered March 30th 2012 by Marcus Williams
    permalink
    0 Comments
  • I need it too… Me so thirsty.

    — answered April 3rd 2012 by Mark Ruys
    permalink
    0 Comments
  • UIKit's UILabel is to blame here - it's not possible to control line-height with the native controls. There's a native solution involving the replacement of UILabel by a custom text-renderer control: MSLabel

    A simple solution for me was to patch the font directly using OSX Font Tool:
    Minor Truetype Font Editing on a Mac

    I've modified lineGap, ascender and descender to get the correct line-height - had to delete build/iphone each time for the font to be picked up.

    — answered May 22nd 2012 by Philippe Elsass
    permalink
    1 Comment
    • This helped me. However, make sure you check the EULA for the font (if any), especially for Adobe fonts, you can not modify many of them and put them in your product : Font Permission List

      — commented December 14th 2012 by Josiah Hester
  • OK, thanks Jeff

    — answered July 3rd 2010 by Keith Harper
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.