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 strikethrough (NSStrikethroughStyleAttributeName) #117

Open
gardnermj opened this issue Jan 22, 2013 · 3 comments
Open

Support strikethrough (NSStrikethroughStyleAttributeName) #117

gardnermj opened this issue Jan 22, 2013 · 3 comments

Comments

@gardnermj
Copy link

Strikethrough works in UILabel (using NSStrikethroughStyleAttributeName = NSUnderlineStyleSingle), but doesn't seem to work in OHAttributedLabel.

@AliSoftware
Copy link
Owner

Are you sure that the CoreText framework support this attribute?

As OHAttributedLabel is based on CoreText (because it is the only framework, available since iOS 3.2/4.0+, that can draw attributed strings before iOS6 added support for them in UIKit) and not on the newly introduced UIKit methods, if attributes not supported by CoreText itself are used, you won't see their effect.

I'll make some tests anyway with this attribute, but can you tell the code you did try on your own? Thx

@AliSoftware
Copy link
Owner

After some digging, I confirm that NSStrikethroughStyleAttributeName is only supported on UIKit (and on OSX) but not by CoreText on iOS.

Unfortunately I won't have time soon to write anything to work around this CoreText limitation and add support for this attribute, but feel free to try yourself and propose a pull request.
I saw some interesting code from Cocoanetics (see end of the page) that you can use for inspiration to implement this strikethru yourself, as Apple didn't feel in the mood to support it itself in CoreText…

@gardnermj
Copy link
Author

Ah, that's unfortunate. Thanks for the pointer; I don't know if I'll have time to implement it either, but I'll let you know if I do.

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

2 participants