Record Class GuiTextMetrics
java.lang.Object
java.lang.Record
com.render.api.gui.GuiTextMetrics
- Record Components:
width- logical layout widthheight- logical layout heightascent- maximum line ascentdescent- maximum line descentleading- maximum line leadinginkBounds- actual glyph ink, including overhangs, excluding effectslines- immutable per-line metricstruncated- whether height, max-lines, or ellipsis truncated the sourceeffectBounds- ink expanded by stroke, shadow, glow, and decorations
public record GuiTextMetrics(float width, float height, float ascent, float descent, float leading, GuiRect inkBounds, List<GuiTextMetrics.Line> lines, boolean truncated, GuiRect effectBounds)
extends Record
Immutable aggregate and per-line geometry for a shaped text layout.
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionGuiTextMetrics(float width, float height, float ascent, float descent, float leading, GuiRect inkBounds, List<GuiTextMetrics.Line> lines, boolean truncated) Creates metrics without additional effect expansion for compatibility callers.GuiTextMetrics(float width, float height, float ascent, float descent, float leading, GuiRect inkBounds, List<GuiTextMetrics.Line> lines, boolean truncated, GuiRect effectBounds) Creates an instance of aGuiTextMetricsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatascent()Returns the value of theascentrecord component.floatdescent()Returns the value of thedescentrecord component.Returns the value of theeffectBoundsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatheight()Returns the value of theheightrecord component.Returns the value of theinkBoundsrecord component.floatleading()Returns the value of theleadingrecord component.intlines()Returns the value of thelinesrecord component.Logical line-box extent used for layout; it deliberately includes whitespace and empty lines.final StringtoString()Returns a string representation of this record class.booleanReturns the value of thetruncatedrecord component.floatwidth()Returns the value of thewidthrecord component.
-
Constructor Details
-
GuiTextMetrics
public GuiTextMetrics(float width, float height, float ascent, float descent, float leading, GuiRect inkBounds, List<GuiTextMetrics.Line> lines, boolean truncated) Creates metrics without additional effect expansion for compatibility callers. -
GuiTextMetrics
public GuiTextMetrics(float width, float height, float ascent, float descent, float leading, GuiRect inkBounds, List<GuiTextMetrics.Line> lines, boolean truncated, GuiRect effectBounds) Creates an instance of aGuiTextMetricsrecord class.- Parameters:
width- the value for thewidthrecord componentheight- the value for theheightrecord componentascent- the value for theascentrecord componentdescent- the value for thedescentrecord componentleading- the value for theleadingrecord componentinkBounds- the value for theinkBoundsrecord componentlines- the value for thelinesrecord componenttruncated- the value for thetruncatedrecord componenteffectBounds- the value for theeffectBoundsrecord component
-
-
Method Details
-
lineCount
public int lineCount() -
logicalBounds
Logical line-box extent used for layout; it deliberately includes whitespace and empty lines. -
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
width
-
height
-
ascent
-
descent
-
leading
-
inkBounds
-
lines
-
truncated
-
effectBounds
Returns the value of theeffectBoundsrecord component.- Returns:
- the value of the
effectBoundsrecord component
-