Start native apps faster with the Composables CLI ->
Interface

RemoteTypeface

A sealed interface that represent the concept of a Typeface in Remote Compose.

Source set: Android
public sealed interface RemoteTypeface

A sealed interface that represent the concept of a Typeface in Remote Compose.

Custom or named system fonts are represented by Named type and are registered in the document as Strings to be referenced.

Properties

name

Source set: Android
public val name: String

The name used to identify the font in the document and player

Functions

toAndroidTypeface

Source set: Android
public fun toAndroidTypeface(): Typeface

Converts this RemoteTypeface to an Android framework Typeface.

Members

Default

Source set: Android
public object Default : RemoteTypeface

Represents the default system font.

Properties

name

Source set: Android
override val name: String = "default"

Functions

toAndroidTypeface

Source set: Android
override fun toAndroidTypeface(): Typeface

DefaultBold

Source set: Android
public object DefaultBold : RemoteTypeface

Represents the default bold system font.

Properties

name

Source set: Android
override val name: String = "default-bold"

Functions

toAndroidTypeface

Source set: Android
override fun toAndroidTypeface(): Typeface

SansSerif

Source set: Android
public object SansSerif : RemoteTypeface

Represents the sans-serif system font.

Properties

name

Source set: Android
override val name: String = "sans-serif"

Functions

toAndroidTypeface

Source set: Android
override fun toAndroidTypeface(): Typeface

Serif

Source set: Android
public object Serif : RemoteTypeface

Represents the serif system font.

Properties

name

Source set: Android
override val name: String = "serif"

Functions

toAndroidTypeface

Source set: Android
override fun toAndroidTypeface(): Typeface

Monospace

Source set: Android
public object Monospace : RemoteTypeface

Represents the monospace system font.

Properties

name

Source set: Android
override val name: String = "monospace"

Functions

toAndroidTypeface

Source set: Android
override fun toAndroidTypeface(): Typeface

Named

Source set: Android
public class Named(
        private val fontName: String,
        public val weight: Int = 400,
        public val isItalic: Boolean = false,
    ) : RemoteTypeface

Represents a system font referenced by name.

Parameters

fontName The string name of the font family (e.g., "roboto-flex").
weight The weight of the font (e.g., 400 for normal, 700 for bold).
isItalic Whether the font is italic.

Properties

name

Source set: Android
override val name: String = fontName

Functions

toAndroidTypeface

Source set: Android
override fun toAndroidTypeface(): Typeface

equals

Source set: Android
override fun equals(other: Any?): Boolean

hashCode

Source set: Android
override fun hashCode(): Int

Style

Source set: Android
public enum class Style {
        Normal,
        Bold,
        Italic,
        BoldItalic,
    }

Represents the style of a RemoteTypeface (e.g., Normal, Bold, Italic).

Members

Normal

Source set: Android
Normal

Bold

Source set: Android
Bold

Italic

Source set: Android
Italic

BoldItalic

Source set: Android
BoldItalic

Companion

Source set: Android
public companion object

Functions

create

Source set: Android
public fun create(fontName: String?, style: Style = Style.Normal): RemoteTypeface

Creates a RemoteTypeface with the given font name and style.

fromAndroidTypeface

Source set: Android
public fun fromAndroidTypeface(typeface: Typeface?): RemoteTypeface

Maps an Android framework Typeface to a RemoteTypeface.