no need for font_{ascent,descent,height} wrappers; limit font_width to
just requiring xftfont.
This commit is contained in:
22
font.c
22
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);
|
||||
|
||||
Reference in New Issue
Block a user