The translation of SVG Glyphs can be wrong on using SVGFont. However the rotation of Glyphs is correct. Examples: http://dev.w3.org/SVG/profiles/1.1F2/test/harness/htmlObject/text-path-02-b.html http://dev.w3.org/SVG/profiles/1.1F2/test/harness/htmlObject/text-text-07-t.html http://dev.w3.org/SVG/profiles/1.1F2/test/harness/htmlObject/text-text-09-t.html It's possible, that the not working square glyphs tests on the Test-suite have the same reason for the brokness.
After checking SVGInlineTextBox::calculateGlyphBoundaries it turns out, that only the x-Position is wrong, caused by a wrong x-Position of SVGChar.x. Another very strange issue: The values depend on the chars that are used and how they are combined. Combining the same characters results in the expected output. Some other combinations cause wrong positioning of the chars. I try to upload a short test case to demonstrate this.
Created attachment 51868 [details] SVGFont text and serif-font text should lie one upon the other. Note, that only the x-position is wrong, and only on the left example.
*hmpf* Looks like I found the problem. The SVGFont in this test is using hkern. We don't support hkern or vkern. That causes the trouble.
Looks like I was wrong again (someone should update the SVG status page). We support kerning and deleting the kerning values causes _my_ expected rendering. Compared with Opera, it looks like Opera don't respect the kerning. Shouldn't we use kerning on glyph-transformation? Is our rendering correct, but the rendering of Opera is wrong? Do we have a bug in kerning?
The value of the kerning should be relative to the userSpace of the Char. WebKit takes the userSpace of the viewport.
Created attachment 51934 [details] Patch
Comment on attachment 51934 [details] Patch > + kerning = static_cast<float>(kerningPair.kerning); I think we have a special cast just for the "double to float" conversion. With the word "narrow" in its name. I don't have a source tree handy.
(In reply to comment #7) > (From update of attachment 51934 [details]) > > + kerning = static_cast<float>(kerningPair.kerning); > > I think we have a special cast just for the "double to float" conversion. With > the word "narrow" in its name. I don't have a source tree handy. Your're right, narrowPrecisionToFloat. Forgot this.
Created attachment 51961 [details] Patch
Comment on attachment 51961 [details] Patch Good catch, r=me!
Comment on attachment 51961 [details] Patch Clearing flags on attachment: 51961 Committed r56776: <http://trac.webkit.org/changeset/56776>
All reviewed patches have been landed. Closing bug.
svg/custom/glyph-transformation-with-hkern.svg has been failing on the Gtk 32-bit Debug builder since this change.
Commited DRT update in http://trac.webkit.org/changeset/56971