RESOLVED FIXED 106013
[Qt] Support kerning in fast path font rendering
https://bugs.webkit.org/show_bug.cgi?id=106013
Summary [Qt] Support kerning in fast path font rendering
Allan Sandfeld Jensen
Reported 2013-01-03 06:10:30 PST
The fast path font rendering has support for kerning, but to do so requires the SimpleFontData::applyTransforms method. Fortunately the method is available in QRawFont under the name advancesForGlyphIndexes. By tweaking the GlyphBufferGlyph and GlyphBufferAdvance types similar to what Safari does, this method can be called directly.
Attachments
Patch (5.40 KB, patch)
2013-01-03 06:14 PST, Allan Sandfeld Jensen
no flags
Patch (5.93 KB, patch)
2013-03-14 08:36 PDT, Allan Sandfeld Jensen
no flags
Patch (7.58 KB, patch)
2013-03-19 02:28 PDT, Allan Sandfeld Jensen
no flags
Patch (7.78 KB, patch)
2013-03-19 03:06 PDT, Allan Sandfeld Jensen
no flags
Patch (7.74 KB, patch)
2013-03-19 03:28 PDT, Allan Sandfeld Jensen
no flags
Patch (5.25 KB, patch)
2013-03-19 07:00 PDT, Allan Sandfeld Jensen
jturcotte: review+
Allan Sandfeld Jensen
Comment 1 2013-01-03 06:14:41 PST
Allan Sandfeld Jensen
Comment 2 2013-01-03 06:25:07 PST
Comment on attachment 181169 [details] Patch This patch is missing a change to ensure kerning is set on QRawFont.
Allan Sandfeld Jensen
Comment 3 2013-01-03 08:43:54 PST
Actually it seems I have tested this incorrectly last time, or there have been a regression in Qt. QRawFont::advancesForGlyphIndexes does not currently perform kerning.
Allan Sandfeld Jensen
Comment 4 2013-03-14 08:36:21 PDT
Created attachment 193128 [details] Patch Updated to new proposed Qt 5.1 API
Allan Sandfeld Jensen
Comment 5 2013-03-19 02:28:34 PDT
EFL EWS Bot
Comment 6 2013-03-19 02:50:29 PDT
Early Warning System Bot
Comment 7 2013-03-19 02:51:12 PDT
Early Warning System Bot
Comment 8 2013-03-19 02:56:07 PDT
WebKit Review Bot
Comment 9 2013-03-19 02:56:16 PDT
Comment on attachment 193769 [details] Patch Attachment 193769 [details] did not pass chromium-ews (chromium-xvfb): Output: http://webkit-commit-queue.appspot.com/results/17194461
WebKit Review Bot
Comment 10 2013-03-19 03:03:01 PDT
Comment on attachment 193769 [details] Patch Attachment 193769 [details] did not pass cr-linux-debug-ews (chromium-xvfb): Output: http://webkit-commit-queue.appspot.com/results/17194463
Allan Sandfeld Jensen
Comment 11 2013-03-19 03:06:13 PDT
EFL EWS Bot
Comment 12 2013-03-19 03:14:24 PDT
Allan Sandfeld Jensen
Comment 13 2013-03-19 03:28:50 PDT
Created attachment 193774 [details] Patch Do not use QT_VERSION_CHECK() in parts that other ports needs to parse
Pierre Rossi
Comment 14 2013-03-19 04:22:37 PDT
Comment on attachment 193774 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=193774&action=review LGTM > Source/WebCore/platform/graphics/GlyphBuffer.h:95 > +struct GlyphBufferAdvance : public QPointF { Just out of curiosity, why not use QSizeF here ? Wouldn't a simple typedef do the trick even since the function signatures match already ?
Allan Sandfeld Jensen
Comment 15 2013-03-19 04:34:28 PDT
(In reply to comment #14) > (From update of attachment 193774 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=193774&action=review > > LGTM > > > Source/WebCore/platform/graphics/GlyphBuffer.h:95 > > +struct GlyphBufferAdvance : public QPointF { > > Just out of curiosity, why not use QSizeF here ? Wouldn't a simple typedef do the trick even since the function signatures match already ? The problem is that QRawFont::advancesForGlyphIndexes takes a pointer to an QPointF array as an argument. So I want a GlyphBufferAdvance class that is also makes for a valid QPointF pointer.
Pierre Rossi
Comment 16 2013-03-19 06:16:47 PDT
Comment on attachment 193774 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=193774&action=review >>> Source/WebCore/platform/graphics/GlyphBuffer.h:95 >>> +struct GlyphBufferAdvance : public QPointF { >> >> Just out of curiosity, why not use QSizeF here ? Wouldn't a simple typedef do the trick even since the function signatures match already ? > > The problem is that QRawFont::advancesForGlyphIndexes takes a pointer to an QPointF array as an argument. So I want a GlyphBufferAdvance class that is also makes for a valid QPointF pointer. Right. So there is no way around it indeed. so now we could also save a line in Font::drawGlyphs in FontQt.cpp ;)
Allan Sandfeld Jensen
Comment 17 2013-03-19 07:00:44 PDT
Created attachment 193818 [details] Patch Moving enabling kerning by default to a separate patch
Jocelyn Turcotte
Comment 18 2013-03-19 08:59:06 PDT
Comment on attachment 193818 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=193818&action=review > Source/WebCore/platform/graphics/SimpleFontData.h:209 > +#elif PLATFORM(QT) && QT_VERSION >= 0x050100 QT_VERSION_CHECK? > Source/WebCore/platform/graphics/WidthIterator.h:69 > +#elif PLATFORM(QT) && QT_VERSION >= 0x050100 ditto LGTM too for the rest, r=me.
Allan Sandfeld Jensen
Comment 19 2013-03-19 09:03:08 PDT
Note You need to log in before you can comment on or make changes to this bug.