diff options
author | Markus Teich <markus.teich@stusta.mhn.de> | 2015-10-31 18:07:07 +0100 |
---|---|---|
committer | Markus Teich <markus.teich@stusta.mhn.de> | 2015-10-31 18:07:07 +0100 |
commit | a9ca2473fd72462eaf90346258119c13c74bddcb (patch) | |
tree | 8fa7bddfc91501b0b625d02613858504eea6241f /sent.c | |
parent | 4a114392bbdef9fc23d7f346ad1dab4f855bed17 (diff) |
fix font width calculations
Diffstat (limited to 'sent.c')
-rw-r--r-- | sent.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -312,17 +312,18 @@ void pngdraw(Image *img) void getfontsize(char *str, unsigned int *width, unsigned int *height) { size_t i; - size_t len = strlen(str); for (i = 0; i < NUMFONTSCALES; i++) { drw_setfontset(d, fonts[i]); - drw_font_getexts(fonts[i], str, len, width, height); + *height = fonts[i]->h; + *width = drw_fontset_getwidth(d, str); if (*width > xw.uw || *height > xw.uh) break; } if (i > 0) { drw_setfontset(d, fonts[i-1]); - drw_font_getexts(fonts[i-1], str, len, width, height); + *height = fonts[i-1]->h; + *width = drw_fontset_getwidth(d, str); } *width += d->fonts->h; } |