cvs: gd /gd-pango/examples rotated.c simple.c
[email protected] ("Takeshi Abe") Wed, 18 Jun 2008 16:34:30 -0000
| Newsgroups | php.gd.cvs |
|---|---|
| Message-ID | <cvstabe1213806870@cvsserver> |
tabe Wed Jun 18 16:34:30 2008 UTC
Modified files:
/gd/gd-pango/examples simple.c rotated.c
Log:
good examples start gdPangoInit(), without memory leak of course.
http://cvs.php.net/viewvc.cgi/gd/gd-pango/examples/simple.c?r1=1.2&r2=1.3&diff_format=u
Index: gd/gd-pango/examples/simple.c
diff -u gd/gd-pango/examples/simple.c:1.2 gd/gd-pango/examples/simple.c:1.3
--- gd/gd-pango/examples/simple.c:1.2 Sat Jun 14 14:50:24 2008
+++ gd/gd-pango/examples/simple.c Wed Jun 18 16:34:30 2008
@@ -15,7 +15,7 @@
| Authors: Pierre-A. Joye <[email protected]> |
+----------------------------------------------------------------------+
*/
-/* $Id: simple.c,v 1.2 2008/06/14 14:50:24 tabe Exp $ */
+/* $Id: simple.c,v 1.3 2008/06/18 16:34:30 tabe Exp $ */
#include <pango/pango.h>
#include <pango/pangoft2.h>
@@ -55,6 +55,8 @@
gdPangoColors default_colors;
PangoContext *pangocontext;
+ gdPangoInit();
+
default_colors.fg = gdTrueColorAlpha(0, 0, 255, 0);
default_colors.bg = gdTrueColorAlpha(255, 255, 255, 0);
default_colors.alpha = 0;
@@ -92,7 +94,6 @@
fp = fopen("c.png", "wb");
gdImagePng(im, fp);
fclose(fp);
-
gdImageDestroy(im);
/* Render to a new image, sized for text */
@@ -101,6 +102,7 @@
fp = fopen("d.png", "wb");
gdImagePng(im, fp);
fclose(fp);
+ gdImageDestroy(im);
gdPangoFreeContext(context);
return 0;
http://cvs.php.net/viewvc.cgi/gd/gd-pango/examples/rotated.c?r1=1.2&r2=1.3&diff_format=u
Index: gd/gd-pango/examples/rotated.c
diff -u gd/gd-pango/examples/rotated.c:1.2 gd/gd-pango/examples/rotated.c:1.3
--- gd/gd-pango/examples/rotated.c:1.2 Sat Jun 14 14:50:24 2008
+++ gd/gd-pango/examples/rotated.c Wed Jun 18 16:34:30 2008
@@ -15,7 +15,7 @@
| Authors: Pierre-A. Joye <[email protected]> |
+----------------------------------------------------------------------+
*/
-/* $Id: rotated.c,v 1.2 2008/06/14 14:50:24 tabe Exp $ */
+/* $Id: rotated.c,v 1.3 2008/06/18 16:34:30 tabe Exp $ */
#include <pango/pango.h>
#include <pango/pangoft2.h>
@@ -57,6 +57,8 @@
PangoMatrix rotated_matrix = PANGO_MATRIX_INIT;
PangoLayout *layout;
+ gdPangoInit();
+
default_colors.fg = gdTrueColorAlpha(0, 255, 255, 0);
default_colors.bg = gdTrueColorAlpha(255, 255, 255, 0);
default_colors.alpha = 0;