In the San Francisco font, brackets are a bit low if they surround numbers. An example from the app I'm making, using an NSAttributedString
:
I'd like to increase the baseline for the brackets by a pixel or two, but when I do that using the NSBaselineOffsetAttributeName
attribute, the line height is increased by two pixels as well. The text is inside a UITextView
, and I really wouldn't like the line height to change. Is there anything I can do?
A possible way to do it is to force the maximum line height with NSParagraphAttributeName
.
NSMutableParagraphStyle *style = [[NSMutableParagraphStyle alloc] init];
[style setMaximumLineHeight:maxHeightWanted];
NSDictionary *parenthesisAttributes = @{NSParagraphStyleAttributeName:style,
NSBaselineOffsetAttributeName:@(baselineWanted),
NSFontAttributeName:sameFontWithBiggerPointSize};