# StaticLayoutFactory

Artifact: [androidx.compose.ui:ui-text](https://developer.android.com/jetpack/androidx/releases/compose-ui) [View Source](https://cs.android.com/search?q=file:androidx/compose/ui/text/android/StaticLayoutFactory.android.kt+class:androidx.compose.ui.text.android.StaticLayoutFactory) Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.6.0)


```
@InternalPlatformTextApi
object StaticLayoutFactory
```

<br />

*** ** * ** ***

## Summary

| ### Public functions |
|---|---|
| `https://developer.android.com/reference/android/text/StaticLayout.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/android/StaticLayoutFactory#create(kotlin.CharSequence,android.text.TextPaint,kotlin.Int,kotlin.Int,kotlin.Int,android.text.TextDirectionHeuristic,android.text.Layout.Alignment,kotlin.Int,android.text.TextUtils.TruncateAt,kotlin.Int,kotlin.Float,kotlin.Float,kotlin.Int,kotlin.Boolean,kotlin.Boolean,kotlin.Int,kotlin.Int,kotlin.Int,kotlin.Int,kotlin.IntArray,kotlin.IntArray)( text: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-char-sequence/index.html, paint: https://developer.android.com/reference/android/text/TextPaint.html, width: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, start: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, end: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, textDir: https://developer.android.com/reference/android/text/TextDirectionHeuristic.html, alignment: https://developer.android.com/reference/android/text/Layout.Alignment.html, maxLines: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, ellipsize: https://developer.android.com/reference/android/text/TextUtils.TruncateAt.html?, ellipsizedWidth: @https://developer.android.com/reference/kotlin/androidx/annotation/IntRange(from = 0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, lineSpacingMultiplier: @https://developer.android.com/reference/kotlin/androidx/annotation/FloatRange(from = 0.0) https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, lineSpacingExtra: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-float/index.html, justificationMode: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, includePadding: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, useFallbackLineSpacing: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html, breakStrategy: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, lineBreakStyle: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, lineBreakWordStyle: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, hyphenationFrequency: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html, leftIndents: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html?, rightIndents: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int-array/index.html? )` Builder class for StaticLayout. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/compose/ui/text/android/StaticLayoutFactory#isFallbackLineSpacingEnabled(android.text.StaticLayout,kotlin.Boolean)( layout: https://developer.android.com/reference/android/text/StaticLayout.html, useFallbackLineSpacing: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html )` Returns whether fallbackLineSpacing is enabled for the given layout. |

## Public functions

### create

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.6.0)

```
fun create(
    text: CharSequence,
    paint: TextPaint,
    width: Int,
    start: Int = 0,
    end: Int = text.length,
    textDir: TextDirectionHeuristic = LayoutCompat.DEFAULT_TEXT_DIRECTION_HEURISTIC,
    alignment: Layout.Alignment = LayoutCompat.DEFAULT_LAYOUT_ALIGNMENT,
    maxLines: @IntRange(from = 0) Int = LayoutCompat.DEFAULT_MAX_LINES,
    ellipsize: TextUtils.TruncateAt? = null,
    ellipsizedWidth: @IntRange(from = 0) Int = width,
    lineSpacingMultiplier: @FloatRange(from = 0.0) Float = LayoutCompat.DEFAULT_LINESPACING_MULTIPLIER,
    lineSpacingExtra: Float = LayoutCompat.DEFAULT_LINESPACING_EXTRA,
    justificationMode: Int = LayoutCompat.DEFAULT_JUSTIFICATION_MODE,
    includePadding: Boolean = LayoutCompat.DEFAULT_INCLUDE_PADDING,
    useFallbackLineSpacing: Boolean = LayoutCompat.DEFAULT_FALLBACK_LINE_SPACING,
    breakStrategy: Int = LayoutCompat.DEFAULT_BREAK_STRATEGY,
    lineBreakStyle: Int = LayoutCompat.DEFAULT_LINE_BREAK_STYLE,
    lineBreakWordStyle: Int = LayoutCompat.DEFAULT_LINE_BREAK_WORD_STYLE,
    hyphenationFrequency: Int = LayoutCompat.DEFAULT_HYPHENATION_FREQUENCY,
    leftIndents: IntArray? = null,
    rightIndents: IntArray? = null
): StaticLayout
```

Builder class for StaticLayout.

### isFallbackLineSpacingEnabled

Added in [1.6.0](https://developer.android.com/jetpack/androidx/releases/compose-ui#1.6.0)

```
fun isFallbackLineSpacingEnabled(
    layout: StaticLayout,
    useFallbackLineSpacing: Boolean
): Boolean
```

Returns whether fallbackLineSpacing is enabled for the given layout.

| Parameters |
|---|---|
| `layout: https://developer.android.com/reference/android/text/StaticLayout.html` | StaticLayout instance |
| `useFallbackLineSpacing: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | fallbackLineSpacing configuration passed while creating the StaticLayout. |