GNOME Bugzilla – Bug 572741
margins on printed documents are too small
Last modified: 2015-06-07 14:42:36 UTC
Upstream from launchpad : https://bugs.launchpad.net/ubuntu/+source/gedit/+bug/331077 In gedit 2.24.2 (Ubuntu 8.10), the margins of a printed document does not seems to be configurable. The left margin is very small - about 1 cm. While such small margins maximizes the printable text on a page, the left margin is too small to punch holes in the sheet using a paper hole punch - holes are punched in the text. See attached file, a print-out of the "Thin clients" Wikipedia page, copied from a Web browser and pasted in gedit for printing. Having configurable margins could enable the user to avoid such problems.
Created attachment 195321 [details] Print-out of the "Thin clients" Wikipedia page Attached file mentioned on the bug description.
Still a problem with gedit 3.14.
Created attachment 304710 [details] [review] Printing: fix margins GTK+'s default margins are too small. It was not possible to use a hole punch, and with some printers the text was truncated on the right. Add gsettings to configure margins, with better defaults (25mm on each side). The unit chosen is the millimeter, because it's the international standard.
It would be nice to backport the bug fix for the 3.16 and 3.14 versions too, but with the above patch there are new translatable strings (so we need to ask for a string freeze exception, if we take that patch).
Review of attachment 304710 [details] [review]: the patch looks ok to me. Out of curiosity, what are gtk's defaults? I wonder if we should have different defaults for lateral margins and top and bottom margins
Review of attachment 304710 [details] [review]: ::: gedit/gedit-print-job.c @@ -559,2 +568,4 @@ g_free (left); } + + g_free (print_font_body); maybe these leak fixes should be a separate patch if you feel like splitting it
Commit pushed: https://git.gnome.org/browse/gedit/commit/?id=355cd2dd89e66efa1023310d66936eddfb55d58f GTK+'s default is 1/4 of inch, i.e. 6.35 mm (i.e. less than 1cm, which is not enough): https://git.gnome.org/browse/gtk+/tree/gtk/gtkpapersize.c#n918 There was no memory leak fixes, I just moved the g_free() at the end of the function (cosmetic change).
Microsoft Word uses 1 inch (25.4mm) on each side. So I guess most people are used to have the same margin size on each side. See: https://en.wikipedia.org/wiki/Margin_%28typography%29#The_Digital_Page