Re: Restricted FontPanel
Re: Restricted FontPanel
- Subject: Re: Restricted FontPanel
- From: email@hidden
- Date: Mon, 27 May 2013 09:10:27 +0900
From
https://developer.apple.com/library/mac/documentation/TextFonts/Conceptual/CocoaTextArchitecture/FontHandling/FontHandling.html#//apple_ref/doc/uid/TP40009459-CH5-SW1
> Normally, an application’s Font panel displays all the standard fonts available on the system. If this isn’t appropriate for your application—for example, if only fixed-pitch fonts should be used—you can assign a delegate to the NSFontPanelobject to filter the available fonts. Before the NSFontPanel object adds a particular font family or face to its list, theNSFontPanel object asks its delegate to confirm the addition by sending the delegate afontManager:willIncludeFont:message. If the delegate returns TRUE (or doesn’t implement this method), the font is added. If the delegate returns FALSE, the font isn’t added. This method must be invoked before the loading of the main nib file.
Sent from my iPhone
On 2013/05/26, at 20:48, "Gerriet M. Denkmann" <email@hidden> wrote:
> I want (on OS X 10.8.3) to show a font panel, which only has nice fonts (e.g. only fonts which are able to show "门").
>
> There is a delegate method of NSFontManager:
> - (BOOL)fontManager:(id)theFontManager willIncludeFont:(NSString *)fontName
> Requests permission from the Font panel delegate to display the given font name in the Font panel.
>
> Looks exactly the thing I need.
>
> But then the documentation ends with:
> Important: This delegate method is not called in OS X versions 10.3 and later.
>
> So: how to display a restricted Font Panel in 10.8?
>
> Gerriet.
>
>
> P.S.
> NSFontPanel has this method:
> reloadDefaultFontFamilies
> "Triggers a reload to the default state, so that the delegate is called."
>
> But there is no delegate for a FontPanel. There is a NSWindow delegate, but this does not help much.
>
> Somehow either I or the documentation is a bit confused.
>
>
> _______________________________________________
>
>
_______________________________________________
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