Package net.minecraft.client.gui
Class FontRenderer
- java.lang.Object
-
- net.minecraft.client.gui.FontRenderer
-
- All Implemented Interfaces:
IResourceManagerReloadListener
- Direct Known Subclasses:
EaglerFontRenderer
public class FontRenderer extends java.lang.Object implements IResourceManagerReloadListener
+ This portion of EaglercraftX contains deobfuscated Minecraft 1.8 source code. Minecraft 1.8.8 bytecode is (c) 2015 Mojang AB. "Do not distribute!" Mod Coder Pack v9.18 deobfuscation configs are (c) Copyright by the MCP Team EaglercraftX 1.8 patch files are (c) 2022-2023 LAX1DUDE. All Rights Reserved. WITH THE EXCEPTION OF PATCH FILES, MINIFIED JAVASCRIPT, AND ALL FILES NORMALLY FOUND IN AN UNMODIFIED MINECRAFT RESOURCE PACK, YOU ARE NOT ALLOWED TO SHARE, DISTRIBUTE, OR REPURPOSE ANY FILE USED BY OR PRODUCED BY THE SOFTWARE IN THIS REPOSITORY WITHOUT PRIOR PERMISSION FROM THE PROJECT AUTHOR. NOT FOR COMMERCIAL OR MALICIOUS USE (please read the 'LICENSE' file this repo's root directory for more info)
-
-
Field Summary
Fields Modifier and Type Field Description protected floatalphaprotected booleanbidiFlagprotected floatblueprotected booleanboldStyleprotected int[]charWidth+ Array of width of all the characters in default.pngprotected int[]colorCode+ Array of RGB triplets defining the 16 standard chat colors followed by 16 darker version of the same colors for drop shadows.intFONT_HEIGHT+ the height in pixels of default textEaglercraftRandomfontRandomprotected byte[]glyphWidth+ Array of the start/end column (in upper/lower nibble) for every glyph in the /font directory.protected floatgreenprotected booleanitalicStyleprotected ResourceLocationlocationFontTextureprotected floatposXprotected floatposYprotected booleanrandomStyleprotected floatredprotected TextureManagerrenderEngineprotected booleanstrikethroughStyleprotected inttextColorprotected booleanunderlineStyleprotected booleanunicodeFlagprotected static ResourceLocation[]unicodePageLocations
-
Constructor Summary
Constructors Constructor Description FontRenderer(GameSettings gameSettingsIn, ResourceLocation location, TextureManager textureManagerIn, boolean unicode)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddrawSplitString(java.lang.String str, int x, int y, int wrapWidth, int textColor)+ Splits and draws a String with wordwrap (maximum length is parameter k)intdrawString(java.lang.String text, float x, float y, int color, boolean dropShadow)+ Draws the specified string.intdrawString(java.lang.String text, int x, int y, int color)+ Draws the specified string.intdrawStringWithShadow(java.lang.String text, float x, float y, int color)+ Draws the specified string with a shadow.booleangetBidiFlag()+ Get bidiFlag that controls if the Unicode Bidirectional Algorithm should be run before rendering any stringintgetCharWidth(char character)+ Returns the width of this character as rendered.intgetColorCode(char character)static java.lang.StringgetFormatFromString(java.lang.String text)+ Digests a string for nonprinting formatting characters then returns a string containing only that formatting.intgetStringWidth(java.lang.String text)+ Returns the width of this string.booleangetUnicodeFlag()+ Get unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png font.java.util.List<java.lang.String>listFormattedStringToWidth(java.lang.String str, int wrapWidth)+ Breaks a string into a list of pieces that will fit a specified width.voidonResourceManagerReload(IResourceManager resourceManager)protected voidrenderStringAtPos(java.lang.String parString1, boolean parFlag)+ Render a single line string at the current (posX,posY) and update posXprotected voidresetStyles()+ Reset all style flag fields in the class to false; called at the start of string renderingvoidsetBidiFlag(boolean bidiFlagIn)+ Set bidiFlag to control if the Unicode Bidirectional Algorithm should be run before rendering any string.voidsetUnicodeFlag(boolean unicodeFlagIn)+ Set unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png font.intsplitStringWidth(java.lang.String parString1, int parInt1)+ Returns the width of the wordwrapped String (maximum length is parameter k)java.lang.StringtrimStringToWidth(java.lang.String text, int width)+ Trims a string to fit a specified Width.java.lang.StringtrimStringToWidth(java.lang.String text, int width, boolean reverse)+ Trims a string to fit a specified Width.
-
-
-
Field Detail
-
unicodePageLocations
protected static final ResourceLocation[] unicodePageLocations
-
charWidth
protected int[] charWidth
+ Array of width of all the characters in default.png
-
FONT_HEIGHT
public int FONT_HEIGHT
+ the height in pixels of default text
-
fontRandom
public EaglercraftRandom fontRandom
-
glyphWidth
protected byte[] glyphWidth
+ Array of the start/end column (in upper/lower nibble) for every glyph in the /font directory.
-
colorCode
protected int[] colorCode
+ Array of RGB triplets defining the 16 standard chat colors followed by 16 darker version of the same colors for drop shadows.
-
locationFontTexture
protected final ResourceLocation locationFontTexture
-
renderEngine
protected final TextureManager renderEngine
-
posX
protected float posX
-
posY
protected float posY
-
unicodeFlag
protected boolean unicodeFlag
-
bidiFlag
protected boolean bidiFlag
-
red
protected float red
-
blue
protected float blue
-
green
protected float green
-
alpha
protected float alpha
-
textColor
protected int textColor
-
randomStyle
protected boolean randomStyle
-
boldStyle
protected boolean boldStyle
-
italicStyle
protected boolean italicStyle
-
underlineStyle
protected boolean underlineStyle
-
strikethroughStyle
protected boolean strikethroughStyle
-
-
Constructor Detail
-
FontRenderer
public FontRenderer(GameSettings gameSettingsIn, ResourceLocation location, TextureManager textureManagerIn, boolean unicode)
-
-
Method Detail
-
onResourceManagerReload
public void onResourceManagerReload(IResourceManager resourceManager)
- Specified by:
onResourceManagerReloadin interfaceIResourceManagerReloadListener
-
drawStringWithShadow
public int drawStringWithShadow(java.lang.String text, float x, float y, int color)+ Draws the specified string with a shadow.
-
drawString
public int drawString(java.lang.String text, int x, int y, int color)+ Draws the specified string.
-
drawString
public int drawString(java.lang.String text, float x, float y, int color, boolean dropShadow)+ Draws the specified string.
-
resetStyles
protected void resetStyles()
+ Reset all style flag fields in the class to false; called at the start of string rendering
-
renderStringAtPos
protected void renderStringAtPos(java.lang.String parString1, boolean parFlag)+ Render a single line string at the current (posX,posY) and update posX
-
getStringWidth
public int getStringWidth(java.lang.String text)
+ Returns the width of this string. Equivalent of FontMetrics.stringWidth(String s).
-
getCharWidth
public int getCharWidth(char character)
+ Returns the width of this character as rendered.
-
trimStringToWidth
public java.lang.String trimStringToWidth(java.lang.String text, int width)+ Trims a string to fit a specified Width.
-
trimStringToWidth
public java.lang.String trimStringToWidth(java.lang.String text, int width, boolean reverse)+ Trims a string to fit a specified Width.
-
drawSplitString
public void drawSplitString(java.lang.String str, int x, int y, int wrapWidth, int textColor)+ Splits and draws a String with wordwrap (maximum length is parameter k)
-
splitStringWidth
public int splitStringWidth(java.lang.String parString1, int parInt1)+ Returns the width of the wordwrapped String (maximum length is parameter k)
-
setUnicodeFlag
public void setUnicodeFlag(boolean unicodeFlagIn)
+ 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 bidiFlagIn)
+ Set bidiFlag to control if the Unicode Bidirectional Algorithm should be run before rendering any string.
-
listFormattedStringToWidth
public java.util.List<java.lang.String> listFormattedStringToWidth(java.lang.String str, int wrapWidth)+ Breaks a string into a list of pieces that will fit a specified width.
-
getFormatFromString
public static java.lang.String getFormatFromString(java.lang.String text)
+ Digests a string for nonprinting formatting characters then returns a string containing only that formatting.
-
getBidiFlag
public boolean getBidiFlag()
+ Get bidiFlag that controls if the Unicode Bidirectional Algorithm should be run before rendering any string
-
getColorCode
public int getColorCode(char character)
-
-