Movatterモバイル変換


[0]ホーム

URL:


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.1Changes for SMIL 3.0

This section is informative.

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

8.2Introduction

This section is normative.

The functionality described in these modules provide a new media type foruse in SMIL presentations. This functionality is called smilText. Unlikeother media types defined in themedia object module, all of whichare synonyms of theref element, thesmilText modules provide a text container element with an explicit contentmodel for defining timed text. The smilText modules also define a set ofadditional elements and attributes to control timed text rendering. AllsmilText content is processed in a manner consistent with other SMIL media.This means, among other aspects, that smilText respects SMIL timing andlayout behavior, including the semantics of the fit and fill attributes ofSMIL Layout.

The smilText Modules are composed of aBasicText module and two modules withadditional functionality that build on top of the BasicText module: theTextStyling andTextMotion modules. These modules containelements and attributes used to define in-line text content. TheSmilText profile allows smilText to be usedas an external format; this is described informally inAppendix B.

Since the smilText elements and attributes are defined in a series ofmodules, designers of other markup languages may reuse these modules whenthey wish to include a simple form of timed text functionality into theirlanguage.

8.2.1Motivation

This section is informative.

The purpose of including text content functionality into SMIL 3.0 is toallow authors to define small amounts of lightly-formatted text containingembedded temporal markup within the context of a SMIL presentation. Such textmay be used for labels within a presentation or for incidental captions orforeign-language subtitles. Users who wish to use large amounts of structuredtext (with or without temporal markup) should consider the use of smilText asan text media object, or the use of objects encoded in formats such as XHTMLor the "Distribution Format Exchange Profile" (DFXP) of Timed Text[DFXP].

All versions of SMIL have had support for thetext element, which is defined as an alias ofthe generic SMILref media referenceelement. 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 havea content model -- that is, an ability to specify the content text along withthe 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-linetext 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 stylingoptions available, make it a less-than-optimal way of including incidentaltext content into a SMIL presentation. A more author-friendly approach totext inclusion was a requirement for SMIL 3.0.

The implementation of SMIL on a wide range of devices, from set-top boxesand mobile devices to conventional desktop computers, means that care neededto be taken in defining the complexity of the smilText modules. Themotivation of the SMIL's in-line text facility was not to provide completesupport for all types of text, but to provide a balance between authoringconvenience and player complexity. smilText was also designed todifferentiate text styling from general layout and positioning so thatsmilText could be used efficiently with SMIL Layout. Both of thesemotivations, plus the desire to define a media facility that could be usedacross all of SMIL's implementation platforms, has resulted in a simple textspecification that meet many of the requirements for incidental text within aSMIL document.

smilText has been designed as a functional subset of the W3C Timed TextDistribution Format Exchange Profile (DFXP) of TimedText. While usersfamiliar with DFXP will recognize the functionality included in thisspecification, the differences in temporal and layout specifications betweenSMIL and DFXP have resulted in a slightly different syntax in the twolanguages. The SYMM working group has striven to minimize these differences.A complete list of differences between smilText and DFXP is presented inAppendix A.

8.2.2The smilText RenderingModel

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 durationdefined by timing mark-up within the smilText definition. All text content isprocessed as if it were first rendered to an off-screen bitmap; this bitmapis then used as the basis for inclusion into a SMIL presentation much as ifit 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 representationof smilText will depend on a number of factors. In general, the layout modelused to define a drawing area for the text content will provide initialvalues for the extents of the text area. The default text-wrap behavior forsmilText is to wrap the text content based on region width. In this case, theregion will determine the text-area width and the text content will determinethe effective off-screen bitmap height. If the wrap behavior is set todisallow automatic text wrapping (which is only possible if the TextStylemodule is supported by the profile implementing smilText), the effectiveheight is determined based on the number of lines of text (which in turn isdetermined by the number of manual line breaks created via thebr element) and constrained by the regionheight, while the text content determines the off-screen bitmap width.

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

When used as anexternal format,a smilText object consists of a smil host-level identifier with a smilTextbase profile, and a set of dimensioning and temporal parameters. With theexception of event processing, the functionality of embedding a smilTextobject as an in-line element in a SMIL presentation and storing it in anexternal object in a separate file is identical.

8.3SMIL 3.0 BasicText Module

This section is normative.

This section defines the elements and attributes that make up thefunctionality in the SMIL 3.0 BasicText module. Languages implementingelements and attributes found in the BasicText Module must implement allelements and attributes defined in this section.

8.3.1 Elements andAttributes

The SMIL 3.0BasicText module definesfour elements and four attributes which, together, provide basic support forin-line text within a SMIL presentation. The functionality provided by theseelements and attributes represent the minimum level of text processing thatis 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
textWrapOption
xml:space

In addition, this module extends the definition of the SMIL Layoutregion element to include thetextWrapOption attribute.

Note that unless overridden by the profile integrating these modules, allsmilText elements will also reference thexml:id,xml:lang and ITS attributes to specifythe identity and the language used in a particular text fragment.

For profiles that support only theBasicText module, all in-line text contentstyling and processing is defined and controlled by the SMIL user agentrendering the text. Additional content styling elements and attributes aredefined in theTextStyling andTextMotion modules; support for thisextended functionality is profile dependent.

For implementations that support the use of smilText as an externalobject, a separate rendering agent will control the processing of smilTextcontent. Depending on the implementation of this agent, functionality in theTextStyling andTextMotion modules may be available.Functionality defined in theBasicTextmodule must be supported.

ThesmilTextElement

ThesmilText element functionsas a logical and temporal structuring element that allows the inclusion ofin-line text content into a SMIL presentation.

When rendering in-line text, thesmilText element provides a top-levelcontainer for timing semantics. Additional timing semantics may be defined onthe content within thesmilTextelement. When rendering text specified in an external file, thesmil element together with the smilTextbaseProfile attribute value provides atop-level container for text content. As defined within the SmilText profile,default timing and spatial characteristics may be defined on the externalsmilText encoding; when embedded as a media object in a SMIL presentation,these default characteristics will be overridden by the effective values ofidentical attributes specified on the media object reference in the SMILpresentation.

When text is rendered into an associated region, the existing content ofthe region is replaced by the element content. The properties of the regionwill determine the extents of the rendering area and the clipping behavior oftext placed in the region. The effective value of thetextWrapOption attribute willdetermine if lines wrap if they are wider than the space provided. In-linetext is considered to be rendered instantaneously at the beginning of thesimple duration of the text element unless temporal markup using thetev orclear elements is defined within thetext. In smilText, extra white space between characters is processedaccording to the xml:space model defined in XML 1.1[XML11]. The xml:space attribute is reused insmilText, with the conventional semantics described in the sectionxml:space, below.

Anchors and links, if supported by the profile integrating this module,may be attached to content within thesmilText element. In these cases, thesyntax and semantics of SMIL Linking will be expected, including temporalattributes on anchors.

Element attributes

This element accepts thetextWrapOption andxml:space attributes, which willoverride the effective value for these attribute defined on the layoutregion.

Profiles including thesmilTextelement must define which other SMIL attributes may be attached to thiselement. At a minimum, the definition of an associated layout region (forin-line use) or the definition of a height/width of the rendering area (forexternal use), and basic SMIL timing control, including the definition of abegin and end or duration, will be expected.

Element Content

ThesmilText element containsmixed content. The profile integrating this element will define a contentmodel. If character content is present, it will be rendered as text in amanner consistent with other elements and attributes in this module. Theintrinsic duration of asmilTextelement ends as soon as the last resolvedtev orclear element is processed. If asmilText element does not contain anyinternal timing, then the simple duration will be determined by timing markupon the element itself. If no content is present, thesmilText element must still observe allSMIL timing properties.

Thetev Element

Thetev element defines a"temporal moment" within a block of smilText content. Depending on the valuesof thebegin ornext attributes, it determines ascheduling time at which the associated text content (up to the followingtev orclear element or the end of thesmilText element) is rendered. Thetev element does not define a contentcontainer, but is simply a temporal marker within a text fragment.

Element attributes

This element accepts thebeginandnext attributes. Profilesincluding thetev element mustdefine which other SMIL attributes will be attached to this element.

Element content

This element has no content.

TheclearElement

Theclear element defines a"temporal moment" within a block of smilText content at which the fullcontents of the rendering area are cleared. Depending on the values of thebegin ornext attributes, it also determines ascheduling time at which the associated text content (up to the followingtev orclear element or the end of thesmilText element) is rendered. Thiselement is functionally equivalent to thetev element, except that it has aside-effect of clearing the rendering area before any new content isrendered. This element does not define a content container, but is simply atemporal marker within a text fragment.

Element attributes

This element accepts thebeginandnext attributes. Profilesincluding theclear element mustdefine which other SMIL attributes will be attached to this element.

Element content

This element has no content.

Thebr Element

Thebr element functions as a forcedline break within in-line content defined in asmilText element. Thebr element is only valid within as content of asmilText element and has notemporal semantics other than those of its parent smilText element.

Element attributes

This element does not accept any attributes beyond those specified by theprofile.

Element content

This element has no content.

ThebeginAttribute

This attribute defines an absolute time, relative to the beginning of the parentsmilText element, when the associatedtev orclear element becomes active. Within a single element, absolute begin times are expected to be specified in temporal order. If this is not the case, the associatedtev orclear element becomes active as soon as the previous fragment is activated.
The attribute value is a semi-colon separated list of begin-values.
For in-line use of smilText, the values of the begin attribute are:
begin-value : ( clock-value | ed-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 supported. The use of offsets based on scheduled activation of other elements is not supported. All support for event timing is optional and not required. If event timing cannot be supported, the associated time will be ignored.


When used as an external container format, the attribute value is a single clock valued, defined as follows:

begin-value : clock-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.

The general semantics of this element are the same as the SMIL beginattribute defined within the timing module, with the restriction that onlythe subset of potential time values defined above are supported.

If both a begin and next attribute are defined on anytev/clear elements, only the begin attributewill be recognized.

ThenextAttribute

Thenext attribute defines a relative start time, relative to the effective begin time of the parentsmilText element, or the most recently activatedtev orclear element within the parent.
The attribute value is a 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.

If both a begin and next attribute are defined on anytev/clear elements, only the begin attributewill be recognized.

ThetextWrapOption Attribute

ThetextWrapOption attribute specifies whether text content that is larger than the effective space available on one line in a region wraps. Given the complexities of general support for line breaking in different languages, smilText only guarantees implementation-dependent, best effort support for determining appropriate line break points.

Values:

wrap (default)
Text is wrapped across lines within a region: content that extends beyond the logical boundary of the rendering region will be displayed across multiple lines or columns.
noWrap
Text is not wrapped across lines within a region: content that extends beyond the logical boundary of the rendering region will be truncated in an implementation-dependent manner.
inherit
The effective value is used, as defined by the initial value or an override value.

The initial value is set towrap.

Unless otherwise defined by the profile integrating this attribute, it may be used on thesmilText element or as a default on theregion element.

This section is informative.

Since smilText is expected to be supported by a wide range of rendering agents, the behavior associated with text wrapping is defined to be best-effort. In general, rendering agents are encouraged to support text wrapping as defined by DFXP[DFXP].

Thexml:spaceAttribute

Thexml:space attribute specifies how whitespace and linefeeds are processed.

Values:

default (default)
Whitespace is collapsed according to the semantics defined byXML 1.1, ([XML11] section 2.10).

As with DFXP, smilText processing with an effective value forxml:space ofdefault must occur as if the following XSL 1.1[XSL11] properties were specified:

  • suppress-at-line-break="auto"

  • linefeed-treatment="treat-as-space"

  • white-space-collapse="true"

  • white-space-treatment="ignore-if-surrounding-linefeed"

preserve
Whitespace is preserved according to the semantics defined byXML 1.1, ([XML11], section 2.10).

As with DFXP, smilText processing with an effective value forxml:space ofpreserve must occur as if the following XSL 1.1[XSL11] properties were specified:

  • suppress-at-line-break="retain"

  • linefeed-treatment="preserve"

  • white-space-collapse="false"

  • white-space-treatment="preserve"

This attribute may be used on thesmilText element or as a default on theregion element. In general, smilText does not add white space into a text string unless explicitly authored.

Evaluation of begin and endtime lists

AsmilText object is defined asa collection of text characters that may have one or more timing markersinserted in the text. The markers allow incremental appearance of textfragments.

In its most simple form, asmilText element contains a block of textthat is displayed in its entirety at the effective start time of the element.This behavior is logically equivalent to placing aclear element with a begin time of '0'at the start of thesmilTextelement.

It is possible to insert one or moretev elements within thesmilText content. Each of these elementsspecify an absolute or relative starting time for the text immediately afterthetev element. The text isdisplayed instantaneously up to the followingtev element. If aclear element is used, any contentwithin the associated rendering region is erased before the new text isdisplayed.

Thenext attribute defines arelative offset as the start time of the associatedtev orclear element. This time is defined asbeing relative to the effective start time of the precedingtev (orclear) element -- or from the start ofthesmilText element if noprecedingtev/clear element was defined. The effectivestart time is the time that the preceding element actually was activated,either by a resolved time value or in response to an event.

The intrinsic duration of asmilText element is one of thefollowing:

Examples

This section is informative.

In-Line Use of smilText

ThesmilText element provides atemporal wrapper for in-line text:

    <smilText>       Hello world!    </smilText>

ThesmilText element is theequivalent of allowing a data URL that contains text content, such as:<ref src="data:,Hello%20world!" ... > . Notethat since this example does not define explicit temporal markup on thesmilText element, the intrinsic duration will be zero seconds. The fillsemantics of the embedding SMIL content will determine the visual persistenceof the content.

In this simple form, the text will be rendered based on the default layoutproperties defined for the user agent. If SMIL Layout is used, the defaultbehavior is that a dynamic region will be defined that contains the textcontent 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 profileimplementing this module, the rendering extent and the clipping behavior ofthe text rendered in a SMIL region will be determined by the effective valueof SMIL's layout attributes.

<smil ...> <head>   ...   <layout>     ...     <region xml:id="Title" top="5px" left="10%" width="80%" height="30px" />     ...   </layout>  </head>  <body>   ...    <smilText region="Title" dur="10s">       Hello World!    </smilText>   ...  </body></smil>

This is equivalent to specifying:<refregion="Title" src="data:,Hello%20world!" ... >. In both cases, theproperties associated with the region namedTitle will be used whenpositioning the text.

If the rendering space for the content of the smilText element is greaterhorizontal extent of one line, the effective value of thetextWrapOption attribute willdetermine whether content will be clipped or wrapped:

<smil ...> <head>     ...     <region xml: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 thebr 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 smilTextelement that contains an explicit duration:

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

The smilText element TS01 is active for 6s. All activity occurs withinthis time period, even if the timing definition within the smilText objectextends 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 contentif its internal timing was shorter than that of the smilText object.

The initial content that is rendered is the stringWillemijn's 11thBirthday Party. At 2s after the start of the TS01 container, thefragment with id TS02 gets rendered. In this case, the contentwas heldsix weeks late. is displayed along with the previous contents of thesmilText element. (The exact display depends on the size of the renderingregion and the setting of the textWrapOption attribute.)

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

The following fragment is similar to the previous example, except that itillustrates use of temporal markers with a smilText element that does notcontain an explicit duration (and in which the duration is dependent on theintrinsic duration of the smilText content):

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

The smilText element TS04 is active for a duration that is determined byits content. All activity occurs within this time period. Note that in thisexample, this may lead to an unexpected result.

The initial content that is rendered is the stringWillemijn's 11thBirthday Party. At 2s after the start of the TS05 container, thefragment with id TS02 gets rendered. In this case, the contentwas heldsix weeks late. is displayed along with the previous contents of thesmilText element.

At 4s after the start of the parent smilText container, the fragment withthe id TS06 is displayed. The use of the clear element causes the displayarea to be erased before the new text is displayed. All of the text that isdefined to be rendered at this instance is placed into the region, but afterthis the smilText element ends: no additional timing markup has been providedto extend its intrinsic duration. Thefill semantics associated withthe smilText element will determine the visual persistence of the content, ifany.

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

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

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

The following example illustrates the interaction of timing rules withinsmilText:

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

The TS31 smilText element starts, and 'fragment 1,' is rendered. Then, 2slater, TS32 is appended to the displayed text. At the same time, TS33 isappended to the display: it has an absolute begin time of 1s after the startof 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 ofits predecessor), so the associated fragment will be displayed if the eventis triggered between 2s and 10s in the presentation. TS35 is displayed 5safter the effective start of TS34 (assuming the parent smilText container isstill active). The effective begin time of TS36 will depend on a number offactors: if the TS35 fragment starts before an absolute 8s, TS36 will waituntil 8s. If it starts later (but before the end of the smilText container),the fragment will start immediately.

External Use of smilText

It is possible to define an external file with timed text content usingsmilText semantics. The capabilities of such an external use are defined inthe SmilText profile. A full SMIL rendering agent is not required to renderthe smilText content.

The following example shows an external encoding of smilText content:

                  <smil xmlns="http://www.w3.org/ns/smil" version="3.0" baseProfile="smilText"              height="50" width="30" dur="6s">         <body>           Willemijn's 11th Birthday Party           <tev xml:id="TS12" next="2s"/>           was held six weeks late.           <clear xml:id="TS13" begin="TS14.beginEvent"/>           (Again!)         </body>        </smil>

The external file (which in this example we assume is named"external.smil"), may be referenced by any smilText-complaint renderingagent. If that rendering agent is a SMIL 3.0 player, then the followingreference to the text file may be used:

     ...     <par>        <textstream src="external.smil" dur="10s" width="40" region="Contents" >        <audio xml:id="TS14" begin="4.5s" src="gongAudio.mp3">     </par>     ...

In this example, the source smilText file is defined as proscribed by theSmilText profile. It contains a namespace declaration for smil plus thesmilText base profile definition, as well as default values for height, widthand duration. The SMIL fragment shown next illustrates a <par>containing an audio object and atextstream object that references thesmilText encoding. The SMIL-based reference overrides the width specificationgiven in the smilText source file. The smilText duration is treated as theintrinsic duration of the object; the duration is extended in the SMIL filein a manner similar to the reference of a video object.

Fill Semantics ofsmilText

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

Layout and Rendering Consequences of smilText

In terms of visual behavior, the value of the fit attribute will determineclipping behavior of the text. Since not all user agents may be expected todynamically scale plain text, fit="slice" will be the expected defaultbehavior with basic smilText.

In terms of the rendering semantics defined in theTextStyling module, the only behaviordefined by basic smilText is theappend text modesemantic.

8.3.2IntegrationRequirements

If the including profile supports the XMLBase functionality[XMLBase], the values of thelongdesc attribute (of present) on thesmilText element must beinterpreted in the context of the relevant XMLBase URI prefix.

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

Any profile that integrates theclear element must define what is meantby "display area" and further define the interaction.

A profile integrating this module will define the event names generatedwhen named elements are activated in smilText. Unless overridden by theprofile, eachtev andclear element must raise an event namedtevEvent. This event must also be raised at thestart and end of thesmilTextelement; thesmilText element mustalso raise the standardbeginEvent andendEvent events.

8.4SMIL 3.0 TextStyling Module

This section is normative.

This section defines the elements and attributes that make up the SMILTextStyling Module. Languages implementing the elements and attributes in theTextStyling Module must implement all elements and attributes defined below,as well as those defined in theBasicTextmodule.

8.4.1 Elements andAttributes

The TextStyling module defines the following five elements:

div
p
span
textStyle
textStyling

The TextStyling module defines the following twelve attributes:

textAlign
textBackgroundColor
textColor
textDirection
textFontFamily
textFontSize
textFontStyle
textFontWeight
textMode
textPlace
textStyle
textWritingMode

In addition, for in-line use of smilText, this module extends thedefinition of the SMIL Layoutregionelement to include the TextStyling attributes listed above.

Since smilText is designed to be implemented on a wide range of renderingagents, not all agents may be expected to support all of the stylingattributes defined in this section. If a given attribute is not supported, animplementation-dependent behavior may be substituted by the renderingagent.

Thediv Element

Thediv element functions as alogical container for in-line formatting attributes defined within asmilText element. Thediv element does not define any temporalsemantics within a smilText element. Use of thediv element causes an implicit line breakbefore the rendering of the element. User agents may supply an additionalline of white space.

Element attributes

Unless otherwise defined by the profile integrating this module, thediv element may (re)specify values for thefollowing attributes:

textAlign
textBackgroundColor
textColor
textFontFamily
textFontSize
textFontStyle
textFontWeight
textStyle
textWrapOption
textWritingMode
xml:space

Unless specified otherwise by the profile integrating this element, theprofile's core attributes may also be used. All other attributes areignored.

Element content

Unless overridden by the profile integrating this module, this elementaccepts mixed content including zero or more characters to which thespecified styling is applied. Any styling attributes changed within the scopeof this element must be restored to their previous values outside the scopeof this element. The content accepted by this element is defined by theprofile integrating this module.

Thep Element

Thep element functions as alogical container for in-line formatting attributes defined within asmilText ordiv element. Thep element may not be nested within anotherp element. Thep element does not define any temporalsemantics within a smilText element. The use of thep element causes an implicit line break.User agents may supply an additional line of white space after the implicitline break. Any extra empty lines may be merged with empty lines produced bythediv element on a best-effortbasis.

Element attributes

Unless defined otherwise by the profile integrating this module, thep element may (re)specify values for thefollowing attributes:

textBackgroundColor
textColor
textFontFamily
textFontSize
textFontStyle
textFontWeight
textStyle
textWrapOption
textWritingMode
xml:space

Unless specified otherwise by the profile integrating this element, theprofile's core attributes may also be used. All other attributes areignored.

Element content

Unless otherwise specified by the profile integrating this module, thiselement accepts mixed content, including zero or more characters to which thespecified styling is applied. Any styling attributes changed within the scopeof this element must be restored to their previous values outside the scopeof this element. The content accepted by this element is defined by theprofile integrating this module.

Thespan Element

Thespan element functions as alogical container for in-line formatting attributes defined within asmilText,div, orp element. Thespan element does not define any temporalsemantics within a smilText element. The use of thespan element does not cause a line break nordoes it insert any white space before or after the scope of the element.

Element attributes

Unless specified otherwise in the profile integrating this module, thespan element may (re)specify values forthe following attributes:

textBackgroundColor
textColor
textDirection
textFontFamily
textFontSize
textFontStyle
textFontWeight
textStyle
xml:space

Unless specified otherwise by the profile integrating this element, theprofile's core attributes may also be used. All other attributes areignored.

Element content

Unless overridden by the profile integrating this module, this elementaccepts mixed content, including zero or more characters to which thespecified styling is applied. Any styling attributes changed within the scopeof this element must be restored to their previous values outside the scopeof this element. The content accepted by this element is defined by theprofile integrating this module.

ThetextStyleElement

The textStyle element is used to define a set of text style attributes inthe document head section. The style group defined with this element may beused within a SMIL layout region to define default styles for text elementsin that region, or within the smilText content elementssmilText,div, andp.

Element attributes

All of the styling attributes defined in this module (with the exceptionof thetextStyle attribute) may bespecified within atextStyleelement in the head section. Note that if text style attributes arereferenced on an element to which they do not apply, they are ignored. Ifmultiple instances of the same styling attribute are defined, the valueassociated with the lexically-last instance is used.

This element will use the xml:id attribute within the profile's coreattribute set to define a unique identity for the set of text styleattributes.

Element content

This element has no content.

ThetextStylingElement

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

Element attributes

Unless specified otherwise by the profile integrating this element, theprofile's core attributes may also be used. All other attributes areignored.

Element content

This element contains one or more textStyle elements as children.

ThetextAlignAttribute

ThetextAlign attribute provides a hint on how text should be aligned within the region referenced by the smilText element, based on the primary writing direction defined by thetextWritingMode attribute.textAlign attribute may be used on thesmilText anddiv elements or as a default on theregion andtextStyle elements. It is supported on a best-effort basis. The semantics of this attribute are a subset of those defined inXSL 1.1, ([XSL11], section 7.16.9).

Values:

start
The text is aligned on the starting edge of the rendering region based on the primary writing direction defined by thetextWritingMode attribute. For example, it will be left-aligned in the region if the primary writing mode is left-to-right, and it will be right-aligned in the region if the primary writing mode is right-to-left.
end
The text is aligned on the ending edge of the rendering region based on the primary writing direction defined by thetextWritingMode attribute. For example, it will be right-aligned in the region if the primary writing mode is left-to-right, and it will be left-aligned in the region if the primary writing mode is right-to-left.
left
If the primary writing direction is either left-to-right or right-to-left, the text is left-aligned in the region. It is ignored otherwise.
right
If the primary writing direction is either left-to-right or right-to-left, the text is right-aligned in the region. It is ignored otherwise.
center
If the primary writing direction is either left-to-right or right-to-left, the text is center-aligned in the region. It is ignored otherwise.
inherit (default)
The effective value is used, as defined by the initial value or an override value.

The initial value for this attribute isstart.

This section is informative.

Because of the implementation complexities of arbitrary text placement, not all text renderers may support all of the alignment operations specified by this attribute. If the selected attribute value is not supported, a renderer may substitute a player-dependent behavior.

ThetextBackgroundColor Attribute

ThetextBackgroundColor attribute is identical to the "background-color" property in theXSL 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 thesmilText,div,p orspan elements, or as a default on theregion andtextStyle elements.

Values:

CSS2 color specification
The textBackgroundColor attribute may take on the CSS valueinherit. 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 istransparent.

ThetextColorAttribute

ThetextColor attribute is identical to the "color" property in theXSL 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 thesmilText,div,p orspan elements, or as a default on theregion andtextStyle elements.

Values:

CSS2 color specification
The textColor attribute may take on the CSS valueinherit. 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 implementation dependent.

ThetextDirection Attribute

ThetextDirection attribute provides a hint on the desired horizontal direction of text within aspan. The specified direction may be overridden by the font based on the Unicode Bidirectional algorithm. This attribute is supported on a best-effort basis. The semantics defined inXSL 1.1, ([XSL11], section 7.29.1) are available, plus two attributes that allow default unicode-BIDI behavior to be overriden. Unlike XSL 1.1 and DFXP, smilText only supports this functionality within aspan element or as a default on thetextStyle element. For block-level control of text direction, see thetextWritingMode attribute.

Values:

ltr
Text is written in a left-to-right direction, unless overridden by font unicode-BIDI processing.
rtl
The text is written in a right-to-left direction, unless overridden by font unicode-BIDI processing.
ltro
Text is written in a left-to-right direction, and any font unicode-BIDI processing is explicitly overridden.
rtlo
The text is written in a right-to-left direction, and any font unicode-BIDI processing is explicitly overridden.
inherit (default)
The effective value is used, as defined by the initial value or an override value.

The initial value for this attribute isltr.

This section is informative.

Because of the implementation complexities of arbitrary text placement, not all text renderers may support all of the direction operations specified by this attribute. If the selected attribute value cannot supported, a renderer may substitute a player-dependent behavior.

In XSL and DFXP, two attributes are used to control direction and unicode-BIDI override. Given the lightweight nature of smilText, basic override behavior is supported within the textDirection attribute.

ThetextFontFamily Attribute

This attribute defines the family of font used to render text. An ordered list of specific font names and/or a generic family name may be supplied. 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. The sansSerif and serif fonts are expected to be proportional. SeeXSL 1.1, ([XSL11], section 7.9.2) for font family details. This attribute may be used on thesmilText,div,p orspan elements, or as a default on theregion andtextStyle elements.

Values:

font-list:
a prioritized, comma-separated list of font names, optionally including one or more of the generic font identifiersmonospace,sansSerif, and/orserif.
inherit: (default)
The effective value is used, as defined by the initial value or an override value.

The initial value for this attribute issansSerif. If an unrecognized or unsupported textFontFamily is specified,monospace will be expected.

ThetextFontSize 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 inXSL 1.1, ([XSL11], section 7.9.4) are supported by smilText. This attribute may be used on thesmilText,div,p orspan elements, or as a default on theregion andtextStyle elements.

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 absolute-size xx-large or smaller than the absolute-size xx-small will not be supported.
inherit (default)
The effective value is used, as defined by the initial value or an override value.

The initial value for this attribute ismedium. If a specified size cannot be support, implementations are expected to provide a best-effort substitute size.

ThetextFontStyle Attribute

This attribute defines the style (italic, oblique, reverseOblique or normal) of the text displayed. If the specified style is not available, a style ofnormal will be used. This attribute may be used on thesmilText,div,p orspan elements, or as a default on theregion andtextStyle elements. Of the values defined inXSL 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)
The effective value is used, as defined by the initial value or an override value.

The initial value for this attribute isnormal. If a particular style cannot be support, implementations may provide an implementation-dependent alternative style.

ThetextFontWeight Attribute

This attribute defines the weight (bold or regular) of text displayed. If the specified weight is not available, a weight ofnormal will be used. This attribute may be used on thesmilText,div,p orspan elements, or as a default on theregion andtextStyle elements. Of the values defined inXSL 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 value is used, as defined by the initial value or an override value.

The initial value for this attribute isnormal. If a particular weight cannot be support, implementations may provide an implementation-dependent alternative weight.

ThetextModeAttribute

The attribute defines the manner in which each temporal fragment within asmilText element is added to the rendering area. This attribute may be used on thesmilText element or as a default on theregion andtextStyle elements.

Values:

append
The new fragment 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 without the introduction of any additional white space.
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 value is used, as defined by the initial value or an override value.

The initial value for this attribute isappend.

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.

ThetextPlaceAttribute

The attribute provides a hint on where content is initially placed in a rendering area, both as an initial string and after aclear operation. The placement is defined in terms of the secondary writing direction, as defined by thetextWritingMode attribute. ThetextPlace attribute may be used on thesmilText element or as a default on theregion andtextStyle elements.

Values:

start
New content in an empty region is placed first at the starting edge of the secondary writing direction, and then flowed in the secondary writing direction as text is wrapped or explicitbr elements are used. For example, if the secondary writing direction is top-to-bottom, the content will initially be placed at the top of the region.
center
New content in an empty region is placed first at the center of the secondary writing direction, and then flowed in the secondary writing direction as text is wrapped or explicitbr elements are used. For example, if the secondary writing direction is top-to-bottom, the content will initially be placed at the vertical center of the region.
end
New content in an empty region is placed first at the ending edge of the secondary writing direction, and then flowed in the secondary writing direction as text is wrapped or explicitbr elements are used. For example, if the secondary writing direction is top-to-bottom, the content will initially be placed at the bottom of the region.
inherit (default)
The effective value is used, as defined by the initial value or an override value.

The initial value for this attribute isstart.

This section is informative.

If no text motion attributes have been defined, any text that is explicitly or implicitly placed beyond the ending boundary of the region will not be displayed. As a consequence, if the valueend is used without motion, only one line of content will be visible.

ThetextStyleAttribute

The attribute references a text style set defined using the textStyle element in the document head. This attribute may be used on thesmilText,div,p orspan elements, or as a default on theregion 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 attribute is ignored.

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

ThetextWritingMode Attribute

ThetextWritingMode attribute provides a hint on the desired primary and secondary writing directions of text added to a region. It is supported on a best-effort basis. The semantics defined inXSL 1.1, ([XSL11], section 7.29.7) are available, with the restriction that only the subset provided below may be available. This attribute may be used on thesmilText,div orp elements, or as a default on theregion andtextStyle elements. When used with thediv orp elements, implementations may limit the allowable the override behavior to the opposite of the primary writing direction. The specified behavior may be overridden by the Unicode BIDI algorithm. Within ap, the direction of text and unicode-BIDI processing may be overridden by thetextDirection attribute.

Values:lr-tb | rl-tb | tb-rl | tb-lr | lr | rl | inherit

lr-tb
The primary writing direction of text is a left-to-right progression and the secondary writing direction is a top-to-bottom progression.
rl-tb
The primary writing direction of text is a right-to-left progression and the secondary writing direction is a top-to-bottom progression.
tb-lr
The primary writing direction of text is a top-to-bottom progression and the secondary writing direction is a left-to-right progression.
tb-rl
The primary writing direction of text is a top-to-bottom progression and the secondary writing direction is a right-to-left progression.
lr
A shortcut forlr-tb.
rl
A shortcut forrl-tb.
inherit (default)
The effective value is used, as defined by the initial value or an override value.

The initial value for this attribute islr-tb.

This section is informative.

Because of the implementation complexities of arbitrary text placement, not all text renderers may support all of the alignment operations specified by this attribute. A given profile may further restrict the available values. If the selected attribute value is not supported, a renderer may substitute a player-dependent behavior. At a minimum,lr-tb may be expected.

Implementations may define default behavior if adiv orp element attempts to override both the primary and secondary writing directions (such as changing from lr-tb to tb-lr). Additionally, changes to the primary writing direction may be ingored if the text mode is set tocrawl, and changes to the secondary writing direction may be ignored if the text mode is set toscroll, as defined within theTextMotion module.

Note that only the subset of XSL 1.1's writing-mode attribute supported by DFXP are adopted by smilText. In smilText, the XSL naming conventions for the writing modes are adopted.

Examples

This section is informative.

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

00 <smil ...>01  <head>     ...02    <textStyling>03      <textStyle xml:id="HeadlineStyle" textFontFamily="serif" textFontSize="12px"              textFontWeight="bold" textFontStyle="italic"                       textWrapOption="noWrap" textColor="blue" textBackgroundColor="white" />04    </textStyling>05    <layout>         ...06      <region xml:id="Title" top="5px" left="10%" width="80%" height="25px"             textStyle="HeadlineStyle" />07      <region xml:id="Captions" top="215px" left="10%" width="80%" height="35px"           textFontFamily="serif" textColor="orange"  backgroundColor="blue"/>08      <region xml: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 Party15     </smilText>16     <seq>17       <par>18         <img region="slides" src="p001.jpg" begin="1s" dur="9s"/>19         <audio ... src="yip.mp3" begin="woof.tevEvent"/>20         <smilText region="Captions" textAlign="start" 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 began25              </div>26              <br/>27              to chime six times...28              <tev begin="4s"/>29              our trusty dog Gretchen30              <tev xml: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 layoutregions are defined, one of which (on line 06) references a style definitionwith local overrides, and another of which (on line 07) uses mostly defaultstyle. In the body of the presentation, a parallel container is defined thatcontains a text title (on line 13); most of the styling attributes aredefined on the region via the text style attribute. Later in thepresentation, a sequence of images are defined that are each accompanied byone or more text captions. The text definition on line 13 illustrates thattext, like images, has no inherit duration, but that by using the SMIL fillattribute, the content of the smilText element remains visible until the endof the parent time container (in this case, the par that is defined on line12). The three smilText fragments that accompany the image defined on line 18illustrate that the in-line text object may use the standard SMIL timingattributes, plus several new attributes to explicitly control text placementand styling. A tevEvent will be generated by a text fragment and used tocontrol some other portion of the presentation, as is shown in line 30'striggering of the sound on line 19. Finally, the text element on line 36illustrates that it is possible to mix in-line and external text in a singledocument.

8.4.2IntegrationRequirements

None.

8.5SMIL 3.0 TextMotion Module

This section is normative.

This section defines the elements and attributes that make up the SMILTextMotion Module. Languages implementing the elements and attributes in theTextMotion Module must implement all elements and attributes defined below,as well as those defined in theBasicTextandTextStyling modules.

8.5.1 Elements andAttributes

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

This module does not define any new elements.

This module:

  1. extends the definition of theBasicText module'ssmilText element and theTextStyling module'stextStyle element to include thetextConceal andtextRate attributes;
  2. extends the definition of theTextStyling module'stextMode attribute to include thecrawl,scroll andjump attribute values; and
  3. extends the definition of the SMIL Layoutregion element to include thetextConceal andtextRate attributes.

ThetextModeAttribute

ThetextMode is extended to support three values for motion-based text presentation of asmilText object. These values may be used on the smilText element or as a default on theregion andtextStyle elements.

Values:

crawl
This value causes text to move as a single line against the primary writing direction (as defined by thetextWritingMode attribute). The initial position of the text in the primary writing direction will be determined by thetextAlign attribute, unless overridden by thetextConceal attribute. The position of the text in the secondary writing direction will be determined by thetextPlace attribute. All line breaks, either implicit or explicit, will be ignored. The speed of movement, in pixels per second, is determined by thetextRate attribute. If present, thetev/clear elements may be used to specify incremental appearance of content within a crawling string.
scroll
This value causes text to move smoothly against the secondary writing direction (as defined by thetextWritingMode attribute). The alignment of the text in the primary writing direction will be determined by thetextAlign attribute. The initial position of the text in the secondary writing direction is defined by thetextPlace attribute, unless overridden by thetextConceal attribute. All line breaks, either implicit or explicit, will be respected. The speed of movement, in pixels per second, is determined by thetextRate attribute. Unless otherwise specified by thetextRate attribute, thetev/clear elements may be used to specify incremental presentation of content within a scrolling string.
jump
This value causes text to jump against the secondary writing direction (as defined by thetextWritingMode attribute) by line within the region when the current line fills (or after an explicitbr). The alignment of the text in the primary writing direction will be determined by thetextAlign attribute. The initial position of the text in the secondary writing direction is defined by thetextPlace attribute, unless overridden by thetextConceal attribute. All line breaks, either implicit or explicit, will be respected. The number of line jumped is determined by thetextRate attribute. Thetev/clear elements may be used to specify incremental presentation of content within a jumping block.

The default value for this attribute is given in thetextMode definition in theTextStyling module.

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

This section is informative.

Given the complexities of supporting text motion, it is expected that motion in all primary and secondary modes may not be available. At a minimum, motion should be supported with an effective text writing mode of lr-tb.

ThetextConcealAttribute

ThetextConceal attribute specifies the initial and ending positioning content as a result of a textMode setting ofcrawl,scroll orjump. This attribute may be specified on the smilText element or as a default on theregion andtextStyle elements.

Values:

none:
Text initially will be rendered at the starting point in the region defined by thetextPlace andtextAlign attributes, and will finish at the terminating placement determined by the normal processing of the content. No leading or trailing space will be added.
initial:
Text initially will be rendered at a starting point that is just outside the region and enter the region once the simple duration begins. Text will finish at the terminating placement determined by the normal processing of the content. This has the visual effect that leading spaces will be added to the content. IftextMode is set tocrawl, thetextAlign attribute will be ignored. IftextMode is set toscroll orjump, thetextPlace attribute will be ignored.
This setting will extend the intrinsic duration of the content to support the rendering of leading spaces.
final:
Text initially will be rendered at the starting point in the region defined by thetextPlace andtextAlign attributes. At the conclusion of normal processing of the content, any content left in the rendering region will be crawled, scrolled or jumped out of view. This has the visual effect that trailing spaces will be added to the content.
This setting will extend the intrinsic duration of the content to support the rendering of trailing spaces.
both:
Theinitial andfinal behavior described for this attribute are both applied to the text.
This setting will extend the intrinsic duration of the content to support the rendering of leading and trailing spaces.
inherit: (default)
The effective value is used, as defined by the initial value or an override value.

The initial value for this attribute isnone.

This section is informative.

Given the complexities of supporting text motion and recalculating the intrinsic duration, only best-effort support for all textConceal modes can be expected.

ThetextRateAttribute

ThetextRate specifies the rate of motion of smilText elements that have thecrawl,scroll orjump values defined for thetextMode attribute. This attribute may be specified on the smilText element or as a default on theregion andtextStyle elements.

Values:

auto (default):
The interpretation of this value depends on the effective motion mode of text. When used with thecrawl orscroll text modes, this value specifies that the rendering system should determine the appropriate rate of movement (in pixels per second) to display the entire content of the smilText element (including any extra spacing required for processing the textConceal attribute) within its simple duration. All timing markup on tev/clear elements to be ignored and no activation events will be generated from within the smilText element. If the simple duration is not known, implementations may make an informed guess or provide a default rate. When used with thejump text mode, this value specifies that a single line in the secondary writing direction is jumped when an explicit or implicit line break is generated. There is no further impact on temporal processing of the text. When used with all other text modes, this attribute is ignored.
CSS2 pixel value:
The interpretation of this value depends on the effective motion mode of text. When used with thecrawl orscroll text modes, this value defines a non-negative integer representing a pixel movement rate in pixels per second. The "px" unit qualifier in pixel values may be omitted. When used with thejump text mode, this value will be interpreted as a non-negative integer and the "px" qualifier, if present, will be ignored. When used with all other text modes, this attribute is ignored.
non-negative integer:
The interpretation of this value depends on the effective motion mode of text. When used with thecrawl orscroll text modes, this value will be interpreted as a CSS2 pixel value without the "px" qualifier. When used with thejump text mode, this value defines the number of lines to jump when adding new content. When used with any other text mode, this attribute is ignored.

Implementations may use simple algorithms to determine the rate of motion,either based on a fixed pixel movement value per update cycle or as a defaultvalue.

Looping behavior of crawling, scrolling or jumping text may be specifiedusing standard SMIL repeat semantics on the smilText element.

Examples

This section is informative.

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

 <smil ...>  <head>     ...    <layout>        ...      <region xml:id="Contents" top="5px" left="10%" width="80%" height="300px"             textMode="crawl" textRate="20px" />    </layout>   </head>   <body>      ...        <smilText xml: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 atthe right of the display. The text crawls across the screen in a directionthat is opposite to the (in this case default) textWritingMode ofleft-to-right. Initially, only the first fragment is visible. After 5seconds, the entire portion of the second fragment is made visible; note thata portion may be initially clipped from view. After another 5 seconds, thefinal fragment is added to the text display.

8.5.2IntegrationRequirements

None.

8.6Appendices

8.6.1Appendix A: Differences with the DFXPSpecification

This section is informative.

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. Inthis section, we review the components taken from DFXP, the components nottaken from DFXP and the extensions defined that are not in DFXP.

Components Taken From DFXP forsmilText

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

ComponentDFXP NamesmilText NameDifferences
Contentbr
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 elementsstyle
styling
textStyle
textStyling
These elements are declared in the document head.
smilText allows styles to be associated with layout regions as default values.
Styling attributestextAlign
backgroundColor
color
direction
fontFamily
fontSize
fontWeight
style
wrapOption
writingMode
textAlign
textBackgroundColor
textColor
textFontFamily
textFontSize
textFontWeight
textStyle
textWrapOption
textWritingMode
smilText limits the range of values permitted for some of these attributes. Several attributes are considered to be hints in smilText: these are textAlign, textDirection, textWrapOption, and textWritingMode. Renderers may supply implementation-dependent behavior for these attributes.

Components Not Taken FromDFXP for smilText

The following elements and attributes are not included in smilText.

Additions in smilText Not inDFXP

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

8.6.2Appendix B: Using SMIL 3.0 SmilTextas a Stand-Alone External Format

This section is informative.

This section defines the use of SmilText as an external, stand-alone timedtext format. This is accomplished by using the SMIL 3.0 SmilText profile. Inthe following sections, examples of the use of the SMIL 3.0 SmilText profileare provided. Full details of the profile are given in theSMIL 3.0 SmilText profile specification.

Elements andAttributes

The SMIL 3.0 smilText profile provides a light-weight collection of SMILelements and attributes that are specifically defined to allow thespecification of an external smilText object. This profile allows an authorto encode in-line smilText content in an external file with littlemodification. The profile does not define any new elements or attributes. Thebasic difference from the in-line specification of SmilText content is thatthe external content uses thesmilText element as the top-levelcontainer element. The external smilText element is expanded withdimensioning and background color attributes that allow a simple smilTextengine to effectively render the content. These attributes are defined in thefollowing sections.

The dur Attribute

This attribute is functionally and syntactically equivalent to thedur attribute defined in the SMIL TimingModules. When placed on the top-levelsmil element in the external file that alsoincludes abaseProfile attributewith the valueSmilText, thedur attribute defines the intrinsic value ofthe duration of the text object. The default value for this attribute is zero(0). A value ofindefinite is allowed and specifiesan object that does not have a self-scheduled end.

The height Attribute

This attribute specifies the height of a rendering area for the SmilTextcontent. It is functionally and syntactically equivalent to theheight attribute defined in the SMIL LayoutModules, with the exception that percentage values are not supported inexternal SmilText profile files. The default value for this attribute isauto, which allows the (SMIL or other) renderingagent to determine the height of the rendering area based on definitions madein the rendering agent. When used with an external object that will berendered by a SMIL processor, any value for this attribute in the externalfile will be overridden by the effectiveheight value defined for the media elementthat references the external file.

The width Attribute

This attribute specifies the width of a rendering area for the SmilTextcontent. This attribute is functionally and syntactically equivalent to thewidth attribute defined in the SMILLayout Modules, with the exception that percentage values are not supportedin external SmilText profile files. The default value for this attribute isauto, which allows the (SMIL or other) renderingagent to determine the width of the rendering area based on definitions madein the rendering agent. When used with an external object that will berendered by a SMIL processor, any value for this attribute in the externalfile will be overridden by the effectivewidth value defined for the media elementthat references the external file.

The backgroundColor Attribute

This attribute is used to specify the background color of the renderingarea containing the external SmilText content. This attribute is functionallyand syntactically equivalent to thebackgroundColor attribute definedin the SMIL Layout Modules. The default value for this attribute istransparent. When used with an external object that willbe rendered by a SMIL processor, any value for this attribute in the externalfile will be overridden by the effectivebackgroundColor value defined forthe media element that references the external file.

Other External SmilText Attributes

The SmilText profile may define other attributes that may be used on thetop-level smil element, or specific SmilText modules that may be used withinby the external SmilText context. These are not considered here.

Examples

The following example illustrates the use of SmilText as an externaltimed-text format. Assume that the following file is namedexternalText.smil:

 <smilText xmlns="http://www.w3.org/ns/smil" height="40" width="60" dur="12s" backgroundColor="white" textAlign="right">      Willemijn's 11th Birthday Party      <tev begin="5s"/>      was held six weeks late.      <tev next="5s"/>      (Again!)</smilText>

This example displays text string that is aligned at the right of the40x60 rendering extent. The background color of the rendering area is set towhite. The intrinsic duration is set to 12 seconds. Note that thesmilText element is used as a top-levelcontent container for text. Nohead orelementbody need be specified. TheSMILversion andbaseProfile attributes are set to3.0 andsmilText bydefault. (The profile specification defines the rules for default content ofall elements and attributes.)

Since the external smilText file does not have a layout section in thehead, there is no requirement to use layout related attributes (such asregion) on the smilText definition. Notethat to enhance copy/paste transfer of smilText objects between internal andexternal files, the specification of any non-recognized attributes is ignoredby the SmilText profile.

The following SMIL 3.0 fragment illustrates the use of an externalSmilText definition within a SMIL file:

 <smil ...>  <head>     ...    <layout>        ...      <region xml:id="Contents" top="5px" left="10%" width="80%" height="300px" />    </layout>   </head>   <body>      ...        <textstream xml:id="ST99" region="Contents" src="externalText.smil" dur="25s"/>      ...   </body> </smil>

In this example, the effective values for height, width, backgroundColorand duration are taken from the embedding SMIL file rather than the externalSmilText profile file.

8.6.3Appendix C: Using ITS Facilities with SMIL3.0 SmilText

This section is informative.

W3C publishes a set of internationalization and localization guidelines[ITS] that allow content to be easily localized and translated. ThesmilText modules provide a direct means of specify content, and the ITSfacilities have been defined to apply tosmilText,div,p andspanelements.

The following fragment illustrates an ITS rules file:

<its:rules  xmlns:its="http://www.w3.org/2005/11/its"  xmlns:s="http://www.w3.org/2008/SMIL30/" version="1.0"> <!-- Rule number 1 --> <its:translateRule selector="//s:*" translate="no"/> <!-- Rule number 2 --> <its:translateRule selector="//s:smilText | //s:div | //s:p | //s:span " translate="yes"/><!-- Rule number 3 --><its:withinTextRule selector="//s:span" withinText="yes"/></its:rules>

The first two rules are used to separate translatable and non-translatablecontent. They can be read as: the default for elements is that they are nottranslatable (first <translateRule> element). The exceptions(translatable elements and attribute content) are handled by the second<translateRule> element, which takes precedence over the first one.

The third rule about "Elements within Text" describes that the<span> element appears in the flow of other elements, like<smilText>, <p> or <div>. The default for "Elements WithinText" is that elements are not nested.

For internationalization and localization purposes, a SMIL 3.0 file isassociated to the ITS rules file indicated above.


previous  next  contents  

[8]ページ先頭

©2009-2025 Movatter.jp