summaryrefslogtreecommitdiffstats
path: root/drw.c
diff options
context:
space:
mode:
authorDouglas Rumbaugh <doug@douglasrumbaugh.com>2021-12-19 22:13:32 -0500
committerDouglas Rumbaugh <doug@douglasrumbaugh.com>2021-12-19 22:13:32 -0500
commit60036de81ef8279033682c6fc117627e96d7b574 (patch)
treea274332f5457a654e2e991b2bd51ec0e84e8a963 /drw.c
parenta92bca0d79269f7597720014973fd570b1253b91 (diff)
downloaddwm-60036de81ef8279033682c6fc117627e96d7b574.tar.gz
Applied statusbar font patch
https://dwm.suckless.org/patches/statusbarfont/
Diffstat (limited to 'drw.c')
-rw-r--r--drw.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drw.c b/drw.c
index 8f1059e..073502e 100644
--- a/drw.c
+++ b/drw.c
@@ -249,7 +249,7 @@ drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int
}
int
-drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert)
+drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lpad, const char *text, int invert, const int fontindex)
{
char buf[1024];
int ty;
@@ -288,6 +288,8 @@ drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, unsigned int lp
nextfont = NULL;
while (*text) {
utf8charlen = utf8decode(text, &utf8codepoint, UTF_SIZ);
+ curfont = drw->fonts;
+ for (int i=0;i<fontindex;i++){ curfont = curfont->next ;}
for (curfont = drw->fonts; curfont; curfont = curfont->next) {
charexists = charexists || XftCharExists(drw->dpy, curfont->xfont, utf8codepoint);
if (charexists) {
@@ -390,11 +392,11 @@ drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h)
}
unsigned int
-drw_fontset_getwidth(Drw *drw, const char *text)
+drw_fontset_getwidth(Drw *drw, const char *text ,int fontindex)
{
if (!drw || !drw->fonts || !text)
return 0;
- return drw_text(drw, 0, 0, 0, 0, 0, text, 0);
+ return drw_text(drw, 0, 0, 0, 0, 0, text, 0,fontindex);
}
void