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

# CTFontCreateWithGraphicsFont(_:_:_:_:)

Creates a new font reference from an existing Core Graphics font reference.

```
func CTFontCreateWithGraphicsFont(_ graphicsFont: CGFont, _ size: CGFloat, _ matrix: UnsafePointer<CGAffineTransform>?, _ attributes: CTFontDescriptor?) -> CTFont
```

## Parameters

`graphicsFont`

A valid Core Graphics font reference.

`size`

The point size for the font reference. If `0.0` is specified the default font size of 12.0 is used.

`matrix`

The transformation matrix for the font.  In most cases, set this parameter to be `NULL`.  If `NULL`, the identity matrix is used. Optional.

`attributes`

Additional attributes that should be matched. Optional.

## Return Value

A new font reference for an existing <doc://com.apple.documentation/documentation/CoreGraphics/CGFont> object with the specified size, matrix, and additional attributes.

---

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)