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

Add ability to revert to default kerning #273

Open
ZevEisenberg opened this issue Feb 22, 2017 · 0 comments
Open

Add ability to revert to default kerning #273

ZevEisenberg opened this issue Feb 22, 2017 · 0 comments

Comments

@ZevEisenberg
Copy link
Collaborator

ZevEisenberg commented Feb 22, 2017

Currently, you can set a value for NSKernAttributeName with .tracking(.point(10)) or .tracking(.adobe(100)) (for example). Passing nonzero values affects the tracking (overall letter spacing over a range). Passing 0 disables the font's built-in kerning, which is almost definitely what you didn't want to do. What you can't do at all is pass NSNull() or remove the key, either of which will (I believe) use the font's default kerning. This is the UIKit default (question: what about AppKit?). If you override tracking in a style, and you nest a style inside it, you should be able to set the value back to the default. We should be able to test how things work by measuring strings in a unit test.

Depending on what we find through testing, I propose we add either the first or both of these cases to Tracking:

case `default` // sets it to NSNull()
case disabled // removes the key entirely

I'm guessing we'll only need one of these, since they should be synonymous, but we should test to confirm.

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

No branches or pull requests

1 participant