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

# availableFontNames(with:)

Returns the names of the fonts available in the system whose traits are described exactly by the given font trait mask (not the `NSFont` objects themselves).

```
func availableFontNames(with someTraits: NSFontTraitMask) -> [String]?
```

## Parameters

`someTraits`

The font traits for which to return font names. You specify the desired traits by combining the font trait mask values described in `Constants` using the C bitwise OR operator.

## Return Value

The names of the corresponding fonts.

## Discussion

These fonts are in various system font directories.

If `someTraits` is 0, this method returns all fonts that are neither italic nor bold. This result is the same one you’d get if `fontTraitMask` were `NSUnitalicFontMask` `|` `NSUnboldFontMask`.

---

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)