2 * Put this file in cairo/doc/tutorial/src and type "make"
8 #include "cairo-tutorial.h"
12 draw (cairo_t *cr, int width, int height)
15 unsigned char s[2] = {0, 0};
17 /* clear background */
18 cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
21 cairo_set_source_rgb (cr, 0, 0, 0);
22 cairo_select_font_face (cr,
24 CAIRO_FONT_SLANT_NORMAL,
25 CAIRO_FONT_WEIGHT_NORMAL);
28 for (i = 8; i < 48; i >= 24 ? i+=3 : i++) {
29 cairo_set_font_size (cr, i);
30 for (j = 33; j < 128; j++) {
31 if (j == 33 || (j == 80 && i > 24)) {
33 cairo_move_to (cr, 10, h);
36 cairo_show_text (cr, (const char *) s);