RTF files. Word 6. Macintosh and Power Macintosh have. RTF. Software that takes a formatted file and turns it into an RTF file is called. An RTF writer separates the applications control information from. RTF groups. associated with that text. Software that translates an RTF file into a formatted. Included with the RTF specification is a sample RTF reader application see. Appendix A Sample RTF Reader Application beginning on page 8. It is designed for use with the specification to assist those. RTF readers. The file included with this Application. Note, Rtfreadr. exe, contains the sample RTF reader program itself. This file. and its use are described in Appendix A. The sample RTF reader is not a for sale. Microsoft does not provide technical or any other type of support. RTF reader code or the RTF specification. RTF Version 1. 5 has been updated to include all new control words introduced. Microsoft Word for Windows 9. Word 9. 7 for Windows. An RTF file consists of unformatted text, control words, control symbols. For ease of transport, a standard RTF file can consist of only. ASCII characters. Converters that communicate with Microsoft Word. Windows or Microsoft Word for the Macintosh should expect 8 bit characters. There is no set maximum line length for an RTF file. A control word is a specially formatted command that RTF uses to mark. A control word cannot be longer than 3. A control word takes. Letter. Sequencelt Delimiter. Note that a backslash begins each control word. The Letter. Sequence is made up of lowercase alphabetic characters between. RTF is case sensitive, and all RTF control words must. The delimiter marks the end of an RTF control word, and can be one of the. A space. In this case, the space is part of the control word. A digit or a hyphen, which indicates that a numeric parameter follows. The subsequent digital sequence is then delimited by a space or any character. The parameter can be a positive or a negative. The range of the values for the number is generally 3. However, Word tends to restrict the range to 3. Word allows values in the range 2,1. An RTF parser must handle an arbitrary string of digits as a. If a numeric parameter immediately follows the. The control. word is then delimited by a space or a nonalphabetic or nonnumeric character. Any character other than a letter or a digit. In this case, the delimiting. If a space delimits the control word, the space does not appear in the document. Any characters following the delimiter, including spaces, will appear in. For this reason, you should use spaces only where necessary. RTF code. A control symbol consists of a backslash followed by a single. For example, represents a nonbreaking. Control symbols take no delimiters. A group consists of text and control words or control symbols enclosed. The opening brace indicates the start of the group. Each group specifies. The RTF file can also include groups for fonts, styles, screen color, pictures. If the font, file, style, screen color. These groups form the RTF file header. If the group for fonts is included. If any group is not used, it can. The groups are discussed in the following sections. The control properties of certain control words such as bold, italic, keep. When such a control word has no. When such a control word has a parameter of 0, it. For example. b turns on bold, whereas b. Certain control words, referred to as destinations, mark the beginning. Destinations may also be text that is used. An example of a destination. Page breaks cannot occur in destination text. Destination control words and. No other control words or. Destinations added after the. RTF Specification published in the March 1. Microsoft Systems Journal. This control symbol identifies. RTF reader does. not recognize the destination. RTF writers should follow the convention. Destinations whose related text should be inserted into the document even. RTF reader does not recognize the destination should not use. All destinations that were not included in the March 1. RTF Specification are shown with as part of the control. Formatting specified within a group affects only the text within that group. Generally, text within a group inherits the formatting of the text in the. However, Microsoft implementations of RTF assume that the. Therefore. to ensure that these groups are always formatted correctly, you should set. The control words, control symbols, and braces constitute control information. All other characters in the file are plain text. Here is an example of plain. Tms Rmn f. 1fdecor. Symbol f. 2fswiss Helv colortbl red. Normal infoauthor John Doe. This is plain text. The phrase This is plain text is not part of a group and is treated as. As previously mentioned, the backslash and braces have special. RTF. To use these characters as text, precede them with a backslash. The reader of an RTF stream is concerned with the following. Separating control information from plain text. Acting on control information. Collecting and properly inserting text into the document, as directed by. Acting on control information is designed to be a relatively simple process. Some control information simply contributes special characters to the plain. Other information serves to change the program state. As previously mentioned, a group state can specify the following. The destination, or part of the document that the plain text is. Character formatting properties, such as bold or italic. Paragraph formatting properties, such as justified or centered. Section formatting properties, such as the number of columns. Table formatting properties, which define the number of cells and dimensions. In practice, an RTF reader will evaluate each character it reads in sequence. If the character is an opening brace, the reader stores its current. If the character is a closing brace, the reader retrieves. If the character is a backslash, the reader collects the control word. It then. carries out the action prescribed in the table. The possible actions are. The read pointer is left before or after a control word. If the character is anything other than an opening brace, closing brace. If the RTF reader cannot find a particular control word or control symbol. If a control word or control symbol is preceded by an. The current state should be saved. When a closing brace. If the control symbol precedes a control. The RTF reader should discard all text up to and including the. All RTF readers must recognize. March 1. 98. 7 RTF Specification. The reader. may skip past the group, but it is not allowed to simply discard the control. Destinations defined since March 1. Note All RTF readers must implement the control symbol. RTF files written by newer RTF writers.