[WebKit-devel] [Bug 291277] Does not justify or does not distribute whitespace

Pol polbrian at orange.fr
Wed Feb 22 22:41:58 UTC 2012


https://bugs.kde.org/show_bug.cgi?id=291277





--- Comment #20 from Pol <polbrian orange fr>  2012-02-22 22:41:57 ---
(In reply to comment #18)

> How exactly are you going to know the amount of spaces to add between words if
> you actually do not have the font metrics information ? That is why the font
> type and size, i.e. your fonts settings, and the justified text shown on the
> page are related to one another.

I suppose webkit 1. If style.whitespace == normal, all white spaces are
collapsed; 2. What's not whitespace makes up anonymous inline blocks of known
width (webkit has the font metrics); 3. Sets as many inline blocks so as total
width + (n-1) word spaces does not exceed line length (I can measure this
dimension on the left-align version); 4. Distributes the leftover space between
the in-line blocks (I can calculate the increment to every word space).

This observation led me to remark that those words that were separated by more
than one space (i.e. one space and one line feed) were (approximately, I
confess) correctly spaced in the failed rendering. So I tried to encode two
spaces at all points, and the rendering was nearly OK. Note that I did not need
to knows the details of font metrics, and that the rendering is good in
left-aligned style shows that webkit does not get that font information wrong
very much.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the WebKit-devel mailing list