Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support using NSKernAttributeName for auto-kerning with UILabel #11

Open
ZevEisenberg opened this issue May 21, 2015 · 1 comment
Open

Comments

@ZevEisenberg
Copy link
Collaborator

From the iOS 8.3 UILabel documentation:

To turn on auto-kerning in the label, set NSKernAttributeName of the string to [NSNull null].

To research

  • What exactly does "auto-kerning" mean in this context?
  • Does it have performance implications?
  • Does it work only for UILabel? What about UITextView, UITextField, Core Animation, and Core Graphics?
@ZevEisenberg
Copy link
Collaborator Author

Turns out NSKernAttributeName works like this for UIKit:

  • Non-zero NSNumber: adjusts tracking
  • @0: disables font kerning (ugly, only do this if you have a very good reason)
  • [NSNull null] - enables pretty font Kerning. It's not clear from the documentation, but this is necessary only for manual attributed string drawing. In UIKit, even if you don’t set this property, this is the default behavior.

To consider for BonMot: should we always use [NSNull null], just in case the string is being used in Quartz drawing? Or should we provide a separate accessor, -attributedStringForBitmapDrawing or similar?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant