X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;ds=sidebyside;f=render%2Ffont.c;h=f46bb660cdb2b7aded0da3be6c9589dda71598dc;hb=b287b126ccebe8f65b90cba8191b720fdb901d49;hp=d562353975184f1cefb4b8714b77a0f682ab7382;hpb=b2cd881d3131d85622d9cc969dd387e5a6ca9133;p=chaz%2Fopenbox diff --git a/render/font.c b/render/font.c index d5623539..f46bb660 100644 --- a/render/font.c +++ b/render/font.c @@ -28,6 +28,9 @@ #include #include #include +#if USE_PANGO && !ENABLE_NLS +#include +#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);