public class FontUtils
extends java.lang.Object
| Constructor and Description |
|---|
FontUtils() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
getFormatFromString(java.lang.String text)
Return the last format usd on the input text.
|
static boolean |
isFormatColor(char character) |
static boolean |
isFormatSpecial(char character) |
static java.lang.String |
parseFormatting(java.lang.String text,
boolean keepFormatting)
Get if the input test should keep its formatting.
|
static java.util.List<net.minecraft.util.IChatComponent> |
splitText(net.minecraft.util.IChatComponent chatComponent,
int width,
net.minecraft.client.gui.FontRenderer fontRenderer,
boolean stripSpaces,
boolean keepFormatting)
Split the text into the width, with every newline as a new list entry.
|
public static java.util.List<net.minecraft.util.IChatComponent> splitText(net.minecraft.util.IChatComponent chatComponent,
int width,
net.minecraft.client.gui.FontRenderer fontRenderer,
boolean stripSpaces,
boolean keepFormatting)
chatComponent - the start componentwidth - the max widthfontRenderer - the font renderer instancestripSpaces - true if spaces on the start of newlines should be removedkeepFormatting - true if the text formatting shouldn't be removedpublic static java.lang.String parseFormatting(java.lang.String text,
boolean keepFormatting)
text - the input textkeepFormatting - false if if the input shouldn't keep the formattingpublic static java.lang.String getFormatFromString(java.lang.String text)
text - the input textpublic static boolean isFormatColor(char character)
character - the character to checkpublic static boolean isFormatSpecial(char character)
character - the character to check