Bug 119838 - [Qt] Kerning in fast font path breaks letter-spacing
Summary: [Qt] Kerning in fast font path breaks letter-spacing
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Allan Sandfeld Jensen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-15 07:52 PDT by Allan Sandfeld Jensen
Modified: 2013-08-16 11:34 PDT (History)
4 users (show)

See Also:


Attachments
Patch (3.81 KB, patch)
2013-08-15 08:08 PDT, Allan Sandfeld Jensen
no flags Details | Formatted Diff | Diff
Patch (3.65 KB, patch)
2013-08-16 08:08 PDT, Allan Sandfeld Jensen
jturcotte: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Allan Sandfeld Jensen 2013-08-15 07:52:13 PDT
If CSS letter-spacing is used shaping makes very little sense and should be disabled. At least in the Qt implementation of applyTransforms(), letter spacing is also currently completely overriden.
Comment 1 Allan Sandfeld Jensen 2013-08-15 08:08:40 PDT
Created attachment 208810 [details]
Patch
Comment 2 Allan Sandfeld Jensen 2013-08-16 06:42:34 PDT
Since we enable kerning by default in 5.1 this actually break CSS letter-spacing in most cases in 5.1.0. While not the most important CSS property, it is still a regression, so I plan to cherry-pick it for 5.1.1 or 5.1.2. What do you think jocelyn?
Comment 3 Jocelyn Turcotte 2013-08-16 07:14:30 PDT
Quoting http://www.w3.org/TR/css-fonts-3/ :

"If the ‘letter-spacing’ property is defined, kerning adjustments are considered part of the default spacing and letter spacing adjustments are made after kerning has been applied."

So it seems like we should be handling it or set it as a limitation without affecting other ports.
Comment 4 Allan Sandfeld Jensen 2013-08-16 07:42:02 PDT
(In reply to comment #3)
> Quoting http://www.w3.org/TR/css-fonts-3/ :
> 
> "If the ‘letter-spacing’ property is defined, kerning adjustments are considered part of the default spacing and letter spacing adjustments are made after kerning has been applied."
> 
> So it seems like we should be handling it or set it as a limitation without affecting other ports.

Okay, so it is defined for kerning, but I am still unsure about other types of shaping. Especially ones that tries for fuse the letters together.

But I will change this to a Qt specific bug and let the complex path handle it.
Comment 5 Allan Sandfeld Jensen 2013-08-16 08:08:01 PDT
Created attachment 208925 [details]
Patch
Comment 6 Allan Sandfeld Jensen 2013-08-16 09:02:24 PDT
Committed r154186: <http://trac.webkit.org/changeset/154186>
Comment 7 Glenn Adams 2013-08-16 11:25:22 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > Quoting http://www.w3.org/TR/css-fonts-3/ :
> > 
> > "If the ‘letter-spacing’ property is defined, kerning adjustments are considered part of the default spacing and letter spacing adjustments are made after kerning has been applied."
> > 
> > So it seems like we should be handling it or set it as a limitation without affecting other ports.
> 
> Okay, so it is defined for kerning, but I am still unsure about other types of shaping. Especially ones that tries for fuse the letters together.
> 
> But I will change this to a Qt specific bug and let the complex path handle it.

You definitely would NOT want letter-spacing to cause Arabic letters to not be joined. There is a thread discussing this topic (in related to ligatures) at [1].

[1] http://lists.w3.org/Archives/Public/www-style/2013Aug/0211.html
Comment 8 Allan Sandfeld Jensen 2013-08-16 11:34:07 PDT
(In reply to comment #7)
> (In reply to comment #4)
> > (In reply to comment #3)
> > > Quoting http://www.w3.org/TR/css-fonts-3/ :
> > > 
> > > "If the ‘letter-spacing’ property is defined, kerning adjustments are considered part of the default spacing and letter spacing adjustments are made after kerning has been applied."
> > > 
> > > So it seems like we should be handling it or set it as a limitation without affecting other ports.
> > 
> > Okay, so it is defined for kerning, but I am still unsure about other types of shaping. Especially ones that tries for fuse the letters together.
> > 
> > But I will change this to a Qt specific bug and let the complex path handle it.
> 
> You definitely would NOT want letter-spacing to cause Arabic letters to not be joined. There is a thread discussing this topic (in related to ligatures) at [1].
> 
> [1] http://lists.w3.org/Archives/Public/www-style/2013Aug/0211.html

Well fortunately arabic and other joined scripts are all currently handled by the complex path. Fast font path can currently only handle kerning and ligatures. How should letter spacing handle ligatures, should be glyph-spacing or should it disable ligatures?