Hi Urs,

I don’t quite see your problem. I’m using such functions without. Since multiple \paper blocks are combined in a rather sensible way, there’s no problem with just having the function output an entire \paper block and use it on top level, regardless of any other \paper blocks (except if they also use #(define fonts …)). You didn’t say what’s actually supposed to be the argument of the function, but I attached an example.

HTH, Simon

Am 06.03.2015 um 17:32 schrieb Urs Liska:
Hi all,

I don't even know where to start with this, and looking around in the documentation doesn't get me started either.

What would I have to do if I want to write a Scheme function (presumably with define-scheme-function) that produces a \paper block or rather sets the content of a paper block?

What I ultimately need is a wrapper around

\paper {
  #(define fonts
     (set-global-fonts
      #:music "cadence"
      #:brace "cadence"
      #:factor (/ staff-height pt 20)
      ))
}

I don't see whether I will have to somehow _create_ the paper block and produce what I want to have in that or if I have to somehow _find_ an existing paper block where the (define fonts) thing can be applied/executed.

TIA
Urs


\version "2.19.16"

globalFonts = #(define-scheme-function (parser location name) (string?)
                 #{
                   \paper {
                     #(define fonts
                        (set-global-fonts
                         #:music name
                         #:brace name
                         #:factor (/ staff-height pt 20)
                         ))
                   }
                 #})
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to