lilypond-devel
[Top][All Lists]
Advanced

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

Re: [Lilypond-auto] Issue 1320 in lilypond: Enhancement: user-customizab


From: Marc Hohl
Subject: Re: [Lilypond-auto] Issue 1320 in lilypond: Enhancement: user-customizable barlines through a Scheme interface.
Date: Mon, 23 Jul 2012 10:30:50 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120714 Thunderbird/14.0

Am 21.07.2012 15:02, schrieb address@hidden:
Updates:
    Labels: -Patch-new Patch-needs_work

Comment #35 on issue 1320 by address@hidden: Enhancement: user-customizable barlines through a Scheme interface.
http://code.google.com/p/lilypond/issues/detail?id=1320#c35

Patchy the autobot says: Again, lots of small changes across the bar. The shifts for repeats appear fixed. breathing-sign-ancient.ly looks like it is losing the third breathing sign, however that may be a rasterization artifact of the regtest checker. There are small effects like isolated letters in text shifted likely by one pixel. That makes it likely that we are seeing the effects of rounding/quantization artifacts. Are there some calculations done in C++ that use integers and/or rounding? I would suspect that those are probably done with exact numbers or reals or different rounding modes in Scheme. Remember that (/ 1 2) yields 1/2, not 0 in Scheme.

Thanks for your comment.

I did some experimenting with the stencils in order to
find out what's fishy here.

A small test file:

#(define (bar-line-print-info grob)
         (let* ((stencil (bar-line::print grob))
                ;;(stencil (ly:bar-line::print grob))
                (glyph (ly:grob-property grob 'glyph))
                (x-extent (ly:stencil-extent stencil X))
                (y-extent (ly:stencil-extent stencil Y)))

               (display "\nBar Line - glyph: ")(display glyph)
               (display ", X-extent: ")(display x-extent)
               (display ", Y-extent: ")(display y-extent)
               stencil))

music = \relative f {
  \override Staff.BarLine #'stencil = #bar-line-print-info
  c'4 c c c \bar "|"
  c c c c \bar "."
  c c c c \bar ":"
  c c c c \bar "'"
  c c c c \bar "S"
  c c c c \bar "kievan"
  c c c c \bar "dashed"
}

\score {
  \new Staff {
     \new Voice { \music }
  }
}

was processed twice; first a build from current master, then again with
a build from my local branch:

[master]

address@hidden ~/sandbox/issue1320$ Lilypond show-extents.ly
GNU LilyPond 2.15.42
»show-extents.ly« wird verarbeitet
Analysieren...
Interpreting music...[8][8]
Vorverarbeitung der grafischen Elemente...
Bar Line - glyph: |, X-extent: (0.0 . 0.19), Y-extent: (-1.99875 . 1.99875)
Bar Line - glyph: ., X-extent: (0.0 . 0.6), Y-extent: (-1.99875 . 1.99875)
Bar Line - glyph: :, X-extent: (0.0 . 0.449996), Y-extent: (-1.725 . 1.725)
Bar Line - glyph: ', X-extent: (0.0 . 0.1), Y-extent: (1.49875 . 2.49875)
Bar Line - glyph: S, X-extent: (-1.25 . 1.25), Y-extent: (-4.0 . 4.0)
Bar Line - glyph: kievan, X-extent: (-0.0 . 1.59999), Y-extent: (-2.095008 . 2.904992)
Bar Line - glyph: |, X-extent: (0.0 . 0.19), Y-extent: (-1.99875 . 1.99875)
Bar Line - glyph: ., X-extent: (0.0 . 0.6), Y-extent: (-1.99875 . 1.99875)
Bar Line - glyph: :, X-extent: (0.0 . 0.449996), Y-extent: (-1.725 . 1.725)
Bar Line - glyph: :, X-extent: (0.0 . 0.0), Y-extent: (-1.99875 . 1.99875)
Bar Line - glyph: ', X-extent: (0.0 . 0.1), Y-extent: (1.49875 . 2.49875)
Bar Line - glyph: S, X-extent: (-0.3 . 0.38), Y-extent: (-1.99875 . 1.99875)
Bar Line - glyph: S, X-extent: (-1.25 . 1.25), Y-extent: (-4.0 . 4.0)
Bar Line - glyph: kievan, X-extent: (-0.0 . 1.59999), Y-extent: (-2.095008 . 2.904992) Bar Line - glyph: kievan, X-extent: (0.0 . 0.0), Y-extent: (-1.99875 . 1.99875) Bar Line - glyph: dashed, X-extent: (0.0 . 0.19), Y-extent: (-1.99875 . 1.99875) Bar Line - glyph: dashed, X-extent: (0.0 . 0.19), Y-extent: (-1.99875 . 1.99875)
Ideale Seitenanzahl wird gefunden...
Musik wird auf eine Seite angepasst...
Systeme erstellen...
Layout nach »show-extents.ps« ausgeben...
Konvertierung nach »./show-extents.pdf«...
Kompilation erfolgreich beendet

[barlineI]

address@hidden ~/sandbox/issue1320$ Lilypond show-extents.ly
GNU LilyPond 2.15.42
»show-extents.ly« wird verarbeitet
Analysieren...
Interpreting music...[8][8]
Vorverarbeitung der grafischen Elemente...
Bar Line - glyph: |, X-extent: (0.0 . 0.19), Y-extent: (-2.05 . 2.05)
Bar Line - glyph: ., X-extent: (0.0 . 0.6), Y-extent: (-2.05 . 2.05)
Bar Line - glyph: :, X-extent: (0.0 . 0.449996), Y-extent: (-1.725 . 1.725)
Bar Line - glyph: ', X-extent: (0.0 . 0.1), Y-extent: (1.55 . 2.55)
Bar Line - glyph: S, X-extent: (-1.25 . 1.25), Y-extent: (-4.0 . 4.0)
Bar Line - glyph: kievan, X-extent: (-0.0 . 1.59999), Y-extent: (-2.095008 . 2.904992)
Bar Line - glyph: |, X-extent: (0.0 . 0.19), Y-extent: (-2.05 . 2.05)
Bar Line - glyph: ., X-extent: (0.0 . 0.6), Y-extent: (-2.05 . 2.05)
Bar Line - glyph: :, X-extent: (0.0 . 0.449996), Y-extent: (-1.725 . 1.725)
Bar Line - glyph: :, X-extent: (0.0 . 0.0), Y-extent: (-2.05 . 2.05)
Bar Line - glyph: ', X-extent: (0.0 . 0.1), Y-extent: (1.55 . 2.55)
Bar Line - glyph: S, X-extent: (-0.3 . 0.38), Y-extent: (-2.05 . 2.05)
Bar Line - glyph: S, X-extent: (-1.25 . 1.25), Y-extent: (-4.0 . 4.0)
Bar Line - glyph: kievan, X-extent: (-0.0 . 1.59999), Y-extent: (-2.095008 . 2.904992)
Bar Line - glyph: kievan, X-extent: (0.0 . 0.0), Y-extent: (-2.05 . 2.05)
Bar Line - glyph: dashed, X-extent: (-0.095 . 0.095), Y-extent: (-2.05 . 2.05) Bar Line - glyph: dashed, X-extent: (-0.095 . 0.095), Y-extent: (-2.05 . 2.05)
Ideale Seitenanzahl wird gefunden...
Musik wird auf eine Seite angepasst...
Systeme erstellen...
Layout nach »show-extents.ps« ausgeben...
Konvertierung nach »./show-extents.pdf«...
Kompilation erfolgreich beendet

The x-extent of all bar lines is identical except for the dashed
bar line (the newer version is centered around x=0, but the width is identical),
so IIUC, rounding errors may not a problem here.

Interestingly, the y-coordinates differ in some cases; this shouldn't
affect the spacing, but I'll try to correct this anyway.

So the main question is: where do the shifted pixels come from?

Regards,

Marc








reply via email to

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