Function

fromTextStyle

Creates a RemoteTextStyle from a TextStyle.

fromTextStyle

Source set: Android
public fun RemoteTextStyle.Companion.fromTextStyle(style: TextStyle): RemoteTextStyle

Creates a RemoteTextStyle from a TextStyle.

TextStyle.fontFeatureSettings is carried over as RemoteTextStyle.fontFeatureSettings and never affects RemoteTextStyle.fontVariationSettings. The variation settings are taken from the Font in the FontListFontFamily that best matches the style's FontWeight and FontStyle, using the same CSS font matching rules as Compose, among the fonts that declare variation settings.

Parameters

style The Compose TextStyle to convert.

Return

a RemoteTextStyle converted from style

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: