Last Comment Bug 595688 - text-rendering: optimizeSpeed; doesn't work
: text-rendering: optimizeSpeed; doesn't work
Status: RESOLVED INVALID
: dev-doc-complete, regression, testcase
Product: Core
Classification: Components
Component: Layout (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
https://developer.mozilla.org/en/CSS/...
Depends on:
Blocks: 463413
  Show dependency treegraph
 
Reported: 2010-09-12 11:35 PDT by j.j.
Modified: 2010-09-13 22:53 PDT (History)
8 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
screenshots, Fx 3.6 and current trunk in Win XP (10.98 KB, image/png)
2010-09-12 16:45 PDT, j.j.
no flags Details

Description j.j. 2010-09-12 11:35:43 PDT
Mozilla/5.0 (Windows NT 5.1; rv:2.0b6pre) Gecko/20100912 Firefox/4.0b6pre

testcase is here: 
https://developer.mozilla.org/en/CSS/text-rendering#Live_Example
Comment 1 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2010-09-12 14:27:08 PDT
It's not *required* to do anything.  And we even document that it doesn't on Mac.  But it does seem odd that it isn't on Windows.  (It works on Linux.)
Comment 2 Robert Longson 2010-09-12 14:38:59 PDT
It does exactly what it says on the tin...

http://mxr.mozilla.org/mozilla-central/source/layout/base/nsLayoutUtils.cpp#3418

Whether you can see a significant visible effect is a different matter.
Comment 3 j.j. 2010-09-12 16:45:33 PDT
Created attachment 474591 [details]
screenshots, Fx 3.6 and current trunk in Win XP

This is a regression, I don't think it's intended.

Expected Result:
e.g. 20px font has kerning and ligatures enabled, 19.9px font has not

(Testcase requires "DejaVu Serif" or "Constantia" font)
Comment 4 David Baron :dbaron: ⌚️UTC-7 (busy September 14-25) 2010-09-12 17:35:08 PDT
Is it related to DirectWrite being turned on?
Comment 5 Boris Zbarsky [:bz] (TPAC) 2010-09-12 17:45:53 PDT
j.j., what happens if you disable directwrite?
Comment 6 j.j. 2010-09-12 21:15:21 PDT
unrelated to directwrite
Comment 7 Robert Longson 2010-09-12 23:36:05 PDT
Odd.
Comment 8 Robert O'Callahan (:roc) (email my personal email if necessary) 2010-09-13 00:36:49 PDT
This is just the fact that Harfbuzz landed for Windows. We no longer have a shaping "fast path", we always use HB shaping. It's pretty fast, we didn't regress performance. Since there is no longer a special fast code path, optimizeSpeed no longer selects it.
Comment 9 j.j. 2010-09-13 04:23:45 PDT
Ok, this needs documentation then

1. it is impossible to disable inadequate ligatures on Windows, right?
2. the "browser.display.auto_quality_min_font_size" pref is useless on windows

Also, bug 463413 is fixed now?
Comment 10 Jonathan Kew (:jfkthame) 2010-09-13 07:21:37 PDT
(In reply to comment #9)
> Ok, this needs documentation then
> 
> 1. it is impossible to disable inadequate ligatures on Windows, right?

You could specify

  -moz-font-feature-settings: "liga=0"

in CSS to disable default ligatures. Or use a font that doesn't have the ligatures!

> 2. the "browser.display.auto_quality_min_font_size" pref is useless on windows

I think it still has an effect on how glyph bounds are measured for drawing/refreshing the display, though you may not notice any visible difference.

> 
> Also, bug 463413 is fixed now?

It should be, I believe (for Mac OS X and Windows), though I have not tested that particular font. (As suggested in comments there, it still represents a misuse of Unicode, though. Sinhala script should be encoded using the Sinhala block beginning at U+0D80, not Basic Latin characters.)
Comment 11 j.j. 2010-09-13 07:44:57 PDT
(In reply to comment #10)

> You could specify
>   -moz-font-feature-settings: "liga=0"

oops... it was me who added "dev-doc-needed" keyword to bug 511339
Comment 12 John Daggett (:jtd) 2010-09-13 10:07:43 PDT
(In reply to comment #8)
> This is just the fact that Harfbuzz landed for Windows. We no longer have a
> shaping "fast path", we always use HB shaping. It's pretty fast, we didn't
> regress performance. Since there is no longer a special fast code path,
> optimizeSpeed no longer selects it.

Actually, this change was made earlier as part of the font restructuring done to prepare for harfbuzz.  When breaking up the text handling code into shapers, we explicitly enabled Uniscribe shaping by default, ignoring the text-rendering setting.  Unfortunately, there are bugs with Uniscribe shaping on XP so our code is now somewhat convoluted:

http://mxr.mozilla.org/mozilla-central/source/gfx/thebes/gfxGDIFont.cpp#114

So, on XP we'll pay attention to the text-rendering setting but ignore it on Vista/Win7.  The text-rendering setting has always been ignored on OSX.  Clear as mud? ;)
Comment 13 j.j. 2010-09-13 13:38:57 PDT
(In reply to comment #12)
> So, on XP we'll pay attention to the text-rendering setting

but there is no longer a visual difference in Gecko 2 on XP, right?  

Given bug 463413 comment 17, is authoring "text-rendering" for HTML content useless at all now (on Mac, Windows, Linux soon)?

Or has "text-rendering" any visual effect in Gecko 2, on any platform, that is worth to document here:
  https://developer.mozilla.org/en/CSS/text-rendering
Comment 14 Robert O'Callahan (:roc) (email my personal email if necessary) 2010-09-13 14:41:52 PDT
geometricPrecision is still useful, it will turn off hinting (although we don't implement that yet)
Comment 15 Eric Shepherd [:sheppy] 2010-09-13 21:51:32 PDT
So is it accurate to say that the documentation issue here is that optimizeSpeed no longer does anything because the normal font rendering code is fast enough that we do not (for now at least) have a faster code path?
Comment 16 Eric Shepherd [:sheppy] 2010-09-13 21:52:34 PDT
I should add that I've updated the article here to say that, and if further changes are needed, point them out and re-tag this as doc needed (or make the changes for me and make me extra happy).
Comment 17 Robert O'Callahan (:roc) (email my personal email if necessary) 2010-09-13 22:53:58 PDT
Looks great, thanks.

Note You need to log in before you can comment on or make changes to this bug.