Package icyllis.modernui.graphics.text
Class LineBreaker
java.lang.Object
icyllis.modernui.graphics.text.LineBreaker
Provides automatic line breaking for a single paragraph.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
The methods in this interface may be called several times.static class
Line breaking constraints for single paragraph.static class
Holds the result of the line breaking algorithm. -
Constructor Summary
ConstructorDescriptionLineBreaker
(char[] textBuf, MeasuredText measuredText, LineBreaker.LineWidth lineWidthLimits, TabStops tabStops) -
Method Summary
Modifier and TypeMethodDescriptionstatic LineBreaker.Result
computeLineBreaks
(MeasuredText measuredText, LineBreaker.ParagraphConstraints constraints, int[] indents, int lineNumber) Break paragraph into lines.static com.ibm.icu.util.ULocale
getLocaleWithLineBreakOption
(Locale locale, int lbStyle, int lbWordStyle) static boolean
isLineEndSpace
(char c)
-
Constructor Details
-
LineBreaker
public LineBreaker(@Nonnull char[] textBuf, @Nonnull MeasuredText measuredText, @Nonnull LineBreaker.LineWidth lineWidthLimits, @Nonnull TabStops tabStops)
-
-
Method Details
-
isLineEndSpace
public static boolean isLineEndSpace(char c) -
computeLineBreaks
@Nonnull public static LineBreaker.Result computeLineBreaks(@Nullable MeasuredText measuredText, @Nonnull LineBreaker.ParagraphConstraints constraints, @Nullable int[] indents, int lineNumber) Break paragraph into lines.The result is filled to out param.
- Parameters:
measuredText
- a result of the text measurementconstraints
- constraints for a single paragraphindents
- the supplied array provides the total amount of indentation per line, in pixel. This amount is the sum of both left and right indentations. For lines past the last element in the array, the indentation amount of the last element is used.lineNumber
- a line number (index offset) of this paragraph- Returns:
- the result of line break
-
getLocaleWithLineBreakOption
-