[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: hspace in cm?
From: |
Robin Bannister |
Subject: |
Re: hspace in cm? |
Date: |
Mon, 27 Sep 2010 16:54:26 +0200 |
Xavier Scheuer wrote:
Robin (or somebody else), could you provide me a version of your
"put-mm" but using \hspace instead of \vspace ?
...
in order to make a _horizontal_ space with a value in millimeters
Well, I've had Lilypond on the back burner for a while, so I'm a bit rusty.
By swapping the X and Y of mm-feed you get horizontal millimeters:
#(define-markup-command (mm-hgap layout props amount) (number?)
(let ((o-s (ly:output-def-lookup layout 'output-scale)))
(ly:make-stencil "" (cons 0 (abs (/ amount o-s))) '(0 . 0) )))
\markup \line { "first" "next" "last" }
\markup \line { \mm-hgap #20 "first" \mm-hgap #20 "next" \mm-hgap #20 "last" }
Note that \line inserts a word-space between each markup, so you will get
{ 20mm word-space "first" word-space 20mm word-space "next" ... }
But you can squeeze these out by using \concat instead of \line.
There's probably no need for a horizontal put-mm (resp. put-Lmm and put-Rmm)
because with \concat you can combine a single \mm-hgap with whatever you want.
Cheers,
Robin