public class FontRenderer extends java.lang.Object implements IResourceManagerReloadListener
Modifier and Type | Field and Description |
---|---|
private float |
alpha |
private boolean |
bidiFlag |
private float |
blue |
private boolean |
boldStyle |
protected int[] |
charWidth |
private int[] |
colorCode |
int |
FONT_HEIGHT |
java.util.Random |
fontRandom |
protected byte[] |
glyphWidth |
private float |
green |
private boolean |
italicStyle |
protected ResourceLocation |
locationFontTexture |
protected float |
posX |
protected float |
posY |
private boolean |
randomStyle |
private float |
red |
private TextureManager |
renderEngine |
private boolean |
strikethroughStyle |
private int |
textColor |
private boolean |
underlineStyle |
private static ResourceLocation[] |
UNICODE_PAGE_LOCATIONS |
private boolean |
unicodeFlag |
Constructor and Description |
---|
FontRenderer(GameSettings gameSettingsIn,
ResourceLocation location,
TextureManager textureManagerIn,
boolean unicode) |
Modifier and Type | Method and Description |
---|---|
private java.lang.String |
bidiReorder(java.lang.String text) |
protected void |
bindTexture(ResourceLocation location) |
protected void |
doDraw(float f) |
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,
boolean dropShadow) |
int |
drawString(java.lang.String text,
int x,
int y,
int color) |
int |
drawStringWithShadow(java.lang.String text,
float x,
float y,
int color) |
protected void |
enableAlpha() |
boolean |
getBidiFlag() |
int |
getCharWidth(char character) |
int |
getColorCode(char character) |
static java.lang.String |
getFormatFromString(java.lang.String text) |
protected IResource |
getResource(ResourceLocation location) |
int |
getStringWidth(java.lang.String text) |
boolean |
getUnicodeFlag() |
private ResourceLocation |
getUnicodePageLocation(int page) |
int |
getWordWrappedHeight(java.lang.String str,
int maxLength) |
private static boolean |
isFormatColor(char colorChar) |
private static boolean |
isFormatSpecial(char formatChar) |
java.util.List<java.lang.String> |
listFormattedStringToWidth(java.lang.String str,
int wrapWidth) |
private void |
loadGlyphTexture(int page) |
void |
onResourceManagerReload(IResourceManager resourceManager) |
private void |
readFontTexture() |
private void |
readGlyphSizes() |
private float |
renderChar(char ch,
boolean italic) |
protected float |
renderDefaultChar(int ch,
boolean italic) |
private void |
renderSplitString(java.lang.String str,
int x,
int y,
int wrapWidth,
boolean addShadow) |
private int |
renderString(java.lang.String text,
float x,
float y,
int color,
boolean dropShadow) |
private int |
renderStringAligned(java.lang.String text,
int x,
int y,
int width,
int color,
boolean dropShadow) |
private void |
renderStringAtPos(java.lang.String text,
boolean shadow) |
protected float |
renderUnicodeChar(char ch,
boolean italic) |
private void |
resetStyles() |
void |
setBidiFlag(boolean bidiFlagIn) |
protected void |
setColor(float r,
float g,
float b,
float a) |
void |
setUnicodeFlag(boolean unicodeFlagIn) |
private 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) |
(package private) java.lang.String |
wrapFormattedStringToWidth(java.lang.String str,
int wrapWidth) |
private static final ResourceLocation[] UNICODE_PAGE_LOCATIONS
protected final int[] charWidth
public int FONT_HEIGHT
public java.util.Random fontRandom
protected final byte[] glyphWidth
private final int[] colorCode
protected final ResourceLocation locationFontTexture
private final TextureManager renderEngine
protected float posX
protected float posY
private boolean unicodeFlag
private boolean bidiFlag
private float red
private float blue
private float green
private float alpha
private int textColor
private boolean randomStyle
private boolean boldStyle
private boolean italicStyle
private boolean underlineStyle
private boolean strikethroughStyle
public FontRenderer(GameSettings gameSettingsIn, ResourceLocation location, TextureManager textureManagerIn, boolean unicode)
public void onResourceManagerReload(IResourceManager resourceManager)
onResourceManagerReload
in interface IResourceManagerReloadListener
private void readFontTexture()
private void readGlyphSizes()
private float renderChar(char ch, boolean italic)
protected float renderDefaultChar(int ch, boolean italic)
private ResourceLocation getUnicodePageLocation(int page)
private void loadGlyphTexture(int page)
protected float renderUnicodeChar(char ch, boolean italic)
public int drawStringWithShadow(java.lang.String text, float x, float y, int color)
public int drawString(java.lang.String text, int x, int y, int color)
public int drawString(java.lang.String text, float x, float y, int color, boolean dropShadow)
private java.lang.String bidiReorder(java.lang.String text)
private void resetStyles()
private void renderStringAtPos(java.lang.String text, boolean shadow)
protected void doDraw(float f)
private int renderStringAligned(java.lang.String text, int x, int y, int width, int color, boolean dropShadow)
private int renderString(java.lang.String text, float x, float y, int color, boolean dropShadow)
public int getStringWidth(java.lang.String text)
public int 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, boolean addShadow)
public int getWordWrappedHeight(java.lang.String str, int maxLength)
public void setUnicodeFlag(boolean unicodeFlagIn)
public boolean getUnicodeFlag()
public void setBidiFlag(boolean bidiFlagIn)
public java.util.List<java.lang.String> listFormattedStringToWidth(java.lang.String str, int wrapWidth)
java.lang.String wrapFormattedStringToWidth(java.lang.String str, int wrapWidth)
private int sizeStringToWidth(java.lang.String str, int wrapWidth)
private static boolean isFormatColor(char colorChar)
private static boolean isFormatSpecial(char formatChar)
public static java.lang.String getFormatFromString(java.lang.String text)
public boolean getBidiFlag()
protected void setColor(float r, float g, float b, float a)
protected void enableAlpha()
protected void bindTexture(ResourceLocation location)
protected IResource getResource(ResourceLocation location) throws java.io.IOException
java.io.IOException
public int getColorCode(char character)