previous next

Text Tags

RealText provides many mark-up tags that define how the streaming text looks and operates. A tag's default value applies if you do not specify a tag value. You can place mark-up tags anywhere on a line. RealPlayer treats spaces, tabs, line feeds, and carriage returns as does a Web browser. It ignores these elements when they are between tags (except the <pre> and </pre> tags). When they occur between text elements, it interprets them as a single space, no matter how many of them are actually between the text elements.

Note
When you are familiar with the tags, you can refer to "Summary of Text Tags".

Time and Position Tags

The following tags affect when and where the text appears within the window.

<time begin="dd:hh:mm:ss.xyz"/>
<time end="dd:hh:mm:ss.xyz"/>

The <time/> tags control the RealText presentation timeline by determining when a text component appears and disappears, respectively, relative to the start of the presentation. They are meant primarily for window text that does not scroll or crawl. If you do not specify begin times, RealPlayer displays all text as quickly as it can.

The <time/> tag values are in 24-hour format, where dd is days, hh is hours, mm is minutes, ss is seconds, x is tenths of seconds, y is hundredths of seconds, and z is milliseconds. Only the ss field is required. When the time value does not include a decimal point, the last field is read as the seconds. For example, 1:30 means 1 minute and 30 seconds, whereas 1:30:00 means 1 hour and 30 minutes. Note that all the following values are equivalent. They all start the text component 90 minutes after the stream begins:


<time begin="1:30:00.0"/> 
<time begin="90:00"/>
<time begin="5400"/>

Text with an end value is erased when the specified end value is reached. Otherwise it stays active until the presentation ends or the entire window is erased with <clear/>. Note that you can combine the begin and end attributes in a single <time/> tag as shown here:


<time begin="23" end="55.5"/>This text displays 23 seconds into the presentation and disappears at 55.5 seconds.

All text following a <time/> tag has the specified begin and end values until new values are given. Once you specify an end time for a text component, you must specify an end time for all following components. For example, the following text would not display properly:


<time begin="23" end="55.5"/>Display at 23 seconds in.
<time begin="56"/>Display at 56 seconds in.

Because the second line does not include an end value, the previous end value of 55.5 still applies. The second line cannot be displayed because its begin time is later than its end time.

Note
The <time/> tags are not necessary in a window with a non- zero scrollrate or crawlrate unless you want text to become visible after it has moved into the window, or to disappear before it moves out of the window.

<clear/>

This tag clears the existing text buffers to remove all text from the window. The text that follows this tag is then displayed starting at the window's normal starting point.

In a window that does not scroll or crawl, you can add <clear/> after <time begin="time"/> to erase existing text when new text arrives. For example, you would specify the following to clear old text and display "Hello!" at 3 minutes into the stream:


<time begin="3:00"/><clear/>Hello!

However, a <clear/> tag does not remove text that has an end time that has not yet elapsed. Consider this example:


<time begin="5"/>They all lived happily.
<time begin="10" time end="20"/>And so our story ends.
<time begin="15"/><clear/>Goodbye!

The second line of text is set to end at 20 seconds. The <clear/> tag, which begins at 15 seconds, does not clear this line because the line's end time has not elapsed. The <clear/> tag removes the first line of text, though, which has no end time.

<pos x="pixels"/>
<pos y="pixels"/>

These tags position the text horizontally and vertically, respectively. The <pos y> tag moves the upper, left corner of the subsequent text block the specified number of pixels down from the window's top edge. The <pos x> tag indents the text block the specified number of pixels in addition to the two-pixel default padding that applies to all text blocks. You can combine both tags in a single tag like this:


<pos x="10" y="55"/>

Note
These tags work only if scrollrate and crawlrate are both 0 (zero).

<tu [color="color"]>...</tu>
<tl [color="color"]>...</tl>

These tags function only with TickerTape windows. They display the enclosed text at the window's upper (<tu>) or lower (<tl>) edge. When a tag specifies a color with the color option, the color applies to text enclosed by all subsequent tags of that type until another tag of that type changes the color. However, color specified for <tu> elements does not affect color for <tl> elements, and vice versa.

Additional Information
Refer to "Color Options" for a list of available colors.

Layout Tags

Much as in HTML, the following tags let you define the layout of RealText in the RealPlayer window.

<p>...</p>

Adds space between text. In TickerTape and Marquee windows, it moves the "cursor" to the right edge of the window. In all other window types, the <p> and </p> each cause the next text to display two lines down.

<br/>

Adds space between text. In TickerTape and Marquee windows, it moves the "cursor" to the right edge of the window. In all other window types, this tag causes the text that follows to display on the next line.

<ol>...</ol>

For compatibility with HTML lists. Text between these tags is indented, but not numbered.

<ul>...</ul>

For compatibility with HTML lists. Text between these tags is indented, but not bulleted.

<li>...</li>

For compatibility with HTML lists. Acts like a <br/> tag.

<hr/>

For compatibility with HTML horizontal rules. Acts as two <br/> tags.

<center>...</center>

Used to center the enclosed text. Text is centered according to the actual window width, which may differ from the width attribute. These tags behave the same as HTML centering tags. <center> forces a line break if and only if a line break caused by a tag such as <br>, <p>, or <hr> does not immediately precede it. The </center> tag always causes a line break.

Note
RealText does not center text until it has determined the line length. In rare instances, one streamed packet may contain the first part of the line while another packet received several seconds later contains the end of the line. In this case, the first part displays flush left, and the entire line is centered and redisplayed when the second packet arrives.

<pre>...</pre>

Works the same as in HTML. Text tagged with <pre> uses the Courier font at the current size. For example, a preceding <font size="+1"> makes the preformatted text one size larger than the default font size. Line breaks, spaces, and tabs are preserved, with tabs defaulting to 64 pixels for 16 point text (the normal point size). Tab spaces are determined by dividing the text height by 2, then multiplying by 8.

Additional Information
For information on text heights, see "<font attribute="value">...</font>".

Appearance Tags

You can use the following set of tags to change the appearance of text.

<b>...</b>

These tags display the enclosed text bolded.

<i>...</i>

These tags display the enclosed text italicized.

<u>...</u>

These tags display the enclosed text underlined.

<font attribute="value">...</font>

The <font> tag lets you specify text characteristics. Like the HTML <FONT> tag, it uses an end tag, </font>, and can contain any number of attributes. For example:


<font size="+4" face="courier"> 

RealText supports the following <font> attributes:

Command Tags

The following tags let you embed RealPlayer commands in your presentation or modify the default streaming behavior.

<a href="URL" [target="_player"]>...</a>

This tag makes the enclosed text a hyperlink to the specified URL, which should begin with a protocol designation such as http:// or rtsp://. For static files, you can also specify URLs relative to the location of the RealText source file. For example, the link <a href="more.htm">...</a> opens the file more.htm in the same directory as the RealText file. Relative links follow the HTML directory syntax.

You can also include the target="_player" attribute to launch the new stream in the current RealPlayer window. If you do not use the target attribute or you specify target="_browser", the linked URL opens in a Web browser window.

Note
The link text is the color specified in the link attribute of the <window> tag. The link is underlined unless the <window> tag includes underline_hyperlinks="false".

<a href="command" target="_player">...</a>

This tag makes the enclosed text a hyperlink that, when clicked, executes a RealPlayer command. The commands are case-sensitive and must be enclosed in double quotes. The target="_player" attribute is required. The following command instructs RealPlayer to seek to the specified time in the current text stream:


<a href="command:seek(time)" target="_player"> 

For example, the following instructs RealPlayer to seek to 1:35.4 in the stream:


<a href="command:seek(1:35.4)" target="_player"> 

When clicked, the following link causes RealPlayer to pause the stream:


<a href="command:pause()" target="_player"> 

When clicked, the following link causes RealPlayer to begin or resume playing the stream:


<a href="command:play()" target="_player"> 

Note
The link text is the color specified in the link attribute of the <window> tag. The link is underlined unless the <window> tag includes underline_hyperlinks="false".

<required>...</required>

Use these tags to enclose text that must be delivered to RealPlayer under any circumstance. During extremely adverse network conditions, RealSystem will halt the presentation if necessary rather than drop the text. You can use these tags sparingly, though, because RealSystem ensures that very little data loss occurs in transmission.

Color Options

For the RealText color options, you can use any colors available through the HTML <FONT COLOR> tag. This includes Red/Green/Blue hexadecimal values (#RRGGBB), as well as these predefined color names, listed here with their corresponding hexadecimal values:

white (#FFFFFF)silver (#C0C0C0)gray (#808080)black (#000000)
yellow (#FFFF00)fuschia (#FF00FF)red (#FF0000)maroon (#800000)
lime (#00FF00)olive (#808000)green (#008000)purple (#800080)
aqua (#00FFFF)teal (#008080)blue (#0000FF)navy (#000080)

You can also use "transparent" as a color. For example, <font bgcolor="transparent"> means that each following word does not have a rectangle drawn behind it. This lets you draw text on top of previous text (using the <pos> tags) without "erasing" the previous text.

Coded Characters

The following table lists the character codes you can include in a RealText source file. Codes begin with an ampersand (&) and end with a semicolon (;). RealText interprets these characters the same way as popular Web browsers.

RealText Coded Character Set
CodeDisplays as
&lt; <
&gt; >
&amp; &
&nbsp; (nonbreaking space)
&#32;
to
&#255;
ISO Latin-1 characters. For a list of these characters, visit the W3C reference at:

http://www.w3.org/MarkUp/html-spec/html-spec_13.html

Or click here for a list generated through JavaScript. (This may take a few seconds.)

For example, the following RealText source text:


This is a bold tag: "&lt;b&gt;".

is displayed in a RealText window as:


This is a bold tag: "<b>".


Copyright © 1998 RealNetworks
For technical support on RealNetworks products, visit http://service.real.com/.
Comments on this document? Contact techpubs@real.com.
This file last updated on 05/20/98 at 16:39:42.
previous next