1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-09-29 21:49:07 +00:00

Fix regression with loading of non-Xft fonts (sf.net #2804324).

This commit is contained in:
Brenden Matthews 2009-06-10 14:08:39 -06:00
parent da65a4bcf8
commit 1571bb1aad
4 changed files with 18 additions and 2 deletions

View File

@ -1,3 +1,6 @@
2009-06-10
* Fix regression with loading of non-Xft fonts (sf.net #2804324)
2009-06-09
* Fixed a regression which causes fonts to not be rendered properly with
certain types of windows

View File

@ -6526,6 +6526,7 @@ static void draw_line(char *s)
cur_y -= font_ascent();
selected_font = specials[special_index].font_added;
set_font();
if (cur_y + font_ascent() < cur_y + old) {
cur_y += old;
} else {

View File

@ -32,6 +32,16 @@ int selected_font = 0;
int font_count = -1;
struct font_list *fonts = NULL;
void set_font(void)
{
#ifdef XFT
if (use_xft) return;
#endif /* XFT */
if (font_count > -1 && fonts[selected_font].font) {
XSetFont(display, window.gc, fonts[selected_font].font->fid);
}
}
void setup_fonts(void)
{
if ((output_methods & TO_X) == 0) {
@ -45,7 +55,8 @@ void setup_fonts(void)
window.xftdraw = XftDrawCreate(display, window.drawable,
DefaultVisual(display, screen), DefaultColormap(display, screen));
}
#endif
#endif /* XFT */
set_font();
}
int add_font(const char *data_in)
@ -171,7 +182,7 @@ void load_fonts(void)
}
#endif
/* load normal font */
if (fonts[i].font || (fonts[i].font = XLoadQueryFont(display, fonts[i].name)) == NULL) {
if (!fonts[i].font && (fonts[i].font = XLoadQueryFont(display, fonts[i].name)) == NULL) {
ERR("can't load font '%s'", fonts[i].name);
if ((fonts[i].font = XLoadQueryFont(display, "fixed")) == NULL) {
CRIT_ERR("can't load font '%s'", "fixed");

View File

@ -71,6 +71,7 @@ extern int selected_font;
extern int font_count;
void setup_fonts(void);
void set_font(void);
int add_font(const char *);
void set_first_font(const char *);
void free_fonts(void);