diff options
author | Midare Kiyura <puce@gmx.com> | 2008-05-24 16:04:33 -0500 |
---|---|---|
committer | Shawn <sabetts@juicebox.(none)> | 2008-05-24 23:41:09 -0700 |
commit | d37c7484ab881b0283fd4573235b24fe7d1e7af9 (patch) | |
tree | 981341de090bb7834ab4617aed763218d9c7e8f5 /src/screen.c | |
parent | c7ec59674cfe315f2a0ea54fc7444b4a6a6a8a67 (diff) | |
download | ratpoison-d37c7484ab881b0283fd4573235b24fe7d1e7af9.zip |
Add xft support
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/screen.c b/src/screen.c index 7d2fc6e..88b95b7 100644 --- a/src/screen.c +++ b/src/screen.c @@ -343,6 +343,29 @@ init_screen (rp_screen *s, int screen_num) XSelectInput (dpy, s->help_window, KeyPressMask); XSync (dpy, 0); + +#ifdef USE_XFT_FONT + { + XRenderColor rc = {0, 0, 0, 0xFFFF}; + + if (!XftColorAllocValue (dpy, DefaultVisual (dpy, screen_num), + DefaultColormap (dpy, screen_num), &rc, &s->color)) + { + PRINT_ERROR(("Failed to allocate font color\n")); + s->ft_font = NULL; + } + else + { + s->ft_font = XftFontOpenName (dpy, screen_num, DEFAULT_XFT_FONT); + if (!s->ft_font) + { + PRINT_ERROR(("Failed to open font\n")); + XftColorFree (dpy, DefaultVisual (dpy, screen_num), + DefaultColormap (dpy, screen_num), &s->color); + } + } + } +#endif } static int |