From 088ff3f60f42be5d9352e57d181052bbb705149a Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Thu, 29 Jan 2009 20:51:37 +0000 Subject: [PATCH] Add margin to updated postscript_print code. Add some missing credits for PS print support. --- docs/AUTHORS.txt | 5 +++++ docs/CHANGES.txt | 5 ++++- src/manpage/tuxpaint.1 | 6 ++++-- src/postscript_print.c | 16 ++++++++-------- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/docs/AUTHORS.txt b/docs/AUTHORS.txt index 7ccf67a2c..8999268be 100644 --- a/docs/AUTHORS.txt +++ b/docs/AUTHORS.txt @@ -44,6 +44,11 @@ $Id$ copyright notice and this permission notice appear in supporting documentation. This software is provided "as is" without express or implied warranty. + Enhanced in Tux Paint by: + Bill Kendrick + Pere Pujal i Carabantes + Henry House + Thomas Kalka Blur ('entire image' mode), Sharpen, Trace Contour, Silhouette, Snow Flake, Snow Ball, Black & White, Threshold, Alien, Toothpaste, diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 60b9ef42d..827af2ca2 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -8,7 +8,7 @@ http://www.tuxpaint.org/ $Id$ -2009.January.23 (0.9.21) +2009.January.29 (0.9.21) * New Starters: ------------- * Silver Frame @@ -84,6 +84,9 @@ $Id$ "lpr", but that command is not available) should appear in Tux Paint. (SourceForge bug #2205528) + * Further adjustments to postscript_print scaling. + Thomas Kalka + * Build System Improvements: -------------------------- * Adhering to Debian & FreeDesktop.org standards regarding .desktop file. diff --git a/src/manpage/tuxpaint.1 b/src/manpage/tuxpaint.1 index 04b113f77..6c04be3e8 100644 --- a/src/manpage/tuxpaint.1 +++ b/src/manpage/tuxpaint.1 @@ -1,5 +1,5 @@ -.\" tuxpaint.1 - 2009.01.17 -.TH TUXPAINT 1 "17 January 2009" "0.9.21" "Tux Paint" +.\" tuxpaint.1 - 2009.01.29 +.TH TUXPAINT 1 "29 January 2009" "0.9.21" "Tux Paint" .SH NAME tuxpaint -- "Tux Paint", a drawing program for young children. @@ -845,6 +845,7 @@ Tedi Heriyanto, Pjetur G. Hjaltason, Knut Erik Hollund, Khaled Hosny, +Henry House, Mohomodou Houssouba, Song Huang, Karl Ove Hufthammer, @@ -861,6 +862,7 @@ Amed Petri Jooste, Richard June, Andrej Kacian, +Thomas Kalka, Jorma Karvonen, Kazuhiko, Gabor Kelemen, diff --git a/src/postscript_print.c b/src/postscript_print.c index 549ad2ef8..6b603b754 100644 --- a/src/postscript_print.c +++ b/src/postscript_print.c @@ -6,7 +6,7 @@ (for non-Windows, non-Mac OS X, non-BeOS platforms, e.g. Linux) (moved from tuxpaint.c in 0.9.17) - Copyright (c) 2008 by Bill Kendrick and others + Copyright (c) 2009 by Bill Kendrick and others bill@newbreedsoftware.com http://www.tuxpaint.org/ @@ -36,7 +36,7 @@ implied warranty. - June 24, 2007 - December 7, 2008 + June 24, 2007 - January 29, 2009 $Id$ */ @@ -62,6 +62,8 @@ #include "pixels.h" +#define MARGIN 36 /* Margin to put around image, in points (inch/72) (36pt = 0.5") */ + #define my_min(x,y) ((x < y) ? (x) : (y)) int f2int(float f); @@ -185,8 +187,8 @@ int do_ps_save(FILE * fi, /* Determine scale: */ - scale = my_min(((float) ppr_w / (float) r_img_w), - ((float) ppr_h / (float) r_img_h)) * (72.0 / 100.0); + scale = my_min(((float) (ppr_w - (MARGIN * 2)) / (float) r_img_w), + ((float) (ppr_h - (MARGIN * 2)) / (float) r_img_h)); printed_img_w = r_img_w * scale; printed_img_h = r_img_h * scale; @@ -219,10 +221,8 @@ int do_ps_save(FILE * fi, fprintf(fi, "%%%%Pages: 1\n"); - fprintf(fi, "%%%%BoundingBox: %d %d %d %d\n", - (int) tlate_x, (int) tlate_y, - (int) (tlate_x + printed_img_w + 0.5), - (int) (tlate_y + printed_img_h + 0.5)); + fprintf(fi, "%%%%BoundingBox: 0 0 %d %d\n", (int) (ppr_w + 0.5), (int) +(ppr_h + 0.5)); fprintf(fi, "%%%%EndComments\n");