Merge remote-tracking branch 'upstream/master' into xft-port
* upstream/master: Conform to coding standard and errors Fixed font selection
This commit is contained in:
commit
020a3e1848
|
@ -91,7 +91,7 @@ Set the text foreground color. The parameter I<color> can be I<-> or a color in
|
||||||
|
|
||||||
=item B<T>I<index>
|
=item B<T>I<index>
|
||||||
|
|
||||||
Set the font used to draw the following text. The parameter I<index> is a 1-based index of the font list supplied to bar. Any other value (for example I<->) resets the bar to normal behaviour (matching the first font that can be used for that character). If the selected font can't be used to draw a character, lemonbar will fall back to normal behaviour for that character.
|
Set the font used to draw the following text. The parameter I<index> can either be I<-> or the 1-based index of the slot which contains the desired font. If the parameter is I<-> lemonbar resets to the normal behavior (matching the first font that can be used for the character). If the selected font can't be used to draw a character, lemonbar will fall back to normal behavior for that character
|
||||||
|
|
||||||
=item B<U>I<color>
|
=item B<U>I<color>
|
||||||
|
|
||||||
|
|
|
@ -641,6 +641,11 @@ parse (char *text)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'T':
|
case 'T':
|
||||||
|
if (*p == '-') { //Reset to automatic font selection
|
||||||
|
font_index = -1;
|
||||||
|
p++;
|
||||||
|
break;
|
||||||
|
} else if (isdigit(*p)) {
|
||||||
font_index = (int)strtoul(p, &ep, 10);
|
font_index = (int)strtoul(p, &ep, 10);
|
||||||
// User-specified 'font_index' ∊ (0,font_count]
|
// User-specified 'font_index' ∊ (0,font_count]
|
||||||
// Otherwise just fallback to the automatic font selection
|
// Otherwise just fallback to the automatic font selection
|
||||||
|
@ -648,6 +653,10 @@ parse (char *text)
|
||||||
font_index = -1;
|
font_index = -1;
|
||||||
p = ep;
|
p = ep;
|
||||||
break;
|
break;
|
||||||
|
} else {
|
||||||
|
fprintf(stderr, "Invalid font slot \"%c\"\n", *p++); //Swallow the token
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
// In case of error keep parsing after the closing }
|
// In case of error keep parsing after the closing }
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user