RealText is the markup language that defines how streaming text looks and operates within a G2 presentation. Because text files are typically small, streaming text consumes minimal bandwidth, usually less than 1 Kbps, and therefore has an almost negligible impact on the overall bitrate of a G2 show.
Like SMIL and RealPix, standalone tags are self-closing -- they must end with a forward slash (/). All tag and attribute names must be lowercase, and attribute values must be enclosed within double quotation marks.
RealText supports many standard HTML layout and appearance tags, including <br/> and <p> for line breaks and spacing, as well as <b> and <i> for bolding and italicizing. Coded characters such as for nonbreaking space are supported as well. Many more advanced HTML features, such as tables and frames, are not supported. For a full list of supported tags and coded characters, refer to RealNetwork's RealText Authoring Guide at http://service.real.com/help/library/guides/realtext/realtext.htm. The SMIL 2 specification is expected to greatly enhance the functionality of the SMIL specification.
RealText files open and close with the <window> and </window> tags. The <window> tag must contain the type attribute, which designates the file as one of five preset types: generic, tickertape, marquee, scrollingnews, or teleprompter. Each type has preset parameters, as well as a number of attributes that can be applied to it, which define the appearance and functionality of the content. Within these parameters, you can define additional details such as font size and color:
A generic window has no preset parameters, and you can use it to create any RealText display allowed by the markup. You can display and erase lines of text, scroll text through the window, set text to crawl from side to side, or create a simple, static text box.
scrollingnews text is preset to scroll from the bottom of the window to the top, but it does not scroll from side to side. Scrolling occurs at a constant rate throughout the presentation.
Text in a tickertape window crawls from right to left and can also loop back around to the right. It cannot scroll up or down. The <tu> and <tl> tags describe the appearance and behavior of the text that appears in the upper and lower rows of the window, in the style of a stock ticker.
marquee text crawls from right to left and can loop, and it is centered vertically within the window.
In a teleprompter window, text arriving at the bottom edge of the window causes the text above it to move up just enough to display the new line.
The <window> tag also describes the height and width of the file. It's important to note that the height and width of the window must be the same as the height and width of the corresponding region in the SMIL file where your RealText file is being placed. If the dimensions are not exactly the same, the text will be distorted in the display.
Example 7-7 is a simple RealText file, using a scrollingnews window type. The <center> and <font> tags function the same way as they do in HTML.
<window type="scrollingnews" height="40" width="200"> <center><font size="1" face="arial" color="#0000CC"> All text goes in here. All text will scroll from the bottom of the window to the top, but not from side to side. Scrolling will occur at a constant rate throughout the presentation. <b>This text will be bold.</b> </font></center> </window>
RealText files can be more complex as well, with their own internal timelines. Example 7-8 contains the three captions that will appear beneath graphics consecutively in the same area, according to the indicated time settings.
<window type="generic" width="200" height="20" duration="30"> <time begin="0.5" end="10"/> <font face="arial" size="1">Graphic 1 caption</font> <time begin="10.5" end="20"/> <font face="arial" size="1">Graphic 2 caption</font> <time begin="20.5" end="30"/> <font face="arial" size="1">Graphic 3 caption</font> </window>
RealText supports hyperlinking to both HTML files and other SMIL files. Any words in RealText can be hyperlinked with the use of the <a href=""></a> syntax, identical to HTML. The default target is a web browser, so to create a hyperlink to another SMIL file, use the target=_player attribute.
For complete RealText documentation, visit RealNetwork's RealText Authoring Guide at http://service.real.com/help/library/guides/realtext/realtext.htm.
Copyright © 2002 O'Reilly & Associates. All rights reserved.