<!--
{
  "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/CTFontCreateWithFontDescriptorAndOptions(_:_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@F@CTFontCreateWithFontDescriptorAndOptions"
  },
  "title" : "CTFontCreateWithFontDescriptorAndOptions(_:_:_:_:)"
}
-->

# CTFontCreateWithFontDescriptorAndOptions(_:_:_:_:)

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

```
func CTFontCreateWithFontDescriptorAndOptions(_ descriptor: CTFontDescriptor, _ size: CGFloat, _ matrix: UnsafePointer<CGAffineTransform>?, _ options: CTFontOptions) -> CTFont
```

## Parameters

`descriptor`

A font descriptor containing attributes that specify the requested font.

`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

A `CTFontRef` that best matches the attributes provided with the font descriptor.

## Discussion

The size and matrix parameters override any specified in the font descriptor, unless they are unspecified (`0.0` for `size` and `NULL` for `matrix` and `options`). A best match font is always returned, and default values are used for any unspecified.

---

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)