X-Git-Url: https://git.cworth.org/git?p=spritext;a=blobdiff_plain;f=spritext.c;fp=spritext.c;h=fd031a479d4f9caac2841ac46f0719d9a8dee241;hp=212b87214dc1cb9cec7569946892cb8f9690c083;hb=00364b1038bfd29bf210d3524319532cf7ab9f52;hpb=3939158960798ff712d9031def852db4bad09c74 diff --git a/spritext.c b/spritext.c index 212b872..fd031a4 100644 --- a/spritext.c +++ b/spritext.c @@ -19,11 +19,6 @@ #define TRUE (1==1) #define FALSE (!TRUE) -#if USE_CGIC -static cairo_status_t -stdio_write (void *closure, const unsigned char *data, unsigned int length); -#endif - static double get_max_width (cairo_t *cr, const char *characters, int num_characters) { @@ -316,15 +311,6 @@ main (void) parse_args (&args); -#if USE_CGIC - if (outputJson) - { - cgiHeaderContentType("application/json"); - } else { - cgiHeaderContentType("image/png"); - } -#endif - ft_face = load_ft_face_for_family (args.family); get_characters_max_width_height (ft_face, args.size, @@ -347,15 +333,6 @@ main (void) characters, ARRAY_SIZE (characters), max_width, max_height); -#if USE_CGIC - if (outputJson) - { - printf("}"); - } else { - cairo_surface_write_to_png_stream (surface, stdio_write, cgiOut); - } -#endif - cairo_surface_write_to_png (surface, "spritext-output.png"); printf ("Result written to spritext-output.png\n"); @@ -365,15 +342,3 @@ main (void) return 0; } - -#if USE_CGIC -static cairo_status_t -stdio_write (void *closure, const unsigned char *data, unsigned int length) -{ - FILE *file = closure; - if (fwrite (data, 1, length, file) == length) - return CAIRO_STATUS_SUCCESS; - else - return CAIRO_STATUS_WRITE_ERROR; -} -#endif