Package icyllis.modernui.graphics.text

# Class LineBreaker

java.lang.Object
icyllis.modernui.graphics.text.LineBreaker

public class LineBreaker extends Object
Provides automatic line breaking for a single paragraph.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static interface`
  `LineBreaker.LineWidth`
  The methods in this interface may be called several times.
  `static class`
  `LineBreaker.ParagraphConstraints`
  Line breaking constraints for single paragraph.
  `static class`
  `LineBreaker.Result`
  Holds the result of the line breaking algorithm.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `LineBreaker(char[] textBuf, MeasuredText measuredText, LineBreaker.LineWidth lineWidthLimits, TabStops tabStops)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static 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)`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## 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 measurement
      `constraints` - constraints for a single paragraph
      `indents` - 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

    @NonNull public static com.ibm.icu.util.ULocale getLocaleWithLineBreakOption(@NonNull Locale locale, int lbStyle, int lbWordStyle)