---
name: "XTextWidth"
section: "3x"
platform: "linux"
package: "libx11-dev"
version: "4.3.0.dfsg.1-14sarge7"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/XTextWidth/3x"
---

# XTextWidth(3x)

compute text width

## NAME

XTextWidth, XTextWidth16 - compute text width

## SYNTAX

int XTextWidth(XFontStruct \**font\_struct*, char \**string*, int *count*);

int XTextWidth16(XFontStruct \**font\_struct*, XChar2b \**string*, int *count*);

## ARGUMENTS

- *count*

  Specifies the character count in the specified string.

- *font\_struct*

  Specifies the font used for the width computation.

- *string*

  Specifies the character string.

## DESCRIPTION

The *XTextWidth* and *XTextWidth16* functions return the width of the specified 8-bit or 2-byte character strings.

## SEE ALSO

XLoadFont(3X11), XTextExtents(3X11)\
 *Xlib - C Language X Interface*
