-#ifndef USE_PANGO
- XftDrawStringUtf8(d, &c, t->font->xftfont, x,
- t->font->xftfont->ascent + y,
- (FcChar8*)text->str, l);
-#else /* USE_PANGO */
- for (p = pll->runs; p != NULL; p = p->next)
- {
- PangoLayoutRun *run = p->data;
- PangoFont *font = run->item->analysis.font;
- PangoGlyphString *glyphs = run->glyphs;
- PangoRectangle rect;
-
- pango_glyph_string_extents (glyphs, font, NULL, &rect);
- pango_xft_render (d, &c, font, glyphs, x, t->font->xftfont->ascent + y);
- x += rect.width / PANGO_SCALE;
- }
-
- // pango_layout_line_unref(pll);
- g_object_unref(pl);
- g_object_unref(context);
-#endif /* USE_PANGO */
-
- g_string_free(text, TRUE);
- return;
+ /* layout_line() uses y to specify the baseline
+ The line doesn't need to be freed, it's a part of the layout */
+ pango_xft_render_layout_line
+ (d, &c, pango_layout_get_line(t->font->layout, 0),
+ x * PANGO_SCALE, y * PANGO_SCALE);