---
title: font
framework: quartzcore
role: symbol
role_heading: Instance Property
path: quartzcore/catextlayer/font
---

# font

The font used to render the receiver’s text.

## Declaration

```swift
var font: CFTypeRef? { get set }
```

## Discussion

Discussion May be either a CTFont, a CGFont, an instance of NSFont (macOS only), or a string naming the font. In iOS, you cannot assign a UIFont object to this property. Defaults to Helvetica. The font property is only used when the string property is not an NSAttributedString. note: If the font property is a CTFontRef, a CGFontRef, or an instance of NSFont, the font size of the property is ignored.

## See Also

### Text Visual Properties

- [fontSize](quartzcore/catextlayer/fontsize.md)
- [foregroundColor](quartzcore/catextlayer/foregroundcolor.md)
- [allowsFontSubpixelQuantization](quartzcore/catextlayer/allowsfontsubpixelquantization.md)
