---
title: "CTFontCreateWithName(_:_:_:)"
framework: coretext
role: symbol
role_heading: Function
path: "coretext/ctfontcreatewithname(_:_:_:)"
---

# CTFontCreateWithName(_:_:_:)

Returns a new font reference for the given name.

## Declaration

```swift
func CTFontCreateWithName(_ name: CFString, _ size: CGFloat, _ matrix: UnsafePointer<CGAffineTransform>?) -> 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.

## Return Value

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

## Discussion

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). If all parameters cannot be matched identically, a best match is found.

## See Also

### Creating Fonts

- [CTFontCreateWithNameAndOptions(_:_:_:_:)](coretext/ctfontcreatewithnameandoptions(_:_:_:_:).md)
- [CTFontCreateWithFontDescriptor(_:_:_:)](coretext/ctfontcreatewithfontdescriptor(_:_:_:).md)
- [CTFontCreateWithFontDescriptorAndOptions(_:_:_:_:)](coretext/ctfontcreatewithfontdescriptorandoptions(_:_:_:_:).md)
- [CTFontCreateUIFontForLanguage(_:_:_:)](coretext/ctfontcreateuifontforlanguage(_:_:_:).md)
- [CTFontCreateCopyWithAttributes(_:_:_:_:)](coretext/ctfontcreatecopywithattributes(_:_:_:_:).md)
- [CTFontCreateCopyWithSymbolicTraits(_:_:_:_:_:)](coretext/ctfontcreatecopywithsymbolictraits(_:_:_:_:_:).md)
- [CTFontCreateCopyWithFamily(_:_:_:_:)](coretext/ctfontcreatecopywithfamily(_:_:_:_:).md)
- [CTFontCreateForString(_:_:_:)](coretext/ctfontcreateforstring(_:_:_:).md)
- [CTFontCreateForStringWithLanguage(_:_:_:_:)](coretext/ctfontcreateforstringwithlanguage(_:_:_:_:).md)
