FontFamily
final class FontFamily<F extends IFontFace>
Package: dev.joid.lib.font.impl.glyph · Module: core · Source: FontFamily.java
The faces of one font, by weight and style, from which a text picks the face it draws with.
Description
Section titled “Description”A GlyphFont holds one family; MsdfFontLoader builds it for you from the files you load.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
FontFamily<F> | of(F… faces) factory | Creates a family of faces, sorted by weight. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
F | resolve(FontWeight weight, boolean italic) | Returns the face for weight and italic: among the faces of that style, or all faces when none has it, the closest weight. |
List<F> | getFaces() | Returns the faces, sorted by weight, as a list you cannot change. |
Creation details
Section titled “Creation details”<F extends IFontFace> FontFamily<F> of(F... faces) factory
Throws:
IllegalArgumentException: A font family needs at least one face, got none: pass its faces to FontFamily.of(…)IllegalArgumentException: Two faces share the weight …, keep one face per weight and style
Creates a family of faces, sorted by weight.
Throws IllegalArgumentException when no face is given or when two faces share a weight and a style.
Method details
Section titled “Method details”resolve
Section titled “resolve”F resolve(FontWeight weight, boolean italic)
Returns the face for weight and italic: among the faces of that style, or all faces when none has it, the closest weight.
For a requested weight of 400 or above 500, the heavier of two equally close faces wins; otherwise the lighter one.
A weight that the family does not have warns once in dev mode and names the loaded faces.
getFaces
Section titled “getFaces”List<F> getFaces()
Returns the faces, sorted by weight, as a list you cannot change.
fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses
