Monday, May 14, 2012

Adding hyphenation to Core Text?

I am trying to add hyphenation to a string to draw with Core Text. So far I've found this category extension on NSString that attempts to add hyphens, but it is outdated, and doesn't work when the string has apostrophes, as well as many other issues. And then this other guy uses that code to do this, but this is dependent on the first source code, which is no good.



But now in iOS 5 there is apparently a built in method for hyphenation, though tutorials and examples are extremely scarce: CFStringGetHyphenationLocationBeforeIndex. Can anyone more experienced with Core Text and CF cook up a quick example of how I could potentially use this function?





No comments:

Post a Comment