size of a NSFont
size of a NSFont
- Subject: size of a NSFont
- From: email@hidden
- Date: Wed, 7 Mar 2007 08:43:50 +0100 (CET)
- Importance: Normal
Hello all,
even after reading the documentation I'm still confused on how to access
the size of a NSFont. I need it in a piece of code like this :
(*starting with an NSFont oldFont*)
float oldSize=[myFont size];
float newSize=oldSize/2;
NSFont* newFont=[[NSFontManager sharedFontManager]
convertFont: oldFont toSize: newSize];
Unfortunately, there's no method called "size" for an NSFont. In terms
of figure 1 in
Text&Fonts>Font Handling>Getting Font Metrics, that would be the "line
height."
There are "capHeight,xHeight" methods for NSFont, why is there not a
"lineHeight" method ?
In the documentation I have seen many methods for NSFont that are
certainly related,
but it's not clear to me which one I should use. I should like the method
to make no
assumption of the font, since it is intended for use in a text editor ;
even if
it is initialized with a standard user font, it may have been
modified arbitrarily by the user afterwards.
Ewan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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