diff options
Diffstat (limited to 'drw.c')
| -rw-r--r-- | drw.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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 |