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
-
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. -
fontId
-
file
-
shiftX
-
shiftY
-
size
-
oversample
public int oversample()Returns the value of theoversamplerecord component.- Returns:
- the value of the
oversamplerecord component
-