So here are what I've discovered so far regarding display of
multibyte (specifically Japanese) characters in GnuCash:

* For the "duh!" award of the day, the register displays everything in
Helvetica, including Japanese multibyte texts, because DEFAULT_FONT and
ITALIC_FONT are hard-coded to be Helvetica. Re-hard-coding them to be
Japanese fonts fixed that problem, but I'm not so brazen as to offer that
patch for CVS inclusion. Clearly something needs to be done about this, I'm
just not sure what. If there is a way to get the locale-specific default
font/fontset in Gtk/Gnome, I suppose the DEFAULT_FONT and ITALIC_FONT
macros could be replaced by that.

Interestingly, Japanese characters do show up fine in the drop-down list that
lists all the accounts. The result from the selection is still mangled,
though.



* The lower right hand corner (asset/profit) doesn't display multibyte
characters--namely, the Yen symbol--correctly because it also insists on
using Helvetica. Puzzlingly enough, this can be fixed by commenting out
line 863 of src/gnome/dialog-utils.c (in gnc_set_label_color):

     gtk_widget_set_style(GTK_WIDGET(label), style);

although this keeps the total from turning red when the balance is negative.
What this seems to suggest is that the font setting is fine until you run this
function, upon which some evil monolingual routine resets the font to
Helvetica!

I've also discovered, however, that running

     style->font = gdk_fontset_load(SOME_JAPANESE_FONT);

any time before gtk_widget_set_style (including during initialization of the
label widget) also "solves" the problem--so gtk_widget_set_style doesn't
*always* reset the font! Now I'm completely lost.

BTW, I tried to get some documentation on the GtkStyle class, but the styles
section of the online Gtk reference manual is one of the few sections that are
still unfinished. Murphy's law strikes again.



* Finally, XIM (X input method--a method that allows non-Roman-alphabet
people to enter their scripts by translating keyboard input to native
script) continues not to work for the register window. Someone did
email me and tell me they might be able to get it to work, which would
be great, as I'm still getting up to speed on Gtk programming.


I'm using gnome-libs-1.0.61 and gtk+-1.2.7, BTW, if that's important.

-- 
Shimpei Yamashita                   <http://www2.gol.com/users/shimpei/>

Reply via email to