Object

RemoteFontVariation

Font variation settings for variable fonts, with axis values as RemoteFloats.

Source set: JvmAndAndroid
public object RemoteFontVariation

Font variation settings for variable fonts, with axis values as RemoteFloats.

Functions

weight

Source set: JvmAndAndroid
public fun weight(weight: RemoteFloat): Setting

Creates a font weight (wght) variation Setting.

Parameters

weight The font weight value, typically in 1f..1000f (such as 400.rf for normal or 700.rf for bold), or a dynamic RemoteFloat expression.

Return

A Setting for the wght OpenType variation axis.

width

Source set: JvmAndAndroid
public fun width(width: RemoteFloat): Setting

Creates a font width (wdth) variation Setting.

Parameters

width The font width percentage value, typically > 0f (such as 100f.rf for normal width), or a dynamic RemoteFloat expression.

Return

A Setting for the wdth OpenType variation axis.

slant

Source set: JvmAndAndroid
public fun slant(slant: RemoteFloat): Setting

Creates a font slant (slnt) variation Setting.

Parameters

slant The font slant angle in degrees, typically in -90f..90f (0f.rf is upright), or a dynamic RemoteFloat expression.

Return

A Setting for the slnt OpenType variation axis.

opticalSizing

Source set: JvmAndAndroid
public fun opticalSizing(opticalSize: RemoteFloat): Setting

Creates a font optical size (opsz) variation Setting.

Parameters

opticalSize The optical size value, typically in sp (such as 16f.rf), or a dynamic RemoteFloat expression.

Return

A Setting for the opsz OpenType variation axis.

grade

Source set: JvmAndAndroid
public fun grade(grade: RemoteFloat): Setting

Creates a font grade (GRAD) variation Setting.

Parameters

grade The font grade value, typically in -1000f..1000f (such as 0.rf), or a dynamic RemoteFloat expression.

Return

A Setting for the GRAD OpenType variation axis.

Members

Setting

Source set: JvmAndAndroid
public class Setting(public val axisName: String, public val value: RemoteFloat)

A single variable font axis setting, such as Setting("wght", weight).

Constant values are compared numerically, so 0f and -0f are equal, as for Float values of androidx.compose.ui.text.font.FontVariation.Setting.

Parameters

axisName The four-character OpenType axis tag, such as wght or wdth.
value The value of the axis, which can be a remote expression.

Functions

equals

Source set: JvmAndAndroid
override fun equals(other: Any?): Boolean

hashCode

Source set: JvmAndAndroid
override fun hashCode(): Int

toString

Source set: JvmAndAndroid
override fun toString(): String

Settings

Source set: JvmAndAndroid
public class Settings(settings: List<Setting>)

An ordered list of Settings to apply to a variable font.

Parameters

settings The settings to apply, which must be unique by Setting.axisName.

Properties

settings

Source set: JvmAndAndroid
public val settings: List<Setting> = List(settings.size) { settings[it] }

Functions

equals

Source set: JvmAndAndroid
override fun equals(other: Any?): Boolean

Creates Settings from the given settings, which must be unique by Setting.axisName.

hashCode

Source set: JvmAndAndroid
override fun hashCode(): Int

toString

Source set: JvmAndAndroid
override fun toString(): String
Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: