Skip to content

FontWeight

enum FontWeight
Package: dev.joid.lib.font · Module: core · Source: FontWeight.java

The nine standard font weights, from 100 (thin) to 900 (black).

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.

ReturnsSignatureSummary
FontWeightof(int value) factoryReturns the weight closest to value, rounded to the nearest hundred and clamped between THIN and BLACK.

ReturnsSignatureSummary
intgetValue()Returns the numeric weight, such as 400 for REGULAR.
ValueSummary
THINWeight 100.
EXTRA_LIGHTWeight 200.
LIGHTWeight 300.
REGULARWeight 400, the default of a TextInfo.
MEDIUMWeight 500.
SEMI_BOLDWeight 600.
BOLDWeight 700.
EXTRA_BOLDWeight 800.
BLACKWeight 900.

FontWeight of(int value) factory

Returns the weight closest to value, rounded to the nearest hundred and clamped between THIN and BLACK.

int getValue()

Returns the numeric weight, such as 400 for REGULAR.

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.


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

Report a problem with this page