GNOME Bugzilla – Bug 133924
landscape mode prints strange looking text
Last modified: 2005-11-15 02:22:21 UTC
Using gnumeric 1.2.6-1 with gnomeprint 2.4.2-2 (debian package versions). If I try to print a file in landscape mode as pdf, what I get is a pdf file with correct looking grid lines, but totally wrong text; it looks a bit like it was drawn 90° rotated compared to where it should be, and cut off. Steps to reproduce: Load attached gnumeric file Verify File|Page Setup shows landscape page orientation Click Print in the page setup dialog Select PDF output Verify that the "Paper" tab shows Landscape orientation Click Print I'll attach the .gnumeric and .pdf file.
Created attachment 24249 [details] .gnumeric file
Created attachment 24250 [details] generated pdf file (bzip2-compressed)
It's really not that strange, it's just not landscape.
*** Bug 152326 has been marked as a duplicate of this bug. ***
I beleive this is fixed in 2.7.90
Hmm, I've backported your change on gnome-print-pdf.c on 2.6.2 and I'm still seeing the problem (but maybe I missed something)..
Reopening, still valid with libgnomeprint 2.8.2
Actually, the change in gnome-print-pdf.c looks wrong to me ... before the change, the code was busted in that the call to art_affine_scale() was overwriting the initialization of Tm from ctm. But that gave a *closer* to right result, since according to the PDF docs, the text matrix is composed with the ctm before use.
Turns out that last comment is wrong, since the "CTM" is passed to the PDF backend *per* primitive, and not set in the PDF file permanently. I'm still not sure that the computations are right.
On some investigation, I'm pretty sure that using dx + pgl->glyphs[ps->start].x dy + pgl->glyphs[ps->start].y is in fact wrong, but pgl->glyphs[ps->start].x/y are pretty typically zero so it doens't matter much. (*) Can you give details of how you are reproducing, Frederic? I don't see any problems here. (*) dx/dy are the last two components of the CTM, so this has the effect that the glyph origin starts at CTM * (0, 0) + (dx, dy) in device space. While we actually want CTM * (dx, dy). So, something like: point.x = pgl->glyphs[ps->start].x point.y = pgl->glyphs[ps->start].y art_affine_point (&point, &point, ctm); Then use point.x/point.y.
Ohh, my bad, it seems to be fixed in 2.8.2 (and 2.10 too). I got busted with the test case because : -if you open the test case and check print preview or print settings, you see landscape -then you choose print, choose PDF and print. Unfortunately, when you open "print" dialog, the first available printer is selected (unually not PDF "printer") and landscape get unselected and replaced by portrait. I'll suggest we close this bug..
owen : good point. I'll add the map. fcrozat : ok. we'll need to solve the general problem of losing settings when changing printers, but I agree this is not the bug for that.