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 floatbooleanNeo: enables linear filtering on text(package private) final booleanprivate final Function<ResourceLocation, FontSet> final intstatic final intfinal RandomSourcestatic final floatprivate 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, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) intdrawInBatch(Component pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) intdrawInBatch(Component pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) intdrawInBatch(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) voiddrawInBatch8xOutline(FormattedCharSequence pText, float pX, float pY, int pColor, int pBackgroundColor, Matrix4f pPose, MultiBufferSource pBufferSource, int pPackedLightCoords) private intdrawInternal(String pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) private intdrawInternal(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) (package private) FontSetgetFontSet(ResourceLocation pFontLocation) booleanplainSubstrByWidth(String pText, int pMaxWidth) plainSubstrByWidth(String pText, int pMaxWidth, boolean pTail) private floatrenderText(String pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) private floatrenderText(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) 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_DEPTH
public static final float SHADOW_DEPTH- See Also:
-
NO_SHADOW
public static final int NO_SHADOW- See Also:
-
ALPHA_CUTOFF
public static final int ALPHA_CUTOFF- 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 int drawInBatch(String pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) -
drawInBatch
public int drawInBatch(Component pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) -
drawInBatch
public int drawInBatch(Component pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) -
drawInBatch
public int drawInBatch(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) -
drawInBatch8xOutline
public void drawInBatch8xOutline(FormattedCharSequence pText, float pX, float pY, int pColor, int pBackgroundColor, Matrix4f pPose, 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, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) -
drawInternal
private int drawInternal(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) -
renderText
private float renderText(String pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) -
renderText
private float renderText(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) -
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
-