cairo.cc

Alexis Bienvenüe, 10/13/2019 04:04 pm

Download (512 Bytes)

 
1
#include <cairo.h>
2
#include <cairo-pdf.h>
3
4
// gcc cairo.cc `pkg-config --cflags --libs cairo`
5
6
int main() {
7
  cairo_surface_t *surface;
8
  cairo_t *cr;
9
  cairo_matrix_t matrix;
10
11
  surface = cairo_pdf_surface_create ("cairo.pdf", 150, 120);
12
  cr = cairo_create (surface);
13
14
  cairo_matrix_init(&matrix, 1.5, 0.1, 0.1, 1.0, 0.0, 0.0);
15
  cairo_set_matrix(cr, &matrix);
16
17
  cairo_move_to (cr, 50, 50);
18
  cairo_show_text (cr, "Texte");
19
20
  cairo_surface_finish(surface);
21
  cairo_surface_destroy(surface);
22
23
  return(0);
24
}