Bug 71937
Summary: | gdm word wrap problem for CJK | ||
---|---|---|---|
Product: | [Retired] Red Hat Public Beta | Reporter: | Nakai <ynakai> |
Component: | gdm | Assignee: | Havoc Pennington <hp> |
Status: | CLOSED RAWHIDE | QA Contact: | Mike McLean <mikem> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | null | CC: | alexl, eng-asia-list, garrett, jrb |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2002-08-28 22:25:56 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 67218 |
Description
Nakai
2002-08-20 12:30:35 UTC
Probably just a matter of pango_layout_set_width() on the relevant PangoLayout Perhaps it's just the redhat theme, to me it seems nothing is cut off (but I can't read japanese so I can't really tell) ... try it with the circles theme. jrb said there was a way to handle this in the theme - alex do you remember how to do it? we need to let garrett know. I don't understand why it's wrapping the english string but not the japanese. maybe the japanese text is just longer without good word breaks? German also overflows the boxes. the fix I had in mind was a way to grow the boxes in the theme as the text grows. Hmm? Isn't the problem already that the box grows to much? I tried to set the width on the pam-error text, but that didn't seem to help. maybe pango just doesn't word wrap for japanese at all? Japanese sentence doesn't need any white space even if it's long. Right but Pango's word wrap code is way more complicated than just a whitespace thing. It has special cases for Japanese as recommended by the Unicode book. Maybe look at pango/pango/break.c and see if it is working correctly. Does it work in message and error dialogs? If it works there it should work in gdm, if gdm enables word wrap. The relevant pango code is: case G_UNICODE_LOWERCASE_LETTER: case G_UNICODE_MODIFIER_LETTER: case G_UNICODE_OTHER_LETTER: case G_UNICODE_TITLECASE_LETTER: case G_UNICODE_UPPERCASE_LETTER: if (current_word_type == WordLetters) { /* Japanese special cases for ending the word */ if (JAPANESE (last_word_letter) || JAPANESE (wc)) { if ((HIRAGANA (last_word_letter) && !HIRAGANA (wc)) || (KATAKANA (last_word_letter) && !(KATAKANA (wc) || HIRAGANA (wc))) || (KANJI (last_word_letter) && !(HIRAGANA (wc) || KANJI (wc))) || (JAPANESE (last_word_letter) && !JAPANESE (wc)) || (!JAPANESE (last_word_letter) && JAPANESE (wc))) attrs[i].is_word_end = TRUE; } } Eh, bad alex - not using Pango. I'm working on a hack here. static char * break_at (const char *orig, int len) { char *text, *p, *newline; int i; text = g_strdup (orig); p = text; while (strlen (p) > len) { newline = strchr (p, '\n'); if (newline && ((newline - p) < len)) { p = newline + 1; continue; } for (i = MIN (len, strlen (p)-1); i > 0; i--) { if (p[i] == ' ') { p[i] = '\n'; p = p + i + 1; goto out; } } /* No place to break. give up */ p = p + 80; out: } return text; } 2.4.0.7-8 should fix. Fix confirmed with gdm-2.4.0.7-10. |