Last Comment Bug 672456 - inflated character spacing in svg file when harfbuzz is disabled
: inflated character spacing in svg file when harfbuzz is disabled
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: Layout: Text (show other bugs)
: unspecified
: x86 Windows XP
: -- normal (vote)
: mozilla10
Assigned To: Jonathan Kew (:jfkthame)
:
Mentors:
http://dnsviz.net/d/www.mozilla.org/d...
Depends on:
Blocks: 690917
  Show dependency treegraph
 
Reported: 2011-07-19 00:16 PDT by al_9x
Modified: 2011-10-25 18:10 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch, ensure proper font is selected into the DC for GDI text layout (1.04 KB, patch)
2011-10-11 01:33 PDT, Jonathan Kew (:jfkthame)
jd.bugzilla: review+
Details | Diff | Review

Description al_9x 2011-07-19 00:16:19 PDT
Fx 5.0.1, new profile

http://dnsviz.net/d/www.mozilla.org/dnssec/auth_graph.svg

likely related to Bug 667242

Fx 3.6 renders svg text (this bug) and prints (Bug 667242) properly without harfbuzz, and so should Fx >= 4.0 with harfbuzz disabled

see Bug 639185 for the reason to disable harfbuzz on XP
Comment 1 Jonathan Kew (:jfkthame) 2011-10-10 09:48:23 PDT
Is this still a problem with the current release, or trunk builds? I tried FF7.0.1 on WinXP and did not see any spacing issues in the SVG file above.
Comment 2 Jonathan Kew (:jfkthame) 2011-10-10 10:22:33 PDT
Ah, I _can_ reproduce this - my profile had a modified value for browser.display.auto_quality_min_font_size. If you set this to 0, does the problem go away?
Comment 3 al_9x 2011-10-10 12:15:05 PDT
(In reply to Jonathan Kew (:jfkthame) from comment #2)
> Ah, I _can_ reproduce this - my profile had a modified value for
> browser.display.auto_quality_min_font_size. If you set this to 0, does the
> problem go away?

yes, also for Bug 667242 and Bug 682709

now that I know about this setting I would be inclined to set it high (if not for these bugs), since, like with harfbuzz, I actually want to turn off the fancy rendering features.
Comment 4 al_9x 2011-10-10 12:42:50 PDT
one thing that's not clear to me, assuming no bugs, are there still advanced rendering features active, when harfbuzz is disabled, for auto_quality_min_font_size to affect?  Or should auto_quality_min_font_size make no difference when harfbuzz is disabled?
Comment 5 Jonathan Kew (:jfkthame) 2011-10-10 13:03:59 PDT
(In reply to al_9x from comment #4)
> one thing that's not clear to me, assuming no bugs, are there still advanced
> rendering features active, when harfbuzz is disabled, for
> auto_quality_min_font_size to affect?  Or should auto_quality_min_font_size
> make no difference when harfbuzz is disabled?

With harfbuzz disabled, the issue comes down to whether we use Uniscribe to lay out the text, or just draw glyphs individually using GDI. In theory, Uniscribe could implement some effects such as ligatures or kerning, but I believe the standard version on XP does little or none of this for Latin script, at least, so it's quite likely you wouldn't see any difference.
Comment 6 al_9x 2011-10-10 13:35:48 PDT
(In reply to Jonathan Kew (:jfkthame) from comment #5)
> (In reply to al_9x from comment #4)
> > one thing that's not clear to me, assuming no bugs, are there still advanced
> > rendering features active, when harfbuzz is disabled, for
> > auto_quality_min_font_size to affect?  Or should auto_quality_min_font_size
> > make no difference when harfbuzz is disabled?
> 
> With harfbuzz disabled, the issue comes down to whether we use Uniscribe to
> lay out the text, or just draw glyphs individually using GDI. In theory,
> Uniscribe could implement some effects such as ligatures or kerning, but I
> believe the standard version on XP does little or none of this for Latin
> script, at least, so it's quite likely you wouldn't see any difference.

So auto_quality_min_font_size switches between Uniscribe and GDI when harbuzz is disabled, setting it to 0 forces Uniscribe, which works, is that right?

Then it's individual GDI that's currently buggy?

What method does 3.6 use, Uniscribe?

When harfbuzz is enabled, what does auto_quality_min_font_size do:

a. modify harfbuzz?
b. switch between harfbuzz and uniscribe?
Comment 7 Jonathan Kew (:jfkthame) 2011-10-11 01:27:42 PDT
(In reply to al_9x from comment #6)
> So auto_quality_min_font_size switches between Uniscribe and GDI when
> harbuzz is disabled, setting it to 0 forces Uniscribe, which works, is that
> right?

At sizes below auto_quality_min_font_size, we use the GDI path unless the text requires complex-script shaping.

> Then it's individual GDI that's currently buggy?

Apparently so.

> What method does 3.6 use, Uniscribe?

Both - but all this code has been extensively restructured since then, and it looks like something broke...

> When harfbuzz is enabled, what does auto_quality_min_font_size do:
> 
> a. modify harfbuzz?
> b. switch between harfbuzz and uniscribe?

c. Nothing.

(Actually, I think it still affects how we compute bounding rectangles, to determine areas that need repainting - they're more accurate once the font size exceeds auto_quality_min_font_size. But there's no effect on glyph layout behavior.)
Comment 8 Jonathan Kew (:jfkthame) 2011-10-11 01:33:05 PDT
Created attachment 566145 [details] [diff] [review]
patch, ensure proper font is selected into the DC for GDI text layout

It looks like on XP, there are cases (at least in SVG text and when printing) where the DC doesn't have the right font preselected when gfxGDIFont::InitTextRun is called. So we should make sure it's selected here.

Those who are experiencing this bug: Please test with the tryserver build at https://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/jkew@mozilla.com-9d3ee39d7727/try-win32/ and confirm whether it fixes the problem.
Comment 9 al_9x 2011-10-11 02:50:13 PDT
(In reply to Jonathan Kew (:jfkthame) from comment #8)
> Those who are experiencing this bug: Please test with the tryserver build at
> https://ftp.mozilla.org/pub/mozilla.org/firefox/try-builds/jkew@mozilla.com-
> 9d3ee39d7727/try-win32/ and confirm whether it fixes the problem.

Yes, new profile, gfx.font_rendering.harfbuzz.scripts=0, spacing is ok.
Comment 10 Jonathan Kew (:jfkthame) 2011-10-25 05:32:56 PDT
Pushed to inbound:
https://hg.mozilla.org/integration/mozilla-inbound/rev/df77779b340e
Comment 11 Ed Morley [:emorley] 2011-10-25 18:10:54 PDT
https://hg.mozilla.org/mozilla-central/rev/df77779b340e

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