Re: GtkPrintOperation uses wrong scale on Windows ?



On 27-06-12 11:34, Geert Janssens wrote:
On 26-06-12 16:29, Michael Cronenworth wrote:
Geert Janssens wrote:
Am I doing something wrong here ?
Was GNUCash setting units before? If so, what to?


It was. This setting has never changed since 2007, while the bug first appeared in 2010. Your question make me realize I may be chasing the wrong tail here.

Instead I am now comparing changes between the last known working version and the one first reported to be failing. There's only about a hundred commits in between and each rebuild on my Windows test machine takes a couple of hours... :(

I have identified one change that could be a good candidate and I'm now testing my theories with this one reverted. We'll see the result later today.

Thanks for the feedback so far.

Geert
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

I found my issue, and it was indeed a completely different one. I'll share my experience here in case others hit the same problem.

The GnuCash code called cairo_identity_matrix on the cairo_t obtained via gtk_print_context_get_cairo_context with the intention to start form a clean cairo_t to write our checks to.

cairo_identity_matrix removes all transformations from a cairo_t, in the process resetting its resolution to 72dpi. On linux this doesn't make a difference because GtkPrintContext works with a 72dpi resolution internally.

On Windows though, the cairo_t returned by gtk_print_context_get_cairo_context has the resolution of the printer (eg 600dpi). I suppose GtkPrintContext already set a transformation on the context to achieve this. Resetting the cairo_t also removes this internally set up transformation, ruining the complete page setup.

I don't think this description is not 100% accurate. I believe a cairo_t doesn't really have a resolution. But in the context of printing this is close enough to explain what went wrong.

I rewrote my code to no longer use cairo_identity_matrix (altering some of our own transformations to cope with this), and now the pages print fine on Windows as well.

Geert



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]