X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=spectrwm.c;h=596db238d92ef2023adc0cab897e751180b00ec2;hb=ff9956dda8ed3a7d857646620e0392f5672e23a6;hp=4ec19672f53e49f8c5349fc0dc892f4c076bbbf3;hpb=1931c8e6d7edc3ce4a7e48cab22ca7cb33396de6;p=spectrwm.git diff --git a/spectrwm.c b/spectrwm.c index 4ec1967..596db23 100644 --- a/spectrwm.c +++ b/spectrwm.c @@ -1866,7 +1866,8 @@ bar_refresh(void) void bar_setup(struct swm_region *r) { - char *font; + char *font, *fontpos; + int count; xcb_screen_t *screen = get_screen(r->s->idx); uint32_t wa[3]; XRenderColor color; @@ -1883,7 +1884,20 @@ bar_setup(struct swm_region *r) continue; DNPRINTF(SWM_D_INIT, "bar_setup: try font %s\n", font); - bar_font = XftFontOpenName(display, r->s->idx, font); + + count = 0; + fontpos = font; + while ((fontpos = index(fontpos, '-'))) { + count++; + fontpos++; + } + + if (count == 14) + bar_font = XftFontOpenXlfd(display, r->s->idx, + font); + else + bar_font = XftFontOpenName(display, r->s->idx, + font); if (!bar_font) { warnx("unable to load font %s", font); continue;