androidx.ui.text.font

Classes

Font

Defines a font to be used while rendering text.

FontFamily

Defines a font family.

FontWeight

The thickness of the glyphs, in a range of 1,1000.

Enums

FontStyle

Defines whether the font is Italic or Normal.

FontSynthesis

Possible options for font synthesis.

Top-level functions summary

FontWeight
lerp(start: FontWeight, stop: FontWeight, fraction: Float)

Linearly interpolate between two font weights

Extension functions summary

For Font
FontFamily

Create a FontFamily from this single Font.

Top-level functions

lerp

fun lerp(
    start: FontWeight,
    stop: FontWeight,
    fraction: Float
): FontWeight

Linearly interpolate between two font weights

Rather than using fractional weights, the interpolation rounds to the nearest weight.

The fraction argument represents position on the timeline, with 0.0 meaning that the interpolation has not started, returning start (or something equivalent to start), 1.0 meaning that the interpolation has finished, returning stop (or something equivalent to stop), and values in between meaning that the interpolation is at the relevant point on the timeline between start and stop. The interpolation can be extrapolated beyond 0.0 and 1.0, so negative values and values greater than 1.0 are valid (and can easily be generated by curves).

Values for fraction are usually obtained from an Animation, such as an AnimationController.

Extension functions

asFontFamily

fun Font.asFontFamily(): FontFamily

Create a FontFamily from this single Font.