FontWeight
enum FontWeight
Package: dev.joid.lib.font · Module: core · Source: FontWeight.java
The nine standard font weights, from 100 (thin) to 900 (black).
Description
Section titled “Description”A font draws a weight with the face of that weight; when the font has no such face, it draws the closest one and warns once in dev mode. For a requested weight of 400 or above 500, the heavier of two equally close faces wins; otherwise the lighter one.
Learn more
Section titled “Learn more”Creation
Section titled “Creation”| Returns | Signature | Summary |
|---|---|---|
FontWeight | of(int value) factory | Returns the weight closest to value, rounded to the nearest hundred and clamped between THIN and BLACK. |
Methods
Section titled “Methods”| Returns | Signature | Summary |
|---|---|---|
int | getValue() | Returns the numeric weight, such as 400 for REGULAR. |
Values
Section titled “Values”| Value | Summary |
|---|---|
THIN | Weight 100. |
EXTRA_LIGHT | Weight 200. |
LIGHT | Weight 300. |
REGULAR | Weight 400, the default of a TextInfo. |
MEDIUM | Weight 500. |
SEMI_BOLD | Weight 600. |
BOLD | Weight 700. |
EXTRA_BOLD | Weight 800. |
BLACK | Weight 900. |
Creation details
Section titled “Creation details”FontWeight of(int value) factory
Returns the weight closest to value, rounded to the nearest hundred and clamped between THIN and BLACK.
Method details
Section titled “Method details”getValue
Section titled “getValue”int getValue()
Returns the numeric weight, such as 400 for REGULAR.
Value details
Section titled “Value details”THIN
Weight 100.
EXTRA_LIGHT
Section titled “EXTRA_LIGHT”EXTRA_LIGHT
Weight 200.
LIGHT
Weight 300.
REGULAR
Section titled “REGULAR”REGULAR
Weight 400, the default of a TextInfo.
MEDIUM
Section titled “MEDIUM”MEDIUM
Weight 500.
SEMI_BOLD
Section titled “SEMI_BOLD”SEMI_BOLD
Weight 600.
BOLD
Weight 700.
EXTRA_BOLD
Section titled “EXTRA_BOLD”EXTRA_BOLD
Weight 800.
BLACK
Weight 900.
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
