GNOME Bugzilla – Bug 623202
pango_layout_line_get_extents gets wrong height for empty lines
Last modified: 2010-07-26 16:57:13 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?
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 ***
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.
No worries.
You may want to ping Ubuntu to push it in.