- l = strlen(text->str); /* number of bytes */
-
-#else
- pango_layout_set_text(pl, text->str, -1);
- pango_layout_set_font_description(pl, t->font->pango_font_description);
- pango_layout_set_single_paragraph_mode(pl, TRUE);
- pango_layout_set_width(pl, w * PANGO_SCALE);
- pango_layout_set_ellipsize(pl, PANGO_ELLIPSIZE_MIDDLE);
- pango_layout_set_alignment(pl, (PangoAlignment)(t->justify));
- pango_layout_get_pixel_extents(pl, NULL, &rect);
- y = area->y +
- (area->height - rect.height) / 2;
-
-#endif /* USE_PANGO */
-
- if (t->font->shadow) {
- if (t->font->tint >= 0) {
- c.color.red = 0;
- c.color.green = 0;
- c.color.blue = 0;
- c.color.alpha = 0xffff * t->font->tint / 100;
- c.pixel = BlackPixel(RrDisplay(t->font->inst),
- RrScreen(t->font->inst));
- } else {
- c.color.red = 0xffff;
- c.color.green = 0xffff;
- c.color.blue = 0xffff;
- c.color.alpha = 0xffff * -t->font->tint / 100;
- c.pixel = WhitePixel(RrDisplay(t->font->inst),
- RrScreen(t->font->inst));
- }
-#ifndef USE_PANGO
- XftDrawStringUtf8(d, &c, t->font->xftfont, x + t->font->offset,
- t->font->xftfont->ascent + y + t->font->offset,
- (FcChar8*)text->str, l);
-#else /* USE_PANGO */
- pango_xft_render_layout(d, &c, pl, (x + t->font->offset) * PANGO_SCALE,
- (y + t->font->offset) * PANGO_SCALE);
-#endif /* USE_PANGO */
+ t->font->shortcut_underline->start_index = 0;
+ t->font->shortcut_underline->end_index = 0;
+ /* the attributes are owned by the layout.
+ re-add the attributes to the layout after changing the
+ start and end index */
+ attrlist = pango_layout_get_attributes(t->font->layout);
+ pango_attr_list_ref(attrlist);
+ pango_layout_set_attributes(t->font->layout, attrlist);
+ pango_attr_list_unref(attrlist);
+
+ if (t->shadow_offset_x || t->shadow_offset_y) {
+ c.color.red = t->shadow_color->r | t->shadow_color->r << 8;
+ c.color.green = t->shadow_color->g | t->shadow_color->g << 8;
+ c.color.blue = t->shadow_color->b | t->shadow_color->b << 8;
+ c.color.alpha = 0xffff * t->shadow_alpha / 255;
+ c.pixel = t->shadow_color->pixel;
+
+ /* see below... */
+ pango_xft_render_layout_line
+ (d, &c, pango_layout_get_line(t->font->layout, 0),
+ (x + t->shadow_offset_x) * PANGO_SCALE,
+ (y + t->shadow_offset_y) * PANGO_SCALE);