Package top.untold.frostlumen.core.font
Record Class Font
java.lang.Object
java.lang.Record
top.untold.frostlumen.core.font.Font
public record Font(org.lwjgl.util.freetype.FT_Face face, String path, ByteBuffer data, int id)
extends Record
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFont(org.lwjgl.util.freetype.FT_Face face, String path, ByteBuffer data) Font(org.lwjgl.util.freetype.FT_Face face, String path, ByteBuffer data, int id) Creates an instance of aFontrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondata()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.org.lwjgl.util.freetype.FT_Faceface()Returns the value of thefacerecord component.static FontintgetStringHeight(int fontSize) intgetStringWidth(String text, int fontSize) final inthashCode()Returns a hash code value for this object.intid()Returns the value of theidrecord component.static Fontpath()Returns the value of thepathrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
DEFAULT_FONT_PATH
- See Also:
-
-
Constructor Details
-
Font
-
Font
Creates an instance of aFontrecord class.- Parameters:
face- the value for thefacerecord componentpath- the value for thepathrecord componentdata- the value for thedatarecord componentid- the value for theidrecord component
-
-
Method Details
-
getStringWidth
-
getStringHeight
public int getStringHeight(int fontSize) -
loadFontFromCurrentResourceManager
-
getDefaultFont
-
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 '=='. -
face
public org.lwjgl.util.freetype.FT_Face face()Returns the value of thefacerecord component.- Returns:
- the value of the
facerecord component
-
path
Returns the value of thepathrecord component.- Returns:
- the value of the
pathrecord component
-
data
Returns the value of thedatarecord component.- Returns:
- the value of the
datarecord component
-
id
public int id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-