Package net.minecraft.client.font
Class TextHandler.LineBreakingVisitor
java.lang.Object
net.minecraft.client.font.TextHandler.LineBreakingVisitor
- All Implemented Interfaces:
CharacterVisitor
- Enclosing class:
- TextHandler
@Environment(CLIENT) class TextHandler.LineBreakingVisitor extends Object implements CharacterVisitor
-
Field Summary
Fields Modifier and Type Field Description private int
count
private int
endIndex
private Style
endStyle
private int
lastSpaceBreak
private Style
lastSpaceStyle
private float
maxWidth
private boolean
nonEmpty
private int
startOffset
private float
totalWidth
-
Constructor Summary
Constructors Constructor Description LineBreakingVisitor(float maxWidth)
-
Method Summary
Modifier and Type Method Description boolean
accept(int index, Style style, int codePoint)
Visits a single character.private boolean
breakLine(int finishIndex, Style finishStyle)
int
getEndingIndex()
Style
getEndingStyle()
private boolean
hasLineBreak()
void
offset(int extraOffset)
-
Field Details
-
maxWidth
private final float maxWidth -
endIndex
private int endIndex -
endStyle
-
nonEmpty
private boolean nonEmpty -
totalWidth
private float totalWidth -
lastSpaceBreak
private int lastSpaceBreak -
lastSpaceStyle
-
count
private int count -
startOffset
private int startOffset
-
-
Constructor Details
-
LineBreakingVisitor
public LineBreakingVisitor(float maxWidth)
-
-
Method Details
-
accept
Visits a single character.Multiple surrogate characters are converted into one single
codePoint
when passed into this method.- Specified by:
accept
in interfaceCharacterVisitor
- Parameters:
index
- the current index of the characterstyle
- the style of the character, containing formatting and font informationcodePoint
- the code point of the character- Returns:
true
to continue visiting other characters, orfalse
to terminate the visit
-
breakLine
-
hasLineBreak
private boolean hasLineBreak() -
getEndingIndex
public int getEndingIndex() -
getEndingStyle
-
offset
public void offset(int extraOffset)
-