]> git.donarmstrong.com Git - lilypond.git/blobdiff - lily/text-interface.cc
Oops - did not see the following changes during the previous merge.
[lilypond.git] / lily / text-interface.cc
index e8f5aefdf88c7659b5cdf32741f1934904b9823a..96444e10ab6537319b2471009988fe0eb57998a4 100644 (file)
 #include "output-def.hh"
 #include "modified-font-metric.hh"
 
+static void
+replace_whitespace (string *str)
+{
+  for (vsize i = 0; i < str->size (); i++)
+    if (isspace ((*str)[i]))
+      (*str)[i] = ' ';
+}
+
 MAKE_SCHEME_CALLBACK (Text_interface, interpret_string, 3);
 SCM
 Text_interface::interpret_string (SCM layout_smob,
@@ -31,6 +39,8 @@ Text_interface::interpret_string (SCM layout_smob,
   string str = ly_scm2string (markup);
   Output_def *layout = unsmob_output_def (layout_smob);
   Font_metric *fm = select_encoded_font (layout, props);
+
+  replace_whitespace (&str);
   return fm->word_stencil (str).smobbed_copy ();
 }