I cannot seem to find this and hope it is a FAQ somewhere. How can I get the minimum NSRect needed to draw an NSAttributed string on OS X? I am doing an overlay borderless window, but I want to constrain the size based on what is needed to display the string.
Asked
Active
Viewed 128 times
1 Answers
1
use NSTextContainer and NSLayoutManager. More from Apple here: https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/TextLayout/Tasks/StringHeight.html

Ken Aspeslagh
- 11,484
- 2
- 36
- 42
-
This is in fact what I ended up doing and the same reference I used. – uchuugaka May 10 '13 at 04:46