Rich-Text Format Specification V. 2 Introduction 2 rtf syntax 2 Conventions of an rtf reader 4

Download 1.09 Mb.
Date conversion29.04.2016
Size1.09 Mb.
1   ...   4   5   6   7   8   9   10   11   ...   15

Associated Character Properties

Bi-directional aware text processors often need to associate a Latin (or other left to right) font with an Arabic or Hebrew (or other right to left) font. The association is needed to match commonly used pairs of fonts in name, size and other attributes. While RTF defines a broad variety of associated character properties, any implementation may choose to not implement a particular associated character property and share the property between the Latin and Arabic fonts.

Property association uses the following syntax:


\ rtlch \ af & * \ ltrch

\ ltrch \ af & * \ rtlch

Here are some examples of property association:

\ ltrch\ af2\ ab\ au\ rtlch\ u Sample Text
This is a right-to-left run. Text will use the default bi-directional font, and will be underlined. The left-to right font associated with this run is font 2 (in the font table) with bolding and underlining.

\ plain\ rtlch\ ltrch Sample Text

This is a left to right run. The right to left font and the left to right font use the default font (specified by \ deff).

\ rtlch\ af5\ ab\ ai\ ltrch\ u Sample Text

This is a left to right run. The right to left font is font 5, bold and italicized. The left to right font is the default font, underlined. If the reader does not support underlining in the associated font, then both fonts will be underlined.

The property association control words (described as in the syntax description) are listed in the following table. Some control words (indicated in the following table by an asterisk following the description) can be turned off by the control word followed by 0 (zero).

Control word


\ ab

Associated font is Bold*

\ acaps

Associated font is All capitals*

\ acfN

Associated Foreground color (default is 0)

\ adnN

Associated font is Subscript position in half-points (default is 6)

\ aexpndN

Expansion or compression of the space between characters in quarter-points; a negative value compresses (default is 0)

\ afN

Associated Font number (default is 0)

\ afsN

Associated Font size in half-points (default is 24)

\ ai

Associated font is Italic*

\ alangN

Language ID for the Associated font. (This uses the same language ID codes described above.)

\ aoutl

Associated font is Outline*

\ ascaps

Associated font is Small capitals*

\ ashad

Associated font is Shadow*

\ astrike

Associated font is Strikethrough*

\ aul

Associated font is continuous underlined. \ aul0 turns off all underlining for the alternate font.

\ auld

Associated font is dotted underlined

\ auldb

Associated font is double underlined

\ aulnone

Associated font is no longer underlined.

\ aulw

Associated font is word underlined.

\ aupN

Superscript position in half-points (default is 6)

Special Characters

The RTF standard includes control words for special characters (described as in the syntax description). If a special-character control word is not recognized by the RTF reader, it is ignored and the text following it is considered plain text. The RTF specification is flexible enough to allow new special characters to be added for interchange with other software.

The special RTF characters are listed in the following table:

Control word


\ chdate

Current date (as in headers).

\ chdpl

Current date in long format, e.g. Thursday, October 28, 1993

\ chdpa

Current date in abbreviated format, e.g. Thu, Oct 28, 1993

\ chtime

Current time (as in headers).

\ chpgn

Current page number (as in headers).

\ sectnum

Current section number (as in headers).

\ chftn

Automatic footnote reference (footnotes follow in a group).

\ chatn

Annotation reference (annotation text follows in a group).

\ chftnsep

Anchoring character for footnote separator.

\ chftnsepc

Anchoring character for footnote continuation.

\ cell

End of table cell.

\ row

End of table row.

\ par

End of paragraph.

\ sect

End of section and paragraph.

\ page

Required page break.

\ column

Required column break.

\ line

Required line break (no paragraph break).

\ softpage

Non-required page break. Emitted as it appears in galley view.

\ softcol

Non-required column break. Emitted as it appears in galley view.

\ softline

Non-required line break. Emitted as it appears in galley view.

\ softlheightN

Non-required line height. This is emitted as a prefix to each line.

\ tab

Tab character; same as ASCII 9.

\ emdash

Em-dash (long hyphen).

\ endash

En-dash (short hyphen).

\ emspace

Non-breaking space equal to width of character "m" in current font.

\ enspace

Non-breaking space equal to width of character "n" in current font.

\ bullet

Bullet character.

\ lquote

Left single quotation mark.

\ rquote

Right single quotation mark.

\ ldblquote

Left double quotation mark.

\ rdblquote

Right double quotation mark.

\ |

Formula character.

\ ~

Non-breaking space.

\ -

Optional hyphen.

\ _

Non-breaking hyphen.

\ :

Specifies a sub-entry in an index entry.

\ *

Marks a destination whose text should be ignored if not understood by the RTF reader.

\ 'hh

A hexadecimal value, based on the specified character set (may be used to identify 8-bit values).

\ ltrmark

The following characters should be displayed from left to right; usually found at the start of \ltrch runs.

\ rtlmark

The following characters should be displayed from right to left; usually found at the start of \rtlch runs.

\ zwj

Zero Width Joiner. This is used to ligate words.

\ zwnj

Zero-Width Non-Joiner. This is used for unligating a word.

Note that an ASCII 9 is accepted as a tab character. A carriage return (character value 13) or line feed (character value 10) will be treated as a \ par control if the character is preceded by a backslash. You must include the backslash or RTF ignores the control word. (You may also want to insert a carriage-return/line-feed pair without backslashes at least every 255 characters for better text transmission over communication lines.)

Here are the code values for the following special characters:


Word for Windows and OS/2

Apple Macintosh

\ bullet



\ endash



\ emdash



\ lquote



\ rquote



\ ldblquote



\ rdblquote



1   ...   4   5   6   7   8   9   10   11   ...   15

The database is protected by copyright © 2016
send message

    Main page