# PlatformTextStyle

Artifact: [androidx.compose.ui:ui-text](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/text/+class:androidx.compose.ui.text.PlatformTextStyle) Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0) Common/AllAndroid/JVM
- Cmn

  ```
  class PlatformTextStyle
  ```

*** ** * ** ***

Provides platform specific `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/TextStyle` configuration options for styling and compatibility.

## Summary

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformTextStyle#PlatformTextStyle(androidx.compose.ui.text.EmojiSupportMatch)(emojiSupportMatch: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/EmojiSupportMatch)` `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/EmojiSupportMatch` allows you to control emoji support replacement behavior. | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformTextStyle#PlatformTextStyle(kotlin.Boolean)(includeFontPadding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)` Enables turning on and off for Android [includeFontPadding](https://developer.android.com/reference/android/text/StaticLayout.Builder#setIncludePad(boolean)). | android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformTextStyle#PlatformTextStyle(androidx.compose.ui.text.PlatformSpanStyle,androidx.compose.ui.text.PlatformParagraphStyle)( spanStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformSpanStyle?, paragraphStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformParagraphStyle? )` Convenience constructor for when you already have a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformTextStyle#(androidx.compose.ui.text.PlatformSpanStyle,androidx.compose.ui.text.PlatformParagraphStyle)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformTextStyle#(androidx.compose.ui.text.PlatformSpanStyle,androidx.compose.ui.text.PlatformParagraphStyle)`. | android |

| ### Public functions |
|---|---|---|
| `open operator https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformTextStyle#equals(kotlin.Any)(other: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html?)` | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformTextStyle#hashCode()()` | android |
| `open https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformTextStyle#toString()()` | android |

| ### Public properties |
|---|---|---|
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformParagraphStyle?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformTextStyle#paragraphStyle()` Platform specific paragraph styling and compatibility configuration. | Cmn android |
| `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformSpanStyle?` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformTextStyle#spanStyle()` Platform specific text span styling and compatibility configuration. | Cmn android |

## Public constructors

### PlatformTextStyle

android Added in [1.9.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.9.0)

```
PlatformTextStyle(emojiSupportMatch: EmojiSupportMatch)
```

`https://developer.android.com/reference/kotlin/androidx/compose/ui/text/EmojiSupportMatch` allows you to control emoji support replacement behavior.

You can disable emoji support matches by passing `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/EmojiSupportMatch#None()`

| Parameters |
|---|---|
| `emojiSupportMatch: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/EmojiSupportMatch` | configuration for emoji support match and replacement |

### PlatformTextStyle

android Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0)

```
PlatformTextStyle(includeFontPadding: Boolean = DefaultIncludeFontPadding)
```

Enables turning on and off for Android [includeFontPadding](https://developer.android.com/reference/android/text/StaticLayout.Builder#setIncludePad(boolean)).

includeFontPadding was added to Android in order to prevent clipping issues on tall scripts. However that issue has been fixed since Android 28. Jetpack Compose backports the fix for Android versions prior to Android 28. Therefore the original reason why includeFontPadding was needed in invalid on Compose.

This configuration was added for migration of the apps in case some code or design was relying includeFontPadding=true behavior.

| Parameters |
|---|---|
| `includeFontPadding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html = DefaultIncludeFontPadding` | Set whether to include extra space beyond font ascent and descent. |

### PlatformTextStyle

android Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0)

```
PlatformTextStyle(
    spanStyle: PlatformSpanStyle?,
    paragraphStyle: PlatformParagraphStyle?
)
```

Convenience constructor for when you already have a `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformTextStyle#(androidx.compose.ui.text.PlatformSpanStyle,androidx.compose.ui.text.PlatformParagraphStyle)` and `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformTextStyle#(androidx.compose.ui.text.PlatformSpanStyle,androidx.compose.ui.text.PlatformParagraphStyle)`.

| Parameters |
|---|---|
| `spanStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformSpanStyle?` | platform specific span styling |
| `paragraphStyle: https://developer.android.com/reference/kotlin/androidx/compose/ui/text/PlatformParagraphStyle?` | platform specific paragraph styling |

## Public functions

### equals

android

```
open operator fun equals(other: Any?): Boolean
```

### hashCode

android

```
open fun hashCode(): Int
```

### toString

android

```
open fun toString(): String
```

## Public properties

### paragraphStyle

Cmn android Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0)

```
val paragraphStyle: PlatformParagraphStyle?
```

Platform specific paragraph styling and compatibility configuration.

### spanStyle

Cmn android Added in [1.2.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.2.0)

```
val spanStyle: PlatformSpanStyle?
```

Platform specific text span styling and compatibility configuration.