+#if HAVE_PANGO_FT2
+
+Pango_font *
+All_font_metrics::find_pango_font (PangoFontDescription *description,
+ Real magnification,
+ Real output_scale)
+{
+ pango_font_description_set_size (description,
+ gint (magnification *
+ pango_font_description_get_size (description)));
+
+ gchar *fn = pango_font_description_to_filename (description);
+ SCM key = ly_symbol2scm (fn);
+
+ SCM val;
+ if (!pango_dict_->try_retrieve (key, &val))
+ {
+ if (be_verbose_global)
+ progress_indication ("[" + String (fn));
+ Pango_font *pf = new Pango_font (pango_ft2_fontmap_,
+ RIGHT,
+ description,
+ output_scale);
+ val = pf->self_scm ();
+ pango_dict_->set (key, val);
+ scm_gc_unprotect_object (val);
+
+ if (be_verbose_global)
+ progress_indication ("]");
+
+ pf->description_ = scm_cons (SCM_BOOL_F,
+ scm_make_real (1.0));
+ }
+ g_free (fn);
+ return dynamic_cast<Pango_font *> (unsmob_metrics (val));
+}
+
+#endif
+
+String
+kpathsea_find_file (String name, String ext)
+{
+ name += "." + ext;
+ String path = global_path.find (name);
+ if (path.length () > 0)
+ return path;
+
+ SCM kpath = ly_lily_module_constant ("ly:kpathsea-find-file");
+ if (ly_c_procedure_p (kpath))
+ {
+ SCM kp_result = scm_call_1 (kpath, scm_makfrom0str (name.to_str0 ()));
+ if (scm_is_string (kp_result))
+ return ly_scm2string (kp_result);
+ }
+
+ return "";
+}
+