#include "cairo/cairo.h" void main () { cairo_surface_t *surface; cairo_t *cr; surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, 600, 600); cr = cairo_create(surface); cairo_set_source_rgb(cr, 0, 0, 0); cairo_select_font_face (cr, "Arial", CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); const char* txt = "N"; cairo_set_font_size(cr, 10); cairo_text_extents_t ext; cairo_text_extents(cr, txt, &ext); for (int j = 0; j < 50; ++j) for (int i = 0; i < 50; ++i) { cairo_move_to(cr, (ext.width * (1.999 + j * 0.0005)) * i + 20, j * 12 + 11); cairo_show_text(cr, txt); } cairo_destroy(cr); cairo_surface_write_to_png(surface, "magicnum.png"); cairo_surface_destroy(surface); }