views:

104

answers:

2

I have a label and I wish to increase the spacing between characters.

  • I tried adding a space between each character, but this was too much
  • Perhaps there is a font with large spacing between the letters?
  • If all else fails, I am considering putting each character (only a size character code), into its own textbox.

Any ideas on how to achieve this?

+1  A: 

You're better off creating a custom view and using your drawRect routine to draw the text manually. You can use CFAttributedString to hold your text along with kerning information.

Update: sounds like you can't actually use CFAttributedString to draw text on the iPhone. You can still use your drawRect to draw the customized text, but it will take some more work to actually get your custom kerning to work.

pix0r
"iPhone OS Note: While Core Foundation on iPhone OS contains CFAttributedString, there are no additions to the APIs in UIKit to add specific attributes such as font, style, or color, and there are no APIs to draw attributed strings."
Kendall Helmstetter Gelner
Thanks, KHG - I didn't see that. Updated my response.
pix0r
+1  A: 

There is a way to insert a half space, but I don't recall the exact command (option-spacebar?). Wikipedia has a complete list of spaces you can use.

Another approach would be a UIWebView with the letter-spacing CSS attribute set.

Frank Schmitt