[cairo-commit] cairo-demo/PS ChangeLog,NONE,1.1 .cvsignore,1.1,1.2 basket.c,1.2,1.3

Carl Worth commit at pdx.freedesktop.org
Tue Nov 4 06:14:09 PST 2003


Committed by: cworth

Update of /cvs/cairo/cairo-demo/PS
In directory pdx:/tmp/cvs-serv27751

Modified Files:
	.cvsignore basket.c 
Added Files:
	ChangeLog 
Log Message:
Add a loop so that the PostScript output has more than one page.

--- NEW FILE: ChangeLog ---
2003-11-04  Carl Worth  <cworth at isi.edu>

	* basket.c (main): Add a loop so the PostScript output has more
	than one page.

2003-11-03  Carl Worth  <cworth at isi.edu>

	* basket.c (Y_INCHES): Increased page size and borders so the
	figure doesn't land in the unprintable regions near the paper
	edge.


Index: .cvsignore
===================================================================
RCS file: /cvs/cairo/cairo-demo/PS/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** .cvsignore	1 Nov 2003 05:59:13 -0000	1.1
--- .cvsignore	4 Nov 2003 14:14:07 -0000	1.2
***************
*** 1 ****
--- 1,3 ----
  basket
+ *.ps
+ *.png

Index: basket.c
===================================================================
RCS file: /cvs/cairo/cairo-demo/PS/basket.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** basket.c	3 Nov 2003 21:36:28 -0000	1.2
--- basket.c	4 Nov 2003 14:14:07 -0000	1.3
***************
*** 27,30 ****
--- 27,31 ----
  
  #include <cairo.h>
+ #include <math.h>
  
  #include "write_png.h"
***************
*** 51,54 ****
--- 52,56 ----
      cairo_t *cr;
      FILE *file;
+     int i;
  
      file = fopen (FILENAME, "w");
***************
*** 60,69 ****
      cr = cairo_create ();
  
-     cairo_set_target_ps (cr, file, X_INCHES, Y_INCHES, X_PPI, Y_PPI);
- 
-     draw (cr);
- 
-     cairo_show_page (cr);
- 
      cairo_set_target_image (cr, image, CAIRO_FORMAT_ARGB32, WIDTH, HEIGHT, STRIDE);
  
--- 62,65 ----
***************
*** 72,81 ****
      write_png_argb32 (image, "basket.png", WIDTH, HEIGHT, STRIDE);
  
      cairo_destroy (cr);
  
      fclose (file);
  
-     FcFini ();
- 
      return 0;
  }
--- 68,87 ----
      write_png_argb32 (image, "basket.png", WIDTH, HEIGHT, STRIDE);
  
+     cairo_set_target_ps (cr, file, X_INCHES, Y_INCHES, X_PPI, Y_PPI);
+ 
+     for (i = 0; i <= 5 ; i++) {
+ 	draw (cr);
+ 	if (i == 0)
+ 	    cairo_copy_page (cr);
+ 	cairo_show_page (cr);
+ 	cairo_rotate (cr, - M_PI / 10.0);
+ 	cairo_translate (cr, 50, 100);
+ 	cairo_scale (cr, .5, .5);
+     }
+ 
      cairo_destroy (cr);
  
      fclose (file);
  
      return 0;
  }





More information about the cairo-commit mailing list