Crash when music of score starts with \pageBreak

2021-09-11 Thread Richard Shann
I came across a situation where LilyPond crashes caused by a badly
placed \pageBreak. I've chopped most of the music out of the example
but when I tried to remove more the crash stopped.
The error message ends:

Finding the ideal number of pages...
Fitting music on 1 page...lilypond: 
/home/gub/NewGub/gub/target/linux-64/src/lilypond-git.sv.gnu.org--lilypond.git-stable-2.22/lily/page-breaking.cc:1073:
 void Page_breaking::line_divisions_rec(vsize, const Line_division&, const 
Line_division&, Page_breaking::Line_division*): Assertion `my_index == 0' 
failed.
Exited with return code 6.

8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><

\version "2.22.1"
MI = {
  r8 e'' g''8. f''16 e''8 d''16 c'' b'4-\trill 
}

MII = { \time 2/4
 \pageBreak 
 e''8( f'') g''( f'') |
 e''( d'') c''-\trill( b'8) | 
 c''( d'') e''( f'') | 
 e''4-\trill d''4 | 
%5
 e''8 c'' g'' e'' | 
 a'' c''' b'' g'' | 
 a''4 fis''-\trill | 
 g''2 | 
 e''8( f'') g''( f'') | 
%10
 e''( d'') c''( b') | 
 c''( d'') e''( f'') | 
 e''4-\trill d''4 | 
 e''8( c'') g''( e'') | 
 a''( b'') c'''( c'') | 
%15
 d''4 b'-\trill | 
 c''2  \break \bar ":..:" e''8( f'') g''( a'') | 
 g''4 c'''8( b'') | 
 c'''( g'') a''( f'') | 
%20
 e''4-\trill d''4 | 
 e''8( d'') c''( b') | 
 c''( d'') e''( d'') | 
 d''4( c''8-\trill) b'8 | 
 a'2-\trill | 
%25
 b'8( c'') d''( e'') | 
 d''( e'') fis''( g'') | 
 b'4 a'-\trill | 
 g'2 | 
 d''8( e'') c''( e'') | 
%30
 e''( f'') d''( f'') 
}

\score {\MI} 

\score {\MII} 

8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><

I think this bug will not be in some earlier version of LilyPond as the
file is an old one that at one time compiled ok.

Richard






Re: Cairo plans

2021-09-11 Thread Han-Wen Nienhuys
On Mon, Aug 30, 2021 at 10:49 AM Werner LEMBERG  wrote:
> >   The current SVG backend is glacially slow, and has suffered from
> >   rendering discrepancies.  I propose we retire it ASAP to be
> >   replaced by Cairo.
>
> I don't use SVG normally, but this sounds like a good plan, especially
> because of ...
>
> >   The Cairo SVG files are larger, but that is because they also
> >   embed the fonts used for texts, making the rendering exactly equal
> >   to the PDF/PNG.
>
> ... this.

Jonas, aside from the discussion we had about the SVG backend's speed
vs Cairo, how do you feel about replacing the SVG backend with Cairo's
SVG output?

That would yield more accurate SVG output at a reduced maintenance burden.

The immediate motivation is that fixing cut & paste requires
rearrangement of how we output text strings, and I'd rather avoid
refactoring up the SVG backend if I can
(https://gitlab.com/lilypond/lilypond/-/issues/6172#note_675122487 for
background).

This would be predicated on getting Cairo to compile on CI, in GUB and
in the new compile scripts, obviously.

-- 
Han-Wen Nienhuys - hanw...@gmail.com - http://www.xs4all.nl/~hanwen