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
    Constructor
    Description
    TtfFont(net.kyori.adventure.key.Key fontId, String file, int shiftX, int shiftY, int size, int oversample)
    Creates an instance of a TtfFont record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    Returns the value of the file record component.
    net.kyori.adventure.key.Key
    Returns the value of the fontId record component.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the oversample record component.
    int
    Returns the value of the shiftX record component.
    int
    Returns the value of the shiftY record component.
    int
    Returns the value of the size record component.
    com.google.gson.JsonObject
    Serializes the provider into a JSON object representation.
    final String
    Returns a string representation of this record class.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • 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 a TtfFont record class.
      Parameters:
      fontId - the value for the fontId record component
      file - the value for the file record component
      shiftX - the value for the shiftX record component
      shiftY - the value for the shiftY record component
      size - the value for the size record component
      oversample - the value for the oversample record component
  • Method Details

    • toJson

      public com.google.gson.JsonObject toJson()
      Serializes the provider into a JSON object representation.
      Returns:
      The generated JsonObject.
    • toString

      public final 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • fontId

      public net.kyori.adventure.key.Key fontId()
      Returns the value of the fontId record component.
      Returns:
      the value of the fontId record component
    • file

      public String file()
      Returns the value of the file record component.
      Returns:
      the value of the file record component
    • shiftX

      public int shiftX()
      Returns the value of the shiftX record component.
      Returns:
      the value of the shiftX record component
    • shiftY

      public int shiftY()
      Returns the value of the shiftY record component.
      Returns:
      the value of the shiftY record component
    • size

      public int size()
      Returns the value of the size record component.
      Returns:
      the value of the size record component
    • oversample

      public int oversample()
      Returns the value of the oversample record component.
      Returns:
      the value of the oversample record component