Package net.minecraft.client.font
Class TextHandler
java.lang.Object
net.minecraft.client.font.TextHandler
@Environment(CLIENT) public class TextHandler extends Object
- Mappings:
Namespace Name official dquintermediary net/minecraft/class_5225named net/minecraft/client/font/TextHandler
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) classTextHandler.LineBreakingVisitor(package private) static classTextHandler.LineWrappingCollectorstatic interfaceTextHandler.LineWrappingConsumerA consumer of the line-breaking information.(package private) static classTextHandler.StyledString(package private) classTextHandler.WidthLimitingVisitorstatic interfaceTextHandler.WidthRetrieverA retriever of character width. -
Field Summary
Fields Modifier and Type Field Description private TextHandler.WidthRetrieverwidthRetriever -
Constructor Summary
Constructors Constructor Description TextHandler(TextHandler.WidthRetriever widthRetriever) -
Method Summary
Modifier and Type Method Description StylegetStyleAt(OrderedText text, int x)Gets the style at thexposition in a text.StylegetStyleAt(StringVisitable text, int x)Gets the style at thexposition in a text.intgetTrimmedLength(String text, int maxWidth, Style style)Returns the length of a string when it is trimmed to be at mostmaxWidthwide.floatgetWidth(String text)Returns the width of a string.floatgetWidth(OrderedText text)floatgetWidth(StringVisitable text)Returns the width of a text.static intmoveCursorByWords(String text, int offset, int cursor, boolean consumeSpaceOrBreak)StringtrimToWidth(String text, int maxWidth, Style style)Trim a string to be at mostmaxWidthwide.StringVisitabletrimToWidth(StringVisitable text, int width, Style style)StringtrimToWidthBackwards(String text, int maxWidth, Style style)Trim a string from right to left to be at mostmaxWidthwide.List<StringVisitable>wrapLines(String text, int maxWidth, Style style)voidwrapLines(String text, int maxWidth, Style style, boolean retainTrailingWordSplit, TextHandler.LineWrappingConsumer consumer)List<StringVisitable>wrapLines(StringVisitable text, int maxWidth, Style style)voidwrapLines(StringVisitable text, int maxWidth, Style style, BiConsumer<StringVisitable,Boolean> biConsumer)
-
Field Details
-
widthRetriever
- Mappings:
Namespace Name Mixin selector official aLdqu;a:Ldqu$f;intermediary field_24216Lnet/minecraft/class_5225;field_24216:Lnet/minecraft/class_5225$class_5231;named widthRetrieverLnet/minecraft/client/font/TextHandler;widthRetriever:Lnet/minecraft/client/font/TextHandler$WidthRetriever;
-
-
Constructor Details
-
TextHandler
- Mappings:
Namespace Name Mixin selector official <init>Ldqu;<init>(Ldqu$f;)Vintermediary <init>Lnet/minecraft/class_5225;<init>(Lnet/minecraft/class_5225$class_5231;)Vnamed <init>Lnet/minecraft/client/font/TextHandler;<init>(Lnet/minecraft/client/font/TextHandler$WidthRetriever;)V
-
-
Method Details
-
getWidth
Returns the width of a string.- Mappings:
Namespace Name Mixin selector official aLdqu;a(Ljava/lang/String;)Fintermediary method_27482Lnet/minecraft/class_5225;method_27482(Ljava/lang/String;)Fnamed getWidthLnet/minecraft/client/font/TextHandler;getWidth(Ljava/lang/String;)F
-
getWidth
Returns the width of a text.- Mappings:
Namespace Name Mixin selector official aLdqu;a(Lol;)Fintermediary method_27488Lnet/minecraft/class_5225;method_27488(Lnet/minecraft/class_5348;)Fnamed getWidthLnet/minecraft/client/font/TextHandler;getWidth(Lnet/minecraft/text/StringVisitable;)F
-
getWidth
- Mappings:
Namespace Name Mixin selector official aLdqu;a(Lafs;)Fintermediary method_30875Lnet/minecraft/class_5225;method_30875(Lnet/minecraft/class_5481;)Fnamed getWidthLnet/minecraft/client/font/TextHandler;getWidth(Lnet/minecraft/text/OrderedText;)F
-
getTrimmedLength
Returns the length of a string when it is trimmed to be at mostmaxWidthwide.- Parameters:
text- the string to trimmaxWidth- the max width of the trimmed stringstyle- the style of the trimmed string- Mappings:
Namespace Name Mixin selector official aLdqu;a(Ljava/lang/String;ILos;)Iintermediary method_27484Lnet/minecraft/class_5225;method_27484(Ljava/lang/String;ILnet/minecraft/class_2583;)Inamed getTrimmedLengthLnet/minecraft/client/font/TextHandler;getTrimmedLength(Ljava/lang/String;ILnet/minecraft/text/Style;)I
-
trimToWidth
Trim a string to be at mostmaxWidthwide.- Parameters:
text- the string to trimmaxWidth- the max width of the trimmed stringstyle- the style of the trimmed string- Returns:
- the trimmed string
- Mappings:
Namespace Name Mixin selector official bLdqu;b(Ljava/lang/String;ILos;)Ljava/lang/String;intermediary method_27494Lnet/minecraft/class_5225;method_27494(Ljava/lang/String;ILnet/minecraft/class_2583;)Ljava/lang/String;named trimToWidthLnet/minecraft/client/font/TextHandler;trimToWidth(Ljava/lang/String;ILnet/minecraft/text/Style;)Ljava/lang/String;
-
trimToWidthBackwards
Trim a string from right to left to be at mostmaxWidthwide.- Parameters:
text- the string to trimmaxWidth- the max width of the trimmed stringstyle- the style of the trimmed string- Returns:
- the trimmed string
- Mappings:
Namespace Name Mixin selector official cLdqu;c(Ljava/lang/String;ILos;)Ljava/lang/String;intermediary method_27497Lnet/minecraft/class_5225;method_27497(Ljava/lang/String;ILnet/minecraft/class_2583;)Ljava/lang/String;named trimToWidthBackwardsLnet/minecraft/client/font/TextHandler;trimToWidthBackwards(Ljava/lang/String;ILnet/minecraft/text/Style;)Ljava/lang/String;
-
getStyleAt
Gets the style at thexposition in a text.- Parameters:
x- the position in the text- Returns:
- a style
- Mappings:
Namespace Name Mixin selector official aLdqu;a(Lol;I)Los;intermediary method_27489Lnet/minecraft/class_5225;method_27489(Lnet/minecraft/class_5348;I)Lnet/minecraft/class_2583;named getStyleAtLnet/minecraft/client/font/TextHandler;getStyleAt(Lnet/minecraft/text/StringVisitable;I)Lnet/minecraft/text/Style;
-
getStyleAt
Gets the style at thexposition in a text.- Parameters:
x- the position in the text- Returns:
- a style
- Mappings:
Namespace Name Mixin selector official aLdqu;a(Lafs;I)Los;intermediary method_30876Lnet/minecraft/class_5225;method_30876(Lnet/minecraft/class_5481;I)Lnet/minecraft/class_2583;named getStyleAtLnet/minecraft/client/font/TextHandler;getStyleAt(Lnet/minecraft/text/OrderedText;I)Lnet/minecraft/text/Style;
-
trimToWidth
- Mappings:
Namespace Name Mixin selector official aLdqu;a(Lol;ILos;)Lol;intermediary method_27490Lnet/minecraft/class_5225;method_27490(Lnet/minecraft/class_5348;ILnet/minecraft/class_2583;)Lnet/minecraft/class_5348;named trimToWidthLnet/minecraft/client/font/TextHandler;trimToWidth(Lnet/minecraft/text/StringVisitable;ILnet/minecraft/text/Style;)Lnet/minecraft/text/StringVisitable;
-
moveCursorByWords
public static int moveCursorByWords(String text, int offset, int cursor, boolean consumeSpaceOrBreak)- Mappings:
Namespace Name Mixin selector official aLdqu;a(Ljava/lang/String;IIZ)Iintermediary method_27483Lnet/minecraft/class_5225;method_27483(Ljava/lang/String;IIZ)Inamed moveCursorByWordsLnet/minecraft/client/font/TextHandler;moveCursorByWords(Ljava/lang/String;IIZ)I
-
wrapLines
public void wrapLines(String text, int maxWidth, Style style, boolean retainTrailingWordSplit, TextHandler.LineWrappingConsumer consumer)- Mappings:
Namespace Name Mixin selector official aLdqu;a(Ljava/lang/String;ILos;ZLdqu$d;)Vintermediary method_27485Lnet/minecraft/class_5225;method_27485(Ljava/lang/String;ILnet/minecraft/class_2583;ZLnet/minecraft/class_5225$class_5229;)Vnamed wrapLinesLnet/minecraft/client/font/TextHandler;wrapLines(Ljava/lang/String;ILnet/minecraft/text/Style;ZLnet/minecraft/client/font/TextHandler$LineWrappingConsumer;)V
-
wrapLines
- Mappings:
Namespace Name Mixin selector official gLdqu;g(Ljava/lang/String;ILos;)Ljava/util/List;intermediary method_27498Lnet/minecraft/class_5225;method_27498(Ljava/lang/String;ILnet/minecraft/class_2583;)Ljava/util/List;named wrapLinesLnet/minecraft/client/font/TextHandler;wrapLines(Ljava/lang/String;ILnet/minecraft/text/Style;)Ljava/util/List;
-
wrapLines
- Mappings:
Namespace Name Mixin selector official bLdqu;b(Lol;ILos;)Ljava/util/List;intermediary method_27495Lnet/minecraft/class_5225;method_27495(Lnet/minecraft/class_5348;ILnet/minecraft/class_2583;)Ljava/util/List;named wrapLinesLnet/minecraft/client/font/TextHandler;wrapLines(Lnet/minecraft/text/StringVisitable;ILnet/minecraft/text/Style;)Ljava/util/List;
-
wrapLines
public void wrapLines(StringVisitable text, int maxWidth, Style style, BiConsumer<StringVisitable,Boolean> biConsumer)- Mappings:
Namespace Name Mixin selector official aLdqu;a(Lol;ILos;Ljava/util/function/BiConsumer;)Vintermediary method_29971Lnet/minecraft/class_5225;method_29971(Lnet/minecraft/class_5348;ILnet/minecraft/class_2583;Ljava/util/function/BiConsumer;)Vnamed wrapLinesLnet/minecraft/client/font/TextHandler;wrapLines(Lnet/minecraft/text/StringVisitable;ILnet/minecraft/text/Style;Ljava/util/function/BiConsumer;)V
-