libi3/font: Log the used font

This commit is contained in:
Quentin Glidic 2012-08-12 12:20:51 +02:00
parent 9f7247fd9c
commit 310f542937
1 changed files with 10 additions and 0 deletions

View File

@ -39,7 +39,15 @@ static bool load_pango_font(i3Font *font, const char *desc) {
/* Load the font description */ /* Load the font description */
font->specific.pango_desc = pango_font_description_from_string(desc); font->specific.pango_desc = pango_font_description_from_string(desc);
if (!font->specific.pango_desc) if (!font->specific.pango_desc)
{
ELOG("Could not open font %s with Pango, fallback to X font.\n", desc);
return false; return false;
}
LOG("Using Pango font %s, size %d",
pango_font_description_get_family(font->specific.pango_desc),
pango_font_description_get_size(font->specific.pango_desc)
);
/* We cache root_visual_type here, since you must call /* We cache root_visual_type here, since you must call
* load_pango_font before any other pango function * load_pango_font before any other pango function
@ -178,6 +186,8 @@ i3Font load_font(const char *pattern, const bool fallback) {
} }
} }
LOG("Using X font %s", pattern);
/* Get information (height/name) for this font */ /* Get information (height/name) for this font */
if (!(font.specific.xcb.info = xcb_query_font_reply(conn, info_cookie, NULL))) if (!(font.specific.xcb.info = xcb_query_font_reply(conn, info_cookie, NULL)))
errx(EXIT_FAILURE, "Could not load font \"%s\"", pattern); errx(EXIT_FAILURE, "Could not load font \"%s\"", pattern);