# LineHeightSpan

Added in[API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Nested Classes](https://developer.android.com/reference/android/text/style/LineHeightSpan#nestedclasses)\|[Methods](https://developer.android.com/reference/android/text/style/LineHeightSpan#pubmethods)  

# LineHeightSpan

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/text/style/LineHeightSpan "View this page in Kotlin")\|Java

`
public


interface
LineHeightSpan
`  
`


implements

`[ParagraphStyle](https://developer.android.com/reference/android/text/style/ParagraphStyle)`,

`[WrapTogetherSpan](https://developer.android.com/reference/android/text/style/WrapTogetherSpan)`


`

|-----------------------------------|
| android.text.style.LineHeightSpan |

|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Known indirect subclasses [DrawableMarginSpan](https://developer.android.com/reference/android/text/style/DrawableMarginSpan),[IconMarginSpan](https://developer.android.com/reference/android/text/style/IconMarginSpan),[LineHeightSpan.Standard](https://developer.android.com/reference/android/text/style/LineHeightSpan.Standard),[LineHeightSpan.WithDensity](https://developer.android.com/reference/android/text/style/LineHeightSpan.WithDensity) |---------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [DrawableMarginSpan](https://developer.android.com/reference/android/text/style/DrawableMarginSpan)                 | A span which adds a drawable and a padding to the paragraph it's attached to.                                                                                                      | | [IconMarginSpan](https://developer.android.com/reference/android/text/style/IconMarginSpan)                         | Paragraph affecting span, that draws a bitmap at the beginning of a text.                                                                                                          | | [LineHeightSpan.Standard](https://developer.android.com/reference/android/text/style/LineHeightSpan.Standard)       | Default implementation of the[LineHeightSpan](https://developer.android.com/reference/android/text/style/LineHeightSpan), which changes the line height of the attached paragraph. | | [LineHeightSpan.WithDensity](https://developer.android.com/reference/android/text/style/LineHeightSpan.WithDensity) | The classes that affect the line height of paragraph with respect to density, should implement this interface.                                                                     | |

<br />

*** ** * ** ***

The classes that affect the line height of paragraph should implement this interface.

## Summary

|                                                                                                                                               ### Nested classes                                                                                                                                               ||
|--------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` class`     | [LineHeightSpan.Standard](https://developer.android.com/reference/android/text/style/LineHeightSpan.Standard) Default implementation of the[LineHeightSpan](https://developer.android.com/reference/android/text/style/LineHeightSpan), which changes the line height of the attached paragraph. |
| ` interface` | [LineHeightSpan.WithDensity](https://developer.android.com/reference/android/text/style/LineHeightSpan.WithDensity) The classes that affect the line height of paragraph with respect to density, should implement this interface.                                                               |

|                                                                                                                                                                                                                                                                        ### Public methods                                                                                                                                                                                                                                                                        ||
|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[chooseHeight](https://developer.android.com/reference/android/text/style/LineHeightSpan#chooseHeight(java.lang.CharSequence,%20int,%20int,%20int,%20int,%20android.graphics.Paint.FontMetricsInt))`(`[CharSequence](https://developer.android.com/reference/java/lang/CharSequence)` text, int start, int end, int spanstartv, int lineHeight, `[Paint.FontMetricsInt](https://developer.android.com/reference/android/graphics/Paint.FontMetricsInt)` fm) ` Classes that implement this should define how the height is being calculated. |

## Public methods

### chooseHeight

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

```
public abstract void chooseHeight (CharSequence text, 
                int start, 
                int end, 
                int spanstartv, 
                int lineHeight, 
                Paint.FontMetricsInt fm)
```

Classes that implement this should define how the height is being calculated.

<br />

|                                     Parameters                                      ||
|--------------|-----------------------------------------------------------------------|
| `text`       | `CharSequence`: the text <br />                                       |
| `start`      | `int`: the start of the line <br />                                   |
| `end`        | `int`: the end of the line <br />                                     |
| `spanstartv` | `int`: the start of the span <br />                                   |
| `lineHeight` | `int`: the line height <br />                                         |
| `fm`         | `Paint.FontMetricsInt`: font metrics of the paint, in integers <br /> |