----- Original Message ----- From: <d...@gnu.org> To: <philehol...@googlemail.com>; <tdanielsmu...@googlemail.com>; <em...@philholmes.net>; <m...@philholmes.net>
Cc: <lilypond-devel@gnu.org>; <re...@codereview-hr.appspotmail.com>
Sent: Tuesday, August 12, 2014 1:56 PM
Subject: Re: Adds incipit section to NR (issue 108270043 by philehol...@googlemail.com)


On 2014/08/12 12:16:12, mail_philholmes.net wrote:
----- Original Message -----
From: <mailto:d...@gnu.org>
To: <mailto:philehol...@googlemail.com>;
<mailto:tdanielsmu...@googlemail.com>;
<mailto:em...@philholmes.net>
Cc: <mailto:re...@codereview-hr.appspotmail.com>;
<mailto:lilypond-devel@gnu.org>
Sent: Tuesday, August 12, 2014 1:09 PM
Subject: Re: Adds incipit section to NR (issue 108270043
mailto:byphilehol...@googlemail.com)


> On 2014/08/12 11:54:38, http://email_philholmes.net wrote:
>
>> I can post this as a bug, but I'm guessing it would be tricky to
fix.
> Would
>> you object to scaling the dimensions of the incipit (in the incipit
> code)
>> line-width and indent by the 1.76 factor, to work round the
problem?
>
> Yes, I would object to scaling the dimensions of the incipit
line-width
> and indent by the 1.76 factor since that is just an ad-hoc
approximation
> for a single case.

Shame you didn't when I first asked.

> Is there a reason you don't scale by the ratio of output-scale
between
> grob-layout and layout?
>
> https://codereview.appspot.com/108270043/


Tell me how and I'll do it.

I think the problem you are trying to work around will likely go away
when you give "incipit-width" the same treatment as "short-indent"
everywhere it occurs in scm/paper.scm.

It's sort of irritating that this is not equally easy to do for a
user-level extension.  Even then, one could check the setting of "mm"
and scale by that.  But when implementing this as a "native" feature, we
are probably better off using the native mechanisms.

https://codereview.appspot.com/108270043/


The problem is the other way round. incipit-width is not scaled within the layout block, and so produces correct results for width. indent and short-indent are scaled, and so produce widths that are too small for the desired output. Attached is a sample file that illustrates the problem. In it is a potential solution: using

scale-factor = #( / 1.0 (module-ref (current-module) 'mm) )

That would seem to be a satisfactory way of avoiding problems should the way scaling is done change in future?

--
Phil Holmes
\pointAndClickOff

incipitA =
#(define-music-function (parser location incipit-music) (ly:music?)
  #{
    \once \override Staff.InstrumentName #'stencil =
      #(lambda (grob)
        (let* ((instrument-name (ly:grob-property grob 'long-text)))
        (set! (ly:grob-property grob 'long-text)
          #{ \markup {
            \score
            {
              \new Staff
              {
                $incipit-music
              }
              \layout { $(ly:grob-layout grob)
                #(format #t "grob::cm: ~a " (module-ref (current-module) 'cm))
                scale-factor = #( / 1.0 (module-ref (current-module) 'mm) )
                #(format #t "test: ~a " (module-ref (current-module) 'scale-factor))
                #(format #t "indent: ~a " (module-ref (current-module) 'indent))
                #(format #t "short-indent: ~a " (module-ref (current-module) 'short-indent))
                #(format #t "incipit-width: ~a " (module-ref (current-module) 'incipit-width))
              }
              \layout {
                #(format #t "cm: ~a " (module-ref (current-module) 'cm))
                test = \cm
                #(format #t "test: ~a " (module-ref (current-module) 'test))
              }
            }
            }
          #})
          (system-start-text::print grob)))
  #}
)

\score {
  {
    \set Staff.instrumentName = #"Altus"
    \incipitA { f''1 }
  }
  \layout {
    indent = 10\cm
    short-indent = 1\cm
    incipit-width = 2\cm
  }
}
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to