previous   next   contents  

8. SMIL 3.0 smilText

Editors for SMIL 3.0
Dick Bulterman, CWI
Sjoerd Mullender, CWI
Samuel Cruz-Lara, INRIA

Table of contents

8.1 Changes for SMIL 3.0

This section is informative.

This module defines new functionality for SMIL 3.0. It extends the media types available for SMIL, but does not alter any other existing functionality from SMIL 2.1 or earlier versions.

The SYMM WG is exploring the addition of a multilingual module for specific support translating timed-text content, and for a linguistic markup module to aid in processing semantically-scaled timed text. This addition will be presented in a separate specification; it is not expected to impact the basic facilities of smilText as defined in this document.

8.2 Introduction

This section is normative.

The functionality described in these modules provide a new media type for use in SMIL presentations. This functionality is called smilText. Unlike other media types defined in the media object module, all of which are synonyms of the ref element, the smilText modules provide a text container element with an explicit content model for defining in-line text. The smilText modules also define a set of additional elements and attributes to control explicit in-line text rendering. smilText content is processed in a manner consistent with other SMIL media. This means, among other aspects, that the smilText respects SMIL timing and layout behavior, including the semantics of the fit and fill attributes of SMIL Layout.

The smilText Modules are composed of a BasicText module and two modules with additional functionality that build on top of the BasicText module: the TextStyling and TextMotion modules. These modules contain elements and attributes used to define in-line text content. Since the smilText elements and attributes are defined in a series of modules, designers of other markup languages can reuse these modules when they need to include a simple form of timed text functionality into their language.

8.2.1 Motivation

This section is informative.

The purpose of including text content functionality into SMIL 3.0 is to allow authors to define small amounts of lightly-formatted text within the context of a SMIL presentation. Such text can be used for labels within a presentation or for incidental captions. Users who wish to use large amounts of structured text (with or without temporal markup) should consider the use of external text media objects encoded in formats such as XHTML or the "Distribution Format Exchange Profile" (DFXP) of Timed Text [DFXP].

All versions of SMIL have had support for the text element, which is defined as an alias of the generic SMIL ref media reference element. A typical use of the text element is:

    <text region="Title" src="Headline.html" dur="10s" >

Users new to SMIL are often surprised that the text element does not have a content model -- that is, an ability to specify the content text along with the element, such as in:

    <text region="Title" dur="10s" >
       Willemijn's 11th Birthday Party
    </text>
 

More advanced users of SMIL found that they were able to insert in-line text content into the SMIL file using a data URL, such as:

    <text src="data:,Willemijn's%2011th%20Birthday%20Party" 
          region="Title" dur="10s" >
 

However, the strict syntax of this approach, plus the limited styling options available, make it a less-than-optimal way of including incidental text content into a SMIL presentation. A more author-friendly approach to text inclusion was a requirement for SMIL 3.0.

The implementation of SMIL on a wide range of devices, from set-top boxes and mobile devices to conventional desktop computers, means that care needed to be taken in defining the complexity of the smilText modules. The motivation of the SMIL's in-line text facility was not to provide complete support for all types of text, but to provide a balance between authoring convenience and player complexity. smilText was also designed to differentiate text styling from general layout and positioning so that smilText could be used efficiently with SMIL Layout. Both of these motivations, plus the desire to define a media facility that could be used across all of SMIL's implementation platforms, has resulted in a simple text specification that can meet many of the requirements for incidental text within a SMIL document.

smilText has been designed as a functional subset of the W3C Timed Text Distribution Format Exchange Profile (DFXP) of TimedText [DFXP]. While users familiar with DFXP will recognize the functionality included in this specification, the differences in temporal and layout specifications between SMIL and DFXP have resulted in a slightly different syntax in the two languages. The SYMM working group has striven to minimize these differences. A complete list of differences between smilText and DFXP is presented in Appendix A.

8.2.2 The smilText Rendering Model

This section is normative.

In order for text content to be compatible with the SMIL timing semantics, a general text processing model has been defined for smilText. In this model, text is classified as a continuous media type, with the inherent duration defined by timing mark-up within the smilText definition. All text content is processed as if it were first rendered to an off-screen bitmap; this bitmap is then used as the basis for inclusion into a SMIL presentation much as if it were a video object. If the smilText contains no internal timing mark-up, the processing model treats it as if it were a logical image.

The dimensions used in constructing the off-screen bitmap representation of smilText will depend on a number of factors. In general, the layout model used to define a drawing area for the text content will provide initial values for the extents of the text area. The default text-wrap behavior for smilText is to wrap the text content based on region width. In this case, the region will determine the text-area width and the text content will determine the effective off-screen bitmap height. If the wrap behavior is set to disallow automatic text wrapping (which is only possible if the TextStyle module is supported by the profile implementing smilText), the effective height is determined based on the number of lines of text (which in turn is determined by the number of manual line breaks created via the br element) and constrained by the region height, while the text content determines the off-screen bitmap width.

In most cases, content defined in a smilText element will define a new off-screen bitmap pseudo-image that will replace any existing content in the target region. If multiple smilText elements are active simultaneously and target the same layout region, the behavior is fully defined by the semantics of the SMIL timing and layout models. Users of smilText are encouraged to study the examples at the end of each module description to better understand the impact of SMIL timing on text rendering with smilText.

8.3 SMIL 3.0 BasicText Module

This section is normative.

This section defines the elements and attributes that make up the functionality in the SMIL 3.0 BasicText module. Languages implementing elements and attributes found in the BasicText Module must implement all elements and attributes defined in this section.

8.3.1 Elements and Attributes

The SMIL 3.0 BasicText module defines four elements and four attributes which, together, provide basic support for in-line text within a SMIL presentation. The functionality provided by these elements and attributes represent the minimum level of text processing that can be required by a user agent implementing smilText.

The elements defined in this module are:

smilText
tev
clear
br

The attributes defined in this module are:

begin
next
id
textWrapOption
xml:space

In addition, this module extends the definition of the SMIL Layout region element to include the textWrapOption attribute.

For profiles that support only the BasicText module, all in-line text content styling and processing is defined and controlled by the SMIL user agent rendering the text. Additional content styling elements and attributes are defined in the TextStyling and TextMotion modules; support for this extended functionality is profile dependent.

The smilText Element

The smilText element functions as a logical and temporal structuring element that allows the inclusion of in-line text content into a SMIL presentation. When rendering in-line text, the smilText element provides a top-level container for timing semantics. Additional timing semantics may be defined on the content within the smilText element.

When text is rendered into an associated region, the existing contents of the region is replaced by the element content. The properties of the region will determine the extents of the rendering area and the clipping behavior of text placed in the region. The effective value of the textWrapOption attribute will determine if lines wrap if they are wider than the space provided. In-line text is considered to be rendered instantaneously at the beginning of the simple duration of the text element unless temporal markup using the tev or clear elements is defined within the text. In smilText, extra white space between characters is processed according to the xml:space model defined in XML 1.1 [XML11]. The xml:space attribute is reused in smilText, with the conventional semantics described in the section xml:space, below.

Anchors and links may be attached to content within the smilText element. In these cases, the syntax and semantics of SMIL Linking will be expected, including temporal attributes on anchors.

Element attributes

This element accepts the textWrapOption and xml:space attributes, which will override the effective value for these attribute defined on the layout region.

Profiles including the smilText element must define which other SMIL attributes may be attached to this element. At a minimum, the definition of an associated layout region and basic SMIL timing control, including the definition of a begin and end or duration will be expected.

Element Content

The smilText element may contain character content. If this content is present, it will be rendered as text in a manner consistent with other elements and attributes in this module. If no content is present, the smilText element must still observe all SMIL timing properties.

The tev Element

The tev element defines a "temporal moment" within a block of smilText content. Depending on the values of the begin or next attributes, it determines a scheduling time at which the associated text content (up to the following tev or clear element or the end of the smilText element) is rendered. This element does not define a content container, but is simply a temporal marker within a text fragment.

Element attributes

This element accepts the begin, next and id attributes. Profiles including the tev element must define which other SMIL attributes may be attached to this element.

Element content

This element has no content.

The clear Element

The clear element defines a "temporal moment" within a block of smilText content at which the full contents of the rendering area are cleared. Depending on the values of the begin or next attributes, it also determines a scheduling time at which the associated text content (up to the following tev or clear element or the end of the smilText element) is rendered. This element is functionally equivalent to the tev element, except that it has a side-effect of clearing the rendering area before any new content is rendered. This element does not define a content container, but is simply a temporal marker within a text fragment.

Element attributes

This element accepts the begin, next and id attributes. Profiles including the clear element must define which other SMIL attributes may be attached to this element.

Element content

This element has no content.

The br Element

The br element functions as a forced line break within in-line content defined in a smilText element. The br element is only valid within as content of a smilText element and has no temporal semantics other than those of its parent smilText element.

Element attributes

This element does not accept any attributes.

Element content

This element has no content.

The begin Attribute

This attribute defines an absolute time, relative to the beginning of the parent smilText element, when the associated tev or clear element becomes active.
The attribute value is a semi-colon separated list of begin-values:
begin-value : ( clock-value | event-value )
Defines the element's begin time.
Clock-value
Describes the element begin as a non-negative offset from the start of the element's smilText container. The offset is measured in parent simple time.
event-value : ( Id-value "." )? ( event-ref? ) ( ( "+" ) Clock-value )?
Describes an event and an optional offset that determine the element begin. The element begin is defined relative to the time that the event is raised. Events may be any event defined for the host language in accordance with [DOM2Events]. These may include user-interface events, event-triggers transmitted via a network, etc. When using smilText, only event-based timing is support. The use of offsets based on scheduled activation of other elements is not supported.

The general semantics of this element are the same as the SMIL begin attribute defined within the timing module, with the restriction that only a subset of potential time values are supported.

The next Attribute

The next attribute defines a relative start time, relative to the effective begin time of the parent smilText element, or the most recently activated tev or clear element within the parent.
The attribute value is single clock value.
Clock-value
Defines a time marker relative to the effective start time of the preceding temporal marker The offset is measured in parent simple time.

The id Attribute

The id attribute specifies a name that can be used by other attributes within the presentation. The name is typically used to identify a temporal event. The value is a valid NMTOKEN.

The textWrapOption Attribute

The textWrapOption attribute specifies whether text content that is larger than the effective space available on one line in a region wraps.

Values:

wrap (default)
Text is wrapped across lines within a region.
noWrap
Text is not wrapped across lines within a region.
inherit
The effective value of this attribute is used.

This attribute may be used on the smilText element or as a default on the region element.

The xml:space Attribute

The xml:space attribute specifies how whitespace is processed.

Values:

default (default)
Whitespace is collapsed according to the semantics defined by XML 1.1, ([XML11] section 2.10).
preserve
Whitespace is preserved according to the semantics defined by XML 1.1, ([XML11], section 2.10).

This attribute may be used on the smilText element or as a default on the region element.

Editor's note:
The DFXP [[rovides additional information on the exact processing ofDFXP]] specification provides additional information on the exact processing of whitespace, based on XSL 1.0 [[XSL 10]] semantics. This description may be integrated into the smilText specification, but we have not done so since it required modifying the definition of xml:space. Feedback on this topic is welcome.

Evaluation of begin and end time lists

This section is informative

A smilText object is defined as a collection of text characters that may have one or more timing markers inserted in the text. The markers allow incremental appearance of text fragments.

In its most simple form, a smilText element contains a block of text that is displayed in its entirety at the effective start time of the element. This behavior is logically equivalent to placing a clear element with a begin time of '0' at the start of the smilText element.

It is possible to insert one or more tev elements within the smilText content. Each of these elements specify an absolute or relative starting time for the text immediately after the tev element. The text is displayed instantaneously up to the following tev element. If a clear element is used, any content within the associated rendering region is erased before the new text is displayed.

The next attribute defines a relative offset as the start time of the associated tev or clear element. This time is defines as being relative to the effective start time of the preceding tev (or clear) element -- or from the start of the smilText element if no preceding tev/clearelement was defined. The effective start time is the time that the preceding element actually was activated, either by a resolved time value or in response to an event.

Authors are encouraged to study the examples in this section for details on the interaction of smilText, tev, clear, begin and next.

Examples

This section is informative.

General Use of smilText

The smilText element provides a temporal wrapper for in-line text:

    <smilText>
       Hello world!
    </smilText>

The smilText element is the equivalent of allowing a data URL that contains text content, such as: <ref src="data:,Hello%20world!" ... > .

In this simple form, the text will be rendered based on the default layout properties defined for the user agent. If SMIL Layout is used, the default behavior is: a dynamic region will be defined that contains the text content of the element. All styling information -- including font, font size, font style and font color -- will be determined by the SMIL player.

If the SMIL Layout BasicLayout module is also supported by the profile implementing this module, the rendering extent and the clipping behavior of the text rendered in a SMIL region will be determined by the effective value of SMIL's layout attributes.

<smil ...>
 <head>
   ...
   <layout>
     ...
     <region id="Title" top="5px" left="10%" width="80%" height="30px" />
     ...
   </layout>
  </head>
  <body>
   ...
    <smilText region="Title" dur"10s">
       Willemijn's 11th Birthday Party
    </smilText>
   ...
  </body>
</smil>

This is equivalent to specifying: <ref region="Title" src="data:,Hello%20world!" ... >. In both cases, the properties associated with the region named Title will be used when positioning the text.

If the rendering space for the content of the smilText element is greater than the horizontal extent of one line, the effective value of the textWrapOption attribute will determine whether content will be clipped or wrapped:

<smil ...>
 <head>
     ...
     <region id="Title" top="5px" left="10%" width="80%" height="30px" 
          textWrapOption="wrap"/>
     ...
  </head>
  <body>
   ...
    <smilText region="Title" dur"10s">
       Willemijn's 11th Birthday Party was held six weeks late. (Again!)
    </smilText>
   ...
  </body>
</smil>

Line breaks within smilText content may be forced by using the br element within text content:

   ...
    <smilText region="Title" dur"10s">
       Willemijn's 11th Birthday Party<br/>was held six weeks late.<br/>(Again!)
    </smilText>
   ...
  </body>
</smil>

The following fragment illustrates use of temporal markers with a smilText element:

 <smil ...>
  <head>
     ...
    <layout>
     <root-layout width="400" height="300"/>
      <region id="Contents" top="5px" left="10%" width="80%" height="300"/>
    </layout>
   </head>
   <body>
      ...
        <smilText id="TS01" region="Contents" dur="6s">
           Willemijn's 11th Birthday Party
           <tev id="TS02" next="2s"/>
           was held six weeks late.
           <clear id="TS03" begin="4s"/>
           (Again!)
        </smilText>
         ...
   </body>
 </smil>

The smilText element TS01 is active for 6s. All activity occurs within this time period, even if the timing definition within the smilText object extends beyond the 6s time limit. If SMIL Layout is used (as in this case), the fill attribute will determine the visual persistence of the text content if its internal timing was shorter than that of the smilText object.

The initial content that is rendered is the string Willemijn's 11th Birthday Party. At 2s after the start of the TS01 container, the fragment with id TS02 gets rendered. In this case, the content was held six weeks late. is displayed along with the previous contents of the smilText element. (The exact display depends on the size of the rendering region and the setting of the textWrapOption attribute.)

At 4s after the start of the parent smilText container, the fragment with the id TS03 is displayed. The use of the clear element causes the display area to be erased before the new text is displayed. Note that since a begin attribute is used instead of the next attribute, the activation time of this fragment is relative to the containing smilText container instead of relative to TS02.

The following example is used to illustrate smilText behavior when used with event-based timing:

      ...
    <par>
        <smilText id="TS11" region="Contents" dur="6s">
           Willemijn's 11th Birthday Party
           <tev id="TS12" next="2s"/>
           was held six weeks late.
           <clear id="TS13" begin="gong.beginEvent"/>
           (Again!)
        </smilText>
        <audio id="TS14" begin="4.5s" src="gongAudio.mp3">
    </par>
      ...

In this example, elements TS11 and TS12 act as TS01 and TS02 in the previous example. Coincident with the start of TS12, the potential active period for TS13 begins. Anytime between 2s after TS11 and the end of the smilText element, TS13 will begin if the "gong.beginEvent" is activated. In this example, the activation happens at 4.5 after the start of the par element containing both the smilText and audio object.

The following example illustrates the interaction of timing rules within smilText:

      ...

        <smilText id="TS31" region="Contents" dur="10s">
           fragment 1,
           <tev id="TS32" next="2s"/>
           fragment 2,
           <clear id="TS33" begin="1s"/>
           fragment 3,
           <clear id="TS34" begin="XXX.beginEvent"/>
           fragment 4,
           <clear id="TS35" next="5s"/>
           fragment 5,
           <clear id="TS36" begin="8s"/>
           fragment 6.
        </smilText>
      ...

The TS31 smilText element starts, and 'fragment 1,' is rendered. Then, 2s later, TS32 is appended to the displayed text. At the same time, TS33 is appended to the display: it has an absolute begin time of 1s after the start of TS31, but its temporal scope only becomes active once TS32 has displayed. (The begin time is still absolute, so the fragment is displayed immediately.) TS34 comes into temporal scope at 2s (that is, at the effective begin time of its predecessor), so the associated fragment will be displayed if the event is triggered between 2s and 10s in the presentation. TS35 is displayed 5s after the effective start of TS34 (assuming the parent smilText container is still active). The effective begin time of TS36 will depend on a number of factors: if the TS35 fragment starts before an absolute 8s, TS36 will wait until 8s. If it starts later (but before the end of the smilText container), the fragment will start immediately.

Fill Semantics of smilText

SMIL timing defines a number of rules that govern the rendering persistence of smilText content. These are:

Layout and Rendering Consequences of smilText

In terms of visual behavior, the value of the fit attribute will determine clipping behavior of the text. Since not all user agents can be expected to dynamically scale plain text, fit="slice" will be the expected default behavior with basic smilText.

In terms of the rendering semantics defined in the TextStyling module, the only behavior defined by basic smilText is the append text mode semantic.

8.3.2 Integration Requirements

This section is normative.

If the including profile supports the XMLBase functionality [XMLBase] , the values of the longdesc attribute (of present) on the smilText element must be interpreted in the context of the relevant XMLBase URI prefix.

All of the attributes specified for media within the SMIL MediaParam module must be supported by implementations integrating this module.

Any profile that integrates the clear element must define what is meant by "display area" and further define the interaction.

8.4 SMIL 3.0 TextStyling Module

This section is normative.

This section defines the elements and attributes that make up the SMIL TextStyling Module. Languages implementing the elements and attributes in the TextStyling Module must implement all elements and attributes defined below, as well as those defined in the BasicText module.

8.4.1 Elements and Attributes

The TextStyling module defines the following five elements:

div
p
span
textStyle
textStyling

The TextStyling module defines the following eleven attributes:

textAlign
textBackgroundColor
textColor
textDirection
textFontFamily
textFontSize
textFontStyle
textFontWeight
textMode
textPlace
textStyle

In addition, this module extends the definition of the SMIL Layout region element to include the TextStyling attributes listed above.

The div Element

The div element functions as a logical container for in-line formatting attributes defined within a smilText element. The div element does not define any temporal semantics with a smilText element. Use of the div element causes an implicit line break.

Element attributes

The div element may (re)specify values for the following SMIL styling attributes defined in this module:

textAlign
textBackgroundColor
textColor
textDirection
textFontFamily
textFontSize
textFontStyle
textFontWeight
textStyle
xml:space

Editor's note:
The textWrapOption may be added to this list. Comments are welcome.

All other attributes are ignored.

Element content

This element accepts as content zero or more characters to which the specified styling is applied. Any styling attributes changed within the scope of this element must be restored to their previous values outside the scope of this element.

The p Element

The p element functions as a logical container for in-line formatting attributes defined within a smilText or div element. The p element may not be nested within another p element. The p element does not define any temporal semantics with a smilText element. The use of the p element causes an implicit line break.

Element attributes

The p element may (re)specify values for the following SMIL styling attributes defined in this module:

textBackgroundColor
textColor
textDirection
textFontFamily
textFontSize
textFontStyle
textFontWeight
textStyle
xml:space

Editor's note:
The textWrapOption may be added to this list. Comments are welcome.

All other attributes are ignored.

Element content

This element accepts as content zero or more characters to which the specified styling is applied. Any styling attributes changed within the scope of this element must be restored to their previous values outside the scope of this element.

The span Element

The span element functions as a logical container for in-line formatting attributes defined within a smilText, div, or p element. The span element does not define any temporal semantics with a smilText element. The use of the span element does not cause a line break.

Element attributes

The span element may (re)specify values for the following SMIL styling attributes defined in this module:

textBackgroundColor
textColor
textDirection
textFontFamily
textFontSize
textFontStyle
textFontWeight
textStyle
xml:space

All other attributes are ignored.

Element content

This element accepts as content zero or more characters to which the specified styling is applied. Any styling attributes changed within the scope of this element must be restored to their previous values outside the scope of this element.

The textStyle Element

The textStyle element is used to define a set of text style attributes in the document head section. The style group defined with this element may be used within a SMIL layout region to define default styles for text elements in that region, or within the smilText and span in-line content elements in a SMIL body section.

Element attributes

All of the styling attributes defined in this module (with the exception of the textStyle attribute) may be specified within a textStyle element in the head section. Note that if text style attributes are referenced on an element to which they do not apply, they are ignored. If multiple instances of the same styling attribute are defined, the value associated with the lexically-last instance are used.

In addition, this attribute defines:

IDREF
The ID of the textStyle definition.
Element content

This element has no content.

The textStyling Element

The textStyling element delineates a set of textStyle elements in the document head section.

Element attributes

This attribute accepts no attributes.

Element content

This element contains one or more textStyle elements as children.

The textAlign Attribute

The textAlign attribute specifies how text is aligned within the region specified by the text element. This attribute may be used on the smilText element or as a default on the region element. The semantics of this attribute are a subset of those defined in XSL 1.1, ([XSL11], section 7.16.9).

Values:

start
The text is left-aligned in the region if the effective value of the textDirection attribute is ltr, or right-aligned otherwise.
end
The text is right-aligned in the region if the effective value of the textDirection attribute is ltr, or left-aligned otherwise.
left
The text is left-aligned in the region.
right
The text is right-aligned in the region.
center
The text is centered in the region.
inherit (default)
The effective value defined for the region is used.

If no value is defined, the default value will be start.

The textBackgroundColor Attribute

The textBackgroundColor attribute is identical to the "background-color" property in the XSL 1.1, ([XSL11], section 7.8.2) specification. As such, support for CSS2 system colors is required. This attribute specifies the background color used to fill the area around text content that falls within a player-defined bounding box. This attribute may be used on the smilText, div, p or span elements, or as a default on the region element.

Values:

CSS2 color specification
The textBackgroundColor attribute may take on the CSS value inherit. This means that the background color used for text will be that of the backgroundColor attribute defined for the region specified by the parent text element.

If no color has been specified, the default is transparent.

The textColor Attribute

The textColor attribute is identical to the "color" property in the XSL 1.1, ([XSL11], section 7.18.1) specification. As such, support for CSS2 system colors is required. This attribute specifies the color used to render text content in the region specified by the parent text element. This attribute may be used on the smilText, div, p or span elements, or as a default on the region element.

Values:

CSS2 color specification
The textColor attribute may take on the CSS value inherit. This means that the color used for text will be that of the color attribute defined for the region specified by the parent text element. If no color has been specified, the default is transparent.

If no color has been specified, the default is transparent.

The textDirection Attribute

The textDirection attribute specifies the direction of text added to a region based on the Unicode Bidirectional algorithm. The semantics defined in XSL 1.1, ([XSL11], section 7.29.1) are available, with the restriction that smilText only supports simple text direction control; for more elaborate text processing (including tb-lr), an external text formatting language is required. This attribute may be used on the smilText, div, p or span elements, or as a default on the region element.

Values:

ltr
The text is written in a left-to-right direction
rtl
The text is written in a right-to-left direction
inherit (default)
The text is written in the direction defined for the region referenced in the text element.

If no direction was defined, the default is ltr.

The textFontFamily Attribute

This attribute defines the family of font used to render text. The resolution of a generic family name to a specific font instance is not defined by this specification, but may be defined by a profile implementing this module. In order to reduce implementation burden, only generic font families may be specified in smilText. If an unrecognized font family is defined, then monospace can be expected. The sansSerif and serif fonts are expected to be proportional. See XSL 1.1, ([XSL11], section 7.9.2) for font family details. This attribute may be used on the smilText, div, p or span elements, or as a default on the region element.

Values:

monospace
sansSerif
serif
inherit (default)

If no value is defined, the default textFontFamily will be sansSerif.

The textFontSize Attribute

This attribute defines the size of the font to be used. In order to reduce implementation burden and to provide scalability across device classes, only absolute and relative sizes (as defined in XSL 1.1, ([XSL11], section 7.9.4) are supported by smilText. This attribute may be used on the smilText, div, p or span elements, or as a default on the region element.

Values:

length
absolute-size
absolute-size represents a set of absolute font sizes, maintained by the SMIL player (and possible influenced by the player user agent). Expected absolute sizes are: [ xx-small | x-small | small | medium | large | x-large | xx-large ]. As recommended in XSL 1.1, it is expected that each of the absolute sizes will differ by a factor of 1.2. The default absolute size is medium.
relative-size
relative-size represents a relative increase or reduction in the absolute font size value. Expected values are: [ larger | smaller ]. Effective font sizes larger than the absolute-size xx-large or smaller than the absolute-size xx-small will not be supported.
inherit (default)

If no value is defined, the default textFontSize will be medium.

The textFontStyle Attribute

This attribute defines the style (italic, oblique, reverseOblique or normal) of the text displayed. If the specified style is not available, a style of normal will be used. This attribute may be used on the smilText, div, p or span elements, or as a default on the region element. Of the values defined in XSL 1.1, ([XSL11], section 7.9.7), only the options defined in the following list will be supported by smilText.

Values:

normal
italic
oblique
reverseOblique
inherit (default)

If no value is defined, the default textFontStyle will be normal.

The textFontWeight Attribute

This attribute defines the weight (bold or regular) of text displayed. If the specified weight is not available, a weight of normal will be used. This attribute may be used on the smilText, div, p or span elements, or as a default on the region element. Of the values defined in XSL 1.1, ([XSL11], section 7.9.9), only the options defined in the following list will be supported by smilText.

Values:

normal
The normal font weight for the font family selected is used.
bold
The bold font weight for the font family selected is used.
inherit (default)
The effective font weight for the font family selected, as defined on the text element or the referenced region, is used.

If no value is defined, the default textFontWeight will be normal.

The textMode Attribute

The attribute defines the manner in which each temporal fragment is added to the rendering area. This attribute may be used on the smilText element or as a default on the region element.

Values:

append
New content is added to any existing content in the rendering area. The new content is appended to the text at the logical end of the display.
replace
New content replaces any existing content in the rendering area. The new content becomes the only content within the display.
inherit (default)
The effective textMode for the region selected, as defined on the smilText element or the referenced region, is used.

If no value is defined, the default textMode will be append.

This section is informative.

The textStyling module extends the single default value of append defined by the BasicText module with replace and inherit. Note that the textMotion module further extends this attribute with values that specify how text movement is controlled.

The textPlace Attribute

The attribute defines where content is initially placed in a rendering area, both as an initial string and after a clear operation. This attribute may be used on the smilText element or as a default on the region element.

Values:

fromTop
New content in an empty region is placed first at the top of the rendering area, and then flowed downward as new content is added.
fromBottom
New content in an empty region is placed first at the bottom of the rendering area, and then moved upward as new content is added.
inherit (default)
The effective textPosition for the region selected, as defined on the smilText element or the referenced region, is used.

If no value is defined, the default textPlace will be fromTop.

The textStyle Attribute

The attribute references a text style set defined using the textStyle element in the document head. This attribute may be used on the smilText, div, p or span elements, or as a default on the region element.

Values:

IDREF
The ID of a textStyle definition. If the IDREF specified as a value does not refer to a valid textStyle set definition, this attributed is ignored.

The textStyle attribute will be applied only to the content within the scope of the element to which it is applied.

Examples

This section is informative.

The following example provides an indication of the use of smilText within a profile that provides support for the TextStyling module (such as the SMIL 3.0 Language profile).

00 <smil ...>
01  <head>
     ...
02    <textStyling>
03      <textStyle id="HeadlineStyle" textFontFamily="serif" textFontSize="12px" 
             textFontWeight="bold" textFontstyle="italic"          
             textWrapOption="noWrap" textColor="blue" textBackgroundColor="white">
04    </textStyling>
05    <layout>
06      <region id="Title" top="5px" left="10%" width="80%" height="25px"
             textStyle="HeadlineStyle" />
07      <region id="Captions" top="215px" left="10%" width="80%" height="35px" 
          textFontFamily="serif" textColor="orange"  backgroundColor="blue"/>
08      <region id="Slides" top="10px" left="5%" width="90%" height="200px" />
09    </layout>
10   </head>
11   <body>
      ...
12    <par>
13     <smilText region="Title" textFontfamily="sansSerif" fill="freeze">
14        Willemijn's 11th Birthday Party
15     </smilText>
16     <seq>
17       <par>
18         <img region="slides" src="p001.jpg" begin="1s" dur="9s"/>
19         <audio region="sound" src="yip.mp3" begin="woof.beginEvent"/>
20         <smilText region="Captions" textAlign="left" dur="8s">
21              Shortly <span textFontStyle="italic">before</span> dawn ...
22              <tev next="1.5s"/>
23              <div textAlign="center" textColor="green">
24              just as the clock began
25              </div>
26              <br/>
27              to chime six times...
28              <tev begin="4s"/>
29              our trusty dog Gretchen
30              <tev id="woof" begin="3s"/>
31              barked. 
32         </smilText>
33       </par>
         ...
34       <par>
35         <img region="slides" src="p128.jpg" dur="7s"/>
36         <text region="Captions" src="c128.html" dur="7s"/>
37       </par>
38     <seq>
39     <audio src="Commentary.mp3" />
40    </par>
41   </body>
42 </smil>

In this example, one text style is defined (on line 03) and three layout regions are defined, one of which (on line 06) references a style definition with local overrides, and another of which (on line 07) uses mostly default style. In the body of the presentation, a parallel container is defined that contains a text title (on line 13); most of the styling attributes are defined on the region via the text style attribute. Later in the presentation, a sequence of images are defined that are each accompanied by one or more text captions. The text definition on line 13 illustrates that text, like images, has no inherit duration, but that by using the SMIL fill attribute, the content of the smilText element remains visible until the end of the parent time container (in this case, the par that is defined on line 12). The three smilText fragments that accompany the image defined on line 18 illustrate that the in-line text object can use the standard SMIL timing attributes, plus several new attributes to explicitly control text placement and styling. A beginEvent can be generated by a text fragment and used to control some other portion of the presentation, as is shown in line 30'w triggering of the sound on line 19. Finally, the text element on line 35 illustrates that it is possible to mix in-line and external text in a single document.

8.4.2 Integration Requirements

This section is normative.

None.

8.5 SMIL 3.0 TextMotion Module

This section is normative.

This section defines the elements and attributes that make up the SMIL TextMotion Module. Languages implementing the elements and attributes in the TextMotion Module must implement all elements and attributes defined below, as well as those defined in the BasicText and TextStyling modules.

8.5.1 Elements and Attributes

This section defines the elements and attributes that make up the functionality in the SMIL 3.0 TextMotion module.

This module does not define any new elements.

This module defines one new attribute and extends the values available for one attribute in the TextStyling module:

textMode
textRate

This module extends the definition of one element from the BasicText module and one element TextStyling module:

smilText
textStyle

This module extends the definition of two attributes from the TextStyling module and adds a new attribute to this module:

textMode

In addition:

  1. this module extends the definition of the BasicText smilText element to include the textRate attribute;
  2. this module extends the definition of the TextStyling textMode attribute to include the crawl, scroll and jump attribute values; and
  3. this module extends the definition of the SMIL Layout region element to include the textRate attribute.

The textMode Attribute

The textMode is extended to support three values for motion-based text presentation of a smilText object. These values may be used on the smilText element or as a default on the region.

Values:

crawl
This setting causes text to move as a single line against the logical writing direction defined by the textDirection attribute. The starting position of the text will be determined by the textAlign attribute. All line breaks, either implicit or explicit, will be ignored.
scroll
This setting causes text to move smoothly upward within the region. The initial position of the text is defined by the textPlace attribute. The alignment of the text is determined by the textAlign attribute.
jump
This setting causes text to jump upward by line within the region when the current line fills (or after an explicit br). The initial position of the text is defined by the textPlace attribute. The alignment of the text is determined by the textAlign attribute.

In all cases, the rate of movement is determined by the textRate attribute.

The textMode will be applied to all text displayed in the region.

The textRate Attribute

The textRate specifies the rate of motion of smilText elements that have either the crawl, scroll or jump value defined for the textMode attribute. These values may be used on the smilText element or as a default on the region.

Values:

CSS2 pixel | non-negative percentage value | non-negative integer value
The value uniquely specified the motion rate for the corresponding textMode attribute. The value is defined as follows:
CSS2 pixel value:
This value is used when textMode is set to crawl or scroll. This value defines a non-negative integer representing a pixel movement rate in pixels per second. If the textMode is set to crawl, the default value of this attribute is 0px. The "px" unit qualifier in pixel values may be omitted.
non-negative percentage value:
This value is used when textMode is set to crawl or scroll. This value defines a non-negative percentage value representing the pixel movement rate as a percentage of the simple duration of the total smilText element. When a percentage value is used, all internal timing within the smilText object is ignored, including the setting of event that are triggered by the smilText element. If the simple duration is not known, implementations may make an informed guess or provide a default rate. The use of this value is discouraged when the duration is not specified explicitly on the smilText element. If the textMode is set to scroll, the default rate is 0% of the object's simple duration.
non-negative integer:
This value is used when textMode is set to jump. This setting defines a non-negative integer representing the number of lines to jump when adding new content. Text movement is initiated when a line break is generated by the smilText object, either explicitly or implicitly. If the textMode is set to jump, the default line jump value is set to 1.

If the textMode is set to anything other than crawl, scroll or jump, this attribute is ignored.

Examples

This section is informative.

The text motion rendering behavior of within this module has been designed to be relatively simple to implement and stay consistent with other forms of scrollable/crawlable text. The following example illustrates the use of the attributes and attribute values defined in this section.

 <smil ...>
  <head>
     ...
    <layout>
        ...
      <region id="Contents" top="5px" left="10%" width="80%" height="300px"
             textMode="crawl" textRate="20px" />
    </layout>
   </head>
   <body>
      ...
        <smilText id="TS21" region="Contents" textAlign="right">
           Willemijn's 11th Birthday Party
           <tev begin="5s"/>
           was held six weeks late.
           <tev next="5s"/>
           (Again!)
        </smilText>
         ...
   </body>
 </smil>

This example displays a crawling text string that is initially aligned at the right of the display. The text crawls across the screen in a direction that is opposite to the (in this case default) textDirection of left-to-right. Initially, only the first fragment is visible. After 5 seconds, the entire portion of the second fragment is made visible; note that a portion may be initially clipped from view. After another 5 seconds, the final fragment is added to the text display.

8.5.2 Integration Requirements

This section is normative.

Any profile that integrates the textRate attribute must specify whether a scroll value of 100% causes all of the text to be scrolled out of the visible rendering area.

8.6 Appendices

This section is informative.

8.6.1 Appendix A: Differences with the DFXP Specification

While smilText has been modelled as a functional subset of the "Distribution Format Exchange Profile" [DFXP] of W3C Timed Text, there are several differences between the languages. In this section, we review the components taken from DFXP, the components not taken from DFXP and the extensions defined that are not in DFXP.

Components Taken From DFXP for smilText

The following elements and attributes have been taken from DFXP [DFXP] and are included in smilText. Note that relevant attribute names from DFXP are preceded with 'text' to avoid conflict with attributes used in SMIL layout.

Component DFXP Name smilText Name Differences
Content br
div
p
span
br
div
p
span
The br element is identical in use.
The div and span elements may not be nested in smilText. The div, p and span elements may not contain timing markup in smilText.
Styling elements style
styling
textStyle
textStyling
These elements are declared in the document head.
smilText allows styles to be associated with layout regions as default values.
Styling attributes textAlign
BackgroundColor
Color
Direction
FontFamily
FontSize
FontWeight
Style
WrapOption
textAlign
textBackgroundColor
textColor
textDirection
textFontFamily
textFontSize
textFontWeight
textStyle
textWrapOption
smilText limits the range of values permitted for some of these attributes. The basic functionality is the same in all cases.

Components Not Taken From DFXP for smilText

The following elements and attributes are not included in smilText.

Additions in smilText Not in DFXP

The following elements and attributes are included in smilText but are not directly available in DFXP [DFXP]:


previous   next   contents