+ attr->start_index = start_index;
+ pango_attr_list_insert (list, attr);
+}
+
+static int
+xr_layout_cell_text (struct xr_driver *xr,
+ const struct cell_contents *contents,
+ const struct cell_style *style,
+ int bb[TABLE_N_AXES][2], int clip[TABLE_N_AXES][2],
+ int *widthp, int *brk)
+{
+ unsigned int options = contents->options;
+ size_t length;
+ int w, h;
+
+ struct xr_font *font = (options & TAB_FIX ? &xr->fonts[XR_FONT_FIXED]
+ : options & TAB_EMPH ? &xr->fonts[XR_FONT_EMPHASIS]
+ : &xr->fonts[XR_FONT_PROPORTIONAL]);
+ struct xr_font local_font;
+ if (style->font)
+ {
+ PangoFontDescription *desc = parse_font (
+ style->font,
+ style->font_size ? style->font_size * 1000 * 72 / 128 : 10000,
+ style->bold, style->italic);
+ if (desc)
+ {
+ PangoLayout *layout = pango_cairo_create_layout (xr->cairo);
+ pango_layout_set_font_description (layout, desc);
+
+ local_font.desc = desc;
+ local_font.layout = layout;
+ font = &local_font;
+ }
+ }
+
+ int footnote_adjustment;
+ if (contents->n_footnotes == 0)
+ footnote_adjustment = 0;
+ else if (contents->n_footnotes == 1 && (options & TAB_HALIGN) == TAB_RIGHT)
+ {
+ PangoAttrList *attrs;
+
+ const char *marker = contents->footnotes[0]->marker;
+ pango_layout_set_text (font->layout, marker, strlen (marker));
+
+ attrs = pango_attr_list_new ();
+ pango_attr_list_insert (attrs, pango_attr_rise_new (7000));
+ pango_layout_set_attributes (font->layout, attrs);
+ pango_attr_list_unref (attrs);