From 5f66d9ac8697b19fa8cc1556bab81c5a44024af4 Mon Sep 17 00:00:00 2001 From: hiro Date: Thu, 10 Feb 2011 06:55:37 +0000 Subject: implement fix_font_setting() for Mac OS X. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2843 ee746299-78ed-0310-b773-934348b2243d --- src/gtkutils.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'src/gtkutils.c') 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 @@ -118,6 +118,26 @@ gboolean gtkut_font_can_load(const gchar *str) pango_font_description_free(desc); } + 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; -- cgit v1.2.3