summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@gnome.org>2006-02-02 02:13:08 +0000
committerBehdad Esfahbod <behdad@src.gnome.org>2006-02-02 02:13:08 +0000
commite2a2ac7947f8763fe1270d0f5f42602e59d84c0a (patch)
treeeebbf706bde5321c2319e9c273e09607b7f875af /examples
parentb69dea4155ec9a51617f727e8bd0c6ff74d15570 (diff)
downloadpango-e2a2ac7947f8763fe1270d0f5f42602e59d84c0a.tar.gz
AC_DEFINE (HAVE_CAIRO_PNG).
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.
Diffstat (limited to 'examples')
-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
8 files changed, 23 insertions, 10 deletions
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"