"and...@andis59.se" <and...@andis59.se> writes: > On 2012-08-02 18:46, Thomas Morley wrote: >> fN = >> #(define-music-function (parser location fretp) (string?) >> (let ((m (make-music 'TextScriptEvent 'text fretp))) >> (set! (ly:music-property m 'tweaks) >> (acons 'staff-padding 4 (ly:music-property m 'tweaks))) >> m)) > > Hello Thomas, > > You almost nailed it! I wanted a box around the fretnumber. changed > your function to this which I'm happy with! > > fN = > #(define-music-function (parser location fretp) (string?) > (let ((m (make-music 'TextScriptEvent 'text (markup #:line (#:box > fretp))))) > (set! (ly:music-property m 'tweaks) > (acons 'staff-padding 5 (ly:music-property m 'tweaks))) > m)) >
Ah, "version 2.14.2". In a current version, you could just write fN = #(define-event-function (parser location fretp) (markup?) #{ -\tweak #'staff-padding #5 -\markup \line { \box #fretp } #}) And that's it. You might still want to consider exchanging the string? predicate with markup? though: it would still accept strings (possibly only without # though: I don't quite remember what 2.14.2 did here), but also more complex markups. -- David Kastrup _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user