|
root / base / hammerhead-desktop / pdf-gen.c
pdf-gen.c C 23 lines 1.4 KB
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <cairo.h>
#include <cairo-pdf.h>
int main(int c,char**v){
 cairo_surface_t*s=cairo_pdf_surface_create(c>1?v[1]:"welcome.pdf",612,792);
 cairo_t*cr=cairo_create(s);
 cairo_set_source_rgb(cr,0.02,0.035,0.06); cairo_paint(cr);
 cairo_set_source_rgb(cr,0.12,0.71,0.71); cairo_rectangle(cr,0,0,612,8); cairo_fill(cr);
 cairo_select_font_face(cr,"sans",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_BOLD);
 cairo_set_font_size(cr,40); cairo_set_source_rgb(cr,0.12,0.71,0.71);
 cairo_move_to(cr,60,120); cairo_show_text(cr,"HAMMERHEAD");
 cairo_select_font_face(cr,"sans",CAIRO_FONT_SLANT_NORMAL,CAIRO_FONT_WEIGHT_NORMAL);
 cairo_set_font_size(cr,15); cairo_set_source_rgb(cr,0.55,0.68,0.68);
 cairo_move_to(cr,62,148); cairo_show_text(cr,"Zygaena Operating System");
 const char*L[]={"Welcome to your Hammerhead desktop.","",
  "This document is displayed by mupdf, built from source for",
  "Hammerhead - a 64-bit illumos-derived OS with a modern GNU",
  "toolchain running an XLibre + Openbox desktop, all GTK-free.","",
  "Keys:  Super+Return terminal   Super+f files   Super+e editor",
  "       Super+Space launcher    Right-click the desktop for the menu.",0};
 cairo_set_font_size(cr,14); double y=210;
 for(int i=0;L[i];i++){cairo_set_source_rgb(cr,0.82,0.9,0.9);cairo_move_to(cr,60,y);cairo_show_text(cr,L[i]);y+=26;}
 cairo_show_page(cr); cairo_destroy(cr); cairo_surface_destroy(s); return 0;}