From aee2ce6e1ed7395160a72477309618a2271e14d1 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 25 Sep 2011 09:57:37 +0200 Subject: index.c, thumbnail.c: Fix --title-font fallback to default (closes #65) --- ChangeLog | 1 + src/index.c | 3 ++- src/thumbnail.c | 3 +++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d955e8d..c28cf05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,7 @@ git HEAD (fun fact: strictly speaking, this was not a memory leak) * "--image-bg default" was renamed to "--image-bg checks" + * Fix --title-font fallback behaviour Sun, 11 Sep 2011 12:46:50 +0200 Daniel Friesel diff --git a/src/index.c b/src/index.c index 4b4c77f..4a1a0f0 100644 --- a/src/index.c +++ b/src/index.c @@ -79,8 +79,9 @@ void init_index_mode(void) int fh, fw; title_fn = gib_imlib_load_font(opt.title_font); - if (!fn) + if (!title_fn) title_fn = gib_imlib_load_font(DEFAULT_FONT_TITLE); + gib_imlib_get_text_size(title_fn, "W", NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT); title_area_h = fh + 4; } else diff --git a/src/thumbnail.c b/src/thumbnail.c index 0c8d00a..6c61322 100644 --- a/src/thumbnail.c +++ b/src/thumbnail.c @@ -104,6 +104,9 @@ void init_thumbnail_mode(void) int fh, fw; td.font_title = gib_imlib_load_font(opt.title_font); + if (!td.font_title) + td.font_title = gib_imlib_load_font(DEFAULT_FONT_TITLE); + gib_imlib_get_text_size(td.font_title, "W", NULL, &fw, &fh, IMLIB_TEXT_TO_RIGHT); title_area_h = fh + 4; -- cgit v1.2.3