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

# substituteFont(for:)

Returns a screen font suitable for use in place of the specified original font,.

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

## Discussion

A screen font can be substituted if the receiver is set to use screen fonts and if no [`NSTextView`](/documentation/AppKit/NSTextView) associated with the receiver is scaled or rotated. If a suitable screen font isn’t available or usable, this method returns the original font.

---

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)