This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours

Bug 132527

Summary: Invalid assumptions about character width
Product: [Fedora] Fedora Reporter: Owen Taylor <otaylor>
Component: xchatAssignee: Jonathan Blandford <jrb>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 14CC: ddumas, djr, i18n-bugs, llim, mail, petersen, tagoh, wtogami
Target Milestone: ---Keywords: i18n, MoveUpstream, Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-06 03:55:15 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Bug Depends On:    
Bug Blocks: 212512    
Attachments:
Description Flags
screenshot of xchat with pango none

Description Owen Taylor 2004-09-14 10:53:50 EDT
xchat is assuming that the width of ascii characters is
always constant. However, this isn't true for Pango ... 
for example a space in the middle of Japanese text will get 
a different width then a space in the middle of English text.

This causes problems like the horizontal spacing problem
described in bug 131218.

I'll look at coming up with a patch (a patch is easy,
a patch that doesn't badly hurt performance may be harder)
Comment 1 Warren Togami 2004-10-15 00:40:13 EDT
gnome-terminal seems to have similar trouble, readily apparent when
you try to select text containing Japanese characters.  Is this the
same issue?
Comment 2 Owen Taylor 2004-10-15 11:44:55 EDT
Not meaningfully. vte doesn't use Pango for rendering,
so while it is probably making some sort of invalid assumption
about character width, it isn't directly related to this.
Comment 3 Owen Taylor 2004-10-18 17:58:14 EDT
OK, there is a quick fix ... just remove the ASCII optimization. 
But that gives an unacceptable performance hit for the xchat display
overall. And fixing it better would be a major change to go in at 
this point.

Removing it from YellowPad target bug.
Comment 4 Peter Zelezny 2004-10-19 04:34:23 EDT
A quick fix without performance penalty might be to build your RPMs
with ./configure --enable-xft. I guess you'd loose the multiple fonts
features of pango though.
Comment 5 Lawrence Lim 2004-10-19 22:13:54 EDT
Tested xchat-2.4.0-3 with pango-1.6.0-4. The horizontal spacing
problem still exist.

Comment 6 Lawrence Lim 2004-10-19 22:15:17 EDT
Created attachment 105488 [details]
screenshot of xchat with pango
Comment 7 Owen Taylor 2004-10-20 00:19:25 EDT
I'm not planning to fix this for FC3.
Comment 8 Warren Togami 2004-10-20 00:41:19 EDT
Also unsuitable for RHEL4 GA or even U1?
Comment 9 Owen Taylor 2004-10-20 00:46:48 EDT
I don't have a real fix short of a rewrite of GtkXText. 

You might be able to get a partial fix by using Xft for 
rendering of pure ascii segments as well as the measurement.

But there are also bugs with selection and wrapping in assuming
sum(width of chars in string) == width(string) that make working
on the code unhappy. (And make for a darn inefficient algorithm for
non-ascii where it's laying out each character to find it's width)
Comment 10 Peter Zelezny 2004-10-20 01:32:30 EDT
Owen, could you describe to me the changes in Pango 1.5/1.6? Or point
me to the mailing list archives where it was discussed/implemented?

Is it basically that the width of a space (and only a space?) varies
depending on what chars preceeded it?

So rendering (or measuring) "hello " and "hello"," " could yield
different results?

And this phenomenon can never occur in only ascii (< 0x80) strings?
Comment 11 Owen Taylor 2004-10-20 01:40:01 EDT
As of Pango-1.4, the font selected for neutral characters (such
as spaces, punctuation) will in many cases depend on the script of
adjacent characters. 

This can happen even for ASCII only strings in non-latin locales,
because an isolated neutral character (I think, it's sort of late
at the moment) will get the default language tag, not the Latin
language tag. 

If, for ASCII only strings, you specifically pass
a language tag of 'en' to Pango (by using a different PangoContext,
instead of gtk_widget_get_pango_context(), say. Or by setting
it with a PangoAttribute), then Pango will indeed always produce 
consistent font selection for those strings.

Comment 12 Jens Petersen 2005-02-07 02:27:53 EST
Just a "me too": this makes xchat unusable in CJK locale for example.
Comment 14 Mike A. Harris 2005-06-02 17:26:08 EDT
Moving to FC5Target, as FC4 is 'done', barring release blockers that
pop up.
Comment 15 Peter Zelezny 2005-06-13 23:54:05 EDT
Crude and dirty work-around here, but untested:

http://sourceforge.net/tracker/index.php?func=detail&aid=1204916&group_id=239&atid=100239
Comment 16 Jens Petersen 2005-09-27 09:38:39 EDT
Is this still happening in FC devel?
Comment 17 Jens Petersen 2005-09-28 05:01:49 EDT
This appears to be fixed now finally in FC devel. :)
Comment 18 Lawrence Lim 2005-11-18 01:26:02 EST
Fixed for Ja, Ko and *_IN but not zh_TW and zh_CN. Strange.
Comment 20 Matthias Clasen 2006-08-30 17:27:17 EDT
I guess that not having this assigned to owen might increase the chances of this
getting fixed.
Comment 21 Jens Petersen 2006-08-31 00:28:59 EDT
Lawrence, this looks fixed to me for Chinese input with fc6,
could you doublecheck, please? :)
Comment 22 Lawrence Lim 2006-08-31 02:45:22 EDT
Tested with xchat-2.6.0-6 and pango-1.13.4-2. Looking very good now. :-)
Comment 23 Jens Petersen 2006-10-25 04:30:18 EDT
Unfortunately seems to be broken again in FC6 final. :-/
Comment 24 Jens Petersen 2006-10-25 05:17:37 EDT
*** Bug 181892 has been marked as a duplicate of this bug. ***
Comment 25 Xiaohong Wang 2006-10-25 07:12:59 EDT
Tested in RHEL5-Client-20061020.1 with ko or ja locale, xchat-2.6.6-7.el5,
pango-1.14.6-3.el5.
In xchat, enter mix of english, numbers and i18n text, the last few chars would
get missing.
Comment 26 Jens Petersen 2006-10-29 22:52:17 EST
I tried in vain backing down to pango-1.14.3-1.fc6 (fc6test3), pango-1.14.0-3, 
xchat-2.6.0-6 (fc6test2), pango-1.13.4-2 (fc6test2), and pango-1.13.1-3 (fc6test1).

Comment 27 Jens Petersen 2007-09-06 01:03:09 EDT
Still happens with xchat-2.8.4-4.fc8.
Comment 28 Bug Zapper 2008-04-03 11:39:08 EDT
Based on the date this bug was created, it appears to have been reported
against rawhide during the development of a Fedora release that is no
longer maintained. In order to refocus our efforts as a project we are
flagging all of the open bugs for releases which are no longer
maintained. If this bug remains in NEEDINFO thirty (30) days from now,
we will automatically close it.

If you can reproduce this bug in a maintained Fedora version (7, 8, or
rawhide), please change this bug to the respective version and change
the status to ASSIGNED. (If you're unable to change the bug's version
or status, add a comment to the bug and someone will change it for you.)

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.
Comment 29 Jens Petersen 2008-04-10 01:01:09 EDT
This looks fixed to me in current rawhide (pre-F9).

If someone else could also test and confirm that would be cool.
Comment 30 Jens Petersen 2008-04-10 01:03:29 EDT
(I assume the actual fix was probably in pango.)
Comment 31 Bug Zapper 2008-05-13 21:57:01 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 32 Tony Fu 2008-09-09 23:16:40 EDT
requested by Jens Petersen (#27995)
Comment 33 Jens Petersen 2009-05-26 21:43:03 EDT
Actually it is still visible at least for zh_CN in F11...
Comment 34 Bug Zapper 2009-06-09 05:06:48 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle.
Changing version to '11'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 35 Bug Zapper 2010-04-27 07:35:22 EDT
This message is a reminder that Fedora 11 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 11.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '11'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 11's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 11 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 36 Jens Petersen 2010-05-20 02:43:11 EDT
moving back to rawhide
Comment 37 Bug Zapper 2010-07-30 06:25:15 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 14 development cycle.
Changing version to '14'.

More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping
Comment 38 Akira TAGOH 2010-11-25 21:22:49 EST
still happens with xchat-2.8.8-4.fc14.x86_64 on ja
Comment 39 Akira TAGOH 2011-11-21 02:50:44 EST
looks good to me on ja locale tested with:
xchat-2.8.8-10.fc16.x86_64
pango-1.29.4-1.fc16.x86_64
Comment 41 Akira TAGOH 2012-06-06 03:55:15 EDT
still looks good on f17. this may be related to the font configuration though, it's stable enough since f16 at least. close this so far.