gdk-Fonts               package:RGtk2               R Documentation

_F_o_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

     Loading and manipulating fonts

_M_e_t_h_o_d_s _a_n_d _F_u_n_c_t_i_o_n_s:

     'gdkFontLoad(font.name)'
      'gdkFontLoadForDisplay(display, font.name)'
      'gdkFontLoadForDisplay(display, font.name)'
      'gdkFontsetLoad(fontset.name)'
      'gdkFontsetLoadForDisplay(display, fontset.name)'
      'gdkFontsetLoadForDisplay(display, fontset.name)'
      'gdkFontFromDescription(font.desc)'
      'gdkFontFromDescriptionForDisplay(display, font.desc)'
      'gdkFontFromDescriptionForDisplay(display, font.desc)'
      'gdkFontGetDisplay(object)'
      'gdkFontGetDisplay(object)'
      'gdkFontId(object)'
      'gdkStringExtents(object, string)'
      'gdkTextExtents(object, string)'
      'gdkTextExtentsWc(object, text)'
      'gdkStringWidth(object, string)'
      'gdkTextWidth(object, text, text.length = -1)'
      'gdkTextWidthWc(object, text)'
      'gdkCharWidth(object, character)'
      'gdkCharWidthWc(object, character)'
      'gdkStringMeasure(object, string)'
      'gdkTextMeasure(object, text, text.length = -1)'
      'gdkCharMeasure(object, character)'
      'gdkStringHeight(object, string)'
      'gdkTextHeight(object, text, text.length = -1)'
      'gdkCharHeight(object, character)'

_D_e_t_a_i_l_e_d _D_e_s_c_r_i_p_t_i_o_n:

     The 'GdkFont' data type represents a font for drawing on the
     screen. These functions provide support for loading fonts, and
     also for determining the dimensions of characters and strings when
     drawn with a particular font.

     Fonts in X are specified by a X Logical Font Description.  The
     following description is considerably simplified. For definitive
     information about XLFD's see the  X reference documentation. A X
     Logical Font Description (XLFD) consists of a sequence of fields
     separated (and surrounded by) '-' characters. For example, Adobe
     Helvetica Bold 12 pt, has the full description: 

     "-adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1"

     The fields in the XLFD are:

       Foundry           the company or organization where the font originated.
       Family            the font family (a group of related font designs).
       Weight            A name for the font's typographic weight For example, 'bold' or 'medium').
       Slant             The slant of the font. Common values are 'R' for Roman, 'I' for italoc, and 'O' for oblique.
       Set Width         A name for the width of the font. For example, 'normal' or 'condensed'.
       Add Style         Additional information to distinguish a font from other fonts of the same family.
       Pixel Size        The body size of the font in pixels.
       Point Size        The body size of the font in 10ths of a point. (A   point   is 1/72.27 inch)
       Resolution X      The horizontal resolution that the font was designed for.
       Resolution Y      The vertical resolution that the font was designed for .
       Spacing           The type of spacing for the font - can be 'p' for proportional, 'm' for monospaced or 'c' for charcell.
       Average Width     The average width of a glyph in the font. For monospaced and charcell fonts, all glyphs in the font have this width
       Charset Registry  The registration authority that owns the encoding for the font. Together with the Charset Encoding field, this defines the character set for the font.
       Charset Encoding  An identifier for the particular character set encoding.

     When specifying a font via a X logical Font Description, '*' can
     be used as a wildcard to match any portion of the XLFD. For
     instance, the above example could also be specified as

     "-*-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-1"

     It is generally a good idea to use wildcards for any portion of
     the XLFD that your program does not care about specifically, since
     that will improve the chances of finding a matching font.

     A fontset is a list of fonts that is used for drawing
     international text that may contain characters from a number of
     different character sets. It is represented by a list of XLFD's. 

     The font for a given character set is determined by going through
     the list of XLFD's in order. For each one, if the registry and and
     encoding fields match the desired character set, then that font is
     used, otherwise if the XLFD contains wild-cards for the registry
     and encoding fields, the registry and encoding for the desired
     character set are substituted in and a lookup is done. If a match
     is found that font is used. Otherwise, processing continues on to
     the next font in the list.

     The functions for determining the metrics of a string come in
     several varieties that can take a number of forms of string input:


     _8-_b_i_t _s_t_r_i_n_g When using functions like 'gdkStringWidth' that take
          a 'character', if the font is of type 'GDK_FONT_FONT' and is
          an 8-bit font, then each 'character' indexes the glyphs in
          the font directly.

     _1_6-_b_i_t _s_t_r_i_n_g For functions taking a 'character', if the font is
          of type 'GDK_FONT_FONT', and is a 16-bit font, then the
          'character' argument is interpreted as a 'integer' cast to a
          'character' and each 'integer' indexes the glyphs in the font
          directly.

     _M_u_l_t_i_b_y_t_e _s_t_r_i_n_g For functions taking a 'character', if the font
          is of type 'GDK_FONT_FONTSET', then the input string is
          interpreted as a multibyte encoded according to the current
          locale. (A multibyte string is one in which each character
          may consist of one or more bytes, with different lengths for
          different characters in the string). They can be converted to
          and from wide character strings (see below) using
          'gdkWcstombs()' and 'gdkMbstowcs()'.) The string will be
          rendered using one or more different fonts from the fontset.

     _W_i_d_e _c_h_a_r_a_c_t_e_r _s_t_r_i_n_g For a number of the text-measuring
          functions, GDK provides a variant (such as 'gdkTextWidthWc')
          which takes a 'numeric' instead of a  'character'. The input
          is then taken to be a wide character string in the encoding
          of the current locale. (A wide character string is a string
          in which each character consists of several bytes, and the
          width of each character in the string is  constant.)


     GDK provides functions to determine a number of different
     measurements (metrics) for a given string. (Need diagram here).


     _a_s_c_e_n_t The vertical distance from the origin of the drawing
          opereration to the top of the drawn character.

     _d_e_s_c_e_n_t The vertical distance from the origin of the drawing
          opereration to the bottom of the drawn character.

     _l_e_f_t _b_e_a_r_i_n_g The horizontal distance from the origin of the
          drawing operation to the left-most part of the drawn
          character.

     _r_i_g_h_t _b_e_a_r_i_n_g The horizontal distance from the origin of the
          drawing operation to the right-most part of the drawn
          character.

     _w_i_d_t_h _b_e_a_r_i_n_g The horizontal distance from the origin of the
          drawing operation to the correct origin for drawing another
          string to follow the current one. Depending on the font, this
          could be greater than or less than the  right bearing.


_S_t_r_u_c_t_u_r_e_s:


     '_G_d_k_F_o_n_t' *WARNING: 'GdkFont' is deprecated and should not be used
          in newly-written code.* The 'GdkFont' structure represents a
          font or fontset. It contains the following public fields. A
          new 'GdkFont' structure is returned by 'gdkFontLoad' or
          'gdkFontsetLoad', and is reference counted with
          'gdkFontRef()' and 'gdkFontUnref()'

          '_t_y_p_e' ['GdkFontType'] a value of type 'GdkFontType' which
               indicates whether this font is a single font or a
               fontset.

          '_a_s_c_e_n_t' [integer] the maximum distance that the font, when
               drawn, ascends above the baseline.

          '_d_e_s_c_e_n_t' [integer] the maximum distance that the font, when
               drawn, descends below the baseline.


_E_n_u_m_s _a_n_d _F_l_a_g_s:


     '_G_d_k_F_o_n_t_T_y_p_e' *WARNING: 'GdkFontType' is deprecated and should not
          be used in newly-written code.* Indicates the type of a font.
          The possible values are currently:

          '_f_o_n_t' the font is a single font.

          '_f_o_n_t_s_e_t' the font is a fontset.


_A_u_t_h_o_r(_s):

     Derived by RGtkGen from GTK+ documentation

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://developer.gnome.org/doc/API/2.0/gdk/gdk-Fonts.html>

