From: Dana Jansens Date: Mon, 2 Jun 2003 02:10:50 +0000 (+0000) Subject: create some temporary fonts to use for rendering text X-Git-Tag: gl2~5 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=07fcb36e5dd9a9d2f837a3a12f4f31bd6dcce5ce;p=dana%2Fopenbox.git create some temporary fonts to use for rendering text --- diff --git a/openbox/menu_render.c b/openbox/menu_render.c index dcfcd557..6374c578 100644 --- a/openbox/menu_render.c +++ b/openbox/menu_render.c @@ -35,8 +35,10 @@ void menu_render_full(Menu *self) { /* set texture data and size them mofos out */ if (self->label) { struct RrColor c; + struct RrFont *font; RrColorSet(&c, 0, 0, 0, 1.0); - RrTextureSetText(self->s_title, 0, NULL, RR_CENTER, &c, + font = RrFontOpen(ob_render_inst, "arial-10:bold"); /* XXX mem leak! */ + RrTextureSetText(self->s_title, 0, font, RR_CENTER, &c, self->label); RrSurfaceMinSize(self->s_title, &self->title_min_w, &self->title_h); self->title_min_w += theme_bevel * 2; @@ -49,19 +51,21 @@ void menu_render_full(Menu *self) { for (it = self->entries; it; it = it->next) { MenuEntry *e = it->data; struct RrColor c; + struct RrFont *font; int h; RrColorSet(&c, 0, 0, 0, 1.0); - RrTextureSetText(e->s_item, 0, NULL, RR_LEFT, &c, e->label); + font = RrFontOpen(ob_render_inst, "arial-10:bold"); /* XXX mem leak! */ + RrTextureSetText(e->s_item, 0, font, RR_LEFT, &c, e->label); RrSurfaceMinSize(e->s_item, &e->min_w, &self->item_h); self->size.width = MAX(self->size.width, e->min_w); - RrTextureSetText(e->s_disabled, 0, NULL, RR_LEFT, &c, e->label); + RrTextureSetText(e->s_disabled, 0, font, RR_LEFT, &c, e->label); RrSurfaceMinSize(e->s_disabled, &e->min_w, &h); self->item_h = MAX(self->item_h, h); self->size.width = MAX(self->size.width, e->min_w); - RrTextureSetText(e->s_hilite, 0, NULL, RR_LEFT, &c, e->label); + RrTextureSetText(e->s_hilite, 0, font, RR_LEFT, &c, e->label); RrSurfaceMinSize(e->s_hilite, &e->min_w, &h); self->item_h = MAX(self->item_h, h); self->size.width = MAX(self->size.width, e->min_w); diff --git a/openbox/popup.c b/openbox/popup.c index 906cec17..870589a9 100644 --- a/openbox/popup.c +++ b/openbox/popup.c @@ -124,10 +124,12 @@ void popup_show(Popup *self, char *text, Icon *icon) int textw, texth; int iconw; struct RrColor c; + struct RrFont *font; /* set up the textures */ RrColorSet(&c, 0, 0, 0, 1.0); - RrTextureSetText(self->s_text, 0, NULL, RR_LEFT, &c, text); + font = RrFontOpen(ob_render_inst, "arial-10:bold"); /* XXX mem leak! */ + RrTextureSetText(self->s_text, 0, font, RR_LEFT, &c, text); /* measure the shit out */ RrSurfaceMinSize(self->s_text, &textw, &texth);