Package icyllis.modernui.graphics.text
Class LineBreakConfig
java.lang.Object
icyllis.modernui.graphics.text.LineBreakConfig
Indicates the strategies can be used when calculating the text wrapping.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A builder for creatingLineBreakConfig
.static @interface
static @interface
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Uses the least restrictive rule for line-breaking.static final int
No line break style specified.static final int
Indicates breaking text with the most common set of line-breaking rules.static final int
Indicates breaking text with the most stringent line-breaking rules.static final int
Allow midword breaks unless forbidden by line break style.static final int
Prohibit midword breaks except for dictionary breaks.static final int
No line break word style specified.static final int
Normal script/language behavior for midword breaks.static final int
Indicates the line breaking is based on the phrased.static final LineBreakConfig
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static LineBreakConfig
getLineBreakConfig
(int lineBreakStyle, int lineBreakWordStyle) Create the LineBreakConfig instance.int
Get the line break style.int
Get the line break word style.int
hashCode()
-
Field Details
-
LINE_BREAK_STYLE_NONE
public static final int LINE_BREAK_STYLE_NONENo line break style specified.- See Also:
-
LINE_BREAK_STYLE_LOOSE
public static final int LINE_BREAK_STYLE_LOOSEUses the least restrictive rule for line-breaking. Typically used for short lines.- See Also:
-
LINE_BREAK_STYLE_NORMAL
public static final int LINE_BREAK_STYLE_NORMALIndicates breaking text with the most common set of line-breaking rules.- See Also:
-
LINE_BREAK_STYLE_STRICT
public static final int LINE_BREAK_STYLE_STRICTIndicates breaking text with the most stringent line-breaking rules.- See Also:
-
LINE_BREAK_WORD_STYLE_NONE
public static final int LINE_BREAK_WORD_STYLE_NONENo line break word style specified.- See Also:
-
LINE_BREAK_WORD_STYLE_PHRASE
public static final int LINE_BREAK_WORD_STYLE_PHRASEIndicates the line breaking is based on the phrased. This makes text wrapping only on meaningful words. The support of the text wrapping word style varies depending on the locales. If the locale does not support the phrase based text wrapping, there will be no effect.- See Also:
-
LINE_BREAK_WORD_STYLE_NORMAL
public static final int LINE_BREAK_WORD_STYLE_NORMALNormal script/language behavior for midword breaks.- See Also:
-
LINE_BREAK_WORD_STYLE_BREAK_ALL
public static final int LINE_BREAK_WORD_STYLE_BREAK_ALLAllow midword breaks unless forbidden by line break style. To prevent overflow, word breaks should be inserted between any two characters (excluding Chinese/Japanese/Korean text).- See Also:
-
LINE_BREAK_WORD_STYLE_KEEP_ALL
public static final int LINE_BREAK_WORD_STYLE_KEEP_ALLProhibit midword breaks except for dictionary breaks. Word breaks should not be used for Chinese/Japanese/Korean (CJK) text. Non-CJK text behavior is the same as for normal.- See Also:
-
NONE
-
-
Method Details
-
getLineBreakConfig
@Internal @NonNull public static LineBreakConfig getLineBreakConfig(int lineBreakStyle, int lineBreakWordStyle) Create the LineBreakConfig instance.- Parameters:
lineBreakStyle
- the line break style for text wrapping.lineBreakWordStyle
- the line break word style for text wrapping.- Returns:
- the
LineBreakConfig
instance.
-
getLineBreakStyle
public int getLineBreakStyle()Get the line break style.- Returns:
- The current line break style to be used for the text wrapping.
-
getLineBreakWordStyle
public int getLineBreakWordStyle()Get the line break word style.- Returns:
- The current line break word style to be used for the text wrapping.
-
hashCode
public int hashCode() -
equals
-