---
title: "substituteFont(for:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstypesetter/substitutefont(for:)"
---

# substituteFont(for:)

Returns a screen font suitable for use in place of a given font.

## Declaration

```swift
func substituteFont(for originalFont: NSFont) -> NSFont
```

## Parameters

- `originalFont`: The original font.

## Return Value

Return Value A screen font suitable for use in place of originalFont. This method returns originalFont if a screen font can’t be used or isn’t available.

## Discussion

Discussion A screen font can only be substituted if the receiver is set to use screen fonts and if no text view associated with the receiver is scaled or rotated.
