summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorsabetts <sabetts>2007-05-04 20:25:10 +0000
committersabetts <sabetts>2007-05-04 20:25:10 +0000
commitfd9c683b25edd3a56eaaed005fe51545bbb93217 (patch)
tree8acdbefc03b252c668d187439663b6e75d1dde8c /src
parent95fa75486929a9f535ae9a7283bd3dfc52528a2f (diff)
downloadratpoison-fd9c683b25edd3a56eaaed005fe51545bbb93217.zip
* src/main.c (init_defaults): if the default font fails, use the
backup font. * src/conf.h (BACKUP_FONT): new define
Diffstat (limited to 'src')
-rw-r--r--src/conf.h1
-rw-r--r--src/main.c7
2 files changed, 7 insertions, 1 deletions
diff --git a/src/conf.h b/src/conf.h
index 2095efd..d0322cc 100644
--- a/src/conf.h
+++ b/src/conf.h
@@ -121,5 +121,6 @@
/* The default font */
#define DEFAULT_FONT "-*-fixed-bold-r-normal-*-15-*-*-*-c-*-*-*"
+#define BACKUP_FONT "*"
#endif /* !_ _RATPOISON_CONF_H */
diff --git a/src/main.c b/src/main.c
index 779ae46..9ea60f4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -517,12 +517,17 @@ init_defaults (void)
defaults.padding_top = 0;
defaults.padding_bottom = 0;
+ /* Attempt to load a font */
defaults.font = load_query_font_set (dpy, DEFAULT_FONT);
if (defaults.font == NULL)
+ PRINT_ERROR (("ratpoison: Cannot load font %s.\n", DEFAULT_FONT));
+ defaults.font = load_query_font_set (dpy, BACKUP_FONT);
+ if (defaults.font == NULL)
{
- fprintf (stderr, "ratpoison: Cannot load font %s.\n", DEFAULT_FONT);
+ PRINT_ERROR (("ratpoison: Cannot load backup font %s . You lose.\n", BACKUP_FONT));
exit (EXIT_FAILURE);
}
+
defaults.font_string = xstrdup (DEFAULT_FONT);
set_extents_of_fontset (defaults.font);