blob: 9b0bb20064a7cdce54124930ef9ffdddb0581c03 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
#include <stdio.h>
#include <cairo/cairo-pdf.h>
#include <pango/pangocairo.h>
#include "draw.h"
// Metric
#define US_LETTER_WIDTH 216
#define US_LETTER_HEIGHT 279
#define A4_WIDTH 210
#define A4_HEIGHT 297
double width = A4_WIDTH;
double height = A4_HEIGHT;
int main (int argc, char **argv) {
char *filename;
// TBD clean this up
filename = argv[1];
if (argc == 1) {
filename = "output.pdf";
}
// Initialization
cairo_surface_t *surface = cairo_pdf_surface_create(filename, width, height);
cairo_t *cr = cairo_create(surface);
// Draw stuff here
fill_bg(cr, width, height);
// FUNCTIONS TO MAKE
// Draw Grid
// Draw Numbers
// Clean up
cairo_destroy(cr);
cairo_surface_destroy(surface);
return 0;
}
|