W3C home > Mailing lists > Public > www-style@w3.org > November 1997

Re: a vote for rotation

From: Chris Lilley <Chris.Lilley@sophia.inria.fr>
Date: Tue, 25 Nov 1997 22:47:16 +0100 (MET)
Message-Id: <9711252247.ZM25116@grommit.inria.fr>
To: Space Cowboy <spacecow@mis.net>, www-style@w3.org
On Nov 25,  3:08pm, Space Cowboy wrote:

> While it's probably quite complex and a little complicated to deal with,
> wouldn't it be nice if you could have a rotate property in CSS? Even if
> it's only the cardinal points (0, 90, 180, 270 degrees), I think it
> would be a real boon to pages.

There are clearly lots of uses of rotated text in print publication and in
"pictures of text" on the Web. The question then becomes, can this be fitted
into the model used by CSS and what is the implementation effort (both
directly and in terms of "what breaks if this is added".

>  I've had lots of times I wanted write
> some DHTML to spin something around.

Restriction to the cardinal points would not allow smooth spinning. *Not*
restricting it to the cardinal points, in the absence of some clipping
mechanism,  would potentially forcea reflow for every iteration of the
loop, which is unlikely to give the performance you want.


> I realize that this causes two problems, one, rendering text at an angle
> is more complicated,

Yes, some platforms can't do it (or can't do it except as graphics) so there
needs to be a fallback story. Many hinting mechanisms break when doing
non-cardinal rotation - or indeed any rotation at all. See the rendering
of rotated anti-aliased TrueType text in BeOS for a counter example which
works well.

> and rendering raster images is very complicated,

It can be fairly simple - for a pixel replication method, iterate over
every pixel in the destination image and transform back to the original
image to locate the nearest pixel; color destination pixel same as source
pixel.

For higher quality yes, it gets complicated since a proper subsampling
method will always generate a truecolor image even if the original image
was palettized - a problem on platforms with limited color capability
such as the grossly inadequate but surprisingly common 256 color displays.

> and two, the height and width of the object change when it's rotated,

Right. This can be dealt with by having a parennt container of known
width and height and a clipping policy.

> but I know MM Director programs do this well, and I've seen programming
> languages that handle it well.
>
> What'd ya think?

It's possible that it could be added as a new form of relative or absolute
positioning, using rotation rather than translation. That would give defined
clipping and scrolling behaviour and define a Z-order for cases where the
rotated text would overlap other content.

Other comment on Space Cowboy's proposal is invited.

-- 
Chris Lilley, W3C                          [ http://www.w3.org/ ]
Graphics and Fonts Guy            The World Wide Web Consortium
http://www.w3.org/people/chris/              INRIA,  Projet W3C
chris@w3.org                       2004 Rt des Lucioles / BP 93
+33 (0)4 93 65 79 87       06902 Sophia Antipolis Cedex, France
Received on Tuesday, 25 November 1997 16:47:50 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:53:52 GMT