Class FontRenderer

java.lang.Object
net.minecraft.src.FontRenderer
All Implemented Interfaces:
ResourceManagerReloadListener

@Environment(CLIENT) public class FontRenderer extends Object implements ResourceManagerReloadListener
  • Field Details

    • FONT_HEIGHT

      public int FONT_HEIGHT
      the height in pixels of default text
    • fontRandom

      public Random fontRandom
    • charWidthf

      public float[] charWidthf
    • isHD

      public boolean isHD
    • fontAdj

      public float fontAdj
  • Constructor Details

  • Method Details

    • onResourceManagerReload

      public void onResourceManagerReload(ResourceManager par1ResourceManager)
      Specified by:
      onResourceManagerReload in interface ResourceManagerReloadListener
    • readFontTexture

      public void readFontTexture()
    • drawStringWithShadow

      public int drawStringWithShadow(String par1Str, int par2, int par3, int par4)
      Draws the specified string with a shadow.
    • drawString

      public int drawString(String par1Str, int par2, int par3, int par4)
      Draws the specified string.
    • drawString

      public int drawString(String par1Str, int par2, int par3, int par4, boolean par5)
      Draws the specified string. Args: string, x, y, color, dropShadow
    • applyCustomFormatCodes

      public int applyCustomFormatCodes(String str, boolean shadow, int i)
      Hook for EMI
    • getStringWidth

      public int getStringWidth(String par1Str)
      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

      public String trimStringToWidth(String par1Str, int par2)
      Trims a string to fit a specified Width.
    • trimStringToWidth

      public String trimStringToWidth(String par1Str, int par2, boolean par3)
      Trims a string to a specified width, and will reverse it if par3 is set.
    • drawSplitString

      public void drawSplitString(String par1Str, int par2, int par3, int par4, int par5)
      Splits and draws a String with wordwrap (maximum length is parameter k)
    • splitStringWidth

      public int splitStringWidth(String par1Str, int par2)
      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

      public List listFormattedStringToWidth(String par1Str, int par2)
      Breaks a string into a list of pieces that will fit a specified width.
    • wrapFormattedStringToWidth

      public String wrapFormattedStringToWidth(String par1Str, int par2)
      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

      public ResourceLocation getDefaultFont()
    • setDefaultFont

      public void setDefaultFont(ResourceLocation var1)
    • getHDFont

      public ResourceLocation getHDFont()
    • setHDFont

      public void setHDFont(ResourceLocation var1)