X11: Allow bold attribute for menucolors

This commit is contained in:
Pasi Kallinen
2018-10-12 20:46:19 +03:00
parent 62234b871f
commit 9f2f232d99
4 changed files with 66 additions and 1 deletions
+28
View File
@@ -484,6 +484,34 @@ int *x, *y, *width, *height;
*y -= top;
}
/* Change the full font name string so the weight is "bold" */
char *
fontname_boldify(fontname)
const char *fontname;
{
static char buf[BUFSZ];
char *bufp = buf;
int idx = 0;
while (*fontname) {
if (*fontname == '-')
idx++;
*bufp = *fontname;
if (idx == 3) {
strcat(buf, "bold");
bufp += 5;
do {
fontname++;
} while (*fontname && *fontname != '-');
} else {
bufp++;
fontname++;
}
}
*bufp = '\0';
return buf;
}
#ifdef TEXTCOLOR
/* ARGSUSED */
static void