Appendix AWorking with RTF and HTML tags in a dynamic text control : Working with RTF tags

Working with RTF tags

The RTF tags that you use in a dynamic text control must be well formed. An RTF tag starts with a \ and ends with a space or a new line character. To turn off the effect of a tag, use the same tag with a 0 after it. For example, the following RTF code:

Hello world\par
\b Hello stars\b0\par Hello moon

produces the following text that contains bold text and multiple paragraphs:

Hello world
Hello stars
Hello moon

You can concatenate tags. For example, the following RTF code:

\b\i Hello\i0  stars\b0

produces the following text that is both bold and italic:

Hello stars

You do not need to provide a complete RTF document by providing an RTF header.

Table A-1 lists the supported RTF structural and definition tags. For more information about using RTF tags, refer to RTF documentation, such as “Rich Text Format (RTF) Specification, version 1.6,” which is available at the following URL:

http://latex2rtf.sourceforge.net/rtfspec.html
This extended feature group indicator specifies the contents of groups identified in this way are ignored.
Specifies the RTF dynamic text. N indicates the major RTF version number. The value of N must be 1.
RTF text can contain alternative representations for Unicode characters for use by RTF readers that do not support Unicode. RTF readers that do not support Unicode skip the \uN tag and display the following character. For example, \rtf1\u8364 E displays the Euro currency symbol on an RTF reader that supports Unicode and E on a reader that does not support Unicode.
RTF text that contains alternative representations for Unicode characters uses \ucN to enable RTF readers that support the \uN tag to display the Unicode character(s) and skip the following character(s).

Table A-2 lists the supported RTF paragraph format tags.

Table A-2  RTF paragraph format tags 
Specifies first line left indent. N indicates the indent in twips. \fi is additive with \li and N can be a negative number. For example, \li1440\fi-720 makes the first line indented 0.5" and remaining lines indented 1.0".
Specifies keeping the paragraph intact. This tag prevents page breaks in the middle of a paragraph.
Specifies keeping the paragraph with the next paragraph. This tag adjusts the page break so that both paragraphs are rendered on the same page.

Table A-3 lists the supported RTF character format tags.

Table A-3  RTF character format tags 
Specifies font size. N indicates the font size in half points. Because AFC does not recognize fractional font sizes, half point sizes round to integers. For example, \fs21 indicates font size 10.5pt, which rounds to 10pt.

The dynamic text control recognizes any Unicode character encoded in the standard RTF form \un where n is the decimal Unicode value of the character. If the specified character does not exist in the requested font, the null symbol (Unicode value 127) is used.

The dynamic text control recognizes any character encoded in the standard RTF format \'xx where xx is the 2-digit hex value of the character. This format is treated as a Unicode value, regardless of the original document encoding. If the specified character does not exist in the requested font, the null symbol (hex value 0x7f) is used.

Table A-4 lists the supported special characters.

Table A-4  Special characters 

(c) Copyright Actuate Corporation 2011