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 623202 - pango_layout_line_get_extents gets wrong height for empty lines
pango_layout_line_get_extents gets wrong height for empty lines
Status: RESOLVED DUPLICATE of bug 457990
Product: pango
Classification: Platform
Component: cairo
1.28.x
Other Linux
: Normal minor
: ---
Assigned To: pango-maint
pango-maint
Depends on:
Blocks:
 
 
Reported: 2010-06-30 11:13 UTC by Kjell Ahlstedt
Modified: 2010-07-26 16:57 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Kjell Ahlstedt 2010-06-30 11:13:19 UTC
Overview:
If the unit of length is chosen as millimeters in the gtkmm class
Gtk::PrintOperation, pango_layout_line_get_extents reports a too large logical
height of empty lines. (The unit of length is transferred to pango in a call
to pango_cairo_context_set_resolution.)

   Steps to reproduce:
Start with the simple printing example in the tutorial "Programming with
gtkmm" at http://git.gnome.org/browse/gtkmm-documentation/tree/examples/book/printing/simple.

In file examplewindow.cc, function ExampleWindow::print_or_preview, after
  print->set_print_settings(m_refSettings);
add
  print->set_unit(Gtk::UNIT_MM);

Run the program, enter some text in the text box 'Comments'. Enter an empty
line between non-empty lines. For easy comparison, you may also enter a line
with just a space character. Its height will be correct.
Choose File|Print Preview.

   Actual results:
Empty lines are much higher than non-empty lines. 

   Expected results:
Empty lines should have the same height as non-empty lines.

   Additional information:
With UNIT_PIXEL and UNIT_POINTS all line heights are correct. With UNIT_INCH
it gets even worse than with UNIT_MM. (Gtk::PrintOperation assumes that
dpi = 72, which means that there is actually no difference between pixels and
points.)

pango_layout_line_get_extents calls pango_layout_run_get_extents for non-empty
lines, but pango_layout_line_get_empty_extents for empty lines.
Perhaps pango_layout_line_get_empty_extents does not consider the Cairo
context resolution?
Comment 1 Behdad Esfahbod 2010-07-23 01:06:49 UTC
Humm, I believe that this is fixed in 1.28.1.  What version did you test?

*** This bug has been marked as a duplicate of bug 457990 ***
Comment 2 Kjell Ahlstedt 2010-07-24 08:59:14 UTC
I use version 1.28.0, the version presently distributed in Ubuntu Linux.

I prefer not to test 1.28.1 until it's distributed in Ubuntu. It's not worth the extra trouble for me to install Pango from the source code. I believe you, when you say the problem is fixed in 1.28.1.

Btw I did try to find similar bug reports before I wrote this one, but unfortunately I didn't find 457990.
Comment 3 Behdad Esfahbod 2010-07-26 16:56:38 UTC
No worries.
Comment 4 Behdad Esfahbod 2010-07-26 16:57:13 UTC
You may want to ping Ubuntu to push it in.