+ dest.add_stencil (item_stencil);
+ }
+ }
+
+ string name = get_output_backend_name ();
+ string output_mod = "scm output-" + name;
+ SCM mod = scm_c_resolve_module (output_mod.c_str ());
+
+ bool has_utf8_string = false;
+
+ if (ly_is_module (mod))
+ {
+ SCM utf8_string = ly_module_lookup (mod, ly_symbol2scm ("utf-8-string"));
+ /*
+ has_utf8_string should only be true when utf8_string is a
+ variable that is bound to a *named* procedure, i.e. not a
+ lambda expression.
+ */
+ if (utf8_string != SCM_BOOL_F
+ && scm_procedure_name (SCM_VARIABLE_REF (utf8_string)) != SCM_BOOL_F)
+ has_utf8_string = true;
+ }
+
+ bool to_paths = music_strings_to_paths;
+
+ /*
+ Backends with the utf-8-string expression use it when
+ 1) the -dmusic-strings-to-paths option is set
+ and `str' is not a music string, or
+ 2) the -dmusic-strings-to-paths option is not set.
+ */
+ if (has_utf8_string && ((to_paths && !music_string) || !to_paths))
+ {
+ // For Pango based backends, we take a shortcut.
+ SCM exp = scm_list_3 (ly_symbol2scm ("utf-8-string"),
+ ly_string2scm (description_string ()),
+ ly_string2scm (str));
+
+ Box b (Interval (0, 0), Interval (0, 0));
+ b.unite (dest.extent_box ());
+ return Stencil (b, exp);
+ }
+
+ return dest;
+}
+
+string
+Pango_font::description_string () const
+{
+ char *descr_string = pango_font_description_to_string (pango_description_);
+ string s (descr_string);
+ g_free (descr_string);
+ return s;
+}
+
+SCM
+Pango_font::font_file_name () const
+{
+ return SCM_BOOL_F;
+}
+
+#endif // HAVE_PANGO_FT2