Bug 36105

Summary: Unevenly distributed space in justified text
Product: WebKit Reporter: mitz
Component: TextAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, eric, webkit.review.bot
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: data:text/html,<div style="font-family: ahem; text-align: justify; width: 290px; border: solid blue; font-size: 10px;">l l l l l l l l l l l l <span style="visibility: hidden;">llllll
Attachments:
Description Flags
Sketch of fix
none
Distribute justification padding more evenly simon.fraser: review+

mitz
Reported 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).
Attachments
Sketch of fix (1.21 KB, patch)
2010-03-14 23:23 PDT, mitz
no flags
Distribute justification padding more evenly (deleted)
2010-06-13 22:27 PDT, mitz
simon.fraser: review+
mitz
Comment 1 2010-03-14 21:57:54 PDT
mitz
Comment 2 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.
mitz
Comment 3 2010-06-13 22:27:56 PDT
Created attachment 58622 [details] Distribute justification padding more evenly
Simon Fraser (smfr)
Comment 4 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.
mitz
Comment 5 2010-06-14 10:07:52 PDT
WebKit Review Bot
Comment 6 2010-06-14 10:30:13 PDT
http://trac.webkit.org/changeset/61128 might have broken Qt Linux Release
Eric Seidel (no email)
Comment 7 2010-06-14 12:22:52 PDT
Yup. Looks like the test fails on Qt.
Note You need to log in before you can comment on or make changes to this bug.