Forum Feature requests

CSS3 2D transformations and text stretching revisited

massifr
In May, I asked for a way to stretch a text (or a font) by a certain percentage:
http://www.princexml.com/bb/viewtopic.php?t=2296

There is the "font-stretch" property, but it means selecting a font variant: condensed, expanded, etc.
Only some fonts have those variants (Helvetica, for example).
What I wanted was a way to (geometrically) transform a text making it narrower. The resulting text makes some violence to the glyphs, which are designed to appear in certain proportions, but for limited amounts of stretch the result can be acceptable.

Now I have found there's a W3C draft for "CSS 2D Transforms Module Level 3":
http://www.w3.org/TR/2009/WD-css3-2d-transforms-20090320/

Now there's a standard way to specify transformations in general and not only text ones. Are you going to implement it?
mikeday
This new transformations draft does look promising, and we will be watching it closely to see if there is also uptake from other browsers, like Opera and Mozilla. I'll add this to the roadmap.
NoMoreNicksLeft
If so, a workaround might be to use to that for any stretching needs.
mikeday
Yes, SVG is the only current option for applying arbitrary transformations. However, the lack of foreignObject does make it impossible to nest XHTML within SVG for now.
NoMoreNicksLeft
Nesting SVG inside of XHTML rather. If it suits his needs, this might be a way to get that effect, and from what I've seen of Prince it just might handle it.
jmh
I'll add my vote for CSS transforms. They now have decent browser uptake: Webkit/Safari/Chrome and Firefox 3.5.

We've been evaluating Prince for generating brochures. They commonly have slanted elements, blocks and images. CSS transforms make this much simpler than SVG.

(Here's the Mozilla documentation for transforms: https://developer.mozilla.org/en/CSS/-moz-transform )
mikeday
Prince 8.1 is now available, with support for CSS3 Transforms! :D