#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)
{
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,
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");
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