public class RemoteTextStyle constructor(
public val color: RemoteColor? = null,
public val fontSize: RemoteTextUnit? = null,
public val fontWeight: FontWeight? = null,
public val fontStyle: FontStyle? = null,
public val fontFamily: RemoteFontFamily? = 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,
public val lineBreak: LineBreak = LineBreak.Unspecified,
public val hyphens: Hyphens = Hyphens.Unspecified,
public val fontFeatureSettings: String? = null,
public val fontVariationSettings: FontVariation.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., FontWeight.Bold). |
| fontStyle | the font style to use when painting the text (e.g., FontStyle.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., TextDecoration.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
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. |
Return
A new RemoteTextStyle with properties from other taking precedence.
merge
public fun merge(
color: RemoteColor? = null,
fontSize: RemoteTextUnit? = null,
fontWeight: FontWeight? = null,
fontStyle: FontStyle? = null,
fontFamily: RemoteFontFamily? = null,
letterSpacing: RemoteTextUnit? = null,
background: RemoteColor? = null,
textAlign: TextAlign? = null,
lineHeight: RemoteTextUnit? = null,
textDecoration: TextDecoration? = null,
lineBreak: LineBreak = LineBreak.Unspecified,
hyphens: Hyphens = Hyphens.Unspecified,
fontFeatureSettings: String? = null,
fontVariationSettings: FontVariation.Settings? = null,
): RemoteTextStyle
copy
public fun copy(
color: RemoteColor? = this.color,
fontSize: RemoteTextUnit? = this.fontSize,
fontWeight: FontWeight? = this.fontWeight,
fontStyle: FontStyle? = this.fontStyle,
fontFamily: RemoteFontFamily? = this.fontFamily,
letterSpacing: RemoteTextUnit? = this.letterSpacing,
background: RemoteColor? = this.background,
textAlign: TextAlign? = this.textAlign,
lineHeight: RemoteTextUnit? = this.lineHeight,
textDecoration: TextDecoration? = this.textDecoration,
lineBreak: LineBreak = this.lineBreak,
hyphens: Hyphens = this.hyphens,
fontFeatureSettings: String? = this.fontFeatureSettings,
fontVariationSettings: FontVariation.Settings? = this.fontVariationSettings,
): RemoteTextStyle
Creates a copy of this RemoteTextStyle with the ability to override individual attributes.
Members
Companion
public companion object
Properties
Default
public val Default: RemoteTextStyle = RemoteTextStyle()
Functions
fromTextStyle
public fun fromTextStyle(style: TextStyle): RemoteTextStyle
Creates a RemoteTextStyle from a TextStyle.
TextStyle.fontFeatureSettings is carried over as RemoteTextStyle.fontFeatureSettings and never affects RemoteTextStyle.fontVariationSettings. The variation settings are taken from the Font in the FontListFontFamily that best matches the style's FontWeight and FontStyle, using the same CSS font matching rules as Compose, among the fonts that declare variation settings.