WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
32794
With text-rendering: optimizelegibility, sometimes lines run too long
https://bugs.webkit.org/show_bug.cgi?id=32794
Summary
With text-rendering: optimizelegibility, sometimes lines run too long
mitz
Reported
2009-12-20 08:55:46 PST
The attached test case shows the using text-rendering: optimizelegibility can cause lines to break too late, and the effect that it has on left-aligned and on justified text. Perhaps there is a discrepancy between how text is measured for the purpose of line breaking and how it’s actually rendered afterwards.
Attachments
Test case
(559 bytes, text/html)
2009-12-20 08:56 PST
,
mitz
no flags
Details
Allow trailing space to affect kerning when measuring a word
(60.58 KB, patch)
2010-01-06 17:17 PST
,
mitz
sam
: review+
Details
Formatted Diff
Diff
View All
Add attachment
proposed patch, testcase, etc.
mitz
Comment 1
2009-12-20 08:56:38 PST
Created
attachment 45282
[details]
Test case
mitz
Comment 2
2009-12-20 08:57:03 PST
<
rdar://problem/7488126
>
mitz
Comment 3
2010-01-06 17:17:47 PST
Created
attachment 46010
[details]
Allow trailing space to affect kerning when measuring a word
WebKit Review Bot
Comment 4
2010-01-06 17:19:13 PST
style-queue ran check-webkit-style on
attachment 46010
[details]
without any errors.
Darin Adler
Comment 5
2010-01-06 17:29:22 PST
Comment on
attachment 46010
[details]
Allow trailing space to affect kerning when measuring a word
> + TextRenderingMode textRenderingMode = f.fontDescription().textRenderingMode(); > + // Non-zero only when kerning is enabled, in which case we measure words with their trailing > + // space, then subtract its width. > + int wordTrailingSpaceWidth = textRenderingMode == OptimizeLegibility || textRenderingMode == GeometricPrecision ? f.spaceWidth() + wordSpacing : 0;
I think it would be clearer to have a function named allowsKerning or something like that. It could contain: TextRenderingMode textRenderingMode = f.fontDescription().textRenderingMode(); textRenderingMode == OptimizeLegibility || textRenderingMode == GeometricPrecision Then you could saw: wordTrailingSpaceWidth = allowsKerning(f) ? f.spaceWidth() + wordSpacing : 0; Maybe there's a better name than "allows kerning", though.
mitz
Comment 6
2010-01-06 17:39:28 PST
(In reply to
comment #5
)
> (From update of
attachment 46010
[details]
) > > + TextRenderingMode textRenderingMode = f.fontDescription().textRenderingMode(); > > + // Non-zero only when kerning is enabled, in which case we measure words with their trailing > > + // space, then subtract its width. > > + int wordTrailingSpaceWidth = textRenderingMode == OptimizeLegibility || textRenderingMode == GeometricPrecision ? f.spaceWidth() + wordSpacing : 0; > > I think it would be clearer to have a function named allowsKerning or something > like that. It could contain: > > TextRenderingMode textRenderingMode = > f.fontDescription().textRenderingMode(); > textRenderingMode == OptimizeLegibility || textRenderingMode == > GeometricPrecision > > Then you could saw: > > wordTrailingSpaceWidth = allowsKerning(f) ? f.spaceWidth() + wordSpacing : > 0; > > Maybe there's a better name than "allows kerning", though.
I intend to add two Font methods (one for kerning and one for ligatures) and deploy them here and in the many other places that currently access the TextRenderingMode.
mitz
Comment 7
2010-01-06 17:42:15 PST
Fixed in <
http://trac.webkit.org/projects/webkit/changeset/52889
>.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug