Re: Repost: NSFont userFontOfSize vs setUserFixedPitchFont
Re: Repost: NSFont userFontOfSize vs setUserFixedPitchFont
- Subject: Re: Repost: NSFont userFontOfSize vs setUserFixedPitchFont
- From: Jim Correia <email@hidden>
- Date: Sat, 5 Jan 2002 00:12:16 -0500
At 8:33 PM -0800 1/4/02, David Rehring wrote:
On 1/3/02 10:47 PM, Greg Titus at email@hidden wrote:
Hi David,
The trick - or at least it used to be the trick under NeXTStep/OpenStep,
I haven't tried it lately - is to use zero for the size.
font = [NSFont userFixedPitchFontOfSize:0.0];
That will give you the default font in the default size.
Hope this helps,
--Greg
Yes, this does seem to work [for how long, who knows].
Presumably indefinitely. It is the documented behavior for
+[NSFont fontWithName:size:]
<
http://developer.apple.com/techpubs/macosx/Cocoa/Reference/ApplicationKit/ObjC_classic/Classes/NSFont.html#//apple_ref/occ/clm/NSFont/fontWithName:size:>
"Returns a font object for fontName and fontSize. fontName is a fully
specified family-face name, such as Helvetica-BoldOblique or
Times-Roman. fontSize is used to scale the font, and is equivalent to
using a font matrix of [fontSize 0 0 fontSize 0 0] with
fontWithName:matrix: . If you use a fontSize of 0.0, this method uses
the default User Font size."
While the other methods don't explicitly state the same thing, the
text above looks like it should at least be extensible to
userFontOfSize.
Jim