From 2ed4e9b64d3c9338c621a85f3264315e59cf2176 Mon Sep 17 00:00:00 2001 From: Neil Puttock Date: Mon, 26 Jul 2010 22:28:22 +0100 Subject: [PATCH] Fix space in \hspace. Since \hspace creates an invisible stencil, any following markup is effectively spaced at a distance of (hspace-amount + word-space). * scm/define-markup-commands.scm (hspace): subtract word-space from amount --- scm/define-markup-commands.scm | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 1291d4f879..cc2d232754 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -477,6 +477,7 @@ Create a box of the same height as the space in the current font." (define-markup-command (hspace layout props amount) (number?) #:category align + #:properties ((word-space)) " @cindex creating horizontal spaces in text @@ -491,9 +492,10 @@ Create an invisible object taking up horizontal space @var{amount}. three } @end lilypond" - (if (> amount 0) - (ly:make-stencil "" (cons 0 amount) '(0 . 0)) - (ly:make-stencil "" (cons amount amount) '(0 . 0)))) + (let ((corrected-space (- amount word-space))) + (if (> corrected-space 0) + (ly:make-stencil "" (cons 0 corrected-space) '(0 . 0)) + (ly:make-stencil "" (cons corrected-space corrected-space) '(0 . 0))))) ;; todo: fix negative space (define-markup-command (vspace layout props amount) -- 2.11.4.GIT