View ModifieriOS 17.0+macOS 14.0+tvOS 17.0+watchOS 10.0+
Overloads
2 ways to call compose().typesettingLanguage(). Each is one SwiftUI overload, picked by the arguments you pass.
compose().typesettingLanguage(
language: string,
options?: {
isEnabled?: boolean;
}
)nonisolated func typesettingLanguage(
_ language: Locale.Language,
isEnabled: Bool = true
) -> some ViewParameters
language*stringThe explicit language to use for typesetting.
options.isEnabledbooleanA Boolean value that indicates whether text language is added
Return value
A view with the typesetting language set to the value you supply.
Discussion
In some cases Text may contain text of a particular language which
doesn't match the device UI language. In that case it's useful to
specify a language so line height, line breaking and spacing will
respect the script used for that language. For example:
Text(verbatim: "แอปเปิล")
.typesettingLanguage(.init(languageCode: .thai))Note: this language does not affect text localization.
See also
More in Text and symbols.
- allowsTighteningSets whether text in this view can compress the space between characters when necessary to fit text in a line.
- autocorrectionDisabledSets whether to disable autocorrection for this view.
- baselineOffsetSets the vertical offset for the text relative to its baseline in this view.
- boldApplies a bold font weight to the text in this view.
- findDisabledPrevents find and replace operations in a text editor.
- findNavigatorProgrammatically presents the find and replace interface for text editor views.
- fontSets the default font for text in this view.
- fontDesignSets the font design of the text in this view.
- fontWeightSets the font weight of the text in this view.
- fontWidthSets the font width of the text in this view.
- interactionActivityTrackingTagSets a tag that you use for tracking interactivity.
- italicApplies italics to the text in this view.