Record Class GuiFontManager.FontMetrics
java.lang.Object
java.lang.Record
com.render.api.gui.GuiFontManager.FontMetrics
- Enclosing class:
GuiFontManager
public static record GuiFontManager.FontMetrics(float lineHeight, float ascent, float descent, float leading)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionFontMetrics(float lineHeight, float ascent, float descent, float leading) Creates an instance of aFontMetricsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfloatascent()Returns the value of theascentrecord component.floatdescent()Returns the value of thedescentrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatleading()Returns the value of theleadingrecord component.floatReturns the value of thelineHeightrecord component.floatoriginOffset(float targetAscent) floatscaleFor(float targetLineHeight) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
FontMetrics
public FontMetrics(float lineHeight, float ascent, float descent, float leading) Creates an instance of aFontMetricsrecord class.- Parameters:
lineHeight- the value for thelineHeightrecord componentascent- the value for theascentrecord componentdescent- the value for thedescentrecord componentleading- the value for theleadingrecord component
-
-
Method Details
-
scaleFor
public float scaleFor(float targetLineHeight) -
originOffset
public float originOffset(float targetAscent) -
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
lineHeight
public float lineHeight()Returns the value of thelineHeightrecord component.- Returns:
- the value of the
lineHeightrecord component
-
ascent
public float ascent()Returns the value of theascentrecord component.- Returns:
- the value of the
ascentrecord component
-
descent
public float descent()Returns the value of thedescentrecord component.- Returns:
- the value of the
descentrecord component
-
leading
public float leading()Returns the value of theleadingrecord component.- Returns:
- the value of the
leadingrecord component
-