Package net.minecraft.src
Class FontRenderer
java.lang.Object
net.minecraft.src.FontRenderer
- All Implemented Interfaces:
ResourceManagerReloadListener
@Environment(CLIENT)
public class FontRenderer
extends Object
implements ResourceManagerReloadListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionfloat[]intthe height in pixels of default textfloatboolean -
Constructor Summary
ConstructorsConstructorDescriptionFontRenderer(GameSettings par1GameSettings, ResourceLocation par2ResourceLocation, TextureManager par3TextureManager, boolean par4) -
Method Summary
Modifier and TypeMethodDescriptionintapplyCustomFormatCodes(String str, boolean shadow, int i) Hook for EMIvoiddrawSplitString(String par1Str, int par2, int par3, int par4, int par5) Splits and draws a String with wordwrap (maximum length is parameter k)intdrawString(String par1Str, int par2, int par3, int par4) Draws the specified string.intdrawString(String par1Str, int par2, int par3, int par4, boolean par5) Draws the specified string.intdrawStringWithShadow(String par1Str, int par2, int par3, int par4) Draws the specified string with a shadow.booleanGet bidiFlag that controls if the Unicode Bidirectional Algorithm should be run before rendering any stringintgetCharWidth(char par1) Returns the width of this character as rendered.intgetStringWidth(String par1Str) Returns the width of this string.booleanGet unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png font.listFormattedStringToWidth(String par1Str, int par2) Breaks a string into a list of pieces that will fit a specified width.voidonResourceManagerReload(ResourceManager par1ResourceManager) voidvoidsetBidiFlag(boolean par1) Set bidiFlag to control if the Unicode Bidirectional Algorithm should be run before rendering any string.voidvoidsetHDFont(ResourceLocation var1) voidsetUnicodeFlag(boolean par1) Set unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png font.intsplitStringWidth(String par1Str, int par2) Returns the width of the wordwrapped String (maximum length is parameter k)trimStringToWidth(String par1Str, int par2) Trims a string to fit a specified Width.trimStringToWidth(String par1Str, int par2, boolean par3) Trims a string to a specified width, and will reverse it if par3 is set.wrapFormattedStringToWidth(String par1Str, int par2) Inserts newline and formatting into a string to wrap it within the specified width.
-
Field Details
-
FONT_HEIGHT
public int FONT_HEIGHTthe height in pixels of default text -
fontRandom
-
charWidthf
public float[] charWidthf -
isHD
public boolean isHD -
fontAdj
public float fontAdj
-
-
Constructor Details
-
FontRenderer
public FontRenderer(GameSettings par1GameSettings, ResourceLocation par2ResourceLocation, TextureManager par3TextureManager, boolean par4)
-
-
Method Details
-
onResourceManagerReload
- Specified by:
onResourceManagerReloadin interfaceResourceManagerReloadListener
-
readFontTexture
public void readFontTexture() -
drawStringWithShadow
Draws the specified string with a shadow. -
drawString
Draws the specified string. -
drawString
Draws the specified string. Args: string, x, y, color, dropShadow -
applyCustomFormatCodes
Hook for EMI -
getStringWidth
Returns the width of this string. Equivalent of FontMetrics.stringWidth(String s). -
getCharWidth
public int getCharWidth(char par1) Returns the width of this character as rendered. -
trimStringToWidth
Trims a string to fit a specified Width. -
trimStringToWidth
Trims a string to a specified width, and will reverse it if par3 is set. -
drawSplitString
Splits and draws a String with wordwrap (maximum length is parameter k) -
splitStringWidth
Returns the width of the wordwrapped String (maximum length is parameter k) -
setUnicodeFlag
public void setUnicodeFlag(boolean par1) Set unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png font. -
getUnicodeFlag
public boolean getUnicodeFlag()Get unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png font. -
setBidiFlag
public void setBidiFlag(boolean par1) Set bidiFlag to control if the Unicode Bidirectional Algorithm should be run before rendering any string. -
listFormattedStringToWidth
Breaks a string into a list of pieces that will fit a specified width. -
wrapFormattedStringToWidth
Inserts newline and formatting into a string to wrap it within the specified width. -
getBidiFlag
public boolean getBidiFlag()Get bidiFlag that controls if the Unicode Bidirectional Algorithm should be run before rendering any string -
getDefaultFont
-
setDefaultFont
-
getHDFont
-
setHDFont
-