GNOME Bugzilla – Bug 539734
Rotated text is not correctly anchored when printing
Last modified: 2010-02-18 04:56:10 UTC
Try this: choose a vertical orientation for a cell, then print (tested with preview and pdf). The text is always anchored at the top left corner of the cell, whatever the angle. The result is that it is printed outide of the cell area.
Where should it be anchored? The calculation used to determine the location of the rotated string in the cell does not make any sense to me. For example have a look at the change in location between 0 degrees and -1 degrees.
Created attachment 113418 [details] [review] proposed patch This patch almost fixes the issue, but seems there is still a size issue. The printed text was slightly larger than on screen. Btw, I don't understand what is the purpose of the PangoContext* passed to print_cell_gtk.
I believe we need the PangoContext* to adjust the rendered value of the cell. This patch does seem to make the rotation match what is seen on screen. So I guess it should be committed. I still don't understand while the rotation by 5 degrees makes a multi-line cell look so different than a 0 degree rotation.
Seen that too, I'm suspecting that gnm_rendered_value_remeasure is full of bugs bout the PangoContext* we don't use it. I tried to use it, creating a new PangoLayout* and copying text and attributes to it, but did not see any difference in the output.
Excel has a discontinuity at 0. 1. Put "x" into D10 2. Put a border around it 3. Rotate +1 degree --> Cell becomes very, very wide
I think this patch should be committed to head. Not ethat the size differnece is probably simply the old and well known to be annoying fact that fonts rendered a different resolutions may have slightly different size.
Replying to #5: looks as one more excel bug. Do wo need to reproduce such a stupid behavior? to #6: the 1.8 branch is affected too.
#5 was in response to my last sentence in #3. Your patch has the same discontinuity. Regarding your comment re #6. This could be said about nearly all bugs fixed in 1.9.x. I really don't know which fixes should be backported to 1..8.x.
Re #5, I do not think it is a bug. When a cell's text is rotated, it makes some of sense to shear the visible border to get the right angle for the previously-vertical sides with respect to horizontal. Don't bother backporting. This is non-trivial and not very visible to most users.
backporting to 1.8 is trivial, or I am missing something.
Comment on attachment 113418 [details] [review] proposed patch This patch does not apply to HEAD anymore. THe equivalent should still be committed though!
I have committed a slightly modified patch (due to my prior modifications ini the print code) to HEAD. This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.
*** Bug 610328 has been marked as a duplicate of this bug. ***