Bug 76048 - [GTK] fast/text/font-kerning.html fails
Summary: [GTK] fast/text/font-kerning.html fails
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: Gtk, LayoutTestFailure
Depends on:
Blocks:
 
Reported: 2012-01-11 03:42 PST by Philippe Normand
Modified: 2013-07-05 01:53 PDT (History)
8 users (show)

See Also:


Attachments
testcase (327 bytes, text/html)
2012-08-15 15:02 PDT, arno.
no flags Details
Patch (3.65 KB, patch)
2013-05-23 05:49 PDT, Denis Nomiyama (dnomi)
no flags Details | Formatted Diff | Diff
Patch (4.94 KB, patch)
2013-05-23 10:10 PDT, Denis Nomiyama (dnomi)
no flags Details | Formatted Diff | Diff
Patch (4.88 KB, patch)
2013-05-24 02:19 PDT, Denis Nomiyama (dnomi)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Comment 1 mitz 2012-01-11 10:12:27 PST
Can you debug this? A good place to start would be to look at Font::typesettingFeatures() as you enter Font::codePath() for each line in the test.
Comment 2 Philippe Normand 2012-01-11 10:24:56 PST
(In reply to comment #1)
> Can you debug this? A good place to start would be to look at Font::typesettingFeatures() as you enter Font::codePath() for each line in the test.

Will do, thanks for the hints Dan!
Comment 3 mitz 2012-01-11 13:12:35 PST
See also bug 76050.
Comment 4 Philippe Normand 2012-01-16 09:06:42 PST
Hum I can't reproduce this failure here :(
Comment 5 arno. 2012-08-15 14:47:56 PDT
I can reproduce the bug.
Actually, for "-webkit-font-kerning: none; text-rendering: optimizelegibility", the complex text path is taken. That's probably correct because there may be some ligatures.
But unfortunately, it's not possible to disable kerning (nor ligatures) in the complex codepath. I tried to find a way to tell pango to not enable kerning, but I didn't suceed.
Comment 6 arno. 2012-08-15 15:02:38 PDT
Created attachment 158643 [details]
testcase
Comment 7 Denis Nomiyama (dnomi) 2013-05-23 05:49:47 PDT
Created attachment 202669 [details]
Patch
Comment 8 Martin Robinson 2013-05-23 07:43:00 PDT
Comment on attachment 202669 [details]
Patch

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

> Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp:502
> +        if (m_font->fontDescription().kerning() == FontDescription::NoneKerning) {
> +            Vector<hb_feature_t, 5> features = m_features;
> +            hb_feature_t kerning = { HB_TAG('k', 'e', 'r', 'n'), 0, 0, static_cast<unsigned>(-1) };
> +            features.append(kerning);
> +            hb_shape(harfBuzzFont.get(), harfBuzzBuffer.get(), features.data(), features.size());
> +        } else

Hrm. A more likely location for this change is HarfBuzzShaper::setFontFeatures where the rest of the feature are set, no? Aren't you also adding 'kern' to the feature list here instead of removing it?
Comment 9 Denis Nomiyama (dnomi) 2013-05-23 10:01:05 PDT
Comment on attachment 202669 [details]
Patch

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

>> Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp:502
>> +        } else
> 
> Hrm. A more likely location for this change is HarfBuzzShaper::setFontFeatures where the rest of the feature are set, no? Aren't you also adding 'kern' to the feature list here instead of removing it?

Good point about setFontFeatures(). The idea is to add 'kern' as 0 (disabled) to the feature list in case of NoneKerning. I will also include a case for NormalKerning.
Comment 10 Denis Nomiyama (dnomi) 2013-05-23 10:10:26 PDT
Created attachment 202724 [details]
Patch
Comment 11 EFL EWS Bot 2013-05-23 10:33:54 PDT
Comment on attachment 202724 [details]
Patch

Attachment 202724 [details] did not pass efl-ews (efl):
Output: http://webkit-queues.appspot.com/results/651023
Comment 12 Denis Nomiyama (dnomi) 2013-05-24 02:15:58 PDT
Comment on attachment 202724 [details]
Patch

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

> Source/WebCore/platform/graphics/harfbuzz/HarfBuzzShaper.cpp:357
> +        kerning = { HarfBuzzFace::kernTag, 0, 0, static_cast<unsigned>(-1) };

I will remove this cheesy initialisation that requires c++11.
Comment 13 Denis Nomiyama (dnomi) 2013-05-24 02:19:20 PDT
Created attachment 202791 [details]
Patch
Comment 14 WebKit Commit Bot 2013-07-05 01:53:22 PDT
Comment on attachment 202791 [details]
Patch

Clearing flags on attachment: 202791

Committed r152411: <http://trac.webkit.org/changeset/152411>
Comment 15 WebKit Commit Bot 2013-07-05 01:53:25 PDT
All reviewed patches have been landed.  Closing bug.