]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-markup-commands.scm
Fix 442.
[lilypond.git] / scm / define-markup-commands.scm
index 8d4d749770d129975a80113fce9fee9c9d6b5454..cc2d232754370f4f00adf5ab7da2e3068f0d8378 100644 (file)
@@ -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)
@@ -518,8 +520,8 @@ of @var{amount} multiplied by 3.
 @end lilypond"
   (let ((amount (* amount 3.0)))
     (if (> amount 0)
-        (ly:make-stencil "" (cons -1 1) (cons 0 amount))
-        (ly:make-stencil "" (cons -1 1) (cons amount amount)))))
+        (ly:make-stencil "" (cons 0 0) (cons 0 amount))
+        (ly:make-stencil "" (cons 0 0) (cons amount amount)))))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;