[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

gEDA-cvs: CVS update: f_print.c



  User: cnieves 
  Date: 07/06/09 10:59:02

  Modified:    .        f_print.c
  Log:
  Added EPS support.
  
  
  
  Applied patch #1713747 (with minor tweaks) from Wojciech Kazubski 
  
  adding support for EPS when writing an image. Thanks.
  
  
  
  
  Revision  Changes    Path
  1.30                 eda/geda/gaf/libgeda/src/f_print.c
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: f_print.c
  ===================================================================
  RCS file: /home/cvspsrv/cvsroot/eda/geda/gaf/libgeda/src/f_print.c,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -b -r1.29 -r1.30
  --- f_print.c	21 Apr 2007 21:39:45 -0000	1.29
  +++ f_print.c	9 Jun 2007 14:59:02 -0000	1.30
  @@ -94,7 +94,7 @@
    *  \return 0 on success, -1 on failure.
    */
   int f_print_header(TOPLEVEL *w_current, FILE *fp, 
  -		   int paper_size_x, int paper_size_y) 
  +		   int paper_size_x, int paper_size_y, int eps) 
   {
     char *buf;
     FILE *prolog;
  @@ -116,8 +116,11 @@
     }
   
     /* Output the DSC comments at the beginning of the document */
  -  fprintf(fp, "%%!PS-Adobe-3.0\n"
  -	  "%%%%Creator: gEDA gschem %s\n"
  +  if (eps)
  +    fprintf(fp, "%%!PS-Adobe-3.0 EPSF-3.0\n");
  +  else
  +    fprintf(fp, "%%!PS-Adobe-3.0\n");
  +  fprintf(fp, "%%%%Creator: gEDA gschem %s\n"
   	  "%%%%CreationDate: %s"
   	  "%%%%Title: %s\n"
   	  "%%%%Author: %s\n"
  @@ -434,6 +437,7 @@
     int unicode_count;
     gunichar unicode_table [128];  /* to contain the list of unicode
   				    characters that need mapping */
  +  int eps;
   
   
     /* Unicode support */
  @@ -485,6 +489,18 @@
   
     }
   
  +  if(w_current->paper_width == 0) {
  +    eps = 1;
  +    if(w_current->print_orientation == LANDSCAPE) {
  +      w_current->paper_width = dx;
  +      w_current->paper_height = dy;
  +    } else { /* portrait */
  +      w_current->paper_width = dy;
  +      w_current->paper_height = dx;
  +    }
  +  } else
  +    eps = 0;
  +  
     scale = 0.0;
     if(w_current->print_orientation == LANDSCAPE) {
       /* First attempt to fit in x direction. */
  @@ -512,7 +528,8 @@
     /* Output the header */
     if (f_print_header(w_current, fp, 
   		     w_current->paper_width, 
  -		     w_current->paper_height) != 0) {
  +		     w_current->paper_height,
  +		     eps) != 0) {
   
       /* There was an error in f_print_header */
       return -1;
  
  
  


_______________________________________________
geda-cvs mailing list
geda-cvs@xxxxxxxxxxxxxx
http://www.seul.org/cgi-bin/mailman/listinfo/geda-cvs