开发者

Spacing between characters on the iPhone

开发者 https://www.devze.com 2022-12-17 09:40 出处:网络
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

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 c开发者_StackOverflowode), into its own textbox.

Any ideas on how to achieve this?


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消