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 334582 - Text is shifted off-by-one in Add to panel
Text is shifted off-by-one in Add to panel
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: X11
1.0.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
: 318552 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2006-03-14 22:18 UTC by Simos Xenitellis
Modified: 2006-05-04 16:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
"Add to panel" window, when no icon is selected. (59.58 KB, image/png)
2006-03-14 22:21 UTC, Simos Xenitellis
Details
"Add to panel" window, when icon is selected. (60.68 KB, image/png)
2006-03-14 22:28 UTC, Simos Xenitellis
Details
Before mouse pointer pass over any applet icon (54.59 KB, image/png)
2006-03-15 00:23 UTC, Konstantinos Togias
Details
After mouse pointer has just passed over an applet icon at the first row (54.69 KB, image/png)
2006-03-15 00:30 UTC, Konstantinos Togias
Details
Animated gif showing the slight shifting of text (136.01 KB, image/gif)
2006-04-08 01:13 UTC, Simos Xenitellis
Details

Description Simos Xenitellis 2006-03-14 22:18:25 UTC
There is a case where text (caption of icons) is shifted in an unusual way to the right, when an icon is selected.

This has been observed in Ubuntu Dapper, Greek locale.

Compare the two following attached screenshots.
Comment 1 Simos Xenitellis 2006-03-14 22:21:48 UTC
Created attachment 61249 [details]
"Add to panel" window, when no icon is selected.

Notice that the "o" in Pilot appears wider than other "o" in the window. 
The same goes with the second "mu" (as in micro) at the icon caption below.
Comment 2 Simos Xenitellis 2006-03-14 22:28:41 UTC
Created attachment 61250 [details]
"Add to panel" window, when icon is selected.

We select an icon and we can now see that text is strangely shifted to the right.
It is shifted in a way as if a rectangle is copied and pasted one pixel to the right.

Thanks to Konstantinos Togias for both screenshots.
Comment 3 Simos Xenitellis 2006-03-14 22:30:31 UTC
Chances are that bug 329547 may be relevant to this.
Comment 4 Konstantinos Togias 2006-03-15 00:23:48 UTC
Created attachment 61256 [details]
Before mouse pointer pass over any applet icon

This is the screenshot of "add to panel" window just after it is opened and before mouse pointer pass over any applet icon.
Comment 5 Konstantinos Togias 2006-03-15 00:30:40 UTC
Created attachment 61257 [details]
After mouse pointer has just passed over an applet icon at the first row

This is a screenshot of "Add to pannel" widow just after mouse pointer has passed over an icon of the first row.
Please notice the distortion of character 'y' in 'Sticky Notes', character 's' in GEyes and all the instances of greek character 'η' in 'Αναζήτηση Λεξικού'.
Also some of the characters are shifted to right and spaces between characters have been alerted.
Comment 6 Konstantinos Togias 2006-03-15 00:34:05 UTC
The view of "Add to panel" window changes from http://bugzilla.gnome.org/attachment.cgi?id=61256&action=view to http://bugzilla.gnome.org/attachment.cgi?id=61257&action=view and back as mouse pointer passes over the various applet icons and selects by klicking.
Comment 7 Konstantinos Togias 2006-03-15 00:40:30 UTC
The same bug appears when selecting english USA language from GDM and the applet icon captions do not contain greek characters.
Comment 8 Simos Xenitellis 2006-04-08 01:13:07 UTC
Created attachment 62960 [details]
Animated gif showing the slight shifting of text

This animated GIF was generated on Ubuntu Breezy with en_US.UTF-8 locale and the application font was set to Bitstream Vera Sans Roman.
This bug appears in Dapper as well.

When you open the Add to Panel dialog box, simply hover the mouse over the icons (no clicking required). To generate the GIF, I did a full hover over all icons and took the second screenshot.
Comment 9 Behdad Esfahbod 2006-04-08 02:17:41 UTC
Yes, I observed this in the GNOME 2.14 Live CD.

I fixed a rounding bug with Pango+Cairo that *may* fix this too.  If it doesn't, I really doubt it's a Pango bug.  The most probable thing is that Add to Panel is drawing Pango layouts at non-pixel-boundaries.  It shouldn't.
Comment 10 Sebastien Bacher 2006-04-08 10:27:36 UTC
bug #318552 is about that too (same issue on the control-center canvas screen), might be a gnomecanvas bug
Comment 11 Behdad Esfahbod 2006-04-08 10:32:35 UTC
*** Bug 318552 has been marked as a duplicate of this bug. ***
Comment 12 Sebastien Bacher 2006-04-24 12:03:54 UTC
Could you point the changelog entry corresponding to that rounding bug fix? The issue happens with the gnome-control-center shell too, could be a gnomecanvas issue maybe?
Comment 13 Behdad Esfahbod 2006-04-24 21:32:29 UTC
http://cvs.gnome.org/viewcvs/pango/ChangeLog?rev=1.1391.2.6&view=markup

Yes, I think it's a gnomecanvas bug too.
Comment 14 Sebastien Bacher 2006-04-27 22:23:24 UTC
The new pango version doesn't fix the issue, that should probably be reassigned to libgnomecanvas, what do you mean by "is drawing Pango layouts at non-pixel-boundaries", should that be something easy to fix by somebody knowing pango?
Comment 15 Behdad Esfahbod 2006-04-28 06:37:02 UTC
Ok, I found the fix, but will charge a couple pints of beer, it damn took hours tonight... :-D
Comment 16 Behdad Esfahbod 2006-04-28 06:59:14 UTC
Neither Pango, nor gnomecanvas: gdk.

This is what happens:

Apparently the bug only happens when hinting is off and bug 307196 happens.

Next, there's this bug in gdkpango.c:

diff -u -p -d -r1.50 gdkpango.c
--- gdk/gdkpango.c      20 Feb 2006 17:17:09 -0000      1.50
+++ gdk/gdkpango.c      28 Apr 2006 06:51:23 -0000
@@ -235,12 +235,12 @@ gdk_pango_renderer_draw_glyphs (PangoRen
     {
       cairo_save (cr);
       emboss_context (cr);
-      cairo_move_to (cr, x / PANGO_SCALE, y / PANGO_SCALE);
+      cairo_move_to (cr, (double)x / PANGO_SCALE, (double)y / PANGO_SCALE);
       pango_cairo_show_glyph_string (cr, font, glyphs);
       cairo_restore (cr);
     }

-  cairo_move_to (cr, x / PANGO_SCALE, y / PANGO_SCALE);
+  cairo_move_to (cr, (double)x / PANGO_SCALE, (double)y / PANGO_SCALE);
   pango_cairo_show_glyph_string (cr, font, glyphs);
 }

Normally this shouldn't matter, as x and y are whole-pixels.  But with that hinting bug hitting, we get x values that are subpixel, so when gnomecanvas is drawing part of the layout such that after offsetting, x becomes negative, the integer division rounds up (towards zero) which shift one.

Now I don't know why gnomecanvas does so many extra exposes, but I'll commit the fix to stable and head right now.
Comment 17 Sebastien Bacher 2006-05-04 16:46:27 UTC
Rocking work Behdad, I've patched the Ubuntu package with that for some days and it works just fine! You can collect the couple pints of beer next time we meet ;)