Record Class Font.OffsetGlyph
java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.server.resource.asset.Font.OffsetGlyph
- Record Components:
fontId- The key identifier of the font.character- The unicode character.advance- The pixel advance distance.
- All Implemented Interfaces:
Font.Glyph
- Enclosing class:
Font
public static record Font.OffsetGlyph(net.kyori.adventure.key.Key fontId, char character, int advance)
extends Record
implements Font.Glyph
A spacing glyph that adjusts character advance.
-
Constructor Summary
ConstructorsConstructorDescriptionOffsetGlyph(net.kyori.adventure.key.Key fontId, char character, int advance) Creates an instance of aOffsetGlyphrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintadvance()Returns the value of theadvancerecord component.charReturns the value of thecharacterrecord component.final booleanIndicates whether some other object is "equal to" this one.net.kyori.adventure.key.KeyfontId()Returns the value of thefontIdrecord component.final inthashCode()Returns a hash code value for this object.net.kyori.adventure.text.TextComponentConverts this offset glyph to a TextComponent.Converts this offset glyph to a MiniMessage string format.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
OffsetGlyph
public OffsetGlyph(net.kyori.adventure.key.Key fontId, char character, int advance) Creates an instance of aOffsetGlyphrecord class.
-
-
Method Details
-
toComponent
public net.kyori.adventure.text.TextComponent toComponent()Converts this offset glyph to a TextComponent.- Returns:
- The representing TextComponent.
-
toMiniMessageString
Converts this offset glyph to a MiniMessage string format.- Returns:
- The formatted MiniMessage string.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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 '=='. -
fontId
public net.kyori.adventure.key.Key fontId()Returns the value of thefontIdrecord component.- Returns:
- the value of the
fontIdrecord component
-
character
public char character()Returns the value of thecharacterrecord component.- Returns:
- the value of the
characterrecord component
-
advance
public int advance()Returns the value of theadvancerecord component.- Returns:
- the value of the
advancerecord component
-