Re: lilypond-user Digest, Vol 146, Issue 98

2015-01-19 Thread Werner LEMBERG

 I dare say there is a prettier and more concise way of doing this,
 but at least I now have something that works!

What about the following?


#(define-public (pt-to-ss size)
   Convert from points to staff space units.

   ;; The value `output-scale' gives the size (in mm) of the staff
   ;; space at the global staff size.  By definition, the staff space
   ;; for a staff size of 20pt is 20pt / 4 = 5pt.
   (let* ((5pt (ly:pt 5))
  (output-scale (ly:output-def-lookup $defaultpaper
  'output-scale 1))
  (factor (/ output-scale 5pt))
  (staff-space (* 5 factor)))
 (/ size staff-space)))

#(define-markup-command (abs-baseline-skip layout props size arg)
   (number? markup?)
   #:category font
   Use @var{size} as the absolute value for @code{baseline-skip} (in
points).

   (interpret-markup layout
 (cons `((baseline-skip . ,(pt-to-ss size)))
   props)
 arg))

\paper {
  line-width = 170.0\mm
  top-margin = 15.0\mm
  bottom-margin = 15.0\mm
  indent = 20.0\mm

  top-markup-spacing = #`((basic-distance . ,(pt-to-ss 30))
  (minimum-distance . ,(pt-to-ss 30))
  (padding . 0)
  (stretchability . 0))
  markup-markup-spacing = #'((basic-distance . ,(pt-to-ss 15))
 (minimum-distance . ,(pt-to-ss 15))
 (padding . 0)
 (stretchability . 0))
  ...

  bookTitleMarkup = \markup {
\abs-baseline-skip #20 {
  \column {
\fill-line {
  \abs-fontsize #18 \bold
  \fromproperty #'header:title
}
\fill-line {
  \abs-fontsize #11 \bold
  \fromproperty #'header:subtitle
}
\fill-line {
  \abs-fontsize #9 \bold
  \fromproperty #'header:subsubtitle
}
...
  }
}
  }
}


Werner

___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: lilypond-user Digest, Vol 146, Issue 98

2015-01-19 Thread David Sumbler

   From: Noeck [hidden email] 
  
   To: [hidden email] 
   Subject: Re: Printing titles at a consistent size 
   Date: Sun, 18 Jan 2015 23:57:09 +0100 
   
   Hi, 
   
   if I am not mistaken, there was some discussion and a solution how
  to get the 
   line space consistent for different settings of the staff space
  within the 
   discussion about a new Mutopia tagline. 
   
   Unfortunately, I can not find it anymore. But I think it involved
  having a zero 
   baseline-skip: 
   \override #'(baseline-skip . 0 ) 
   Perhaps, some keywords in this mail could help to find some more
  hints. 
   
   HTH, 
   Joram
  I have just tried this - I thought it sounded promising. 
  
  It didn't help, except that it seems to show what is happening: in
  the 
  parts (which have the larger global-staff-size), not only are the 
  characters in the titles spaced too far apart, but the lines of text
  are 
  also vertically further apart than in the score. 
  
  So it looks as if the second global-staff size setting is causing
  the 
  print to be spaced as if it were proportionally larger than in the
  score 
  (with the smaller global-staff-size), but the abs-fontsize specified
  in 
  my bookTitleMarkup is forcing the characters themselves to be
  printed at 
  the size I actually want.  I can see a sort of logic in this, but
  it 
  isn't useful! 
  
  David 
  
 Can you show us a picture/PDF or provide a small example of what you
 are currently trying? I have some ideas, but I want to make sure you
 aren't already doing them...
  
  
 Thanks,
 Abraham

I have tried so many different permutations of setting relative or
absolute font size, having one or two definitions for bookTitleMarkup,
placing things in different scopes etc. that I have lost track of what
didn't work - which was everything until an hour ago.  I have now found
something that does work, ungainly though it undoubtedly is.

What I now have, basically, is this:

\version 2.18.0

#(set-global-staff-size 16)

\book {
  %This is the score
  \paper
bookTitleMarkup = \myBookTitleMarkupSixteen
  }
  \score  { }
  \layout { }
}

#(set-global-staff-size 20)

\book {
  %This is the first of the instrumental parts
  \paper
bookTitleMarkup = \myBookTitleMarkupTwenty
  }
  \score  { }
  \layout { }
}

In the 2 different bookTitleMarkup definitions, I have used proportional
measurements, corresponding to the 5/4 ratio of the staff sizes in the
score/parts.  So I have (baseline-skip . 5) and (baseline-skip . 4)
respectively.  I specify the size of each item using \fontsize, with a
difference of 2 for each corresponding item in the score and part
definitions respectively  - e.g., where I have \fontsize #7 in the
definition for the score, I have \fontsize #5 in the definition used for
the parts (this difference of 2 corresponds to the statement made in the
Learning Manual section 4.3.2, where it says that 1 step is
approximately equivalent to 12%.)

The result is that the printed output is virtually identical in the
score and parts, despite the difference in staff size in the music that
follows.

I dare say there is a prettier and more concise way of doing this, but
at least I now have something that works!

David


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user