diff options
author | sabetts <sabetts> | 2007-05-04 20:25:10 +0000 |
---|---|---|
committer | sabetts <sabetts> | 2007-05-04 20:25:10 +0000 |
commit | fd9c683b25edd3a56eaaed005fe51545bbb93217 (patch) | |
tree | 8acdbefc03b252c668d187439663b6e75d1dde8c /src | |
parent | 95fa75486929a9f535ae9a7283bd3dfc52528a2f (diff) | |
download | ratpoison-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.h | 1 | ||||
-rw-r--r-- | src/main.c | 7 |
2 files changed, 7 insertions, 1 deletions
@@ -121,5 +121,6 @@ /* The default font */ #define DEFAULT_FONT "-*-fixed-bold-r-normal-*-15-*-*-*-c-*-*-*" +#define BACKUP_FONT "*" #endif /* !_ _RATPOISON_CONF_H */ @@ -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); |