GNOME Bugzilla – Bug 120411
GtkLabel does not properly wrap CJK languages
Last modified: 2003-08-21 21:26:34 UTC
unlike GtkTextView that wrap correctly chinese and japanese languages, GtkLabel do not wrap correctly CJK languages. i guess it does not properly uses pango to know where one can wrap cjk languages. see mdk bug #4642 http://qa/show_bug.cgi?id=4642 and its snapshot example (http://qa/attachment.cgi?id=596&action=view).
Your links are broken. GtkLabel uses the exact same code for wrapping as GtkTextView, though, so it's very odd.
fix urls (s/qa/qa.mandrakesoft.com): http://qa.mandrakesoft.com/show_bug.cgi?id=4642 http://qa.mandrakesoft.com/attachment.cgi?id=596&action=view
Created attachment 19420 [details] TextView really wrap differently CJK (same window, same text but different widget)
Are you sure wrapping is turned on for those labels? Can you create a standalone test case that exhibits the problem?
Created attachment 19423 [details] some example: same text in a label and in a textview in a window (the label is not wrapped properly despite the window is sized through set_size_request before.
Created attachment 19425 [details] the same example but now the user enlarge the window once displayed: we see that the label had cutted its content in the previous snapshot due to non functionnal cjk wrapping despite "GtkLabel uses the exact same code for wrapping as GtkTextView" comment
need to see C code. (If that's impossible, just attach the text as an attachment. I can cook something up. But screenshots aren't useful.)
anwsering to "is wrapping enabled": yes it is. note that this may be related to the fact that the lable has no proper knowledge of its geometry (see #118045) as for testcase: this bug was spotten in a perl/gtk+2 app. i'll make a short c testcase.
Created attachment 19427 [details] #120411 test case: gcc $(pkg-config gtk+-2.0 --cflags --libs) -Wl,--export-dynamic -Os -s -Wall -W test.c
When I turn on line wrapping in your test case: --- ./tvignaud.c.orig 2003-08-21 17:19:20.000000000 -0400 +++ ./tvignaud.c 2003-08-21 17:18:38.000000000 -0400 @@ -39,6 +39,7 @@ gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0); gtk_widget_set_size_request (label, 121, 100); gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT); + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); scrolledwindow = gtk_scrolled_window_new (NULL, NULL); gtk_widget_show (scrolledwindow); It wraps fine for me.
ok if you add the missing "gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);" it ended in always the same GtkLabel bug, that is it does not know properly how to be sized (see #118045) *** This bug has been marked as a duplicate of 101968 ***