summaryrefslogtreecommitdiff
path: root/doc/tutorial/src/twin.c
diff options
context:
space:
mode:
authormh0310.choi <mh0310.choi@samsung.com>2015-07-28 10:46:57 +0900
committermh0310.choi <mh0310.choi@samsung.com>2015-07-28 13:08:12 +0900
commit5e67a6f721eaedda61300baf0799199c7771ebd0 (patch)
tree6cd50b52498aab50e79b966cdccc2a137db316d9 /doc/tutorial/src/twin.c
parentd3aeffba37161d2b76b29c4ea13369bd67a47a8e (diff)
downloadcairo-5e67a6f721eaedda61300baf0799199c7771ebd0.tar.gz
cairo-5e67a6f721eaedda61300baf0799199c7771ebd0.tar.bz2
cairo-5e67a6f721eaedda61300baf0799199c7771ebd0.zip
- from 1.12.14 to 1.14.2 Change-Id: I3b62d212041b337bbb926d579f9ce74f42a45c3b
Diffstat (limited to 'doc/tutorial/src/twin.c')
-rw-r--r--doc/tutorial/src/twin.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/doc/tutorial/src/twin.c b/doc/tutorial/src/twin.c
new file mode 100644
index 000000000..14347bac2
--- /dev/null
+++ b/doc/tutorial/src/twin.c
@@ -0,0 +1,39 @@
+/**
+ * Put this file in cairo/doc/tutorial/src and type "make"
+ */
+
+#define WIDTH 1350
+#define HEIGHT 900
+
+#include "cairo-tutorial.h"
+
+
+static void
+draw (cairo_t *cr, int width, int height)
+{
+ int i, j, h;
+ unsigned char s[2] = {0, 0};
+
+ /* clear background */
+ cairo_set_source_rgb (cr, 1.0, 1.0, 1.0); /* white */
+ cairo_paint (cr);
+
+ cairo_set_source_rgb (cr, 0, 0, 0);
+ cairo_select_font_face (cr,
+ "@cairo:",
+ CAIRO_FONT_SLANT_NORMAL,
+ CAIRO_FONT_WEIGHT_NORMAL);
+
+ h = 2;
+ for (i = 8; i < 48; i >= 24 ? i+=3 : i++) {
+ cairo_set_font_size (cr, i);
+ for (j = 33; j < 128; j++) {
+ if (j == 33 || (j == 80 && i > 24)) {
+ h += i + 2;
+ cairo_move_to (cr, 10, h);
+ }
+ s[0] = j;
+ cairo_show_text (cr, (const char *) s);
+ }
+ }
+}