home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / man / cat3 / xdrawtext.0 < prev    next >
Encoding:
Text File  |  1996-10-17  |  5.5 KB  |  199 lines

  1.  
  2.  
  3.  
  4. XDrawText(3X11)          XLIB FUNCTIONS      XDrawText(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XDrawText, XDrawText16, XTextItem, XTextItem16 - draw
  9.        polytext text and text drawing structures
  10.  
  11. SSYYNNTTAAXX
  12.        XDrawText(_d_i_s_p_l_a_y, _d, _g_c, _x, _y, _i_t_e_m_s, _n_i_t_e_m_s)
  13.          Display *_d_i_s_p_l_a_y;
  14.          Drawable _d;
  15.          GC _g_c;
  16.          int _x, _y;
  17.          XTextItem *_i_t_e_m_s;
  18.          int _n_i_t_e_m_s;
  19.  
  20.        XDrawText16(_d_i_s_p_l_a_y, _d, _g_c, _x, _y, _i_t_e_m_s, _n_i_t_e_m_s)
  21.          Display *_d_i_s_p_l_a_y;
  22.          Drawable _d;
  23.          GC _g_c;
  24.          int _x, _y;
  25.          XTextItem16 *_i_t_e_m_s;
  26.          int _n_i_t_e_m_s;
  27.  
  28. AARRGGUUMMEENNTTSS
  29.        _d     Specifies the drawable.
  30.  
  31.        _d_i_s_p_l_a_y     Specifies the connection to the X server.
  32.  
  33.        _g_c     Specifies the GC.
  34.  
  35.        _i_t_e_m_s     Specifies an array of text items.
  36.  
  37.        _n_i_t_e_m_s     Specifies the number of text items in the array.
  38.  
  39.        _x
  40.        _y     Specify the x and y coordinates, which are rela-
  41.          tive to the origin of the specified drawable and
  42.          define the origin of the first character.
  43.  
  44. DDEESSCCRRIIPPTTIIOONN
  45.        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
  46.        that it uses 2-byte or 16-bit characters.  Both functions
  47.        allow complex spacing and font shifts between counted
  48.        strings.
  49.  
  50.        Each text item is processed in turn.  A font member other
  51.        than _N_o_n_e in an item causes the font to be stored in the
  52.        GC and used for subsequent text.     A text element delta
  53.        specifies an additional change in the position along the x
  54.        axis before the string is drawn.     The delta is always
  55.        added to the character origin and is not dependent on any
  56.        characteristics of the font.  Each character image, as
  57.        defined by the font in the GC, is treated as an additional
  58.        mask for a fill operation on the drawable.  The drawable
  59.        is modified only where the font character has a bit set to
  60.        1.  If a text item generates a _B_a_d_F_o_n_t error, the previous
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XDrawText(3X11)          XLIB FUNCTIONS      XDrawText(3X11)
  71.  
  72.  
  73.        text items may have been drawn.
  74.  
  75.        For fonts defined with linear indexing rather than 2-byte
  76.        matrix indexing, each _X_C_h_a_r_2_b structure is interpreted as
  77.        a 16-bit number with byte1 as the most significant byte.
  78.  
  79.        Both functions use these GC components: function, plane-
  80.        mask, fill-style, font, subwindow-mode, clip-x-origin,
  81.        clip-y-origin, and clip-mask.  They also use these GC
  82.        mode-dependent components: foreground, background, tile,
  83.        stipple, tile-stipple-x-origin, and tile-stipple-y-origin.
  84.  
  85.        _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,
  86.        _B_a_d_F_o_n_t, _B_a_d_G_C, and _B_a_d_M_a_t_c_h errors.
  87.  
  88. SSTTRRUUCCTTUURREESS
  89.        The _X_T_e_x_t_I_t_e_m and _X_T_e_x_t_I_t_e_m_1_6 structures contain:
  90.  
  91.        typedef struct {
  92.         char *chars;         /* pointer to string */
  93.         int nchars;             /* number of characters */
  94.         int delta;             /* delta between strings */
  95.         Font font;             /* Font to print it in, None don't change */
  96.        } XTextItem;
  97.  
  98.        typedef struct {
  99.         XChar2b *chars;         /* pointer to two-byte characters */
  100.         int nchars;             /* number of characters */
  101.         int delta;             /* delta between strings */
  102.         Font font;             /* font to print it in, None don't change */
  103.        } XTextItem16;
  104.  
  105.        If the font member is not _N_o_n_e, the font is changed before
  106.        printing and also is stored in the GC.  If an error was
  107.        generated during text drawing, the previous items may have
  108.        been drawn.  The baseline of the characters are drawn
  109.        starting at the x and y coordinates that you pass in the
  110.        text drawing functions.
  111.  
  112.        For example, consider the background rectangle drawn by
  113.        _X_D_r_a_w_I_m_a_g_e_S_t_r_i_n_g.  If you want the upper-left corner of
  114.        the background rectangle to be at pixel coordinate (x,y),
  115.        pass the (x,y + ascent) as the baseline origin coordinates
  116.        to the text functions.  The ascent is the font ascent, as
  117.        given in the _X_F_o_n_t_S_t_r_u_c_t structure.  If you want the
  118.        lower-left corner of the background rectangle to be at
  119.        pixel coordinate (x,y), pass the (x,y - descent + 1) as
  120.        the baseline origin coordinates to the text functions.
  121.        The descent is the font descent, as given in the
  122.        _X_F_o_n_t_S_t_r_u_c_t structure.
  123.  
  124. DDIIAAGGNNOOSSTTIICCSS
  125.        _B_a_d_D_r_a_w_a_b_l_e
  126.          A value for a Drawable argument does not name a
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XDrawText(3X11)          XLIB FUNCTIONS      XDrawText(3X11)
  137.  
  138.  
  139.          defined Window or Pixmap.
  140.  
  141.        _B_a_d_F_o_n_t     A value for a Font or GContext argument does not
  142.          name a defined Font.
  143.  
  144.        _B_a_d_G_C     A value for a GContext argument does not name a
  145.          defined GContext.
  146.  
  147.        _B_a_d_M_a_t_c_h     An _I_n_p_u_t_O_n_l_y window is used as a Drawable.
  148.  
  149. SSEEEE AALLSSOO
  150.        XDrawImageString(3X11), XDrawString(3X11), XLoadFont(3X11)
  151.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196. X Version 11           Release 6.1                3
  197.  
  198.  
  199.