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

# CTFontCreateForStringWithLanguage(_:_:_:_:)

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

```
func CTFontCreateForStringWithLanguage(_ currentFont: CTFont, _ string: CFString, _ range: CFRange, _ language: CFString?) -> 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> specifying the range of the string to map.

`language`

A language identifier to select a font for a particular localization.

## Return Value

The best substitute font that can encode the specified string range.

## Discussion

The current font itself can be returned if it covers the string provided. If the caller does not specify the language parameter, the function uses the current system language. The format of the language identifier should conform to [UTS #35](http://unicode.org/reports/tr35/).

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