Rich Text Format

From Free net encyclopedia

RTF redirects here. For the former French national broadcaster, see Radiodiffusion-Télévision Française.

The Rich Text Format (often abbreviated to RTF) is a document file format that has been continually developed by Microsoft since 1987 for cross-platform document interchange. Most word processors are able to read and write RTF documents. Unlike most of the word processing formats, RTF is human-readable.

Contents

Sample RTF document

As an example, the following RTF code:

{\rtf
Hello!\par
This is some {\b bold} text.\par
}

would be rendered like this when read by an appropriate word processor:

Hello!
This is some bold text.

A backslash (\) starts an RTF control code. The \par control code indicates a new line, and \b switches to a bold typeface. Braces ({ and }) define a group; the example uses a group to limit the scope of the \b control code. Everything else will be treated as clear text, or the text to be formatted. A valid RTF document is a group starting with the \rtf control code.

Character encoding

RTF is a 7-bit format. That would limit it to ASCII, but RTF can encode characters beyond ASCII by escape sequences. The character escapes are of two types: codepage escapes and Unicode escapes. In a codepage escape, two hexadecimal digits following an apostrophe are used for denoting a character taken from a Windows codepage. For example, if control codes specifying Windows-1256 are present, the sequence \'c8 will encode the Arabic letter beh (ب). In a Unicode escape, the character u followed by a Unicode codepoint number in decimal will specify the character, e.g. \u1576 for Arabic letter beh.

Common implementations

The RTF format is the default rich text format for Mac OS X's default editor TextEdit. Previous versions of the WordPad editor created RTF files by default; however, though it can still view and edit RTF files, it now uses the Microsoft Word file format. The open-source editor AbiWord, which is common on Unix-like platforms that implement the X Window System and [[GTK+]], can also edit RTF files. These different programs do not however create files that are completely compatible with each other. Since RTF is supported natively by the Microsoft Windows and Mac OS X operating systems, it is very easy for developers targeting these platforms to integrate RTF display and editing capabilities into their applications.

See also

External links

de:Rich Text Format es:RTF fr:Rich Text Format it:Rich Text Format ja:Rich Text Format pl:RTF pt:Rich Text Format ru:Расширенный текстовый формат sv:Rich Text Format fi:Rich Text Format zh:富文本格式