I have a NSAttributedString
which is a "table" using NSTextTab
stops where the first column is the KEY and the second column is the value
Like this:
| **KEY 1**|value1|
|**KEY TWO**|value2|
The font for the KEYS is different size/weight + it is all caps. The rows align so that the bottoms of all the letters match up. I would like to nudge the values up vertically so that they appear to be vertically centered with the KEYS.
Is there any way to do this? This seems highly specialized, but from a design perspective I think it will look much better
I haven't tried it, but it seems like you should be able to use
NSBaselineOffsetAttributeName
for this. Here's what the docs say about it:So you'll probably have to compute the number of points needed to move the values up -- I guess that'd be half the difference in font sizes between the keys and values. Then apply
NSBaselineOffsetAttributeName
with that number of points to the text for the values.