diff options
Diffstat (limited to 'font-viewer/sushi-font-loader.c')
-rw-r--r-- | font-viewer/sushi-font-loader.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/font-viewer/sushi-font-loader.c b/font-viewer/sushi-font-loader.c index 9ac319fd..1991a861 100644 --- a/font-viewer/sushi-font-loader.c +++ b/font-viewer/sushi-font-loader.c @@ -87,10 +87,13 @@ create_face_from_contents (FontLoadJob *job, &retval); if (ft_error != 0) { - g_set_error_literal (error, G_IO_ERROR, 0, - "Unable to read the font face file"); + gchar *uri; + uri = g_file_get_uri (job->file); + g_set_error (error, G_IO_ERROR, 0, + "Unable to read the font face file '%s'", uri); retval = NULL; g_free (job->face_contents); + g_free (uri); } else { *contents = job->face_contents; } @@ -156,16 +159,20 @@ sushi_new_ft_face_from_uri (FT_Library library, GError **error) { FontLoadJob *job = NULL; + FT_Face face; job = font_load_job_new (library, uri, NULL, NULL); font_load_job_do_load (job, error); if ((error != NULL) && (*error != NULL)) { - g_object_unref (job); + font_load_job_free (job); return NULL; } - return create_face_from_contents (job, contents, error); + face = create_face_from_contents (job, contents, error); + font_load_job_free (job); + + return face; } /** |