lilypond-user
[Top][All Lists]
Advanced

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

Re: Strange effect of set-global-staff-size


From: David Sumbler
Subject: Re: Strange effect of set-global-staff-size
Date: Sat, 07 Jan 2017 15:07:05 +0000

%%%%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.19.48"

#(set-global-staff-size 20)
\book {
  \markup {
    \abs-fontsize #48
    \bold "Title 1"
  }
}

#(set-global-staff-size 16)
\book {
  \markup {
    \abs-fontsize #48
    \bold "Title 2"
  } 
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%

The above illustrates the problem I was/am having.  Simon was wrong in
thinking I wouldn't want to share my project, but he was right that I
was trying to save myself a few hours work finding exactly where the
problem was arising: I was hoping that perhaps somebody would recognise
an already well-known problem.  Vaughan has suggested a possible
solution, using \magnifyStaff (which is new to me), and I can now see
another possible work-around.

Compiling the above illustrates the problem well.  The markup in the
first file will always be printed correctly, regardless of the value
given to set-global-staff-size.  The vertical height of the markup in
the second file will also be correct, but the spacing is compressed or
expanded addording to the ratio A/B, where A and B are the set-global-
staff size values of the first and second files respectively.

In my original files the value for the first file is not specifically
set.  But as one would expect, this gives the same result as the above
file, since the default value is 20.

The Notation Reference says:
%%%
To set the staff size globally for all scores in a file (or in a \book
block, to be precise), use set-global-staff-size:
#(set-global-staff-size 14)
The above example sets the global default staff size to 14pt (4.92mm)
and scales all fonts accordingly.
%%%

The implication is that you can have different values for different
books generated by the same file, but in practice one parameter is not
handled as the rest are.  The spacing of a font using abs-fontsize is
not affected at all by the first value of set-global-staff-size, but
subsequent values cause it to be scaled from its natural value.

My mistake seems to be using abs-fontsize.  It only occurred to me
after I had reduced my files to the above minimal example, that I don't
have the same problem with the titles etc. on the first page of actual
music.  Why not?  I think that I must have run up against this same
problem in my very early days of using Lilypond, and probably for that
reason I created 2 variables, myBookTitleMarkupSixteen
and myBookTitleMarkupTwenty, which use \fontsize to give roughly
similar results on the opening page of music in both score and parts.
 I can do something similar for the main title page, I suppose.  But
should it really be necessary to have 2 different specifications in
order to get a consistent output?

This behaviour of set-global-staff-size must surely be regarded as a
bug.  As I pointed out, the printing on the first file's title page
will always be correct whatever the value of set-global-staff-size, but
subsequent ones will have horizontal spacing which depends partly on
the original setting, even though everything else depends only on the
most recent setting.  That surely can't be intentional.

David



reply via email to

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