LineBreakStyle Enum
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Specifies the line-break rules used by a line-break configuration.
public enum LineBreakStyle
type LineBreakStyle =
- Inheritance
-
LineBreakStyle
Fields
| Name | Value | Description |
|---|---|---|
| Unspecified | -1 | No line break style is specified. When Merge(LineBreakConfig) merges a configuration with an unspecified line-break style, it keeps the builder's existing style.
For text layout, this value resolves to None when the target SDK is API level 34 or earlier, and to Auto when the target SDK is API level 35 or later. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| None | 0 | No additional line-break style rules are applied. The default line-break rules still apply. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| Loose | 1 | The least restrictive line-break rules are used for line breaking. This setting is typically used for short lines. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| Normal | 2 | The most common line-break rules are used for line breaking. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| Strict | 3 | The most strict line-break rules are used for line breaking. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| NoBreak | 4 | This style prevents automatic line breaking. To keep words on the same line, use LineBreakConfigSpan or the CreateNoBreakSpan() shorthand. Grapheme-based breaks can still occur to prevent clipping. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
| Auto | 5 | A special value for the line breaking style option. The auto option selects a line-break style based on the locale of the text rendering context. You can set the context locale with TextLocales or TextLocales. If the first locale in a text run's locale list supports Japanese script, this option is equivalent to Strict; otherwise, it is equivalent to None. Note: future versions may have special line breaking style rules for other locales. Android reference for Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License. |
Remarks
Unspecified leaves an existing style unchanged during a merge. Auto is an explicit choice that lets the platform select rules from the text's locale. These values have different merge behavior.
NoBreak suppresses normal automatic breaks, but grapheme-based breaks can still occur to prevent clipping.
This enum exposes the LINE_BREAK_STYLE_* constants from LineBreakConfig.