- l = strlen(text->str); /* number of bytes */
-
- if (t->shadow) {
- if (t->tint >= 0) {
- c.color.red = 0;
- c.color.green = 0;
- c.color.blue = 0;
- c.color.alpha = 0xffff * t->tint / 100; /* transparent shadow */
- c.pixel = BlackPixel(RrDisplay(t->font->inst),
- RrScreen(t->font->inst));
- } else {
- c.color.red = 0xffff * -t->tint / 100;
- c.color.green = 0xffff * -t->tint / 100;
- c.color.blue = 0xffff * -t->tint / 100;
- c.color.alpha = 0xffff * -t->tint / 100; /* transparent shadow */
- c.pixel = WhitePixel(RrDisplay(t->font->inst),
- RrScreen(t->font->inst));
- }
- XftDrawStringUtf8(d, &c, t->font->xftfont, x + t->offset,
- t->font->xftfont->ascent + y + t->offset,
- (FcChar8*)text->str, l);
- }
+ 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);
+ }
+