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 121488 - Thai modules display garbage
Thai modules display garbage
Status: RESOLVED FIXED
Product: pango
Classification: Platform
Component: general
1.2.x
Other All
: High major
: 1.2.5
Assigned To: pango-maint
pango-maint
Depends on:
Blocks: 124175
 
 
Reported: 2003-09-04 20:06 UTC by Theppitak Karoonboonyanan
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.3/2.4


Attachments
A workaround patch (661 bytes, patch)
2003-09-04 20:31 UTC, Theppitak Karoonboonyanan
none Details | Review
Removing preprocessing from thai-shaper (5.75 KB, patch)
2003-09-05 05:08 UTC, Theppitak Karoonboonyanan
none Details | Review

Description Theppitak Karoonboonyanan 2003-09-04 20:06:44 UTC
Symptom: Thai-xft and thai-ft2 modules display all Thai characters using
"unknown 
glyphs" (boxed hexadecimal of their 8-bit TIS-620 codes) instead of correct
Thai 
glyphs.

My analysis: thai-x, thai-xft, and thai-ft2 share the same object file
thai-shaper.lo,
but the header file thai-shaper.h is preprocessed differently by the HAVE_X
macro.
As a result, the struct _ThaiFontInfo defined in the header varies its
structure across
the compilation units.

The thai-shaper.lo is generated by the first build, which appears to be
thai-x in the 
Makefile. Thus, the struct appears fine for it, but the rest ones access
different struct.
And the assignments of pointers to functions are shifted, which appears to
assign
the make_unknown_glyph() function to the offset of make_glyph() function
pointer
member as seen by thai-shaper.lo.
Comment 1 Theppitak Karoonboonyanan 2003-09-04 20:22:28 UTC
A remedy: Make it more object-oriented.

The extra element of the X backend should be made in a somewhat
"derived class".

However, considering the trivialness of the single extra member, a simple
workaround might help, by moving the extra element to the end of struct,
as in the attached patch.
Comment 2 Theppitak Karoonboonyanan 2003-09-04 20:31:44 UTC
Created attachment 19742 [details] [review]
A workaround patch
Comment 3 Owen Taylor 2003-09-04 20:41:53 UTC
Note that the code is entirely different in CVS HEAD, so complicated
fixes to gtk-2-2 probably don't make sense.

I think the simplest thing woudl be simply to include "config.h"
in thai-shaper.h.
Comment 4 Theppitak Karoonboonyanan 2003-09-05 05:06:09 UTC
I think the problem is the content of thai-shaper.lo itself. There
should be
only one version of it.  So, I think removing any preprocessing from it
should be done.  And I've prepared another patch that does that.

(Yes, I realize the difference with CVS HEAD.  Hoping the fix is not too
complicated.)
Comment 5 Theppitak Karoonboonyanan 2003-09-05 05:08:16 UTC
Created attachment 19760 [details] [review]
Removing preprocessing from thai-shaper
Comment 6 Owen Taylor 2003-09-08 18:44:29 UTC
Is it really worth rewriting stuff in the 1.2.x branch, which
will shortly be dead. All that is needed, to fix the problem,
is, I think:

--- pango-1.2.5/modules/thai/thai-shaper.h.thai 2003-09-08
12:04:55.000000000 -0400
+++ pango-1.2.5/modules/thai/thai-shaper.h      2003-09-08
12:05:01.000000000 -0400
@@ -1,6 +1,8 @@
 #ifndef __THAI_SHAPER_H__
 #define __THAI_SHAPER_H__
  
+#include "config.h"
+
 #ifdef HAVE_X
 #include "pangox.h"
 #endif
Comment 7 Theppitak Karoonboonyanan 2003-09-09 05:19:56 UTC
OK. It does work. (Sorry that I didn't get the point in the first place
how it works.) 

So, provided that only the type, not any function, from pangox
is referenced in thai-shaper, this should be fine. (Otherwise,
the linking error would come back again.)
Comment 8 Theppitak Karoonboonyanan 2003-10-09 04:38:54 UTC
Please proceed to close this bug. Its seriousness for Thai users is
comparable to security fixes. (In fact, it's serious enough to be a
measurement for which distro is the quickest in fixing it. And we have got
a winner. :-P)
Comment 9 Owen Taylor 2003-10-09 05:53:29 UTC
If you want to commit a fix to the pango-1-2 branch,
that's fine with me. Otherwise I'll get to it next time I 
do a stable release.

[ For Red Hat, the patch is in our CVS repository since 8 September,
  and the RHEL 3 beta 2 Pango RPMS. But it really doesn't matter
  much since we don't ship any scaleable Thai fonts...]
Comment 10 Theppitak Karoonboonyanan 2003-10-09 13:39:51 UTC
Well, I don't have a commit account.
So, I need your hands for this.
Comment 11 Theppitak Karoonboonyanan 2003-10-09 13:54:18 UTC
[BTW, in case you want to include some Thai scalable fonts in Red Hat,
 you may get some from 
 ftp://linux.thai.net/pub/thailinux/software/thaifonts-scalable/
 or for cvs snapshot:
 cvs -d :pserver:anonymous@linux.thai.net:/home/cvs co
software/thaifonts-scalable
 version 0.4.0 is just gonna been released soon. Any suggestion
 is appreciated.]
Comment 12 Owen Taylor 2004-01-27 16:18:35 UTC
I've applied the fix in CVS now, though I don't think I'll
be doing another Pango-1.2.x release.