Package limn.graphics
Record Class Font
java.lang.Object
java.lang.Record
limn.graphics.Font
- Record Components:
family- typeface family, case-insensitive (ships "Roboto")size- em size in logical points (like CSS px)isBold- whether to select the bold faceisItalic- whether to select the italic face
A typeface selection: family name, size in logical points, and weight/style
(regular / bold / italic / bold-italic). The backend resolves the
(family, isBold, isItalic) triple against its registered faces
("default", and unknown families, map to the embedded Roboto) and
rasterizes glyphs at size × contentScale physical pixels, so text is
crisp at any HiDPI scale; glyph bitmaps are never scaled.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringFamily alias that always resolves to the toolkit's embedded font. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbold()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.booleanisBold()Returns the value of theisBoldrecord component.booleanisItalic()Returns the value of theisItalicrecord component.italic()static Fontof(float size) The default family at the given size (regular).floatsize()Returns the value of thesizerecord component.final StringtoString()Returns a string representation of this record class.withSize(float newSize)
-
Field Details
-
DEFAULT_FAMILY
Family alias that always resolves to the toolkit's embedded font.- See Also:
-
-
Constructor Details
-
Font
Creates an instance of aFontrecord class. -
Font
Regular weight/style at the given family and size.
-
-
Method Details
-
of
The default family at the given size (regular). -
withSize
- Returns:
- this font at a different size (weight/style preserved).
-
bold
- Returns:
- this font in bold.
-
italic
- Returns:
- this font in italic.
-
boldItalic
- Returns:
- this font in bold italic.
-
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 '=='. -
family
Returns the value of thefamilyrecord component.- Returns:
- the value of the
familyrecord component
-
size
public float size()Returns the value of thesizerecord component.- Returns:
- the value of the
sizerecord component
-
isBold
public boolean isBold()Returns the value of theisBoldrecord component.- Returns:
- the value of the
isBoldrecord component
-
isItalic
public boolean isItalic()Returns the value of theisItalicrecord component.- Returns:
- the value of the
isItalicrecord component
-