Class

RemoteTextStyle

A remote-aware text style that mirrors androidx.compose.ui.text.TextStyle but uses remote types where applicable.

RevenueCat

RevenueCat

Add subscriptions to your apps in minutes

Ad Get started for free
Android
public class RemoteTextStyle
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
constructor(
    public val color: RemoteColor? = null,
    public val fontSize: RemoteTextUnit? = null,
    public val fontWeight: FontWeight? = null,
    public val fontStyle: FontStyle? = null,
    public val fontFamily: FontFamily? = null,
    public val letterSpacing: RemoteTextUnit? = null,
    public val background: RemoteColor? = null,
    public val textAlign: TextAlign? = null,
    public val lineHeight: RemoteTextUnit? = null,
    public val textDecoration: TextDecoration? = null,
)

A remote-aware text style that mirrors androidx.compose.ui.text.TextStyle but uses remote types where applicable.

Parameters

color The color of the text
fontSize the size of glyphs to use when painting the text in RemoteTextUnit .
fontWeight the typeface thickness to use when painting the text (e.g., FontWeight.Bold).
fontStyle The indentation of the paragraph.
fontFamily the font family to be used when rendering the text.
letterSpacing the amount of space to add between each letter in RemoteTextUnit .
background The background color for the text.
textAlign the alignment of the text within the lines of the paragraph.
lineHeight Line height for the text in RemoteTextUnit unit, e.g. SP or EM.
textDecoration The configuration of hyphenation.

Functions

merge

public fun merge(other: RemoteTextStyle?): RemoteTextStyle

Returns a new RemoteTextStyle that is a combination of this style and the given other style.

If other is null, this style is returned. If other has any null properties, the values from this style are used for those properties.

Parameters

other The style to merge into this style.

Returns

A new RemoteTextStyle with properties from other taking precedence.

merge

@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public fun merge(
        color: RemoteColor? = null,
        fontSize: RemoteTextUnit? = null,
        fontWeight: FontWeight? = null,
        fontStyle: FontStyle? = null,
        fontFamily: FontFamily? = null,
        letterSpacing: RemoteTextUnit? = null,
        background: RemoteColor? = null,
        textAlign: TextAlign? = null,
        lineHeight: RemoteTextUnit? = null,
        textDecoration: TextDecoration? = null,
    ): RemoteTextStyle

copy

public fun copy(
        color: RemoteColor? = this.color,
        fontSize: RemoteTextUnit? = this.fontSize,
        fontWeight: FontWeight? = this.fontWeight,
        fontStyle: FontStyle? = this.fontStyle,
        fontFamily: FontFamily? = this.fontFamily,
        letterSpacing: RemoteTextUnit? = this.letterSpacing,
        background: RemoteColor? = this.background,
        textAlign: TextAlign? = this.textAlign,
        lineHeight: RemoteTextUnit? = this.lineHeight,
        textDecoration: TextDecoration? = this.textDecoration,
    ): RemoteTextStyle

Creates a copy of this RemoteTextStyle with the ability to override individual attributes.

Companion Object

Properties

Android
@RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    public val Default: RemoteTextStyle

Methods


fromTextStyle

Android
public fun fromTextStyle(style: TextStyle): RemoteTextStyle

Creates a RemoteTextStyle from a TextStyle.