---
title: "init(_:)"
framework: coregraphics
role: symbol
role_heading: Initializer
path: "coregraphics/cgfont/init(_:)-1p4b"
---

# init(_:)

Creates a font object corresponding to the font specified by a PostScript or full name.

## Declaration

```swift
init?(_ name: CFString)
```

## Parameters

- `name`: The PostScript or full name of a font.

## Return Value

Return Value The font object or NULL if the font can’t be created. In Objective-C, you’re responsible for releasing this object using CGFontRelease.

## Discussion

Discussion Before drawing text in a Core Graphics context, you must set the font in the current graphics state by calling the function setFont(_:).

## See Also

### Creating Font Objects

- [init(_:)](coregraphics/cgfont/init(_:)-9aour.md)
