Interface ITextWrapper

All Known Subinterfaces:
IMutableShapingTextWrapper

public interface ITextWrapper
Interface for a text wrapper that can wrap text into lines based on the specified font size and text direction. Any other settings such as a maximum width may be offered as configuration options by implementations of this interface.

The wrapped text is a list of strings, each representing a line of text. Joining the lines together results in the original text, minus any line breaks and potentially spaces at the end of the lines.

Since:
8.4.0
  • Method Summary

    Modifier and Type
    Method
    Description
    wrap(String text, double fontSize, String script, EBidiTextDirection textDirection)
    Wraps the given text into lines based on the specified font size and text direction.
  • Method Details

    • wrap

      WrappedText wrap(String text, double fontSize, String script, EBidiTextDirection textDirection)
      Wraps the given text into lines based on the specified font size and text direction. The wrapped text is a list of strings, each representing a line of text. Joining the lines together results in the original text, minus any line breaks and potentially spaces at the end of the lines.
      Parameters:
      text - The text to wrap.
      fontSize - The font size to use for wrapping the text.
      script - The script of the text. A case-insensitive match for the values as defined by ISO 15924: Code for the Representation of Names of Scripts. See also the Unicode standard.
      textDirection - The base text direction to use for wrapping the text.
      Returns:
      The wrapped text and its dimensions.