1 ;;;; define-markup-commands.scm -- markup commands
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 2000--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
6 ;;;; Jan Nieuwenhuizen <janneke@gnu.org>
10 ;;; * each markup function should have a doc string with
11 ;; syntax, description and example.
13 (define-public empty-stencil (ly:make-stencil '() '(1 . -1) '(1 . -1)))
14 (define-public point-stencil (ly:make-stencil "" '(0 . 0) '(0 . 0)))
16 (def-markup-command (stencil layout props stil) (ly:stencil?)
21 (def-markup-command (score layout props score) (ly:score?)
22 "Inline an image of music."
24 ((systems (ly:score-embedded-format score layout)))
26 (if (= 0 (vector-length systems))
28 (ly:warn "No systems found in \\score markup. Did you forget \\layout?")
32 ((stencil (ly:paper-system-stencil (vector-ref systems 0))))
34 (ly:stencil-align-to! stencil Y CENTER)
37 (def-markup-command (simple layout props str) (string?)
38 "A simple text string; @code{\\markup @{ foo @}} is equivalent with
39 @code{\\markup @{ \\simple #\"foo\" @}}."
40 (interpret-markup layout props str))
42 (def-markup-command (encoded-simple layout props sym str) (symbol? string?)
43 "A text string, encoded with encoding @var{sym}. See
44 @usermanref{Text encoding} for more information."
45 (Text_interface::interpret_string layout
49 ;; TODO: use font recoding.
51 ;; (map make-word-markup (string-tokenize str)))))
53 (define-public empty-markup
54 (make-simple-markup ""))
57 (def-markup-command (postscript layout props str) (string?)
59 "This inserts @var{str} directly into the output as a PostScript
60 command string. Due to technicalities of the output backends,
61 different scales should be used for the @TeX{} and PostScript backend,
62 selected with @code{-f}.
65 For the TeX backend, the following string prints a rotated text
70 0 0 moveto /ecrm10 findfont
71 1.75 scalefont setfont 90 rotate (hello) show
75 The magical constant 1.75 scales from LilyPond units (staff spaces) to
78 For the postscript backend, use the following
81 gsave /ecrm10 findfont
83 scalefont setfont 90 rotate (hello) show grestore
89 (list 'embedded-ps str)
92 ;;(def-markup-command (fill-line layout props line-width markups)
93 ;; (number? markup-list?)
94 ;; no parser tag -- should make number? markuk-list? thingy
95 (def-markup-command (fill-line layout props markups)
97 "Put @var{markups} in a horizontal line of width @var{line-width}.
98 The markups are spaced/flushed to fill the entire line.
99 If there are no arguments, return an empty stencil.
102 (let* ((orig-stencils
103 (map (lambda (x) (interpret-markup layout props x))
107 (if (ly:stencil-empty? stc)
109 stc)) orig-stencils))
112 (if (ly:stencil-empty? stc)
114 (interval-length (ly:stencil-extent stc X))))
116 (word-count (length stencils))
117 (word-space (chain-assoc-get 'word-space props))
118 (line-width (chain-assoc-get 'linewidth props))
119 (fill-space (if (< line-width text-width)
121 (/ (- line-width text-width)
122 (if (= word-count 1) 2 (- word-count 1)))))
123 (line-stencils (if (= word-count 1)
130 (if (null? (remove ly:stencil-empty? orig-stencils))
132 (stack-stencils X RIGHT fill-space line-stencils))))
134 (define (font-markup qualifier value)
135 (lambda (layout props arg)
136 (interpret-markup layout
137 (prepend-alist-chain qualifier value props)
141 (def-markup-command (line layout props args) (markup-list?)
142 "Put @var{args} in a horizontal line. The property @code{word-space}
143 determines the space between each markup in @var{args}."
145 (chain-assoc-get 'word-space props)
146 (map (lambda (m) (interpret-markup layout props m)) args)))
148 (def-markup-command (fromproperty layout props symbol) (symbol?)
149 "Read the @var{symbol} from property settings, and produce a stencil from the markup contained within. If @var{symbol} is not defined, it returns an empty markup"
151 ((m (chain-assoc-get symbol props)))
154 (interpret-markup layout props m)
155 (ly:make-stencil '() '(1 . -1) '(1 . -1) ))))
158 (def-markup-command (on-the-fly layout props procedure arg) (symbol? markup?)
159 "Apply the @var{procedure} markup command to
160 @var{arg}. @var{procedure} should take a single argument."
162 ((anonymous-with-signature (lambda (layout props arg) (procedure layout props arg))))
164 (set-object-property! anonymous-with-signature
168 (interpret-markup layout props (list anonymous-with-signature arg))
172 (def-markup-command (combine layout props m1 m2) (markup? markup?)
173 "Print two markups on top of each other."
175 ((s1 (interpret-markup layout props m1))
176 (s2 (interpret-markup layout props m2)))
178 (ly:stencil-add s1 s2)))
180 (def-markup-command (finger layout props arg) (markup?)
181 "Set the argument as small numbers."
182 (interpret-markup layout
183 (cons '((font-size . -5) (font-encoding . fetaNumber)) props)
186 (def-markup-command (fontsize layout props mag arg) (number? markup?)
187 "This sets the relative font size, e.g.
189 A \\fontsize #2 @{ B C @} D
193 This will enlarge the B and the C by two steps.
197 (prepend-alist-chain 'font-size mag props)
200 (def-markup-command (magnify layout props sz arg) (number? markup?)
201 "This sets the font magnification for the its argument. In the following
202 example, the middle A will be 10% larger:
204 A \\magnify #1.1 @{ A @} A
207 Note: magnification only works if a font-name is explicitly selected.
208 Use @code{\\fontsize} otherwise."
212 (prepend-alist-chain 'font-magnification sz props)
215 (def-markup-command (bold layout props arg) (markup?)
216 "Switch to bold font-series"
217 (interpret-markup layout (prepend-alist-chain 'font-series 'bold props) arg))
219 (def-markup-command (sans layout props arg) (markup?)
220 "Switch to the sans serif family"
221 (interpret-markup layout (prepend-alist-chain 'font-family 'sans props) arg))
223 (def-markup-command (number layout props arg) (markup?)
224 "Set font family to @code{number}, which yields the font used for
225 time signatures and fingerings. This font only contains numbers and
226 some punctuation. It doesn't have any letters. "
227 (interpret-markup layout (prepend-alist-chain 'font-encoding 'fetaNumber props) arg))
229 (def-markup-command (roman layout props arg) (markup?)
230 "Set font family to @code{roman}."
231 (interpret-markup layout (prepend-alist-chain 'font-family 'roman props) arg))
233 (def-markup-command (huge layout props arg) (markup?)
234 "Set font size to +2."
235 (interpret-markup layout (prepend-alist-chain 'font-size 2 props) arg))
237 (def-markup-command (large layout props arg) (markup?)
238 "Set font size to +1."
239 (interpret-markup layout (prepend-alist-chain 'font-size 1 props) arg))
241 (def-markup-command (normalsize layout props arg) (markup?)
242 "Set font size to default."
243 (interpret-markup layout (prepend-alist-chain 'font-size 0 props) arg))
245 (def-markup-command (small layout props arg) (markup?)
246 "Set font size to -1."
247 (interpret-markup layout (prepend-alist-chain 'font-size -1 props) arg))
249 (def-markup-command (tiny layout props arg) (markup?)
250 "Set font size to -2."
251 (interpret-markup layout (prepend-alist-chain 'font-size -2 props) arg))
253 (def-markup-command (teeny layout props arg) (markup?)
254 "Set font size to -3."
255 (interpret-markup layout (prepend-alist-chain 'font-size -3 props) arg))
257 (def-markup-command (caps layout props arg) (markup?)
258 "Set @code{font-shape} to @code{caps}."
259 (interpret-markup layout (prepend-alist-chain 'font-shape 'caps props) arg))
261 ;(def-markup-command (latin-i layout props arg) (markup?)
262 ; "TEST latin1 encoding."
263 ; (interpret-markup layout (prepend-alist-chain 'font-shape 'latin1 props) arg))
265 (def-markup-command (dynamic layout props arg) (markup?)
266 "Use the dynamic font. This font only contains @b{s}, @b{f}, @b{m},
267 @b{z}, @b{p}, and @b{r}. When producing phrases, like ``pi@`{u} @b{f}'', the
268 normal words (like ``pi@`{u}'') should be done in a different font. The
269 recommend font for this is bold and italic"
271 layout (prepend-alist-chain 'font-encoding 'fetaDynamic props) arg))
273 (def-markup-command (italic layout props arg) (markup?)
274 "Use italic @code{font-shape} for @var{arg}. "
275 (interpret-markup layout (prepend-alist-chain 'font-shape 'italic props) arg))
277 (def-markup-command (typewriter layout props arg) (markup?)
278 "Use @code{font-family} typewriter for @var{arg}."
280 layout (prepend-alist-chain 'font-family 'typewriter props) arg))
282 (def-markup-command (upright layout props arg) (markup?)
283 "Set font shape to @code{upright}."
285 layout (prepend-alist-chain 'font-shape 'upright props) arg))
287 (def-markup-command (doublesharp layout props) ()
288 "Draw a double sharp symbol."
290 (interpret-markup layout props (markup #:musicglyph "accidentals-4")))
291 (def-markup-command (sesquisharp layout props) ()
292 "Draw a 3/2 sharp symbol."
293 (interpret-markup layout props (markup #:musicglyph "accidentals-3")))
295 (def-markup-command (sharp layout props) ()
296 "Draw a sharp symbol."
297 (interpret-markup layout props (markup #:musicglyph "accidentals-2")))
298 (def-markup-command (semisharp layout props) ()
299 "Draw a semi sharp symbol."
300 (interpret-markup layout props (markup #:musicglyph "accidentals-1")))
301 (def-markup-command (natural layout props) ()
302 "Draw a natural symbol."
304 (interpret-markup layout props (markup #:musicglyph "accidentals-0")))
305 (def-markup-command (semiflat layout props) ()
307 (interpret-markup layout props (markup #:musicglyph "accidentals--1")))
308 (def-markup-command (flat layout props) ()
309 "Draw a flat symbol."
311 (interpret-markup layout props (markup #:musicglyph "accidentals--2")))
312 (def-markup-command (sesquiflat layout props) ()
313 "Draw a 3/2 flat symbol."
315 (interpret-markup layout props (markup #:musicglyph "accidentals--3")))
316 (def-markup-command (doubleflat layout props) ()
317 "Draw a double flat symbol."
319 (interpret-markup layout props (markup #:musicglyph "accidentals--4")))
322 (def-markup-command (column layout props args) (markup-list?)
323 "Stack the markups in @var{args} vertically."
325 -1 0.0 (chain-assoc-get 'baseline-skip props)
326 (remove ly:stencil-empty?
327 (map (lambda (m) (interpret-markup layout props m)) args))))
329 (def-markup-command (dir-column layout props args) (markup-list?)
330 "Make a column of args, going up or down, depending on the setting
331 of the @code{#'direction} layout property."
332 (let* ((dir (chain-assoc-get 'direction props)))
334 (if (number? dir) dir -1)
336 (chain-assoc-get 'baseline-skip props)
337 (map (lambda (x) (interpret-markup layout props x)) args))))
339 (def-markup-command (center-align layout props args) (markup-list?)
340 "Put @code{args} in a centered column. "
341 (let* ((mols (map (lambda (x) (interpret-markup layout props x)) args))
342 (cmols (map (lambda (x) (ly:stencil-align-to! x X CENTER)) mols)))
343 (stack-lines -1 0.0 (chain-assoc-get 'baseline-skip props) cmols)))
345 (def-markup-command (vcenter layout props arg) (markup?)
346 "Align @code{arg} to its center. "
347 (let* ((mol (interpret-markup layout props arg)))
348 (ly:stencil-align-to! mol Y CENTER)
351 (def-markup-command (right-align layout props arg) (markup?)
352 (let* ((m (interpret-markup layout props arg)))
353 (ly:stencil-align-to! m X RIGHT)
356 (def-markup-command (left-align layout props arg) (markup?)
357 "Align @var{arg} on its left edge. "
359 (let* ((m (interpret-markup layout props arg)))
360 (ly:stencil-align-to! m X LEFT)
363 (def-markup-command (general-align layout props axis dir arg) (integer? number? markup?)
364 "Align @var{arg} in @var{axis} direction to the @var{dir} side."
365 (let* ((m (interpret-markup layout props arg)))
367 (ly:stencil-align-to! m axis dir)
371 (def-markup-command (halign layout props dir arg) (number? markup?)
372 "Set horizontal alignment. If @var{dir} is @code{-1}, then it is
373 left-aligned, while @code{+1} is right. Values in between interpolate
374 alignment accordingly."
377 (let* ((m (interpret-markup layout props arg)))
378 (ly:stencil-align-to! m X dir)
381 (def-markup-command (musicglyph layout props glyph-name) (string?)
382 "This is converted to a musical symbol, e.g. @code{\\musicglyph
383 #\"accidentals-0\"} will select the natural sign from the music font.
384 See @usermanref{The Feta font} for a complete listing of the possible glyphs.
386 (ly:find-glyph-by-name
387 (ly:paper-get-font layout (cons '((font-encoding . fetaMusic))
392 (def-markup-command (lookup layout props glyph-name) (string?)
393 "Lookup a glyph by name."
394 (ly:find-glyph-by-name (ly:paper-get-font layout props)
397 (def-markup-command (char layout props num) (integer?)
398 "Produce a single character, e.g. @code{\\char #65} produces the
400 (ly:get-glyph (ly:paper-get-font layout props) num))
402 (def-markup-command (raise layout props amount arg) (number? markup?)
404 This raises @var{arg}, by the distance @var{amount}.
405 A negative @var{amount} indicates lowering:
407 @lilypond[verbatim,fragment,relative=1]
408 c1^\\markup { C \\small \\raise #1.0 \\bold { \"9/7+\" }}
410 The argument to @code{\\raise} is the vertical displacement amount,
411 measured in (global) staff spaces. @code{\\raise} and @code{\\super}
412 raise objects in relation to their surrounding markups.
414 If the text object itself is positioned above or below the staff, then
415 @code{\\raise} cannot be used to move it, since the mechanism that
416 positions it next to the staff cancels any shift made with
417 @code{\\raise}. For vertical positioning, use the @code{padding}
418 and/or @code{extra-offset} properties. "
421 (ly:stencil-translate-axis (interpret-markup layout props arg)
424 (def-markup-command (fraction layout props arg1 arg2) (markup? markup?)
425 "Make a fraction of two markups."
427 (let* ((m1 (interpret-markup layout props arg1))
428 (m2 (interpret-markup layout props arg2)))
429 (ly:stencil-align-to! m1 X CENTER)
430 (ly:stencil-align-to! m2 X CENTER)
431 (let* ((x1 (ly:stencil-extent m1 X))
432 (x2 (ly:stencil-extent m2 X))
433 (line (ly:round-filled-box (interval-union x1 x2) '(-0.05 . 0.05) 0.0))
434 ;; should stack mols separately, to maintain LINE on baseline
435 (stack (stack-lines -1 0.2 0.6 (list m1 line m2))))
436 (ly:stencil-align-to! stack Y CENTER)
437 (ly:stencil-align-to! stack X LEFT)
438 ;; should have EX dimension
440 (ly:stencil-translate-axis stack 0.75 Y))))
443 ;; TODO: better syntax.
445 (def-markup-command (note-by-number layout props log dot-count dir) (number? number? number?)
446 "Construct a note symbol, with stem. By using fractional values for
447 @var{dir}, you can obtain longer or shorter stems."
449 (let* ((font (ly:paper-get-font layout (cons '((font-encoding . fetaMusic)) props)))
450 (size (chain-assoc-get 'font-size props 0))
451 (stem-length (* (magstep size) (max 3 (- log 1))))
452 (head-glyph (ly:find-glyph-by-name
454 (string-append "noteheads-s" (number->string (min log 2)))))
455 (stem-thickness 0.13)
456 (stemy (* dir stem-length))
457 (attachx (if (> dir 0)
458 (- (cdr (ly:stencil-extent head-glyph X)) stem-thickness)
460 (attachy (* dir 0.28))
461 (stem-glyph (and (> log 0)
463 (cons attachx (+ attachx stem-thickness))
464 (cons (min stemy attachy)
466 (/ stem-thickness 3))))
467 (dot (ly:find-glyph-by-name font "dots-dot"))
468 (dotwid (interval-length (ly:stencil-extent dot X)))
469 (dots (and (> dot-count 0)
470 (apply ly:stencil-add
472 (ly:stencil-translate-axis
473 dot (* (+ 1 (* 2 x)) dotwid) X) )
474 (iota dot-count 1)))))
475 (flaggl (and (> log 2)
476 (ly:stencil-translate
477 (ly:find-glyph-by-name font
478 (string-append "flags-"
479 (if (> dir 0) "u" "d")
480 (number->string log)))
481 (cons (+ attachx (/ stem-thickness 2)) stemy)))))
483 (set! stem-glyph (ly:stencil-add flaggl stem-glyph)))
484 (if (ly:stencil? stem-glyph)
485 (set! stem-glyph (ly:stencil-add stem-glyph head-glyph))
486 (set! stem-glyph head-glyph))
487 (if (ly:stencil? dots)
490 (ly:stencil-translate-axis dots
491 (+ (if (and (> dir 0) (> log 2))
494 ;; huh ? why not necessary?
495 ;;(cdr (ly:stencil-extent head-glyph X))
501 (use-modules (ice-9 regex))
504 (let ((divisor (log 2)))
505 (lambda (z) (inexact->exact (/ (log z) divisor)))))
507 (define (parse-simple-duration duration-string)
508 "Parse the `duration-string', e.g. ''4..'' or ''breve.'', and return a (log dots) list."
509 (let ((match (regexp-exec (make-regexp "(breve|longa|maxima|[0-9]+)(\\.*)") duration-string)))
510 (if (and match (string=? duration-string (match:substring match 0)))
511 (let ((len (match:substring match 1))
512 (dots (match:substring match 2)))
513 (list (cond ((string=? len "breve") -1)
514 ((string=? len "longa") -2)
515 ((string=? len "maxima") -3)
516 (else (log2 (string->number len))))
517 (if dots (string-length dots) 0)))
518 (error "This is not a valid duration string:" duration-string))))
520 (def-markup-command (note layout props duration dir) (string? number?)
521 "This produces a note with a stem pointing in @var{dir} direction, with
522 the @var{duration} for the note head type and augmentation dots. For
523 example, @code{\\note #\"4.\" #-0.75} creates a dotted quarter note, with
524 a shortened down stem."
526 (let ((parsed (parse-simple-duration duration)))
527 (note-by-number-markup layout props (car parsed) (cadr parsed) dir)))
529 (def-markup-command (normal-size-super layout props arg) (markup?)
530 "Set @var{arg} in superscript with a normal font size."
532 (ly:stencil-translate-axis (interpret-markup
535 (* 0.5 (chain-assoc-get 'baseline-skip props))
538 (def-markup-command (super layout props arg) (markup?)
541 @cindex lowering text
543 @cindex translating text
545 @cindex @code{\\super}
548 Raising and lowering texts can be done with @code{\\super} and
551 @lilypond[verbatim,fragment,relative=1]
552 c1^\\markup { E \"=\" mc \\super \"2\" }
557 (ly:stencil-translate-axis
560 (cons `((font-size . ,(- (chain-assoc-get 'font-size props 0) 3))) props)
562 (* 0.5 (chain-assoc-get 'baseline-skip props))
565 (def-markup-command (translate layout props offset arg) (number-pair? markup?)
566 "This translates an object. Its first argument is a cons of numbers
568 A \\translate #(cons 2 -3) @{ B C @} D
570 This moves `B C' 2 spaces to the right, and 3 down, relative to its
571 surroundings. This command cannot be used to move isolated scripts
572 vertically, for the same reason that @code{\\raise} cannot be used for
577 (ly:stencil-translate (interpret-markup layout props arg)
580 (def-markup-command (sub layout props arg) (markup?)
581 "Set @var{arg} in subscript."
583 (ly:stencil-translate-axis
586 (cons `((font-size . ,(- (chain-assoc-get 'font-size props 0) 3))) props)
588 (* -0.5 (chain-assoc-get 'baseline-skip props))
591 (def-markup-command (normal-size-sub layout props arg) (markup?)
592 "Set @var{arg} in subscript, in a normal font size."
594 (ly:stencil-translate-axis
595 (interpret-markup layout props arg)
596 (* -0.5 (chain-assoc-get 'baseline-skip props))
599 (def-markup-command (hbracket layout props arg) (markup?)
600 "Draw horizontal brackets around @var{arg}."
601 (let ((th 0.1) ;; todo: take from GROB.
602 (m (interpret-markup layout props arg)))
603 (bracketify-stencil m X th (* 2.5 th) th)))
605 (def-markup-command (bracket layout props arg) (markup?)
606 "Draw vertical brackets around @var{arg}."
607 (let ((th 0.1) ;; todo: take from GROB.
608 (m (interpret-markup layout props arg)))
609 (bracketify-stencil m Y th (* 2.5 th) th)))
611 ;; todo: fix negative space
612 (def-markup-command (hspace layout props amount) (number?)
613 "This produces a invisible object taking horizontal space.
615 \\markup @{ A \\hspace #2.0 B @}
617 will put extra space between A and B, on top of the space that is
618 normally inserted before elements on a line.
621 (ly:make-stencil "" (cons 0 amount) '(-1 . 1) )
622 (ly:make-stencil "" (cons amount amount) '(-1 . 1))))
624 (def-markup-command (override layout props new-prop arg) (pair? markup?)
625 "Add the first argument in to the property list. Properties may be
626 any sort of property supported by @internalsref{font-interface} and
627 @internalsref{text-interface}, for example
630 \\override #'(font-family . married) \"bla\"
634 (interpret-markup layout (cons (list new-prop) props) arg))
636 (def-markup-command (smaller layout props arg) (markup?)
637 "Decrease the font size relative to current setting"
638 (let* ((fs (chain-assoc-get 'font-size props 0))
639 (entry (cons 'font-size (- fs 1))))
640 (interpret-markup layout (cons (list entry) props) arg)))
643 (def-markup-command (bigger layout props arg) (markup?)
644 "Increase the font size relative to current setting"
645 (let* ((fs (chain-assoc-get 'font-size props 0))
646 (entry (cons 'font-size (+ fs 1))))
647 (interpret-markup layout (cons (list entry) props) arg)))
649 (def-markup-command larger (markup?)
653 (def-markup-command (box layout props arg) (markup?)
654 "Draw a box round @var{arg}. Looks at @code{thickness} and
655 @code{box-padding} properties to determine line thickness and padding
657 (let ((th (chain-assoc-get 'thickness props 0.1))
658 (pad (chain-assoc-get 'box-padding props 0.2))
659 (m (interpret-markup layout props arg)))
660 (box-stencil m th pad)))
662 ;FIXME: is this working?
663 (def-markup-command (strut layout props) ()
665 "Create a box of the same height as the space in the current font."
667 (let ((m (Text_interface::interpret_markup layout props " ")))
668 (ly:stencil-set-extent! m X '(1000 . -1000))
671 (define number->mark-letter-vector (make-vector 25 #\A))
676 (if (= i (- (char->integer #\I) (char->integer #\A)))
678 (vector-set! number->mark-letter-vector j
679 (integer->char (+ i (char->integer #\A)))))
681 (define (number->markletter-string n)
682 "Double letters for big marks."
684 ((l (vector-length number->mark-letter-vector)))
687 (string-append (number->markletter-string (1- (quotient n l)))
688 (number->markletter-string (remainder n l)))
689 (make-string 1 (vector-ref number->mark-letter-vector n)))))
692 (def-markup-command (markletter layout props num) (integer?)
693 "Make a markup letter for @var{num}. The letters start with A to Z
694 (skipping I), and continues with double letters."
696 (Text_interface::interpret_markup layout props (number->markletter-string num)))
701 (def-markup-command (bracketed-y-column layout props indices args)
703 "Make a column of the markups in @var{args}, putting brackets around
704 the elements marked in @var{indices}, which is a list of numbers."
706 (define (sublist l start stop)
707 (take (drop l start) (- (1+ stop) start)) )
709 (define (stencil-list-extent ss axis)
711 (apply min (map (lambda (x) (car (ly:stencil-extent x axis))) ss))
712 (apply max (map (lambda (x) (cdr (ly:stencil-extent x axis))) ss))))
714 (define (stack-stencils stencils bskip last-stencil)
716 ((null? stencils) '())
719 (stack-stencils (cdr stencils) bskip (car stencils))))
722 ((orig (car stencils))
723 (dir (chain-assoc-get 'direction props DOWN))
724 (new (ly:stencil-moved-to-edge last-stencil Y dir
729 (cons new (stack-stencils (cdr stencils) bskip new))))
732 (define (make-brackets stencils indices acc)
735 (pair? (cdr indices)))
737 ((encl (sublist stencils (car indices) (cadr indices)))
738 (x-ext (stencil-list-extent encl X))
739 (y-ext (stencil-list-extent encl Y))
742 (protusion (* 2.5 thick))
744 (ly:stencil-translate-axis
745 (ly:bracket Y y-ext thick protusion)
746 (- (car x-ext) pad) X))
747 (rb (ly:stencil-translate-axis
748 (ly:bracket Y y-ext thick (- protusion))
749 (+ (cdr x-ext) pad) X))
753 stencils (cddr indices)
767 (chain-assoc-get 'baseline-skip props))
768 (stacked (stack-stencils stencils 1.25 #f))
769 (brackets (make-brackets stacked indices '()))
772 (apply ly:stencil-add
773 (append stacked brackets)