[cairo-commit] [cairo-www] src/FAQ.mdwn
Carl Worth
cworth at freedesktop.org
Tue Oct 20 16:52:30 PDT 2009
src/FAQ.mdwn | 29 ++++++++++++++++++-----------
1 file changed, 18 insertions(+), 11 deletions(-)
New commits:
commit 0e336d2ebe2578f71aee81edb5d92563f4b0b57d
Author: spitzak <spitzak at web>
Date: Tue Oct 20 16:52:30 2009 -0700
Added some help for csh
diff --git a/src/FAQ.mdwn b/src/FAQ.mdwn
index 8fe950c..0100f7c 100644
--- a/src/FAQ.mdwn
+++ b/src/FAQ.mdwn
@@ -37,24 +37,25 @@ Create a file called `hello.c` containing
int
main (int argc, char *argv[])
{
- cairo_surface_t *surface;
- cairo_t *cr;
-
- surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 240, 80);
- cr = cairo_create (surface);
+ cairo_surface_t *surface =
+ cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 240, 80);
+ cairo_t *cr =
+ cairo_create (surface);
cairo_select_font_face (cr, "serif", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_BOLD);
cairo_set_font_size (cr, 32.0);
cairo_set_source_rgb (cr, 0.0, 0.0, 1.0);
cairo_move_to (cr, 10.0, 50.0);
cairo_show_text (cr, "Hello, world");
+
cairo_destroy (cr);
cairo_surface_write_to_png (surface, "hello.png");
cairo_surface_destroy (surface);
-
return 0;
}
+After compiling, run the resulting `hello` program you'll have a PNG
+image file named `hello.png` with "Hello World" written in blue.
<h2 id="compilation_flags">What compilation flags are required to compile that code?</h2>
@@ -70,14 +71,20 @@ pkg-config installed, then you can compile the above hello.c with:
cc -o hello $(pkg-config --cflags --libs cairo) hello.c
-and, after running the resulting `hello` program you'll have a PNG
-image file named `hello.png` with "Hello World" written in blue.
+If you are using a csh style shell, use backquotes:
-NOTE: If cairo is not installed to a system directory that pkg-config
+ cc -o hello `pkg-config --cflags --libs cairo` hello.c
+
+If cairo is not installed to a system directory that pkg-config
is aware of, then you will need to tell pkg-config about the directory
by setting the `PKG_CONFIG_PATH` environment variable to point to the
-directory into which cairo.pc is installed, (for example, with bash,
-`export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig`).
+directory into which cairo.pc is installed, For example, with bash:
+
+ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
+
+or for csh:
+
+ setenv PKG_CONFIG_PATH /usr/local/lib/pkgconfig
<h1 id="drawing_questions">Drawing questions</h1>
More information about the cairo-commit
mailing list