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

  1.  
  2.  
  3.  
  4. XTextExtents(3X11)      XLIB FUNCTIONS       XTextExtents(3X11)
  5.  
  6.  
  7. NNAAMMEE
  8.        XTextExtents, XTextExtents16, XQueryTextExtents, XQuery-
  9.        TextExtents16 - compute or query text extents
  10.  
  11. SSYYNNTTAAXX
  12.        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_-
  13.        _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,
  14.              _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)
  15.          XFontStruct *_f_o_n_t___s_t_r_u_c_t;
  16.          char *_s_t_r_i_n_g;
  17.          int _n_c_h_a_r_s;
  18.          int *_d_i_r_e_c_t_i_o_n___r_e_t_u_r_n;
  19.          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;
  20.          XCharStruct *_o_v_e_r_a_l_l___r_e_t_u_r_n;
  21.  
  22.  
  23.        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_-
  24.        _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,
  25.                _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)
  26.          XFontStruct *_f_o_n_t___s_t_r_u_c_t;
  27.          XChar2b *_s_t_r_i_n_g;
  28.          int _n_c_h_a_r_s;
  29.          int *_d_i_r_e_c_t_i_o_n___r_e_t_u_r_n;
  30.          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;
  31.          XCharStruct *_o_v_e_r_a_l_l___r_e_t_u_r_n;
  32.  
  33.  
  34.        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_-
  35.        _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,
  36.                _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)
  37.          Display *_d_i_s_p_l_a_y;
  38.          XID _f_o_n_t___I_D;
  39.          char *_s_t_r_i_n_g;
  40.          int _n_c_h_a_r_s;
  41.          int *_d_i_r_e_c_t_i_o_n___r_e_t_u_r_n;
  42.          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;
  43.          XCharStruct *_o_v_e_r_a_l_l___r_e_t_u_r_n;
  44.  
  45.        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,
  46.        _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,
  47.                    _f_o_n_t___d_e_s_c_e_n_t___r_e_t_u_r_n,
  48.        _o_v_e_r_a_l_l___r_e_t_u_r_n)
  49.          Display *_d_i_s_p_l_a_y;
  50.          XID _f_o_n_t___I_D;
  51.          XChar2b *_s_t_r_i_n_g;
  52.          int _n_c_h_a_r_s;
  53.          int *_d_i_r_e_c_t_i_o_n___r_e_t_u_r_n;
  54.          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;
  55.          XCharStruct *_o_v_e_r_a_l_l___r_e_t_u_r_n;
  56.  
  57. AARRGGUUMMEENNTTSS
  58.        _d_i_r_e_c_t_i_o_n___r_e_t_u_r_n
  59.          Returns the value of the direction hint
  60.          (_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).
  61.  
  62.  
  63.  
  64. X Version 11           Release 6.1                1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. XTextExtents(3X11)      XLIB FUNCTIONS       XTextExtents(3X11)
  71.  
  72.  
  73.        _d_i_s_p_l_a_y     Specifies the connection to the X server.
  74.  
  75.        _f_o_n_t___I_D     Specifies either the font ID or the _G_C_o_n_t_e_x_t ID
  76.          that contains the font.
  77.  
  78.        _f_o_n_t___a_s_c_e_n_t___r_e_t_u_r_n
  79.          Returns the font ascent.
  80.  
  81.        _f_o_n_t___d_e_s_c_e_n_t___r_e_t_u_r_n
  82.          Returns the font descent.
  83.  
  84.        _f_o_n_t___s_t_r_u_c_t
  85.          Specifies the _X_F_o_n_t_S_t_r_u_c_t structure.
  86.  
  87.        _n_c_h_a_r_s     Specifies the number of characters in the char-
  88.          acter string.
  89.  
  90.        _s_t_r_i_n_g     Specifies the character string.
  91.  
  92.        _o_v_e_r_a_l_l___r_e_t_u_r_n
  93.          Returns the overall size in the specified
  94.          _X_C_h_a_r_S_t_r_u_c_t structure.
  95.  
  96. DDEESSCCRRIIPPTTIIOONN
  97.        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
  98.        size computation locally and, thereby, avoid the round-
  99.        trip overhead of _X_Q_u_e_r_y_T_e_x_t_E_x_t_e_n_t_s and
  100.        _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
  101.        structure, whose members are set to the values as follows.
  102.  
  103.        The ascent member is set to the maximum of the ascent met-
  104.        rics of all characters in the string.  The descent member
  105.        is set to the maximum of the descent metrics.  The width
  106.        member is set to the sum of the character-width metrics of
  107.        all characters in the string.  For each character in the
  108.        string, let W be the sum of the character-width metrics of
  109.        all characters preceding it in the string.  Let L be the
  110.        left-side-bearing metric of the character plus W.  Let R
  111.        be the right-side-bearing metric of the character plus W.
  112.        The lbearing member is set to the minimum L of all charac-
  113.        ters in the string.  The rbearing member is set to the
  114.        maximum R.
  115.  
  116.        For fonts defined with linear indexing rather than 2-byte
  117.        matrix indexing, each _X_C_h_a_r_2_b structure is interpreted as
  118.        a 16-bit number with byte1 as the most significant byte.
  119.        If the font has no defined default character, undefined
  120.        characters in the string are taken to have all zero met-
  121.        rics.
  122.  
  123.        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
  124.        return the bounding box of the specified 8-bit and 16-bit
  125.        character string in the specified font or the font con-
  126.        tained in the specified GC.  These functions query the X
  127.  
  128.  
  129.  
  130. X Version 11           Release 6.1                2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. XTextExtents(3X11)      XLIB FUNCTIONS       XTextExtents(3X11)
  137.  
  138.  
  139.        server and, therefore, suffer the round-trip overhead that
  140.        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 func-
  141.        tions return a _X_C_h_a_r_S_t_r_u_c_t structure, whose members are
  142.        set to the values as follows.
  143.  
  144.        The ascent member is set to the maximum of the ascent met-
  145.        rics of all characters in the string.  The descent member
  146.        is set to the maximum of the descent metrics.  The width
  147.        member is set to the sum of the character-width metrics of
  148.        all characters in the string.  For each character in the
  149.        string, let W be the sum of the character-width metrics of
  150.        all characters preceding it in the string.  Let L be the
  151.        left-side-bearing metric of the character plus W.  Let R
  152.        be the right-side-bearing metric of the character plus W.
  153.        The lbearing member is set to the minimum L of all charac-
  154.        ters in the string.  The rbearing member is set to the
  155.        maximum R.
  156.  
  157.        For fonts defined with linear indexing rather than 2-byte
  158.        matrix indexing, each _X_C_h_a_r_2_b structure is interpreted as
  159.        a 16-bit number with byte1 as the most significant byte.
  160.        If the font has no defined default character, undefined
  161.        characters in the string are taken to have all zero met-
  162.        rics.
  163.  
  164.        Characters with all zero metrics are ignored.  If the font
  165.        has no defined default_char, the undefined characters in
  166.        the string are also ignored.
  167.  
  168.        _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
  169.        _B_a_d_F_o_n_t and _B_a_d_G_C errors.
  170.  
  171. DDIIAAGGNNOOSSTTIICCSS
  172.        _B_a_d_F_o_n_t     A value for a Font or GContext argument does not
  173.          name a defined Font.
  174.  
  175.        _B_a_d_G_C     A value for a GContext argument does not name a
  176.          defined GContext.
  177.  
  178. SSEEEE AALLSSOO
  179.        XLoadFont(3X11), XTextWidth(3X11)
  180.        _X_l_i_b _- _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  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.