summaryrefslogtreecommitdiff
path: root/font-viewer
diff options
context:
space:
mode:
authorraveit65 <[email protected]>2017-03-08 13:32:04 +0100
committerraveit65 <[email protected]>2017-03-08 16:08:00 +0100
commit440e7588459f39a56043bc85658aec5a9262a2e3 (patch)
tree750a89986fc82ea2af9a1311790991cfdaa0a48d /font-viewer
parentadff2474297f0153bd5f06b9e89b7674eaef7435 (diff)
downloadmate-control-center-440e7588459f39a56043bc85658aec5a9262a2e3.tar.bz2
mate-control-center-440e7588459f39a56043bc85658aec5a9262a2e3.tar.xz
font-viewer font-utils: Add face_index argument
font_utils_get_font_name_for_file() now takes face index as the third argument. All callers changed.
Diffstat (limited to 'font-viewer')
-rw-r--r--font-viewer/font-model.c4
-rw-r--r--font-viewer/font-utils.c6
-rw-r--r--font-viewer/font-utils.h3
3 files changed, 9 insertions, 4 deletions
diff --git a/font-viewer/font-model.c b/font-viewer/font-model.c
index 9c1d82e8..3abd5a43 100644
--- a/font-viewer/font-model.c
+++ b/font-viewer/font-model.c
@@ -364,7 +364,9 @@ load_font_infos (GTask *task,
FcPatternGetString (self->priv->font_list->fonts[i], FC_FILE, 0, &file);
g_mutex_unlock (&self->priv->font_list_mutex);
- font_name = font_utils_get_font_name_for_file (self->priv->library, (const gchar *) file);
+ font_name = font_utils_get_font_name_for_file (self->priv->library,
+ (const gchar *) file,
+ 0);
if (!font_name)
continue;
diff --git a/font-viewer/font-utils.c b/font-viewer/font-utils.c
index 6c96395a..c9a84349 100644
--- a/font-viewer/font-utils.c
+++ b/font-viewer/font-utils.c
@@ -37,7 +37,8 @@ font_utils_get_font_name (FT_Face face)
gchar *
font_utils_get_font_name_for_file (FT_Library library,
- const gchar *path)
+ const gchar *path,
+ gint face_index)
{
GFile *file;
gchar *uri, *contents = NULL, *name = NULL;
@@ -47,7 +48,8 @@ font_utils_get_font_name_for_file (FT_Library library,
file = g_file_new_for_path (path);
uri = g_file_get_uri (file);
- face = sushi_new_ft_face_from_uri (library, uri, 0, &contents, &error);
+ face = sushi_new_ft_face_from_uri (library, uri, face_index, &contents,
+ &error);
if (face != NULL) {
name = font_utils_get_font_name (face);
FT_Done_Face (face);
diff --git a/font-viewer/font-utils.h b/font-viewer/font-utils.h
index 51bf47d5..4e6959b1 100644
--- a/font-viewer/font-utils.h
+++ b/font-viewer/font-utils.h
@@ -27,7 +27,8 @@
gchar * font_utils_get_font_name (FT_Face face);
gchar * font_utils_get_font_name_for_file (FT_Library library,
- const gchar *path);
+ const gchar *path,
+ gint face_index);
#endif /* __FONT_UTILS_H__ */