RE: [gtk-list] Re: gtk_label and internationalisation question




On 18-Dec-98 Akira Higuchi wrote:

> >>   /* create Japanese style */
> >>   jstyle = gtk_style_new();
> >>   jfont =
> >>   gdk_fontset_load("-*-fixed-medium-r-*--16-*-jisx0208.1983-0");
>  
>  This line seems odd. If you want to load a single font, you should
>  use gdk_font_load() instead.

Oops yes, that's what I was doing. I had been twiddling that line
in an uneducated attempt to make it work, as I had seen that some parts
of the string-drawing code were dependent on whether a font or fontset
were used. In any case I was barking up the wrong tree, and it was indeed
gdk_font_load() before...


> >>   gdk_font_unref(jstyle->font);
> >>   jstyle->font = jfont;
> >> 
> >>   /* Insert Kana "A" */
> >>   gtk_label_set_text (GTK_LABEL(search_entry_mode_label),"\x24\x22");
> >>   gtk_widget_set_style (search_entry_mode_label, jstyle);
>  
>  I guess you are trying to draw 2-byte characters without locale
>  support, aren't you? If so, we have to add 2-byte font support
>  into *_wc() functions. Shall I write a patch?

Yes, that is basically what I'm doing - unless there's a clean way to
make dual-language apps using locale support? My knowledge on this is
admittedly not what it could be, but it seemed not from what I could
find out. As I understand, X and libc locale support in general is
designed to allow apps to be in different languages at different
times, but not at the same time ... ? (That is, you have things like
setlocale/_Xsetlocale() that affect global behaviour, but don't deal
with anything more fine-grained...)


The app in question is incidentally an EDICT (Jim Breen's J->E
electronic dictionary file) client; the other "funky" thing I was doing
was hacking around gtk_entry to allow Kana entry without requiring a
working Wnn or Canna setup (by intercepting keypresses and passing
them through a small state machine to convert them, then handwaving
the character widths, key navigation and so on).

I know this is perhaps a little outside the call of duty for an poor
innocent widget, but if it could be made possible again I'd be
extremely grateful... I'd like to be able to do as much of this as
possible without leaving the standard widget set.


Later on I would also like to add optional support for Canna et al...
(don't want much from life, do I? :P). But that's for later.


Thanks very much for the rapid reply,
-Matt.

"The results of this intrusion into your life will be used 'responsibly'
in ways you cannot even begin to imagine. Of course, the innocent have
nothing to fear from the rapidly expanding data industry."
 - Radiohead, Airbag/How Am I Driving?



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]