urgent: layout of first page

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

urgent: layout of first page

Werner LEMBERG

Currently, the title block of a score is still handled as a separate
system instead of being attached to the topmost stave.  I consider
this as a severe design error; for example, it makes
`ragged-bottom=##f' produce very ugly results in case the systems are
vertically large.

Well, we have to live with it.  Independently of this, I think it is
another error that `head-separation' and `page-top-space' are applied
on the first page if a title is present.

To circumvent this I would like to say

  page-top-space =
    #(if (not-first-page)
          (* 12 mm)
        0)

within the \header block, however, it doesn't work.  Can someone
please help me quickly by providing an equivalent to the
`not-first-page' function which works in the \header block?


    Werner


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: urgent: layout of first page

Mats Bengtsson-4
If you look in ly/titling-init.ly, you will find lines like
  \on-the-fly #not-first-page \fromproperty #'header:instrument
I'm not sure that it helps directly, but you can probably check the
definition of #not-first-page.

   /Mats

Werner LEMBERG wrote:

> Currently, the title block of a score is still handled as a separate
> system instead of being attached to the topmost stave.  I consider
> this as a severe design error; for example, it makes
> `ragged-bottom=##f' produce very ugly results in case the systems are
> vertically large.
>
> Well, we have to live with it.  Independently of this, I think it is
> another error that `head-separation' and `page-top-space' are applied
> on the first page if a title is present.
>
> To circumvent this I would like to say
>
>   page-top-space =
>     #(if (not-first-page)
>           (* 12 mm)
>         0)
>
> within the \header block, however, it doesn't work.  Can someone
> please help me quickly by providing an equivalent to the
> `not-first-page' function which works in the \header block?
>
>
>     Werner
>
>
> _______________________________________________
> lilypond-devel mailing list
> [hidden email]
> http://lists.gnu.org/mailman/listinfo/lilypond-devel
>  

--
=============================================
        Mats Bengtsson
        Signal Processing
        Signals, Sensors and Systems
        Royal Institute of Technology
        SE-100 44  STOCKHOLM
        Sweden
        Phone: (+46) 8 790 8463
        Fax:   (+46) 8 790 7260
        Email: [hidden email]
        WWW: http://www.s3.kth.se/~mabe
=============================================



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: urgent: layout of first page

Werner LEMBERG

I wrote:

  To circumvent this I would like to say

    page-top-space =
     #(if (not-first-page)
            (* 12 mm)
          0)
  within the \header block, however, it doesn't work.

I mean the \page block, of course.

> If you look in ly/titling-init.ly, you will find lines like
>   \on-the-fly #not-first-page \fromproperty #'header:instrument
> I'm not sure that it helps directly, but you can probably check the
> definition of #not-first-page.

Thanks, this was the first I tried.  However, the function
`not-first-page' asks for a `props' argument, and I wasn't able to
extract this properly or to write similar code which accesses the
current page number.

Ideally, the functions `not-first-page' and friends should work
unconditionally in the \page block, not only in variables which are
markup strings (scoreTitleMarkup, bookTitleMarkup, etc.)


    Werner


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: urgent: layout of first page

Nicolas Sceaux
In reply to this post by Werner LEMBERG
Werner LEMBERG <[hidden email]> writes:

> Independently of this, I think it is another error that
> `head-separation' and `page-top-space' are applied on the first page
> if a title is present.
>
> To circumvent this I would like to say
>
>   page-top-space =
>     #(if (not-first-page)
>           (* 12 mm)
>         0)
>
> within the \header block, however, it doesn't work.  Can someone
> please help me quickly by providing an equivalent to the
> `not-first-page' function which works in the \header block?

You'd rather have to modify the function that computes the first system
position on page: `first-line-position' in the file
scm/layout-page-layout.scm

;; not tested
(define (first-line-position line layout)
  "Position of the first line on page"
  (max (+ (if (ly:prob-property? line 'is-title)
              0.0 ; do not use page-top-space when the 1st line is a title
              (ly:output-def-lookup layout 'page-top-space))
          (interval-end (paper-system-staff-extents line)))
       (interval-end (paper-system-extent line Y))))

nicolas


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: urgent: layout of first page

Werner LEMBERG

> You'd rather have to modify the function that computes the first
> system position on page: `first-line-position' in the file
> scm/layout-page-layout.scm

Thanks, I came to the same conclusion (but without doing any
programming).

> (define (first-line-position line layout)
>   "Position of the first line on page"
>   (max (+ (if (ly:prob-property? line 'is-title)
>               0.0 ; do not use page-top-space when the 1st line is a title
>               (ly:output-def-lookup layout 'page-top-space))
>  (interval-end (paper-system-staff-extents line)))
>        (interval-end (paper-system-extent line Y))))

This works fine, thanks!  I suggest to add it to the CVS.


    Werner


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: urgent: layout of first page

Werner LEMBERG
In reply to this post by Nicolas Sceaux

> > Independently of this, I think it is another error that
> > `head-separation' and `page-top-space' are applied on the first page
> > if a title is present.
>
> You'd rather have to modify the function that computes the first system
> position on page: `first-line-position' in the file
> scm/layout-page-layout.scm
>
> ;; not tested
> (define (first-line-position line layout)
>   "Position of the first line on page"
>   (max (+ (if (ly:prob-property? line 'is-title)
>               0.0 ; do not use page-top-space when the 1st line is a title
>               (ly:output-def-lookup layout 'page-top-space))
>  (interval-end (paper-system-staff-extents line)))
>        (interval-end (paper-system-extent line Y))))

Han-Wen, shall I apply this to the git repository?

Regarding head-separation I wonder whether the current approach of
lilypond to handle headers and footers is the right one.  Wouldn't it
be better to define a zone of a given height within the header (or
footer) is rendered, instead of defining a distance from the header to
the score?

  current with header:                current without header:

        header line                              ^
             ^                                   |
             |                                   | head-separation
             | head-separation                   |
             |                                   v
             v                                 score
           score

  suggested with header:              suggested without header:

     ^  header line                      ^
     |                                   |
     |                                   |
     |                                   |
     |                                   |
     v                                   v
  score                                score


Currently, if a header line is missing, the whole text jumps up.


    Werner


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: urgent: layout of first page

Han-Wen Nienhuys-2
Werner LEMBERG escreveu:

>> ;; not tested
>> (define (first-line-position line layout)
>>   "Position of the first line on page"
>>   (max (+ (if (ly:prob-property? line 'is-title)
>>               0.0 ; do not use page-top-space when the 1st line is a title
>>               (ly:output-def-lookup layout 'page-top-space))
>>  (interval-end (paper-system-staff-extents line)))
>>        (interval-end (paper-system-extent line Y))))
>
> Han-Wen, shall I apply this to the git repository?

yes, looks good.

> Regarding head-separation I wonder whether the current approach of
> lilypond to handle headers and footers is the right one.  Wouldn't it
> be better to define a zone of a given height within the header (or
> footer) is rendered, instead of defining a distance from the header to
> the score?

> Currently, if a header line is missing, the whole text jumps up.

Perhaps we can take the maximum of both distances, and set the
without-header-distance to 0 for compatibility.

--

Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen

LilyPond Software Design
 -- Code for Music Notation
http://www.lilypond-design.com



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: urgent: layout of first page

Werner LEMBERG

> > Han-Wen, shall I apply this to the git repository?
>
> yes, looks good.

Done.

> > Regarding head-separation I wonder whether the current approach of
> > lilypond to handle headers and footers is the right one.  Wouldn't
> > it be better to define a zone of a given height within the header
> > (or footer) is rendered, instead of defining a distance from the
> > header to the score?
>
> > Currently, if a header line is missing, the whole text jumps up.
>
> Perhaps we can take the maximum of both distances,

Which distances?


    Werner


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: urgent: layout of first page

Han-Wen Nienhuys-2
Werner LEMBERG escreveu:
>>> Regarding head-separation I wonder whether the current approach of
>>> lilypond to handle headers and footers is the right one.  Wouldn't
>>> it be better to define a zone of a given height within the header
>>> (or footer) is rendered, instead of defining a distance from the
>>> header to the score?
>>> Currently, if a header line is missing, the whole text jumps up.
>> Perhaps we can take the maximum of both distances,
>
> Which distances?

We could have a header separation measuring distance from the header,
and another separation from the top of the page. The effective
distance would be the lowest of both.

--

Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen

LilyPond Software Design
 -- Code for Music Notation
http://www.lilypond-design.com



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: urgent: layout of first page

Werner LEMBERG
> >>> Regarding head-separation I wonder whether the current approach
> >>> of lilypond to handle headers and footers is the right one.
> >>> Wouldn't it be better to define a zone of a given height within
> >>> the header (or footer) is rendered, instead of defining a
> >>> distance from the header to the score?
> >>
> >>> Currently, if a header line is missing, the whole text jumps up.
> >>
> >> Perhaps we can take the maximum of both distances,
> >
> > Which distances?
>
> We could have a header separation measuring distance from the
> header,

distance B

> and another separation from the top of the page.

distance A

> The effective distance would be the lowest of both.

Isn't this the same what I propose?


             ------------                 ------------
    ^          header            ^   ^     no header
    |        ------------        |   |    ------------
   A|   ^                       A|  B|
    |  B|                        |   |
    v   v                        v   v
             ------------                 ------------

BTW, the change to `first-line-position' is a quite severe
modification to the layout of the first page.  Shouldn't this be
mentioned somewhere?  I can imagine that we add a CHANGES file which
reports `minor' user-visible changes (but all of them which are not
mentioned in the NEWS file).


    Werner


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: urgent: layout of first page

Han-Wen Nienhuys-2
Werner LEMBERG escreveu:
>> The effective distance would be the lowest of both.
>
> Isn't this the same what I propose?

I thought you were proposing to scrap B altogether.

>
>
>              ------------                 ------------
>     ^          header            ^   ^     no header
>     |        ------------        |   |    ------------
>    A|   ^                       A|  B|
>     |  B|                        |   |
>     v   v                        v   v
>              ------------                 ------------


> BTW, the change to `first-line-position' is a quite severe
> modification to the layout of the first page.  Shouldn't this be
> mentioned somewhere?  I can imagine that we add a CHANGES file which
> reports `minor' user-visible changes (but all of them which are not
> mentioned in the NEWS file).

I doubt whether anyone will bother to look at yet another piece of
documentation.  Maybe a section in the manual would be more
appropriate.

--

Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen

LilyPond Software Design
 -- Code for Music Notation
http://www.lilypond-design.com



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: urgent: layout of first page

Werner LEMBERG

> > Isn't this the same what I propose?
>
> I thought you were proposing to scrap B altogether.

Well, I have proposed this

    ^   ^    ------------
    |  B|       header
    |   v    ------------
   A|
    |
    v
             ------------

which can be directly transformed into your proposal.


    Werner


_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel
Reply | Threaded
Open this post in threaded view
|

Re: urgent: layout of first page

Han-Wen Nienhuys-2
Werner LEMBERG escreveu:

>>> Isn't this the same what I propose?
>> I thought you were proposing to scrap B altogether.
>
> Well, I have proposed this
>
>     ^   ^    ------------
>     |  B|       header
>     |   v    ------------
>    A|
>     |
>     v
>              ------------
>
> which can be directly transformed into your proposal.

sounds good, go ahead

--

Han-Wen Nienhuys - [hidden email] - http://www.xs4all.nl/~hanwen

LilyPond Software Design
 -- Code for Music Notation
http://www.lilypond-design.com



_______________________________________________
lilypond-devel mailing list
[hidden email]
http://lists.gnu.org/mailman/listinfo/lilypond-devel