Added code to read font options.
svn path=/trunk/; revision=32358
This commit is contained in:
@ -1,3 +1,7 @@
|
||||
2006-07-20 Rajeev ramanathan <rajeevramanathan_2004@yahoo.co.in>
|
||||
|
||||
* e-util.[ch]: (get_font_options): Added code to get font options.
|
||||
|
||||
2006-06-15 Tor Lillqvist <tml@novell.com>
|
||||
|
||||
* e-plugin.c (ep_construct): On Win32, if the compile-time
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -27,6 +27,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <glib-object.h>
|
||||
#include <limits.h>
|
||||
#include <gconf/gconf-client.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
Reference in New Issue
Block a user