diff options
author | Xan Lopez <xan@gnome.org> | 2009-07-25 00:05:51 +0800 |
---|---|---|
committer | Xan Lopez <xan@gnome.org> | 2009-07-25 00:05:51 +0800 |
commit | 63b75ff9e83a2ee7bd33ec221477a63fdf66d0d2 (patch) | |
tree | 27b026344ea5dac400fb0a74ed9b3101b47ec82c /embed/ephy-embed-prefs.c | |
parent | 76d8dc8d01dd1458cb4a2ccd0f22662427e7a21e (diff) | |
download | gsoc2013-epiphany-63b75ff9e83a2ee7bd33ec221477a63fdf66d0d2.tar gsoc2013-epiphany-63b75ff9e83a2ee7bd33ec221477a63fdf66d0d2.tar.gz gsoc2013-epiphany-63b75ff9e83a2ee7bd33ec221477a63fdf66d0d2.tar.bz2 gsoc2013-epiphany-63b75ff9e83a2ee7bd33ec221477a63fdf66d0d2.tar.lz gsoc2013-epiphany-63b75ff9e83a2ee7bd33ec221477a63fdf66d0d2.tar.xz 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/ephy-embed-prefs.c')
-rw-r--r-- | embed/ephy-embed-prefs.c | 39 |
1 files changed, 37 insertions, 2 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 }, |