diff options
author | Srinivasa Ragavan <sragavan@src.gnome.org> | 2006-07-20 15:51:51 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2006-07-20 15:51:51 +0800 |
commit | 35a3b3e69964df852a4a649336fe473a42da491c (patch) | |
tree | 8d2dfcd0de4dedf7e393aae546c8755eb4f77d76 /e-util/e-util.c | |
parent | 281a1b94af981d5cb9a69d3b6e2e616e031f9a73 (diff) | |
download | gsoc2013-evolution-35a3b3e69964df852a4a649336fe473a42da491c.tar.gz gsoc2013-evolution-35a3b3e69964df852a4a649336fe473a42da491c.tar.zst gsoc2013-evolution-35a3b3e69964df852a4a649336fe473a42da491c.zip |
Added code to read font options.
svn path=/trunk/; revision=32358
Diffstat (limited to 'e-util/e-util.c')
-rw-r--r-- | e-util/e-util.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/e-util/e-util.c b/e-util/e-util.c index 4415961c2b..7216f0e8cc 100644 --- a/e-util/e-util.c +++ b/e-util/e-util.c @@ -1125,3 +1125,54 @@ e_gettext (const char *msgid) return dgettext (E_I18N_DOMAIN, msgid); } + +cairo_font_options_t * +get_font_options () +{ + char *antialiasing, *hinting, *subpixel_order; + GConfClient *gconf = gconf_client_get_default (); + cairo_font_options_t *font_options = cairo_font_options_create (); + + /* Antialiasing */ + antialiasing = gconf_client_get_string (gconf, + "/desktop/gnome/font_rendering/antialiasing", NULL); + if (strcmp (antialiasing, "grayscale") == 0) + cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_GRAY); + else if (strcmp (antialiasing, "rgba") == 0) + cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_SUBPIXEL); + else if (strcmp (antialiasing, "none") == 0) + cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_NONE); + else + cairo_font_options_set_antialias (font_options, CAIRO_ANTIALIAS_DEFAULT); + + hinting = gconf_client_get_string (gconf, + "/desktop/gnome/font_rendering/hinting", NULL); + if (strcmp (hinting, "full") == 0) + cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_FULL); + else if (strcmp (hinting, "medium") == 0) + cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_MEDIUM); + else if (strcmp (hinting, "slight") == 0) + cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_SLIGHT); + else if (strcmp (hinting, "none") == 0) + cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_NONE); + else + cairo_font_options_set_hint_style (font_options, CAIRO_HINT_STYLE_DEFAULT); + + subpixel_order = gconf_client_get_string (gconf, + "/desktop/gnome/font_rendering/rgba_order", NULL); + if (strcmp (subpixel_order, "rgb") == 0) + cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_RGB); + else if (strcmp (subpixel_order, "bgr") == 0) + cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_BGR); + else if (strcmp (subpixel_order, "vrgb") == 0) + cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_VRGB); + else if (strcmp (subpixel_order, "vbgr") == 0) + cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_VBGR); + else + cairo_font_options_set_subpixel_order (font_options, CAIRO_SUBPIXEL_ORDER_DEFAULT); + + g_object_unref (gconf); + return font_options; +} + + |