---
title: "Typeface"
description: "Build an Android specific Typeface from FontFamily.

You can pass [styles] for loading only specific styles.

This function caches the internal native Typeface but always create the new Typeface object.
Caller should cache if necessary."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-android'>Android</div>


> **Deprecated** This API is deprecated with the introduction of async fonts which cannot resolve in this context. To preload fonts, use FontFamily.Resolver.

```kotlin
fun Typeface(
    context: Context,
    fontFamily: FontFamily,
    styles: List<Pair<FontWeight, FontStyle>>? = null,
): androidx.compose.ui.text.font.Typeface
```


Build an Android specific Typeface from FontFamily.

You can pass `styles` for loading only specific styles.

This function caches the internal native Typeface but always create the new Typeface object.
Caller should cache if necessary.

#### Parameters

| | |
| --- | --- |
| context | the context to be used for loading Typeface. |
| fontFamily | the font family to be loaded |
| styles | optional style filter for loading subset of fontFamily. null means load all fonts in fontFamily. |


#### Returns

| | |
| --- | --- |
|  | `androidx.compose.ui.text.font.Typeface` instance |




<div class='sourceset sourceset-android'>Android</div>


```kotlin
fun Typeface(typeface: Typeface): androidx.compose.ui.text.font.Typeface
```


Returns a Compose `androidx.compose.ui.text.font.Typeface` from Android `Typeface`.

#### Parameters

| | |
| --- | --- |
| typeface | Android Typeface instance |




