I want to superscript all the instances of ® character in a block of text (legal disclaimer, naturally ;)) and the default way NSAttributedString
is not very go
The following code seems to do the trick:
UIFont *fnt = [UIFont fontWithName:@"Helvetica" size:20.0];
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:@"GGG®GGG"
attributes:@{NSFontAttributeName: [fnt fontWithSize:20]}];
[attributedString setAttributes:@{NSFontAttributeName : [fnt fontWithSize:10]
, NSBaselineOffsetAttributeName : @10} range:NSMakeRange(3, 1)];