Class

RemoteTextStyle

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

Source set: JvmAndAndroid
public class RemoteTextStyle(
    public val color: RemoteColor? = null,
    public val fontSize: RemoteTextUnit? = null,
    public val fontWeight: RemoteFontWeight? = null,
    public val fontStyle: RemoteFontStyle? = null,
    public val fontFamily: RemoteFontFamily? = null,
    public val letterSpacing: RemoteTextUnit? = null,
    public val background: RemoteColor? = null,
    public val textAlign: RemoteTextAlign = RemoteTextAlign.Unspecified,
    public val lineHeight: RemoteTextUnit? = null,
    public val textDecoration: RemoteTextDecoration? = null,
    public val lineBreak: RemoteLineBreak = RemoteLineBreak.Unspecified,
    public val hyphens: RemoteHyphens = RemoteHyphens.Unspecified,
    public val fontFeatureSettings: String? = null,
    public val fontVariationSettings: RemoteFontVariation.Settings? = 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., RemoteFontWeight.Bold).
fontStyle The font style to use when painting the text (e.g., RemoteFontStyle.Italic).
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 decorations to paint on the text (e.g., RemoteTextDecoration.Underline).
lineBreak The configuration of line break.
hyphens The configuration of hyphenation.
fontFeatureSettings The advanced typography settings provided by font in CSS format (e.g. "smcp" or "tnum").
fontVariationSettings The font variation settings to be applied to the text.

Functions

merge

Source set: JvmAndAndroid
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 unspecified properties, the values from this style are used for those properties.

Parameters

other The style to merge into this style.

Return

A new RemoteTextStyle with properties from other taking precedence.

merge

Source set: JvmAndAndroid
public fun merge(
        color: RemoteColor? = null,
        fontSize: RemoteTextUnit? = null,
        fontWeight: RemoteFontWeight? = null,
        fontStyle: RemoteFontStyle? = null,
        fontFamily: RemoteFontFamily? = null,
        letterSpacing: RemoteTextUnit? = null,
        background: RemoteColor? = null,
        textAlign: RemoteTextAlign = RemoteTextAlign.Unspecified,
        lineHeight: RemoteTextUnit? = null,
        textDecoration: RemoteTextDecoration? = null,
        lineBreak: RemoteLineBreak = RemoteLineBreak.Unspecified,
        hyphens: RemoteHyphens = RemoteHyphens.Unspecified,
        fontFeatureSettings: String? = null,
        fontVariationSettings: RemoteFontVariation.Settings? = null,
    ): RemoteTextStyle

Returns a new RemoteTextStyle that is a combination of this style and the given attributes, keeping this style's values for any attributes left unspecified (null or Unspecified).

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., RemoteFontWeight.Bold).
fontStyle The font style to use when painting the text (e.g., RemoteFontStyle.Italic).
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 decorations to paint on the text (e.g., RemoteTextDecoration.Underline).
lineBreak The configuration of line break.
hyphens The configuration of hyphenation.
fontFeatureSettings The advanced typography settings provided by font in CSS format (e.g. "smcp" or "tnum").
fontVariationSettings The font variation settings to be applied to the text.

Return

a new RemoteTextStyle with the specified attributes merged into this style

copy

Source set: JvmAndAndroid
public fun copy(
        color: RemoteColor? = this.color,
        fontSize: RemoteTextUnit? = this.fontSize,
        fontWeight: RemoteFontWeight? = this.fontWeight,
        fontStyle: RemoteFontStyle? = this.fontStyle,
        fontFamily: RemoteFontFamily? = this.fontFamily,
        letterSpacing: RemoteTextUnit? = this.letterSpacing,
        background: RemoteColor? = this.background,
        textAlign: RemoteTextAlign = this.textAlign,
        lineHeight: RemoteTextUnit? = this.lineHeight,
        textDecoration: RemoteTextDecoration? = this.textDecoration,
        lineBreak: RemoteLineBreak = this.lineBreak,
        hyphens: RemoteHyphens = this.hyphens,
        fontFeatureSettings: String? = this.fontFeatureSettings,
        fontVariationSettings: RemoteFontVariation.Settings? = this.fontVariationSettings,
    ): RemoteTextStyle

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

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., RemoteFontWeight.Bold).
fontStyle The font style to use when painting the text (e.g., RemoteFontStyle.Italic).
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 decorations to paint on the text (e.g., RemoteTextDecoration.Underline).
lineBreak The configuration of line break.
hyphens The configuration of hyphenation.
fontFeatureSettings The advanced typography settings provided by font in CSS format (e.g. "smcp" or "tnum").
fontVariationSettings The font variation settings to be applied to the text.

Return

a new RemoteTextStyle with the specified attributes overridden

Members

Companion

Source set: JvmAndAndroid
public companion object

Properties

Default

Source set: JvmAndAndroid
public val Default: RemoteTextStyle = RemoteTextStyle()

Constant for default RemoteTextStyle with no overridden properties.

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: