XTextExtents(3)


HOME

XTextExtents

NAME
SYNTAX
ARGUMENTS
DESCRIPTION
DIAGNOSTICS
SEE ALSO

NAME

XTextExtents, XTextExtents16, XQueryTextExtents, XQueryTextExtents16 − compute or query text extents

SYNTAX

int XTextExtents(XFontStruct *font_struct, char *string, int nchars, int *direction_return, int *font_ascent_return, int *font_descent_return, XCharStruct *overall_return);

int XTextExtents16(XFontStruct *font_struct, XChar2b *string, int nchars, int *direction_return, int *font_ascent_return, int *font_descent_return, XCharStruct *overall_return);

int XQueryTextExtents(Display *display, XID font_ID, char *string, int nchars, int *direction_return, int *font_ascent_return, int *font_descent_return, XCharStruct *overall_return);

int XQueryTextExtents16(Display *display, XID font_ID, XChar2b *string, int nchars, int *direction_return, int *font_ascent_return, int *font_descent_return, XCharStruct *overall_return);

ARGUMENTS

direction_return

Returns the value of the direction hint (FontLeftToRight or FontRightToLeft).

display

Specifies the connection to the X server.

font_ID

Specifies either the font ID or the GContext ID that contains the font.

font_ascent_return

Returns the font ascent.

font_descent_return

Returns the font descent.

font_struct

Specifies the XFontStruct structure.

nchars

Specifies the number of characters in the character string.

string

Specifies the character string.

overall_return

Returns the overall size in the specified XCharStruct structure.

DESCRIPTION

The XTextExtents and XTextExtents16 functions perform the size computation locally and, thereby, avoid the round-trip overhead of XQueryTextExtents and XQueryTextExtents16. Both functions return an XCharStruct structure, whose members are set to the values as follows.

The ascent member is set to the maximum of the ascent metrics of all characters in the string. The descent member is set to the maximum of the descent metrics. The width member is set to the sum of the character-width metrics of all characters in the string. For each character in the string, let W be the sum of the character-width metrics of all characters preceding it in the string. Let L be the left-side-bearing metric of the character plus W. Let R be the right-side-bearing metric of the character plus W. The lbearing member is set to the minimum L of all characters in the string. The rbearing member is set to the maximum R.

For fonts defined with linear indexing rather than 2-byte matrix indexing, each XChar2b structure is interpreted as a 16-bit number with byte1 as the most significant byte. If the font has no defined default character, undefined characters in the string are taken to have all zero metrics.

The XQueryTextExtents and XQueryTextExtents16 functions return the bounding box of the specified 8-bit and 16-bit character string in the specified font or the font contained in the specified GC. These functions query the X server and, therefore, suffer the round-trip overhead that is avoided by XTextExtents and XTextExtents16. Both functions return a XCharStruct structure, whose members are set to the values as follows.

The ascent member is set to the maximum of the ascent metrics of all characters in the string. The descent member is set to the maximum of the descent metrics. The width member is set to the sum of the character-width metrics of all characters in the string. For each character in the string, let W be the sum of the character-width metrics of all characters preceding it in the string. Let L be the left-side-bearing metric of the character plus W. Let R be the right-side-bearing metric of the character plus W. The lbearing member is set to the minimum L of all characters in the string. The rbearing member is set to the maximum R.

For fonts defined with linear indexing rather than 2-byte matrix indexing, each XChar2b structure is interpreted as a 16-bit number with byte1 as the most significant byte. If the font has no defined default character, undefined characters in the string are taken to have all zero metrics.

Characters with all zero metrics are ignored. If the font has no defined default_char, the undefined characters in the string are also ignored.

XQueryTextExtents and XQueryTextExtents16 can generate BadFont and BadGC errors.

DIAGNOSTICS

BadFont

A value for a Font or GContext argument does not name a defined Font.

BadGC

A value for a GContext argument does not name a defined GContext.

SEE ALSO

XLoadFont(3), XTextWidth(3)
Xlib − C Language X Interface



More Linux Commands

manpages/DBM_Filter::utf8.3pm.html
DBM_Filter::utf8(3pm) - filter for DBM_Filter (Man Page)....
This Filter will ensure that all data written to the DBM will be encoded in UTF-8 . This module uses the Encode module. SEE ALSO DBM_Filter, perldbmfilter, Enco

manpages/XmbLookupString.3.html
XmbLookupString(3) - obtain composed input from an input met
The XmbLookupString, XwcLookupString and Xutf8LookupString functions return the string from the input method specified in the buffer_return argument. If no stri

manpages/file.n.html
file(n) - Manipulate file names and attributes (Man Page)...
This command provides several operations on a files name or attributes. Name is the name of a file; if it starts with a tilde, then tilde substitution is done b

manpages/Tcl_FSSplitPath.3.html
Tcl_FSSplitPath(3) - procedures to interact with any filesys
There are several reasons for calling the Tcl_FS API functions (e.g. Tcl_FSAccess and Tcl_FSStat) rather than calling system level functions like access and sta

manpages/gnutls_pkcs11_add_provider.3.html
gnutls_pkcs11_add_provider(3) - API function (Man Page).....
This function will load and add a PKCS 11 module to the module list used in gnutls. After this function is called the module will be used for PKCS 11 operations

manpages/ip-token.8.html
ip-token(8) tokenized interface identifier support..........
IPv6 tokenized interface identifier support is used for assigning well-known host-part addresses to nodes whilst still obtaining a global network prefix from Ro

manpages/tk_getOpenFile.n.html
tk_getOpenFile(n) - pop up a dialog box for the user to sele
The procedures tk_getOpenFile and tk_getSaveFile pop up a dialog box for the user to select a file to open or save. The tk_getOpenFile command is usually associ

manpages/item_name.3menu.html
item_name(3menu) - get menu item name and description fields
The function item_name returns the name part of the given item. The function item_description returns the description part of the given item. RETURN VALUE These

manpages/koi8-u.7.html
koi8-u(7) - Ukrainian character set encoded in octal, decima
KOI8-U (KOI8 Ukrainian, described in RFC 2310) is the de-facto standard character set for encoding Ukrainian texts. KOI8-U is compatible with KOI8-R (RFC 1489)

manpages/scalbf.3.html
scalbf(3) - multiply floating-point number by integral power
These functions multiply their first argument x by FLT_RADIX (probably 2) to the power of exp, that is: x * FLT_RADIX ** exp The definition of FLT_RADIX can be

manpages/vlc.1.html
vlc.1 (Manual - Linux man page)............................
This manual page documents briefly the VLC multimedia player and server. OPTIONS VLC follows the usual GNU command line syntax, with long options starting with

manpages/fts_close.3.html
fts_close(3) - traverse a file hierarchy - Linux man page...
The fts functions are provided for traversing file hierarchies. A simple overview is that the fts_open() function returns a handle on a file hierarchy, which is





We can't live, work or learn in freedom unless the software we use is free.