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 color) bidirectionalShaping(String text) Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering.intdrawInBatch(String text, float x, float y, int color, boolean dropShadow, org.joml.Matrix4f matrix, MultiBufferSource buffer, Font.DisplayMode displayMode, int backgroundColor, int packedLightCoords) intdrawInBatch(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) intdrawInBatch(Component text, float x, float y, int color, boolean dropShadow, org.joml.Matrix4f matrix, MultiBufferSource buffer, Font.DisplayMode displayMode, int backgroundColor, int packedLightCoords) intdrawInBatch(FormattedCharSequence text, float x, float y, int color, boolean dropShadow, org.joml.Matrix4f matrix, MultiBufferSource buffer, Font.DisplayMode displayMode, int backgroundColor, int packedLightCoords) voiddrawInBatch8xOutline(FormattedCharSequence text, float x, float y, int color, int backgroundColor, org.joml.Matrix4f matrix, MultiBufferSource bufferSource, int packedLightCoords) private intdrawInternal(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) private intdrawInternal(FormattedCharSequence text, float x, float y, int color, boolean dropShadow, org.joml.Matrix4f matrix, MultiBufferSource buffer, Font.DisplayMode displayMode, int backgroundColor, int packedLightCoords) (package private) FontSetgetFontSet(ResourceLocation fontLocation) booleanplainSubstrByWidth(String text, int maxWidth) plainSubstrByWidth(String text, int maxWidth, boolean tail) (package private) voidrenderChar(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) private floatrenderText(String text, float x, float y, int color, boolean dropShadow, org.joml.Matrix4f matrix, MultiBufferSource buffer, Font.DisplayMode displayMode, int backgroundColor, int packedLightCoords) private floatrenderText(FormattedCharSequence text, float x, float y, int color, boolean dropShadow, org.joml.Matrix4f matrix, MultiBufferSource buffer, Font.DisplayMode displayMode, int backgroundColor, int packedLightCoords) self()split(FormattedText text, int maxWidth) substrByWidth(FormattedText text, int maxWidth) intReturns the width of this string.intwidth(FormattedText text) intwidth(FormattedCharSequence text) intwordWrapHeight(String text, int maxWidth) Returns the height (in pixels) of the given string if it is wordwrapped to the given max width.intwordWrapHeight(FormattedText text, int maxWidth) 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 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
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
-