RTF

From MobileRead

Jump to: navigation, search

RTF (Rich Text Format) is an word processor interchange format developed by Microsoft to facilitate the exchange of documents between different tools and different operating systems.

Contents

[edit] Description

Files in this format will usually have an .rtf extension. The first RTF reader and writer shipped in 1987 as part of Microsoft Word 3.0 for Macintosh. It is the native save format for WordPad files. Some eBook readers can read files this format but it is fairly verbose so the file sizes will be larger.

RTF is an example of a markup language and uses pure text even for graphics by encoding the binary. It is capable of representing fairly complicated layouts.

When an eBook reader claims to read RTF it does not mean that it supports all of the fonts, or all of the available constructions.

RTF has two sections in the file, a header and a body. The header contains default information for the file such as the default font size and may contain metadata. If the file is loaded into an editor and then saved some or all of the metadata may be lost. WordPad for example saves files natively in RTF format but does not support metadata.

[edit] Syntax

RTF files include data and control structures. The control structures include:

  • Control Words - begin with a \ and consist of case sensitve letters followed by a delimiter. A delimiter can be a space (the space itself will be ignored), a number or - indicating a parameter for the control word, or another character which will start a new sequence.
  • Control Symbols - begin with a \ and consist of one special character. An example is \~ which is the symbol for a non-breaking space.
  • Groups - are delimited with { and } and are used to specify the text and the attributes of that text.
  • Destinations are special control words that specify that the text goes somewhere else in the document. An example is \footnote. The footnote itself will be defined as a group.

[edit] example

Here is an example of an RTF document.

{\rtf1\ansi{\fonttbl\f0\fswiss Helvetica;}\f0\pard
This is some {\b bold} text.\par
}

This would be displayed as:

This is some bold text.

Bolding could also been achieved using \b bold\b0

[edit] For more information

The specifications can be found on the Microsoft web site.

Personal tools
MobileRead Networks