Font Height and -[NSString sizeWithAttributes:]
Font Height and -[NSString sizeWithAttributes:]
- Subject: Font Height and -[NSString sizeWithAttributes:]
- From: Thomas Clément <email@hidden>
- Date: Mon, 28 Mar 2011 18:45:33 +0200
Hello,
I'm confused about the returned height from -[NSString sizeWithAttributes:].
> NSFont *font = [NSFont fontWithName:@"Menlo" size:11.0];
> [@"Hello World" sizeWithAttributes:[NSDictionary dictionaryWithObjectsAndKeys:font, NSFontAttributeName, nil]];
This returns a height of 17.0. However when using this font (Menlo 11.0) in TextEdit (plain text document), I'm seeing a line height of 13.0.
Monaco 10.0 returns a height of 14.0 which is also what I'm seeing in TextEdit.
Helvetica 12.0 returns a height of 15.0 but I'm seeing 14.0 in TextEdit.
Why these differences?
How do I get programmatically the value I'm seeing in TextEdit?
Thomas_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden