<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSTypesetter/substituteFont(for:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSTypesetter(im)substituteFontForFont:"
  },
  "title" : "substituteFont(for:)"
}
-->

# substituteFont(for:)

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

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

## Parameters

`originalFont`

The original font.

## 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

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.

---

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)