Drawing an NSAttributedString into a non-rectangular CGPath?

Posted by Adrian Kosmaczewski on Stack Overflow See other posts from Stack Overflow or by Adrian Kosmaczewski
Published on 2010-11-05T14:03:22Z Indexed on 2010/12/29 19:53 UTC
Read the original article Hit count: 449

I generate a rather complex NSAttributedString in my iOS 3.2 application (iPad), including formatting options of type CTParagraphStyleSetting, in particular with values for kCTParagraphStyleSpecifierMinimumLineHeight and kCTParagraphStyleSpecifierParagraphSpacing.

When I try to draw this attributed string into a non-rectangular CGPath, Core Text draws it but without the line spacing defined; that is, all text appears crammed in paragraphs without line spacing. Needless to say, it does not look as pretty as if the CGPath was simply defined using a single call to CGPathAddRect()!

Is there any setting I can specify (to my CTFramesetterRef or to the CTFrameRef associated to the culprit CGPath) to avoid losing all line height information?

Thanks!

© Stack Overflow or respective owner

Related posts about ipad

Related posts about core-text