summaryrefslogtreecommitdiff
path: root/font-viewer/sushi-font-loader.c
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2017-01-08 17:37:31 +0100
committerraveit65 <[email protected]>2017-02-17 12:28:22 +0100
commitd936cb03dd2f88b68ce60ce5fb7ac9698180c662 (patch)
tree1a133d976e83b23e4b647dec2a7aa5a202525a17 /font-viewer/sushi-font-loader.c
parent51280ca46635b75a756c67a87a6db7fa2fc1d058 (diff)
downloadmate-control-center-d936cb03dd2f88b68ce60ce5fb7ac9698180c662.tar.bz2
mate-control-center-d936cb03dd2f88b68ce60ce5fb7ac9698180c662.tar.xz
Fontviewer: Update SushiFontLoader and SushiFontWidget from sushi
taken from: https://git.gnome.org/browse/gnome-font-viewer/commit/?id=026e378 https://git.gnome.org/browse/gnome-font-viewer/commit/?id=044842e https://git.gnome.org/browse/gnome-font-viewer/commit/?id=63268c1 https://git.gnome.org/browse/gnome-font-viewer/commit/?id=0d617cf https://git.gnome.org/browse/gnome-font-viewer/commit/?id=4940840 https://git.gnome.org/browse/gnome-font-viewer/commit/?id=f0aac98 and others
Diffstat (limited to 'font-viewer/sushi-font-loader.c')
-rw-r--r--font-viewer/sushi-font-loader.c15
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;
}
/**