Function

CTFontManagerRegisterGraphicsFont(_:_:)

Registers the specified graphics font with the font manager.

Declaration

func CTFontManagerRegisterGraphicsFont(_ font: CGFont, _ error: UnsafeMutablePointer<Unmanaged<CFError>?>?) -> Bool

Parameters

font

The graphics font to be registered.

error

Returns by indirection an error object in the case of failed registration.

Return Value

true if registration of the font was successful, otherwise false.

Discussion

Registered fonts are discoverable through font descriptor matching. Any attempt to register a font that is either already registered or contains the same Postscript of an already registered font will fail. This behavior is useful for fonts that may be embedded in documents or constructed in memory. A graphics font is obtained by calling init(_:). Fonts that are backed by files should be registered using CTFontManagerRegisterFontsForURL(_:_:_:).

See Also