]> Dogcows Code - chaz/openbox/blobdiff - render/font.c
half way through the changes to new menu code/design. hot shit. static menus work...
[chaz/openbox] / render / font.c
index 2fce1dd44a15afb21a09e5a05b60c3f032ee70b9..94d9fa2db47e48f2805cf29c41d021b247f782f3 100644 (file)
@@ -2,13 +2,12 @@
 #include "color.h"
 #include "mask.h"
 #include "theme.h"
-#include "kernel/geom.h"
-#include "kernel/gettext.h"
-#define _(str) gettext(str)
+#include "gettext.h"
 
 #include <X11/Xft/Xft.h>
 #include <glib.h>
 #include <string.h>
+#include <stdlib.h>
 
 #define ELIPSES "..."
 #define ELIPSES_LENGTH(font) \
@@ -57,7 +56,6 @@ static RrFont *openfont(const RrInstance *inst, char *fontstring)
         return NULL;
 
     match = XftFontMatch(RrDisplay(inst), RrScreen(inst), pat, &res);
-    FcPatternDestroy(pat);
     if (!match)
         return NULL;
 
@@ -66,7 +64,6 @@ static RrFont *openfont(const RrInstance *inst, char *fontstring)
 
     if (FcPatternGetBool(match, OB_SHADOW, 0, &out->shadow) != FcResultMatch)
         out->shadow = FALSE;
-    g_message("shadow %d", out->shadow);
 
     if (FcPatternGetInteger(match, OB_SHADOW_OFFSET, 0, &out->offset) !=
         FcResultMatch)
@@ -79,8 +76,8 @@ static RrFont *openfont(const RrInstance *inst, char *fontstring)
     out->tint = tint;
 
     font = XftFontOpenPattern(RrDisplay(inst), match);
-    FcPatternDestroy(match);
     if (!font) {
+        FcPatternDestroy(match);
         g_free(out);
         return NULL;
     } else
@@ -136,7 +133,7 @@ int RrFontMeasureString(const RrFont *f, const gchar *str)
 {
     gint x, y;
     font_measure_full (f, str, &x, &y);
-    return x;
+    return x + 4;
 }
 
 int RrFontHeight(const RrFont *f)
@@ -150,7 +147,7 @@ int RrFontMaxCharWidth(const RrFont *f)
     return (signed) f->xftfont->max_advance_width;
 }
 
-void RrFontDraw(XftDraw *d, RrTextureText *t, Rect *area)
+void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area)
 {
     gint x,y,w,h;
     XftColor c;
This page took 0.023275 seconds and 4 git commands to generate.