home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / p_man / cat3 / X11 / XTextExtents.z / XTextExtents
Encoding:
Text File  |  2002-10-03  |  10.1 KB  |  199 lines

  1.  
  2.  
  3.  
  4.      XXXXTTTTeeeexxxxttttEEEExxxxtttteeeennnnttttssss((((3333XXXX11111111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))  XXXXTTTTeeeexxxxttttEEEExxxxtttteeeennnnttttssss((((3333XXXX11111111))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.           XTextExtents, XTextExtents16, XQueryTextExtents,
  10.           XQueryTextExtents16 - compute or query text extents
  11.  
  12.      SSSSYYYYNNNNTTTTAAAAXXXX
  13.           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,
  14.           _f_o_n_t__a_s_c_e_n_t__r_e_t_u_r_n,
  15.                         _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)
  16.                 XFontStruct *_f_o_n_t__s_t_r_u_c_t;
  17.                 char *_s_t_r_i_n_g;
  18.                 int _n_c_h_a_r_s;
  19.                 int *_d_i_r_e_c_t_i_o_n__r_e_t_u_r_n;
  20.                 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;
  21.                 XCharStruct *_o_v_e_r_a_l_l__r_e_t_u_r_n;
  22.  
  23.  
  24.           XTextExtents16(_f_o_n_t__s_t_r_u_c_t, _s_t_r_i_n_g, _n_c_h_a_r_s,
  25.           _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,
  26.                           _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)
  27.                 XFontStruct *_f_o_n_t__s_t_r_u_c_t;
  28.                 XChar2b *_s_t_r_i_n_g;
  29.                 int _n_c_h_a_r_s;
  30.                 int *_d_i_r_e_c_t_i_o_n__r_e_t_u_r_n;
  31.                 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;
  32.                 XCharStruct *_o_v_e_r_a_l_l__r_e_t_u_r_n;
  33.  
  34.  
  35.           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,
  36.           _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,
  37.                               _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)
  38.                 Display *_d_i_s_p_l_a_y;
  39.                 XID _f_o_n_t__I_D;
  40.                 char *_s_t_r_i_n_g;
  41.                 int _n_c_h_a_r_s;
  42.                 int *_d_i_r_e_c_t_i_o_n__r_e_t_u_r_n;
  43.                 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;
  44.                 XCharStruct *_o_v_e_r_a_l_l__r_e_t_u_r_n;
  45.  
  46.           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,
  47.           _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,
  48.                                   _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)
  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.      AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  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.  
  61.  
  62.  
  63.      Page 1                                          (printed 10/3/02)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      XXXXTTTTeeeexxxxttttEEEExxxxtttteeeennnnttttssss((((3333XXXX11111111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))  XXXXTTTTeeeexxxxttttEEEExxxxtttteeeennnnttttssss((((3333XXXX11111111))))
  71.  
  72.  
  73.  
  74.                     (_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).
  75.  
  76.           _d_i_s_p_l_a_y   Specifies the connection to the X server.
  77.  
  78.           _f_o_n_t__I_D   Specifies either the font ID or the _G_C_o_n_t_e_x_t ID
  79.                     that contains the font.
  80.  
  81.           _f_o_n_t__a_s_c_e_n_t__r_e_t_u_r_n
  82.                     Returns the font ascent.
  83.  
  84.           _f_o_n_t__d_e_s_c_e_n_t__r_e_t_u_r_n
  85.                     Returns the font descent.
  86.  
  87.           _f_o_n_t__s_t_r_u_c_t
  88.                     Specifies the _X_F_o_n_t_S_t_r_u_c_t structure.
  89.  
  90.           _n_c_h_a_r_s    Specifies the number of characters in the
  91.                     character string.
  92.  
  93.           _s_t_r_i_n_g    Specifies the character string.
  94.  
  95.           _o_v_e_r_a_l_l__r_e_t_u_r_n
  96.                     Returns the overall size in the specified
  97.                     _X_C_h_a_r_S_t_r_u_c_t structure.
  98.  
  99.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  100.           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
  101.           size computation locally and, thereby, avoid the round-trip
  102.           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
  103.           functions return an _X_C_h_a_r_S_t_r_u_c_t structure, whose members are
  104.           set to the values as follows.
  105.  
  106.           The ascent member is set to the maximum of the ascent
  107.           metrics of all characters in the string.  The descent member
  108.           is set to the maximum of the descent metrics.  The width
  109.           member is set to the sum of the character-width metrics of
  110.           all characters in the string.  For each character in the
  111.           string, let W be the sum of the character-width metrics of
  112.           all characters preceding it in the string.  Let L be the
  113.           left-side-bearing metric of the character plus W.  Let R be
  114.           the right-side-bearing metric of the character plus W.  The
  115.           lbearing member is set to the minimum L of all characters in
  116.           the string.  The rbearing member is set to the maximum R.
  117.  
  118.           For fonts defined with linear indexing rather than 2-byte
  119.           matrix indexing, each _X_C_h_a_r_2_b structure is interpreted as a
  120.           16-bit number with byte1 as the most significant byte.  If
  121.           the font has no defined default character, undefined
  122.           characters in the string are taken to have all zero metrics.
  123.  
  124.           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
  125.           return the bounding box of the specified 8-bit and 16-bit
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 10/3/02)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      XXXXTTTTeeeexxxxttttEEEExxxxtttteeeennnnttttssss((((3333XXXX11111111)))) XXXX VVVVeeeerrrrssssiiiioooonnnn 11111111 ((((RRRReeeelllleeeeaaaasssseeee 6666....6666))))  XXXXTTTTeeeexxxxttttEEEExxxxtttteeeennnnttttssss((((3333XXXX11111111))))
  137.  
  138.  
  139.  
  140.           character string in the specified font or the font contained
  141.           in the specified GC.  These functions query the X server
  142.           and, therefore, suffer the round-trip overhead that is
  143.           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
  144.           return a _X_C_h_a_r_S_t_r_u_c_t structure, whose members are set to the
  145.           values as follows.
  146.  
  147.           The ascent member is set to the maximum of the ascent
  148.           metrics of all characters in the string.  The descent member
  149.           is set to the maximum of the descent metrics.  The width
  150.           member is set to the sum of the character-width metrics of
  151.           all characters in the string.  For each character in the
  152.           string, let W be the sum of the character-width metrics of
  153.           all characters preceding it in the string.  Let L be the
  154.           left-side-bearing metric of the character plus W.  Let R be
  155.           the right-side-bearing metric of the character plus W.  The
  156.           lbearing member is set to the minimum L of all characters in
  157.           the string.  The rbearing member is set to the maximum R.
  158.  
  159.           For fonts defined with linear indexing rather than 2-byte
  160.           matrix indexing, each _X_C_h_a_r_2_b structure is interpreted as a
  161.           16-bit number with byte1 as the most significant byte.  If
  162.           the font has no defined default character, undefined
  163.           characters in the string are taken to have all zero metrics.
  164.  
  165.           Characters with all zero metrics are ignored.  If the font
  166.           has no defined default_char, the undefined characters in the
  167.           string are also ignored.
  168.  
  169.           _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
  170.           _B_a_d_F_o_n_t and _B_a_d_G_C errors.
  171.  
  172.      DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  173.           _B_a_d_F_o_n_t   A value for a Font or GContext argument does not
  174.                     name a defined Font.
  175.  
  176.           _B_a_d_G_C     A value for a GContext argument does not name a
  177.                     defined GContext.
  178.  
  179.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  180.           XLoadFont(3X11), XTextWidth(3X11)
  181.           _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                                          (printed 10/3/02)
  196.  
  197.  
  198.  
  199.