- SCM exp
- = scm_list_3 (ly_symbol2scm ("utf-8-string"),
- scm_makfrom0str (description_string ().c_str ()),
- scm_makfrom0str (str.c_str ()));
+ 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));