AliSoftware / OHAttributedLabel

UILabel that supports NSAttributedString
https://github.com/AliSoftware/OHAttributedLabel/wiki
1.51k stars 344 forks source link

Superscript doesn't work #123

Closed moughxyz closed 11 years ago

moughxyz commented 11 years ago

I'm trying to add superscripts with your label, but it doesn't work:

OHAttributedLabel *label = [[OHAttributedLabel alloc] initWithFrame:CGRectMake(0, 0, 300, 300)];
NSMutableAttributedString* attrStr = [NSMutableAttributedString attributedStringWithString:@"Hello world my name is Ben Franklin"];
[attrStr setTextColor:[UIColor blackColor]];
[attrStr addAttribute:(NSString*)kCTSuperscriptAttributeName value:@(1) range:NSMakeRange(3, 5)];
[label setAttributedText:attrStr];
[self.view addSubview:label];

If I change OHAttributedLabel to UILabel (in iOS 6) with the same exact code as above, it works just fine.

AliSoftware commented 11 years ago

Duplicate of #25 and #37 .

moughxyz commented 11 years ago

Yes I noticed those. I think it might be helpful to have some sort of "limitations" section, where you discuss what is and isn't possible.

AliSoftware commented 11 years ago

You're right, that's actually a good idea! I'll try to add a dedicated page in the wiki and mention it in the README soon :)