+ const GtkStyle *style = gtk_widget_get_style (GTK_WIDGET (viewer));
+
+ struct text_item *text_item;
+ PangoFontDescription *font_desc;
+ char *font_name;
+ int font_width;
+
+ gchar *fgc =
+ gdk_color_to_string (&style->text[gtk_widget_get_state (GTK_WIDGET (widget))]);
+
+ string_map_replace (&viewer->render_opts, "foreground-color", fgc);
+
+ free (fgc);
+
+ /* Use GTK+ default font as proportional font. */
+ font_name = pango_font_description_to_string (style->font_desc);
+ string_map_replace (&viewer->render_opts, "prop-font", font_name);
+ g_free (font_name);
+
+ /* Derived emphasized font from proportional font. */
+ font_desc = pango_font_description_copy (style->font_desc);
+ pango_font_description_set_style (font_desc, PANGO_STYLE_ITALIC);
+ font_name = pango_font_description_to_string (font_desc);
+ string_map_replace (&viewer->render_opts, "emph-font", font_name);
+ g_free (font_name);
+ pango_font_description_free (font_desc);
+
+ xr_rendering_apply_options (r, &viewer->render_opts);
+