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 120411 - GtkLabel does not properly wrap CJK languages
GtkLabel does not properly wrap CJK languages
Status: RESOLVED DUPLICATE of bug 101968
Product: gtk+
Classification: Platform
Component: Widget: Other
2.2.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2003-08-21 18:25 UTC by tvignaud
Modified: 2003-08-21 21:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
TextView really wrap differently CJK (same window, same text but different widget) (13.86 KB, image/png)
2003-08-21 19:08 UTC, tvignaud
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. (7.51 KB, image/png)
2003-08-21 19:26 UTC, tvignaud
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 (8.49 KB, image/png)
2003-08-21 19:28 UTC, tvignaud
Details
#120411 test case: gcc $(pkg-config gtk+-2.0 --cflags --libs) -Wl,--export-dynamic -Os -s -Wall -W test.c (1.71 KB, text/plain)
2003-08-21 20:59 UTC, tvignaud
Details

Description tvignaud 2003-08-21 18:25:58 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).
Comment 1 Owen Taylor 2003-08-21 18:33:52 UTC
Your links are broken. GtkLabel uses the exact same code for
wrapping as GtkTextView, though, so it's very odd.
Comment 3 tvignaud 2003-08-21 19:08:29 UTC
Created attachment 19420 [details]
TextView really wrap differently CJK (same window, same text but different widget)
Comment 4 Owen Taylor 2003-08-21 19:10:50 UTC
Are you sure wrapping is turned on for those labels?

Can you create a standalone test case that exhibits the
problem?
Comment 5 tvignaud 2003-08-21 19:26:16 UTC
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.
Comment 6 tvignaud 2003-08-21 19:28:34 UTC
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
Comment 7 Owen Taylor 2003-08-21 19:33:36 UTC
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.)
Comment 8 tvignaud 2003-08-21 20:43:07 UTC
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. 
Comment 9 tvignaud 2003-08-21 20:59:56 UTC
Created attachment 19427 [details]
#120411 test case:
gcc $(pkg-config gtk+-2.0 --cflags --libs) -Wl,--export-dynamic -Os -s -Wall -W test.c
Comment 10 Owen Taylor 2003-08-21 21:19:54 UTC
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.
Comment 11 tvignaud 2003-08-21 21:26:34 UTC
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 ***