FontFamily

class FontFamily(val typefaceName: String)

Represents a font family by encapsulating the typeface name or asset path.

The typefaceName property holds a string that typically represents either a system-defined font name or a path to a custom font file located in the application's assets. For example, if you have a font file at assets/fonts/exampleFont.ttf, you can create a new font family using:

val myFont = FontFamily("fonts/exampleFont.ttf")

This class is useful for abstracting font selection in your application, allowing you to use custom fonts by simply specifying their asset path. If the specified custom font is not available, you can fall back to a default font.

Constructors

Link copied to clipboard
constructor(typefaceName: String)

Properties

Link copied to clipboard

The name or asset path of the font.