<div class="meta" robots="noindex">

</div>

Method

# Graphics.StringHeight

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `Graphics.TextHeight<graphics.textheight>` as a replacement.

</div>

## Description

Returns as a `Double</api/data_types/double>` the height of the text based on the current font and font size and the passed *wrapWidth* (in display points).

## Notes

The *wrapWidth* parameter specifies the width (in pixels) at which text should wrap.

StringHeight is calculated as the maximum height for the font itself and not the actual height of the text. For example, with "a" vs. "A", both return the same <span class="title-ref">StringHeight</span> even though "A" has a greater height than "a".

## Sample code

``` xojo
g.TextFont = "Helvetica"
g.TextUnit = FontUnits.Pixel
g.TextSize = 32

Dim i As Double
i = g.StringHeight("Hello world", 150)
```

## Compatibility

All project types on all supported operating systems.
