Package icyllis.modernui.graphics.text
Class LineBreaker.Result
java.lang.Object
icyllis.modernui.graphics.text.LineBreaker.Result
- Enclosing class:
LineBreaker
Holds the result of the line breaking algorithm.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfloat
getLineAscent
(int lineIndex) Returns font ascent of the line in pixels.int
getLineBreakOffset
(int lineIndex) Returns character offset of the break for a given line.int
Returns the number of lines in the paragraph.float
getLineDescent
(int lineIndex) Returns font descent of the line in pixels.float
getLineWidth
(int lineIndex) Returns width of a given line in pixels.boolean
hasLineTab
(int lineIndex) Returns true if the line has a TAB character.
-
Method Details
-
getLineCount
public int getLineCount()Returns the number of lines in the paragraph.- Returns:
- number of lines
-
getLineBreakOffset
public int getLineBreakOffset(int lineIndex) Returns character offset of the break for a given line.- Parameters:
lineIndex
- an index of the line.- Returns:
- the break offset.
-
getLineWidth
public float getLineWidth(int lineIndex) Returns width of a given line in pixels.- Parameters:
lineIndex
- an index of the line.- Returns:
- width of the line in pixels
-
getLineAscent
public float getLineAscent(int lineIndex) Returns font ascent of the line in pixels.- Parameters:
lineIndex
- an index of the line.- Returns:
- font ascent of the line in pixels.
-
getLineDescent
public float getLineDescent(int lineIndex) Returns font descent of the line in pixels.- Parameters:
lineIndex
- an index of the line.- Returns:
- font descent of the line in pixels.
-
hasLineTab
public boolean hasLineTab(int lineIndex) Returns true if the line has a TAB character.- Parameters:
lineIndex
- an index of the line.- Returns:
- true if the line has a TAB character
-