---
title: "FontScale"
description: "A [DeviceConfigurationOverride] that overrides the font scale for the contained content."
type: "function"
---

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


<a id='references'></a>
<div class='sourceset sourceset-common'>Common</div>


```kotlin
expect fun DeviceConfigurationOverride.Companion.FontScale(
    fontScale: Float
): DeviceConfigurationOverride
```


A `DeviceConfigurationOverride` that overrides the font scale for the contained content.

#### Parameters

| | |
| --- | --- |
| fontScale | the font scale to use for the content under test. |


#### Returns

| | |
| --- | --- |
|  | a `DeviceConfigurationOverride` that specifies the font scale for the content under test. |




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


```kotlin
actual fun DeviceConfigurationOverride.Companion.FontScale(
    fontScale: Float
): DeviceConfigurationOverride
```


## Code Examples
### DeviceConfigurationOverrideFontScaleSample
```kotlin
@Composable
fun DeviceConfigurationOverrideFontScaleSample() {
    DeviceConfigurationOverride(DeviceConfigurationOverride.FontScale(1.5f)) {
        MyScreen() // will be rendered with a larger than default font scale
    }
}
```

