---
title: "PlatformTextStyle"
description: "Provides platform specific [TextStyle] configuration options for styling and compatibility."
type: "class"
---

<div class='type'>Class</div>


<a id='references'></a>

<div class='sourceset sourceset-common'>Common</div>


```kotlin
expect class PlatformTextStyle
```


Provides platform specific `TextStyle` configuration options for styling and compatibility.


## Properties

<div class='sourceset sourceset-common'>Common</div>


```kotlin
val spanStyle: PlatformSpanStyle?
```


Platform specific text span styling and compatibility configuration.



<div class='sourceset sourceset-common'>Common</div>


```kotlin
val paragraphStyle: PlatformParagraphStyle?
```


Platform specific paragraph styling and compatibility configuration.



<div class='sourceset sourceset-android'>Android</div>


```kotlin
actual class PlatformTextStyle
```


Provides Android specific `TextStyle` configuration options for styling and compatibility.


## Secondary Constructors

```kotlin
constructor(spanStyle: PlatformSpanStyle?, paragraphStyle: PlatformParagraphStyle?) {
    this.spanStyle = spanStyle
    this.paragraphStyle = paragraphStyle
}
```


Convenience constructor for when you already have a `spanStyle` and `paragraphStyle`.

#### Parameters

| | |
| --- | --- |
| spanStyle | platform specific span styling |
| paragraphStyle | platform specific paragraph styling |



```kotlin
constructor(
    includeFontPadding: Boolean = DefaultIncludeFontPadding
) : this(
    paragraphStyle = PlatformParagraphStyle(includeFontPadding = includeFontPadding),
    spanStyle = null,
)
```


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 | Set whether to include extra space beyond font ascent and descent. |



```kotlin
constructor(
    emojiSupportMatch: EmojiSupportMatch
) : this(paragraphStyle = PlatformParagraphStyle(emojiSupportMatch), spanStyle = null)
```


`EmojiSupportMatch` allows you to control emoji support replacement behavior.

You can disable emoji support matches by passing `EmojiSupportMatch.None`

#### Parameters

| | |
| --- | --- |
| emojiSupportMatch | configuration for emoji support match and replacement |



## Properties

<div class='sourceset sourceset-android'>Android</div>


```kotlin
actual val spanStyle: PlatformSpanStyle?
```


Android specific text span styling and compatibility configuration.



<div class='sourceset sourceset-android'>Android</div>


```kotlin
actual val paragraphStyle: PlatformParagraphStyle?
```


Android specific paragraph styling and compatibility configuration.




