{% setvar book_path %}/reference/androidx/_book.yaml{% endsetvar %} {% include "_shared/_reference-head-tags.html" %}

PlatformParagraphStyle

public final class PlatformParagraphStyle


Provides platform specific ParagraphStyle configuration options for styling and compatibility.

Summary

Nested types

Public constructors

Default platform paragraph style

Represents platform specific text flags.

PlatformParagraphStyle(boolean includeFontPadding)

Represents platform specific text flags

PlatformParagraphStyle(
    @NonNull EmojiSupportMatch emojiSupportMatch,
    boolean includeFontPadding
)

Represents platform specific text flags

Public methods

boolean
equals(Object other)
final @NonNull EmojiSupportMatch

When to replace emoji with support emoji using androidx.emoji2.

final boolean

Include extra space beyond font ascent and descent.

int
final @NonNull PlatformParagraphStyle
@NonNull String

Public constructors

PlatformParagraphStyle

public PlatformParagraphStyle()

Default platform paragraph style

PlatformParagraphStyle

public PlatformParagraphStyle(@NonNull EmojiSupportMatch emojiSupportMatch)

Represents platform specific text flags.

Parameters
@NonNull EmojiSupportMatch emojiSupportMatch

control emoji support matches on Android

PlatformParagraphStyle

public PlatformParagraphStyle(boolean includeFontPadding)

Represents platform specific text flags

Parameters
boolean includeFontPadding

Set whether to include extra space beyond font ascent and descent.

PlatformParagraphStyle

public PlatformParagraphStyle(
    @NonNull EmojiSupportMatch emojiSupportMatch,
    boolean includeFontPadding
)

Represents platform specific text flags

Parameters
@NonNull EmojiSupportMatch emojiSupportMatch

control emoji support matches on Android

boolean includeFontPadding

Set whether to include extra space beyond font ascent and descent.

Public methods

equals

public boolean equals(Object other)

getEmojiSupportMatch

public final @NonNull EmojiSupportMatch getEmojiSupportMatch()

When to replace emoji with support emoji using androidx.emoji2.

This is only available on Android.

getIncludeFontPadding

public final boolean getIncludeFontPadding()

Include extra space beyond font ascent and descent.

Enables turning on and off for Android includeFontPadding.

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.

hashCode

public int hashCode()

merge

public final @NonNull PlatformParagraphStyle merge(PlatformParagraphStyle other)

toString

public @NonNull String toString()