1mNAME0m
       font - Create and inspect fonts.

1mSYNOPSIS0m
       1mfont 4m22moption24m ?4marg24m 4marg24m 4m...24m?

1mDESCRIPTION0m
       The  1mfont  22mcommand  provides several facilities for dealing with fonts,
       such as defining named fonts and inspecting the actual attributes of  a
       font.  The command has several different forms, determined by the first
       argument.  The following forms are currently supported:

       1mfont actual 4m22mfont24m ?1m-displayof 4m22mwindow24m? ?4moption24m?
              Returns information about the the  actual  attributes  that  are
              obtained  when  4mfont24m  is  used  on  4mwindow24m's display; the actual
              attributes obtained may differ from the attributes requested due
              to  platform-dependant  limitations, such as the availability of
              font families and pointsizes.  4mfont24m is a font  description;  see
              FONT  DESCRIPTIONS below.  If the 4mwindow24m argument is omitted, it
              defaults to the main window.  If 4moption24m  is  specified,  returns
              the  value of that attribute; if it is omitted, the return value
              is a list of all the attributes  and  their  values.   See  FONT
              OPTIONS below for a list of the possible attributes.

       1mfont configure 4m22mfontname24m ?4moption24m? ?4mvalue24m 4moption24m 4mvalue24m 4m...24m?
              Query or modify the desired attributes for the named font called
              4mfontname24m.  If no 4moption24m is specified, returns a list  describing
              all  the  options  and  their  values for 4mfontname24m.  If a single
              4moption24m is specified with no  4mvalue24m,  then  returns  the  current
              value  of that attribute.  If one or more 4moption24m-4mvalue24m pairs are
              specified, then the command modifies the  given  named  font  to
              have the given values; in this case, all widgets using that font
              will redisplay themselves using the new attributes for the font.
              See FONT OPTIONS below for a list of the possible attributes.

       1mfont create 22m?4mfontname24m? ?4moption24m 4mvalue24m 4m...24m?
              Creates  a new named font and returns its name.  4mfontname24m speci-
              fies the name for the font; if it is omitted, then Tk  generates
              a  new name of the form 1mfont4m22mx24m, where 4mx24m is an integer.  There may
              be any number of 4moption24m-4mvalue24m pairs, which provide  the  desired
              attributes for the new named font.  See FONT OPTIONS below for a
              list of the possible attributes.

       1mfont delete 4m22mfontname24m ?4mfontname24m 4m...24m?
              Delete the specified named fonts.  If there  are  widgets  using
              the  named  font, the named font won't actually be deleted until
              all the instances are released.  Those widgets will continue  to
              display  using  the  last known values for the named font.  If a
              deleted named font is subsequently recreated with  another  call
              to  1mfont  create22m,  the  widgets  will use the new named font and
              redisplay themselves using the new attributes of that font.

       1mfont families 22m?1m-displayof 4m22mwindow24m?
              The return value is a list of the case-insensitive names of  all
              font  families  that  exist  on 4mwindow24m's display.  If the 4mwindow0m
              argument is omitted, it defaults to the main window.

       1mfont measure 4m22mfont24m ?1m-displayof 4m22mwindow24m? 4mtext0m
              Measures the amount of space the string 4mtext24m would  use  in  the
              given  4mfont24m  when  displayed in 4mwindow24m.  4mfont24m is a font descrip-
              tion; see FONT DESCRIPTIONS below.  If the  4mwindow24m  argument  is
              omitted,  it  defaults  to the main window.  The return value is
              the total width in pixels of 4mtext24m, not including the extra  pix-
              els used by highly exagerrated characters such as cursive ``f''.
              If the string contains newlines or tabs,  those  characters  are
              not expanded or treated specially when measuring the string.

       1mfont metrics 4m22mfont24m ?1m-displayof 4m22mwindow24m? ?4moption24m?
              Returns  information about the metrics (the font-specific data),
              for 4mfont24m when it is used on 4mwindow24m's display.  4mfont24m  is  a  font
              description;  see  FONT DESCRIPTIONS below.  If the 4mwindow24m argu-
              ment is omitted, it defaults to the main window.  If  4moption24m  is
              specified,  returns  the value of that metric; if it is omitted,
              the return value is a list of all the metrics and their  values.
              See FONT METRICS below for a list of the possible metrics.

       1mfont names0m
              The  return value is a list of all the named fonts that are cur-
              rently defined.

1mFONT DESCRIPTION0m
       The following formats are accepted as a font description anywhere  4mfont0m
       is  specified as an argument above; these same forms are also permitted
       when specifying the 1m-font 22moption for widgets.

       [1] 4mfontname0m
              The name of a named font, created using the 1mfont create 22mcommand.
              When a widget uses a named font, it is guaranteed that this will
              never cause an error, as long as the named font exists, no  mat-
              ter  what  potentially  invalid or meaningless set of attributes
              the named font has.  If the named font cannot be displayed  with
              exactly  the specified attributes, some other close font will be
              substituted automatically.

       [2] 4msystemfont0m
              The platform-specific name of a font, interpreted by the  graph-
              ics  server.  This also includes, under X, an XLFD (see [4]) for
              which a single ``1m*22m'' character was used to elide more  than  one
              field  in  the middle of the name.  See PLATFORM-SPECIFIC issues
              for a list of the system fonts.

       [3] 4mfamily24m ?4msize24m? ?4mstyle24m? ?4mstyle24m 4m...24m?
              A properly formed list whose first element is the  desired  font
              4mfamily24m  and  whose  optional second element is the desired 4msize24m.
              The interpretation of the 4msize24m attribute follows the same  rules
              described  for  1m-size  22min  FONT  OPTIONS  below.  Any additional
              optional arguments following the 4msize24m are font 4mstyle24ms.  Possible
              values for the 4mstyle24m arguments are as follows:

                     1mnormal      bold        roman      italic0m
                     1munderline   overstrike0m


       [4] X-font names (XLFD)
              A  Unix-centric  font  name  of the form 4m-foundry-family-weight-0m
              4mslant-setwidth-addstyle-pixel-point-resx-resy-spacing-width-0m
              4mcharset-encoding24m.  The ``1m*22m'' character may be used to skip indi-
              vidual fields that the user does not care about.  There must  be
              exactly one ``1m*22m'' for each field skipped, except that a ``1m*22m'' at
              the end of the XLFD skips any  remaining  fields;  the  shortest
              valid  XLFD  is simply ``1m*22m'', signifying all fields as defaults.
              Any fields that were skipped are given default values.  For com-
              patibility, an XLFD always chooses a font of the specified pixel
              size (not point  size);  although  this  interpretation  is  not
              strictly  correct, all existing applications using XLFDs assumed
              that one ``point'' was in  fact  one  pixel  and  would  display
              incorrectly  (generally  larger)  if  the correct size font were
              actually used.

       [5] 4moption24m 4mvalue24m ?4moption24m 4mvalue24m 4m...24m?
              A properly formed list of 4moption24m-4mvalue24m pairs  that  specify  the
              desired  attributes  of  the  font, in the same format used when
              defining a named font; see FONT OPTIONS below.

       When font description 4mfont24m is used, the system attempts  to  parse  the
       description  according  to  each  of the above five rules, in the order
       specified.  Cases [1] and [2] must match the name of an existing  named
       font  or of a system font.  Cases [3], [4], and [5] are accepted on all
       platforms and the closest available font will be used.  In some  situa-
       tions  it  may  not  be possible to find any close font (e.g., the font
       family was a  garbage  value);  in  that  case,  some  system-dependant
       default  font is chosen.  If the font description does not match any of
       the above patterns, an error is generated.

1mFONT METRICS0m
       The following options are used by the 1mfont  metrics  22mcommand  to  query
       font-specific data determined when the font was created.  These proper-
       ties are for the whole font itself and not  for  individual  characters
       drawn  in that font.  In the following definitions, the ``baseline'' of
       a font is the horizontal line where the bottom of most letters line up;
       certain letters, such as lower-case ``g'' stick below the baseline.

       1m-ascent0m
              The amount in pixels that the tallest letter sticks up above the
              baseline of the font, plus any extra blank space  added  by  the
              designer of the font.

       1m-descent0m
              The  largest  amount in pixels that any letter sticks down below
              the baseline of the font, plus any extra blank  space  added  by
              the designer of the font.

       1m-linespace0m
              Returns  how  far  apart  vertically in pixels two lines of text
              using the same font should be placed so that none of the charac-
              ters  in  one  line  overlap  any of the characters in the other
              line.  This is generally the sum of the ascent above  the  base-
              line line plus the descent below the baseline.

       1m-fixed0m
              Returns  a  boolean  flag that is ``1m122m'' if this is a fixed-width
              font, where each normal character is the the same width  as  all
              the  other  characters, or is ``1m022m'' if this is a proportionally-
              spaced font, where individual characters have different  widths.
              The widths of control characters, tab characters, and other non-
              printing characters  are  not  included  when  calculating  this
              value.

1mFONT OPTIONS0m
       The following options are supported on all platforms, and are used when
       constructing a named font or when specifying a font using style [5]  as
       above:

       1m-family 4m22mname0m
              The case-insensitive font family name.  Tk guarantees to support
              the font families named  1mCourier  22m(a  monospaced  ``typewriter''
              font),  1mTimes  22m(a  serifed ``newspaper'' font), and 1mHelvetica 22m(a
              sans-serif ``European'' font).  The most closely matching native
              font  family  will  automatically be substituted when one of the
              above font families is used.  The 4mname24m may also be the name of a
              native, platform-specific font family; in that case it will work
              as desired on one platform but  may  not  display  correctly  on
              other  platforms.  If the family is unspecified or unrecognized,
              a platform-specific default font will be chosen.

       1m-size 4m22msize0m
              The desired size of the font.  If the 4msize24m argument is  a  posi-
              tive  number, it is interpreted as a size in points.  If 4msize24m is
              a negative number, its absolute value is interpreted as  a  size
              in pixels.  If a font cannot be displayed at the specified size,
              a nearby size will be chosen.  If 4msize24m is unspecified or zero, a
              platform-dependent default size will be chosen.

              Sizes  should normally be specified in points so the application
              will remain the same ruler size on the screen, even when  chang-
              ing screen resolutions or moving scripts across platforms.  How-
              ever, specifying pixels is useful in certain circumstances  such
              as  when  a  piece of text must line up with respect to a fixed-
              size bitmap.  The mapping between points and pixels is set  when
              the  application  starts,  based  on properties of the installed
              monitor, but it can be overridden by calling the 1mtk scaling 22mcom-
              mand.

       1m-weight 4m22mweight0m
              The  nominal thickness of the characters in the font.  The value
              1mnormal 22mspecifies a normal weight font, while  1mbold  22mspecifies  a
              bold  font.   The  closest available weight to the one specified
              will be chosen.  The default weight is 1mnormal22m.

       1m-slant 4m22mslant0m
              The amount the characters in the font are slanted away from  the
              vertical.  Valid values for slant are 1mroman 22mand 1mitalic22m.  A roman
              font is the normal, upright  appearance  of  a  font,  while  an
              italic  font  is  one that is tilted some number of degrees from
              upright.  The closest available slant to the one specified  will
              be chosen.  The default slant is 1mroman22m.

       1m-underline 4m22mboolean0m
              The value is a boolean flag that specifies whether characters in
              this font should be underlined.  The default value for underline
              is 1mfalse22m.

       1m-overstrike 4m22mboolean0m
              The  value is a boolean flag that specifies whether a horizontal
              line should be drawn through the middle of  characters  in  this
              font.  The default value for overstrike is 1mfalse22m.


1mPLATFORM-SPECIFIC ISSUES0m
       The following named system fonts are supported:

              X Windows:
                     All  valid  X  font names, including those listed by xls-
                     fonts(1), are available.

              MS Windows:

                     1msystem      ansi        device0m
                     1msystemfixed ansifixed   oemfixed0m


              Macintosh:

                     1msystem      application0m


1mSEE ALSO0m
       options


1mKEYWORDS0m
