*/
public static int getWidth(String... text) {
int width = 0;
for (String part : text) {
char character;
CharacterSprite charsprite;
for (int i = 0; i < part.length(); i++) {
character = part.charAt(i);
if (character == '\n')
continue;
if (character == StringUtil.CHAT_STYLE_CHAR) {
i++;
continue;
} else if (character == ' ') {
width += SPACE_WIDTH;
} else {
charsprite = MinecraftFont.Font.getChar(character);
if (charsprite != null) {
width += charsprite.getWidth();
}
}
}
}
return width;