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 541360 - Pango miscalculates width of italic text
Pango miscalculates width of italic text
Status: RESOLVED DUPLICATE of bug 383558
Product: pango
Classification: Platform
Component: general
1.20.x
Other All
: Normal trivial
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2008-07-03 08:59 UTC by Emmanuel Briot
Modified: 2008-07-03 14:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
View of the problem (1.31 KB, image/gif)
2008-07-03 09:01 UTC, Emmanuel Briot
Details

Description Emmanuel Briot 2008-07-03 08:59:59 UTC
Please describe the problem:
In the following example (Ada code, but that should translate easily to C), there are two labels, aligned to the right. On is normal font ("sans"), and gets fully
displays. The second one ("sans italic") is missing a few pixels on the right,
and the "0" is partially cut off.

There doesn't seem to be a way to attach an image to a bug report, unfortunately.
It has also been a long time since I last used the C version of gtk+, so I am submitting my (short) code in Ada. It shouldn't take long to translate, I assume. Sorry for the extra trouble.

Steps to reproduce:
1. Translate (if needed) the following code and compile it
2. Launch the application and observe
3. 


Actual results:


Expected results:


Does this happen every time?
Yes

Other information:
Code follows:

with Gtk.Window;  use Gtk.Window;
with Gtk.Box;     use Gtk.Box;
with Gtk.Enums;   use Gtk.Enums;
with Gtk.Main;    use Gtk.Main;
with Gtk.Label;   use Gtk.Label;
with Gtk.Widget;  use Gtk.Widget;
with Pango.Font;  use Pango.Font;

procedure Main is
   Win : Gtk_Window;
   Box   : Gtk_Box;
   Label : Gtk_Label;
   Font  : Pango_Font_Description;
begin
   Gtk.Main.Init;
   Gtk_New (Win, Window_Toplevel);

   Gtk_New_Vbox (Box);
   Add (Win, Box);

   Gtk_New (Label, "Italic font 0");
   Font := From_String ("sans italic");
   Modify_Font (Label, Font);
   Set_Alignment (Label, 1.0, 0.5);
   Set_Padding (Label, 2, 0);
   Set_Justify (Label, Justify_Right);
   Pack_Start (Box, Label);

   Gtk_New (Label, "Normal font 0");
   Font := From_String ("sans");
   Modify_Font (Label, Font);
   Set_Alignment (Label, 1.0, 0.5);
   Set_Justify (Label, Justify_Right);
   Pack_Start (Box, Label);

   Show_All (Win);
   Gtk.Main.Main;
end Main;
Comment 1 Emmanuel Briot 2008-07-03 09:01:12 UTC
Created attachment 113898 [details]
View of the problem
Comment 2 Behdad Esfahbod 2008-07-03 14:00:49 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.


*** This bug has been marked as a duplicate of 383558 ***