public class FontRenderer
extends java.lang.Object
implements java.lang.AutoCloseable
Modifier and Type | Field and Description |
---|---|
private boolean |
bidiFlag |
private Font |
font |
int |
FONT_HEIGHT |
java.util.Random |
random |
private TextureManager |
textureManager |
Constructor and Description |
---|
FontRenderer(TextureManager textureManagerIn,
Font fontIn) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
bidiReorder(java.lang.String text) |
void |
close() |
private void |
drawGlyph(TexturedGlyph glyphIn,
boolean boldIn,
boolean italicIn,
float boldOffsetIn,
float xIn,
float yIn,
Matrix4f matrix,
IVertexBuilder bufferIn,
float redIn,
float greenIn,
float blueIn,
float alphaIn,
int packedLight) |
void |
drawSplitString(java.lang.String str,
int x,
int y,
int wrapWidth,
int textColor) |
int |
drawString(java.lang.String text,
float x,
float y,
int color) |
int |
drawStringWithShadow(java.lang.String text,
float x,
float y,
int color) |
boolean |
getBidiFlag() |
float |
getCharWidth(char character) |
int |
getStringWidth(java.lang.String text) |
int |
getWordPosition(java.lang.String stringIn,
int directionIn,
int p_216863_3_,
boolean p_216863_4_) |
int |
getWordWrappedHeight(java.lang.String str,
int maxLength) |
java.util.List<java.lang.String> |
listFormattedStringToWidth(java.lang.String str,
int wrapWidth) |
private void |
renderSplitString(java.lang.String str,
int x,
int y,
int wrapWidth,
int textColor) |
int |
renderString(java.lang.String text,
float x,
float y,
int color,
boolean dropShadow,
Matrix4f matrix,
IRenderTypeBuffer buffer,
boolean transparentIn,
int colorBackgroundIn,
int packedLight) |
private int |
renderString(java.lang.String text,
float x,
float y,
int color,
Matrix4f matrix,
boolean dropShadow) |
private int |
renderStringAt(java.lang.String text,
float x,
float y,
int color,
boolean dropShadow,
Matrix4f matrix,
IRenderTypeBuffer buffer,
boolean transparentIn,
int colorBackgroundIn,
int packedLight) |
private float |
renderStringAtPos(java.lang.String text,
float x,
float y,
int color,
boolean isShadow,
Matrix4f matrix,
IRenderTypeBuffer buffer,
boolean isTransparent,
int colorBackgroundIn,
int packedLight) |
void |
setBidiFlag(boolean bidiFlagIn) |
void |
setGlyphProviders(java.util.List<IGlyphProvider> gliphProviders) |
int |
sizeStringToWidth(java.lang.String str,
int wrapWidth) |
private java.lang.String |
trimStringNewline(java.lang.String text) |
java.lang.String |
trimStringToWidth(java.lang.String text,
int width) |
java.lang.String |
trimStringToWidth(java.lang.String text,
int width,
boolean reverse) |
java.lang.String |
wrapFormattedStringToWidth(java.lang.String str,
int wrapWidth) |
public final int FONT_HEIGHT
public final java.util.Random random
private final TextureManager textureManager
private final Font font
private boolean bidiFlag
public FontRenderer(TextureManager textureManagerIn, Font fontIn)
public void setGlyphProviders(java.util.List<IGlyphProvider> gliphProviders)
public void close()
close
in interface java.lang.AutoCloseable
public int drawStringWithShadow(java.lang.String text, float x, float y, int color)
public int drawString(java.lang.String text, float x, float y, int color)
public java.lang.String bidiReorder(java.lang.String text)
private int renderString(java.lang.String text, float x, float y, int color, Matrix4f matrix, boolean dropShadow)
public int renderString(java.lang.String text, float x, float y, int color, boolean dropShadow, Matrix4f matrix, IRenderTypeBuffer buffer, boolean transparentIn, int colorBackgroundIn, int packedLight)
private int renderStringAt(java.lang.String text, float x, float y, int color, boolean dropShadow, Matrix4f matrix, IRenderTypeBuffer buffer, boolean transparentIn, int colorBackgroundIn, int packedLight)
private float renderStringAtPos(java.lang.String text, float x, float y, int color, boolean isShadow, Matrix4f matrix, IRenderTypeBuffer buffer, boolean isTransparent, int colorBackgroundIn, int packedLight)
private void drawGlyph(TexturedGlyph glyphIn, boolean boldIn, boolean italicIn, float boldOffsetIn, float xIn, float yIn, Matrix4f matrix, IVertexBuilder bufferIn, float redIn, float greenIn, float blueIn, float alphaIn, int packedLight)
public int getStringWidth(java.lang.String text)
public float getCharWidth(char character)
public java.lang.String trimStringToWidth(java.lang.String text, int width)
public java.lang.String trimStringToWidth(java.lang.String text, int width, boolean reverse)
private java.lang.String trimStringNewline(java.lang.String text)
public void drawSplitString(java.lang.String str, int x, int y, int wrapWidth, int textColor)
private void renderSplitString(java.lang.String str, int x, int y, int wrapWidth, int textColor)
public int getWordWrappedHeight(java.lang.String str, int maxLength)
public void setBidiFlag(boolean bidiFlagIn)
public java.util.List<java.lang.String> listFormattedStringToWidth(java.lang.String str, int wrapWidth)
public java.lang.String wrapFormattedStringToWidth(java.lang.String str, int wrapWidth)
public int sizeStringToWidth(java.lang.String str, int wrapWidth)
public int getWordPosition(java.lang.String stringIn, int directionIn, int p_216863_3_, boolean p_216863_4_)
public boolean getBidiFlag()