NAGText is implemented using the Hershey fonts of the NAG Graphics Library. You may use all in-string keyword facilities also available to users of the NAG Graphics Library. A short description of the most important features is given in this section.
Keywords are available to support such actions as changing the current text font (perhaps to a Greek font), modifying the size and relative position of characters within the string (perhaps to draw subscripts, superscripts or mathematical expressions), etc.
Keywords may be specified as an integral part of any text string supplied to NAG Graphics [1]. Their presence will automatically be detected and the appropriate actions taken; they will not appear on the output plot. Each keyword consists of a delimiter symbol, followed by a one or two- character keyword mnemonic, which may be in upper or lower case. The keyword delimiter is an exclamation mark (`!'); As a simple example, let us take the string `E = mc!u2!N' which may be used to plot the expression E=mc2. This string contains two keywords:
Table 1: In-string keywords, excluding those for font changes Mnemonic Description Movement Scale Factor ---------------------------------------------------------------- A Shift above the fraction line 1.0 1.0 B Shift below the fraction line -1.0 1.0 U Move up to superscript level 0.6 0.62 D Move down to subscript level -0.35 0.62 E Move to exponent level 0.94 0.44 I Move to index level -0.94 0.44 L Move to lower subscript level -1.125 0.62 N Move to normal or base line level 1.0 S Save current point and character size on stack R Restore previous current point and character size from stack ! Display the current symbol
Note: either upper or lower case characters may be used for the mnemonic.
In order to make effective use of the in-string keyword facility you should bear the following points in mind:
The form of the in-string keyword used to select a specific font is the same as previously defined, except that the character mnemonic is replaced by a numeric value ranging from 1 to 25.
You have a choice of 25 different fonts; these can be accessed by issuing the mnemonics (with a preceding delimiter) detailed in Table 2. For ease of use, some fonts have been given a one-character mnemonic which can be used in place of the associated numeric value.
Table 2: In-string keywords for font changing Mnemonic Description Mnemonic Description --------------------------------------------------------- 01 Simplex Roman 14 Cyrillic 02 Duplex Roman 15 Triplex Roman 03 Complex Roman 16 Triplex Italic 04 or g Simplex Greek 17 Map Symbols 05 Complex Greek 18 Astronomical Symbols 06 Complex Italic 19 Music Symbols 07 or m Mathematical Symbols 20 Monospace Typewriter 08 Meteorological Symbols 21 Typewriter 09 Gothic English 22 Simplex 10 or w Simplex Script 23 Italic 11 Complex Script 24 Complex 12 Gothic Italian 25 Complex Cyrillic 13 Gothic German
Note: either upper or lower case characters may be used for the mnemonics.
It may be useful to bear the following points in mind when using in-string keywords to change fonts:
Port: Pick
Type: Pick
The text geometry will be centred around the x coordinate obtained by
picking a point in the Render window, using the y coordinate as the
baseline for the string.
In order to make the module fire, you should wire the Pick output port from the Render module to this input port, and use the Render module in User Pick mode.
Port: Text String
Type: Text
Text string to be plotted
Port: Color
Type: Text
The string will be plotted in the specified color.
Port: Font Size
Type: Dial
The font size in which text will be plotted. Font size j corresponds to
j * SIZE, where SIZE is two percent of the total available height of the
window.
Port: Picture
Type: Geometry
Geometry generated. This port must be wired to the Screen port of the
Render module in order to obtain correspondence between the point picked
in the Render window, and the point around which text will be centred.
These modules may be used to plot multiple lines of text.