X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Ffonts.c;h=6067bf2327ba1a5d0f07c5c39c398e980bab9cfa;hb=6526b47b2c63c9f46b63d3a5e72cbe71b04d60ac;hp=388921d675ab70d8bdbeb64b407365e01343559d;hpb=d97cd93a1c2eb18a697aa1e3c59e03eeabdc454d;p=monky diff --git a/src/fonts.c b/src/fonts.c index 388921d..6067bf2 100644 --- a/src/fonts.c +++ b/src/fonts.c @@ -1,4 +1,7 @@ -/* Conky, a system monitor, based on torsmo +/* -*- mode: c; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: t -*- + * vim: ts=4 sw=4 noet ai cindent syntax=c + * + * Conky, a system monitor, based on torsmo * * Any original torsmo code is licensed under the BSD license * @@ -7,7 +10,7 @@ * Please see COPYING for details * * Copyright (c) 2004, Hannu Saransaari and Lauri Hakkarainen - * Copyright (c) 2005-2009 Brenden Matthews, Philip Kovacs, et. al. + * Copyright (c) 2005-2010 Brenden Matthews, Philip Kovacs, et. al. * (see AUTHORS) * All rights reserved. * @@ -23,8 +26,6 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see . * - * vim: ts=4 sw=4 noet ai cindent syntax=c - * */ #include "conky.h" #include "fonts.h" @@ -57,7 +58,7 @@ void setup_fonts(void) window.xftdraw = 0; } window.xftdraw = XftDrawCreate(display, window.drawable, - DefaultVisual(display, screen), DefaultColormap(display, screen)); + window.visual, window.colourmap); } #endif /* XFT */ set_font(); @@ -134,7 +135,13 @@ void free_fonts(void) for (i = 0; i <= font_count; i++) { #ifdef XFT if (use_xft) { - XftFontClose(display, fonts[i].xftfont); + /* + * Do we not need to close fonts with Xft? Unsure. Not freeing the + * fonts seems to incur a slight memory leak, but it also prevents + * a crash. + * + * XftFontClose(display, fonts[i].xftfont); + */ fonts[i].xftfont = 0; } else #endif /* XFT */ @@ -173,13 +180,13 @@ void load_fonts(void) continue; } - ERR("can't load Xft font '%s'", fonts[i].name); + NORM_ERR("can't load Xft font '%s'", fonts[i].name); if ((fonts[i].xftfont = XftFontOpenName(display, screen, "courier-12")) != NULL) { continue; } - ERR("can't load Xft font '%s'", "courier-12"); + NORM_ERR("can't load Xft font '%s'", "courier-12"); if ((fonts[i].font = XLoadQueryFont(display, "fixed")) == NULL) { CRIT_ERR(NULL, NULL, "can't load font '%s'", "fixed"); @@ -191,7 +198,7 @@ void load_fonts(void) #endif /* load normal font */ if (!fonts[i].font && (fonts[i].font = XLoadQueryFont(display, fonts[i].name)) == NULL) { - ERR("can't load font '%s'", fonts[i].name); + NORM_ERR("can't load font '%s'", fonts[i].name); if ((fonts[i].font = XLoadQueryFont(display, "fixed")) == NULL) { CRIT_ERR(NULL, NULL, "can't load font '%s'", "fixed"); }