X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scm%2Fdefine-markup-commands.scm;h=4844dcd75e321d60b5adec7849900bbfdf1be344;hb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;hp=20990a73857726918a575ff3a6e9f22f64e19a42;hpb=0fe24db3936774a8fb913cb14c997036db7aeb1c;p=lilypond.git diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 20990a7385..4844dcd75e 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -1,6 +1,6 @@ ;;;; This file is part of LilyPond, the GNU music typesetter. ;;;; -;;;; Copyright (C) 2000--2014 Han-Wen Nienhuys +;;;; Copyright (C) 2000--2015 Han-Wen Nienhuys ;;;; Jan Nieuwenhuizen ;;;; ;;;; LilyPond is free software: you can redistribute it and/or modify @@ -1157,6 +1157,31 @@ the use of @code{\\simple} is unnecessary. @end lilypond" (interpret-markup layout props str)) +(define-markup-command (first-visible layout props args) + (markup-list?) + #:category other + "Use the first markup in @var{args} that yields a non-empty stencil +and ignore the rest. + +@lilypond[verbatim,quote] +\\markup { + \\first-visible { + \\fromproperty #'header:composer + \\italic Unknown + } +} +@end lilypond" + (define (false-if-empty stencil) + (if (ly:stencil-empty? stencil) #f stencil)) + (or + (any + (lambda (m) + (if (markup? m) + (false-if-empty (interpret-markup layout props m)) + (any false-if-empty (interpret-markup-list layout props (list m))))) + args) + empty-stencil)) + (define-public empty-markup (make-simple-markup "")) @@ -2377,7 +2402,7 @@ may be any property supported by @rinternals{font-interface}, (define-markup-command (abs-fontsize layout props size arg) (number? markup?) #:category font - "Use @var{size} as the absolute font size to display @var{arg}. + "Use @var{size} as the absolute font size (in points) to display @var{arg}. Adjusts @code{baseline-skip} and @code{word-space} accordingly. @lilypond[verbatim,quote]