aboutsummaryrefslogtreecommitdiffstats
path: root/font.c
diff options
context:
space:
mode:
Diffstat (limited to 'font.c')
-rw-r--r--font.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/font.c b/font.c
index 75d5686..a8b962f 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.22 2012/12/17 02:53:29 okan Exp $
+ * $OpenBSD: font.c,v 1.23 2012/12/17 14:20:52 okan Exp $
*/
#include <sys/param.h>
@@ -33,19 +33,19 @@
int
font_ascent(struct screen_ctx *sc)
{
- return (sc->font->ascent);
+ return (sc->xftfont->ascent);
}
int
font_descent(struct screen_ctx *sc)
{
- return (sc->font->descent);
+ return (sc->xftfont->descent);
}
u_int
font_height(struct screen_ctx *sc)
{
- return (sc->font->height + 1);
+ return (sc->xftfont->height + 1);
}
void
@@ -59,8 +59,8 @@ font_init(struct screen_ctx *sc, const char *name, const char **color)
if (sc->xftdraw == NULL)
errx(1, "XftDrawCreate");
- sc->font = XftFontOpenName(X_Dpy, sc->which, name);
- if (sc->font == NULL)
+ sc->xftfont = XftFontOpenName(X_Dpy, sc->which, name);
+ if (sc->xftfont == NULL)
errx(1, "XftFontOpenName");
for (i = 0; i < CWM_COLOR_MENU_MAX; i++) {
@@ -88,7 +88,7 @@ font_width(struct screen_ctx *sc, const char *text, int len)
{
XGlyphInfo extents;
- XftTextExtentsUtf8(X_Dpy, sc->font, (const FcChar8*)text,
+ XftTextExtentsUtf8(X_Dpy, sc->xftfont, (const FcChar8*)text,
len, &extents);
return (extents.xOff);
@@ -102,6 +102,6 @@ font_draw(struct screen_ctx *sc, const char *text, int len,
color = active ? CWM_COLOR_MENU_FONT_SEL : CWM_COLOR_MENU_FONT;
XftDrawChange(sc->xftdraw, d);
- XftDrawStringUtf8(sc->xftdraw, &sc->xftcolor[color], sc->font, x, y,
+ XftDrawStringUtf8(sc->xftdraw, &sc->xftcolor[color], sc->xftfont, x, y,
(const FcChar8*)text, len);
}