The \fonttbl control word introduces the font table group. Unique \fN control words define each font available in the document, and are used to reference that font throughout the document. This group has the syntax listed in the following table.
<fonttbl> | '{' \fonttbl (<fontinfo> | ('{' <fontinfo> '}'))+ '}' |
<fontinfo> | <fontnum><fontfamily><fcharset>?<fprq>?<panose>?<nontaggedname>?<fontemb>? <codepage>? <fontname><fontaltname>? ';' |
<fontnum> | \f |
<fontfamily> | \fnil | \froman | \fswiss | \fmodern | \fscript | \fdecor | \ftech | \fbidi |
<fcharset> | \fcharset |
<fprq> | \fprq |
<panose> | <data> |
<nontaggedname> | \*\fname |
<fontname> | #PCDATA |
<fontaltname> | '{\*' \falt #PCDATA '}' |
<fontemb> | '{\*' \fontemb <fonttype> <fontfname>? <data>? '}' |
<fonttype> | \ftnil | \fttruetype |
<fontfname> | '{\*' \fontfile <codepage>? #PCDATA '}' |
<codepage> | \cpg |
Note for <fontemb> that either <fontfname> or <data> must be present, although both may be present.
All fonts available to the RTF writer can be included in the font table, even if the document doesn't use all the fonts.
RTF also supports font families, so that applications can attempt to intelligently choose fonts if the exact font is not present on the reading system. RTF uses the following control words to describe the various font families.
Control word | Font family | Examples |
\fnil | Unknown or default fonts (the default) | |
\froman | Roman, proportionally spaced serif fonts | Times New Roman, Palatino |
\fswiss | Swiss, proportionally spaced sans serif fonts | Arial |
\fmodern | Fixed-pitch serif and sans serif fonts | Courier New, Pica |
\fscript | Script fonts | Cursive |
\fdecor | Decorative fonts | Old English, ITC Zapf Chancery |
\ftech | Technical, symbol, and mathematical fonts | Symbol |
\fbidi | Arabic, Hebrew, or other bidirectional font | Miriam |
If an RTF file uses a default font, the default font number is specified with the \deffN control word, which must precede the font-table group. The RTF writer supplies the default font number used in the creation of the document as the numeric argument N. The RTF reader then translates this number through the font table into the most similar font available on the reader's system.
The following control words specify the character set, alternative font name, pitch of a font in the font table, and non-tagged font name.
Control word | Definition | |
\fcharsetN | Specifies the character set of a font in the font table. Values for N are defined by Windows header files, and in the file RTFDEFS.H accompanying this document. | |
\falt | Indicates alternate font name to use if the specified font in the font table is not available. '{\*' \falt <Alternate Font Name>'}' | |
\fprqN | Specifies the pitch of a font in the font table. | |
\*\panose | Destination keyword. This destination contains a 10-byte Panose 1 number. Each byte represents a single font property as described by the Panose 1 standard specification. | |
\*\fname | This is an optional control word in the font table to define the non-tagged font name. This is the actual name of the font without the tag, used to show which character set is being used. For example, Arial is a non-tagged font name, and Arial (Cyrillic) is a tagged font name. This control word is used by WordPad. Word ignores this control word (and never creates it). | |
\fbiasN | Used to arbitrate between two fonts when a particular character can exist in either non-Far East or Far East font. Word 97 emits the \fbiasN keyword only in the context of bullets or list information (that is, a \listlevel destination). The default value of 0 for N indicates a non-Far East font. A value of 1 indicates a Far East font. Additional values may be defined in future releases. |
If \fprq is specified, the N argument can be one of the following values.
Pitch | Value |
Default pitch | 0 |
Fixed pitch | 1 |
Variable pitch | 2 |
RTF supports embedded fonts with the \fontemb group located inside a font definition. An embedded font can be specified by a file name, or the actual font data may be located inside the group. If a file name is specified, it is contained in the \fontfile group. The \cpg control word can be used to specify the character set for the file name.
RTF supports TrueTypeÒ and other embedded fonts. The type of the embedded font is described by the following control words.
Control word | Embedded font type |
\ftnil | Unknown or default font type (the default) |
\fttruetype | TrueType font |
A font may have a different character set from the character set of the document. For example, the Symbol font has the same characters in the same positions both on the Macintosh and in Windows. RTF describes this with the \cpg control word, which names the character set used by the font. In addition, file names (used in field instructions and in embedded fonts) may not necessarily be the same as the character set of the document; the \cpg control word can change the character set for these file names as well. However, all RTF documents must still declare a character set (that is, \ansi, \mac, \pc, or \pca) to maintain backward compatibility with earlier RTF readers.
The table below describes valid values for \cpg.
Value | Description |
437 | United States IBM |
708 | Arabic (ASMO 708) |
709 | Arabic (ASMO 449+, BCON V4) |
710 | Arabic (transparent Arabic) |
711 | Arabic (Nafitha Enhanced) |
720 | Arabic (transparent ASMO) |
819 | Windows 3.1 (United States and Western Europe) |
850 | IBM multilingual |
852 | Eastern European |
860 | Portuguese |
862 | Hebrew |
863 | French Canadian |
864 | Arabic |
865 | Norwegian |
866 | Soviet Union |
932 | Japanese |
1250 | Windows 3.1 (Eastern European) |
1251 | Windows 3.1 (Cyrillic) |