TypefaceManager

public class TypefaceManager

The TypefaceManager class provides management activities related to typefaces.

  • Undocumented

    Declaration

    Swift

    public static let `default`: TypefaceManager
  • Registers a typeface agains a specified tag. The typeface or the tag mustn’t be already registered.

    Declaration

    Swift

    public func register(_ typeface: Typeface, forTag tag: TypefaceTag?)

    Parameters

    typeface

    The typeface that will be registered.

    tag

    An optional tag to identify the typeface.

  • Unregisters a typeface if it was previously registered.

    Declaration

    Swift

    public func unregister(_ typeface: Typeface)

    Parameters

    typeface

    The typeface to unregister.

  • Returns the typeface registered against the specified tag.

    Declaration

    Swift

    public func typeface(forTag tag: TypefaceTag) -> Typeface?

    Parameters

    tag

    The tag that identifies the typeface.

    Return Value

    The registered typeface, or nil if no typeface is registered against the specified tag.

  • Returns the tag of a registered typeface.

    Declaration

    Swift

    public func tag(of typeface: Typeface) -> TypefaceTag?

    Parameters

    typeface

    The typeface whose tag is returned.

    Return Value

    The tag of the typeface, or nil if it is not registered, or no tag was specified while registration.

  • Looks for a registered typeface having the specified full name.

    Declaration

    Swift

    public func typeface(byName fullName: String) -> Typeface?

    Parameters

    fullName

    The full name of the typeface.

    Return Value

    The typeface having the specified full name, or nil if no such typeface is registered.

  • The array of available typefaces sorted by their names in ascending order.

    Declaration

    Swift

    public var availableTypefaces: [Typeface] { get }