aboutsummaryrefslogtreecommitdiffstats
path: root/embed
diff options
context:
space:
mode:
authorXan Lopez <xan@gnome.org>2009-07-25 00:05:51 +0800
committerXan Lopez <xan@gnome.org>2009-07-25 00:05:51 +0800
commit63b75ff9e83a2ee7bd33ec221477a63fdf66d0d2 (patch)
tree27b026344ea5dac400fb0a74ed9b3101b47ec82c /embed
parent76d8dc8d01dd1458cb4a2ccd0f22662427e7a21e (diff)
downloadgsoc2013-epiphany-63b75ff9e83a2ee7bd33ec221477a63fdf66d0d2.tar.gz
gsoc2013-epiphany-63b75ff9e83a2ee7bd33ec221477a63fdf66d0d2.tar.zst
gsoc2013-epiphany-63b75ff9e83a2ee7bd33ec221477a63fdf66d0d2.zip
ephy-embed-prefs: use the font families set in the GNOME preferences
We were using the defaults set in WebKitGTK+.
Diffstat (limited to 'embed')
-rw-r--r--embed/ephy-embed-prefs.c39
-rw-r--r--embed/ephy-embed-prefs.h4
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"