# dxGetFontHeight (Client)

> Returns the height of one line of text in a font.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Screen drawing
- **URL**: https://wiki.mymp.gg/en/dxGetFontHeight

## Syntax

```lua
float|false dxGetFontHeight([float scale = 1, string|element font = default])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `scale` | `float` | Text scale. *(default: `1`)* |
| `font` | `string\|element` | A font's name (from a pack or given to `dxCreateFont`) or a font element from `dxCreateFont`. *(default: `default`)* |

## Returns

The height in pixels, or `false` when the font does not exist.

## Example

```lua
local lines = { "Vida", "Colete", "Dinheiro" }
local lineHeight = dxGetFontHeight(1.5, "default")

addEventHandler("onClientRender", root, function()
    for i, line in ipairs(lines) do
        dxDrawText(line, 20, 200 + (i - 1) * lineHeight, 0, 0, tocolor(255, 255, 255), 1.5)
    end
end)
```

## See also

- [dxGetTextWidth (Client)](https://wiki.mymp.gg/en/dxGetTextWidth.md): Measures how wide a text is on the screen, at its widest line.
- [dxGetTextSize (Client)](https://wiki.mymp.gg/en/dxGetTextSize.md): Measures the width and height a text takes on the screen.
- [dxCreateFont (Client)](https://wiki.mymp.gg/en/dxCreateFont.md): Creates a font from a font file in the resource, for the text functions.
