An ordinary AUTOGRAPH application program linked only with the NCAR library, e.g.
$ LINK PROGRAM, NCAR_DIR:NCAR_LINK/OPT, STAR_LINK/OPT
on VAX/VMS, will include the standard version of the routine AGPWRT which uses the GKS text-drawing facilities. Extremely flexible control over font, colour, etc., is available via GKS (see §2.43 of the AUTOGRAPH document), but NCAR itself contains some facilities for controlling the text font which many users will find more accessible, particularly when Greek letters, subscripts and other special characters are to be included in labels.
To use the NCAR fancy fonts, the application program must be linked with a special Starlink version of the AUTOGRAPH routine AGPWRT, which has access to the NCAR PWRITX character drawing routine (§3). When using the Starlink version of AGPWRT, PWRITX function codes can be included in the character strings in order to switch between various sets of special characters. Lower case characters and common punctuation marks are automatically handled; apostrophe (which is used as the delimiter for the PWRITX codes) is specified by two consecutive apostrophes. A choice of two native NCAR character sets is available. The selection can be made as follows:
CALL SNX_CHSET( I )
The integer argument I may be either 1 or 2. I1 selects the ``duplex" font set and I2 the ``complex" font. The ``complex" characters (the default) are more ornate and fussier than the comparatively plain ``duplex" characters. Only the Roman characters are changed by the SNX_CHSET call - not the Greek, etc.
For precise details of how to construct the PWRITX strings, refer to Appendix , which includes the program preamble comments describing the AGPWRITX routine, followed by a plot of the available characters. The principle is that within the string of ordinary characters, function codes can be embedded describing changes of font, size and position. The function codes are delimited by apostrophes. For example, a label meaning could be written using the string ``r'S'2'N'''. The ``r" is simply drawn as a lower case ``r"; the ``'S'" is a function code switching to superscript; the ``2" is then drawn as a small numeral in the superscript position; and finally the ``'N'" switches back from superscript to normal. Though daunting at first, the strings are quite easy to construct and to debug by trial and error.
As a more complicated example, the string ``Area = 'GL'P'R'r'S'2" will generate a label equivalent to ``Area ". (The apostrophes make for messy Fortran literals; this one would be ```Area = ''GL''P''R''r''S''2'''.) The first PWRITX function code `GL' selects the Greek Lowercase font; P happens to be the source character which generates the pi; the next function code `R' switches back to Roman for the r; the final code `S' means superscript and draws the power of 2 symbol. More examples are included in the XYPLOT input file listed in Appendix .
Inevitably, use of the special fonts costs plotting time - each character is formed from many line segments, all of which have to be transmitted to the device. This is compounded by the relatively high density of numeric labelling which AUTOGRAPH provides by default. This speed penalty is an acceptable cost where a publication-quality plot is being produced on a hardcopy device, but not for interactive applications requiring frequent and rapid plotting. Appendix describes a demonstration program which switches between three different character drawing methods and graph styles to achieve different trade-offs between speed and appearance. This involves a special form of the call to AGPWRT, available only with the AGPWRITX implementation of this routine. The call is:
CALL AGPWRT( 0.0, 0.0, ' ', 0, 0, 0, -100 )
CALL AGPWRT( 0.0, 0.0, ' ', 0, 0, 0, 100 )
(All the arguments except the last one, ICEN, which must be , are ignored.) The ICEN value selects character drawing via the ordinary PWRIT routine, which uses the GKS character drawing facilities and thus allows control of font, precision, etc. The +100 ICEN value selects character drawing via the fancy PWRITX routine.
SNX --- Starlink Extensions to the NCAR Graphics Utilities