Open Bug 593601 Opened 14 years ago Updated 2 years ago

A gradient applied on a textPath should cover the bounding box

Categories

(Core :: SVG, defect)

defect

Tracking

()

UNCONFIRMED

People

(Reporter: sebastian, Unassigned)

References

Details

(Keywords: testcase)

Attachments

(5 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.127 Safari/533.4
Build Identifier: 

This was first described in bug 577850.

Reproducible: Always

Steps to Reproduce:
1. Create a textPath element within a text element.
2. Let the textPath refer to a path which doesn't start at origin 0,0.
3. Set the fill to a linear gradient.
Actual Results:  
The gradient looks like it covers a larger area than the rendered bounding box.

Expected Results:  
The gradient edges should touch the bounding box.
Attached image Test Case
The expected result is for the gradient to go from black to white to black within the rendered text area.
Keywords: testcase
OS: Windows 7 → All
Hardware: x86 → All
Opera has the same bounding box as Firefox. Curious eh?

Batik has it tightly round the text. What does Webkit do?
Attached image without spaces
So it's all about how you compress spaces then.
So it's all about where that middle space character is put that's not part of the textPaths. (The leading and trailing whitespace is removed anyway so it doesn't affect things).
And the position of the central space in Firefox is (128, 0). This seems right as it's the underlying position of the end of the text before the textPath transforms it. So I think this bug is invalid.
Attached image M
Batik draws the M near the foo. Opera, the Adobe SVG Plug in for IE and Firefox draw it just off the top of the window.
Actually, Opera changed its behavior here from 10.5 to 10.6.  It seems to now put the M near the foo (in 10.6), which is just wrong.  At least on Mac.

So am I missing something, or is this bug just invalid?
I'm still not totally convinced it's clearly specified in the SVG spec what to do. I plan to ask them.
After some consideration, I think this bug is invalid according to the SVG spec.

Since the white space will be turned into a single space glyph, it cannot be removed following the existing white space guidelines.

Additionally, the bounding box calculation must consider the full size of the glyph. "The calculations assume that all glyphs occupy the full glyph cell."

Although it's counter intuitive, it's not less so than equivalent text flow in HTML.
The whitespace can't be removed that's true. The outstanding question is where should it go?
Depends on: 941585
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: