Instance Method

fontManager(_:willIncludeFont:)

Requests permission from the Font panel delegate to display the given font name in the Font panel.

Declaration

func fontManager(_ sender: Any, willIncludeFont fontName: String) -> Bool

Parameters

theFontManager

The font manager making the request.

fontName

The full PostScript name of the font to display, such as Helvetica-BoldOblique or Helvetica-Narrow-Bold.

Return Value

If the Font panel delegate returns true, fontName is listed; if the delegate returns false, it isn’t.

Discussion

In macOS versions 10.2 and earlier, this method is invoked repeatedly as necessary whenever the Font panel needs updating, such as when the Font panel is first loaded, and when the user selects a family name to see which typefaces in that family are available. Your implementation should execute fairly quickly to ensure the responsiveness of the Font panel.

See Also

Methods

func availableFontNames(matching: NSFontDescriptor) -> [Any]?

Returns the names of the fonts that match the attributes in the given font descriptor.

Deprecated
func fontDescriptors(inCollection: String) -> [Any]?

Returns an array of the font descriptors in the specified collection.

Deprecated
func addCollection(String, options: NSFontCollectionOptions) -> Bool

Adds a specified font collection to the font manager with a given set of options.

Deprecated
func removeCollection(String) -> Bool

Removes the specified font collection.

Deprecated
func addFontDescriptors([Any], toCollection: String)

Adds an array of font descriptors to the specified font collection.

Deprecated
func removeFontDescriptor(NSFontDescriptor, fromCollection: String)

Removes the specified font descriptor from the specified collection.

Deprecated