From 4cdb295f6624000f0c5a2b7aaa5570a081661d94 Mon Sep 17 00:00:00 2001 From: Joe Neeman Date: Mon, 12 Nov 2007 09:36:01 +1100 Subject: [PATCH] Fix 499. Replace all whitespace characters with spaces in text markup. --- lily/text-interface.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 (); } -- 2.39.5