summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--configure.in4
-rw-r--r--examples/HELLO.utf82
-rw-r--r--examples/cairosimple.c1
-rw-r--r--examples/cairoview.c15
-rw-r--r--examples/pangoft2topgm.c1
-rw-r--r--examples/renderdemo.c9
-rw-r--r--examples/viewer-win32.c2
-rw-r--r--examples/viewer-x.c2
-rw-r--r--examples/xftview.c1
10 files changed, 33 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index cc2c467e..4656dea2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2006-02-01 Behdad Esfahbod <behdad@gnome.org>
+ * configure.in: AC_DEFINE (HAVE_CAIRO_PNG).
+
+ * examples/cairoview.c: Save to PNG if cairo has PNG support and
+ --output is given.
+
+2006-02-01 Behdad Esfahbod <behdad@gnome.org>
+
* pango/pangocairo-font.c: For mini_font, set family to "monospace",
not "mono-space" which didn't work!
diff --git a/configure.in b/configure.in
index 8d599c8f..756552e0 100644
--- a/configure.in
+++ b/configure.in
@@ -294,7 +294,9 @@ if $have_cairo ; then
LDFLAGS="$LDFLAGS $INSTALLED_CAIRO_LIBS"
AC_CHECK_LIB(cairo, cairo_surface_write_to_png, have_cairo_png=true, :)
-
+ if $have_cairo_png; then
+ AC_DEFINE(HAVE_CAIRO_PNG, 1, [Whether Cairo has PNG support])
+ fi
have_cairo=false
AC_CHECK_LIB(cairo, cairo_win32_scaled_font_select_font, have_cairo_win32=true, :)
if $have_cairo_win32 && $have_win32; then
diff --git a/examples/HELLO.utf8 b/examples/HELLO.utf8
index 741d3917..84792ffd 100644
--- a/examples/HELLO.utf8
+++ b/examples/HELLO.utf8
@@ -3,8 +3,6 @@ This is Pango (Παν語)
This is a list of ways to say hello in various languages.
Its purpose is to illustrate a number of scripts.
-(Converted into UTF-8)
-
---------------------------------------------------------
Arabic السَّلام عليكُم
Bengali (বাঙ্লা) ষাগতোম
diff --git a/examples/cairosimple.c b/examples/cairosimple.c
index fb973260..fc9a77a1 100644
--- a/examples/cairosimple.c
+++ b/examples/cairosimple.c
@@ -1,3 +1,4 @@
+#include <config.h>
#include <math.h>
#include <pango/pangocairo.h>
diff --git a/examples/cairoview.c b/examples/cairoview.c
index e677bcd7..8e43a56a 100644
--- a/examples/cairoview.c
+++ b/examples/cairoview.c
@@ -21,6 +21,8 @@
* Boston, MA 02111-1307, USA.
*/
+#include <config.h>
+
#include "renderdemo.h"
#include "viewer-x.h"
@@ -141,7 +143,6 @@ do_render (Display *display,
width, height);
cr = cairo_create (surface);
- cairo_surface_destroy (surface);
transform_callback (context, NULL, cr);
@@ -152,5 +153,17 @@ do_render (Display *display,
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
do_output (context, render_callback, transform_callback, cr, NULL, NULL, show_borders);
+#ifdef HAVE_CAIRO_PNG
+ if (opt_output && *opt_output)
+ {
+ cairo_status_t status;
+
+ status = cairo_surface_write_to_png (surface, opt_output);
+ if (status != CAIRO_STATUS_SUCCESS)
+ g_printerr ("could not save PNG to '%s'\n", opt_output);
+ }
+#endif
+
+ cairo_surface_destroy (surface);
cairo_destroy (cr);
}
diff --git a/examples/pangoft2topgm.c b/examples/pangoft2topgm.c
index ddd162a6..d52cfd19 100644
--- a/examples/pangoft2topgm.c
+++ b/examples/pangoft2topgm.c
@@ -21,6 +21,7 @@
* Boston, MA 02111-1307, USA.
*/
+#include <config.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/examples/renderdemo.c b/examples/renderdemo.c
index 6e3ff981..8eeba740 100644
--- a/examples/renderdemo.c
+++ b/examples/renderdemo.c
@@ -18,10 +18,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
-
-#define DEFAULT_FONT_FAMILY "Sans"
-#define DEFAULT_FONT_SIZE 18
-
+#include <config.h>
#include <errno.h>
#include <math.h>
#include <stdarg.h>
@@ -29,11 +26,13 @@
#include <stdio.h>
#include <string.h>
-
#include <pango/pango.h>
#include "renderdemo.h"
+#define DEFAULT_FONT_FAMILY "Sans"
+#define DEFAULT_FONT_SIZE 18
+
#define _MAKE_FONT_NAME(family, size) family " " #size
#define MAKE_FONT_NAME(family, size) _MAKE_FONT_NAME(family, size)
diff --git a/examples/viewer-win32.c b/examples/viewer-win32.c
index 50b66fea..3ac67ba0 100644
--- a/examples/viewer-win32.c
+++ b/examples/viewer-win32.c
@@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
-
+#include <config.h>
#include <gtk/gtk.h>
#include <gdk/win32/gdkwin32.h>
diff --git a/examples/viewer-x.c b/examples/viewer-x.c
index 8d2a4d11..18cb9ff8 100644
--- a/examples/viewer-x.c
+++ b/examples/viewer-x.c
@@ -18,7 +18,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
-
+#include <config.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
diff --git a/examples/xftview.c b/examples/xftview.c
index ab65a17a..d8d6be99 100644
--- a/examples/xftview.c
+++ b/examples/xftview.c
@@ -20,6 +20,7 @@
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
+#include <config.h>
#include "renderdemo.h"
#include "viewer-x.h"