Bug 86463 - [Qt] Enable SVG Fonts by default
Summary: [Qt] Enable SVG Fonts by default
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Pierre Rossi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-15 04:27 PDT by Pierre Rossi
Modified: 2012-05-16 04:28 PDT (History)
7 users (show)

See Also:


Attachments
Patch (10.42 KB, patch)
2012-05-15 04:59 PDT, Pierre Rossi
no flags Details | Formatted Diff | Diff
new results with the patch (deleted)
2012-05-15 06:15 PDT, Csaba Osztrogonác
no flags Details | Formatted Diff | Diff
Patch (10.76 KB, patch)
2012-05-15 12:39 PDT, Pierre Rossi
no flags Details | Formatted Diff | Diff
Patch (12.28 KB, patch)
2012-05-16 01:38 PDT, Pierre Rossi
zimmermann: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Pierre Rossi 2012-05-15 04:27:50 PDT
[Qt] Enable SVG Fonts by default
Comment 1 Pierre Rossi 2012-05-15 04:59:18 PDT
Created attachment 141920 [details]
Patch
Comment 2 Pierre Rossi 2012-05-15 05:02:22 PDT
Comment on attachment 141920 [details]
Patch

Since the tests have been skipped for a while, they will most likely need to be rebaselined. I'm just not sure I can trus what I get locally once again.
Comment 3 Csaba Osztrogonác 2012-05-15 06:15:09 PDT
Created attachment 141943 [details]
new results with the patch

Here is the new results with your patch.
Feel free to land with the original patch.
Comment 4 Simon Hausmann 2012-05-15 06:55:22 PDT
Comment on attachment 141920 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=141920&action=review

> Source/WebCore/platform/graphics/qt/FontPlatformData.h:59
> +// Necessary for SVG Fonts, which are only supported when using QRawFont.

I suppose the comment should be indented and maybe also explain why it is necessary - like you do in the ChangeLog :)

> Source/WebCore/svg/SVGFontElement.cpp:137
> -                ligatures.append(unicode);
> +                ligatures.append(unicode.string());

Why is this needed?
Comment 5 Pierre Rossi 2012-05-15 10:27:20 PDT
(In reply to comment #3)
> Created an attachment (id=141943) [details]
> new results with the patch
> 
> Here is the new results with your patch.
> Feel free to land with the original patch.

Thanks Ossy ! :)
Comment 6 Pierre Rossi 2012-05-15 10:28:37 PDT
(In reply to comment #4)
> (From update of attachment 141920 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=141920&action=review
> 
> > Source/WebCore/platform/graphics/qt/FontPlatformData.h:59
> > +// Necessary for SVG Fonts, which are only supported when using QRawFont.
> 
> I suppose the comment should be indented and maybe also explain why it is necessary - like you do in the ChangeLog :)
> 
> > Source/WebCore/svg/SVGFontElement.cpp:137
> > -                ligatures.append(unicode);
> > +                ligatures.append(unicode.string());
> 
> Why is this needed?

I had an ambiguity warning with String operator I think. that seemed legit but maybe it's just hiding another problem, I'll look again.
Comment 7 Pierre Rossi 2012-05-15 12:39:07 PDT
Created attachment 142028 [details]
Patch
Comment 8 Nikolas Zimmermann 2012-05-15 13:23:43 PDT
Comment on attachment 142028 [details]
Patch

There are more things to do here. Grep for PLATFORM(QT) in svg/ and rendering/svg, you'll find some places related to SVG Fonts support, where we currently have special cases for Qt, as it's the only code path yet not using the simple code path & GlyphPage concept.
Comment 9 Pierre Rossi 2012-05-16 01:38:02 PDT
Created attachment 142197 [details]
Patch
Comment 10 Pierre Rossi 2012-05-16 01:42:28 PDT
(In reply to comment #8)
> (From update of attachment 142028 [details])
> There are more things to do here. Grep for PLATFORM(QT) in svg/ and rendering/svg, you'll find some places related to SVG Fonts support, where we currently have special cases for Qt, as it's the only code path yet not using the simple code path & GlyphPage concept.

Thanks for taking a look at this.
Are those the ones you meant ? There are also two similar cases I noticed in CanvasRenderingContext2D.cpp, but I don't think it belongs with that patch really.
Comment 11 Nikolas Zimmermann 2012-05-16 03:42:25 PDT
Comment on attachment 142197 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=142197&action=review

> Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp:51
> +#if PLATFORM(QT) && !HAVE(QRAWFONT)

Exactly, without these changes you shouldn't see SVG Fonts, even when QRawFont is enabled.
Did you verify they work now with Qt5+QRawFont?
Comment 12 Pierre Rossi 2012-05-16 03:57:58 PDT
(In reply to comment #11)
> (From update of attachment 142197 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=142197&action=review
> 
> > Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp:51
> > +#if PLATFORM(QT) && !HAVE(QRAWFONT)
> 
> Exactly, without these changes you shouldn't see SVG Fonts, even when QRawFont is enabled.
> Did you verify they work now with Qt5+QRawFont?

Actually I'm not sure to follow you: AFAICT these changes only ensure we use the simple path over the complex one with respect to metrics. Isn't it like for plain font stuff: we can go through the complex path for anything, it just might not be the best thing to do. 
The testing I had done, albeit in release, showed things worked pretty well even without them. I take it some metrics calculations were done using the complex code path, but the integration with GlyphPageTree and the like was still used afterwards.
Comment 13 Nikolas Zimmermann 2012-05-16 04:15:37 PDT
(In reply to comment #12)
> Actually I'm not sure to follow you: AFAICT these changes only ensure we use the simple path over the complex one with respect to metrics. Isn't it like for plain font stuff: we can go through the complex path for anything, it just might not be the best thing to do. 
We've discussed this on IRC. Kerning pairs in SVG Fonts will now be properly respected, by the change, so its good nonetheless :-)
Comment 14 Nikolas Zimmermann 2012-05-16 04:16:44 PDT
Comment on attachment 142197 [details]
Patch

r=me.
Comment 15 Pierre Rossi 2012-05-16 04:28:28 PDT
Committed r117259: <http://trac.webkit.org/changeset/117259>