CATextLayer / NSAttributedString - Determines the exact size of the displayed text

I have a CATextLayer with NSAttributedString and I want to calculate the exact size of the visible / rendered text.

I've tried this: http://www.taffysoft.com/pages/20120202-01.html

But it gives the same result for lines "1" and "5" even though with my test font (AvenirNextCondensed) the two are fuzzy but not the same.

How do I calculate the exact size of the visible text?

+3
ios objective-c core-text nsattributedstring catextlayer


source to share


No one has answered this question yet

Check out similar questions:

1665
How can I get the UITextField to move upward when there is a keyboard - when starting editing?
768
Can I embed my own font in the iPhone app?
274
How can I create an anchored string using Swift?
106
NSAttributedString adds text alignment
95
UILabel is not auto-shortening text to fit the label size
77
How to get text in CATextLayer to be clear
52
How to calculate height of NSAttributedString with given width in iOS 6
21
Resizing CATextLayer to fit text in iOS
1
CATextLayer changes text quickly
0
CATextLayer glyphs are clipped or chopped off



All Articles
Loading...
X
Show
Funny
Dev
Pics