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.
7.4.1. RealText syntax
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.
7.4.2. Window types
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:
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.
Example 7-7. An example of a basic RealText file
<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.
Example 7-8. An example of captioned graphics
<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.