Skip navigation.
 
mlRe: NSFontManager Initialization
FROM : Aki Inoue
DATE : Mon Mar 03 20:56:09 2008

Gordon,

-[NSFontManager selectedFont] is used mainly for getting the font set 
via -[NSFontManager setSelectedFont:isMultiple:] method.

Typically, you query the user font selection via -convertFont: method.

See the following tech doc section.
Font Panel: Using the Font Panel

Aki

On 2008/03/02, at 14:29, Gordon Apple wrote:

>    I am using NSFontManager and NSFontPanel to (eventually) extract 
> a glyph
> as a draw object.  The following code fails unless the font panel has
> previously been used in a text field.
>
>    NSFontManager* fmgr = [NSFontManager sharedFontManager];
>    NSFont* theFont = [fmgr selectedFont];
>
>    After I select the font and size in the panel, "theFont" will 
> always
> return nil.  If I first use the panel with a text view, it will work
> properly.  Also, a few times, I couldn't set the size in the panel's 
> size
> field.  Bug report time? Or is there something else I could do to 
> get it
> properly initialized?
>
> _______________________________________________
>
> Cocoa-dev mailing list (<email_removed>)
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>
>
> This email sent to <email_removed>

Related mailsAuthorDate
mlNSFontManager Initialization Gordon Apple Mar 2, 23:29
mlRe: NSFontManager Initialization Aki Inoue Mar 3, 20:56
mlRe: NSFontManager Initialization Gordon Apple Mar 3, 22:12
mlRe: NSFontManager Initialization Aki Inoue Mar 3, 23:01
mlRe: NSFontManager Initialization Gordon Apple Mar 4, 18:15