Bug 76048

Summary: [GTK] fast/text/font-kerning.html fails
Product: WebKit Reporter: Philippe Normand <pnormand>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: a.renevier, commit-queue, d.nomiyama, d-r, eflews.bot, gyuyoung.kim, mitz, zan
Priority: P2 Keywords: Gtk, LayoutTestFailure
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
testcase
none
Patch
none
Patch
none
Patch none

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.