Class TextLayoutResult


public class TextLayoutResult extends MinMaxWidthLayoutResult
Represents the result of a text layout.
  • Field Details

    • wordHasBeenSplit

      protected boolean wordHasBeenSplit
      Indicates whether some word was split during layout.
    • splitForcedByNewline

      protected boolean splitForcedByNewline
      Indicates whether split was forced by new line symbol in text or not.
    • containsPossibleBreak

      protected boolean containsPossibleBreak
    • startsWithSplitCharacterWhiteSpace

      protected boolean startsWithSplitCharacterWhiteSpace
    • endsWithSplitCharacter

      protected boolean endsWithSplitCharacter
    • leftMinWidth

      protected float leftMinWidth
    • rightMinWidth

      protected float rightMinWidth
  • Constructor Details

  • Method Details

    • isWordHasBeenSplit

      public boolean isWordHasBeenSplit()
      Indicates whether some word in a rendered text was split during layout. The value will be set as true if, for example, the rendered words width is bigger than the width of layout area.
      Returns:
      whether some word was split or not.
    • setWordHasBeenSplit

      public TextLayoutResult setWordHasBeenSplit (boolean wordHasBeenSplit)
      Parameters:
      wordHasBeenSplit - indicates that some word was split during layout.
      Returns:
      this layout result the setting was applied on
      See Also:
    • isSplitForcedByNewline

      public boolean isSplitForcedByNewline()
      Indicates whether split was forced by new line symbol in rendered text. The value will be set as true if, for example, the rendered text contains '\n' symbol. This value can also be true even if the text was fully placed, but had line break at the end.
      Returns:
      whether split was forced by new line or not.
    • setSplitForcedByNewline

      public TextLayoutResult setSplitForcedByNewline (boolean isSplitForcedByNewline)
      Parameters:
      isSplitForcedByNewline - indicates that split was forced by new line symbol in rendered text.
      Returns:
      this layout result the setting was applied on.
      See Also:
    • isContainsPossibleBreak

      public boolean isContainsPossibleBreak()
      Indicates whether split renderer contains possible break. Possible breaks are either whitespaces or split characters.
      Returns:
      true if there's a possible break within the split renderer.
      See Also:
    • setContainsPossibleBreak

      public TextLayoutResult setContainsPossibleBreak (boolean containsPossibleBreak)
      Parameters:
      containsPossibleBreak - indicates that split renderer contains possible break.
      Returns:
      this layout result the setting was applied on.
      See Also:
    • setStartsWithSplitCharacterWhiteSpace

      public TextLayoutResult setStartsWithSplitCharacterWhiteSpace (boolean startsWithSplitCharacterWhiteSpace)
      Parameters:
      startsWithSplitCharacterWhiteSpace - indicates if TextRenderer#line starts with a split character that is also a whitespace.
      Returns:
      this layout result the setting was applied on.
      See Also:
    • isStartsWithSplitCharacterWhiteSpace

      public boolean isStartsWithSplitCharacterWhiteSpace()
      Indicates whether TextRenderer#line starts with a whitespace.
      Returns:
      true if TextRenderer#line starts with a whitespace.
    • setEndsWithSplitCharacter

      public TextLayoutResult setEndsWithSplitCharacter (boolean endsWithSplitCharacter)
      Parameters:
      endsWithSplitCharacter - indicates if TextRenderer#line ends with a splitCharacter.
      Returns:
      this layout result the setting was applied on.
      See Also:
    • isEndsWithSplitCharacter

      public boolean isEndsWithSplitCharacter()
      Indicates whether TextRenderer#line ends with a splitCharacter.
      Returns:
      true if TextRenderer#line ends with a splitCharacter.
      See Also:
    • setLeftMinWidth

      public TextLayoutResult setLeftMinWidth (float leftMinWidth)
      Sets min width of the leftmost unbreakable part of the TextRenderer#line after layout. This value includes left-side additional width, i.e. left margin, border and padding widths. In case when entire TextRenderer#line is unbreakable, leftMinWidth also includes right-side additional width.
      Parameters:
      leftMinWidth - min width of the leftmost unbreakable part of the TextRenderer#line after layout.
      Returns:
      this layout result the setting was applied on.
    • getLeftMinWidth

      public float getLeftMinWidth()
      Gets min width of the leftmost unbreakable part of the TextRenderer#line after layout. This value leftMinWidth includes left-side additional width, i.e. left margin, border and padding widths. In case when entire TextRenderer#line is unbreakable, leftMinWidth also includes right-side additional width.
      Returns:
      min width of the leftmost unbreakable part of the TextRenderer#line after layout.
    • setRightMinWidth

      public TextLayoutResult setRightMinWidth (float rightMinWidth)
      Sets min width of the rightmost unbreakable part of the TextRenderer#line after layout. This value includes right-side additional width, i.e. right margin, border and padding widths. In case when entire TextRenderer#line is unbreakable, this value must be -1 and right-side additional width must be included in leftMinWidth.
      Parameters:
      rightMinWidth - min width of the rightmost unbreakable part of the TextRenderer#line after layout.
      Returns:
      this layout result the setting was applied on.
    • getRightMinWidth

      public float getRightMinWidth()
      Gets min width of the rightmost unbreakable part of the TextRenderer#line after layout. This value includes right-side additional width, i.e. right margin, border and padding widths. In case when entire TextRenderer#line is unbreakable, this value must be -1 and right-side additional width must be included in leftMinWidth.
      Returns:
      min width of the leftmost unbreakable part of the TextRenderer#line after layout.