diff options
-rw-r--r-- | embed/ephy-embed-prefs.c | 39 | ||||
-rw-r--r-- | embed/ephy-embed-prefs.h | 4 |
2 files changed, 39 insertions, 4 deletions
diff --git a/embed/ephy-embed-prefs.c b/embed/ephy-embed-prefs.c index df1c79bef..49cff34d1 100644 --- a/embed/ephy-embed-prefs.c +++ b/embed/ephy-embed-prefs.c @@ -165,17 +165,52 @@ webkit_pref_callback_font_size (GConfClient *client, g_object_set (settings, webkit_pref, size, NULL); } +static void +webkit_pref_callback_font_family (GConfClient *client, + guint cnxn_id, + GConfEntry *entry, + gpointer data) +{ + GConfValue *gcvalue; + char *webkit_pref = data; + const char *value = NULL; + + gcvalue = gconf_entry_get_value (entry); + + /* happens on initial notify if the key doesn't exist */ + if (gcvalue != NULL && + gcvalue->type == GCONF_VALUE_STRING) { + value = gconf_value_get_string (gcvalue); + } + + if (value) { + PangoFontDescription* desc; + const char *family = NULL; + + desc = pango_font_description_from_string (value); + family = pango_font_description_get_family (desc); + g_object_set (settings, webkit_pref, family, NULL); + pango_font_description_free (desc); + } +} + static const PrefData webkit_pref_entries[] = { { CONF_RENDERING_FONT_MIN_SIZE, "minimum-font-size", webkit_pref_callback_int }, - { CONF_DESKTOP_FONT_VAR_SIZE, + { CONF_DESKTOP_FONT_VAR_NAME, "default-font-size", webkit_pref_callback_font_size }, - { CONF_DESKTOP_FONT_FIXED_SIZE, + { CONF_DESKTOP_FONT_VAR_NAME, + "default-font-family", + webkit_pref_callback_font_family }, + { CONF_DESKTOP_FONT_FIXED_NAME, "default-monospace-font-size", webkit_pref_callback_font_size }, + { CONF_DESKTOP_FONT_FIXED_NAME, + "monospace-font-family", + webkit_pref_callback_font_family }, { CONF_SECURITY_JAVASCRIPT_ENABLED, "enable-scripts", webkit_pref_callback_boolean }, diff --git a/embed/ephy-embed-prefs.h b/embed/ephy-embed-prefs.h index 7fd07951e..ada4ac860 100644 --- a/embed/ephy-embed-prefs.h +++ b/embed/ephy-embed-prefs.h @@ -54,8 +54,8 @@ #define CONF_NETWORK_SOCKS_PROXY_PORT "/system/proxy/socks_port" #define CONF_NETWORK_PROXY_AUTO_URL "/system/proxy/autoconfig_url" #define CONF_NETWORK_PROXY_IGNORE_HOSTS "/system/http_proxy/ignore_hosts" -#define CONF_DESKTOP_FONT_VAR_SIZE "/desktop/gnome/interface/font_name" -#define CONF_DESKTOP_FONT_FIXED_SIZE "/desktop/gnome/interface/monospace_font_name" +#define CONF_DESKTOP_FONT_VAR_NAME "/desktop/gnome/interface/font_name" +#define CONF_DESKTOP_FONT_FIXED_NAME "/desktop/gnome/interface/monospace_font_name" /* DEPRECATED, we migrate them */ #define CONF_RENDERING_FONT_VAR_SIZE_OLD "/apps/epiphany/web/font_var_size" |