---
name: "XmSetFontUnits"
section: "3"
platform: "linux"
package: "openmotif"
version: "2.3.8-4"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/XmSetFontUnits"
---

# XmSetFontUnits(3)

A function that sets the font unit value for a display

## NAME

**XmSetFontUnits** — A function that sets the font unit value for a display

## SYNOPSIS

```
#include <Xm/Xm.h>
void XmSetFontUnits(
Display * display,
int h_value,
int v_value);
```

## DESCRIPTION

**XmSetFontUnits** provides an external function to initialize font unit values. Applications may want to specify resolution-independent data based on a global font size. This function must be called before any widgets with resolution-independent data are created. See the **XmNunitType** resource description in the reference pages for **XmGadget**, **XmManager**, and **XmPrimitive** for more information on resolution independence.

This function sets the font units for all screens on the display.

**NOTE:** **XmSetFontUnits** is obsolete and exists for compatibility with previous releases. Instead of using this function, provide initial values or call **XtSetValues** for the XmScreen resources **XmNhorizontalFontUnit** and **XmNverticalFontUnit**.

- *display*

  Defines the display for which this font unit value is to be applied.

- *h\_value*

  Specifies the value to be used for horizontal units in the conversion calculations.

- *h\_value*

  Specifies the value to be used for vertical units in the conversion calculations.

## RELATED

[**XmConvertUnits**(3)](/XmConvertUnits/3.md), [**XmSetFontUnit**(3)](/XmSetFontUnit/3.md), [**XmGadget**(3)](/XmGadget/3.md), [**XmManager**(3)](/XmManager/3.md), [**XmPrimitive**(3)](/XmPrimitive/3.md), and [**XmScreen**(3)](/XmScreen/3.md).
