rpms/paps/devel paps-dsc-compliant.patch, NONE, 1.1 paps-cups.patch, 1.12, 1.13 paps.spec, 1.31, 1.32 paps-0.6.8-dsc-compliant.patch, 1.3, NONE

Akira TAGOH (tagoh) fedora-extras-commits at redhat.com
Fri May 16 02:44:19 UTC 2008


Author: tagoh

Update of /cvs/pkgs/rpms/paps/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv7387

Modified Files:
	paps-cups.patch paps.spec 
Added Files:
	paps-dsc-compliant.patch 
Removed Files:
	paps-0.6.8-dsc-compliant.patch 
Log Message:
* Fri May 16 2008 Akira TAGOH <tagoh at redhat.com> - 0.6.8-6
- paps-cups.patch: Fix printing with -o landscape in CUPS. (#222137)

paps-dsc-compliant.patch:

--- NEW FILE paps-dsc-compliant.patch ---
diff -pruN paps-0.6.8.orig/src/libpaps.c paps-0.6.8/src/libpaps.c
--- paps-0.6.8.orig/src/libpaps.c	2008-05-14 23:07:14.000000000 +0900
+++ paps-0.6.8/src/libpaps.c	2008-05-14 23:11:12.000000000 +0900
@@ -118,7 +118,6 @@ gchar *paps_get_postscript_header_strdup
     gchar *ret_str;
     g_string_append_printf(paps->header,
 			   "end end\n"
-			   "%%%%EndPrologue\n"
 			   );
     ret_str = g_strdup(paps->header->str);
     g_string_truncate(paps->header, old_len);
@@ -247,7 +246,6 @@ static void
 add_postscript_prologue(paps_private_t *paps)
 {
   g_string_append_printf(paps->header,
-			 "%%%%BeginProlog\n"
 			 "/papsdict 1 dict def\n"
 			 "papsdict begin\n"
 			 "\n"
@@ -272,10 +270,10 @@ add_postscript_prologue(paps_private_t *
 			 "/start_ol { gsave } bind def\n"
 			 "/end_ol { closepath fill grestore } bind def\n"
 			 /* Specify both x and y. */
-			 "/draw_char { fontdict begin gsave %f dup scale last_x last_y translate load exec end grestore} def\n"
-			 "/goto_xy { fontdict begin /last_y exch def /last_x exch def end } def\n"
-			 "/goto_x { fontdict begin /last_x exch def end } def\n"
-			 "/fwd_x { fontdict begin /last_x exch last_x add def end } def\n"
+			 "/draw_char { fontdict begin gsave %f dup scale last_x cvi last_y cvi translate load exec end grestore} def\n"
+			 "/goto_xy { fontdict begin /last_y exch string_y cvs def /last_x exch string_x cvs def end } def\n"
+			 "/goto_x { fontdict begin /last_x exch string_x cvs def end } def\n"
+			 "/fwd_x { fontdict begin /last_x exch last_x cvi add string_x cvs def end } def\n"
 			 "/c /curveto load def\n"
 			 "/x /conicto load def\n"
 			 "/l /lineto load def\n"
@@ -344,7 +342,7 @@ add_postscript_prologue(paps_private_t *
 
   /* Open up dictionaries */
   g_string_append(paps->header,
-		  "/fontdict 1 dict def\n"
+		  "/fontdict 1 dict dup begin 16 string dup /string_x exch def /last_x exch def 16 string dup /string_y exch def /last_y exch def end def\n"
 		  "papsdict begin fontdict begin\n");
 }
 
diff -pruN paps-0.6.8.orig/src/paps.c paps-0.6.8/src/paps.c
--- paps-0.6.8.orig/src/paps.c	2008-05-14 23:07:14.000000000 +0900
+++ paps-0.6.8/src/paps.c	2008-05-14 23:12:53.000000000 +0900
@@ -659,7 +659,7 @@ int main(int argc, char *argv[])
   fprintf(OUT, "%s", paps_header);
   g_free(paps_header);
 
-  fprintf(OUT, "%%%%EndPrologue\n");
+  fprintf(OUT, "%%%%EndSetup\n");
   fprintf(OUT, "%s", ps_pages_string->str);
   print_postscript_trailer(OUT, num_pages);
 
@@ -1089,8 +1089,9 @@ void print_postscript_header(FILE *OUT,
           "%%%%Creator: paps version 0.6.7 by Dov Grobgeld\n"
           "%%%%Pages: (atend)\n"
           "%%%%BoundingBox: 0 0 %d %d\n%s"
-          "%%%%BeginProlog\n"
           "%%%%Orientation: %s\n"
+          "%%%%EndComments\n"
+          "%%%%BeginProlog\n"
           "/papsdict 1 dict def\n"
           "papsdict begin\n"
           "\n"
@@ -1134,7 +1135,8 @@ void print_postscript_header(FILE *OUT,
           "/turnpage {\n"
           "  90 rotate\n"
           "  0 pageheight neg translate\n"
-          "} def\n",
+          "} def\n"
+          "%%%%EndProlog\n",
 	  /*
 	   * Put %%cupsRotation tag to prevent the rotation in pstops.
 	   * This breaks paps's behavior to make it in landscape say.
@@ -1150,6 +1152,7 @@ void print_postscript_header(FILE *OUT,
   g_free(owner);
   
   fprintf(OUT,
+          "%%%%BeginSetup\n"
           "%% User settings\n"
           "/pagewidth %d def\n"
           "/pageheight %d def\n"
@@ -1232,8 +1235,8 @@ void print_postscript_trailer(FILE *OUT,
                              int num_pages)
 {
   fprintf(OUT,
-          "%%%%Pages: %d\n"
           "%%%%Trailer\n"
+          "%%%%Pages: %d\n"
           "%%%%EOF\n",
           num_pages
           );

paps-cups.patch:

Index: paps-cups.patch
===================================================================
RCS file: /cvs/pkgs/rpms/paps/devel/paps-cups.patch,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- paps-cups.patch	30 Nov 2007 11:29:46 -0000	1.12
+++ paps-cups.patch	16 May 2008 02:43:31 -0000	1.13
@@ -1,6 +1,6 @@
 diff -pruN paps-0.6.8.orig/configure.in paps-0.6.8/configure.in
 --- paps-0.6.8.orig/configure.in	2007-01-19 20:06:10.000000000 +0900
-+++ paps-0.6.8/configure.in	2007-11-30 18:40:32.000000000 +0900
++++ paps-0.6.8/configure.in	2008-05-15 22:46:49.000000000 +0900
 @@ -7,6 +7,19 @@ AC_LANG_C
  AC_PROG_CC
  AM_PROG_LIBTOOL
@@ -22,8 +22,8 @@
  DX_CHM_FEATURE(OFF)
  DX_CHI_FEATURE(OFF)
 diff -pruN paps-0.6.8.orig/src/Makefile.am paps-0.6.8/src/Makefile.am
---- paps-0.6.8.orig/src/Makefile.am	2007-11-30 18:40:15.000000000 +0900
-+++ paps-0.6.8/src/Makefile.am	2007-11-30 18:40:32.000000000 +0900
+--- paps-0.6.8.orig/src/Makefile.am	2008-05-15 22:46:34.000000000 +0900
++++ paps-0.6.8/src/Makefile.am	2008-05-15 22:46:49.000000000 +0900
 @@ -5,10 +5,10 @@ libpapsinc_HEADERS = libpaps.h
  libpapsincdir = $(includedir)
  
@@ -38,8 +38,8 @@
  
  EXTRA_DIST = test_libpaps.c paps.1
 diff -pruN paps-0.6.8.orig/src/paps.c paps-0.6.8/src/paps.c
---- paps-0.6.8.orig/src/paps.c	2007-11-30 18:40:15.000000000 +0900
-+++ paps-0.6.8/src/paps.c	2007-11-30 18:47:28.000000000 +0900
+--- paps-0.6.8.orig/src/paps.c	2008-05-15 22:46:34.000000000 +0900
++++ paps-0.6.8/src/paps.c	2008-05-15 22:48:42.000000000 +0900
 @@ -31,6 +31,7 @@
  #include <string.h>
  #include <time.h>
@@ -80,7 +80,7 @@
  
    /* Set locale from environment. */
    setlocale(LC_ALL, "");
-@@ -348,6 +353,134 @@ int main(int argc, char *argv[])
+@@ -348,6 +353,128 @@ int main(int argc, char *argv[])
    g_option_context_add_main_entries(ctxt, entries, NULL);
  #endif
    
@@ -148,14 +148,8 @@
 +		if ((val = cupsGetOption("landscape", num_options, options)) != NULL) {
 +			if (g_ascii_strcasecmp(val, "no") &&
 +			    g_ascii_strcasecmp(val, "off") &&
-+			    g_ascii_strcasecmp(val, "false")) {
-+				/* We really need to deal with the landscape orientation because
-+				 * pstops doesn't deal with the position where it should appears.
-+				 * However this causes the unnecessary rotation by pstops. so paps
-+				 * will puts the fake Orientation tag and stop rotating in PS.
-+				 */
++			    g_ascii_strcasecmp(val, "false"))
 +				do_landscape = TRUE;
-+			}
 +		}
 +		/* XXX: need to support orientation-requested? */
 +		if ((val = cupsGetOption("page-left", num_options, options)) != NULL) {
@@ -215,7 +209,7 @@
    /* Parse command line */
    if (!g_option_context_parse(ctxt, &argc, &argv, &error))
      {
-@@ -374,6 +507,8 @@ int main(int argc, char *argv[])
+@@ -374,6 +501,8 @@ int main(int argc, char *argv[])
        IN = stdin;
      }
    title = filename_in;
@@ -224,7 +218,7 @@
    
    paps = paps_new();
    pango_context = paps_get_pango_context (paps);
-@@ -392,8 +527,10 @@ int main(int argc, char *argv[])
+@@ -392,8 +521,10 @@ int main(int argc, char *argv[])
    pango_context_set_font_description (pango_context, font_description);
  
    /* Page layout */
@@ -237,7 +231,7 @@
    
    if (num_columns == 1)
      total_gutter_width = 0;
-@@ -456,6 +593,8 @@ int main(int argc, char *argv[])
+@@ -456,6 +587,8 @@ int main(int argc, char *argv[])
    page_layout.pango_dir = pango_dir;
    page_layout.filename = filename_in;
    page_layout.header_font_desc = header_font_desc;
@@ -246,7 +240,7 @@
  
    /* calculate x-coordinate scale */
    if (page_layout.cpi > 0.0L)
-@@ -756,6 +895,12 @@ split_text_into_paragraphs (PangoContext
+@@ -756,6 +889,12 @@ split_text_into_paragraphs (PangoContext
            if (wc == (gunichar)-1)
              {
                fprintf (stderr, "%s: Invalid character in input\n", g_get_prgname ());
@@ -259,15 +253,19 @@
                wc = 0;
              }
            if (!*p || !wc || wc == '\n' || wc == '\f')
-@@ -925,6 +1070,7 @@ void print_postscript_header(FILE *OUT,
+@@ -925,21 +1064,32 @@ void print_postscript_header(FILE *OUT,
    int orientation = page_layout->page_width > page_layout->page_height;
    int bb_page_width = page_layout->page_width;
    int bb_page_height = page_layout->page_height;
 +  char *owner = NULL;
    
    /* Keep bounding box non-rotated to make ggv happy */
-   if (orientation)
-@@ -934,12 +1080,20 @@ void print_postscript_header(FILE *OUT,
+-  if (orientation)
++  /* ensure the correct bounding box for CUPS */
++  if (orientation && !page_layout->cups_mode)
+     {
+       int tmp = bb_page_width;
+       bb_page_width = bb_page_height;
        bb_page_height = tmp;
      }
    
@@ -281,6 +279,7 @@
 +    }
    fprintf(OUT,
            "%%!PS-Adobe-3.0\n"
++	  "%s"
            "%%%%Title: %s\n"
            "%%%%Creator: paps version 0.6.7 by Dov Grobgeld\n"
            "%%%%Pages: (atend)\n"
@@ -289,31 +288,35 @@
            "%%%%BeginProlog\n"
            "%%%%Orientation: %s\n"
            "/papsdict 1 dict def\n"
-@@ -989,8 +1143,13 @@ void print_postscript_header(FILE *OUT,
+@@ -961,7 +1111,7 @@ void print_postscript_header(FILE *OUT,
+           "             pagewidth\n"
+           "             /pagewidth pageheight def\n"
+           "             /pageheight exch def\n"
+-          "             /orientation 3 def\n"
++          "             /orientation %d def\n"
+           "         } if\n"
+           "         2 dict\n"
+           "         dup /PageSize [pagewidth pageheight] put\n"
+@@ -986,11 +1136,21 @@ void print_postscript_header(FILE *OUT,
+           "  90 rotate\n"
+           "  0 pageheight neg translate\n"
+           "} def\n",
++	  /*
++	   * Put %%cupsRotation tag to prevent the rotation in pstops.
++	   * This breaks paps's behavior to make it in landscape say.
++	   * (RH#222137)
++	   */
++	  (page_layout->cups_mode ? "%cupsRotation: 0\n" : ""),
            title,
            bb_page_width,
            bb_page_height,
 -          orientation_names[orientation]
 +          owner,
-+	  /* Put the fake orientation tag if paps is currently running under
-+	   * the CUPS filter mode. (#222137)
-+	   */
-+          orientation_names[orientation && !page_layout->cups_mode]
++          orientation_names[orientation],
++          /* For landscape, rotate page to portrait orientation for CUPS (RH#222137) */
++          page_layout->cups_mode ? 2 : 3
            );
 +  g_free(owner);
    
    fprintf(OUT,
            "%% User settings\n"
-@@ -1015,7 +1174,11 @@ void print_postscript_header(FILE *OUT,
-           page_layout->left_margin,
-           page_layout->page_height - bodytop,
-           bool_name[page_layout->do_separation_line>0],
--          bool_name[page_layout->do_landscape>0],
-+	  /* just ignore the landscape flag when paps is currently running
-+	   * under the CUPS filter mode. this will stop rotating in PS that
-+	   * paps generates. (#222137)
-+	   */
-+          bool_name[page_layout->do_landscape>0 && !page_layout->cups_mode],
-           bool_name[page_layout->do_tumble>0],
-           bool_name[page_layout->do_duplex>0]
-           );


Index: paps.spec
===================================================================
RCS file: /cvs/pkgs/rpms/paps/devel/paps.spec,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- paps.spec	12 Feb 2008 09:59:46 -0000	1.31
+++ paps.spec	16 May 2008 02:43:31 -0000	1.32
@@ -1,6 +1,6 @@
 Name:		paps
 Version:	0.6.8
-Release:	5%{?dist}
+Release:	6%{?dist}
 
 License:	LGPLv2+
 URL:		http://paps.sourceforge.net/
@@ -19,7 +19,7 @@
 Patch4:		paps-0.6.6-exitcode.patch
 Patch50:	paps-cups.patch
 Patch51:	paps-cpilpi.patch
-Patch52:	paps-0.6.8-dsc-compliant.patch
+Patch52:	paps-dsc-compliant.patch
 Patch61:	paps-0.6.6-fix-wcswidth.patch
 
 Summary:	Plain Text to PostScript converter
@@ -98,6 +98,9 @@
 %{_libdir}/libpaps.so
 
 %changelog
+* Fri May 16 2008 Akira TAGOH <tagoh at redhat.com> - 0.6.8-6
+- paps-cups.patch: Fix printing with -o landscape in CUPS. (#222137)
+
 * Tue Feb 12 2008 Akira TAGOH <tagoh at redhat.com> - 0.6.8-5
 - Rebuild for gcc-4.3.
 


--- paps-0.6.8-dsc-compliant.patch DELETED ---




More information about the fedora-extras-commits mailing list