<!--
{
  "availability" : [
    "iOS: 3.2.0 -",
    "iPadOS: 3.2.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.5.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreText",
  "identifier" : "/documentation/CoreText/CTFontCreateForString(_:_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Text"
    ],
    "preciseIdentifier" : "c:@F@CTFontCreateForString"
  },
  "title" : "CTFontCreateForString(_:_:_:)"
}
-->

# CTFontCreateForString(_:_:_:)

Returns a font reference that most accurately maps the string range based on the current font.

```
func CTFontCreateForString(_ currentFont: CTFont, _ string: CFString, _ range: CFRange) -> CTFont
```

## Parameters

`currentFont`

The current font that contains a valid cascade list.

`string`

A Unicode string containing characters that can’t be encoded by the current font.

`range`

A <doc://com.apple.documentation/documentation/CoreFoundation/CFRange> structure specifying the range of the string to map.

## Return Value

The best substitute font from the cascade list of the current font that can encode the specified string range.

## Discussion

If the current font can encode the string range, the function retains and returns the font.

## See Also

[`CTFontCopyCharacterSet`](/documentation/CoreText/CTFontCopyCharacterSet(_:))

Returns the Unicode character set of the font.

[`CTFontGetGlyphsForCharacters`](/documentation/CoreText/CTFontGetGlyphsForCharacters(_:_:_:_:))

Performs basic character-to-glyph mapping.

[`kCTFontCascadeListAttribute`](/documentation/CoreText/kCTFontCascadeListAttribute)

The cascade list used for a font reference.



---

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)