DRAW Reference Manual
Miscellaneous Text Facilities
: Multiple Fonts within Text Strings
Multiple Fonts within Text Strings
It is possible to switch from one font to another within a single text string, subject to a maximum of four fonts per string. This will allow sub-strings, individual words, or even parts of words to be emphasised. Note that the extension character set, which provides the special symbols, counts as a font.
The string will start to be output using the principal font; this is the one specified by the relevant FONT, DFON, or PFON attribute. Font switching is controlled by a set of special characters embedded in the string. This set will be composed of an escape character (%) followed by either two numeric digits or one alpha character. These sets are best demonstrated by examples:
%24
- switch to font 24 (i.e. variation 4 of font family 2
%46
- switch to font 46
%02
- switch to variation 2 of the current font family
%30
- switch to font family 3 maintaining the current variation
%37
- invalid, variation 7 is not defined (only variations 1 - 6)
%51
- invalid, font family 5 is not defined (only families 1 - 4)
%2
- invalid, two numeric digits are required
%P
- switch to principal font (i.e. that defined by the font attribute
%T
- switch back to previous font (i.e. toggle)
%C
- invalid, only %P, %p, %T, and %t are currently allowed
Font switching can be prevented and the escape character output by doubling it (i.e. %%). Invalid codes (e.g. %51) will be output literally. The font switching character sequence does not have to be preceded or followed by blank characters. For example ‘ABC%04DEF%pGHI’ will be output as the 9-character string ‘ABC
DEF
GHI’ with the two sub-strings ‘ABC’ and ‘GHI’ in the principal font, and the middle three characters (i.e. ‘DEF’) in variation 4 (i.e. upright bold) of the principal font.
The special handling of the '0' digit (preserving the current font family or variation) applies to AVEVA fonts only. Since the font numbers 05, 06, 07, 08, and 09 are reserved for TrueType fonts, the font switching sequences %05, %06, %07, %08, and %09 are interpreted literally, as the font switch to a TrueType font specified after the '%' character.
1974 to current year.
AVEVA Solutions Limited and its subsidiaries. All rights reserved.