<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.6.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreText",
  "identifier" : "/documentation/CoreText/CTFontCreateWithNameAndOptions(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@F@CTFontCreateWithNameAndOptions"
  },
  "title" : "CTFontCreateWithNameAndOptions(_:_:_:_:)"
}
-->

# CTFontCreateWithNameAndOptions(_:_:_:_:)

Returns a new font reference for the given name.

```
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`](/documentation/CoreText/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.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)