From 57e1a3d3766c55d6d2388035493be1f621449bcc Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Sun, 9 Mar 2008 03:10:39 +0000 Subject: [PATCH] 0001917: UI font gets small when creating PDF documents. svn: r10232 --- ChangeLog | 4 ++++ src/docgen/PdfDoc.py | 8 +++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 69c3394c2..51cfa113b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-03-08 Brian Matherly + * src/docgen/PdfDoc.py: + 0001917: UI font gets small when creating PDF documents. + 2008-03-08 Brian Matherly * src/gen/lib/note.py: * src/Editors/_EditNote.py: diff --git a/src/docgen/PdfDoc.py b/src/docgen/PdfDoc.py index f8531cceb..b91cea61e 100644 --- a/src/docgen/PdfDoc.py +++ b/src/docgen/PdfDoc.py @@ -1,7 +1,8 @@ # # Gramps - a GTK+/GNOME based genealogy program # -# Copyright (C) 2007 Zsolt Foldvari +# Copyright (C) 2007 Zsolt Foldvari +# Copyright (C) 2008 Brian G. Matherly # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -91,6 +92,7 @@ class PdfDoc(CairoDoc): cr = pangocairo.CairoContext(cairo.Context(surface)) fontmap = pangocairo.cairo_font_map_get_default() + saved_resolution = fontmap.get_resolution() fontmap.set_resolution(DPI) pango_context = fontmap.create_context() @@ -117,6 +119,10 @@ class PdfDoc(CairoDoc): # close the surface (file) surface.finish() + + # Restore the resolution. On windows, Gramps UI fonts will be smaller + # if we don't restore the resolution. + fontmap.set_resolution(saved_resolution) # load the result into an external viewer if self.print_req: