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

# CTFontCreateCopyWithAttributes(_:_:_:_:)

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

```
func CTFontCreateCopyWithAttributes(_ font: CTFont, _ size: CGFloat, _ matrix: UnsafePointer<CGAffineTransform>?, _ attributes: CTFontDescriptor?) -> CTFont
```

## Parameters

`font`

The original font reference on which to base the new font.

`size`

The point size for the font reference. If `0.0` is specified, the original font’s size is preserved.

`matrix`

The transformation matrix for the font.  In most cases, set this parameter to be `NULL`.  If `NULL` is specified, the original font’s matrix is preserved.

`attributes`

A font descriptor containing additional attributes that the new font should contain.

## Return Value

A new font reference converted from the original with the specified attributes.

## Discussion

This function provides a mechanism to change attributes quickly on a given font reference in response to user actions. For instance, the size can be changed in response to a user manipulating a size slider.

---

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)