Bug 36105 - Unevenly distributed space in justified text
Summary: Unevenly distributed space in justified text
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL: data:text/html,<div style="font-famil...
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2010-03-14 21:56 PDT by mitz
Modified: 2010-06-14 12:22 PDT (History)
3 users (show)

See Also:


Attachments
Sketch of fix (1.21 KB, patch)
2010-03-14 23:23 PDT, mitz
no flags Details | Formatted Diff | Diff
Distribute justification padding more evenly (deleted)
2010-06-13 22:27 PDT, mitz
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mitz 2010-03-14 21:56:36 PDT
When extra spacing needs to be added between words for text justification, WidthIterator (and the complex text implementations) distribute the extra space very unevenly: all word spaces but the last get the same number of pixels added to them, and the last space takes the remainder. See the URL for an example where all spaces are 16 pixels wide except the last one, which is only 10 pixels wide.

This may even be a regression (but a very old one).
Comment 1 mitz 2010-03-14 21:57:54 PDT
<rdar://problem/7752961>
Comment 2 mitz 2010-03-14 23:23:41 PDT
Created attachment 50684 [details]
Sketch of fix

Need to do this in the complex text code paths. Can save one roundf() per space by caching the result.
Comment 3 mitz 2010-06-13 22:27:56 PDT
Created attachment 58622 [details]
Distribute justification padding more evenly
Comment 4 Simon Fraser (smfr) 2010-06-14 08:14:15 PDT
Comment on attachment 58622 [details]
Distribute justification padding more evenly

r=me. I would, however, prefer at sentence independent from the file listing in the changelog that gives the gist of the change.
Comment 5 mitz 2010-06-14 10:07:52 PDT
Fixed in <http://trac.webkit.org/projects/webkit/changeset/61128>.
Comment 6 WebKit Review Bot 2010-06-14 10:30:13 PDT
http://trac.webkit.org/changeset/61128 might have broken Qt Linux Release
Comment 7 Eric Seidel (no email) 2010-06-14 12:22:52 PDT
Yup.  Looks like the test fails on Qt.