Contents

CTFontCreateWithNameAndOptions(_:_:_:_:)

Returns a new font reference for the given name.

Declaration

func CTFontCreateWithNameAndOptions(_ name: CFString, _ size: CGFloat, _ matrix: UnsafePointer<CGAffineTransform>?, _ options: CTFontOptions) -> CTFont

Parameters

  • name:

    The font name for which you wish to create a new font reference. A valid PostScript name is preferred, although other font name types are matched in a fallback manner.

  • size:

    The point size for the font reference. If 0.0 is specified, the default font size of 12.0 is used. This parameter is optional.

  • matrix:

    The transformation matrix for the font. In most cases, set this parameter to be NULL. If NULL is specified, the identity matrix is used. This parameter is optional.

  • options:

    Options flags. See Ctfontoptions for values. This parameter is optional.

Return Value

Returns a CTFontRef that best matches the name provided with size and matrix attributes.

Discussion

The name parameter is the only required parameter, and default values are used for unspecified parameters (0.0 for size and NULL for matrix and options). If all parameters cannot be matched identically, a best match is found.

See Also

Creating Fonts