Last Comment Bug 728537 - Strange italic font rendering after bug 724231 landed
: Strange italic font rendering after bug 724231 landed
Status: RESOLVED FIXED
fixed by bug 754452
:
Product: Core
Classification: Components
Component: Layout: Text (show other bugs)
: Trunk
: x86 Windows 7
: -- normal with 2 votes (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-18 02:06 PST by Ekanan Ketunuti
Modified: 2012-07-03 16:31 PDT (History)
6 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Droid Sans font italic looks strange (196.90 KB, image/png)
2012-02-18 02:06 PST, Ekanan Ketunuti
no flags Details
testcase (239.46 KB, text/html)
2012-02-18 02:08 PST, Ekanan Ketunuti
no flags Details
gdipp disabled (168.25 KB, image/png)
2012-02-18 05:38 PST, Ekanan Ketunuti
no flags Details
Italic texts in some places aren't currently rendered (61.02 KB, image/png)
2012-02-25 01:59 PST, Kemcy BEST
no flags Details
Italic font glitch with gdi++ (197.69 KB, image/png)
2012-05-25 02:29 PDT, Antwan
no flags Details
italic fonts look pretty good now (98.57 KB, image/png)
2012-07-03 07:22 PDT, Ekanan Ketunuti
no flags Details
text transform render with GDI++ (2.89 KB, image/png)
2012-07-03 08:08 PDT, Ekanan Ketunuti
no flags Details

Description Ekanan Ketunuti 2012-02-18 02:06:15 PST
Created attachment 598507 [details]
Droid Sans font italic looks strange

bug 724231 comment 5 spin off


first bad nightly: 2012-02-16-03-12-31

m-i build changeset:
last good revision is 392319d8c1fa
first bad revision is d32d00967753

pushlog:
https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=392319d8c1fa&tochange=d32d00967753
Comment 1 Ekanan Ketunuti 2012-02-18 02:08:42 PST
Created attachment 598508 [details]
testcase

These fonts look really strange:

Dotum
Droid Sans
Estrangelo Edessa
Lucida Console
Lucida Sans Unicode
Microsoft Sans Serif
Segoe Print
Segoe Script
Tahoma
Comment 2 Jonathan Kew (:jfkthame) 2012-02-18 02:32:27 PST
There seem to be two issues here. One is that glyph positioning/spacing is poor in cases where synthetic italics are used; I'm guessing this happens because we handle pixel-rounding differently somewhere when a transform is in effect. I can reproduce this here, and will try to pin it down more specifically.

The second (and very puzzling) issue is that your screenshots show incorrect subpixel antialiasing of the synthetic-italic glyphs. If you zoom in and look at the images, you can see that in these cases, the reddish and blueish fringes are on the opposite sides of the glyphs from all the rest of the (non-synth-italic) text. That mismatch means that in addition to the glyph spacing being uneven, the glyph shapes themselves look awfully rough on your system. However, I can _not_ reproduce this issue here; the subpixel AA remains correct for me.

Please post the Graphics section from about:support, so we can see if that offers any clues about why you're seeing different antialiasing behavior.
Comment 3 Ekanan Ketunuti 2012-02-18 02:39:13 PST
Graphics:

Adapter DescriptionMobile Intel(R) 4 Series Express Chipset Family
Vendor ID0x8086
Device ID0x2a42
Adapter RAM Unknown
Adapter Drivers igdumdx32 igd10umd32
Driver Version 8.15.10.2302
Driver Date 2-11-2011
Direct2D Enabled false
DirectWrite Enabled false (6.1.7601.17563)
ClearType ParametersGamma: 2200 Pixel Structure: BGR ClearType Level: 0 Enhanced Contrast: 50 
WebGL Renderer Google Inc. -- ANGLE (Mobile Intel(R) 4 Series Express Chipset Family) -- OpenGL ES 2.0 (ANGLE 1.0.0.963)
GPU Accelerated Windows 1/1 Direct3D 9
AzureBackend skia


Note: I also use gdipp https://code.google.com/p/gdipp/
Comment 4 Jonathan Kew (:jfkthame) 2012-02-18 05:12:13 PST
Could you please try disabling gdipp, and see if that affects the rendering at all? I don't expect it to make any difference to the poor glyph spacing, but I'm curious about the reversed subpixel antialiasing of the synthetic-italic glyphs, as I have not yet been able to reproduce that on my system.
Comment 5 Ekanan Ketunuti 2012-02-18 05:38:04 PST
Created attachment 598522 [details]
gdipp disabled

(In reply to Jonathan Kew (:jfkthame) from comment #4)
> Could you please try disabling gdipp, and see if that affects the rendering
> at all? I don't expect it to make any difference to the poor glyph spacing,
> but I'm curious about the reversed subpixel antialiasing of the
> synthetic-italic glyphs, as I have not yet been able to reproduce that on my
> system.


gdipp disabled, ss using attachment 598508 [details]
Comment 6 Jonathan Kew (:jfkthame) 2012-02-18 05:59:25 PST
Aha - in this screenshot, you're no longer getting reversed subpixel AA on the italicized glyphs. So it looks like that may be a gdipp bug, and you might want to report it there.

The spacing issue is of course still present; that's a problem with our handling of glyph metrics and transformations.
Comment 7 Kemcy BEST 2012-02-25 01:59:29 PST
Created attachment 600635 [details]
Italic texts in some places aren't currently rendered

This bug is confirmed using Mactype (font rendering software like gdipp) starting from the same build as the reporter.
Comment 8 Jonathan Kew (:jfkthame) 2012-02-25 02:14:57 PST
(In reply to Kemcy BEST from comment #7)
> Created attachment 600635 [details]
> Italic texts in some places aren't currently rendered
> 
> This bug is confirmed using Mactype (font rendering software like gdipp)
> starting from the same build as the reporter.

This screenshot does not show the same issue (incorrect subpixel order used when rendering the synthetic-italic text) as the gdipp example, but it does look as though it's using a font rasterization codepath that doesn't handle hinting. I'd guess that Mactype sees that there's a skew transform in the context, and decides it can't handle glyph hinting in this situation.

Probably, both gdipp and Mactype suffer from problems when they're asked to render text that's undergoing a transform. I think that's a deficiency in those components.

As noted in comment 6, I believe there's also a glyph spacing problem that we need to try and fix, but I don't think we can fix the poor glyph rendering you're seeing with these third-party renderers.
Comment 9 Ekanan Ketunuti 2012-04-13 20:11:50 PDT
Copy from Mactype author http://code.google.com/p/mactype/issues/detail?id=4 :

"actually, this is on firefox side.

Mozilla team strangely use GDI transformation to simulate italic font, not using native GDI italic font directly, while all the other browsers use the native one. Mozilla explain this as it was caused by a resource leak bug. This is ridiculous that only firefox has such a fun problem and they blame to the GDI architecture.

since it is real hard to support GDI distortion (GDI Zooming and tensile is already supported), mactype and gdipp won't be able render these "italic" font in the future."

:(
Comment 10 Antwan 2012-05-25 02:29:33 PDT
Created attachment 627145 [details]
Italic font glitch with gdi++

FYI
I have the same issue using GDI++ font rasteriser on WinXP x86 / Firefox 13.0b
This is very annoying for me the text cannot be read at all.

Since all was perfect before, this is necessarily a regress inside Firefox...
Comment 11 Jonathan Kew (:jfkthame) 2012-05-25 03:09:18 PDT
You're seeing completely garbled glyph positioning in some cases, which is different from the (relatively minor) positioning problems in previous screenshots.

What does GDI++ make of an example such as this?
data:text/html,<div style="margin:100px;-moz-transform:rotate(-5deg)">this is a test for transformed content
Comment 12 Jonathan Kew (:jfkthame) 2012-05-25 03:11:20 PDT
BTW, there's a patch in bug 754452 that should work around these problems for many of the common cases, at least; once that gets reviewed and landed, the issues should be pretty rare.
Comment 13 Ekanan Ketunuti 2012-07-03 07:22:58 PDT
Created attachment 638715 [details]
italic fonts look pretty good now

I believe that patch in bug 754452 fix the problem.
Comment 14 Jonathan Kew (:jfkthame) 2012-07-03 07:34:21 PDT
It avoids the problem for the majority of cases; there will still be certain examples where it can occur, but they should be rare.

I'm still curious how the example in comment #11 renders with GDI++ active; does the transform there cause glyph-rendering problems?
Comment 15 Ekanan Ketunuti 2012-07-03 08:08:03 PDT
Created attachment 638735 [details]
text transform render with GDI++

GDI++ download from http://free.flop.jp/gdi++/src/gdi0959.zip
Comment 16 Jonathan Kew (:jfkthame) 2012-07-03 08:29:10 PDT
Wow. That's _really_ broken! Might be worth reporting to the GDI++ project.
Comment 17 Ekanan Ketunuti 2012-07-03 16:30:33 PDT
Nothing can do from firefox side to fix the issue in GDI++ so Antwan you can uninstall GDI++ and use the other software (Mactype http://code.google.com/p/mactype is the best) at least until the issue is fixed in GDI++.

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