Function

CTFontCreateWithNameAndOptions

Returns a new font reference for the given name.

Declaration

CTFontRef CTFontCreateWithNameAndOptions(CFStringRef name, CGFloat size, const CGAffineTransform *matrix, CTFontOptions options);

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

CTFontCreateWithName

Returns a new font reference for the given name.

CTFontCreateWithFontDescriptor

Returns a new font reference that best matches the given font descriptor.

CTFontCreateWithFontDescriptorAndOptions

Returns a new font reference that best matches the given font descriptor.

CTFontCreateUIFontForLanguage

Returns the special user-interface font for the given language and user-interface type.

CTFontCreateCopyWithAttributes

Returns a new font with additional attributes based on the original font.

CTFontCreateCopyWithSymbolicTraits

Returns a new font in the same font family as the original with the specified symbolic traits.

CTFontCreateCopyWithFamily

Returns a new font in the specified family based on the traits of the original font.

CTFontCreateForString

Returns a font reference that most accurately maps the string range based on the current font.

CTFontCreateForStringWithLanguage

Returns a font reference that most accurately maps the string range based on the current font and language.