aboutsummaryrefslogtreecommitdiff
path: root/src/gtkutils.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-02-10 06:55:37 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2011-02-10 06:55:37 +0000
commit5f66d9ac8697b19fa8cc1556bab81c5a44024af4 (patch)
treedc781a0795d122ad65d81d88c8a51c662d842d42 /src/gtkutils.c
parent67388bc8f489370792031bb7fca11eed20dcd416 (diff)
implement fix_font_setting() for Mac OS X.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2843 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/gtkutils.c')
-rw-r--r--src/gtkutils.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gtkutils.c b/src/gtkutils.c
index ecf38bf5..bb234078 100644
--- a/src/gtkutils.c
+++ b/src/gtkutils.c
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2008 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2011 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -119,6 +119,26 @@ gboolean gtkut_font_can_load(const gchar *str)
}
return can_load;
+#elif defined(__APPLE__)
+ PangoFontDescription *desc;
+ PangoContext *context;
+ PangoFont *font;
+ gboolean can_load = FALSE;
+
+ desc = pango_font_description_from_string(str);
+ if (desc) {
+ context = gdk_pango_context_get_for_screen
+ (gdk_screen_get_default());
+ font = pango_context_load_font(context, desc);
+ if (font) {
+ can_load = TRUE;
+ g_object_unref(font);
+ }
+ g_object_unref(context);
+ pango_font_description_free(desc);
+ }
+
+ return can_load;
#else
return FALSE;
#endif