I use NSTextField to display lines of text that will be printed on a printer with a variable paper size (the printer prints on a spool that cuts to the appropriate length during the job).
I can generate text without problems, but I need to know how big it is to make an NSTextField (vertically) so that it exactly contains all the lines of text. Is there an easy way around this?
The text is prepared as an NSAttributedString , and the lines have a fixed width (no wrapping) if that helps.
source share