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. Sub-strings, individual words, or even parts of words can be emphasised. Note that the extension character set, which provides the special symbols, counts as a font.
The start of the string is 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. The special character set is 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 (for example, 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 (for example, that defined by the font attribute
%T
- switch back to previous font (for example, 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 (for example, %%). Invalid codes (for example, %51) are output literally. The font switching character sequence does not have to be preceded or followed by blank characters. For example ‘ABC%04DEF%pGHI’ is 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 (for example, ‘DEF’) in variation 4 (for example, 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.