Package nl.colorize.multimedialib.stage
Record Class FontFace
java.lang.Object
java.lang.Record
nl.colorize.multimedialib.stage.FontFace
public record FontFace(MediaLoader owner, FilePointer origin, String family, FontStyle style)
extends Record
Describes a TrueType or FreeType font that can be used by the renderer to
draw text. The font consists of the font family and the font style.
MultimediaLib does not rely on system fonts, any fonts used in the
application must be loaded explicitly using
MediaLoader.loadFont(FilePointer, String, FontStyle)
, which will
loads the font from a resource file packaged with the application.
Applications should therefore not attempt to create instances of this class
directly, instances are obtained from the MediaLoader
when the font
is first loaded.
-
Constructor Summary
ConstructorDescriptionFontFace
(MediaLoader owner, FilePointer origin, String family, FontStyle style) Creates an instance of aFontFace
record class. -
Method Summary
Modifier and TypeMethodDescriptionderive
(int size) derive
(int size, boolean bold) final boolean
Indicates whether some other object is "equal to" this one.family()
Returns the value of thefamily
record component.final int
hashCode()
Returns a hash code value for this object.origin()
Returns the value of theorigin
record component.owner()
Returns the value of theowner
record component.Derives a version of this font that is scaled to match the specified display mode.style()
Returns the value of thestyle
record component.toString()
Returns a string representation of this record class.
-
Constructor Details
-
FontFace
Creates an instance of aFontFace
record class.- Parameters:
owner
- the value for theowner
record componentorigin
- the value for theorigin
record componentfamily
- the value for thefamily
record componentstyle
- the value for thestyle
record component
-
-
Method Details
-
derive
-
derive
-
derive
-
derive
-
scale
Derives a version of this font that is scaled to match the specified display mode. If the canvas is zoomed in or zoomed out, the size indicated in the font style should also be scaled accordingly. -
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. All components in this record class are compared withObjects::equals(Object,Object)
. -
owner
Returns the value of theowner
record component.- Returns:
- the value of the
owner
record component
-
origin
Returns the value of theorigin
record component.- Returns:
- the value of the
origin
record component
-
family
Returns the value of thefamily
record component.- Returns:
- the value of the
family
record component
-
style
Returns the value of thestyle
record component.- Returns:
- the value of the
style
record component
-