# PostScript Fonts in PGPLOT

The directory PGPLOT.PSDRIV contains a patch for PGPLOT version 5.2 to enable the use of PostScript Fonts. These include extensions to PGPLOT directives and environmental variables. The patch works without change also for PGPLOT version 5.2.2.

If the variable PGPLOT_PS_FONT is set to NO then the driver is fully 'backwards compatible'. The patch affects modules psdriv.f and grtext.f

For example of use, see psdemo.f. For example of output, see psdemo.ps

To install, replace modules psdriv.f and grtext.f in the PGPLOT source distribution and compile as usual.

-- Peter Smulders <p.j.m.smulders@home.nl> March 1998

## PGPLOT_PS_FONT

The environmental variable PGPLOT_PS_FONT is used to control the PostScript fonts for text strings output by PGPLOT. Specify "NO" to suppress use of PostScript fonts.

The default font family is Times. Another font family may be selected by giving PGPLOT_PS_FONT a specific value, e.g. 'Courier', 'Helvetica', 'NewCentury', 'Zapf'. Fontnames may be truncated to 3 or more letters, and case is ignored; e.g. the values 'NewC' and 'NEW' are equivalent to 'NewCentury'.

## imbedded directives

Fonts may also be set by directives imbedded in the text. Unlike other PGPLOT drivers a distinction is made between `\fr` and `\fR`, and between `\fi` and `\fI`.

`````` \fi : set Italic font
\fr : set Roman font
\fR : set bold font
\fI : set bold italic font
\fn : set normal font, acts the same as \fr.``````

These directives only apply to the remainder of the current string.

In addition a font family may be chosen by directives

`````` \fT : set font family Times,
\fH : set font family Helvetica
\fC : set font family Courier
\fM : set font family NewCentury, [the n was already taken by normal]
\fZ : set font family Zapf.``````

These directives apply to the remainder of the current Page.

Example: the string `\fC\fR text1` results in `text1` in Courier Bold. The default font for subsequent strings is now Courier.

As a last resort, for PostScript fonts, one can also use the directive \f<n>, where <n> is the character CHAR(N+32), and N is the font's number in the array FONTNAME, defined below.

## Some quirks

• The `\fT, \fH, \fM, \fZ` directives are specific for this driver.

• A PostScript Font that looks like 'script' is not yet implemented. The same is true for some special characters. Therefore a string that contains '\fs' or '\(' is plotted as a whole in the good old Hershey font.

• Some Greek characters appear at different positions from PGPLOT in the alphabet of PostScript

• Only a partial solution is available if data are limited to 7 bits: A symbol, specified in the text by a '\' followed by three octal digits, e.g. \277 , is plotted as the corresponding PostScript character. However such a character is not displayed correctly on a non-PostScript device. On the other hand, use of the 256 character set is no problem if all tools involved understand 8-bit characters. The encoding vector used is close to the ISO Latin-1 character set.

• PGPLOT has no way of knowing the width of proportional font characters. Only when using the fixed font Courier the current position after writing a text is known with a reasonable accuracy.

## FONTNAMES

``````  FONTNO  FONTNAME
0    Symbol

1    Times-Roman
2    Times-Italic
3    Times-Bold
4    Times-BoldItalic

5    Helvetica
6    Helvetica-Oblique
7    Helvetica-Bold
8    Helvetica-BoldOblique

9    Courier
10    Courier-Oblique
11    Courier-Bold
12    Courier-BoldOblique

13    NewCenturySchlbk-Roman
14    NewCenturySchlbk-Italic
15    NewCenturySchlbk-Bold
16    NewCenturySchlbk-BoldItalic

17    ZapfChancery
18    ZapfChancery-Oblique
19    ZapfChancery-Bold
20    URWGroteskT-Bold

21    URWAntiquaT-RegularCondensed

22    Cyrillic

23    ZapfDingbats``````