8.5.3 Computing Character String Sizes

Xlib provides functions that you can use to compute the width, the logical extents, and the server information about 8-bit and 2-byte text strings. The width is computed by adding the character widths of all the characters. It does not matter if the font is an 8-bit or 2-byte font. These functions return the sum of the character metrics, in pixels.

To determine the width of an 8-bit character string, use XTextWidth().

To determine the width of a 2-byte character string, use XTextWidth16().

Next: Computing Logical Extents

Christophe Tronche, ch@tronche.com