Search code examples
iphoneiosipadcore-text

Word spacing in CoreText


Is there a way to set a custom word spacing in CoreText?
I have looked around the paragraph properties where I would have expected to see this but found nothing.


Solution

  • I don't have deep experience in this but AFAIK you cannot adjust the space between words. So my list of possible solutions would be:

    • Adjust the kern value, however this will also adjust the space between letter which may not be what you want.

    • Add extra spaces. Crude, but you can increase the space between words by replace a single space with two.

    • (Really advanced) start adjusting individual glyphs. The best example I have found for doing is here: http://invasivecode.tumblr.com/core-text about 2/3rds down the author shows how to access the individual glyphs and adjust their settings.