Class Font

java.lang.Object
net.minecraft.client.gui.Font
All Implemented Interfaces:
IFontExtension

public class Font extends Object implements IFontExtension
  • Field Details

  • Constructor Details

  • Method Details

    • getFontSet

      FontSet getFontSet(ResourceLocation fontLocation)
    • bidirectionalShaping

      public String bidirectionalShaping(String text)
      Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering.
    • drawInBatch

      public int drawInBatch(String text, float x, float y, int color, boolean dropShadow, org.joml.Matrix4f matrix, MultiBufferSource buffer, Font.DisplayMode displayMode, int backgroundColor, int packedLightCoords)
    • drawInBatch

      public int drawInBatch(String text, float x, float y, int color, boolean dropShadow, org.joml.Matrix4f matrix, MultiBufferSource buffer, Font.DisplayMode displayMode, int backgroundColor, int packedLightCoords, boolean bidirectional)
    • drawInBatch

      public int drawInBatch(Component text, float x, float y, int color, boolean dropShadow, org.joml.Matrix4f matrix, MultiBufferSource buffer, Font.DisplayMode displayMode, int backgroundColor, int packedLightCoords)
    • drawInBatch

      public int drawInBatch(FormattedCharSequence text, float x, float y, int color, boolean dropShadow, org.joml.Matrix4f matrix, MultiBufferSource buffer, Font.DisplayMode displayMode, int backgroundColor, int packedLightCoords)
    • drawInBatch8xOutline

      public void drawInBatch8xOutline(FormattedCharSequence text, float x, float y, int color, int backgroundColor, org.joml.Matrix4f matrix, MultiBufferSource bufferSource, int packedLightCoords)
    • adjustColor

      private static int adjustColor(int color)
    • drawInternal

      private int drawInternal(String text, float x, float y, int color, boolean dropShadow, org.joml.Matrix4f matrix, MultiBufferSource buffer, Font.DisplayMode displayMode, int backgroundColor, int packedLightCoords, boolean bidirectional)
    • drawInternal

      private int drawInternal(FormattedCharSequence text, float x, float y, int color, boolean dropShadow, org.joml.Matrix4f matrix, MultiBufferSource buffer, Font.DisplayMode displayMode, int backgroundColor, int packedLightCoords)
    • renderText

      private float renderText(String text, float x, float y, int color, boolean dropShadow, org.joml.Matrix4f matrix, MultiBufferSource buffer, Font.DisplayMode displayMode, int backgroundColor, int packedLightCoords)
    • renderText

      private float renderText(FormattedCharSequence text, float x, float y, int color, boolean dropShadow, org.joml.Matrix4f matrix, MultiBufferSource buffer, Font.DisplayMode displayMode, int backgroundColor, int packedLightCoords)
    • renderChar

      void renderChar(BakedGlyph glyph, boolean bold, boolean italic, float boldOffset, float x, float y, org.joml.Matrix4f matrix, VertexConsumer buffer, float red, float green, float blue, float alpha, int packedLight)
    • width

      public int width(String text)
      Returns the width of this string. Equivalent of FontMetrics.stringWidth(String s).
    • width

      public int width(FormattedText text)
    • width

      public int width(FormattedCharSequence text)
    • plainSubstrByWidth

      public String plainSubstrByWidth(String text, int maxWidth, boolean tail)
    • plainSubstrByWidth

      public String plainSubstrByWidth(String text, int maxWidth)
    • substrByWidth

      public FormattedText substrByWidth(FormattedText text, int maxWidth)
    • wordWrapHeight

      public int wordWrapHeight(String text, int maxWidth)
      Returns the height (in pixels) of the given string if it is wordwrapped to the given max width.
    • wordWrapHeight

      public int wordWrapHeight(FormattedText text, int maxWidth)
    • split

      public List<FormattedCharSequence> split(FormattedText text, int maxWidth)
    • isBidirectional

      public boolean isBidirectional()
    • getSplitter

      public StringSplitter getSplitter()
    • self

      public Font self()
      Specified by:
      self in interface IFontExtension