From a0f62e37b272c6a5f0ea3189df531cb94de8ced6 Mon Sep 17 00:00:00 2001 From: okan Date: Thu, 2 May 2013 17:25:15 +0000 Subject: no need for font_{ascent,descent,height} wrappers; limit font_width to just requiring xftfont. --- font.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'font.c') diff --git a/font.c b/font.c index f2ed403..0b36161 100644 --- a/font.c +++ b/font.c @@ -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 @@ -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); -- cgit v1.2.3-2-gb3c3