# fromTextStyle

> Creates a [RemoteTextStyle] from a [TextStyle].

## API Reference

### fromTextStyle

> Source set: Android

```kotlin
public fun RemoteTextStyle.Companion.fromTextStyle(style: TextStyle): RemoteTextStyle
```

Creates a [RemoteTextStyle](https://composables.com/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteTextStyle/api.md) 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](https://composables.com/jetpack-compose/androidx.compose.ui/ui-text/classes/TextStyle/api.md) to convert. |

#### Return

a [RemoteTextStyle](https://composables.com/jetpack-compose/androidx.compose.remote/remote-creation-compose/classes/RemoteTextStyle/api.md) converted from [style](https://composables.com/jetpack-compose/androidx.compose.foundation/foundation/functions/Style/api.md)
