


XTextExtents(3X11)					   XTextExtents(3X11)
X11R5									X11R5



NAME
  XTextExtents,	XTextExtents16,	XQueryTextExtents, XQueryTextExtents16 - com-
  pute or query	text extents

SYNTAX
  XTextExtents(_f_o_n_t__s_t_r_u_c_t, _s_t_r_i_n_g, _n_c_h_a_r_s, _d_i_r_e_c_t_i_o_n__r_e_t_u_r_n,
  _f_o_n_t__a_s_c_e_n_t__r_e_t_u_r_n,
		_f_o_n_t__d_e_s_c_e_n_t__r_e_t_u_r_n, _o_v_e_r_a_l_l__r_e_t_u_r_n)
	XFontStruct *_f_o_n_t__s_t_r_u_c_t;
	char *_s_t_r_i_n_g;
	int _n_c_h_a_r_s;
	int *_d_i_r_e_c_t_i_o_n__r_e_t_u_r_n;
	int *_f_o_n_t__a_s_c_e_n_t__r_e_t_u_r_n, *_f_o_n_t__d_e_s_c_e_n_t__r_e_t_u_r_n;
	XCharStruct *_o_v_e_r_a_l_l__r_e_t_u_r_n;


  XTextExtents16(_f_o_n_t__s_t_r_u_c_t, _s_t_r_i_n_g, _n_c_h_a_r_s, _d_i_r_e_c_t_i_o_n__r_e_t_u_r_n,
  _f_o_n_t__a_s_c_e_n_t__r_e_t_u_r_n,
		  _f_o_n_t__d_e_s_c_e_n_t__r_e_t_u_r_n, _o_v_e_r_a_l_l__r_e_t_u_r_n)
	XFontStruct *_f_o_n_t__s_t_r_u_c_t;
	XChar2b	*_s_t_r_i_n_g;
	int _n_c_h_a_r_s;
	int *_d_i_r_e_c_t_i_o_n__r_e_t_u_r_n;
	int *_f_o_n_t__a_s_c_e_n_t__r_e_t_u_r_n, *_f_o_n_t__d_e_s_c_e_n_t__r_e_t_u_r_n;
	XCharStruct *_o_v_e_r_a_l_l__r_e_t_u_r_n;


  XQueryTextExtents(_d_i_s_p_l_a_y, _f_o_n_t__I_D, _s_t_r_i_n_g, _n_c_h_a_r_s, _d_i_r_e_c_t_i_o_n__r_e_t_u_r_n,
  _f_o_n_t__a_s_c_e_n_t__r_e_t_u_r_n,
		      _f_o_n_t__d_e_s_c_e_n_t__r_e_t_u_r_n, _o_v_e_r_a_l_l__r_e_t_u_r_n)
	Display	*_d_i_s_p_l_a_y;
	XID _f_o_n_t__I_D;
	char *_s_t_r_i_n_g;
	int _n_c_h_a_r_s;
	int *_d_i_r_e_c_t_i_o_n__r_e_t_u_r_n;
	int *_f_o_n_t__a_s_c_e_n_t__r_e_t_u_r_n, *_f_o_n_t__d_e_s_c_e_n_t__r_e_t_u_r_n;
	XCharStruct *_o_v_e_r_a_l_l__r_e_t_u_r_n;

  XQueryTextExtents16(_d_i_s_p_l_a_y, _f_o_n_t__I_D,	_s_t_r_i_n_g,	_n_c_h_a_r_s,	_d_i_r_e_c_t_i_o_n__r_e_t_u_r_n,
  _f_o_n_t__a_s_c_e_n_t__r_e_t_u_r_n,
			  _f_o_n_t__d_e_s_c_e_n_t__r_e_t_u_r_n, _o_v_e_r_a_l_l__r_e_t_u_r_n)
	Display	*_d_i_s_p_l_a_y;
	XID _f_o_n_t__I_D;
	XChar2b	*_s_t_r_i_n_g;
	int _n_c_h_a_r_s;
	int *_d_i_r_e_c_t_i_o_n__r_e_t_u_r_n;
	int *_f_o_n_t__a_s_c_e_n_t__r_e_t_u_r_n, *_f_o_n_t__d_e_s_c_e_n_t__r_e_t_u_r_n;
	XCharStruct *_o_v_e_r_a_l_l__r_e_t_u_r_n;




ARGUMENTS

  _d_i_r_e_c_t_i_o_n__r_e_t_u_r_n
	    Returns the	value of the direction hint (_F_o_n_t_L_e_f_t_T_o_R_i_g_h_t or	_F_o_n_-
	    _t_R_i_g_h_t_T_o_L_e_f_t).

  _d_i_s_p_l_a_y   Specifies the connection to	the X server.

  _f_o_n_t__I_D   Specifies either the font ID or the	_G_C_o_n_t_e_x_t ID that contains the
	    font.

  _f_o_n_t__a_s_c_e_n_t__r_e_t_u_r_n
	    Returns the	font ascent.

  _f_o_n_t__d_e_s_c_e_n_t__r_e_t_u_r_n
	    Returns the	font descent.

  _f_o_n_t__s_t_r_u_c_t
	    Specifies the _X_F_o_n_t_S_t_r_u_c_t structure.

  _n_c_h_a_r_s    Specifies the number of characters in the character	string.

  _s_t_r_i_n_g    Specifies the character string.

  _o_v_e_r_a_l_l__r_e_t_u_r_n
	    Returns the	overall	size in	the specified _X_C_h_a_r_S_t_r_u_c_t structure.

DESCRIPTION
  The _X_T_e_x_t_E_x_t_e_n_t_s and _X_T_e_x_t_E_x_t_e_n_t_s_1_6 functions	perform	the size computation
  locally and, thereby,	avoid the round-trip overhead of _X_Q_u_e_r_y_T_e_x_t_E_x_t_e_n_t_s
  and _X_Q_u_e_r_y_T_e_x_t_E_x_t_e_n_t_s_1_6.  Both functions return an _X_C_h_a_r_S_t_r_u_c_t structure,
  whose	members	are set	to the values as follows.

  The ascent member is set to the maximum of the ascent	metrics	of all char-
  acters in the	string.	 The descent member is set to the maximum of the des-
  cent 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 _X_C_h_a_r_2_b structure is interpreted	as a 16-bit number with	byte1 as the
  most-significant byte.  If the font has no defined default character,	unde-
  fined	characters in the string are taken to have all zero metrics.

  The _X_Q_u_e_r_y_T_e_x_t_E_x_t_e_n_t_s	and _X_Q_u_e_r_y_T_e_x_t_E_x_t_e_n_t_s_1_6	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
  _X_T_e_x_t_E_x_t_e_n_t_s and _X_T_e_x_t_E_x_t_e_n_t_s_1_6.  Both functions return a _X_C_h_a_r_S_t_r_u_c_t
  structure, whose members are set to the values as follows.

  The ascent member is set to the maximum of the ascent	metrics	of all char-
  acters in the	string.	 The descent member is set to the maximum of the des-
  cent 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 _X_C_h_a_r_2_b structure is interpreted	as a 16-bit number with	byte1 as the
  most-significant byte.  If the font has no defined default character,	unde-
  fined	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.

  _X_Q_u_e_r_y_T_e_x_t_E_x_t_e_n_t_s and	_X_Q_u_e_r_y_T_e_x_t_E_x_t_e_n_t_s_1_6 can	generate _B_a_d_F_o_n_t and _B_a_d_G_C
  errors.

DIAGNOSTICS

  _B_a_d_F_o_n_t   A value for	a Font or GContext argument does not name a defined
	    Font.

  _B_a_d_G_C	    A value for	a GContext argument does not name a defined GContext.

SEE ALSO
  XLoadFont(3X11), XTextWidth(3X11)
  _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e


















































