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
public val name: String
The name used to identify the font in the document and player
Functions
toAndroidTypeface
public fun toAndroidTypeface(): Typeface
Converts this RemoteTypeface to an Android framework Typeface.
Members
Default
public object Default : RemoteTypeface
Represents the default system font.
Properties
name
override val name: String = "default"
Functions
toAndroidTypeface
override fun toAndroidTypeface(): Typeface
DefaultBold
public object DefaultBold : RemoteTypeface
Represents the default bold system font.
Properties
name
override val name: String = "default-bold"
Functions
toAndroidTypeface
override fun toAndroidTypeface(): Typeface
SansSerif
public object SansSerif : RemoteTypeface
Represents the sans-serif system font.
Properties
name
override val name: String = "sans-serif"
Functions
toAndroidTypeface
override fun toAndroidTypeface(): Typeface
Serif
public object Serif : RemoteTypeface
Represents the serif system font.
Properties
name
override val name: String = "serif"
Functions
toAndroidTypeface
override fun toAndroidTypeface(): Typeface
Monospace
public object Monospace : RemoteTypeface
Represents the monospace system font.
Properties
name
override val name: String = "monospace"
Functions
toAndroidTypeface
override fun toAndroidTypeface(): Typeface
Named
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
override val name: String = fontName
Functions
toAndroidTypeface
override fun toAndroidTypeface(): Typeface
equals
override fun equals(other: Any?): Boolean
hashCode
override fun hashCode(): Int
Style
public enum class Style {
Normal,
Bold,
Italic,
BoldItalic,
}
Represents the style of a RemoteTypeface (e.g., Normal, Bold, Italic).
Members
Normal
Normal
Bold
Bold
Italic
Italic
BoldItalic
BoldItalic
Companion
public companion object
Functions
create
public fun create(fontName: String?, style: Style = Style.Normal): RemoteTypeface
Creates a RemoteTypeface with the given font name and style.
fromAndroidTypeface
public fun fromAndroidTypeface(typeface: Typeface?): RemoteTypeface
Maps an Android framework Typeface to a RemoteTypeface.