remove textwidth_primitive

This commit is contained in:
Julien Danjou 2007-12-30 14:22:19 +01:00
parent e57f387df0
commit 9a5e745114
1 changed files with 5 additions and 10 deletions

15
draw.c
View File

@ -247,14 +247,17 @@ draw_rotate(DrawCtx *ctx, int screen, double angle, int tx, int ty)
return newdrawable;
}
static unsigned short
textwidth_primitive(XftFont *font, char *text)
unsigned short
textwidth(XftFont *font, char *text)
{
cairo_surface_t *surface;
cairo_t *cr;
cairo_font_face_t *font_face;
cairo_text_extents_t te;
if (!a_strlen(text))
return 0;
surface = cairo_xlib_surface_create(globalconf.display, DefaultScreen(globalconf.display),
DefaultVisual(globalconf.display, DefaultScreen(globalconf.display)),
DisplayWidth(globalconf.display, DefaultScreen(globalconf.display)),
@ -271,12 +274,4 @@ textwidth_primitive(XftFont *font, char *text)
return MAX(te.x_advance, te.width) + font->height;
}
unsigned short
textwidth(XftFont *font, char *text)
{
if (!a_strlen(text))
return 0;
return textwidth_primitive(font, text);
}
// vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80