Bug 18335 - Pango font backend unable to display japanese properly
Summary: Pango font backend unable to display japanese properly
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: 528+ (Nightly build)
Hardware: Other Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-06 12:56 PDT by Mike Hommey
Modified: 2008-04-17 12:38 PDT (History)
2 users (show)

See Also:


Attachments
No font is set -> junk and ugly font (110 bytes, text/html)
2008-04-16 03:48 PDT, Marco Barisione
no flags Details
Font set -> ok (106 bytes, text/html)
2008-04-16 03:49 PDT, Marco Barisione
no flags Details
Screenshot of GtkLauncher with the wrong rendered page (13.73 KB, image/png)
2008-04-16 04:00 PDT, Marco Barisione
no flags Details
Pass the right font to pango_shape (1.77 KB, patch)
2008-04-17 09:35 PDT, Marco Barisione
alp: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Hommey 2008-04-06 12:56:21 PDT
(and I guess this applies mostly to anything that is not ASCII)

The interesting thing is that it works better when using LANG=ja_JP.UTF-8.

Anyways, with LANG=en_US.UTF8, it only displays squares with the freetype backend, and empty text with the pango backend... :(

(This was tested with revision 31667)
Comment 1 Mike Hommey 2008-04-06 22:16:01 PDT
Interestingly, with LANG=ja_JP.UTF-8 and pango backend, ASCII text is displayed as garbage.
Comment 2 Marco Barisione 2008-04-15 11:51:27 PDT
I reproduced the bug with the pango back-end and it's not a WebKit bug, see http://bugzilla.gnome.org/show_bug.cgi?id=528272
Comment 3 Mike Hommey 2008-04-15 22:12:15 PDT
(In reply to comment #2)
> I reproduced the bug with the pango back-end and it's not a WebKit bug, see
> http://bugzilla.gnome.org/show_bug.cgi?id=528272

That doesn't explain the text garbling for ASCII depending on locale...
Comment 4 Marco Barisione 2008-04-16 03:47:22 PDT
(In reply to comment #3)
> (In reply to comment #2)
> > I reproduced the bug with the pango back-end and it's not a WebKit bug, see
> > http://bugzilla.gnome.org/show_bug.cgi?id=528272
> 
> That doesn't explain the text garbling for ASCII depending on locale...

I can reproduce it only with the japanese locale, not with other non-european ones.

If a font is specified using CSS everything is ok, if not you get an ugly font and wrong chars using tha pango back-end. I also tested the freetype (with debian's webkit not a revision from svn) and you get ugly fonts but the right characters.
Comment 5 Marco Barisione 2008-04-16 03:48:56 PDT
Created attachment 20579 [details]
No font is set -> junk and ugly font
Comment 6 Marco Barisione 2008-04-16 03:49:34 PDT
Created attachment 20580 [details]
Font set -> ok
Comment 7 Marco Barisione 2008-04-16 04:00:04 PDT
Created attachment 20581 [details]
Screenshot of GtkLauncher with the wrong rendered page

To reproduce it use:
LANG=ja_JP.UTF-8 ./Programs/GtkLauncher https://bugs.webkit.org/attachment.cgi?id=20579
Comment 8 Marco Barisione 2008-04-17 04:38:26 PDT
I found where the problem is but I don't know if it's a bug in pango or in our function pango_font_get_glyph() defined in WebCore/platform/graphics/gtk/GlyphPageTreeNodePango.cpp.

I opened a bug in the pango bugzilla, let's see what they think: http://bugzilla.gnome.org/show_bug.cgi?id=528550
Comment 9 Marco Barisione 2008-04-17 09:35:47 PDT
Created attachment 20629 [details]
Pass the right font to pango_shape

I didn't notice we were not passing the font to pango, so pango was returning the glyph index for another font.
Comment 10 Mike Hommey 2008-04-17 11:12:05 PDT
Shouldn't the changelog be changed to not include the whole bug report summary, which leads to think both freetype and pango are being fixed ? BTW, shall I clone this bug and retitle both for each individual issue ?
Comment 11 Alp Toker 2008-04-17 12:36:56 PDT
Comment on attachment 20629 [details]
Pass the right font to pango_shape

r=me
Comment 12 Alp Toker 2008-04-17 12:38:15 PDT
Mike: I retitled this bug to make it Pango-specific.

Could you triage the current Chinese/Japanese bugs? I asked aroben to sort out bug tracker permissions for you.

Thanks!
Comment 13 Alp Toker 2008-04-17 12:38:33 PDT
Landed in r32010.