I’m having trouble getting gtksourceview printing working on
Windows. This is using gtk 2.14.2 and gtksourceview 2.10.5 on Windows
10 (but I had the same problem with earlier Windows releases).
A one-page script prints fine on Linux but on Windows it takes several
pages, with a few short (mostly one-word) lines at the top left corner
of each page.
I’ve tracked down the problem (I think) but have not managed to solve
it yet. Via a bunch of debugging statements in the “begin_print”
callback for GtkPrintOperation I’ve found that these points are
exactly the same on Linux and Windows:
-
via GtkPrintSettings (gtk_print_operation_get_print_settings): the
x and y resolutions are both 300. -
via GtkPageSetup (gtk_print_context_get_page_setup): the paper width
and height are 8.5 x 11 inches or 612 x 792 points.
But here’s the difference (via GtkPrintContext):
On Linux the context dimensions are x=576, y=733.68, with 72 dpi in
both dimensions. On Windows the context dimensions are x=4800, y=6114
with 600 dpi in both dimensions.
If on Windows the cairo context is 4800 x 6114 but the page is 612 x
792 it “makes sense” that only a small fragment of text can be shown
on each printed page. But why is the context 8.33 (600/72) times
bigger than it should be?
Thanks for any suggestions.