previous next

Chapter 3: 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.

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/> and <time end/> Tags

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:

<time begin=""/>

<time end=""/>

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.

Tips for Using <time/> Tags

Here are some times on using <time/> tags:

<clear/> Tag

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="..."/> 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!

A <clear/> tag removes all preceding text, even 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 appears 15 seconds into the presentation and clears this line, however.

The <clear/> tag does not reset text appearance. For example, if text appears bolded before the <clear/> tag, it remains bolded after the <clear/> tag.

<pos x/> and <pos y/> Tags

These tags position the text horizontally and vertically, respectively:

<pos x="pixels"/>

<pos y="pixels"/>

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"/>

These tags work only if scroll rate and crawl rate are both 0 (zero).

<tu> and <tl> Tags

These tags function only with TickerTape windows. They display the enclosed text at the window's upper (<tu>) or lower (<tl>) edge:

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

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

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 "Colors" 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.


The <p>...</p> tags add space between text. In TickerTape and Marquee windows, they move 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.


The <br/> tag 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.


The <ol>...</ol> tags are for compatibility with HTML lists. Text between these tags is indented, but not numbered.


The <ul>...</ul> tags are for compatibility with HTML lists. Text between these tags is indented, but not bulleted.


The <li>...</li> tags are for compatibility with HTML lists. They act like a <br/> tag.


The <hr/> tag is for compatibility with HTML horizontal rules. It acts as two <br/> tags.


The <center>...</center> tags 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, but they have no effect in windows with horizontal motion, such as TickerTape and Marquee windows. The <center> tag 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.

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.


The <pre>...</pre> tags work 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 the "Font Sizes" table. See also the <window> tag attribute extraspaces="use|ignore".

Appearance Tags

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


The <b>...</b> tags display the enclosed text bolded.


The <i>...</i> tags display the enclosed text italicized.


The <s>...</a> tags strike through the enclosed text.


The <u>...</u> tags display the enclosed text underlined.

<font> Tag

The <font> tag lets you specify text characteristics:

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

Like the HTML <FONT> tag, the RealText <font> tag uses an end tag, </font>, and can contain several attributes as described in the following sections. For example:

<font size="+4" face="courier">...text...</font>


Use this <font> tag attribute to set the text background color. The default is bgcolor="transparent".

Additional Information
See "Colors".

charset="character set"

With this <font> tag attribute, you can control the character set used to display the text. You can change character sets within a RealText file with a <font charset="character set"> tag. The following are the character sets you can use.


This <font> tag attribute lets you control the font color. It supports all color values available in HTML. For TickerTape windows, however, this attribute has no effect. The <tu> and <tl> tags set the TickerTape text colors.

Additional Information
See "Colors".

face="font name"

This <font> tag attribute controls the text font. Fonts correspond to character sets as described above. For non-Western fonts, you must specify the correct character set for the font to display properly.

English and European Language Fonts

When writing in English or European languages, use a font name from the "Windows Font Name" column of the following table, which lists fonts that use the us-ascii or iso-8859-1 character set. If you specify no font, RealText uses Times New Roman or Times regardless of the character set specified.

On Macintosh and UNIX, RealText uses the specified font if that font is available. If the font isn't available, RealText defaults to a system font as indicated in the table below. If you use the Algerian font, for example, a RealPlayer on a Macintosh displays the text in that font as long as the font is available. Otherwise, it displays the text in Courier. In a few cases, RealText always defaults to a system font. These cases are indicated with the notation "(always)". For example, the Fixedsys font always displays as Courier on a Macintosh.

RealText Font Support for us-ascii and iso-8859-1 Character Sets
Windows Font Name Macintosh Default
if Font not Available
UNIX Default
if Font not Available
Algerian Courier Courier
Arial Helvetica Helvetica
Arial Black Helvetica Helvetica
Arial Narrow Helvetica Helvetica
Arial Rounded Mt Bold Helvetica Helvetica
Book Antiqua Helvetica Helvetica
Bookman Old Style Helvetica Helvetica
Braggadocio Helvetica Helvetica
Britannic Bold Helvetica Helvetica
Brush Script Times Times
Century Gothic Helvetica Helvetica
Century Schoolbook Helvetica Helvetica
Colonna Mt Colonna Mt or Times Times
Comic Sans Ms Times Times
Courier New Courier Courier
Desdemona Helvetica Helvetica
Fixedsys Courier (always) Courier
Footlight Mt Light Helvetica Helvetica
Garamond Times Times
Haettenschweiler Helvetica Helvetica
Helvetica (Arial is used if Helvetica is not found.) Helvetica Helvetica
Impact Helvetica Helvetica
Kino Mt Times Times
Matura Mt Script Capitals Times Times
Modern Helvetica Helvetica
Ms Dialog Times Times
Ms Dialog Light Times Times
Ms Linedraw Helvetica Helvetica
Ms Sans Serif Helvetica Helvetica
Ms Serif Helvetica Helvetica
Ms Systemex Times Times
Playbill Times Times
Small Fonts Times Times
System Geneva (always) Times
Terminal Geneva Times
Times New Roman Times (always) Times
Verdana Helvetica Helvetica
Wide Latin Helvetica Helvetica

A Macintosh that has Microsoft's Internet Explorer 4.0 or later browser installed should have most of the Windows fonts available.

Asian Language Fonts

RealText also supports the following fonts that use character sets other than us-ascii and iso-8859-1.

RealText Font Support for Non-Western Character Sets
Font Name Characters RealText Font Face Tag charset
AppleGothic Korean <font face="AppleGothic"> iso-2022-kr
Batang Korean <font face="Batang"> iso-2022-kr
BatangChe Korean <font face="BatangChe"> iso-2022-kr
Gothic Korean <font face="Gothic"> iso-2022-kr
Gulim Korean <font face="Gulim"> iso-2022-kr
GulimChe Korean <font face="GulimChe"> iso-2022-kr
Osaka Kanji <font face="Osaka"> x-sjis
Seoul Korean <font face="Seoul"> iso-2022-kr
Simplified Chinese <font face="'ËÎÌå">
(The face name displays as gibberish without the gb2312 character set.)
Traditional Chinese <font face="²Ó©úÅé">
(The face name displays as gibberish without the big5 character set.)

Korean and Japanese are supported in RealPlayer for Windows and Macintosh, but not for UNIX.


This <font> tag attribute lets you control the font size. You can use relative sizes or absolute sizes as shown in the table below. This table also lists the height in pixels for each size. The pixel sizes are for reference only. You cannot specify a pixel size directly in RealText.

Font Sizes
Relative Size Absolute Size Pixel Size Reference
-2 1 12 pixels
-1 2 14 pixels
+0 (default) 3 16 pixels
+1 4 20 pixels
+2 5 24 pixels
+3 6 36 pixels
+4 7 48 pixels

You can also specify relative sizes smaller than -2 or larger than +4, but they are treated as -2 and +4, respectively.

Working with the Font Tag

Keep in mind that the RealText <font> tag works like the HTML <FONT> tag. How you nest tags, which attributes you include, and where you place </font> tags affects the outcome. For example, compare these RealText samples (bolding used for emphasis only) and the illustrations of how this mark-up affects the text when the clip plays in RealPlayer:

Start with normal text.
<font color="red">Make text red.
<font size="+1">Make red text one size larger.
</font>Turn off larger size for red text.
</font>Turn off color.

Start with normal text.
Make text red.
Make red text one size larger.
Turn off larger size for red text.
Turn off color.

Start with normal text.
<font color="red">Make text red.
</font>Turn off color.
<font size="+1">Make text one size larger.
</font>Turn off larger size.

Start with normal text.
Make text red.
Turn off color.
Make text one size larger.
Turn off larger size.

Start with normal text.
<font color="red" size="+2">Make text red and two sizes larger.
<font color="blue" size="+1">Make text blue and one size smaller.
</font></font><font size=+1">Turn off color but keep text the same size.
</font>Reduce text to normal.

Start with normal text.
Make text red and two sizes larger.
Make text blue and one size smaller.
Turn off color but keep text the same size.
Reduce text to normal.

Command Tags

The following sections describe tags you can use to launch URLs in a browser or RealPlayer. You can also use tags to issue RealPlayer commands such as Pause and Play.

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".

Additional Information
SMIL files can also define hypertext links that may override the link you set here. For more information, see the SMIL chapter in RealSystem Production Guide.

Creating a Mail Link

This tag turns the enclosed text into an e-mail hyperlink:

<a href="mailto:address">...</a>

When the viewer clicks the link, RealText passes the e-mail address to the viewer's browser. Use an address in the standard form, such as If the browser is configured for e-mail, the e-mail client opens a new message with the defined address in the "to" line.

Opening a URL in RealPlayer or a Browser

The following RealText tag makes the text enclosed between <a href...> and </a> a hyperlink that opens in a browser or RealPlayer:

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

The specified URL should begin with a protocol designation such as http:// or rtsp://. The URL can use any protocol RealPlayer or the user's Web browser supports. The optional target="_player" attribute launches 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.

Example 1: Opening a URL in RealPlayer

The following example launches a new SMIL Presentation in RealPlayer:

<a href="rtsp:// target="_player">Play Next</a>

Example 2: Opening a URL in a Web Browser

This example opens a URL in the user's browser:

<a href="">Visit RealGuide</a>

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 standard HTML directory syntax.

Example 3: Opening a URL in the Form protocol:path

If you include version="1.5" (or higher if using a newer version of RealText) in the <window> tag, you can pass the browser a URL in the form protocol:path instead of protocol://path. Protocols using this format include those for Telnet and AOL Instant Messenger. For example, here is a RealText link that launches AOL Instant Messenger:

<window version="1.5"...>
...<a href="aim:goim?screenname=[name]">Send Me an Instant Message</a>...

Issuing RealPlayer Commands

The following tag makes the enclosed text a hyperlink that, when clicked, executes a RealPlayer command:

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

The commands are case-sensitive and must be enclosed in double quotes. The target="_player" attribute is required.

Seeking Into a Presentation

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"> 

Pausing a Presentation

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

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

Resuming Playback

Clicking the next link causes RealPlayer to begin or resume playing the stream:

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

Popping Up New RealPlayer Windows

RealPlayer 7 or higher can open as many player windows as the computer CPU and memory allow. This lets you keep navigation information visible in one window, for example, while content plays in another window. A RealText hyperlink that opens a new RealPlayer window uses this format:

<a href="command:openwindow(name, URL, playmode=value, ...)">...</a>

When a viewer clicks a link with this syntax, command:openwindow tells RealPlayer to open a new window for the given URL, and stop the presentation in the current window. This command requires two arguments, name and URL. The playmode arguments are optional. You can separate arguments with a comma, but this is not required. A space may precede or follow a comma. If an argument contains characters such as commas or parentheses, enclose it in single quotation marks.

Because RealPlayer G2 does not support multiple windows, add version="1.4" (or higher if using a newer version of RealText) to the <window> tag to cause RealPlayer G2 to upgrade to the latest version of RealPlayer.


The mandatory name argument comes first. It supplies a predefined or user-defined name for the new RealPlayer window. The following table gives the values for the name argument.

name Argument
Name Function
_new or
Opens a new RealPlayer window each time the viewer clicks the link. Each subsequent link named _new or _blank opens a new window as well.
_self or
Opens the URL in the current RealPlayer window.
name Creates a new RealPlayer window with the user-defined name. A subsequent openwindow command using the same name opens the given URL in the same window.


Following the name argument, the required URL argument gives the fully qualified URL to the clip or SMIL presentation. You must include the protocol, such as rtsp://, http://, chttp://, or file:// in the URL. Relative URLs do not work.


The optional playmode=value argument defines the state of the new RealPlayer window that opens. A command to open a new window can have more than one playmode argument. The following table gives the possible values for playmode.

playmode Attributes and Values
Attribute Value Function
autosize true Puts window in autosize mode so that it minimizes to just the display window when the cursor is not over it.
false Opens window in compact mode so that it does not change size on a mouseover. This is the default. Note that normal view mode is available only on the main RealPlayer window, not the pop-up windows.
zoomlevel normal Plays clip at its normal encoded size. This is the default.
double Doubles clip size.
full Plays clip at full-screen. If the operating system does not support full-screen zoom, normal mode is used instead.
ontopwhileplaying true Keeps window on top of other windows on the desktop.
false Lets user determine which windows to place on top. This is the default.

Examples of Opening New RealPlayer Windows

The following sections provide examples of how to create hyperlinks that launch new RealPlayer windows.

Targeting the Same Window with Multiple Links

The following RealText link opens a URL in a new RealPlayer window named feature. The new window is set to autosize mode:

<a href="command:openwindow(feature, rtsp://, autosize=true)">Comedy Hour</a>

When first clicked, this link creates a RealPlayer window named feature. If another link also targets the feature window, clicking that link starts the new URL in the feature window. Clicking the following link, for example, starts an animal program in the window running the comedy program. This link switches the window out of autosize mode, though:

<a href="command:openwindow(feature, rtsp://, autosize=false)">Sharks!</a> 

Opening Separate Windows

Each link opens a separate window if the window names are different, or you use the predefined name _new or _blank. The following links open separate autosizing windows that play on top of all other desktop windows:

<a href="command:openwindow(_new, rtsp://, autosize=true, ontopwhileplaying=true)">Comedy Hour</a>

<a href="command:openwindow(_blank, rtsp://, autosize=true, ontopwhileplaying=true)">Sharks!</a>

Launching URLs in the Current Window

Use either _current or _self to open the URL in the current window:

<a href="command:openwindow(_current, rtsp://">Sharks!</a>

The next link plays the clip at double its encoded size:

<a href="command:openwindow(_self, rtsp://, zoomlevel=double)">Comedy Hour</a>

Ensuring Text Delivery under any Circumstance

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 normally ensures that very little data loss occurs in transmission.


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)fuchsia (#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.

Transparency is not currently supported as a window background color.

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
Code Displays as
&lt; <
&gt; >
&amp; &
&nbsp; (nonbreaking space)
Characters taken from the active character set as specified by the active <font charset="..."> tag. The default character set is iso-8859-1, which is also known as ISO Latin 1. For a list of these characters, see the W3C reference at Or click here for a list generated through JavaScript. (This may take a few seconds.) See below, however, if you're using the mac-roman character set.

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>".

Using the mac-roman Character Set

Unlike HTML, RealText allows you to change character sets within a document. It then takes coded characters from the active character set. Generally, character codes 128 and below are the same in all Western-language character sets. Those above 128 may differ, though. In the mac-roman character set, for example, &#166; is a paragraph symbol. But in iso-8859-1, this symbol is &#182;.

See for a GIF chart of the mac-roman upper character set. Go by this chart, rather than the W3C reference or JavaScript list provided above if you've set <font charset="mac-roman"> and are entering coded characters of &#129; or above. The values in the chart are in hexadecimal (base 16). The chart cell in the upper, left-hand corner equals 128 in decimal (base 10), so you can count across from there. To make a paragraph symbol when using mac-roman, for instance, you use &#166; in the RealText file because hexadecimal A6 on the chart is decimal 166.

Copyright © 1998-2000 RealNetworks
For information on RealNetworks' technical support, click here.
Comments on this document? Click here.
This file last updated on 12/15/00 at 10:37:07.
previous next