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



Akira Higuchi wrote:
> 
> In article <XFMail.981218031806.asbel@dial.pipex.com>
> asbel@dial.pipex.com writes:
> 
> >>
> >> Hi,
> >>
> >> I notice that gtk_label has followed gtk_entry in moving to wide chars
> >> internally. While this sounds like a great idea in theory, I'm having
> >> trouble working out how to get actual multibyte text into the label
> >> under the new scheme. Before I could simply do something like...
> >>
> >>   /* 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.
> 
> >>   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?
> 
I'm also doing similar stuff. My program langdrill draws Japanese or
ASCII text on Labels or LabeledText. Somebody try to help me use the
locale, but at that time it my locale was somehow broken. As my program
just reads some Japanese text from a text file, I have a parsing
function that just strips the <ESC> codes and sends the resulting stuff
to the label and changes the font. Is there a simpler way ? I would like
to be able to make something like:

label->Caption("xxx"); 

where the "xxx" should be some Japanese text. However this fails from
the start, as the compiler aborts when it finds the <ESC> codes in my
sorce file. 

So:
1. can I put some Japanese text in my source code (I'm using XEmacs +
SKK) ? How ?
2. is there a simpler way to introduce Japanese text in Labels, etc ?
Even without locale support ? If locale support is correct set, how do I
do this ?
3. can a Label have mixed Japanese/Romaji text ? Last time I have try
this, I was forced to switch between fonts and therefore, the only
widget usable for this was the textbox. No way to do this with Labels
:-(

TIA,

Ionutz


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