X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=render%2Ffont.c;h=ee06caca861f9f6dee63917c31992787af5407e9;hb=1fb5c4b595677a029c75b75ef85a69ec90160da8;hp=d783d9d6000efafb9abc95f0b3f5db559e98cd0c;hpb=5755a7a5642ba3b84163a213d79ac021a09b060f;p=chaz%2Fopenbox diff --git a/render/font.c b/render/font.c index d783d9d6..ee06caca 100644 --- a/render/font.c +++ b/render/font.c @@ -6,6 +6,7 @@ #include #include +#include "../kernel/geom.h" void font_startup(void) { @@ -91,10 +92,16 @@ int font_max_char_width(ObFont *f) return (signed) f->xftfont->max_advance_width; } -void font_draw(XftDraw *d, TextureText *t, int x, int y, int w, int h) +void font_draw(XftDraw *d, TextureText *t, Rect *position) { + int x,y,w,h; XftColor c; + x = position->x; + y = position->y; + w = position->width; + h = position->height; + /* accomidate for areas bigger/smaller than Xft thinks the font is tall */ y -= (2 * (t->font->xftfont->ascent + t->font->xftfont->descent) - (t->font->height + h) - 1) / 2;