next up previous contents index
Next: Command-line_options Up: X11 Previous: X11   Contents   Index


X11_fonts

Upon initial startup, the default font is taken from the X11 resources as set in the system or user .Xdefaults file or on the command line.

Example:

     gnuplot*font: lucidasans-bold-12

A new default font may be specified to the x11 driver from inside gnuplot using
    `set term x11 font "<fontspec>"`

The driver first queries the X-server for a font of the exact name given. If this query fails, then it tries to interpret 5#5fontspec6#6 as "5#5font6#6,5#5size6#6,5#5slant6#6,5#5weight6#6" and to construct a full X11 font name of the form
     -*-<font>-<weight>-<s>-*-*-<size>-*-*-*-*-*-<encoding>


<font> is the base name of the font (e.g. Times or Symbol)
<size> is the point size (defaults to 12 if not specified)
<s> is `i` if <slant>=="italic" `o` if <slant>=="oblique" `r` otherwise
<weight> is `medium` or `bold` if explicitly requested, otherwise `*`
<encoding> is set based on the current character set (see `set encoding`).

So set term x11 font "arial,15,italic" will be translated to -*-arial-*-i-*-*-15-*-*-*-*-*-iso8859-1 (assuming default encoding). The 5#5size6#6, 5#5slant6#6, and 5#5weight6#6 specifications are all optional. If you do not specify 5#5slant6#6 or 5#5weight6#6 then you will get whatever font variant the font server offers first. You may set a default enconding via the corresponding X11 resource. E.g.
     gnuplot*encoding: iso8859-15

The driver also recognizes some common PostScript font names and replaces them with possible X11 or TrueType equivalents. This same sequence is used to process font requests from set label.

If your gnuplot was built with configuration option -enable-x11-mbfonts, you can specify multi-byte fonts by using the prefix "mbfont:" on the font name. An additional font may be given, separated by a semicolon. Since multi-byte font encodings are interpreted according to the locale setting, you must make sure that the environmental variable LC_CTYPE is set to some appropriate locale value such as ja_JP.eucJP, ko_KR.EUC, or zh_CN.EUC.

Example:

     set term x11 font 'mbfont:kana14;k14'
           # 'kana14' and 'k14' are Japanese X11 font aliases, and ';'
           # is the separator of font names.
     set term x11 font 'mbfont:fixed,16,r,medium'
           # <font>,<size>,<slant>,<weight> form is also usable.
     set title '(mb strings)' font 'mbfont:*-fixed-medium-r-normal--14-*'

The same syntax applies to the default font in Xresources settings, for example,

     gnuplot*font: \
         mbfont:-misc-fixed-medium-r-normal--14-*-*-*-c-*-jisx0208.1983-0

If gnuplot is built with -enable-x11-mbfonts, you can use two special PostScript font names 'Ryumin-Light-*' and 'GothicBBB-Medium-*' (standard Japanese PS fonts) without the prefix "mbfont:".


next up previous contents index
Next: Command-line_options Up: X11 Previous: X11   Contents   Index
Ethan Merritt 2007-03-03