[Webkit-unassigned] [Bug 12376] glyph rotation in text/tspan not implemented

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 30 22:22:29 PST 2007


------- Comment #2 from oliver at apple.com  2007-01-30 22:22 PDT -------
I thought i already had a bug on this -- but that could be radar :-/

Basically we need to have a separate text rendering path for anything other
than simple horizontal text.

My suggested steps would be:
1. In SVGRenderInlineText (i think that's it) override paint, and have it do
painting itself; once that's going
2. Allow individual character positioning -- for this you'll need to fix
width/height calculation -- eg. make <text x="100" y="100"><tspan dy="10 10
10">foo<tspan>bar</text> -- after that <text x="100" y="100 110 120 130 140
150">foo<tspan x="200">bar</tspan></text>.   This will be difficult as
determining the width/height of a text run will require knowledge of the text
positioning elements of both parent and preceeding elements.
3. Once you've got that done, adding glyph rotations should be relatively
simple  (as you'll already have all the rules and logic setup for accessing per
character x/y/dx/dy/etc)

I suspect for anything other than simple text you'll need 
struct SVGChar {
  UChar m_char;
  short angle : 14;
  short orientation : 2;
  float m_x;
  float m_y;

You could recalculate angle, x, y during painting but it would probably be very
expensive, as the increased memory usage shouldn't be too significant as these
will probably not be used too much (and i doubt people will be putting screeds
of text in SVG).

You could use lots of special cases to deal with only x/y/angle varying per
character, but i doubt it would really be worth it.  It could be worth it to
distinguish the case where no angle is specified as applying rotation to the
glyphs will probably be expensive

I was hoping scaled ints would work for x/y but we'll probably need float
precision (ideally double, but trying to minimise size).  Roatation angle
should be fine as a scaled int, lowering the precision to share with glyph
orientation.  Glyph orientation will be needed for vertical text, though i'm
not yet aware of whether it is possible to determine available glyph
orientations on macos.

However once this is done it should allow the painting code to render
positioned, rotated, vertical, and path defined text in a generic way.  Doing
the layout will still not be incredibly pleasant though. Multipass layout will
probably be easier initially (as happens in current layout)

Configure bugmail: http://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

More information about the webkit-unassigned mailing list