lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What are the units for \hspace?


From: Richard Shann
Subject: Re: What are the units for \hspace?
Date: Sat, 15 Apr 2017 14:48:40 +0100

On Sat, 2017-04-15 at 13:04 +0200, Thomas Morley wrote:
> 2017-04-15 10:35 GMT+02:00 Richard Shann <address@hidden>:
> > Is it documented anywhere what the units used in the markup command
> > \hspace are?
> 
> The general doc is at NR 5.4.3 Distances and measurements

ah, I see - the headings on the left only extend to the first two
levels, so

5.4 Useful concepts and properties

is where I needed to look. The overall heading here is

5. Changing defaults

which is not so accurate - the unit of measurement is relevant here even
if you are not trying alter a default. 
Finally I see

"Scaled distances are always specified in units of the staff-space"

so perhaps an improvement to the entry I found would be:

\hspace amount (number)
         Create an invisible object taking up horizontal space amount (scaled 
distance).

then perhaps I would have searched the index for scaled distance.


> 
> >
> > the documentation is:
> >
> > \hspace amount (number)
> >
> >         Create an invisible object taking up horizontal space amount.
> >
> >
> > The "amount" appears to be smaller than the width of the "m", but larger
> > than a staff-space...
> >
> > Richard
> 
> 
> It's exactly staff-space. See also the terminal-output of:

Thanks for this, I was having trouble estimating how much the vertical
space between staff lines would look like if it were horizontal. I
should have thought to try changing the staff-spacing to see if it
scaled.
This raises a new topic - people arranging e.g. verses in columns at the
end might want to specify a distance in mm, is there a way to do that?

Richard


> 
> #(define-markup-command (demo layout props) ()
> (let ((stil (interpret-markup layout props #{ \markup \hspace #1 #} )))
> (format #t
> "\n++++++++++++++++++++++++++++++++++++++\n
> staff-space is:                   ~a\n
> length of \\markup \\hspace \\#1 is: ~a
> \n++++++++++++++++++++++++++++++++++++++
> "
> (assoc-get 'staff-space (ly:module->alist (ly:output-def-scope layout)))
> (interval-length (ly:stencil-extent stil X)))
> 
>  stil))
> 
> 
> \markup \demo
> 
> 
> Cheers,
>   Harm





reply via email to

[Prev in Thread] Current Thread [Next in Thread]