Bonjour Matthias!

Wed, 14 Apr 2004 20:08:45 +0200, tu as dit : 

 > Hi all,
 > earlier this day, Roland did ask me (per PM) a question leading to an
 > IMHO very usable little helper.

 > Ronald wanted some feature like the following:

 > - At top level, define
 >     textshift = \once\override TextScript #'extra-offset = #'(#1 . #2)

 > - Within music expressions, use
 >     \textshift{0}{-1.5}

I use the following:

----------------------------------------
#(use-modules (ice-9 optargs))

#(define*-public (mus:make-context context element #:key id (operations '()))
  "Base function for building ContextSpeccedMusic objects."
  (apply make-music (append (list 'ContextSpeccedMusic
                                  'property-operations operations
                                  'context-type context
                                  'element element)
                            (if id (list 'context-id id) '()))))

#(define*-public (mus:override context layout property val #:optional once)
  "Layout property override.

 \once \override Voice.Fingering #'padding = #3
 <=>
 (mus:override 'Voice 'Fingering 'padding 3 #t)"
  (mus:make-context context (make-music 'OverrideProperty
                                        'once once
                                        'grob-property property
                                        'grob-value val
                                        'symbol layout)))

#(define* (textshift dx dy #:optional once)
  (ly:export 
   (mus:override 'Bottom 'TextScript 'extra-offset (cons dx dy) once)))

\score {
    \notes { 
        \fatText 
        c'^"normal text"
        #(textshift 3 2 #t)
        c'^"shifted text once"
        c'^"normal text"
    }
}
----------------------------------------

nicolas



_______________________________________________
Lilypond-user mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/lilypond-user

Reply via email to