Menu

#2968 -dpreview cuts off vertically

Accepted
nobody
None
Defect
2018-11-03
2012-11-19
Anonymous
No

Originally created by: *anonymous

Originally created by: Elu...@gmail.com

invoking

LilyPond --png -dpreview …

with the code

\language english
\paper{
  indent=0\mm
  line-width=120\mm
  oddFooterMarkup=##f
  oddHeaderMarkup=##f
  bookTitleMarkup = ##f
  scoreTitleMarkup = ##f
}
\new Staff \with {
  \clef bass
  \remove Time_signature_engraver
}
{
  \key c \major
  <b d' f af>1
}

the top note is slightly cut off.

note that not all chords are cropped, s. http://lilypond.1069038.n5.nabble.com/dpreview-cuts-off-vertically-td136547.html

this looks similar to https://code.google.com/p/lilypond/issues/detail?id=268

another related issue is [#720]

1 Attachments

Related

Issues: #268
Issues: #720

Discussion

  • Federico Bruni

    Federico Bruni - 2017-05-12
    • Description has changed:

    Diff:

    
    
    • Attachments has changed:

    Diff:

    --- old
    +++ new
    @@ -0,0 +1 @@
    +document.preview.png (3.4 kB; image/png)
    
    • Needs: -->
    • Patch: -->
     
  • Federico Bruni

    Federico Bruni - 2017-05-12

    the horizontal cut off reported by Urs does not occur anymore, at least in version 2.19.59:

    \version "2.19.59"
    
    \score {
      \new PianoStaff <<
        \new Staff { R1 }
        \new Staff { R1 }
      >>
    } 
    

    attached preview is correct

     
  • Federico Bruni

    Federico Bruni - 2017-05-12

    On the other hand, StaffGroup bracket is cut off vertically (at the bottom):

    \version "2.19.59"
    
    \score {
      \new StaffGroup <<
        \new Staff { R1 }
        \new TabStaff { R1 }
      >>
    } 
    

    IIRC this is the reason why for my projects I've never been able to use lilypond-book, which creates each snippet's system with -dpreview, if I'm not mistaken.

     
    • Urs Liska

      Urs Liska - 2018-01-18

      I just came across this again (also with a staff bracket and lilypond-book-preamble.ly).
      I can add that the cropping only happens with the last system, all others work fine.

      A workaround is to modify the Y-extent of something that is on that last system to, say, #'(-4 . 0). Of course that only works if that doesn't affect collision handling in any way. An alternative would be to add some element (an articulation, a markup etc.) below the staff and color it white.

      Of course the solution would be to properly calculate the Y-extent of the staff bracket ...

       
      • Federico Bruni

        Federico Bruni - 2018-11-03

        Urs, lilypond-book-preamble.ly uses the EPS backend:

        #(ly:set-option 'backend 'eps)
        

        which seems to suggest that this issue is actually a duplicate of #720.
        The problem is in the last system only when using lilypond-book-preamble. If you use the crop preview option, you may get the crop even on the top. What triggers the error is the kind of Staff used.
        I can reproduce this error only with TabStaff, DrumStaff, RhythmicStaff and VaticanaStaff. But I don't know if it might depend on the example used. Here's what I'm testing now:

        \version "2.19.82"
        \include "lilypond-book-preamble.ly"
        
        \new StaffGroup <<
          \new Staff {
            \repeat unfold 10 a'1*4 \break
          }
          \new TabStaff {
            \repeat unfold 10 g1*4 \break
          }
        >>
        
         
  • Federico Bruni

    Federico Bruni - 2017-05-12
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -31,3 +31,5 @@
     note that not all chords are cropped, s. [http://lilypond.1069038.n5.nabble.com/dpreview-cuts-off-vertically-td136547.html](http://lilypond.1069038.n5.nabble.com/dpreview-cuts-off-vertically-td136547.html)
    
     this looks similar to [https://code.google.com/p/lilypond/issues/detail?id=268](#268)
    +
    +another related issue is [#720]
    
     

    Related

    Issues: #268
    Issues: #720

  • Thomas Morley

    Thomas Morley - 2018-11-03

    As far as I can tell, the kind of staff-like context which appears at the bottom of a StaffGroup doesn't matter.
    Using clefs not sticking out at top/bottom (like bass-clef) will result in top- and bottom-cropped output with otherwise default-Staffs.

    \version "2.19.82"
    
    \include "lilypond-book-preamble.ly"
    
    \new StaffGroup 
      <<
      \new Staff { \clef bass g1 }
      \new Staff { \clef bass g1 }
      >>
    
     

    Last edit: Federico Bruni 2018-11-03
  • Thomas Morley

    Thomas Morley - 2018-11-03

    Looks like it's the SystemStartBracket is not taken into account.

    Here a workaround adjusting SystemStartBracket.Y-extent, iff 'default-toplevel-book-handler' is defined. Which currently only happens if 'lilypond-book-preamble.ly' is included.

    \version "2.19.82"
    
    \include "lilypond-book-preamble.ly"
    
    \layout {                
      \context {
        \Score
        \override SystemStartBracket.after-line-breaking =
        #(lambda (grob)
          (if (defined? 'default-toplevel-book-handler)
              (let ((Y-off (ly:grob-property grob 'Y-extent)))
                (ly:grob-set-property! grob 'Y-extent
                  (cons (- (car Y-off) 1.7) (+ (cdr Y-off) 1.7))))))
      }
    }
    
    
    \new StaffGroup 
      <<
      \new Staff { \clef bass g1 }
      \new Staff { \clef bass g1 }
      >>
    
     

    Last edit: Federico Bruni 2018-11-03
  • Federico Bruni

    Federico Bruni - 2018-11-03

    Thanks for the workaround!
    However, files compiled with -dpreview (such as Documentation/ly-examples/tab-example.ly) are still affected.