This is useful for clients who wish to display a paragraph of text that fits within a specific width, called the wrapping width . LineBreakMeasurer is constructed with an iterator over styled text. The iterator's range should be a single paragraph in the text. LineBreakMeasurer maintains a position in the text for the start of the next text segment. Initially, this position is the start of text.
All segments obtained from a paragraph have the same direction as the paragraph.
Segments of text are obtained by calling the method nextLayout , which returns a TextLayout representing the text that fits within the wrapping width. The nextLayout method moves the current position to the end of the layout returned from nextLayout . If the first word does not fit, then all of the characters that fit within the wrapping width are placed on the line. At least one character is placed on each line. The TextLayout instances returned by LineBreakMeasurer treat tabs like 0-width spaces.