After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 528550 - Wrong glyphs using a japanese locale
Wrong glyphs using a japanese locale
Status: RESOLVED NOTABUG
Product: pango
Classification: Platform
Component: general
1.20.x
Other Linux
: Normal normal
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2008-04-17 11:26 UTC by Marco Barisione
Modified: 2008-04-17 16:15 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test glyphs in pango (2.19 KB, text/plain)
2008-04-17 11:35 UTC, Marco Barisione
Details

Description Marco Barisione 2008-04-17 11:26:59 UTC
When using a japanese locale with the pango back-end of WebKit then wrong characters are displayed. See https://bugs.webkit.org/show_bug.cgi?id=18335 and the screenshot at https://bugs.webkit.org/attachment.cgi?id=20581&action=view

I'm not sure that the bug is in Pango but I was able to reproduce the problem with a small snippet of code.
Comment 1 Marco Barisione 2008-04-17 11:35:03 UTC
Created attachment 109412 [details]
Test glyphs in pango

The program tries to get the glyph using both FcFreeTypeCharIndex() and pango_shape() but the results are not always the same. The error could be in pango_font_get_glyph(), copied from WebKit, but it seems ok to me.

Run it with (the ja_JP.UTF-8 locale must be enabled to test it):
$ gcc -o lang-test `pkg-config --cflags --libs gtk+-2.0 cairo-ft fontconfig freetype2` lang-test.c

$ LANG=C ./lang-test
freetype: 43, pango: 43

$ LANG=ja_JP.UTF-8 ./lang-test
freetype: 42, pango: 43
Comment 2 Owen Taylor 2008-04-17 13:37:21 UTC
You have noticed that the font passed into your pango_font_get_glyph() isn't
used, right?

Basically, the pango_itemize() is picking a different font from the
"first choice" font that pango_font_map_load_font() returns.

Nothing using a function like your pango_font_get_glyph() should be called
a "Pango" backend, though maybe there was some significant distortion
in the translation to a test case. None of the capabilities of Pango
(combining fonts, shaping international text, kerning, etc, etc, etc)
will be available.

(Also, don't put even static functions into the pango_ namespace.
If they conflict with future pango functions, that isn't our problem.)
Comment 3 Marco Barisione 2008-04-17 15:39:00 UTC
Sorry for the useless bug report, but I really didn't notice it.

There is some significant distortion from the code in WebKit, that code is only used for "simple" (and optimised in some ways I don't want to know) text rendering. For more complex things 

I didn't write the code, just trying to fix a bug, so I didn't choose the name but probably it should be a C++ private method to follow WebKit conventions.

Thanks.
Comment 4 Behdad Esfahbod 2008-04-17 16:15:55 UTC
Gcc should have warned you that the font argument to your pango_font_get_glyph() function is unused.  That's quite telling.