Enumeration

# FontUnits

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

## Description

Used by many `DesktopUIControl</api/user_interface/desktop/desktopuicontrol>` classes to set the TextUnits property. This is the unit in which the font size is specified for the control.

## Notes

The <span class="title-ref">FontUnits</span> enum has the following values:

| Value | Constant   | Description                                                                                                                                                                                                                                                                                             |
|-------|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| 0     | Default    | An appropriate cross-platform selection. On macOS, font units is in points, on Windows it is in pixel size, and on Linux it is a scale Point size. This is a legacy carry-over from the days where the TextSize of 12 was the default and 12 was assumed to be the standard font size on each platform. |
| 1     | Pixel      | Units are pixels.                                                                                                                                                                                                                                                                                       |
| 2     | Point      | Units are points.                                                                                                                                                                                                                                                                                       |
| 3     | Inches     | Units are inches.                                                                                                                                                                                                                                                                                       |
| 4     | Millimeter | Units are millimeters.                                                                                                                                                                                                                                                                                  |

This feature works on Windows, macOS, and Linux.

## Sample code

Setting the units to pixels for a `TextArea</api/user_interface/desktop/desktoptextarea>` control:

``` xojo
Me.FontUnit = FontUnits.Pixel
```

## Compatibility

|                       |                       |
|-----------------------|-----------------------|
| **Project Types**     | Console, Desktop, Web |
| **Operating Systems** | All                   |

<div class="seealso">

`DesktopBevelButton</api/user_interface/desktop/desktopbevelbutton>`, `DesktopCheckBox</api/user_interface/desktop/desktopcheckbox>`, `DesktopComboBox</api/user_interface/desktop/desktopcombobox>`, `Graphics</api/graphics/graphics>`, `DesktopGroupBox</api/user_interface/desktop/desktopgroupbox>`, `DesktopLabel</api/user_interface/desktop/desktoplabel>`, `DesktopListBox</api/user_interface/desktop/desktoplistbox>`, `DesktopPopupMenu</api/user_interface/desktop/desktoppopupmenu>`, `DesktopButton</api/user_interface/desktop/desktopbutton>`, `DesktopRadioButton</api/user_interface/desktop/desktopradiobutton>`, `TextShape</api/graphics/textshape>`, `DesktopTabPanel</api/user_interface/desktop/desktoptabpanel>`, `DesktopTextArea</api/user_interface/desktop/desktoptextarea>`, `DesktopTextField</api/user_interface/desktop/desktoptextfield>` controls

</div>
