Package net.minecraft.client.gui
Class Font
java.lang.Object
net.minecraft.client.gui.Font
- All Implemented Interfaces:
IFontExtension
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum(package private) class -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intprivate static final float(package private) final booleanprivate final Function<ResourceLocation, FontSet> final intfinal RandomSourceprivate static final org.joml.Vector3fprivate final StringSplitterFields inherited from interface net.neoforged.neoforge.client.extensions.IFontExtension
ELLIPSIS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static intadjustColor(int pColor) bidirectionalShaping(String pText) Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering.intdrawInBatch(String pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) intdrawInBatch(String pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pBidirectional) intdrawInBatch(Component pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) intdrawInBatch(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) voiddrawInBatch8xOutline(FormattedCharSequence pText, float pX, float pY, int pColor, int pBackgroundColor, org.joml.Matrix4f pMatrix, MultiBufferSource pBufferSource, int pPackedLightCoords) private intdrawInternal(String pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pBidirectional) private intdrawInternal(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) (package private) FontSetgetFontSet(ResourceLocation pFontLocation) booleanplainSubstrByWidth(String pText, int pMaxWidth) plainSubstrByWidth(String pText, int pMaxWidth, boolean pTail) (package private) voidrenderChar(BakedGlyph pGlyph, boolean pBold, boolean pItalic, float pBoldOffset, float pX, float pY, org.joml.Matrix4f pMatrix, VertexConsumer pBuffer, float pRed, float pGreen, float pBlue, float pAlpha, int pPackedLight) private floatrenderText(String pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) private floatrenderText(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) self()split(FormattedText pText, int pMaxWidth) substrByWidth(FormattedText pText, int pMaxWidth) intReturns the width of this string.intwidth(FormattedText pText) intwidth(FormattedCharSequence pText) intwordWrapHeight(String pText, int pMaxWidth) Returns the height (in pixels) of the given string if it is wordwrapped to the given max width.intwordWrapHeight(FormattedText pText, int pMaxWidth) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.neoforged.neoforge.client.extensions.IFontExtension
ellipsize
-
Field Details
-
EFFECT_DEPTH
private static final float EFFECT_DEPTH- See Also:
-
SHADOW_OFFSET
private static final org.joml.Vector3f SHADOW_OFFSET -
ALPHA_CUTOFF
public static final int ALPHA_CUTOFF- See Also:
-
lineHeight
public final int lineHeight- See Also:
-
random
-
fonts
-
filterFishyGlyphs
final boolean filterFishyGlyphs -
splitter
-
-
Constructor Details
-
Font
-
-
Method Details
-
getFontSet
-
bidirectionalShaping
Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering. -
drawInBatch
public int drawInBatch(String pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) -
drawInBatch
public int drawInBatch(String pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pBidirectional) -
drawInBatch
public int drawInBatch(Component pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) -
drawInBatch
public int drawInBatch(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) -
drawInBatch8xOutline
public void drawInBatch8xOutline(FormattedCharSequence pText, float pX, float pY, int pColor, int pBackgroundColor, org.joml.Matrix4f pMatrix, MultiBufferSource pBufferSource, int pPackedLightCoords) -
adjustColor
private static int adjustColor(int pColor) -
drawInternal
private int drawInternal(String pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pBidirectional) -
drawInternal
private int drawInternal(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) -
renderText
private float renderText(String pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) -
renderText
private float renderText(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pMatrix, MultiBufferSource pBuffer, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) -
renderChar
void renderChar(BakedGlyph pGlyph, boolean pBold, boolean pItalic, float pBoldOffset, float pX, float pY, org.joml.Matrix4f pMatrix, VertexConsumer pBuffer, float pRed, float pGreen, float pBlue, float pAlpha, int pPackedLight) -
width
Returns the width of this string. Equivalent of FontMetrics.stringWidth(String s). -
width
-
width
-
plainSubstrByWidth
-
plainSubstrByWidth
-
substrByWidth
-
wordWrapHeight
Returns the height (in pixels) of the given string if it is wordwrapped to the given max width. -
wordWrapHeight
-
split
-
isBidirectional
public boolean isBidirectional() -
getSplitter
-
self
- Specified by:
selfin interfaceIFontExtension
-