Here's something I cooked up recently. I had noticed that numbers coded like this looked way too tight to my eye:
\markup \number #"12345"
But finding an acceptable spacing for every number/letter combination for
my little script is beyond me right now. Particularly bad is when number 7
is followed by the period. Anyway, it's a start.
Comments appreciated...
Mark
% "\No" markup: create stylized movement number for the instrumentName field.
% syntax example: instrumentName = \markup \No #"14a"
#(define-markup-command (No layout props n) (string?)
(define (format-char c)
(let ((s (string c)))
(if (number? (string->number s))
(markup #:hspace 0.125 #:number s #:hspace 0.125)
(markup #:hspace 0 #:fontsize 2 s))))
(define (format-string s i)
(let ((n (string-length s)))
(if (= n 0)
(markup #:null)
(markup (format-char (string-ref s i))
(if (= (+ i 1) n)
(markup #:null)
(format-string s (+ i 1)))))))
(let ((i (string-length n)))
(interpret-markup layout props
(markup
#:concat (
#:concat (
#:fontsize 2 "N"
#:hspace 0.5
#:override '(baseline-skip . 0.825)
#:override '(direction . 1)
#:dir-column (
#:fontsize 2 #:center-align "."
#:fontsize 1 #:center-align "o"
)
)
#:hspace 0.75
#:concat (
(format-string n 0)
#:fontsize 2 "."
)
)
)
)
)
)
\markup \No #"5"
\markup \No #"7"
\markup \No #"11"
\markup \No #"14a"
\markup \No #"27b"
<<attachment: mvt_numbers.PNG>>
_______________________________________________ lilypond-user mailing list [email protected] http://lists.gnu.org/mailman/listinfo/lilypond-user
