diff options
author | okan <okan> | 2013-05-02 17:25:15 +0000 |
---|---|---|
committer | okan <okan> | 2013-05-02 17:25:15 +0000 |
commit | 5acf6c147f88233c477e6f87ca94c45d8475ac73 (patch) | |
tree | bfa4adc3e3a48f6adb5f7deef2e70ea4f94e546c /font.c | |
parent | 5ab3b373d39c333de5774a9503c450fc9fccd814 (diff) | |
download | cwm-5acf6c147f88233c477e6f87ca94c45d8475ac73.tar.gz cwm-5acf6c147f88233c477e6f87ca94c45d8475ac73.tar.xz cwm-5acf6c147f88233c477e6f87ca94c45d8475ac73.zip |
no need for font_{ascent,descent,height} wrappers; limit font_width to
just requiring xftfont.
Diffstat (limited to 'font.c')
-rw-r--r-- | font.c | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/font.c b/font.c index 44d4666..c69d30c 100644 --- a/font.c +++ b/font.c @@ -30,24 +30,6 @@ #include "calmwm.h" -int -font_ascent(struct screen_ctx *sc) -{ - return (sc->xftfont->ascent); -} - -int -font_descent(struct screen_ctx *sc) -{ - return (sc->xftfont->descent); -} - -u_int -font_height(struct screen_ctx *sc) -{ - return (sc->xftfont->height + 1); -} - void font_init(struct screen_ctx *sc, const char *name, const char **color) { @@ -82,11 +64,11 @@ font_init(struct screen_ctx *sc, const char *name, const char **color) } int -font_width(struct screen_ctx *sc, const char *text, int len) +font_width(XftFont *xftfont, const char *text, int len) { XGlyphInfo extents; - XftTextExtentsUtf8(X_Dpy, sc->xftfont, (const FcChar8*)text, + XftTextExtentsUtf8(X_Dpy, xftfont, (const FcChar8*)text, len, &extents); return (extents.xOff); |