RESOLVED FIXED 17541
SVG font support gets wrong metrics by querying 'font' instead of 'font-face' element
https://bugs.webkit.org/show_bug.cgi?id=17541
Summary SVG font support gets wrong metrics by querying 'font' instead of 'font-face'...
Mark Ambachtsheer
Reported 2008-02-25 15:37:18 PST
WebKit isn't getting the right metrics for SVG fonts because it is falling back on default metrics when reading correct SVG font definitions with those metrics supplied. Looking at SVGFontFaceElement::ascent() and SVGFontFaceElement::descent(), the code is attempting to query the 'font' element, when according to the specs here: http://www.w3.org/TR/SVG/fonts.html#FontElement http://www.w3.org/TR/SVG/fonts.html#FontFaceElement the 'ascent' and 'descent' attributes should be defined on the font-face element. This is using code checked out from SVN 2008/02/25.
Attachments
test file that reproduces bugs # 17541 and 17608 visually. (18.04 KB, text/html)
2008-02-29 08:52 PST, Mark Ambachtsheer
no flags
Screenshot of 17541_17608.html being rendered by WebKit (61.74 KB, image/png)
2008-02-29 08:53 PST, Mark Ambachtsheer
no flags
Mark Ambachtsheer
Comment 1 2008-02-29 08:52:23 PST
Created attachment 19450 [details] test file that reproduces bugs # 17541 and 17608 visually.
Mark Ambachtsheer
Comment 2 2008-02-29 08:53:21 PST
Created attachment 19451 [details] Screenshot of 17541_17608.html being rendered by WebKit
Nikolas Zimmermann
Comment 3 2012-05-19 17:15:47 PDT
int SVGFontFaceElement::ascent() const { // Spec: Same syntax and semantics as the 'ascent' descriptor within an @font-face rule. The maximum // unaccented height of the font within the font coordinate system. If the attribute is not specified, // the effect is as if the attribute were set to the difference between the units-per-em value and the // vert-origin-y value for the corresponding font. const AtomicString& ascentValue = fastGetAttribute(ascentAttr); if (!ascentValue.isEmpty()) return static_cast<int>(ceilf(ascentValue.toFloat())); .. This is long resolved in trunk, this bug was forgotten.
Note You need to log in before you can comment on or make changes to this bug.