Contents

init(name:matrix:)

Returns a font object for the specified font name and matrix.

Declaration

init?(name fontName: String, matrix fontMatrix: UnsafePointer<CGFloat>)

Parameters

  • fontName:

    The fully specified family-face name of the font.

  • fontMatrix:

    A transformation matrix applied to the font.

Return Value

A font object for the specified name and transformation matrix.

Discussion

The fontName is a fully specified family-face name, such as Helvetica-BoldOblique or Times-Roman (not a name as shown in the Font Panel). The fontMatrix is a standard 6-element transformation matrix as used in the PostScript language, specifically with the makefont operator. In most cases, you can simply use init(name:size:) to create standard scaled fonts.

You can use the defined value NSFontIdentityMatrix for [1 0 0 1 0 0]. Fonts created with a matrix other than NSFontIdentityMatrix don’t automatically flip themselves in flipped views.

See Also

Related Documentation

Creating Arbitrary Fonts