]> Dogcows Code - chaz/openbox/blobdiff - render/font.c
libobrender needs to link to libobparser
[chaz/openbox] / render / font.c
index d562353975184f1cefb4b8714b77a0f682ab7382..f46bb660cdb2b7aded0da3be6c9589dda71598dc 100644 (file)
@@ -28,6 +28,9 @@
 #include <glib.h>
 #include <string.h>
 #include <stdlib.h>
+#if USE_PANGO && !ENABLE_NLS
+#include <locale.h>
+#endif
 
 #define ELIPSES "..."
 #define ELIPSES_LENGTH(font) \
@@ -43,7 +46,9 @@ FcObjectType objs[] = {
     { OB_SHADOW_ALPHA,  FcTypeInteger  }
 };
 
+#ifdef USE_PANGO
 static PangoContext *context;
+#endif
 static gboolean started = FALSE;
 
 static void font_startup(void)
@@ -99,9 +104,6 @@ static RrFont *openfont(const RrInstance *inst, gchar *fontstring)
     out = g_new(RrFont, 1);
     out->inst = inst;
 #ifdef USE_PANGO
-    /*    printf("\n\n%s\n\n",fontstring);
-          FcPatternPrint(match); */
-
     out->pango_font_description = pango_font_description_new();
 
     if (FcPatternGetString(match, "family", 0, &tmp_string) !=
@@ -140,7 +142,6 @@ static RrFont *openfont(const RrInstance *inst, gchar *fontstring)
         *p = '\0';
     if ((p = strchr(locale, '@')))
         *p = '\0';
-    printf("%s\n", locale);
     PangoFontMetrics *metrics = 
         pango_context_get_metrics(context, out->pango_font_description,
                                   ln = pango_language_from_string(locale));
@@ -405,11 +406,10 @@ void RrFontDraw(XftDraw *d, RrTextureText *t, RrRect *area)
                       t->font->xftfont->ascent + y,
                       (FcChar8*)text->str, l);
 #else /* USE_PANGO */
-    /* This looks retarded, but layout_line() bases y on the baseline, while
-     * layout() bases y on the top of the ink layout shit ass fucking crap.
-     * We want the baseline to always be in the same place, thusly, we use
-     * layout_line()
-     * The actual line doesn't need to be freed */
+    /* layout_line() bases y on the baseline, while layout() bases y on the
+     * top of the ink layout. We want the baseline to always be in the same
+     * place, thusly, we use layout_line()
+     * The actual line doesn't need to be freed (per the pango docs) */
     pango_xft_render_layout_line(d, &c, pango_layout_get_line(pl, 0),
                                  x * PANGO_SCALE, y * PANGO_SCALE);
     g_object_unref(pl);
This page took 0.023391 seconds and 4 git commands to generate.