Rich Text Format (RTF) is a Microsoft word-processing format supported by several word processors, including Microsoft Word 5.0 and Microsoft Word for Windows. RTF allows documents to be transferred between applications without loss of formatting. The HELPMAKE utility recognizes a subset of the full RTF syntax. If your file contains RTF codes that are not part of the subset, HELPMAKE discards them.
To create an RTF-formatted file, enter the text and format it as you want it to appear: bold, underlined, hidden, italic, and so forth. (You can combine attributes.) You can also format paragraphs, selecting body and first-line indenting. The only items you need to insert into an RTF file manually are the help delimiter (>>) and the context string that start each entry.
When you have entered and formatted the text, save it in RTF format. In Microsoft Word 5.0, for example, this means choosing Transfer Save, then highlighting RTF in the format: field.
You do not see the RTF formatting codes when you load an RTF file into a compatible word processor; the word processor removes them and displays the text with the specified attribute(s). However, you can view these codes by loading an RTF file into a plain-text word processor.
HELPMAKE recognizes the subset of RTF codes listed in Table 11.5.
Table 11.5 RTF Formatting Codes
RTF CodeAction | ||
\b | Boldface. The application decides how to display this; often it is intensified text. | |
\fin | Paragraph first-line indent, n columns. | |
\i | Italic. The application decides how to display this; often it is reverse video. | |
\lin | Paragraph indent from left margin, n columns. | |
\line | New line (not new paragraph). | |
\par | End of paragraph. | |
\pard | Default paragraph formatting. | |
\plain | Default attributes. On most screens, this is nonblinking normal intensity. | |
\tab | Tab character. | |
\ul | Underline. The application decides how to display this; some adapters that do not support underlining display it as blue text. | |
\v | Hidden text. Hidden text is used for cross-reference information and for some application-specific communications; it is not displayed. |
When HELPMAKE compresses the file, it formats the text to the width given with the /W option, ignoring the paragraph formats.
As with the other text formats, each entry in the database source consists of one or more context strings, followed by topic text. An RTF file can contain QuickHelp dot commands.
The help delimiter (>>) at the beginning of any paragraph marks the beginning of a new help entry. The text that follows on the same line is defined as a context for the topic. If the next paragraph also begins with the help delimiter, it also defines a context string for the same topic text. You can define any number of contexts for a block of topic text. The topic text comprises all subsequent paragraphs up to the next paragraph that begins with the help delimiter.
The example below is a help database containing a single entry using subset RTF text. Note that RTF uses curly braces ({}) for nesting. Thus, the entire file is enclosed in curly braces, as is each specially formatted text item.
{\rtf1
\pard >>open\par
{\b Include:} <fcntl.h>, <io.h>, <sys\\types.h>, <sys\\stat.h>\par
\par
{\b Syntax:} int open( char * filename, int oflag[, int pmode ] );\par
oflag: O_APPEND O_BINARY O_CREAT O_EXCL O_RDONLY\par
O_RDWR O_TEXT O_TRUNC O_WRONLY\par
(may be joined by |)\par
pmode: S_IWRITE S_IREAD S_IREAD | S_IWRITE\par
\par
{\b Returns:} a handle if successful, or -1 if not.\par
errno: EACCES, EEXIST, EMFILE, ENOENT\par
\par
{\b See also:} Examples{\v open.ex}, access, chmod, close, creat, dup,\par
dup2, fopen, sopen, umask\par
>>open.ex\par
To build this help file, use the following command:\par
\par
HELPMAKE /S1 /E15 /OOPEN.HLP OPEN.RTF\par
\par
< Back >{\v !B}
}
RTF files normally contain additional information that is not visible to the user; HELPMAKE ignores this extra information.