[gs-commits] ghostpdl branch, master, updated. ghostpdl-9.02-988-g0c98813

Henry Stiles henrys at ghostscript.com
Sat Mar 3 18:11:42 UTC 2012


The ghostpdl branch, master has been updated
       via  0c98813be9c1a24bbcf9ca0c1d4127cb4aa4209f (commit)
       via  9d10c339014b9e554116ef55c697f50109071bb2 (commit)
      from  7180b9328f00fb5df41e6d019e16f70ae4f66ec7 (commit)

----------------------------------------------------------------------
commit 0c98813be9c1a24bbcf9ca0c1d4127cb4aa4209f
Author: Henry Stiles <henry.stiles at artifex.com>
Date:   Sat Mar 3 11:03:53 2012 -0700

    Fixes bug 692894, orientation of pcl pages incorrect.
    
    This is a case of the current code emulating undocumented behavior
    incorrectly.  It appears the HP printers resets the print direction
    upon receiving a new page size command. Previously we tried to emulate
    this by not resetting the logical page orientation which is incorrect
    but happened to print the tests we had correctly.

diff --git a/pcl/pcpage.c b/pcl/pcpage.c
index c9e6e34..e59d044 100644
--- a/pcl/pcpage.c
+++ b/pcl/pcpage.c
@@ -590,8 +590,6 @@ pcl_end_page(
     code = (*pcs->end_page)(pcs, pcs->num_copies, true);
     if ( code < 0 )
         return code;
-    /* allow the logical orientation command to be used again */
-    pcs->orientation_set = false;
 
     if ( pcs->end_page == pcl_end_page_top )
         code = gs_erasepage(pcs->pgs);
@@ -658,13 +656,8 @@ set_page_size(
         }
     }
     if ((psize != 0) && ((code = pcl_end_page_if_marked(pcs)) >= 0)) {
-        /* if the orientation flag is not set for this page we select
-           a portrait page using the set paper size.  Otherwise select
-           the paper using the current orientation. */
-        if ( pcs->orientation_set == false )
-            new_logical_page(pcs, 0, psize, false, false);
-        else
-            new_page_size(pcs, psize, false, false);
+        pcs->xfm_state.print_dir = 0;
+        new_page_size(pcs, psize, false, false);
     }
     return code;
 }
@@ -759,7 +752,6 @@ set_logical_page_orientation(
 
     /* If orientation is same as before ignore the command */
     if ( i == pcs->xfm_state.lp_orient ) {
-        pcs->orientation_set = true;
         return 0;
     }
 
@@ -770,7 +762,6 @@ set_logical_page_orientation(
         pcs->hmi_cp = HMI_DEFAULT;
         pcs->vmi_cp = VMI_DEFAULT;
         new_logical_page(pcs, i, pcs->xfm_state.paper_size, false, false);
-        pcs->orientation_set = true;
     }
     return code;
 }
@@ -1324,7 +1315,6 @@ pcpage_do_reset(
     }
 
     if ((type & (pcl_reset_initial | pcl_reset_printer)) != 0) {
-        pcs->orientation_set = false;
         pcs->paper_source = 0;          /* ??? */
         pcs->xfm_state.left_offset_cp = 0.0;
         pcs->xfm_state.top_offset_cp = 0.0;
diff --git a/pcl/pcstate.h b/pcl/pcstate.h
index 25760c5..e2be724 100644
--- a/pcl/pcstate.h
+++ b/pcl/pcstate.h
@@ -148,8 +148,7 @@ struct pcl_state_s {
     int             perforation_skip;
     pcl_margins_t   margins;            /* relative to print_direction */
     pcl_xfm_state_t xfm_state;
-    bool            orientation_set;    /* the orientation command can
-                                           only be set once per page */
+
     /* Chapter 6 (pcursor.c) */
     coord           hmi_cp;
     coord           vmi_cp;

----------------------------------------------------------------------
commit 9d10c339014b9e554116ef55c697f50109071bb2
Author: Henry Stiles <henry.stiles at artifex.com>
Date:   Fri Feb 17 13:51:23 2012 -0700

    Better error handling in the absence of fonts.

diff --git a/pcl/pcfsel.c b/pcl/pcfsel.c
index 37e667d..40c9137 100644
--- a/pcl/pcfsel.c
+++ b/pcl/pcfsel.c
@@ -437,7 +437,7 @@ pcl_reselect_font(pcl_font_selection_t *pfs, const pcl_state_t *pcs, bool intern
                     }
               }
             if ( best_font == 0 )
-                return -1;	/* no fonts */
+                return gs_throw_code(gs_error_Fatal);
 #ifdef DEBUG
             if ( gs_debug_c('=') ) {
                 dprintf_font_scoring("champion", best_font, mapp, best_match);
diff --git a/pcl/pctext.c b/pcl/pctext.c
index 56b43bd..677ab73 100644
--- a/pcl/pctext.c
+++ b/pcl/pctext.c
@@ -940,7 +940,7 @@ pcl_text(
         return 0;
     /* set up the current font and HMI */
     if ((pcs->font == 0) && ((code = pcl_recompute_font(pcs, false)) < 0))
-        return code;
+        return gs_rethrow_code(code);
 
     /* set up the graphic state */
     code = pcl_set_drawing_color( pcs,


Summary of changes:
 pcl/pcfsel.c  |    2 +-
 pcl/pcpage.c  |   14 ++------------
 pcl/pcstate.h |    3 +--
 pcl/pctext.c  |    2 +-
 4 files changed, 5 insertions(+), 16 deletions(-)



More information about the gs-commits mailing list