# LineBreaker.ParagraphConstraints

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# ParagraphConstraints

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/graphics/text/LineBreaker.ParagraphConstraints "View this page in Java")  

```
open class ParagraphConstraints
```

|---|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                                                   ||
| ↳ | [android.graphics.text.LineBreaker.ParagraphConstraints](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#) |

Line breaking constraints for single paragraph.

## Summary

|                                                                        Public constructors                                                                         ||
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [ParagraphConstraints](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#ParagraphConstraints())`()` <br /> |

|                                                                                                                                                                                                                                                    Public methods                                                                                                                                                                                                                                                     ||
|------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)             | [getDefaultTabStop](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#getDefaultTabStop())`()` Returns the default tab stops in pixels.                                                                                                                                                                                                                           |
| open[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)             | [getFirstWidth](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#getFirstWidth())`()` Return the first line's width for this paragraph in pixel.                                                                                                                                                                                                                 |
| open[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)                 | [getFirstWidthLineCount](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#getFirstWidthLineCount())`()` Return the number of lines to apply the first line's width.                                                                                                                                                                                              |
| open[FloatArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float-array/index.html)? | [getTabStops](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#getTabStops())`()` Returns the array of tab stops in pixels.                                                                                                                                                                                                                                      |
| open[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)             | [getWidth](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#getWidth())`()` Return the width for this paragraph in pixels.                                                                                                                                                                                                                                       |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)               | [setIndent](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#setIndent(kotlin.Float,%20kotlin.Int))`(`firstWidth:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`, `firstWidthLineCount:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Set indent for this paragraph.                        |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)               | [setTabStops](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#setTabStops(kotlin.FloatArray,%20kotlin.Float))`(`tabStops:` `[FloatArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float-array/index.html)?`, `defaultTabStop:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` Set tab stops for this paragraph. |
| open[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)               | [setWidth](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#setWidth(kotlin.Float))`(`width:` `[Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html)`)` Set width for this paragraph.                                                                                                                                                   |

## Public constructors

### ParagraphConstraints

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
ParagraphConstraints()
```

## Public methods

### getDefaultTabStop

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun getDefaultTabStop(): Float
```

Returns the default tab stops in pixels.  
The units of this value are pixels.

|                                                                    Return                                                                    ||
|--------------------------------------------------------------------------------|--------------------------------------------------------------|
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) | The units of this value are pixels. Value is 0.0f or greater |

**See Also**

- [#setTabStops](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#setTabStops(kotlin.FloatArray,%20kotlin.Float))  

### getFirstWidth

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun getFirstWidth(): Float
```

Return the first line's width for this paragraph in pixel.  
The units of this value are pixels.

|                                                                    Return                                                                    ||
|--------------------------------------------------------------------------------|--------------------------------------------------------------|
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) | The units of this value are pixels. Value is 0.0f or greater |

**See Also**

- [#setIndent(float, int)](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#setIndent(kotlin.Float,%20kotlin.Int))  

### getFirstWidthLineCount

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun getFirstWidthLineCount(): Int
```

Return the number of lines to apply the first line's width.  
The units of this value are pixels.

|                                                                Return                                                                 ||
|----------------------------------------------------------------------------|-----------------------------------------------------------|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | The units of this value are pixels. Value is 0 or greater |

**See Also**

- [#setIndent(float, int)](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#setIndent(kotlin.Float,%20kotlin.Int))  

### getTabStops

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun getTabStops(): FloatArray?
```

Returns the array of tab stops in pixels.

|                                                        Return                                                        ||
|--------------------------------------------------------------------------------------------|--------------------------|
| [FloatArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float-array/index.html)? | This value may be`null`. |

**See Also**

- [#setTabStops](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#setTabStops(kotlin.FloatArray,%20kotlin.Float))  

### getWidth

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun getWidth(): Float
```

Return the width for this paragraph in pixels.  
The units of this value are pixels.

|                                                                    Return                                                                    ||
|--------------------------------------------------------------------------------|--------------------------------------------------------------|
| [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html) | The units of this value are pixels. Value is 0.0f or greater |

**See Also**

- [#setWidth(float)](https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#setWidth(kotlin.Float))  

### setIndent

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setIndent(
    firstWidth: Float, 
    firstWidthLineCount: Int
): Unit
```

Set indent for this paragraph.

|                                                                                                     Parameters                                                                                                     ||
|-----------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `firstWidth`          | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):the line width of the starting of the paragraph The units of this value are pixels. Value is 0.0f or greater |
| `firstWidthLineCount` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):the number of lines that applies the firstWidth The units of this value are pixels. Value is 0 or greater        |

**See Also**

- <https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#getFirstWidth()>
- <https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#getFirstWidthLineCount()>  

### setTabStops

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setTabStops(
    tabStops: FloatArray?, 
    defaultTabStop: Float
): Unit
```

Set tab stops for this paragraph.

|                                                                                                Parameters                                                                                                 ||
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `tabStops`       | [FloatArray](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float-array/index.html)?:the array of pixels of tap stopping position This value may be`null`.                        |
| `defaultTabStop` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):pixels of the default tab stopping position The units of this value are pixels. Value is 0.0f or greater |

**See Also**

- <https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#getTabStops()>
- <https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#getDefaultTabStop()>  

### setWidth

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setWidth(width: Float): Unit
```

Set width for this paragraph.

|                                                                      Parameters                                                                      ||
|---------|---------------------------------------------------------------------------------------------------------------------------------------------|
| `width` | [Float](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-float/index.html):The units of this value are pixels. Value is 0.0f or greater |

**See Also**

- <https://developer.android.com/reference/kotlin/android/graphics/text/LineBreaker.ParagraphConstraints#getWidth()>