Package nl.colorize.multimedialib.stage
Record Class FontFace
java.lang.Object
java.lang.Record
nl.colorize.multimedialib.stage.FontFace
public record FontFace(nl.colorize.util.ResourceFile origin, String family, int size, ColorRGB color)
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 applications should not make assumptions on which system
fonts are available on the current platform. All fonts used by the
application should be included in the application's resource files.
Fonts can then be loaded from these files using MediaLoader.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncolor()Returns the value of thecolorrecord component.derive(int size) final booleanIndicates whether some other object is "equal to" this one.family()Returns the value of thefamilyrecord component.final inthashCode()Returns a hash code value for this object.nl.colorize.util.ResourceFileorigin()Returns the value of theoriginrecord component.Derives a version of this font that is scaled to match the specified display mode.intsize()Returns the value of thesizerecord component.toString()Returns a string representation of this record class.
-
Constructor Details
-
FontFace
Creates an instance of aFontFacerecord class.- Parameters:
origin- the value for theoriginrecord componentfamily- the value for thefamilyrecord componentsize- the value for thesizerecord componentcolor- the value for thecolorrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
origin
public nl.colorize.util.ResourceFile origin()Returns the value of theoriginrecord component.- Returns:
- the value of the
originrecord component
-
family
Returns the value of thefamilyrecord component.- Returns:
- the value of the
familyrecord component
-
size
public int size()Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
color
Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord component
-