From: Joe Neeman Date: Sun, 11 Nov 2007 22:36:01 +0000 (+1100) Subject: Fix 499. X-Git-Tag: release/2.11.35-1~41^2~9 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=4cdb295f6624000f0c5a2b7aaa5570a081661d94;p=lilypond.git Fix 499. Replace all whitespace characters with spaces in text markup. --- diff --git a/lily/text-interface.cc b/lily/text-interface.cc index e8f5aefdf8..96444e10ab 100644 --- a/lily/text-interface.cc +++ b/lily/text-interface.cc @@ -19,6 +19,14 @@ #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 (); }