Composable Function

fontResource

Synchronously load an font from FontFamily.

fontResource

Source set: Android
@Composable
@Deprecated(
    "Prefer to preload fonts using FontFamily.Resolver.",
    replaceWith =
        ReplaceWith("FontFamily.Resolver.preload(fontFamily, Font.AndroidResourceLoader(context))"),
    level = DeprecationLevel.WARNING,
)
public fun fontResource(fontFamily: FontFamily): Typeface

Synchronously load an font from FontFamily.

Parameters

fontFamily the fontFamily

Return

the decoded image data associated with the resource

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: