@Environment(value=CLIENT) class TextHandler.WidthLimitingVisitor extends Object implements CharacterVisitor
Modifier and Type | Field and Description |
---|---|
private int |
length |
private float |
widthLeft |
Constructor and Description |
---|
WidthLimitingVisitor(float maxWidth) |
Modifier and Type | Method and Description |
---|---|
boolean |
accept(int index,
Style style,
int codePoint)
Visits a single character.
|
int |
getLength() |
void |
resetLength() |
public boolean accept(int index, Style style, int codePoint)
Multiple surrogate characters are converted into one single codePoint
when passed into this method.
accept
in interface CharacterVisitor
index
- the current index of the characterstyle
- the style of the character, containing formatting and font informationcodePoint
- the code point of the charactertrue
to continue visiting other characters, or false
to terminate the visitpublic int getLength()
public void resetLength()