Add Text
This exercise will demonstrate how to add text to the presentation.
Titles, for the pictures, are added in the title location below
the pictures.
The text description of each picture is specified using the <string>
element. The text is placed in the textLines attribute. The text
corresponds to the various pictures added in the previous exercise.
Timing is specified in event timing. The begin and end of the text
is relative to the timing of the pictures.
There is an additional quotation mark in the textLines attribute.
XML uses the quotation mark to delineate the value of the attribute
tags, in this case the textLines attribute. XMT-O also uses the
quotation mark to indicate multiple strings in the attribute, in
this case it would be used to distinguish multiple lines of text.
Thus the textLines attribute has nested quotation mark. In order
to escape the MPEG-4 quotation mark use the XML character escape
for the quotation mark, ". You could also use double
quotation mark nested in single quotation mark, for example textLines='
"Queen Marry" ', but this is non-canonical XML and as
such my not be supported by all tools.
<xmt-o ...>
<head> ... </head>
<body>
<par>
...
<string id="text1" begin="slide1.begin" end="slide1.end" textLines=""Queen Mary""/>
<string id="text2" begin="slide2.begin" end="slide2.end" textLines=""Montpellier Park""/>
<string id="text3" begin="slide3.begin" end="slide3.end" textLines=""Aigues Mortes""/>
<string id="text4" begin="slide4.begin" end="slide4.end" textLines=""Hong Kong""/>
</par>
</body>
</xmt-o>
The <material> element supports the fill characteristic of
an object and the object's color. The color can be specified as
a color string or as hexadecimal value as we saw earlier.
The font is specified by the <fontStyle> element. The family
is a list of strings where the client font family support is searched
according to the specified list. SANS, SERIF and TYPEWRITER font
families are supported by default on all MPEG-4 clients.
The location of the text is specified by the <transformation>
element.
<xmt-o ...>
<head> ... </head>
<body>
<par>
...
<string ...>
<material color="black" filled="true"/>
<fontStyle family=""SANS"" justify="MIDDLE; MIDDLE" size="18" style="BOLD"/>
<transformation translation="0 -126"/>
</string>
<string ...>
<material color="black" filled="true"/>
<fontStyle family=""SANS"" justify="MIDDLE; MIDDLE" size="18" style="BOLD"/>
<transformation translation="0 -126"/>
</string>
<string ...>
<material color="black" filled="true"/>
<fontStyle family=""SANS"" justify="MIDDLE; MIDDLE" size="18" style="BOLD"/>
<transformation translation="0 -126"/>
</string>
<string ...>
<material color="black" filled="true"/>
<fontStyle family=""SANS"" justify="MIDDLE; MIDDLE" size="18" style="BOLD"/>
<transformation translation="0 -126"/>
</string>
</par>
</body>
</xmt-o>
The following is the complete XMT-O file used for this exercise:
IBMSlideShow3.xml
Here is a snap shot of the exercise:
In the next exercise, you will use
definitions to share the text fontstyle and material.
|