Record Class Font.TtfFont
java.lang.Object
java.lang.Record
com.github.darksoulq.abyssallib.server.resource.asset.Font.TtfFont
- Record Components:
fontId- The key identifier of the font.file- The TTF file path.shiftX- The X offset.shiftY- The Y offset.size- The font size.oversample- The oversample scaling.
- All Implemented Interfaces:
Font.Glyph
- Enclosing class:
Font
public static record Font.TtfFont(net.kyori.adventure.key.Key fontId, String file, int shiftX, int shiftY, int size, int oversample)
extends Record
implements Font.Glyph
TTF font provider.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.file()Returns the value of thefilerecord component.net.kyori.adventure.key.KeyfontId()Returns the value of thefontIdrecord component.final inthashCode()Returns a hash code value for this object.intReturns the value of theoversamplerecord component.intshiftX()Returns the value of theshiftXrecord component.intshiftY()Returns the value of theshiftYrecord component.intsize()Returns the value of thesizerecord component.com.google.gson.JsonObjecttoJson()Serializes the provider into a JSON object representation.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
TtfFont
public TtfFont(net.kyori.adventure.key.Key fontId, String file, int shiftX, int shiftY, int size, int oversample) Creates an instance of aTtfFontrecord class.- Parameters:
fontId- the value for thefontIdrecord componentfile- the value for thefilerecord componentshiftX- the value for theshiftXrecord componentshiftY- the value for theshiftYrecord componentsize- the value for thesizerecord componentoversample- the value for theoversamplerecord component
-
-
Method Details
-
toJson
public com.google.gson.JsonObject toJson()Serializes the provider into a JSON object representation.- Returns:
- The generated JsonObject.
-
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
-
file
Returns the value of thefilerecord component.- Returns:
- the value of the
filerecord component
-
shiftX
public int shiftX()Returns the value of theshiftXrecord component.- Returns:
- the value of the
shiftXrecord component
-
shiftY
public int shiftY()Returns the value of theshiftYrecord component.- Returns:
- the value of the
shiftYrecord component
-
size
public int size()Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
oversample
public int oversample()Returns the value of theoversamplerecord component.- Returns:
- the value of the
oversamplerecord component
-