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

Members

Default

Source set: Android
public object Default : RemoteTypeface

Represents the default system font.

Properties

name

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

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"

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"

Serif

Source set: Android
public object Serif : RemoteTypeface

Represents the serif system font.

Properties

name

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

Monospace

Source set: Android
public object Monospace : RemoteTypeface

Represents the monospace system font.

Properties

name

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

Named

Source set: Android
public class Named(
        private val fontName: String,
        @IntRange(from = 1, to = 1000) 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

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 fontName and style.

Parameters

fontName The font family name, or null for the default font.
style The Style of the typeface.
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: