int
main (void)
{
+ const char font_filename[] = "/srv/rdworth.org/cgi-bin/Verdana.ttf";
char outputJson = FALSE;
char characters[] = {
FT_Vector kerning;
error = FT_Init_FreeType( &library );
- if ( error )
- printf("error");
+ if ( error ) {
+ fprintf (stderr, "Fatal error initializing freetype.\n");
+ exit (1);
+ }
- error = FT_New_Face( library,"/srv/rdworth.org/cgi-bin/Verdana.ttf",
+ error = FT_New_Face( library, font_filename,
0,
&ft_face );
- if ( error == FT_Err_Unknown_File_Format )
- printf("File opened. Font format unsupported.");
- else if ( error )
- printf("Could not be open or read or broken.");
+ if ( error == FT_Err_Unknown_File_Format ) {
+ fprintf (stderr, "Unsupported font format: %s\n", font_filename);
+ exit (1);
+ } else if ( error ) {
+ fprintf (stderr, "Failed to open file: %s\n", font_filename);
+ exit (1);
+ }
use_kerning = FT_HAS_KERNING( ft_face );