diff options
author | raveit65 <[email protected]> | 2017-03-08 14:20:29 +0100 |
---|---|---|
committer | raveit65 <[email protected]> | 2017-03-08 16:08:00 +0100 |
commit | d38f3a50bcf258111c61ea1df373fc7b6763d16c (patch) | |
tree | e43d8d27634f6593c8dce6c652fa1ff952e9baf3 /font-viewer | |
parent | cc735a639e2a49fabfd46cde007f84c36472e8d3 (diff) | |
download | mate-control-center-d38f3a50bcf258111c61ea1df373fc7b6763d16c.tar.bz2 mate-control-center-d38f3a50bcf258111c61ea1df373fc7b6763d16c.tar.xz |
font-viewer font-view: Support TTC fonts
https://bugzilla.gnome.org/show_bug.cgi?id=752005
taken from:
https://git.gnome.org/browse/gnome-font-viewer/commit/?id=11d181c
Diffstat (limited to 'font-viewer')
-rw-r--r-- | font-viewer/font-view.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/font-viewer/font-view.c b/font-viewer/font-view.c index aab821b3..0668d6cd 100644 --- a/font-viewer/font-view.c +++ b/font-viewer/font-view.c @@ -492,7 +492,8 @@ font_view_ensure_model (FontViewApplication *self) static void font_view_application_do_open (FontViewApplication *self, - GFile *file) + GFile *file, + gint face_index) { gchar *uri; @@ -526,7 +527,7 @@ font_view_application_do_open (FontViewApplication *self, GdkRGBA black = { 0.0, 0.0, 0.0, 1.0 }; GtkWidget *w; - self->font_widget = GTK_WIDGET (sushi_font_widget_new (uri, 0)); + self->font_widget = GTK_WIDGET (sushi_font_widget_new (uri, face_index)); gtk_widget_override_color (self->font_widget, GTK_STATE_NORMAL, &black); gtk_widget_override_background_color (self->font_widget, GTK_STATE_FLAG_NORMAL, &white); @@ -542,7 +543,7 @@ font_view_application_do_open (FontViewApplication *self, g_signal_connect (self->font_widget, "error", G_CALLBACK (font_widget_error_cb), self); } else { - g_object_set (self->font_widget, "uri", uri, "face-index", 0, NULL); + g_object_set (self->font_widget, "uri", uri, "face-index", face_index, NULL); sushi_font_widget_load (SUSHI_FONT_WIDGET (self->font_widget)); } @@ -561,6 +562,7 @@ icon_view_release_cb (GtkWidget *widget, GtkTreePath *path; GtkTreeIter iter; gchar *font_path; + gint face_index; GFile *file; /* eat double/triple click events */ @@ -574,11 +576,12 @@ icon_view_release_cb (GtkWidget *widget, gtk_tree_model_get_iter (self->model, &iter, path)) { gtk_tree_model_get (self->model, &iter, COLUMN_PATH, &font_path, + COLUMN_FACE_INDEX, &face_index, -1); if (font_path != NULL) { file = g_file_new_for_path (font_path); - font_view_application_do_open (self, file); + font_view_application_do_open (self, file, face_index); g_object_unref (file); } gtk_tree_path_free (path); @@ -670,7 +673,7 @@ query_info_ready_cb (GObject *object, font_view_show_font_error (self, error->message); g_error_free (error); } else { - font_view_application_do_open (self, G_FILE (object)); + font_view_application_do_open (self, G_FILE (object), 0); } g_clear_object (&info); |