Bug 18335

Summary: Pango font backend unable to display japanese properly
Product: WebKit Reporter: Mike Hommey <mh+webkit>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: alp, marco.barisione
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Other   
OS: Linux   
Attachments:
Description Flags
No font is set -> junk and ugly font
none
Font set -> ok
none
Screenshot of GtkLauncher with the wrong rendered page
none
Pass the right font to pango_shape alp: review+

Mike Hommey
Reported 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)
Attachments
No font is set -> junk and ugly font (110 bytes, text/html)
2008-04-16 03:48 PDT, Marco Barisione
no flags
Font set -> ok (106 bytes, text/html)
2008-04-16 03:49 PDT, Marco Barisione
no flags
Screenshot of GtkLauncher with the wrong rendered page (13.73 KB, image/png)
2008-04-16 04:00 PDT, Marco Barisione
no flags
Pass the right font to pango_shape (1.77 KB, patch)
2008-04-17 09:35 PDT, Marco Barisione
alp: review+
Mike Hommey
Comment 1 2008-04-06 22:16:01 PDT
Interestingly, with LANG=ja_JP.UTF-8 and pango backend, ASCII text is displayed as garbage.
Marco Barisione
Comment 2 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
Mike Hommey
Comment 3 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...
Marco Barisione
Comment 4 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.
Marco Barisione
Comment 5 2008-04-16 03:48:56 PDT
Created attachment 20579 [details] No font is set -> junk and ugly font
Marco Barisione
Comment 6 2008-04-16 03:49:34 PDT
Created attachment 20580 [details] Font set -> ok
Marco Barisione
Comment 7 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
Marco Barisione
Comment 8 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
Marco Barisione
Comment 9 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.
Mike Hommey
Comment 10 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 ?
Alp Toker
Comment 11 2008-04-17 12:36:56 PDT
Comment on attachment 20629 [details] Pass the right font to pango_shape r=me
Alp Toker
Comment 12 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!
Alp Toker
Comment 13 2008-04-17 12:38:33 PDT
Landed in r32010.
Note You need to log in before you can comment on or make changes to this bug.