Bug 131128

Summary: Kerning problem with underlined characters in Gtk applications
Product: [openSUSE] SUSE LINUX 10.0 Reporter: Forgotten User sxozS5NPY1 <forgotten_sxozS5NPY1>
Component: X11 ApplicationsAssignee: Federico Mena Quintero <federico>
Status: RESOLVED FIXED QA Contact: Stefan Dirsch <sndirsch>
Severity: Normal    
Priority: P5 - None    
Version: Final   
Target Milestone: RC 1   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: The screenshot
fonts.conf
gtkrc
pango-131128-round-pango-units.diff
pango-131128-font-extents-rounding.diff

Description Forgotten User sxozS5NPY1 2005-10-27 20:12:12 UTC
(bugreport as mentioned in e-mail communication with Mike Fabian and assigned)

There's a problem with Gtk+ applications when rendering fonts black and white. The problem is shown in the attached screenshot: Each time a letter is underlined, the space to the next character is too small. It looks like wrong kerning. The problem doesn't only occure on TrueType fonts but only on bitmap fonts like "Adobe Helvetica", so it cannot be a bug in FreeType.

Following test case:
  
test@hugo:~> xdpyinfo |grep resolu
  resolution:    96x96 dots per inch
test@hugo:~> xrdb -query|grep Xft
test@hugo:~> grep DisplayS /etc/X11/xorg.conf
  DisplaySize  338 270

I tested with a new user and IceWM running, so there's no daemon that might change configuration. The corresponding .gtkrc (with the used font) and fonts.conf is attached. I didn't change the system-wide font configuration.

Interesting:
If I set 

  Xft.dpi: 96

in my ~/.Xresources (and do xrdb -merge ~/.Xresources, of course), the problem doesn't happen in "normal" Gtk applications anymore -- with the execpetion of SWT applications: RSSowl, Eclipse and Azureus (the BitTorrent client).

I tried to compile Pango without Cairo support, but there was no change. So I assume it's a Gtk bug ...
Comment 1 Forgotten User sxozS5NPY1 2005-10-27 20:12:51 UTC
Created attachment 55777 [details]
The screenshot
Comment 2 Forgotten User sxozS5NPY1 2005-10-27 20:13:25 UTC
Created attachment 55778 [details]
fonts.conf
Comment 3 Forgotten User sxozS5NPY1 2005-10-27 20:13:44 UTC
Created attachment 55779 [details]
gtkrc
Comment 4 Forgotten User sxozS5NPY1 2005-11-30 20:32:18 UTC
Because of the SWT difference, I reported a bug at SWT. I just thought that IBM has more manpower than SuSE.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=116155

Quite interesting bug ...
Comment 5 JP Rosevear 2005-12-23 12:58:02 UTC
This has turned into https://bugs.freedesktop.org/show_bug.cgi?id=5200
Comment 6 JP Rosevear 2006-04-13 16:41:09 UTC
There is apparently an upstream solution now.
Comment 7 Federico Mena Quintero 2006-04-17 14:29:12 UTC
Created attachment 78654 [details]
pango-131128-round-pango-units.diff

This is what went into Pango CVS HEAD.
Comment 8 Federico Mena Quintero 2006-04-17 14:37:22 UTC
... but that patch doesn't apply to our version of Pango.  It looks like pangocairo-fcfont.c got a lot of modifications since then.
Comment 9 Federico Mena Quintero 2006-04-24 21:30:46 UTC
Created attachment 79774 [details]
pango-131128-font-extents-rounding.diff
Comment 10 Federico Mena Quintero 2006-04-24 21:47:57 UTC
Submitted to autobuild.  This will appear in the next version of the pango package.

* Mon Apr 24 2006 - federico@novell.com
- Added pango-131128-font-extents-rounding.diff to fix
  https://bugzilla.novell.com/show_bug.cgi?id=131128.  This makes
  PangoCairoFcFont round the font extents before exposing them to
  callers, which produces better results with unhinted /
  un-antialiased displays.