[gnome-font-viewer] font-utils: Add face_index argument



commit a62d0bfd2f66abfb3d9c57bd8d3c267db35225e8
Author: Peng Wu <alexepico gmail com>
Date:   Mon Jan 25 16:47:41 2016 +0900

    font-utils: Add face_index argument
    
    font_utils_get_font_name_for_file() now takes face index as the third
    argument.  All callers changed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=752005

 src/font-model.c |    4 +++-
 src/font-utils.c |    6 ++++--
 src/font-utils.h |    3 ++-
 3 files changed, 9 insertions(+), 4 deletions(-)
---
diff --git a/src/font-model.c b/src/font-model.c
index 4e0d2b2..f3df1cb 100644
--- a/src/font-model.c
+++ b/src/font-model.c
@@ -413,7 +413,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/src/font-utils.c b/src/font-utils.c
index 75790e6..0e7b5c1 100644
--- a/src/font-utils.c
+++ b/src/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/src/font-utils.h b/src/font-utils.h
index 992624e..2dfe786 100644
--- a/src/font-utils.h
+++ b/src/font-utils.h
@@ -27,6 +27,7 @@
 
 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__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]