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 enumstatic interfacestatic interface(package private) class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final floatbooleanNeo: enables linear filtering on text(package private) final booleanprivate final Function<ResourceLocation, FontSet> final intstatic final intprivate static final floatfinal RandomSourcestatic final floatprivate final StringSplitterprivate static final floatFields inherited from interface net.neoforged.neoforge.client.extensions.IFontExtension
ELLIPSIS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbidirectionalShaping(String text) Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering.voiddrawInBatch(String text, float x, float y, int color, boolean drawShadow, Matrix4f pose, MultiBufferSource bufferSource, Font.DisplayMode mode, int backgroundColor, int packedLightCoords) voiddrawInBatch(Component text, float x, float y, int color, boolean drawShadow, Matrix4f pose, MultiBufferSource bufferSource, Font.DisplayMode mode, int backgroundColor, int packedLightCoords) voiddrawInBatch(FormattedCharSequence text, float x, float y, int color, boolean drawShadow, Matrix4f pose, MultiBufferSource bufferSource, Font.DisplayMode mode, int backgroundColor, int packedLightCoords) voiddrawInBatch8xOutline(FormattedCharSequence text, float x, float y, int color, int backgroundColor, Matrix4f pose, MultiBufferSource bufferSource, int packedLightCoords) (package private) FontSetgetFontSet(ResourceLocation fontLocation) booleanplainSubstrByWidth(String text, int maxWidth) plainSubstrByWidth(String text, int maxWidth, boolean tail) prepareText(String text, float x, float y, int color, boolean dropShadow, int backgroundColor) prepareText(FormattedCharSequence text, float x, float y, int color, boolean dropShadow, int backgroundColor) self()split(FormattedText text, int maxWidth) splitIgnoringLanguage(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:
-
OVER_EFFECT_DEPTH
private static final float OVER_EFFECT_DEPTH- See Also:
-
UNDER_EFFECT_DEPTH
private static final float UNDER_EFFECT_DEPTH- See Also:
-
SHADOW_DEPTH
public static final float SHADOW_DEPTH- See Also:
-
NO_SHADOW
public static final int NO_SHADOW- See Also:
-
lineHeight
public final int lineHeight- See Also:
-
random
-
fonts
-
filterFishyGlyphs
final boolean filterFishyGlyphs -
splitter
-
enableTextTextureLinearFiltering
public boolean enableTextTextureLinearFilteringNeo: enables linear filtering on text
-
-
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 void drawInBatch(String text, float x, float y, int color, boolean drawShadow, Matrix4f pose, MultiBufferSource bufferSource, Font.DisplayMode mode, int backgroundColor, int packedLightCoords) -
drawInBatch
public void drawInBatch(Component text, float x, float y, int color, boolean drawShadow, Matrix4f pose, MultiBufferSource bufferSource, Font.DisplayMode mode, int backgroundColor, int packedLightCoords) -
drawInBatch
public void drawInBatch(FormattedCharSequence text, float x, float y, int color, boolean drawShadow, Matrix4f pose, MultiBufferSource bufferSource, Font.DisplayMode mode, int backgroundColor, int packedLightCoords) -
drawInBatch8xOutline
public void drawInBatch8xOutline(FormattedCharSequence text, float x, float y, int color, int backgroundColor, Matrix4f pose, MultiBufferSource bufferSource, int packedLightCoords) -
prepareText
public Font.PreparedText prepareText(String text, float x, float y, int color, boolean dropShadow, int backgroundColor) -
prepareText
public Font.PreparedText prepareText(FormattedCharSequence text, float x, float y, int color, boolean dropShadow, int backgroundColor) -
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
-
splitIgnoringLanguage
-
isBidirectional
public boolean isBidirectional() -
getSplitter
-
self
- Specified by:
selfin interfaceIFontExtension
-