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

</div>

Property

# Graphics.TextUnit

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

<div class="warning">

<div class="title">

Warning

</div>

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

</div>

## Description

The units in which TextSize is measured.

## Notes

<div class="note">

<div class="title">

Note

</div>

<span class="title-ref">TextUnit</span> and the FontUnits enumeration are not available for use in Console or Web apps.

</div>

The FontUnits enumeration values are shown below:

| Value      |
|------------|
| Default    |
| Pixel      |
| Point      |
| Inch       |
| Millimeter |

## Sample code

This example sets the units to points using the class constant.

``` xojo
g.ForeColor = &cff0000
g.Italic = True
g.TextUnit = FontUnits.Point
g.TextSize = 16
g.DrawString("Hello world", 10, 10)
```

## Compatibility

All project types on all supported operating systems.

## See also

`Graphics</api/graphics/graphics>` parent class; `FontUnits</api/graphics/fontunits>` Enumeration
