ABC:L:DEF", 'A', 'B', and 'C' will be treated as characters to be drawn, 'L' will be treated as a function-code character, and 'D', 'E', and 'F' will be treated as characters to be drawn. (In this particular example, since the function code 'L' requests lower case, what would be drawn is the string "ABCdef".)
An example of a string containing function codes is as follows:
:PRU:A:S:2:N:+B:S:2:N:This might be read by a knowledgeable user as "Principal Roman Upper A, Superscript level, 2, Normal level, plus B, Superscript level, 2, Normal level" and it writes the equivalent of "A squared plus B squared". Because of the way the colons are paired, the characters 'P', 'R', 'U', 'S', 'N', 'S', and 'N' are function codes; all other characters are characters to be written.
No punctuation is needed between function codes except for a comma or a blank between adjacent numbers; however, extra commas and blanks may be used to improve readability. The function codes described below are the only legal ones; any other characters in a function-code string will be ignored, but an error message will be printed.
:F16K:ABC", the characters drawn will be those defined by font 16 (gothic_english) corresponding to the uppercase characters 'A','B', and 'C', but they will be reduced in size to approximately match the size of the cartographic characters from the pwritx_database font.
:F16L:ABC", the characters drawn will be those defined by font 16 (gothic_english) corresponding to the lowercase characters 'a', 'b', and 'c'.)
If L is followed by a number n, then n characters will be drawn in lowercase, and subsequent characters will be in uppercase.
The default at the beginning of a string is uppercase.
If D appears without a following integer n or if n is zero, characters will be written "down" until an 'A' is encountered. If n appears, n characters will be written "down" and subsequent characters will be written "across" the frame.
The terms "across" and "down" are to be interpreted to mean "in the direction txAngleF" and "in the direction txAngleF - 90", respectively. Each character has a left edge center point, a right edge center point, a bottom edge center point, and a top edge center point, as defined by information in the database of the font from which it came. These points are not necessarily on the actual edges of the character, but on the edges of a rectangle containing the character; the points are also not necessarily exactly centered on the edges of the rectangle. Characters are always oriented so that the vector from the left edge center point to the right edge center point is in the direction txAngleF. When characters are written across the frame (assuming that the constant spacing parameter txConstantSpacingF is zero), each character is placed so that its left edge center point is coincident with the right edge center point of the previous character. Similarly, when characters are being written down the frame, each character is placed so that its top edge center point is coincident with the bottom edge center point of the previous character.
:S3:A:B2:BC", in which the three-character count for superscripting is not satisfied at the time the two-character count for subscripting is seen).
The function code E terminates the current level of subscripting or superscripting, restoring the size, case, and position to that of the base character. The function code N terminates the current level of subscripting or superscripting, restoring the size and case to that of the base character, but the position as required to continue writing at the level of the base character without writing over the subscripts or superscripts.
10:S:10:S:100". Up to five levels are allowed.
X:B1:2:S1:3". Note that when the character count in the "B1" is satisfied, the original base character is reinstated, so that we can add another subscript or superscript to it.
X:B1:2:S:3:N:Y:S:3". The function code N returns to normal level in such a way that the character Y does not overwrite the 2 and the 3.
X:S:A:B:1:NN:something else". Note that two function code N's are used, one to terminate writing the subscript 1 and another to terminate writing the superscript "a sub 1" and leave the current position such that what follows won't go on top of the "a sub 1".
A Vn or VnQ increments the current position in the direction specified by txAngleF + 90. Vn shifts the position by n digitization units and VnQ shifts the position by n blank heights; in either case, n can be negative.
A C causes a return to either the initial position, if there have
been no other C function codes, or to the position following the last
occurrence of a C function code, otherwise. The position is then
offset by one blank height in the direction txAngleF -90.
For example, the string "
ABC:C:DEF" causes the
characters ABC to be written and ten causes the characters DEF to be
written directly under the ABC.
Using Yn or YnQ will cause subsequent characters to be made n/100 times as high (zoomed in the direction txAngleF + 90). A suffixed Q will cause a shift of character position in the direction txAngleF + 90 sufficient to keep the bases of the characters properly aligned. If "n" is omitted or zero, 100 is assumed.
Using Zn or ZnQ will cause subsequent characters to be made n/100 times as wide and high (zoomed in both of the directions txAngleF and txAngleF + 90). A suffixed Q will cause a shift of character position in the direction txAngleF + 90 sufficient to keep the bases of the characters properly aligned. If "n" is omitted or zero, 100 is assumed.
:GIU:*" is the same as the string "
:1047:" (600+200+0+47=1047, octal.) To find the character produced for a given octal code, refer to the plots produced by the low-level NCAR Graphics example "epltch".
Note: In the "epltch" example (see previous paragraph), you can
write two of the characters in a row by using either the string ':GIU:**'
or the string "
:1047,1047:". This is one example of the need for
a comma between two function codes.
An octal number may be used as a function code in part of the input character string during the processing of which characters are being selected from fonts other than the pwritx_database font. Such an octal function code will still have the effect of selecting a character from the pwritx_database font.
NG4.1 Home, Index, Examples, Glossary, Feedback, Ref Contents, Ref WhereAmI?