RE: Style in SMIL

This is another case where using HTML+SMIL will get you the desired
results.

-Pablo

-----Original Message-----
From: Kari Pihkala [mailto:kpihkala@cc.hut.fi] 
Sent: None
To: www-smil@w3.org
Subject: Re: Style in SMIL


Hi,

I understand now your idea of media elements. SMIL would only
be the language to tie them together.

The way we have been using text media in SMIL is the following.
This prevents creating tens of small text files (or html files).

<text src="data:,This is the text." ... />

This is valid according to "data" URL scheme 
(RFC2397, http://www.ietf.org/rfc/rfc2397.txt).

To get formatted text, we now have to change this to
<text src=
"data:text/html,<STYLE>p { color: green }</STYLE><p>This is the text."
... />
<img src="clickme.gif" ... />

What if we want to change the color of the text when the user clicks
on the image? The only way is to change the src attribute of the text
element. Using html-files:

<text src="blue.html" ... /> becomes
<text src="red.html" ... />

This easily produces a lot of separate small files, which we didn't
want to have. But looks like it is the only option.
Should the styles in <layout type="text/css"> just be discarded?

thanks for the answer,
         Kari


> 
> Kari,
> 
> short answer: there is no text in SMIL, so there
> is no "need" to do text styling. Styling should
> happen in the text media object itself, e.g. in the
> html file that the "text" media object refers to
> in its "src" attribute. 
> 
> You could imagine an architecture where style
> information in the SMIL document influences the
> style information contained in the text media 
> object, but I guess that may be difficult to do
> in a general way.
> 
> Does this make sense ?
> 
> -Philipp
> 
> 
> --- Kari Pihkala <kpihkala@cc.hut.fi> wrote:
> > 
> > Hello,
> > 
> > I got a question about styles in SMIL after staring
> > at standard 
> > Courier 10 black on white font in the text elements.
> > It would be nice 
> > to format text using CSS2. However, none of the SMIL
> > elements have 
> > the style attribute. It would be nice to know why? 
> > 
> > I know there are alternative ways to do this, one is
> > to use external 
> > stylesheets in the beginning of the XML document:
> > 
> > <?xml-stylesheet href="style.css" type="text/css"?>
> > 
> > However, I consider this limiting, especially for
> > scripting. 
> > Frequently, the color of the text is wanted to be
> > changed when mouse 
> > is over it. But, the above stylesheet can't be
> > modified from the script 
> > and prevents changing the color.
> > 
> > One solution is to use the <layout type="text/css">
> > element.
> > The regions will then be defined using CSS2, which
> > includes text 
> > formatting, for example:
> > 
> > [region="b"] { top: 20px; left: 10px; font-family:
> > Arial; color: blue; }
> > [region="r"] { top: 20px; left: 10px; font-family:
> > Arial; color: red; }
> > 
> > The script would then change the region of the text
> > element from 'b' to 'r'.
> > <text region="b" ... > becomes
> > <text region="r" ... >
> > 
> > Another way is to use CSS2 classes:
> > 
> > [region="area"] { top: 20px; left: 10px; }
> > .red  { color: red; }
> > .blue { color: blue; }
> > 
> > The script would then change the class attribute of
> > the text element 
> > from 'red' to 'blue'.
> > <text class="red" region="area" ... > becomes
> > <text class="blue" region="area" ... >
> > 
> > But I find this a bit cumbersome. The way it would
> > be done in HTML is:
> > 
> > <text region="area" style="color: red;">
> > 
> > and the style attribute would then be changed using
> > the script. 
> > I understand this may produce some problems. The
> > region of the media 
> > element could be defined using the style attribute:
> > 
> > <text region="area" style="top: 10px; left: 20px">
> > 
> > and this is probably something unwanted. (or is it?)
> > 
> > It would be nice to hear opinions about this. Is
> > there a reason not to 
> > have the style attribute?
> > SVG and XHTML have it. They also have a style
> > element.
> > 
> >  - Kari
> > 
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
> 

Received on Wednesday, 23 May 2001 12:34:13 UTC