@Environment(value=CLIENT) class TextHandler.WidthLimitingVisitor extends Object implements TextVisitFactory.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 |
|---|---|
int |
getLength() |
boolean |
onChar(int index,
Style style,
int codePoint)
Visits a single character.
|
void |
resetLength() |
public boolean onChar(int index,
Style style,
int codePoint)
Multiple surrogate characters are converted into one single codePoint when passed into this method.
onChar in interface TextVisitFactory.CharacterVisitorindex - 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()