


XDrawText(3X11)						      XDrawText(3X11)
X11R5									X11R5



NAME
  XDrawText, XDrawText16, XTextItem, XTextItem16 - draw	polytext text and
  text drawing structures

SYNTAX
  XDrawText(_d_i_s_p_l_a_y, _d,	_g_c, _x, _y, _i_t_e_m_s, _n_i_t_e_m_s)
	Display	*_d_i_s_p_l_a_y;
	Drawable _d;
	GC _g_c;
	int _x, _y;
	XTextItem *_i_t_e_m_s;
	int _n_i_t_e_m_s;

  XDrawText16(_d_i_s_p_l_a_y, _d, _g_c, _x, _y, _i_t_e_m_s, _n_i_t_e_m_s)
	Display	*_d_i_s_p_l_a_y;
	Drawable _d;
	GC _g_c;
	int _x, _y;
	XTextItem16 *_i_t_e_m_s;
	int _n_i_t_e_m_s;

ARGUMENTS

  _d	    Specifies the drawable.

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

  _g_c	    Specifies the GC.

  _i_t_e_m_s	    Specifies an array of text items.

  _n_i_t_e_m_s    Specifies the number of text items in the array.

  _x
  _y	    Specify the	x and y	coordinates, which are relative	to the origin
	    of the specified drawable and define the origin of the first
	    character.

DESCRIPTION
  The _X_D_r_a_w_T_e_x_t_1_6 function is similar to _X_D_r_a_w_T_e_x_t except that it uses 2-byte
  or 16-bit characters.	 Both functions	allow complex spacing and font shifts
  between counted strings.

  Each text item is processed in turn.	A font member other than _N_o_n_e in an
  item causes the font to be stored in the GC and used for subsequent text. A
  text element delta specifies an additional change in the position along the
  x axis before	the string is drawn. The delta is always added to the charac-
  ter origin and is not	dependent on any characteristics of the	font.  Each
  character image, as defined by the font in the GC, is	treated	as an addi-
  tional mask for a fill operation on the drawable.  The drawable is modified
  only where the font character	has a bit set to 1.  If	a text item generates
  a _B_a_d_F_o_n_t error, the previous	text items may have been drawn.

  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.


  Both functions use these GC components: function, plane-mask,	fill-style,
  font,	subwindow-mode,	clip-x-origin, clip-y-origin, and clip-mask.  They
  also use these GC mode-dependent components: foreground, background, tile,
  stipple, tile-stipple-x-origin, and tile-stipple-y-origin.

  _X_D_r_a_w_T_e_x_t and	_X_D_r_a_w_T_e_x_t_1_6 can	generate _B_a_d_D_r_a_w_a_b_l_e, _B_a_d_F_o_n_t, _B_a_d_G_C, and
  _B_a_d_M_a_t_c_h errors.

STRUCTURES
  The _X_T_e_x_t_I_t_e_m	and _X_T_e_x_t_I_t_e_m_1_6	structures contain:

  typedef struct {
	  char *chars;	  /* pointer to	string */
	  int nchars;	  /* number of characters */
	  int delta;	  /* delta between strings */
	  Font font;	  /* Font to print it in, None don't change */
  } XTextItem;

  typedef struct {
	  XChar2b *chars; /* pointer to	two-byte characters */
	  int nchars;	  /* number of characters */
	  int delta;	  /* delta between strings */
	  Font font;	  /* font to print it in, None don't change */
  } XTextItem16;

  If the font member is	not _N_o_n_e, the font is changed before printing and
  also is stored in the	GC.  If	an error was generated during text drawing,
  the previous items may have been drawn.  The baseline	of the characters are
  drawn	starting at the	x and y	coordinates that you pass in the text drawing
  functions.

  For example, consider	the background rectangle drawn by _X_D_r_a_w_I_m_a_g_e_S_t_r_i_n_g.
  If you want the upper-left corner of the background rectangle	to be at
  pixel	coordinate (x,y), pass the (x,y	+ ascent) as the baseline origin
  coordinates to the text functions.  The ascent is the	font ascent, as	given
  in the _X_F_o_n_t_S_t_r_u_c_t structure.	 If you	want the lower-left corner of the
  background rectangle to be at	pixel coordinate (x,y),	pass the (x,y -	des-
  cent + 1) as the baseline origin coordinates to the text functions.  The
  descent is the font descent, as given	in the _X_F_o_n_t_S_t_r_u_c_t structure.

DIAGNOSTICS

  _B_a_d_D_r_a_w_a_b_l_e
	    A value for	a Drawable argument does not name a defined Window or
	    Pixmap.

  _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.

  _B_a_d_M_a_t_c_h  An _I_n_p_u_t_O_n_l_y window	is used	as a Drawable.

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










