Bug 36532

Summary: [Qt] Use integer pixel metric QFont API to fix rounding errors in text rendering on the Mac
Product: WebKit Reporter: Simon Hausmann <hausmann>
Component: Layout and RenderingAssignee: Simon Hausmann <hausmann>
Status: CLOSED FIXED    
Severity: Normal CC: allan.jensen, commit-queue, jesus, vestbo
Priority: P3 Keywords: Qt
Version: 528+ (Nightly build)   
Hardware: Other   
OS: OS X 10.5   
Bug Depends on: 93263    
Bug Blocks: 35784    
Attachments:
Description Flags
Turns off fractional metrics for fonts used in WebKit, since WebKit expects font engine to be integer-based
none
Patch
none
Patch none

Description Simon Hausmann 2010-03-24 06:55:47 PDT
On Qt/Mac font metrics do have fractions. WebKit's text layouting is integer based, therefore visual rounding issues appear when using QtWebKit with Qt/Mac.

Eskil is adding new API to Qt 4.7 to disable fractions in pixel metrics. We should use this API.

Patch is coming soon.
Comment 1 Eskil 2010-03-25 02:42:24 PDT
Created attachment 51612 [details]
Turns off fractional metrics for fonts used in WebKit, since WebKit expects font engine to be integer-based

Compiles against Qt 4.7 as soon as the Oslo2 staging branch integrates.
Comment 2 Tor Arne Vestbø 2010-03-29 09:27:49 PDT
I'll land this when the required changes in Qt have been integrated from oslo-staging-2
Comment 3 Jesus Sanchez-Palencia 2010-04-07 06:07:05 PDT
I think that oslo-staging-2 was integrated recently.
Has this been landed yet?
Comment 4 Jesus Sanchez-Palencia 2010-04-13 07:54:40 PDT
Created attachment 53250 [details]
Patch
Comment 5 Jesus Sanchez-Palencia 2010-04-13 08:00:16 PDT
Created attachment 53251 [details]
Patch
Comment 6 WebKit Commit Bot 2010-04-13 08:21:45 PDT
Comment on attachment 53251 [details]
Patch

Clearing flags on attachment: 53251

Committed r57516: <http://trac.webkit.org/changeset/57516>
Comment 7 WebKit Commit Bot 2010-04-13 08:21:51 PDT
All reviewed patches have been landed.  Closing bug.
Comment 8 Simon Hausmann 2010-04-20 13:03:42 PDT
Revision r57516 cherry-picked into qtwebkit-2.0 with commit 692f59b5496489f88a49b4af6749b9b45df090ab
Comment 9 Allan Sandfeld Jensen 2013-03-12 06:21:07 PDT
I am not sure this hack is necesary. While WebKit still uses integer coordinates for layout (until we enable SUBPIXEL_LAYOUT). Text is not layed out using integers, but using floats. Or maybe the bug is that advances are being rounded when they shouldn't be?