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
boolean
Neo: enables linear filtering on text(package private) final boolean
private final Function
<ResourceLocation, FontSet> final int
static final int
final RandomSource
static final float
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 pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) int
drawInBatch
(Component pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) int
drawInBatch
(Component pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) int
drawInBatch
(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords) void
drawInBatch8xOutline
(FormattedCharSequence pText, float pX, float pY, int pColor, int pBackgroundColor, org.joml.Matrix4f pPose, MultiBufferSource pBufferSource, int pPackedLightCoords) private int
drawInternal
(String pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) private int
drawInternal
(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) (package private) FontSet
getFontSet
(ResourceLocation pFontLocation) boolean
plainSubstrByWidth
(String pText, int pMaxWidth) plainSubstrByWidth
(String pText, int pMaxWidth, boolean pTail) private float
renderText
(String pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) private float
renderText
(FormattedCharSequence pText, float pX, float pY, int pColor, boolean pDropShadow, org.joml.Matrix4f pPose, MultiBufferSource pBufferSource, Font.DisplayMode pDisplayMode, int pBackgroundColor, int pPackedLightCoords, boolean pInverseDepth) 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_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, org.joml.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, org.joml.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, org.joml.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, org.joml.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, org.joml.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, org.joml.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, org.joml.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, org.joml.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, org.joml.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:
self
in interfaceIFontExtension
-