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 int
private static final float
(package private) final boolean
private final Function
<ResourceLocation, FontSet> final int
final RandomSource
private static final org.joml.Vector3f
private final StringSplitter
Fields inherited from interface net.neoforged.neoforge.client.extensions.IFontExtension
ELLIPSIS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static int
adjustColor
(int pColor) bidirectionalShaping
(String pText) Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering.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) 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) 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) 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) void
drawInBatch8xOutline
(FormattedCharSequence pText, float pX, float pY, int pColor, int pBackgroundColor, org.joml.Matrix4f pMatrix, MultiBufferSource pBufferSource, int pPackedLightCoords) 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) 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) (package private) FontSet
getFontSet
(ResourceLocation pFontLocation) boolean
plainSubstrByWidth
(String pText, int pMaxWidth) plainSubstrByWidth
(String pText, int pMaxWidth, boolean pTail) (package private) 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) 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) 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) self()
split
(FormattedText pText, int pMaxWidth) substrByWidth
(FormattedText pText, int pMaxWidth) int
Returns the width of this string.int
width
(FormattedText pText) int
width
(FormattedCharSequence pText) int
wordWrapHeight
(String pText, int pMaxWidth) Returns the height (in pixels) of the given string if it is wordwrapped to the given max width.int
wordWrapHeight
(FormattedText pText, int pMaxWidth) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
self
in interfaceIFontExtension
-