summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
96d28dc)
And while we're at it, make the error messages a bit
more descriptive.
+ const char font_filename[] = "/srv/rdworth.org/cgi-bin/Verdana.ttf";
char outputJson = FALSE;
char characters[] = {
char outputJson = FALSE;
char characters[] = {
FT_Vector kerning;
error = FT_Init_FreeType( &library );
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,
- 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 );
use_kerning = FT_HAS_KERNING( ft_face );