Next: , Previous: Cyrillic and Japanese, Up: Fonts and Markers


A.3 Available text fonts for the X Window System

The command-line graphics programs graph -T X, plot -T X, pic2plot -T X, tek2plot -T X, and plotfont -T X, and the libplot library that they are built on, can draw text on an X Window System display in a wide variety of fonts. This includes the 22 built-in Hershey vector fonts. They can use the 35 built-in Postscript fonts too, if those fonts are available on the X display. Most releases of the plotting utilities include freely distributable versions of the 35 Postscript fonts, in Type 1 format, that are easily installed on any X display.

The plotting utilities can in fact use most of the `core' fonts that are available on the X display. This includes scalable fonts that have so-called XLFD (X Logical Font Description) names. You may determine which such fonts are available by using the low-level xlsfonts command. Fonts whose names end in "-0-0-0-0-p-0-iso8859-1" or "-0-0-0-0-m-0-iso8859-1" are scalable ISO-Latin-1 fonts that can be used by libplot and the plotting utilities. For example, the "CharterBT-Roman" font is available on many X displays. Its full XLFD name is "-bitstream-charter-medium-r-normal–0-0-0-0-p-0-iso8859-1". The plotting utilities would refer to it by its base XLFD name, which has only three hyphens; namely, "charter-medium-r-normal". The command

     echo 0 0 1 1 2 0 | graph -T X -F charter-medium-r-normal

will draw a plot in a popped-up X window, in which the axis ticks are labeled in this font.

Fonts whose names end in "iso8859-2", etc., and "adobe-fontspecific", may also be used, though they do not employ the standard ISO-Latin-1 encoding. By default libplot will try to retrieve an "iso8859-1", i.e., ISO-Latin-1 version of the font, if one is available. But you can work around this by giving the full name of the font, if you wish. Supplying the full name of an X font is also useful if you wish to employ a screen font (i.e., bitmap font), such as the traditional fonts "fixed" and "9x15". If you supply the full name of an X font, rather than a base XLFD name, each character glyph, once it is obtained from the X display as a pattern of pixels, will be scaled by libplot to the appropriate size.

The plotting utilities, including graph, support a ‘--bitmap-size’ option. If the-T X’ option is used, it sets the size of the popped-up X Window. You may use it to obtain some interesting visual effects. Each of the plotting utilities assumes that it is drawing in a square region, so if you use the ‘--bitmap-size 800x400’ option, your plot will be scaled anisotropically, by a larger factor in the horizontal direction than in the vertical direction. The X fonts in the plot will be scaled accordingly. In the same spirit, the ‘--rotation’ option will rotate the plot, causing all text strings to be rotated too. For example, ‘--rotation 45’ will induce a 45-degree counterclockwise rotation. The options ‘--bitmap-size’ and ‘--rotation’ may be applied together.

The escape sequences that provide access to the non-ASCII `8-bit' characters in the built-in ISO-Latin-1 fonts may be employed when using any ISO-Latin-1 X Window System font. For more on escape sequences, see Text String Format. As an example, "\Po" will yield the British pounds sterling symbol `£'. The command

     echo 0 0 1 1 | graph -T X -F times-medium-r-normal -L "A \Po1 Plot"

shows how this symbol could be used in a graph label. In the same way, the escape sequences that provide access to mathematical symbols and Greek characters may be employed when using any X Window System font, whether or not it is an ISO-Latin-1 font. These symbols and characters are taken from the Symbol font, which is available on nearly all X displays.