diff options
author | okan | 2013-05-02 17:25:15 +0000 |
---|---|---|
committer | okan | 2013-05-02 17:25:15 +0000 |
commit | a0f62e37b272c6a5f0ea3189df531cb94de8ced6 (patch) | |
tree | ae467220b5cd0656160ea736872adda586b1788d /font.c | |
parent | 363edbca19eb979d12939a5fb8502e682498e39b (diff) | |
download | cwm-a0f62e37b272c6a5f0ea3189df531cb94de8ced6.tar.gz |
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 | 24 |
1 files changed, 3 insertions, 21 deletions
@@ -15,7 +15,7 @@ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * - * $OpenBSD: font.c,v 1.24 2012/12/17 18:34:06 okan Exp $ + * $OpenBSD: font.c,v 1.25 2013/05/02 17:25:15 okan Exp $ */ #include <sys/param.h> @@ -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); |