[gnome-font-viewer] sushi-font-loader: Add face_index argument
- From: Daiki Ueno <dueno src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-font-viewer] sushi-font-loader: Add face_index argument
- Date: Wed, 27 Jan 2016 03:17:03 +0000 (UTC)
commit 28bab705ddfb9040e5ffec64967555880bc54205
Author: Peng Wu <alexepico gmail com>
Date: Fri Jan 22 17:37:55 2016 +0900
sushi-font-loader: Add face_index argument
sushi_new_ft_face_from_uri{,_async}() now takes face index as the third
argument. All callers changed.
https://bugzilla.gnome.org/show_bug.cgi?id=752005
src/font-thumbnailer.c | 2 +-
src/font-utils.c | 2 +-
src/sushi-font-loader.c | 9 ++++++---
src/sushi-font-loader.h | 2 ++
src/sushi-font-widget.c | 1 +
5 files changed, 11 insertions(+), 5 deletions(-)
---
diff --git a/src/font-thumbnailer.c b/src/font-thumbnailer.c
index 2c31acd..d22f9d5 100644
--- a/src/font-thumbnailer.c
+++ b/src/font-thumbnailer.c
@@ -237,7 +237,7 @@ main (int argc,
uri = g_file_get_uri (file);
g_object_unref (file);
- face = sushi_new_ft_face_from_uri (library, uri, &contents, &gerror);
+ face = sushi_new_ft_face_from_uri (library, uri, 0, &contents, &gerror);
if (gerror) {
g_printerr ("Could not load face '%s': %s\n", uri,
gerror->message);
diff --git a/src/font-utils.c b/src/font-utils.c
index 5268ac5..75790e6 100644
--- a/src/font-utils.c
+++ b/src/font-utils.c
@@ -47,7 +47,7 @@ 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, &contents, &error);
+ face = sushi_new_ft_face_from_uri (library, uri, 0, &contents, &error);
if (face != NULL) {
name = font_utils_get_font_name (face);
FT_Done_Face (face);
diff --git a/src/sushi-font-loader.c b/src/sushi-font-loader.c
index b927e3f..c612b41 100644
--- a/src/sushi-font-loader.c
+++ b/src/sushi-font-loader.c
@@ -43,13 +43,14 @@ typedef struct {
static FontLoadJob *
font_load_job_new (FT_Library library,
const gchar *uri,
+ gint face_index,
GAsyncReadyCallback callback,
gpointer user_data)
{
FontLoadJob *job = g_slice_new0 (FontLoadJob);
job->library = library;
- job->face_index = 0;
+ job->face_index = (FT_Long) face_index;
job->file = g_file_new_for_uri (uri);
return job;
@@ -132,13 +133,14 @@ font_load_job (GTask *task,
FT_Face
sushi_new_ft_face_from_uri (FT_Library library,
const gchar *uri,
+ gint face_index,
gchar **contents,
GError **error)
{
FontLoadJob *job = NULL;
FT_Face face;
- job = font_load_job_new (library, uri, NULL, NULL);
+ job = font_load_job_new (library, uri, face_index, NULL, NULL);
font_load_job_do_load (job, error);
if ((error != NULL) && (*error != NULL)) {
@@ -159,10 +161,11 @@ sushi_new_ft_face_from_uri (FT_Library library,
void
sushi_new_ft_face_from_uri_async (FT_Library library,
const gchar *uri,
+ gint face_index,
GAsyncReadyCallback callback,
gpointer user_data)
{
- FontLoadJob *job = font_load_job_new (library, uri, callback, user_data);
+ FontLoadJob *job = font_load_job_new (library, uri, face_index, callback, user_data);
GTask *task;
task = g_task_new (NULL, NULL, callback, user_data);
diff --git a/src/sushi-font-loader.h b/src/sushi-font-loader.h
index 8a9df04..82aab03 100644
--- a/src/sushi-font-loader.h
+++ b/src/sushi-font-loader.h
@@ -32,11 +32,13 @@
FT_Face sushi_new_ft_face_from_uri (FT_Library library,
const gchar *uri,
+ gint face_index,
gchar **contents,
GError **error);
void sushi_new_ft_face_from_uri_async (FT_Library library,
const gchar *uri,
+ gint face_index,
GAsyncReadyCallback callback,
gpointer user_data);
diff --git a/src/sushi-font-widget.c b/src/sushi-font-widget.c
index 59313a8..8f00ff7 100644
--- a/src/sushi-font-widget.c
+++ b/src/sushi-font-widget.c
@@ -684,6 +684,7 @@ load_font_face (SushiFontWidget *self)
{
sushi_new_ft_face_from_uri_async (self->priv->library,
self->priv->uri,
+ 0,
font_face_async_ready_cb,
self);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]