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 color) bidirectionalShaping
(String text) Apply Unicode Bidirectional Algorithm to string and return a new possibly reordered string for visual rendering.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) 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) 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) 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) void
drawInBatch8xOutline
(FormattedCharSequence text, float x, float y, int color, int backgroundColor, org.joml.Matrix4f matrix, MultiBufferSource bufferSource, int packedLightCoords) 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) 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) (package private) FontSet
getFontSet
(ResourceLocation fontLocation) boolean
plainSubstrByWidth
(String text, int maxWidth) plainSubstrByWidth
(String text, int maxWidth, boolean tail) (package private) 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) 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) 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) self()
split
(FormattedText text, int maxWidth) substrByWidth
(FormattedText text, int maxWidth) int
Returns the width of this string.int
width
(FormattedText text) int
width
(FormattedCharSequence text) int
wordWrapHeight
(String text, int maxWidth) Returns the height (in pixels) of the given string if it is wordwrapped to the given max width.int
wordWrapHeight
(FormattedText text, int maxWidth) 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 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:
self
in interfaceIFontExtension
-