# LineHeightSpan.WithDensity

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

# LineHeightSpan.WithDensity

*** ** * ** ***

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

`
public
static


interface
LineHeightSpan.WithDensity
`  
`


implements

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


`

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

<br />

*** ** * ** ***

The classes that affect the line height of paragraph with respect to density, should implement this interface.

## Summary

|                                                                                                                                                                                                                                                                                                                                     ### Public methods                                                                                                                                                                                                                                                                                                                                      ||
|------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[chooseHeight](https://developer.android.com/reference/android/text/style/LineHeightSpan.WithDensity#chooseHeight(java.lang.CharSequence,%20int,%20int,%20int,%20int,%20android.graphics.Paint.FontMetricsInt,%20android.text.TextPaint))`(`[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, `[TextPaint](https://developer.android.com/reference/android/text/TextPaint)` paint) ` Classes that implement this should define how the height is being calculated. |

| ### Inherited methods |
|-----------------------|---|
| From interface` `[android.text.style.LineHeightSpan](https://developer.android.com/reference/android/text/style/LineHeightSpan)` ` |------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` 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 5](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, 
                TextPaint paint)
```

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` <br />       |
| `paint`      | `TextPaint`: the paint <br />       |