+Font_metric *
+find_pango_font (Output_def *layout, SCM descr, Real factor)
+{
+ if (layout->parent_)
+ return find_pango_font (layout->parent_, descr, factor);
+
+ SCM table = get_pango_font_table (layout);
+ SCM sizes = scm_hash_ref (table, descr, SCM_EOL);
+ SCM size_key = scm_from_double (factor);
+ SCM handle = scm_assoc (size_key, sizes);
+ if (scm_is_pair (handle))
+ return unsmob_metrics (scm_cdr (handle));
+
+ PangoFontDescription *description
+ = pango_font_description_from_string (scm_i_string_chars (descr));
+
+ pango_font_description_set_size (description,
+ gint (factor *
+ pango_font_description_get_size (description)));
+
+
+ Font_metric *fm = all_fonts_global->find_pango_font (description,
+ output_scale (layout));
+
+ pango_font_description_free (description);
+
+ sizes = scm_acons (size_key, fm->self_scm (), sizes);
+ scm_hash_set_x (table, descr, sizes);
+
+ return fm;
+}
+