OLD | NEW |
1 ;;;; This file is part of LilyPond, the GNU music typesetter. | 1 ;;;; This file is part of LilyPond, the GNU music typesetter. |
2 ;;;; | 2 ;;;; |
3 ;;;; Copyright (C) 2000--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> | 3 ;;;; Copyright (C) 2000--2020 Han-Wen Nienhuys <hanwen@xs4all.nl> |
4 ;;;; Jan Nieuwenhuizen <janneke@gnu.org> | 4 ;;;; Jan Nieuwenhuizen <janneke@gnu.org> |
5 ;;;; | 5 ;;;; |
6 ;;;; LilyPond is free software: you can redistribute it and/or modify | 6 ;;;; LilyPond is free software: you can redistribute it and/or modify |
7 ;;;; it under the terms of the GNU General Public License as published by | 7 ;;;; it under the terms of the GNU General Public License as published by |
8 ;;;; the Free Software Foundation, either version 3 of the License, or | 8 ;;;; the Free Software Foundation, either version 3 of the License, or |
9 ;;;; (at your option) any later version. | 9 ;;;; (at your option) any later version. |
10 ;;;; | 10 ;;;; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 (define-public empty-stencil (ly:make-stencil '() | 114 (define-public empty-stencil (ly:make-stencil '() |
115 empty-interval empty-interval)) | 115 empty-interval empty-interval)) |
116 (define-public point-stencil (ly:make-stencil "" '(0 . 0) '(0 . 0))) | 116 (define-public point-stencil (ly:make-stencil "" '(0 . 0) '(0 . 0))) |
117 | 117 |
118 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 118 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
119 ;; line has to come early since it is often used implicitly from the | 119 ;; line has to come early since it is often used implicitly from the |
120 ;; markup macro since \markup { a b c } -> \markup \line { a b c } | 120 ;; markup macro since \markup { a b c } -> \markup \line { a b c } |
121 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 121 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
122 | 122 |
123 (define-markup-command (line layout props args) | 123 (define-markup-command-compilable (line layout props args) |
124 (markup-list?) | 124 (markup-list?) |
125 #:category align | 125 #:category align |
126 #:properties ((word-space) | 126 #:properties ((word-space) |
127 (text-direction RIGHT)) | 127 (text-direction RIGHT)) |
128 "Put @var{args} in a horizontal line. The property @code{word-space} | 128 "Put @var{args} in a horizontal line. The property @code{word-space} |
129 determines the space between markups in @var{args}. | 129 determines the space between markups in @var{args}. |
130 | 130 |
131 @lilypond[verbatim,quote] | 131 @lilypond[verbatim,quote] |
132 \\markup { | 132 \\markup { |
133 \\line { | 133 \\line { |
134 one two three | 134 one two three |
135 } | 135 } |
136 } | 136 } |
137 @end lilypond" | 137 @end lilypond" |
138 (let ((stencils (interpret-markup-list layout props args))) | 138 (let ((stencils (interpret-markup-list layout props args))) |
139 (if (= text-direction LEFT) | 139 (if (= text-direction LEFT) |
140 (set! stencils (reverse stencils))) | 140 (set! stencils (reverse stencils))) |
141 (stack-stencil-line word-space stencils))) | 141 (stack-stencil-line word-space stencils))) |
142 | 142 |
143 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 143 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
144 ;; geometric shapes | 144 ;; geometric shapes |
145 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 145 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
146 | 146 |
147 (define-markup-command (draw-line layout props dest) | 147 (define-markup-command-compilable (draw-line layout props dest) |
148 (number-pair?) | 148 (number-pair?) |
149 #:category graphic | 149 #:category graphic |
150 #:properties ((thickness 1)) | 150 #:properties ((thickness 1)) |
151 " | 151 " |
152 @cindex drawing line, within text | 152 @cindex drawing line, within text |
153 | 153 |
154 A simple line. | 154 A simple line. |
155 @lilypond[verbatim,quote] | 155 @lilypond[verbatim,quote] |
156 \\markup { | 156 \\markup { |
157 \\draw-line #'(4 . 4) | 157 \\draw-line #'(4 . 4) |
158 \\override #'(thickness . 5) | 158 \\override #'(thickness . 5) |
159 \\draw-line #'(-3 . 0) | 159 \\draw-line #'(-3 . 0) |
160 } | 160 } |
161 @end lilypond" | 161 @end lilypond" |
162 (let ((th (* (ly:output-def-lookup layout 'line-thickness) | 162 (let ((th (* (ly:output-def-lookup layout 'line-thickness) |
163 thickness)) | 163 thickness)) |
164 (x (car dest)) | 164 (x (car dest)) |
165 (y (cdr dest))) | 165 (y (cdr dest))) |
166 (make-line-stencil th 0 0 x y))) | 166 (make-line-stencil th 0 0 x y))) |
167 | 167 |
168 (define-markup-command (draw-dashed-line layout props dest) | 168 (define-markup-command-compilable (draw-dashed-line layout props dest) |
169 (number-pair?) | 169 (number-pair?) |
170 #:category graphic | 170 #:category graphic |
171 #:properties ((thickness 1) | 171 #:properties ((thickness 1) |
172 (on 1) | 172 (on 1) |
173 (off 1) | 173 (off 1) |
174 (phase 0) | 174 (phase 0) |
175 (full-length #t)) | 175 (full-length #t)) |
176 " | 176 " |
177 @cindex drawing dashed line, within text | 177 @cindex drawing dashed line, within text |
178 | 178 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 (set! on 1) | 265 (set! on 1) |
266 (set! off 1))) | 266 (set! off 1))) |
267 | 267 |
268 ;; To give the lines produced by \draw-line and \draw-dashed-line the same | 268 ;; To give the lines produced by \draw-line and \draw-dashed-line the same |
269 ;; length, half-thick has to be added to the stencil-extensions. | 269 ;; length, half-thick has to be added to the stencil-extensions. |
270 (ly:make-stencil | 270 (ly:make-stencil |
271 (list 'dashed-line th on off x y phase) | 271 (list 'dashed-line th on off x y phase) |
272 (interval-widen (ordered-cons 0 x) half-thick) | 272 (interval-widen (ordered-cons 0 x) half-thick) |
273 (interval-widen (ordered-cons 0 y) half-thick)))) | 273 (interval-widen (ordered-cons 0 y) half-thick)))) |
274 | 274 |
275 (define-markup-command (draw-dotted-line layout props dest) | 275 (define-markup-command-compilable (draw-dotted-line layout props dest) |
276 (number-pair?) | 276 (number-pair?) |
277 #:category graphic | 277 #:category graphic |
278 #:properties ((thickness 1) | 278 #:properties ((thickness 1) |
279 (off 1) | 279 (off 1) |
280 (phase 0)) | 280 (phase 0)) |
281 " | 281 " |
282 @cindex drawing dotted line, within text | 282 @cindex drawing dotted line, within text |
283 | 283 |
284 A dotted line. | 284 A dotted line. |
285 | 285 |
(...skipping 11 matching lines...) Expand all Loading... |
297 } | 297 } |
298 @end lilypond" | 298 @end lilypond" |
299 | 299 |
300 (let ((new-props (prepend-alist-chain 'on 0 | 300 (let ((new-props (prepend-alist-chain 'on 0 |
301 (prepend-alist-chain 'full-length #t pro
ps)))) | 301 (prepend-alist-chain 'full-length #t pro
ps)))) |
302 | 302 |
303 (interpret-markup layout | 303 (interpret-markup layout |
304 new-props | 304 new-props |
305 (markup #:draw-dashed-line dest)))) | 305 (markup #:draw-dashed-line dest)))) |
306 | 306 |
307 (define-markup-command (draw-squiggle-line layout props sq-length dest eq-end?) | 307 (define-markup-command-compilable (draw-squiggle-line layout props sq-length des
t eq-end?) |
308 (number? number-pair? boolean?) | 308 (number? number-pair? boolean?) |
309 #:category graphic | 309 #:category graphic |
310 #:properties ((thickness 0.5) | 310 #:properties ((thickness 0.5) |
311 (angularity 0) | 311 (angularity 0) |
312 (height 0.5) | 312 (height 0.5) |
313 (orientation 1)) | 313 (orientation 1)) |
314 " | 314 " |
315 @cindex drawing squiggled line, within text | 315 @cindex drawing squiggled line, within text |
316 | 316 |
317 A squiggled line. | 317 A squiggled line. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 (* n (car first-bow-end-coord)) | 378 (* n (car first-bow-end-coord)) |
379 (* n (cdr first-bow-end-coord)))) | 379 (* n (cdr first-bow-end-coord)))) |
380 (iota amount)))) | 380 (iota amount)))) |
381 ;; The final stencil: lined-up bows | 381 ;; The final stencil: lined-up bows |
382 (apply ly:stencil-add | 382 (apply ly:stencil-add |
383 (map | 383 (map |
384 ly:stencil-translate | 384 ly:stencil-translate |
385 (circular-list init-bow-up init-bow-down) | 385 (circular-list init-bow-up init-bow-down) |
386 list-of-starts)))) | 386 list-of-starts)))) |
387 | 387 |
388 (define-markup-command (draw-hline layout props) | 388 (define-markup-command-compilable (draw-hline layout props) |
389 () | 389 () |
390 #:category graphic | 390 #:category graphic |
391 #:properties ((draw-line-markup) | 391 #:properties ((draw-line-markup) |
392 (line-width) | 392 (line-width) |
393 (span-factor 1)) | 393 (span-factor 1)) |
394 " | 394 " |
395 @cindex drawing line, across a page | 395 @cindex drawing line, across a page |
396 | 396 |
397 Draws a line across a page, where the property @code{span-factor} | 397 Draws a line across a page, where the property @code{span-factor} |
398 controls what fraction of the page is taken up. | 398 controls what fraction of the page is taken up. |
399 @lilypond[verbatim,quote] | 399 @lilypond[verbatim,quote] |
400 \\markup { | 400 \\markup { |
401 \\column { | 401 \\column { |
402 \\draw-hline | 402 \\draw-hline |
403 \\override #'(span-factor . 1/3) | 403 \\override #'(span-factor . 1/3) |
404 \\draw-hline | 404 \\draw-hline |
405 } | 405 } |
406 } | 406 } |
407 @end lilypond" | 407 @end lilypond" |
408 (interpret-markup layout | 408 (interpret-markup layout |
409 props | 409 props |
410 (markup #:draw-line (cons (* line-width | 410 (markup #:draw-line (cons (* line-width |
411 span-factor) | 411 span-factor) |
412 0)))) | 412 0)))) |
413 | 413 |
414 (define-markup-command (draw-circle layout props radius thickness filled) | 414 (define-markup-command-compilable (draw-circle layout props radius thickness fil
led) |
415 (number? number? boolean?) | 415 (number? number? boolean?) |
416 #:category graphic | 416 #:category graphic |
417 " | 417 " |
418 @cindex drawing circle, within text | 418 @cindex drawing circle, within text |
419 | 419 |
420 A circle of radius @var{radius} and thickness @var{thickness}, | 420 A circle of radius @var{radius} and thickness @var{thickness}, |
421 optionally filled. | 421 optionally filled. |
422 | 422 |
423 @lilypond[verbatim,quote] | 423 @lilypond[verbatim,quote] |
424 \\markup { | 424 \\markup { |
425 \\draw-circle #2 #0.5 ##f | 425 \\draw-circle #2 #0.5 ##f |
426 \\hspace #2 | 426 \\hspace #2 |
427 \\draw-circle #2 #0 ##t | 427 \\draw-circle #2 #0 ##t |
428 } | 428 } |
429 @end lilypond" | 429 @end lilypond" |
430 (make-circle-stencil radius thickness filled)) | 430 (make-circle-stencil radius thickness filled)) |
431 | 431 |
432 (define-markup-command (triangle layout props filled) | 432 (define-markup-command-compilable (triangle layout props filled) |
433 (boolean?) | 433 (boolean?) |
434 #:category graphic | 434 #:category graphic |
435 #:properties ((thickness 0.1) | 435 #:properties ((thickness 0.1) |
436 (font-size 0) | 436 (font-size 0) |
437 (baseline-skip 2)) | 437 (baseline-skip 2)) |
438 " | 438 " |
439 @cindex drawing triangle, within text | 439 @cindex drawing triangle, within text |
440 | 440 |
441 A triangle, either filled or empty. | 441 A triangle, either filled or empty. |
442 | 442 |
443 @lilypond[verbatim,quote] | 443 @lilypond[verbatim,quote] |
444 \\markup { | 444 \\markup { |
445 \\triangle ##t | 445 \\triangle ##t |
446 \\hspace #2 | 446 \\hspace #2 |
447 \\triangle ##f | 447 \\triangle ##f |
448 } | 448 } |
449 @end lilypond" | 449 @end lilypond" |
450 (let ((ex (* (magstep font-size) 0.8 baseline-skip))) | 450 (let ((ex (* (magstep font-size) 0.8 baseline-skip))) |
451 (ly:make-stencil | 451 (ly:make-stencil |
452 `(polygon '(0.0 0.0 | 452 `(polygon '(0.0 0.0 |
453 ,ex 0.0 | 453 ,ex 0.0 |
454 ,(* 0.5 ex) | 454 ,(* 0.5 ex) |
455 ,(* 0.86 ex)) | 455 ,(* 0.86 ex)) |
456 ,thickness | 456 ,thickness |
457 ,filled) | 457 ,filled) |
458 (cons 0 ex) | 458 (cons 0 ex) |
459 (cons 0 (* .86 ex))))) | 459 (cons 0 (* .86 ex))))) |
460 | 460 |
461 (define-markup-command (circle layout props arg) | 461 (define-markup-command-compilable (circle layout props arg) |
462 (markup?) | 462 (markup?) |
463 #:category graphic | 463 #:category graphic |
464 #:properties ((thickness 1) | 464 #:properties ((thickness 1) |
465 (font-size 0) | 465 (font-size 0) |
466 (circle-padding 0.2)) | 466 (circle-padding 0.2)) |
467 " | 467 " |
468 @cindex circling text | 468 @cindex circling text |
469 | 469 |
470 Draw a circle around @var{arg}. Use @code{thickness}, | 470 Draw a circle around @var{arg}. Use @code{thickness}, |
471 @code{circle-padding} and @code{font-size} properties to determine line | 471 @code{circle-padding} and @code{font-size} properties to determine line |
472 thickness and padding around the markup. | 472 thickness and padding around the markup. |
473 | 473 |
474 @lilypond[verbatim,quote] | 474 @lilypond[verbatim,quote] |
475 \\markup { | 475 \\markup { |
476 \\circle { | 476 \\circle { |
477 Hi | 477 Hi |
478 } | 478 } |
479 } | 479 } |
480 @end lilypond" | 480 @end lilypond" |
481 (let ((th (* (ly:output-def-lookup layout 'line-thickness) | 481 (let ((th (* (ly:output-def-lookup layout 'line-thickness) |
482 thickness)) | 482 thickness)) |
483 (pad (* (magstep font-size) circle-padding)) | 483 (pad (* (magstep font-size) circle-padding)) |
484 (m (interpret-markup layout props arg))) | 484 (m (interpret-markup layout props arg))) |
485 (circle-stencil m th pad))) | 485 (circle-stencil m th pad))) |
486 | 486 |
487 (define-markup-command (ellipse layout props arg) | 487 (define-markup-command-compilable (ellipse layout props arg) |
488 (markup?) | 488 (markup?) |
489 #:category graphic | 489 #:category graphic |
490 #:properties ((thickness 1) | 490 #:properties ((thickness 1) |
491 (font-size 0) | 491 (font-size 0) |
492 (x-padding 0.2) | 492 (x-padding 0.2) |
493 (y-padding 0.2)) | 493 (y-padding 0.2)) |
494 " | 494 " |
495 @cindex drawing ellipse, around text | 495 @cindex drawing ellipse, around text |
496 | 496 |
497 Draw an ellipse around @var{arg}. Use @code{thickness}, | 497 Draw an ellipse around @var{arg}. Use @code{thickness}, |
498 @code{x-padding}, @code{y-padding} and @code{font-size} properties to determine | 498 @code{x-padding}, @code{y-padding} and @code{font-size} properties to determine |
499 line thickness and padding around the markup. | 499 line thickness and padding around the markup. |
500 | 500 |
501 @lilypond[verbatim,quote] | 501 @lilypond[verbatim,quote] |
502 \\markup { | 502 \\markup { |
503 \\ellipse { | 503 \\ellipse { |
504 Hi | 504 Hi |
505 } | 505 } |
506 } | 506 } |
507 @end lilypond" | 507 @end lilypond" |
508 (let ((th (* (ly:output-def-lookup layout 'line-thickness) | 508 (let ((th (* (ly:output-def-lookup layout 'line-thickness) |
509 thickness)) | 509 thickness)) |
510 (pad-x (* (magstep font-size) x-padding)) | 510 (pad-x (* (magstep font-size) x-padding)) |
511 (pad-y (* (magstep font-size) y-padding)) | 511 (pad-y (* (magstep font-size) y-padding)) |
512 (m (interpret-markup layout props arg))) | 512 (m (interpret-markup layout props arg))) |
513 (ellipse-stencil m th pad-x pad-y))) | 513 (ellipse-stencil m th pad-x pad-y))) |
514 | 514 |
515 (define-markup-command (oval layout props arg) | 515 (define-markup-command-compilable (oval layout props arg) |
516 (markup?) | 516 (markup?) |
517 #:category graphic | 517 #:category graphic |
518 #:properties ((thickness 1) | 518 #:properties ((thickness 1) |
519 (font-size 0) | 519 (font-size 0) |
520 (x-padding 0.75) | 520 (x-padding 0.75) |
521 (y-padding 0.75)) | 521 (y-padding 0.75)) |
522 " | 522 " |
523 @cindex drawing oval, around text | 523 @cindex drawing oval, around text |
524 | 524 |
525 Draw an oval around @var{arg}. Use @code{thickness}, | 525 Draw an oval around @var{arg}. Use @code{thickness}, |
526 @code{x-padding}, @code{y-padding} and @code{font-size} properties to determine | 526 @code{x-padding}, @code{y-padding} and @code{font-size} properties to determine |
527 line thickness and padding around the markup. | 527 line thickness and padding around the markup. |
528 | 528 |
529 @lilypond[verbatim,quote] | 529 @lilypond[verbatim,quote] |
530 \\markup { | 530 \\markup { |
531 \\oval { | 531 \\oval { |
532 Hi | 532 Hi |
533 } | 533 } |
534 } | 534 } |
535 @end lilypond" | 535 @end lilypond" |
536 (let ((th (* (ly:output-def-lookup layout 'line-thickness) | 536 (let ((th (* (ly:output-def-lookup layout 'line-thickness) |
537 thickness)) | 537 thickness)) |
538 (pad-x (* (magstep font-size) x-padding)) | 538 (pad-x (* (magstep font-size) x-padding)) |
539 (pad-y (* (magstep font-size) y-padding)) | 539 (pad-y (* (magstep font-size) y-padding)) |
540 (m (interpret-markup layout props arg))) | 540 (m (interpret-markup layout props arg))) |
541 (oval-stencil m th pad-x pad-y))) | 541 (oval-stencil m th pad-x pad-y))) |
542 | 542 |
543 (define-markup-command (with-url layout props url arg) | 543 (define-markup-command-compilable (with-url layout props url arg) |
544 (string? markup?) | 544 (string? markup?) |
545 #:category graphic | 545 #:category graphic |
546 " | 546 " |
547 @cindex inserting URL link, into text | 547 @cindex inserting URL link, into text |
548 | 548 |
549 Add a link to URL @var{url} around @var{arg}. This only works in | 549 Add a link to URL @var{url} around @var{arg}. This only works in |
550 the PDF backend. | 550 the PDF backend. |
551 | 551 |
552 @lilypond[verbatim,quote] | 552 @lilypond[verbatim,quote] |
553 \\markup { | 553 \\markup { |
554 \\with-url #\"http://lilypond.org/\" { | 554 \\with-url #\"http://lilypond.org/\" { |
555 LilyPond ... \\italic { | 555 LilyPond ... \\italic { |
556 music notation for everyone | 556 music notation for everyone |
557 } | 557 } |
558 } | 558 } |
559 } | 559 } |
560 @end lilypond" | 560 @end lilypond" |
561 (let* ((stil (interpret-markup layout props arg)) | 561 (let* ((stil (interpret-markup layout props arg)) |
562 (xextent (ly:stencil-extent stil X)) | 562 (xextent (ly:stencil-extent stil X)) |
563 (yextent (ly:stencil-extent stil Y)) | 563 (yextent (ly:stencil-extent stil Y)) |
564 (old-expr (ly:stencil-expr stil)) | 564 (old-expr (ly:stencil-expr stil)) |
565 (url-expr (list 'url-link url `(quote ,xextent) `(quote ,yextent)))) | 565 (url-expr (list 'url-link url `(quote ,xextent) `(quote ,yextent)))) |
566 | 566 |
567 (ly:stencil-add (ly:make-stencil url-expr xextent yextent) stil))) | 567 (ly:stencil-add (ly:make-stencil url-expr xextent yextent) stil))) |
568 | 568 |
569 (define-markup-command (page-link layout props page-number arg) | 569 (define-markup-command-compilable (page-link layout props page-number arg) |
570 (number? markup?) | 570 (number? markup?) |
571 #:category other | 571 #:category other |
572 " | 572 " |
573 @cindex referencing page number, in text | 573 @cindex referencing page number, in text |
574 | 574 |
575 Add a link to the page @var{page-number} around @var{arg}. This only works | 575 Add a link to the page @var{page-number} around @var{arg}. This only works |
576 in the PDF backend. | 576 in the PDF backend. |
577 | 577 |
578 @lilypond[verbatim,quote] | 578 @lilypond[verbatim,quote] |
579 \\markup { | 579 \\markup { |
(...skipping 11 matching lines...) Expand all Loading... |
591 (define-public (book-first-page layout props) | 591 (define-public (book-first-page layout props) |
592 "Return the @code{'first-page-number} of the entire book" | 592 "Return the @code{'first-page-number} of the entire book" |
593 (define (ancestor layout) | 593 (define (ancestor layout) |
594 "Return the topmost layout ancestor" | 594 "Return the topmost layout ancestor" |
595 (let ((parent (ly:output-def-parent layout))) | 595 (let ((parent (ly:output-def-parent layout))) |
596 (if (not (ly:output-def? parent)) | 596 (if (not (ly:output-def? parent)) |
597 layout | 597 layout |
598 (ancestor parent)))) | 598 (ancestor parent)))) |
599 (ly:output-def-lookup (ancestor layout) 'first-page-number)) | 599 (ly:output-def-lookup (ancestor layout) 'first-page-number)) |
600 | 600 |
601 (define-markup-command (with-link layout props label arg) | 601 (define-markup-command-compilable (with-link layout props label arg) |
602 (symbol? markup?) | 602 (symbol? markup?) |
603 #:category other | 603 #:category other |
604 " | 604 " |
605 @cindex referencing page label, in text | 605 @cindex referencing page label, in text |
606 | 606 |
607 Add a link to the page holding label @var{label} around @var{arg}. This | 607 Add a link to the page holding label @var{label} around @var{arg}. This |
608 only works in the PDF backend. | 608 only works in the PDF backend. |
609 | 609 |
610 @lilypond[verbatim,quote] | 610 @lilypond[verbatim,quote] |
611 \\markup { | 611 \\markup { |
(...skipping 17 matching lines...) Expand all Loading... |
629 (current-page-number | 629 (current-page-number |
630 (if table-page-number | 630 (if table-page-number |
631 (1+ (- table-page-number first-page-number)) | 631 (1+ (- table-page-number first-page-number)) |
632 #f))) | 632 #f))) |
633 (list 'page-link current-page-number | 633 (list 'page-link current-page-number |
634 `(quote ,x-ext) `(quote ,y-ext))))) | 634 `(quote ,x-ext) `(quote ,y-ext))))) |
635 x-ext | 635 x-ext |
636 y-ext) | 636 y-ext) |
637 arg-stencil))) | 637 arg-stencil))) |
638 | 638 |
639 (define-markup-command (beam layout props width slope thickness) | 639 (define-markup-command-compilable (beam layout props width slope thickness) |
640 (number? number? number?) | 640 (number? number? number?) |
641 #:category graphic | 641 #:category graphic |
642 " | 642 " |
643 @cindex drawing beam, within text | 643 @cindex drawing beam, within text |
644 | 644 |
645 Create a beam with the specified parameters. | 645 Create a beam with the specified parameters. |
646 @lilypond[verbatim,quote] | 646 @lilypond[verbatim,quote] |
647 \\markup { | 647 \\markup { |
648 \\beam #5 #1 #2 | 648 \\beam #5 #1 #2 |
649 } | 649 } |
650 @end lilypond" | 650 @end lilypond" |
651 (let* ((y (* slope width)) | 651 (let* ((y (* slope width)) |
652 (yext (cons (min 0 y) (max 0 y))) | 652 (yext (cons (min 0 y) (max 0 y))) |
653 (half (/ thickness 2))) | 653 (half (/ thickness 2))) |
654 | 654 |
655 (ly:make-stencil | 655 (ly:make-stencil |
656 `(polygon ',(list | 656 `(polygon ',(list |
657 0 (/ thickness -2) | 657 0 (/ thickness -2) |
658 width (+ (* width slope) (/ thickness -2)) | 658 width (+ (* width slope) (/ thickness -2)) |
659 width (+ (* width slope) (/ thickness 2)) | 659 width (+ (* width slope) (/ thickness 2)) |
660 0 (/ thickness 2)) | 660 0 (/ thickness 2)) |
661 ,(ly:output-def-lookup layout 'blot-diameter) | 661 ,(ly:output-def-lookup layout 'blot-diameter) |
662 #t) | 662 #t) |
663 (cons 0 width) | 663 (cons 0 width) |
664 (cons (+ (- half) (car yext)) | 664 (cons (+ (- half) (car yext)) |
665 (+ half (cdr yext)))))) | 665 (+ half (cdr yext)))))) |
666 | 666 |
667 (define-markup-command (underline layout props arg) | 667 (define-markup-command-compilable (underline layout props arg) |
668 (markup?) | 668 (markup?) |
669 #:category font | 669 #:category font |
670 #:properties ((thickness 1) (offset 2) (underline-shift 0) (underline-skip 2)) | 670 #:properties ((thickness 1) (offset 2) (underline-shift 0) (underline-skip 2)) |
671 " | 671 " |
672 @cindex underlining text | 672 @cindex underlining text |
673 | 673 |
674 Underline @var{arg}. Looks at @code{thickness} to determine line | 674 Underline @var{arg}. Looks at @code{thickness} to determine line |
675 thickness, @code{offset} to determine line y-offset from @var{arg} and | 675 thickness, @code{offset} to determine line y-offset from @var{arg} and |
676 @code{underline-skip} to determine the distance of additional lines from the | 676 @code{underline-skip} to determine the distance of additional lines from the |
677 others. | 677 others. |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
725 ;; (+ x1 (/ underline-thick 2)) | 725 ;; (+ x1 (/ underline-thick 2)) |
726 ;; y | 726 ;; y |
727 ;; (- x2 (/ underline-thick 2)) | 727 ;; (- x2 (/ underline-thick 2)) |
728 ;; y)) | 728 ;; y)) |
729 ;; without need to reset x-extent, this causes a different ugliness | 729 ;; without need to reset x-extent, this causes a different ugliness |
730 ;; for huge thickness, though. | 730 ;; for huge thickness, though. |
731 arg-x-ext | 731 arg-x-ext |
732 (ly:stencil-extent raw-line-stil Y)))) | 732 (ly:stencil-extent raw-line-stil Y)))) |
733 (ly:stencil-add m line))) | 733 (ly:stencil-add m line))) |
734 | 734 |
735 (define-markup-command (tie layout props arg) | 735 (define-markup-command-compilable (tie layout props arg) |
736 (markup?) | 736 (markup?) |
737 #:category font | 737 #:category font |
738 #:properties ((thickness 1) | 738 #:properties ((thickness 1) |
739 (offset 2) | 739 (offset 2) |
740 (direction UP) | 740 (direction UP) |
741 (height-limit 0.7) | 741 (height-limit 0.7) |
742 (shorten-pair '(0 . 0))) | 742 (shorten-pair '(0 . 0))) |
743 " | 743 " |
744 @cindex tie-ing text | 744 @cindex tie-ing text |
745 | 745 |
(...skipping 30 matching lines...) Expand all Loading... |
776 (cons (- x2 (cdr shorten-pair) line-thickness) y) | 776 (cons (- x2 (cdr shorten-pair) line-thickness) y) |
777 thick | 777 thick |
778 direction | 778 direction |
779 ;; For usage in text we choose a little less `height-limit' | 779 ;; For usage in text we choose a little less `height-limit' |
780 ;; than the default for `Tie', i.e 0.7 (see properties above) | 780 ;; than the default for `Tie', i.e 0.7 (see properties above) |
781 ;; TODO add the other optional arguments of `make-tie-stencil' | 781 ;; TODO add the other optional arguments of `make-tie-stencil' |
782 ;; i.e. `ratio' and `angularity' ? | 782 ;; i.e. `ratio' and `angularity' ? |
783 height-limit))) | 783 height-limit))) |
784 (ly:stencil-add stil tie))) | 784 (ly:stencil-add stil tie))) |
785 | 785 |
786 (define-markup-command (undertie layout props arg) | 786 (define-markup-command-compilable (undertie layout props arg) |
787 (markup?) | 787 (markup?) |
788 #:category font | 788 #:category font |
789 #:properties (tie-markup) | 789 #:properties (tie-markup) |
790 " | 790 " |
791 @cindex undertie-ing text | 791 @cindex undertie-ing text |
792 | 792 |
793 @lilypond[verbatim,quote] | 793 @lilypond[verbatim,quote] |
794 \\markup \\line { | 794 \\markup \\line { |
795 \\undertie \"undertied\" | 795 \\undertie \"undertied\" |
796 \\override #'((offset . 5) (thickness . 1)) | 796 \\override #'((offset . 5) (thickness . 1)) |
797 \\undertie \"undertied\" | 797 \\undertie \"undertied\" |
798 \\override #'((offset . 1) (thickness . 5)) | 798 \\override #'((offset . 1) (thickness . 5)) |
799 \\undertie \"undertied\" | 799 \\undertie \"undertied\" |
800 } | 800 } |
801 @end lilypond" | 801 @end lilypond" |
802 (interpret-markup layout (prepend-alist-chain 'direction DOWN props) | 802 (interpret-markup layout (prepend-alist-chain 'direction DOWN props) |
803 (make-tie-markup arg))) | 803 (make-tie-markup arg))) |
804 | 804 |
805 (define-markup-command (overtie layout props arg) | 805 (define-markup-command-compilable (overtie layout props arg) |
806 (markup?) | 806 (markup?) |
807 #:category font | 807 #:category font |
808 #:properties (tie-markup) | 808 #:properties (tie-markup) |
809 " | 809 " |
810 @cindex overtie-ing text | 810 @cindex overtie-ing text |
811 | 811 |
812 Overtie @var{arg}. | 812 Overtie @var{arg}. |
813 | 813 |
814 @lilypond[verbatim,quote] | 814 @lilypond[verbatim,quote] |
815 \\markup \\line { | 815 \\markup \\line { |
816 \\overtie \"overtied\" | 816 \\overtie \"overtied\" |
817 \\override #'((offset . 5) (thickness . 1)) | 817 \\override #'((offset . 5) (thickness . 1)) |
818 \\overtie \"overtied\" | 818 \\overtie \"overtied\" |
819 \\override #'((offset . 1) (thickness . 5)) | 819 \\override #'((offset . 1) (thickness . 5)) |
820 \\overtie \"overtied\" | 820 \\overtie \"overtied\" |
821 } | 821 } |
822 @end lilypond" | 822 @end lilypond" |
823 (interpret-markup layout (prepend-alist-chain 'direction UP props) | 823 (interpret-markup layout (prepend-alist-chain 'direction UP props) |
824 (make-tie-markup arg))) | 824 (make-tie-markup arg))) |
825 | 825 |
826 (define-markup-command (box layout props arg) | 826 (define-markup-command-compilable (box layout props arg) |
827 (markup?) | 827 (markup?) |
828 #:category font | 828 #:category font |
829 #:properties ((thickness 1) | 829 #:properties ((thickness 1) |
830 (font-size 0) | 830 (font-size 0) |
831 (box-padding 0.2)) | 831 (box-padding 0.2)) |
832 " | 832 " |
833 @cindex enclosing text within a box | 833 @cindex enclosing text within a box |
834 | 834 |
835 Draw a box round @var{arg}. Looks at @code{thickness}, | 835 Draw a box round @var{arg}. Looks at @code{thickness}, |
836 @code{box-padding} and @code{font-size} properties to determine line | 836 @code{box-padding} and @code{font-size} properties to determine line |
837 thickness and padding around the markup. | 837 thickness and padding around the markup. |
838 | 838 |
839 @lilypond[verbatim,quote] | 839 @lilypond[verbatim,quote] |
840 \\markup { | 840 \\markup { |
841 \\override #'(box-padding . 0.5) | 841 \\override #'(box-padding . 0.5) |
842 \\box | 842 \\box |
843 \\line { V. S. } | 843 \\line { V. S. } |
844 } | 844 } |
845 @end lilypond" | 845 @end lilypond" |
846 (let* ((th (* (ly:output-def-lookup layout 'line-thickness) | 846 (let* ((th (* (ly:output-def-lookup layout 'line-thickness) |
847 thickness)) | 847 thickness)) |
848 (pad (* (magstep font-size) box-padding)) | 848 (pad (* (magstep font-size) box-padding)) |
849 (m (interpret-markup layout props arg))) | 849 (m (interpret-markup layout props arg))) |
850 (box-stencil m th pad))) | 850 (box-stencil m th pad))) |
851 | 851 |
852 (define-markup-command (filled-box layout props xext yext blot) | 852 (define-markup-command-compilable (filled-box layout props xext yext blot) |
853 (number-pair? number-pair? number?) | 853 (number-pair? number-pair? number?) |
854 #:category graphic | 854 #:category graphic |
855 " | 855 " |
856 @cindex drawing solid box, within text | 856 @cindex drawing solid box, within text |
857 @cindex drawing box, with rounded corners | 857 @cindex drawing box, with rounded corners |
858 | 858 |
859 Draw a box with rounded corners of dimensions @var{xext} and | 859 Draw a box with rounded corners of dimensions @var{xext} and |
860 @var{yext}. For example, | 860 @var{yext}. For example, |
861 @verbatim | 861 @verbatim |
862 \\filled-box #'(-.3 . 1.8) #'(-.3 . 1.8) #0 | 862 \\filled-box #'(-.3 . 1.8) #'(-.3 . 1.8) #0 |
863 @end verbatim | 863 @end verbatim |
864 creates a box extending horizontally from -0.3 to 1.8 and | 864 creates a box extending horizontally from -0.3 to 1.8 and |
865 vertically from -0.3 up to 1.8, with corners formed from a | 865 vertically from -0.3 up to 1.8, with corners formed from a |
866 circle of diameter@tie{}0 (i.e., sharp corners). | 866 circle of diameter@tie{}0 (i.e., sharp corners). |
867 | 867 |
868 @lilypond[verbatim,quote] | 868 @lilypond[verbatim,quote] |
869 \\markup { | 869 \\markup { |
870 \\filled-box #'(0 . 4) #'(0 . 4) #0 | 870 \\filled-box #'(0 . 4) #'(0 . 4) #0 |
871 \\filled-box #'(0 . 2) #'(-4 . 2) #0.4 | 871 \\filled-box #'(0 . 2) #'(-4 . 2) #0.4 |
872 \\filled-box #'(1 . 8) #'(0 . 7) #0.2 | 872 \\filled-box #'(1 . 8) #'(0 . 7) #0.2 |
873 \\with-color #white | 873 \\with-color #white |
874 \\filled-box #'(-4.5 . -2.5) #'(3.5 . 5.5) #0.7 | 874 \\filled-box #'(-4.5 . -2.5) #'(3.5 . 5.5) #0.7 |
875 } | 875 } |
876 @end lilypond" | 876 @end lilypond" |
877 (ly:round-filled-box | 877 (ly:round-filled-box |
878 xext yext blot)) | 878 xext yext blot)) |
879 | 879 |
880 (define-markup-command (rounded-box layout props arg) | 880 (define-markup-command-compilable (rounded-box layout props arg) |
881 (markup?) | 881 (markup?) |
882 #:category graphic | 882 #:category graphic |
883 #:properties ((thickness 1) | 883 #:properties ((thickness 1) |
884 (corner-radius 1) | 884 (corner-radius 1) |
885 (font-size 0) | 885 (font-size 0) |
886 (box-padding 0.5)) | 886 (box-padding 0.5)) |
887 "@cindex enclosing text in box, with rounded corners | 887 "@cindex enclosing text in box, with rounded corners |
888 @cindex drawing box, with rounded corners, around text | 888 @cindex drawing box, with rounded corners, around text |
889 Draw a box with rounded corners around @var{arg}. Looks at @code{thickness}, | 889 Draw a box with rounded corners around @var{arg}. Looks at @code{thickness}, |
890 @code{box-padding} and @code{font-size} properties to determine line | 890 @code{box-padding} and @code{font-size} properties to determine line |
891 thickness and padding around the markup; the @code{corner-radius} property | 891 thickness and padding around the markup; the @code{corner-radius} property |
892 makes it possible to define another shape for the corners (default is 1). | 892 makes it possible to define another shape for the corners (default is 1). |
893 | 893 |
894 @lilypond[quote,verbatim,relative=2] | 894 @lilypond[quote,verbatim,relative=2] |
895 c4^\\markup { | 895 c4^\\markup { |
896 \\rounded-box { | 896 \\rounded-box { |
897 Overtura | 897 Overtura |
898 } | 898 } |
899 } | 899 } |
900 c,8. c16 c4 r | 900 c,8. c16 c4 r |
901 @end lilypond" | 901 @end lilypond" |
902 (let ((th (* (ly:output-def-lookup layout 'line-thickness) | 902 (let ((th (* (ly:output-def-lookup layout 'line-thickness) |
903 thickness)) | 903 thickness)) |
904 (pad (* (magstep font-size) box-padding)) | 904 (pad (* (magstep font-size) box-padding)) |
905 (m (interpret-markup layout props arg))) | 905 (m (interpret-markup layout props arg))) |
906 (ly:stencil-add (rounded-box-stencil m th pad corner-radius) | 906 (ly:stencil-add (rounded-box-stencil m th pad corner-radius) |
907 m))) | 907 m))) |
908 | 908 |
909 (define-markup-command (rotate layout props ang arg) | 909 (define-markup-command-compilable (rotate layout props ang arg) |
910 (number? markup?) | 910 (number? markup?) |
911 #:category align | 911 #:category align |
912 " | 912 " |
913 @cindex rotating text | 913 @cindex rotating text |
914 | 914 |
915 Rotate object with @var{ang} degrees around its center. | 915 Rotate object with @var{ang} degrees around its center. |
916 | 916 |
917 @lilypond[verbatim,quote] | 917 @lilypond[verbatim,quote] |
918 \\markup { | 918 \\markup { |
919 default | 919 default |
920 \\hspace #2 | 920 \\hspace #2 |
921 \\rotate #45 | 921 \\rotate #45 |
922 \\line { | 922 \\line { |
923 rotated 45° | 923 rotated 45° |
924 } | 924 } |
925 } | 925 } |
926 @end lilypond" | 926 @end lilypond" |
927 (let* ((stil (interpret-markup layout props arg))) | 927 (let* ((stil (interpret-markup layout props arg))) |
928 (ly:stencil-rotate stil ang 0 0))) | 928 (ly:stencil-rotate stil ang 0 0))) |
929 | 929 |
930 (define-markup-command (whiteout layout props arg) | 930 (define-markup-command-compilable (whiteout layout props arg) |
931 (markup?) | 931 (markup?) |
932 #:category other | 932 #:category other |
933 #:properties ((style 'box) | 933 #:properties ((style 'box) |
934 (thickness '())) | 934 (thickness '())) |
935 " | 935 " |
936 @cindex adding white background, to text | 936 @cindex adding white background, to text |
937 | 937 |
938 Provide a white background for @var{arg}. The shape of the white | 938 Provide a white background for @var{arg}. The shape of the white |
939 background is determined by @code{style}. The default | 939 background is determined by @code{style}. The default |
940 is @code{box} which produces a rectangle. @code{rounded-box} | 940 is @code{box} which produces a rectangle. @code{rounded-box} |
(...skipping 19 matching lines...) Expand all Loading... |
960 \\override #'((style . outline) (thickness . 3)) | 960 \\override #'((style . outline) (thickness . 3)) |
961 \\whiteout whiteout-outline | 961 \\whiteout whiteout-outline |
962 } | 962 } |
963 @end lilypond" | 963 @end lilypond" |
964 (stencil-whiteout | 964 (stencil-whiteout |
965 (interpret-markup layout props arg) | 965 (interpret-markup layout props arg) |
966 style | 966 style |
967 thickness | 967 thickness |
968 (ly:output-def-lookup layout 'line-thickness))) | 968 (ly:output-def-lookup layout 'line-thickness))) |
969 | 969 |
970 (define-markup-command (pad-markup layout props amount arg) | 970 (define-markup-command-compilable (pad-markup layout props amount arg) |
971 (number? markup?) | 971 (number? markup?) |
972 #:category align | 972 #:category align |
973 " | 973 " |
974 @cindex padding text | 974 @cindex padding text |
975 @cindex putting space around text | 975 @cindex putting space around text |
976 | 976 |
977 Add space around a markup object. | 977 Add space around a markup object. |
978 Identical to @code{pad-around}. | 978 Identical to @code{pad-around}. |
979 | 979 |
980 @lilypond[verbatim,quote] | 980 @lilypond[verbatim,quote] |
(...skipping 12 matching lines...) Expand all Loading... |
993 (let* ((m (interpret-markup layout props arg)) | 993 (let* ((m (interpret-markup layout props arg)) |
994 (x (interval-widen (ly:stencil-extent m X) amount)) | 994 (x (interval-widen (ly:stencil-extent m X) amount)) |
995 (y (interval-widen (ly:stencil-extent m Y) amount))) | 995 (y (interval-widen (ly:stencil-extent m Y) amount))) |
996 (ly:stencil-add (make-transparent-box-stencil x y) | 996 (ly:stencil-add (make-transparent-box-stencil x y) |
997 m))) | 997 m))) |
998 | 998 |
999 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 999 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1000 ;; space | 1000 ;; space |
1001 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1001 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1002 | 1002 |
1003 (define-markup-command (strut layout props) | 1003 (define-markup-command-compilable (strut layout props) |
1004 () | 1004 () |
1005 #:category other | 1005 #:category other |
1006 " | 1006 " |
1007 @cindex creating vertical space, in text | 1007 @cindex creating vertical space, in text |
1008 | 1008 |
1009 Create a box of the same height as the space in the current font." | 1009 Create a box of the same height as the space in the current font." |
1010 (let ((m (ly:text-interface::interpret-markup layout props " "))) | 1010 (let ((m (ly:text-interface::interpret-markup layout props " "))) |
1011 (ly:make-stencil (ly:stencil-expr m) | 1011 (ly:make-stencil (ly:stencil-expr m) |
1012 '(0 . 0) | 1012 '(0 . 0) |
1013 (ly:stencil-extent m X) | 1013 (ly:stencil-extent m X) |
1014 ))) | 1014 ))) |
1015 | 1015 |
1016 (define-markup-command (hspace layout props amount) | 1016 (define-markup-command-compilable (hspace layout props amount) |
1017 (number?) | 1017 (number?) |
1018 #:category align | 1018 #:category align |
1019 " | 1019 " |
1020 @cindex creating horizontal space, in text | 1020 @cindex creating horizontal space, in text |
1021 | 1021 |
1022 Create an invisible object taking up horizontal space @var{amount}. | 1022 Create an invisible object taking up horizontal space @var{amount}. |
1023 | 1023 |
1024 @lilypond[verbatim,quote] | 1024 @lilypond[verbatim,quote] |
1025 \\markup { | 1025 \\markup { |
1026 one | 1026 one |
1027 \\hspace #2 | 1027 \\hspace #2 |
1028 two | 1028 two |
1029 \\hspace #8 | 1029 \\hspace #8 |
1030 three | 1030 three |
1031 } | 1031 } |
1032 @end lilypond" | 1032 @end lilypond" |
1033 (ly:make-stencil "" (cons 0 amount) empty-interval)) | 1033 (ly:make-stencil "" (cons 0 amount) empty-interval)) |
1034 | 1034 |
1035 (define-markup-command (vspace layout props amount) | 1035 (define-markup-command-compilable (vspace layout props amount) |
1036 (number?) | 1036 (number?) |
1037 #:category align | 1037 #:category align |
1038 " | 1038 " |
1039 @cindex creating vertical space, in text | 1039 @cindex creating vertical space, in text |
1040 | 1040 |
1041 Create an invisible object taking up vertical space | 1041 Create an invisible object taking up vertical space |
1042 of @var{amount} multiplied by 3. | 1042 of @var{amount} multiplied by 3. |
1043 | 1043 |
1044 @lilypond[verbatim,quote] | 1044 @lilypond[verbatim,quote] |
1045 \\markup { | 1045 \\markup { |
1046 \\center-column { | 1046 \\center-column { |
1047 one | 1047 one |
1048 \\vspace #2 | 1048 \\vspace #2 |
1049 two | 1049 two |
1050 \\vspace #5 | 1050 \\vspace #5 |
1051 three | 1051 three |
1052 } | 1052 } |
1053 } | 1053 } |
1054 @end lilypond" | 1054 @end lilypond" |
1055 (let ((amount (* amount 3.0))) | 1055 (let ((amount (* amount 3.0))) |
1056 (ly:make-stencil "" empty-interval (cons 0 amount)))) | 1056 (ly:make-stencil "" empty-interval (cons 0 amount)))) |
1057 | 1057 |
1058 | 1058 |
1059 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1059 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1060 ;; importing graphics. | 1060 ;; importing graphics. |
1061 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1061 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1062 | 1062 |
1063 (define-markup-command (stencil layout props stil) | 1063 (define-markup-command-compilable (stencil layout props stil) |
1064 (ly:stencil?) | 1064 (ly:stencil?) |
1065 #:category other | 1065 #:category other |
1066 " | 1066 " |
1067 @cindex importing stencil, into text | 1067 @cindex importing stencil, into text |
1068 | 1068 |
1069 Use a stencil as markup. | 1069 Use a stencil as markup. |
1070 | 1070 |
1071 @lilypond[verbatim,quote] | 1071 @lilypond[verbatim,quote] |
1072 \\markup { | 1072 \\markup { |
1073 \\stencil #(make-circle-stencil 2 0 #t) | 1073 \\stencil #(make-circle-stencil 2 0 #t) |
1074 } | 1074 } |
1075 @end lilypond" | 1075 @end lilypond" |
1076 stil) | 1076 stil) |
1077 | 1077 |
1078 (define bbox-regexp | 1078 (define bbox-regexp |
1079 (make-regexp "%%BoundingBox:[ \t]+([0-9-]+)[ \t]+([0-9-]+)[ \t]+([0-9-]+)[ \t]
+([0-9-]+)")) | 1079 (make-regexp "%%BoundingBox:[ \t]+([0-9-]+)[ \t]+([0-9-]+)[ \t]+([0-9-]+)[ \t]
+([0-9-]+)")) |
1080 | 1080 |
1081 (define (get-postscript-bbox string) | 1081 (define (get-postscript-bbox string) |
1082 "Extract the bbox from STRING, or return #f if not present." | 1082 "Extract the bbox from STRING, or return #f if not present." |
1083 (let* | 1083 (let* |
1084 ((match (regexp-exec bbox-regexp string))) | 1084 ((match (regexp-exec bbox-regexp string))) |
1085 | 1085 |
1086 (if match | 1086 (if match |
1087 (map (lambda (x) | 1087 (map (lambda (x) |
1088 (string->number (match:substring match x))) | 1088 (string->number (match:substring match x))) |
1089 (cdr (iota 5))) | 1089 (cdr (iota 5))) |
1090 | 1090 |
1091 #f))) | 1091 #f))) |
1092 | 1092 |
1093 (define-markup-command (epsfile layout props axis size file-name) | 1093 (define-markup-command-compilable (epsfile layout props axis size file-name) |
1094 (number? number? string?) | 1094 (number? number? string?) |
1095 #:category graphic | 1095 #:category graphic |
1096 " | 1096 " |
1097 @cindex inlining an Encapsulated PostScript image | 1097 @cindex inlining an Encapsulated PostScript image |
1098 | 1098 |
1099 Inline an EPS image. The image is scaled along @var{axis} to | 1099 Inline an EPS image. The image is scaled along @var{axis} to |
1100 @var{size}. | 1100 @var{size}. |
1101 | 1101 |
1102 @lilypond[verbatim,quote] | 1102 @lilypond[verbatim,quote] |
1103 \\markup { | 1103 \\markup { |
1104 \\general-align #Y #DOWN { | 1104 \\general-align #Y #DOWN { |
1105 \\epsfile #X #20 #\"context-example.eps\" | 1105 \\epsfile #X #20 #\"context-example.eps\" |
1106 \\epsfile #Y #20 #\"context-example.eps\" | 1106 \\epsfile #Y #20 #\"context-example.eps\" |
1107 } | 1107 } |
1108 } | 1108 } |
1109 @end lilypond" | 1109 @end lilypond" |
1110 (if (ly:get-option 'safe) | 1110 (if (ly:get-option 'safe) |
1111 (interpret-markup layout props "not allowed in safe") | 1111 (interpret-markup layout props "not allowed in safe") |
1112 (eps-file->stencil axis size file-name) | 1112 (eps-file->stencil axis size file-name) |
1113 )) | 1113 )) |
1114 | 1114 |
1115 (define-markup-command (postscript layout props str) | 1115 (define-markup-command-compilable (postscript layout props str) |
1116 (string?) | 1116 (string?) |
1117 #:category graphic | 1117 #:category graphic |
1118 " | 1118 " |
1119 @cindex inserting PostScript directly, into text | 1119 @cindex inserting PostScript directly, into text |
1120 This inserts @var{str} directly into the output as a PostScript | 1120 This inserts @var{str} directly into the output as a PostScript |
1121 command string. | 1121 command string. |
1122 | 1122 |
1123 @lilypond[verbatim,quote] | 1123 @lilypond[verbatim,quote] |
1124 ringsps = #\" | 1124 ringsps = #\" |
1125 0.15 setlinewidth | 1125 0.15 setlinewidth |
(...skipping 19 matching lines...) Expand all Loading... |
1145 (list 'embedded-ps | 1145 (list 'embedded-ps |
1146 (format #f " | 1146 (format #f " |
1147 gsave currentpoint translate | 1147 gsave currentpoint translate |
1148 0.1 setlinewidth | 1148 0.1 setlinewidth |
1149 ~a | 1149 ~a |
1150 grestore | 1150 grestore |
1151 " | 1151 " |
1152 str)) | 1152 str)) |
1153 '(0 . 0) '(0 . 0))) | 1153 '(0 . 0) '(0 . 0))) |
1154 | 1154 |
1155 (define-markup-command (path layout props thickness commands) (number? list?) | 1155 (define-markup-command-compilable (path layout props thickness commands) (number
? list?) |
1156 #:category graphic | 1156 #:category graphic |
1157 #:properties ((line-cap-style 'round) | 1157 #:properties ((line-cap-style 'round) |
1158 (line-join-style 'round) | 1158 (line-join-style 'round) |
1159 (filled #f)) | 1159 (filled #f)) |
1160 " | 1160 " |
1161 @cindex path, drawing | 1161 @cindex path, drawing |
1162 @cindex drawing path | 1162 @cindex drawing path |
1163 Draws a path with line @var{thickness} according to the | 1163 Draws a path with line @var{thickness} according to the |
1164 directions given in @var{commands}. @var{commands} is a list of | 1164 directions given in @var{commands}. @var{commands} is a list of |
1165 lists where the @code{car} of each sublist is a drawing command and | 1165 lists where the @code{car} of each sublist is a drawing command and |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1301 ;; the first system is the baseline of the score | 1301 ;; the first system is the baseline of the score |
1302 (ly:stencil-translate-axis | 1302 (ly:stencil-translate-axis |
1303 (paper-system-stencil paper-system) | 1303 (paper-system-stencil paper-system) |
1304 (- (car (paper-system-staff-extents paper-system))) | 1304 (- (car (paper-system-staff-extents paper-system))) |
1305 Y)) | 1305 Y)) |
1306 (vector->list (ly:paper-score-paper-systems output))) | 1306 (vector->list (ly:paper-score-paper-systems output))) |
1307 (begin | 1307 (begin |
1308 (ly:warning (_"no systems found in \\score markup, does it have a \\la
yout block?")) | 1308 (ly:warning (_"no systems found in \\score markup, does it have a \\la
yout block?")) |
1309 '())))) | 1309 '())))) |
1310 | 1310 |
1311 (define-markup-command (score layout props score) | 1311 (define-markup-command-compilable (score layout props score) |
1312 (ly:score?) | 1312 (ly:score?) |
1313 #:category music | 1313 #:category music |
1314 #:properties ((baseline-skip)) | 1314 #:properties ((baseline-skip)) |
1315 " | 1315 " |
1316 @cindex inserting music, into text | 1316 @cindex inserting music, into text |
1317 | 1317 |
1318 Inline an image of music. The reference point (usually the middle | 1318 Inline an image of music. The reference point (usually the middle |
1319 staff line) of the lowest staff in the top system is placed on the | 1319 staff line) of the lowest staff in the top system is placed on the |
1320 baseline. | 1320 baseline. |
1321 | 1321 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1355 \\override TimeSignature.break-align-anchor-alignment = | 1355 \\override TimeSignature.break-align-anchor-alignment = |
1356 #LEFT | 1356 #LEFT |
1357 } | 1357 } |
1358 } | 1358 } |
1359 } | 1359 } |
1360 } | 1360 } |
1361 @end lilypond" | 1361 @end lilypond" |
1362 (stack-stencils Y DOWN baseline-skip | 1362 (stack-stencils Y DOWN baseline-skip |
1363 (score-lines-markup-list layout props score))) | 1363 (score-lines-markup-list layout props score))) |
1364 | 1364 |
1365 (define-markup-command (null layout props) | 1365 (define-markup-command-compilable (null layout props) |
1366 () | 1366 () |
1367 #:category other | 1367 #:category other |
1368 " | 1368 " |
1369 @cindex creating empty text object | 1369 @cindex creating empty text object |
1370 | 1370 |
1371 An empty markup with extents of a single point. | 1371 An empty markup with extents of a single point. |
1372 | 1372 |
1373 @lilypond[verbatim,quote] | 1373 @lilypond[verbatim,quote] |
1374 \\markup { | 1374 \\markup { |
1375 \\null | 1375 \\null |
1376 } | 1376 } |
1377 @end lilypond" | 1377 @end lilypond" |
1378 point-stencil) | 1378 point-stencil) |
1379 | 1379 |
1380 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1380 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1381 ;; basic formatting. | 1381 ;; basic formatting. |
1382 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 1382 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1383 | 1383 |
1384 (define-markup-command (simple layout props str) | 1384 (define-markup-command-compilable (simple layout props str) |
1385 (string?) | 1385 (string?) |
1386 #:category font | 1386 #:category font |
1387 " | 1387 " |
1388 @cindex simple text string | 1388 @cindex simple text string |
1389 | 1389 |
1390 A simple text string; @code{\\markup @{ foo @}} is equivalent with | 1390 A simple text string; @code{\\markup @{ foo @}} is equivalent with |
1391 @code{\\markup @{ \\simple #\"foo\" @}}. | 1391 @code{\\markup @{ \\simple #\"foo\" @}}. |
1392 | 1392 |
1393 Note: for creating standard text markup or defining new markup commands, | 1393 Note: for creating standard text markup or defining new markup commands, |
1394 the use of @code{\\simple} is unnecessary. | 1394 the use of @code{\\simple} is unnecessary. |
1395 | 1395 |
1396 @lilypond[verbatim,quote] | 1396 @lilypond[verbatim,quote] |
1397 \\markup { | 1397 \\markup { |
1398 \\simple #\"simple\" | 1398 \\simple #\"simple\" |
1399 \\simple #\"text\" | 1399 \\simple #\"text\" |
1400 \\simple #\"strings\" | 1400 \\simple #\"strings\" |
1401 } | 1401 } |
1402 @end lilypond" | 1402 @end lilypond" |
1403 (interpret-markup layout props str)) | 1403 (interpret-markup layout props str)) |
1404 | 1404 |
1405 (define-markup-command (first-visible layout props args) | 1405 (define-markup-command-compilable (first-visible layout props args) |
1406 (markup-list?) | 1406 (markup-list?) |
1407 #:category other | 1407 #:category other |
1408 "Use the first markup in @var{args} that yields a non-empty stencil | 1408 "Use the first markup in @var{args} that yields a non-empty stencil |
1409 and ignore the rest. | 1409 and ignore the rest. |
1410 | 1410 |
1411 @lilypond[verbatim,quote] | 1411 @lilypond[verbatim,quote] |
1412 \\markup { | 1412 \\markup { |
1413 \\first-visible { | 1413 \\first-visible { |
1414 \\fromproperty #'header:composer | 1414 \\fromproperty #'header:composer |
1415 \\italic Unknown | 1415 \\italic Unknown |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1538 ;; first stencil had negative X-extent (e.g. center-column) | 1538 ;; first stencil had negative X-extent (e.g. center-column) |
1539 ;; (if word-count = 1, X-extents are already normalized in | 1539 ;; (if word-count = 1, X-extents are already normalized in |
1540 ;; the definition of line-contents) | 1540 ;; the definition of line-contents) |
1541 (set! line-contents | 1541 (set! line-contents |
1542 (ly:stencil-translate-axis | 1542 (ly:stencil-translate-axis |
1543 line-contents | 1543 line-contents |
1544 (- (car (ly:stencil-extent (car stencils) X))) | 1544 (- (car (ly:stencil-extent (car stencils) X))) |
1545 X))) | 1545 X))) |
1546 line-contents)))) | 1546 line-contents)))) |
1547 | 1547 |
1548 (define-markup-command (fill-line layout props args) | 1548 (define-markup-command-compilable (fill-line layout props args) |
1549 (markup-list?) | 1549 (markup-list?) |
1550 #:category align | 1550 #:category align |
1551 #:properties ((text-direction RIGHT) | 1551 #:properties ((text-direction RIGHT) |
1552 (word-space 0.6) | 1552 (word-space 0.6) |
1553 (line-width #f)) | 1553 (line-width #f)) |
1554 "Put @var{markups} in a horizontal line of width @var{line-width}. | 1554 "Put @var{markups} in a horizontal line of width @var{line-width}. |
1555 The markups are spaced or flushed to fill the entire line. | 1555 The markups are spaced or flushed to fill the entire line. |
1556 If there are no arguments, return an empty stencil. | 1556 If there are no arguments, return an empty stencil. |
1557 | 1557 |
1558 @lilypond[verbatim,quote] | 1558 @lilypond[verbatim,quote] |
(...skipping 14 matching lines...) Expand all Loading... |
1573 \\override #'(line-width . 50) | 1573 \\override #'(line-width . 50) |
1574 \\fill-line { | 1574 \\fill-line { |
1575 Width explicitly specified | 1575 Width explicitly specified |
1576 } | 1576 } |
1577 } | 1577 } |
1578 } | 1578 } |
1579 @end lilypond" | 1579 @end lilypond" |
1580 (justify-line-helper | 1580 (justify-line-helper |
1581 layout props args text-direction word-space line-width #f)) | 1581 layout props args text-direction word-space line-width #f)) |
1582 | 1582 |
1583 (define-markup-command (justify-line layout props args) | 1583 (define-markup-command-compilable (justify-line layout props args) |
1584 (markup-list?) | 1584 (markup-list?) |
1585 #:category align | 1585 #:category align |
1586 #:properties ((text-direction RIGHT) | 1586 #:properties ((text-direction RIGHT) |
1587 (word-space 0.6) | 1587 (word-space 0.6) |
1588 (line-width #f)) | 1588 (line-width #f)) |
1589 "Put @var{markups} in a horizontal line of width @var{line-width}. | 1589 "Put @var{markups} in a horizontal line of width @var{line-width}. |
1590 The markups are spread to fill the entire line and separated by equal | 1590 The markups are spread to fill the entire line and separated by equal |
1591 space. If there are no arguments, return an empty stencil. | 1591 space. If there are no arguments, return an empty stencil. |
1592 | 1592 |
1593 @lilypond[verbatim,quote] | 1593 @lilypond[verbatim,quote] |
1594 \\markup { | 1594 \\markup { |
1595 \\justify-line { | 1595 \\justify-line { |
1596 Space between neighboring words is constant | 1596 Space between neighboring words is constant |
1597 } | 1597 } |
1598 } | 1598 } |
1599 @end lilypond" | 1599 @end lilypond" |
1600 (justify-line-helper | 1600 (justify-line-helper |
1601 layout props args text-direction word-space line-width #t)) | 1601 layout props args text-direction word-space line-width #t)) |
1602 | 1602 |
1603 (define-markup-command (concat layout props args) | 1603 (define-markup-command-compilable (concat layout props args) |
1604 (markup-list?) | 1604 (markup-list?) |
1605 #:category align | 1605 #:category align |
1606 " | 1606 " |
1607 @cindex concatenating text | 1607 @cindex concatenating text |
1608 @cindex ligature, in text | 1608 @cindex ligature, in text |
1609 | 1609 |
1610 Concatenate @var{args} in a horizontal line, without spaces in between. | 1610 Concatenate @var{args} in a horizontal line, without spaces in between. |
1611 Strings and simple markups are concatenated on the input level, allowing | 1611 Strings and simple markups are concatenated on the input level, allowing |
1612 ligatures. For example, @code{\\concat @{ \"f\" \\simple #\"i\" @}} is | 1612 ligatures. For example, @code{\\concat @{ \"f\" \\simple #\"i\" @}} is |
1613 equivalent to @code{\"fi\"}. | 1613 equivalent to @code{\"fi\"}. |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1740 (word-space) | 1740 (word-space) |
1741 (text-direction RIGHT)) | 1741 (text-direction RIGHT)) |
1742 "Internal markup list command used to define @code{\\justify} and @code{\\word
wrap}." | 1742 "Internal markup list command used to define @code{\\justify} and @code{\\word
wrap}." |
1743 (wordwrap-stencils (interpret-markup-list layout props args) | 1743 (wordwrap-stencils (interpret-markup-list layout props args) |
1744 justify | 1744 justify |
1745 word-space | 1745 word-space |
1746 (or line-width | 1746 (or line-width |
1747 (ly:output-def-lookup layout 'line-width)) | 1747 (ly:output-def-lookup layout 'line-width)) |
1748 text-direction)) | 1748 text-direction)) |
1749 | 1749 |
1750 (define-markup-command (justify layout props args) | 1750 (define-markup-command-compilable (justify layout props args) |
1751 (markup-list?) | 1751 (markup-list?) |
1752 #:category align | 1752 #:category align |
1753 #:properties ((baseline-skip) | 1753 #:properties ((baseline-skip) |
1754 wordwrap-internal-markup-list) | 1754 wordwrap-internal-markup-list) |
1755 " | 1755 " |
1756 @cindex justifying text | 1756 @cindex justifying text |
1757 | 1757 |
1758 Like @code{\\wordwrap}, but with lines stretched to justify the margins. | 1758 Like @code{\\wordwrap}, but with lines stretched to justify the margins. |
1759 Use @code{\\override #'(line-width . @var{X})} to set the line width; | 1759 Use @code{\\override #'(line-width . @var{X})} to set the line width; |
1760 @var{X}@tie{}is the number of staff spaces. | 1760 @var{X}@tie{}is the number of staff spaces. |
1761 | 1761 |
1762 @lilypond[verbatim,quote] | 1762 @lilypond[verbatim,quote] |
1763 \\markup { | 1763 \\markup { |
1764 \\justify { | 1764 \\justify { |
1765 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed | 1765 Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed |
1766 do eiusmod tempor incididunt ut labore et dolore magna aliqua. | 1766 do eiusmod tempor incididunt ut labore et dolore magna aliqua. |
1767 Ut enim ad minim veniam, quis nostrud exercitation ullamco | 1767 Ut enim ad minim veniam, quis nostrud exercitation ullamco |
1768 laboris nisi ut aliquip ex ea commodo consequat. | 1768 laboris nisi ut aliquip ex ea commodo consequat. |
1769 } | 1769 } |
1770 } | 1770 } |
1771 @end lilypond" | 1771 @end lilypond" |
1772 (stack-lines DOWN 0.0 baseline-skip | 1772 (stack-lines DOWN 0.0 baseline-skip |
1773 (wordwrap-internal-markup-list layout props #t args))) | 1773 (wordwrap-internal-markup-list layout props #t args))) |
1774 | 1774 |
1775 (define-markup-command (wordwrap layout props args) | 1775 (define-markup-command-compilable (wordwrap layout props args) |
1776 (markup-list?) | 1776 (markup-list?) |
1777 #:category align | 1777 #:category align |
1778 #:properties ((baseline-skip) | 1778 #:properties ((baseline-skip) |
1779 wordwrap-internal-markup-list) | 1779 wordwrap-internal-markup-list) |
1780 "Simple wordwrap. Use @code{\\override #'(line-width . @var{X})} to set | 1780 "Simple wordwrap. Use @code{\\override #'(line-width . @var{X})} to set |
1781 the line width, where @var{X} is the number of staff spaces. | 1781 the line width, where @var{X} is the number of staff spaces. |
1782 | 1782 |
1783 @lilypond[verbatim,quote] | 1783 @lilypond[verbatim,quote] |
1784 \\markup { | 1784 \\markup { |
1785 \\wordwrap { | 1785 \\wordwrap { |
(...skipping 26 matching lines...) Expand all Loading... |
1812 (let* ((stencils | 1812 (let* ((stencils |
1813 (map (lambda (x) | 1813 (map (lambda (x) |
1814 (interpret-markup layout props x)) | 1814 (interpret-markup layout props x)) |
1815 words))) | 1815 words))) |
1816 (wordwrap-stencils stencils | 1816 (wordwrap-stencils stencils |
1817 justify word-space | 1817 justify word-space |
1818 line-width text-direction))) | 1818 line-width text-direction))) |
1819 list-para-words))) | 1819 list-para-words))) |
1820 (concatenate para-lines))) | 1820 (concatenate para-lines))) |
1821 | 1821 |
1822 (define-markup-command (wordwrap-string layout props arg) | 1822 (define-markup-command-compilable (wordwrap-string layout props arg) |
1823 (string?) | 1823 (string?) |
1824 #:category align | 1824 #:category align |
1825 #:properties ((baseline-skip) | 1825 #:properties ((baseline-skip) |
1826 wordwrap-string-internal-markup-list) | 1826 wordwrap-string-internal-markup-list) |
1827 "Wordwrap a string. Paragraphs may be separated with double newlines. | 1827 "Wordwrap a string. Paragraphs may be separated with double newlines. |
1828 | 1828 |
1829 @lilypond[verbatim,quote] | 1829 @lilypond[verbatim,quote] |
1830 \\markup { | 1830 \\markup { |
1831 \\override #'(line-width . 40) | 1831 \\override #'(line-width . 40) |
1832 \\wordwrap-string #\"Lorem ipsum dolor sit amet, consectetur | 1832 \\wordwrap-string #\"Lorem ipsum dolor sit amet, consectetur |
1833 adipisicing elit, sed do eiusmod tempor incididunt ut labore | 1833 adipisicing elit, sed do eiusmod tempor incididunt ut labore |
1834 et dolore magna aliqua. | 1834 et dolore magna aliqua. |
1835 | 1835 |
1836 | 1836 |
1837 Ut enim ad minim veniam, quis nostrud exercitation ullamco | 1837 Ut enim ad minim veniam, quis nostrud exercitation ullamco |
1838 laboris nisi ut aliquip ex ea commodo consequat. | 1838 laboris nisi ut aliquip ex ea commodo consequat. |
1839 | 1839 |
1840 | 1840 |
1841 Excepteur sint occaecat cupidatat non proident, sunt in culpa | 1841 Excepteur sint occaecat cupidatat non proident, sunt in culpa |
1842 qui officia deserunt mollit anim id est laborum\" | 1842 qui officia deserunt mollit anim id est laborum\" |
1843 } | 1843 } |
1844 @end lilypond" | 1844 @end lilypond" |
1845 (stack-lines DOWN 0.0 baseline-skip | 1845 (stack-lines DOWN 0.0 baseline-skip |
1846 (wordwrap-string-internal-markup-list layout props #f arg))) | 1846 (wordwrap-string-internal-markup-list layout props #f arg))) |
1847 | 1847 |
1848 (define-markup-command (justify-string layout props arg) | 1848 (define-markup-command-compilable (justify-string layout props arg) |
1849 (string?) | 1849 (string?) |
1850 #:category align | 1850 #:category align |
1851 #:properties ((baseline-skip) | 1851 #:properties ((baseline-skip) |
1852 wordwrap-string-internal-markup-list) | 1852 wordwrap-string-internal-markup-list) |
1853 "Justify a string. Paragraphs may be separated with double newlines | 1853 "Justify a string. Paragraphs may be separated with double newlines |
1854 | 1854 |
1855 @lilypond[verbatim,quote] | 1855 @lilypond[verbatim,quote] |
1856 \\markup { | 1856 \\markup { |
1857 \\override #'(line-width . 40) | 1857 \\override #'(line-width . 40) |
1858 \\justify-string #\"Lorem ipsum dolor sit amet, consectetur | 1858 \\justify-string #\"Lorem ipsum dolor sit amet, consectetur |
1859 adipisicing elit, sed do eiusmod tempor incididunt ut labore | 1859 adipisicing elit, sed do eiusmod tempor incididunt ut labore |
1860 et dolore magna aliqua. | 1860 et dolore magna aliqua. |
1861 | 1861 |
1862 | 1862 |
1863 Ut enim ad minim veniam, quis nostrud exercitation ullamco | 1863 Ut enim ad minim veniam, quis nostrud exercitation ullamco |
1864 laboris nisi ut aliquip ex ea commodo consequat. | 1864 laboris nisi ut aliquip ex ea commodo consequat. |
1865 | 1865 |
1866 | 1866 |
1867 Excepteur sint occaecat cupidatat non proident, sunt in culpa | 1867 Excepteur sint occaecat cupidatat non proident, sunt in culpa |
1868 qui officia deserunt mollit anim id est laborum\" | 1868 qui officia deserunt mollit anim id est laborum\" |
1869 } | 1869 } |
1870 @end lilypond" | 1870 @end lilypond" |
1871 (stack-lines DOWN 0.0 baseline-skip | 1871 (stack-lines DOWN 0.0 baseline-skip |
1872 (wordwrap-string-internal-markup-list layout props #t arg))) | 1872 (wordwrap-string-internal-markup-list layout props #t arg))) |
1873 | 1873 |
1874 (define-markup-command (wordwrap-field layout props symbol) | 1874 (define-markup-command-compilable (wordwrap-field layout props symbol) |
1875 (symbol?) | 1875 (symbol?) |
1876 #:category align | 1876 #:category align |
1877 "Wordwrap the data which has been assigned to @var{symbol}. | 1877 "Wordwrap the data which has been assigned to @var{symbol}. |
1878 | 1878 |
1879 @lilypond[verbatim,quote] | 1879 @lilypond[verbatim,quote] |
1880 \\header { | 1880 \\header { |
1881 title = \"My title\" | 1881 title = \"My title\" |
1882 myText = \"Lorem ipsum dolor sit amet, consectetur adipisicing | 1882 myText = \"Lorem ipsum dolor sit amet, consectetur adipisicing |
1883 elit, sed do eiusmod tempor incididunt ut labore et dolore | 1883 elit, sed do eiusmod tempor incididunt ut labore et dolore |
1884 magna aliqua. Ut enim ad minim veniam, quis nostrud | 1884 magna aliqua. Ut enim ad minim veniam, quis nostrud |
(...skipping 13 matching lines...) Expand all Loading... |
1898 | 1898 |
1899 \\markup { | 1899 \\markup { |
1900 \\null | 1900 \\null |
1901 } | 1901 } |
1902 @end lilypond" | 1902 @end lilypond" |
1903 (let* ((m (chain-assoc-get symbol props))) | 1903 (let* ((m (chain-assoc-get symbol props))) |
1904 (if (string? m) | 1904 (if (string? m) |
1905 (wordwrap-string-markup layout props m) | 1905 (wordwrap-string-markup layout props m) |
1906 empty-stencil))) | 1906 empty-stencil))) |
1907 | 1907 |
1908 (define-markup-command (justify-field layout props symbol) | 1908 (define-markup-command-compilable (justify-field layout props symbol) |
1909 (symbol?) | 1909 (symbol?) |
1910 #:category align | 1910 #:category align |
1911 "Justify the data which has been assigned to @var{symbol}. | 1911 "Justify the data which has been assigned to @var{symbol}. |
1912 | 1912 |
1913 @lilypond[verbatim,quote] | 1913 @lilypond[verbatim,quote] |
1914 \\header { | 1914 \\header { |
1915 title = \"My title\" | 1915 title = \"My title\" |
1916 myText = \"Lorem ipsum dolor sit amet, consectetur adipisicing | 1916 myText = \"Lorem ipsum dolor sit amet, consectetur adipisicing |
1917 elit, sed do eiusmod tempor incididunt ut labore et dolore magna | 1917 elit, sed do eiusmod tempor incididunt ut labore et dolore magna |
1918 aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco | 1918 aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco |
(...skipping 12 matching lines...) Expand all Loading... |
1931 | 1931 |
1932 \\markup { | 1932 \\markup { |
1933 \\null | 1933 \\null |
1934 } | 1934 } |
1935 @end lilypond" | 1935 @end lilypond" |
1936 (let* ((m (chain-assoc-get symbol props))) | 1936 (let* ((m (chain-assoc-get symbol props))) |
1937 (if (string? m) | 1937 (if (string? m) |
1938 (justify-string-markup layout props m) | 1938 (justify-string-markup layout props m) |
1939 empty-stencil))) | 1939 empty-stencil))) |
1940 | 1940 |
1941 (define-markup-command (combine layout props arg1 arg2) | 1941 (define-markup-command-compilable (combine layout props arg1 arg2) |
1942 (markup? markup?) | 1942 (markup? markup?) |
1943 #:category align | 1943 #:category align |
1944 " | 1944 " |
1945 @cindex merging text | 1945 @cindex merging text |
1946 | 1946 |
1947 Print two markups on top of each other. | 1947 Print two markups on top of each other. |
1948 | 1948 |
1949 Note: @code{\\combine} cannot take a list of markups enclosed in | 1949 Note: @code{\\combine} cannot take a list of markups enclosed in |
1950 curly braces as an argument; for this purpose use @code{\\overlay} instead. | 1950 curly braces as an argument; for this purpose use @code{\\overlay} instead. |
1951 | 1951 |
1952 @lilypond[verbatim,quote] | 1952 @lilypond[verbatim,quote] |
1953 \\markup { | 1953 \\markup { |
1954 \\fontsize #5 | 1954 \\fontsize #5 |
1955 \\override #'(thickness . 2) | 1955 \\override #'(thickness . 2) |
1956 \\combine | 1956 \\combine |
1957 \\draw-line #'(0 . 4) | 1957 \\draw-line #'(0 . 4) |
1958 \\arrow-head #Y #DOWN ##f | 1958 \\arrow-head #Y #DOWN ##f |
1959 } | 1959 } |
1960 @end lilypond" | 1960 @end lilypond" |
1961 (let* ((s1 (interpret-markup layout props arg1)) | 1961 (let* ((s1 (interpret-markup layout props arg1)) |
1962 (s2 (interpret-markup layout props arg2))) | 1962 (s2 (interpret-markup layout props arg2))) |
1963 (ly:stencil-add s1 s2))) | 1963 (ly:stencil-add s1 s2))) |
1964 | 1964 |
1965 (define-markup-command (overlay layout props args) | 1965 (define-markup-command-compilable (overlay layout props args) |
1966 (markup-list?) | 1966 (markup-list?) |
1967 #:category align | 1967 #:category align |
1968 " | 1968 " |
1969 @cindex merging text | 1969 @cindex merging text |
1970 | 1970 |
1971 Takes a list of markups combining them. | 1971 Takes a list of markups combining them. |
1972 | 1972 |
1973 @lilypond[verbatim,quote] | 1973 @lilypond[verbatim,quote] |
1974 \\markup { | 1974 \\markup { |
1975 \\fontsize #5 | 1975 \\fontsize #5 |
1976 \\override #'(thickness . 2) | 1976 \\override #'(thickness . 2) |
1977 \\overlay { | 1977 \\overlay { |
1978 \\draw-line #'(0 . 4) | 1978 \\draw-line #'(0 . 4) |
1979 \\arrow-head #Y #DOWN ##f | 1979 \\arrow-head #Y #DOWN ##f |
1980 \\translate #'(0 . 4)\\arrow-head #Y #UP ##f | 1980 \\translate #'(0 . 4)\\arrow-head #Y #UP ##f |
1981 } | 1981 } |
1982 } | 1982 } |
1983 @end lilypond" | 1983 @end lilypond" |
1984 (apply ly:stencil-add (interpret-markup-list layout props args))) | 1984 (apply ly:stencil-add (interpret-markup-list layout props args))) |
1985 | 1985 |
1986 ;; | 1986 ;; |
1987 ;; TODO: should extract baseline-skip from each argument somehow.. | 1987 ;; TODO: should extract baseline-skip from each argument somehow.. |
1988 ;; | 1988 ;; |
1989 (define-markup-command (column layout props args) | 1989 (define-markup-command-compilable (column layout props args) |
1990 (markup-list?) | 1990 (markup-list?) |
1991 #:category align | 1991 #:category align |
1992 #:properties ((baseline-skip)) | 1992 #:properties ((baseline-skip)) |
1993 " | 1993 " |
1994 @cindex stacking text in a column | 1994 @cindex stacking text in a column |
1995 | 1995 |
1996 Stack the markups in @var{args} vertically. The property | 1996 Stack the markups in @var{args} vertically. The property |
1997 @code{baseline-skip} determines the space between markups | 1997 @code{baseline-skip} determines the space between markups |
1998 in @var{args}. | 1998 in @var{args}. |
1999 | 1999 |
2000 @lilypond[verbatim,quote] | 2000 @lilypond[verbatim,quote] |
2001 \\markup { | 2001 \\markup { |
2002 \\column { | 2002 \\column { |
2003 one | 2003 one |
2004 two | 2004 two |
2005 three | 2005 three |
2006 } | 2006 } |
2007 } | 2007 } |
2008 @end lilypond" | 2008 @end lilypond" |
2009 (let ((arg-stencils (interpret-markup-list layout props args))) | 2009 (let ((arg-stencils (interpret-markup-list layout props args))) |
2010 (stack-lines -1 0.0 baseline-skip arg-stencils))) | 2010 (stack-lines -1 0.0 baseline-skip arg-stencils))) |
2011 | 2011 |
2012 (define-markup-command (dir-column layout props args) | 2012 (define-markup-command-compilable (dir-column layout props args) |
2013 (markup-list?) | 2013 (markup-list?) |
2014 #:category align | 2014 #:category align |
2015 #:properties ((direction) | 2015 #:properties ((direction) |
2016 (baseline-skip)) | 2016 (baseline-skip)) |
2017 " | 2017 " |
2018 @cindex changing direction of text column | 2018 @cindex changing direction of text column |
2019 | 2019 |
2020 Make a column of @var{args}, going up or down, depending on the | 2020 Make a column of @var{args}, going up or down, depending on the |
2021 setting of the @code{direction} layout property. | 2021 setting of the @code{direction} layout property. |
2022 | 2022 |
(...skipping 26 matching lines...) Expand all Loading... |
2049 (stacked-stencil (stack-lines -1 0.0 baseline aligned-mols)) | 2049 (stacked-stencil (stack-lines -1 0.0 baseline aligned-mols)) |
2050 (stacked-extent (ly:stencil-extent stacked-stencil X))) | 2050 (stacked-extent (ly:stencil-extent stacked-stencil X))) |
2051 ;; empty stencils are not moved | 2051 ;; empty stencils are not moved |
2052 (if (interval-sane? stacked-extent) | 2052 (if (interval-sane? stacked-extent) |
2053 (ly:stencil-translate-axis | 2053 (ly:stencil-translate-axis |
2054 stacked-stencil | 2054 stacked-stencil |
2055 (- (car stacked-extent)) | 2055 (- (car stacked-extent)) |
2056 X) | 2056 X) |
2057 stacked-stencil))) | 2057 stacked-stencil))) |
2058 | 2058 |
2059 (define-markup-command (center-column layout props args) | 2059 (define-markup-command-compilable (center-column layout props args) |
2060 (markup-list?) | 2060 (markup-list?) |
2061 #:category align | 2061 #:category align |
2062 #:properties ((baseline-skip)) | 2062 #:properties ((baseline-skip)) |
2063 " | 2063 " |
2064 @cindex centering column of text | 2064 @cindex centering column of text |
2065 | 2065 |
2066 Put @code{args} in a centered column. | 2066 Put @code{args} in a centered column. |
2067 | 2067 |
2068 @lilypond[verbatim,quote] | 2068 @lilypond[verbatim,quote] |
2069 \\markup { | 2069 \\markup { |
2070 \\center-column { | 2070 \\center-column { |
2071 one | 2071 one |
2072 two | 2072 two |
2073 three | 2073 three |
2074 } | 2074 } |
2075 } | 2075 } |
2076 @end lilypond" | 2076 @end lilypond" |
2077 (general-column CENTER baseline-skip (interpret-markup-list layout props args)
)) | 2077 (general-column CENTER baseline-skip (interpret-markup-list layout props args)
)) |
2078 | 2078 |
2079 (define-markup-command (left-column layout props args) | 2079 (define-markup-command-compilable (left-column layout props args) |
2080 (markup-list?) | 2080 (markup-list?) |
2081 #:category align | 2081 #:category align |
2082 #:properties ((baseline-skip)) | 2082 #:properties ((baseline-skip)) |
2083 " | 2083 " |
2084 @cindex text column, left-aligned | 2084 @cindex text column, left-aligned |
2085 | 2085 |
2086 Put @code{args} in a left-aligned column. | 2086 Put @code{args} in a left-aligned column. |
2087 | 2087 |
2088 @lilypond[verbatim,quote] | 2088 @lilypond[verbatim,quote] |
2089 \\markup { | 2089 \\markup { |
2090 \\left-column { | 2090 \\left-column { |
2091 one | 2091 one |
2092 two | 2092 two |
2093 three | 2093 three |
2094 } | 2094 } |
2095 } | 2095 } |
2096 @end lilypond" | 2096 @end lilypond" |
2097 (general-column LEFT baseline-skip (interpret-markup-list layout props args))) | 2097 (general-column LEFT baseline-skip (interpret-markup-list layout props args))) |
2098 | 2098 |
2099 (define-markup-command (right-column layout props args) | 2099 (define-markup-command-compilable (right-column layout props args) |
2100 (markup-list?) | 2100 (markup-list?) |
2101 #:category align | 2101 #:category align |
2102 #:properties ((baseline-skip)) | 2102 #:properties ((baseline-skip)) |
2103 " | 2103 " |
2104 @cindex text column, right-aligned | 2104 @cindex text column, right-aligned |
2105 | 2105 |
2106 Put @code{args} in a right-aligned column. | 2106 Put @code{args} in a right-aligned column. |
2107 | 2107 |
2108 @lilypond[verbatim,quote] | 2108 @lilypond[verbatim,quote] |
2109 \\markup { | 2109 \\markup { |
2110 \\right-column { | 2110 \\right-column { |
2111 one | 2111 one |
2112 two | 2112 two |
2113 three | 2113 three |
2114 } | 2114 } |
2115 } | 2115 } |
2116 @end lilypond" | 2116 @end lilypond" |
2117 (general-column RIGHT baseline-skip (interpret-markup-list layout props args))
) | 2117 (general-column RIGHT baseline-skip (interpret-markup-list layout props args))
) |
2118 | 2118 |
2119 (define-markup-command (vcenter layout props arg) | 2119 (define-markup-command-compilable (vcenter layout props arg) |
2120 (markup?) | 2120 (markup?) |
2121 #:category align | 2121 #:category align |
2122 " | 2122 " |
2123 @cindex vertically centering text | 2123 @cindex vertically centering text |
2124 | 2124 |
2125 Align @code{arg} to its Y@tie{}center. | 2125 Align @code{arg} to its Y@tie{}center. |
2126 | 2126 |
2127 @lilypond[verbatim,quote] | 2127 @lilypond[verbatim,quote] |
2128 \\markup { | 2128 \\markup { |
2129 one | 2129 one |
2130 \\vcenter | 2130 \\vcenter |
2131 two | 2131 two |
2132 three | 2132 three |
2133 } | 2133 } |
2134 @end lilypond" | 2134 @end lilypond" |
2135 (let* ((mol (interpret-markup layout props arg))) | 2135 (let* ((mol (interpret-markup layout props arg))) |
2136 (ly:stencil-aligned-to mol Y CENTER))) | 2136 (ly:stencil-aligned-to mol Y CENTER))) |
2137 | 2137 |
2138 (define-markup-command (center-align layout props arg) | 2138 (define-markup-command-compilable (center-align layout props arg) |
2139 (markup?) | 2139 (markup?) |
2140 #:category align | 2140 #:category align |
2141 " | 2141 " |
2142 @cindex horizontally centering text | 2142 @cindex horizontally centering text |
2143 | 2143 |
2144 Align @code{arg} to its X@tie{}center. | 2144 Align @code{arg} to its X@tie{}center. |
2145 | 2145 |
2146 @lilypond[verbatim,quote] | 2146 @lilypond[verbatim,quote] |
2147 \\markup { | 2147 \\markup { |
2148 \\column { | 2148 \\column { |
2149 one | 2149 one |
2150 \\center-align | 2150 \\center-align |
2151 two | 2151 two |
2152 three | 2152 three |
2153 } | 2153 } |
2154 } | 2154 } |
2155 @end lilypond" | 2155 @end lilypond" |
2156 (let* ((mol (interpret-markup layout props arg))) | 2156 (let* ((mol (interpret-markup layout props arg))) |
2157 (ly:stencil-aligned-to mol X CENTER))) | 2157 (ly:stencil-aligned-to mol X CENTER))) |
2158 | 2158 |
2159 (define-markup-command (right-align layout props arg) | 2159 (define-markup-command-compilable (right-align layout props arg) |
2160 (markup?) | 2160 (markup?) |
2161 #:category align | 2161 #:category align |
2162 " | 2162 " |
2163 @cindex right-aligning text | 2163 @cindex right-aligning text |
2164 | 2164 |
2165 Align @var{arg} on its right edge. | 2165 Align @var{arg} on its right edge. |
2166 | 2166 |
2167 @lilypond[verbatim,quote] | 2167 @lilypond[verbatim,quote] |
2168 \\markup { | 2168 \\markup { |
2169 \\column { | 2169 \\column { |
2170 one | 2170 one |
2171 \\right-align | 2171 \\right-align |
2172 two | 2172 two |
2173 three | 2173 three |
2174 } | 2174 } |
2175 } | 2175 } |
2176 @end lilypond" | 2176 @end lilypond" |
2177 (let* ((m (interpret-markup layout props arg))) | 2177 (let* ((m (interpret-markup layout props arg))) |
2178 (ly:stencil-aligned-to m X RIGHT))) | 2178 (ly:stencil-aligned-to m X RIGHT))) |
2179 | 2179 |
2180 (define-markup-command (left-align layout props arg) | 2180 (define-markup-command-compilable (left-align layout props arg) |
2181 (markup?) | 2181 (markup?) |
2182 #:category align | 2182 #:category align |
2183 " | 2183 " |
2184 @cindex left-aligning text | 2184 @cindex left-aligning text |
2185 | 2185 |
2186 Align @var{arg} on its left edge. | 2186 Align @var{arg} on its left edge. |
2187 | 2187 |
2188 @lilypond[verbatim,quote] | 2188 @lilypond[verbatim,quote] |
2189 \\markup { | 2189 \\markup { |
2190 \\column { | 2190 \\column { |
2191 one | 2191 one |
2192 \\left-align | 2192 \\left-align |
2193 two | 2193 two |
2194 three | 2194 three |
2195 } | 2195 } |
2196 } | 2196 } |
2197 @end lilypond" | 2197 @end lilypond" |
2198 (let* ((m (interpret-markup layout props arg))) | 2198 (let* ((m (interpret-markup layout props arg))) |
2199 (ly:stencil-aligned-to m X LEFT))) | 2199 (ly:stencil-aligned-to m X LEFT))) |
2200 | 2200 |
2201 (define-markup-command (general-align layout props axis dir arg) | 2201 (define-markup-command-compilable (general-align layout props axis dir arg) |
2202 (integer? number? markup?) | 2202 (integer? number? markup?) |
2203 #:category align | 2203 #:category align |
2204 " | 2204 " |
2205 @cindex controlling general text alignment | 2205 @cindex controlling general text alignment |
2206 | 2206 |
2207 Align @var{arg} in @var{axis} direction to the @var{dir} side. | 2207 Align @var{arg} in @var{axis} direction to the @var{dir} side. |
2208 | 2208 |
2209 @lilypond[verbatim,quote] | 2209 @lilypond[verbatim,quote] |
2210 \\markup { | 2210 \\markup { |
2211 \\column { | 2211 \\column { |
(...skipping 19 matching lines...) Expand all Loading... |
2231 \\general-align #Y #3.2 | 2231 \\general-align #Y #3.2 |
2232 two | 2232 two |
2233 three | 2233 three |
2234 } | 2234 } |
2235 } | 2235 } |
2236 } | 2236 } |
2237 @end lilypond" | 2237 @end lilypond" |
2238 (let* ((m (interpret-markup layout props arg))) | 2238 (let* ((m (interpret-markup layout props arg))) |
2239 (ly:stencil-aligned-to m axis dir))) | 2239 (ly:stencil-aligned-to m axis dir))) |
2240 | 2240 |
2241 (define-markup-command (halign layout props dir arg) | 2241 (define-markup-command-compilable (halign layout props dir arg) |
2242 (number? markup?) | 2242 (number? markup?) |
2243 #:category align | 2243 #:category align |
2244 " | 2244 " |
2245 @cindex setting horizontal text alignment | 2245 @cindex setting horizontal text alignment |
2246 | 2246 |
2247 Set horizontal alignment. If @var{dir} is @w{@code{-1}}, then it is | 2247 Set horizontal alignment. If @var{dir} is @w{@code{-1}}, then it is |
2248 left-aligned, while @code{+1} is right. Values in between interpolate | 2248 left-aligned, while @code{+1} is right. Values in between interpolate |
2249 alignment accordingly. | 2249 alignment accordingly. |
2250 | 2250 |
2251 @lilypond[verbatim,quote] | 2251 @lilypond[verbatim,quote] |
(...skipping 17 matching lines...) Expand all Loading... |
2269 one | 2269 one |
2270 \\halign #-5 | 2270 \\halign #-5 |
2271 two | 2271 two |
2272 three | 2272 three |
2273 } | 2273 } |
2274 } | 2274 } |
2275 @end lilypond" | 2275 @end lilypond" |
2276 (let* ((m (interpret-markup layout props arg))) | 2276 (let* ((m (interpret-markup layout props arg))) |
2277 (ly:stencil-aligned-to m X dir))) | 2277 (ly:stencil-aligned-to m X dir))) |
2278 | 2278 |
2279 (define-markup-command (with-dimensions layout props x y arg) | 2279 (define-markup-command-compilable (with-dimensions layout props x y arg) |
2280 (number-pair? number-pair? markup?) | 2280 (number-pair? number-pair? markup?) |
2281 #:category other | 2281 #:category other |
2282 " | 2282 " |
2283 @cindex setting extent of text object | 2283 @cindex setting extent of text object |
2284 | 2284 |
2285 Set the dimensions of @var{arg} to @var{x} and@tie{}@var{y}." | 2285 Set the dimensions of @var{arg} to @var{x} and@tie{}@var{y}." |
2286 (ly:stencil-outline | 2286 (ly:stencil-outline |
2287 (interpret-markup layout props arg) | 2287 (interpret-markup layout props arg) |
2288 (make-filled-box-stencil x y))) | 2288 (make-filled-box-stencil x y))) |
2289 | 2289 |
2290 | 2290 |
2291 (define-markup-command (with-outline layout props outline arg) | 2291 (define-markup-command-compilable (with-outline layout props outline arg) |
2292 (markup? markup?) | 2292 (markup? markup?) |
2293 #:category other | 2293 #:category other |
2294 " | 2294 " |
2295 Print @var{arg} with the outline and dimensions of @var{outline}." | 2295 Print @var{arg} with the outline and dimensions of @var{outline}." |
2296 (ly:stencil-outline (interpret-markup layout props arg) | 2296 (ly:stencil-outline (interpret-markup layout props arg) |
2297 (interpret-markup layout props outline))) | 2297 (interpret-markup layout props outline))) |
2298 | 2298 |
2299 (define-markup-command (with-dimensions-from layout props arg1 arg2) | 2299 (define-markup-command-compilable (with-dimensions-from layout props arg1 arg2) |
2300 (markup? markup?) | 2300 (markup? markup?) |
2301 #:category other | 2301 #:category other |
2302 " | 2302 " |
2303 Print @var{arg2} with the dimensions of @var{arg1}." | 2303 Print @var{arg2} with the dimensions of @var{arg1}." |
2304 (let* ((stil1 (interpret-markup layout props arg1)) | 2304 (let* ((stil1 (interpret-markup layout props arg1)) |
2305 (x (ly:stencil-extent stil1 0)) | 2305 (x (ly:stencil-extent stil1 0)) |
2306 (y (ly:stencil-extent stil1 1))) | 2306 (y (ly:stencil-extent stil1 1))) |
2307 (interpret-markup layout props (markup #:with-dimensions x y arg2)))) | 2307 (interpret-markup layout props (markup #:with-dimensions x y arg2)))) |
2308 | 2308 |
2309 (define-markup-command (pad-around layout props amount arg) | 2309 (define-markup-command-compilable (pad-around layout props amount arg) |
2310 (number? markup?) | 2310 (number? markup?) |
2311 #:category align | 2311 #:category align |
2312 "Add padding @var{amount} all around @var{arg}. | 2312 "Add padding @var{amount} all around @var{arg}. |
2313 | 2313 |
2314 @lilypond[verbatim,quote] | 2314 @lilypond[verbatim,quote] |
2315 \\markup { | 2315 \\markup { |
2316 \\box { | 2316 \\box { |
2317 default | 2317 default |
2318 } | 2318 } |
2319 \\hspace #2 | 2319 \\hspace #2 |
2320 \\box { | 2320 \\box { |
2321 \\pad-around #0.5 { | 2321 \\pad-around #0.5 { |
2322 padded | 2322 padded |
2323 } | 2323 } |
2324 } | 2324 } |
2325 } | 2325 } |
2326 @end lilypond" | 2326 @end lilypond" |
2327 (let* ((m (interpret-markup layout props arg)) | 2327 (let* ((m (interpret-markup layout props arg)) |
2328 (x (interval-widen (ly:stencil-extent m X) amount)) | 2328 (x (interval-widen (ly:stencil-extent m X) amount)) |
2329 (y (interval-widen (ly:stencil-extent m Y) amount))) | 2329 (y (interval-widen (ly:stencil-extent m Y) amount))) |
2330 (ly:stencil-add (make-transparent-box-stencil x y) | 2330 (ly:stencil-add (make-transparent-box-stencil x y) |
2331 m))) | 2331 m))) |
2332 | 2332 |
2333 (define-markup-command (pad-x layout props amount arg) | 2333 (define-markup-command-compilable (pad-x layout props amount arg) |
2334 (number? markup?) | 2334 (number? markup?) |
2335 #:category align | 2335 #:category align |
2336 " | 2336 " |
2337 @cindex padding text horizontally | 2337 @cindex padding text horizontally |
2338 | 2338 |
2339 Add padding @var{amount} around @var{arg} in the X@tie{}direction. | 2339 Add padding @var{amount} around @var{arg} in the X@tie{}direction. |
2340 | 2340 |
2341 @lilypond[verbatim,quote] | 2341 @lilypond[verbatim,quote] |
2342 \\markup { | 2342 \\markup { |
2343 \\box { | 2343 \\box { |
2344 default | 2344 default |
2345 } | 2345 } |
2346 \\hspace #4 | 2346 \\hspace #4 |
2347 \\box { | 2347 \\box { |
2348 \\pad-x #2 { | 2348 \\pad-x #2 { |
2349 padded | 2349 padded |
2350 } | 2350 } |
2351 } | 2351 } |
2352 } | 2352 } |
2353 @end lilypond" | 2353 @end lilypond" |
2354 (let* ((m (interpret-markup layout props arg)) | 2354 (let* ((m (interpret-markup layout props arg)) |
2355 (x (ly:stencil-extent m X)) | 2355 (x (ly:stencil-extent m X)) |
2356 (y (ly:stencil-extent m Y))) | 2356 (y (ly:stencil-extent m Y))) |
2357 (ly:make-stencil (ly:stencil-expr m) | 2357 (ly:make-stencil (ly:stencil-expr m) |
2358 (interval-widen x amount) | 2358 (interval-widen x amount) |
2359 y))) | 2359 y))) |
2360 | 2360 |
2361 (define-markup-command (put-adjacent layout props axis dir arg1 arg2) | 2361 (define-markup-command-compilable (put-adjacent layout props axis dir arg1 arg2) |
2362 (integer? ly:dir? markup? markup?) | 2362 (integer? ly:dir? markup? markup?) |
2363 #:category align | 2363 #:category align |
2364 "Put @var{arg2} next to @var{arg1}, without moving @var{arg1}." | 2364 "Put @var{arg2} next to @var{arg1}, without moving @var{arg1}." |
2365 (let ((m1 (interpret-markup layout props arg1)) | 2365 (let ((m1 (interpret-markup layout props arg1)) |
2366 (m2 (interpret-markup layout props arg2))) | 2366 (m2 (interpret-markup layout props arg2))) |
2367 (ly:stencil-combine-at-edge m1 axis dir m2 0.0))) | 2367 (ly:stencil-combine-at-edge m1 axis dir m2 0.0))) |
2368 | 2368 |
2369 (define-markup-command (transparent layout props arg) | 2369 (define-markup-command-compilable (transparent layout props arg) |
2370 (markup?) | 2370 (markup?) |
2371 #:category other | 2371 #:category other |
2372 "Make @var{arg} transparent. | 2372 "Make @var{arg} transparent. |
2373 | 2373 |
2374 @lilypond[verbatim,quote] | 2374 @lilypond[verbatim,quote] |
2375 \\markup { | 2375 \\markup { |
2376 \\transparent { | 2376 \\transparent { |
2377 invisible text | 2377 invisible text |
2378 } | 2378 } |
2379 } | 2379 } |
2380 @end lilypond" | 2380 @end lilypond" |
2381 (ly:stencil-outline empty-stencil (interpret-markup layout props arg))) | 2381 (ly:stencil-outline empty-stencil (interpret-markup layout props arg))) |
2382 | 2382 |
2383 (define-markup-command (pad-to-box layout props x-ext y-ext arg) | 2383 (define-markup-command-compilable (pad-to-box layout props x-ext y-ext arg) |
2384 (number-pair? number-pair? markup?) | 2384 (number-pair? number-pair? markup?) |
2385 #:category align | 2385 #:category align |
2386 "Make @var{arg} take at least @var{x-ext}, @var{y-ext} space. | 2386 "Make @var{arg} take at least @var{x-ext}, @var{y-ext} space. |
2387 | 2387 |
2388 @lilypond[verbatim,quote] | 2388 @lilypond[verbatim,quote] |
2389 \\markup { | 2389 \\markup { |
2390 \\box { | 2390 \\box { |
2391 default | 2391 default |
2392 } | 2392 } |
2393 \\hspace #4 | 2393 \\hspace #4 |
2394 \\box { | 2394 \\box { |
2395 \\pad-to-box #'(0 . 10) #'(0 . 3) { | 2395 \\pad-to-box #'(0 . 10) #'(0 . 3) { |
2396 padded | 2396 padded |
2397 } | 2397 } |
2398 } | 2398 } |
2399 } | 2399 } |
2400 @end lilypond" | 2400 @end lilypond" |
2401 (ly:stencil-add (make-transparent-box-stencil x-ext y-ext) | 2401 (ly:stencil-add (make-transparent-box-stencil x-ext y-ext) |
2402 (interpret-markup layout props arg))) | 2402 (interpret-markup layout props arg))) |
2403 | 2403 |
2404 (define-markup-command (hcenter-in layout props length arg) | 2404 (define-markup-command-compilable (hcenter-in layout props length arg) |
2405 (number? markup?) | 2405 (number? markup?) |
2406 #:category align | 2406 #:category align |
2407 "Center @var{arg} horizontally within a box of extending | 2407 "Center @var{arg} horizontally within a box of extending |
2408 @var{length}/2 to the left and right. | 2408 @var{length}/2 to the left and right. |
2409 | 2409 |
2410 @lilypond[quote,verbatim] | 2410 @lilypond[quote,verbatim] |
2411 \\new StaffGroup << | 2411 \\new StaffGroup << |
2412 \\new Staff { | 2412 \\new Staff { |
2413 \\set Staff.instrumentName = \\markup { | 2413 \\set Staff.instrumentName = \\markup { |
2414 \\hcenter-in #12 | 2414 \\hcenter-in #12 |
(...skipping 14 matching lines...) Expand all Loading... |
2429 (interpret-markup layout props | 2429 (interpret-markup layout props |
2430 (make-pad-to-box-markup | 2430 (make-pad-to-box-markup |
2431 (cons (/ length -2) (/ length 2)) | 2431 (cons (/ length -2) (/ length 2)) |
2432 '(0 . 0) | 2432 '(0 . 0) |
2433 (make-center-align-markup arg)))) | 2433 (make-center-align-markup arg)))) |
2434 | 2434 |
2435 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 2435 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2436 ;; property | 2436 ;; property |
2437 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 2437 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2438 | 2438 |
2439 (define-markup-command (property-recursive layout props symbol) | 2439 (define-markup-command-compilable (property-recursive layout props symbol) |
2440 (symbol?) | 2440 (symbol?) |
2441 #:category other | 2441 #:category other |
2442 "Print out a warning when a header field markup contains some recursive | 2442 "Print out a warning when a header field markup contains some recursive |
2443 markup definition." | 2443 markup definition." |
2444 (ly:warning "Recursive definition of property ~a detected!" symbol) | 2444 (ly:warning "Recursive definition of property ~a detected!" symbol) |
2445 empty-stencil) | 2445 empty-stencil) |
2446 | 2446 |
2447 (define-markup-command (fromproperty layout props symbol) | 2447 (define-markup-command-compilable (fromproperty layout props symbol) |
2448 (symbol?) | 2448 (symbol?) |
2449 #:category other | 2449 #:category other |
2450 "Read the @var{symbol} from property settings, and produce a stencil | 2450 "Read the @var{symbol} from property settings, and produce a stencil |
2451 from the markup contained within. If @var{symbol} is not defined, it | 2451 from the markup contained within. If @var{symbol} is not defined, it |
2452 returns an empty markup. | 2452 returns an empty markup. |
2453 | 2453 |
2454 @lilypond[verbatim,quote] | 2454 @lilypond[verbatim,quote] |
2455 \\header { | 2455 \\header { |
2456 myTitle = \"myTitle\" | 2456 myTitle = \"myTitle\" |
2457 title = \\markup { | 2457 title = \\markup { |
2458 from | 2458 from |
2459 \\italic | 2459 \\italic |
2460 \\fromproperty #'header:myTitle | 2460 \\fromproperty #'header:myTitle |
2461 } | 2461 } |
2462 } | 2462 } |
2463 \\markup { | 2463 \\markup { |
2464 \\null | 2464 \\null |
2465 } | 2465 } |
2466 @end lilypond" | 2466 @end lilypond" |
2467 (let ((m (chain-assoc-get symbol props))) | 2467 (let ((m (chain-assoc-get symbol props))) |
2468 (if (markup? m) | 2468 (if (markup? m) |
2469 ;; prevent infinite loops by clearing the interpreted property: | 2469 ;; prevent infinite loops by clearing the interpreted property: |
2470 (interpret-markup layout (cons (list (cons symbol `(,property-recursive-
markup ,symbol))) props) m) | 2470 (interpret-markup layout (cons (list (cons symbol `(,property-recursive-
markup ,symbol))) props) m) |
2471 empty-stencil))) | 2471 empty-stencil))) |
2472 | 2472 |
2473 (define-markup-command (on-the-fly layout props procedure arg) | 2473 (define-markup-command-compilable (on-the-fly layout props procedure arg) |
2474 (procedure? markup?) | 2474 (procedure? markup?) |
2475 #:category other | 2475 #:category other |
2476 "Apply the @var{procedure} markup command to @var{arg}. | 2476 "Apply the @var{procedure} markup command to @var{arg}. |
2477 @var{procedure} takes the same arguments as @code{interpret-markup} | 2477 @var{procedure} takes the same arguments as @code{interpret-markup} |
2478 and returns a stencil." | 2478 and returns a stencil." |
2479 (procedure layout props arg)) | 2479 (procedure layout props arg)) |
2480 | 2480 |
2481 (define-markup-command (footnote layout props mkup note) | 2481 (define-markup-command-compilable (footnote layout props mkup note) |
2482 (markup? markup?) | 2482 (markup? markup?) |
2483 #:category other | 2483 #:category other |
2484 "Have footnote @var{note} act as an annotation to the markup @var{mkup}. | 2484 "Have footnote @var{note} act as an annotation to the markup @var{mkup}. |
2485 | 2485 |
2486 @lilypond[verbatim,quote] | 2486 @lilypond[verbatim,quote] |
2487 \\markup { | 2487 \\markup { |
2488 \\auto-footnote a b | 2488 \\auto-footnote a b |
2489 \\override #'(padding . 0.2) | 2489 \\override #'(padding . 0.2) |
2490 \\auto-footnote c d | 2490 \\auto-footnote c d |
2491 } | 2491 } |
2492 @end lilypond | 2492 @end lilypond |
2493 The footnote will not be annotated automatically." | 2493 The footnote will not be annotated automatically." |
2494 (ly:stencil-combine-at-edge | 2494 (ly:stencil-combine-at-edge |
2495 (interpret-markup layout props mkup) | 2495 (interpret-markup layout props mkup) |
2496 X | 2496 X |
2497 RIGHT | 2497 RIGHT |
2498 (ly:make-stencil | 2498 (ly:make-stencil |
2499 `(footnote (gensym "footnote") #f ,(interpret-markup layout props note)) | 2499 `(footnote (gensym "footnote") #f ,(interpret-markup layout props note)) |
2500 '(0 . 0) | 2500 '(0 . 0) |
2501 '(0 . 0)) | 2501 '(0 . 0)) |
2502 0.0)) | 2502 0.0)) |
2503 | 2503 |
2504 (define-markup-command (auto-footnote layout props mkup note) | 2504 (define-markup-command-compilable (auto-footnote layout props mkup note) |
2505 (markup? markup?) | 2505 (markup? markup?) |
2506 #:category other | 2506 #:category other |
2507 #:properties ((raise 0.5) | 2507 #:properties ((raise 0.5) |
2508 (padding 0.0)) | 2508 (padding 0.0)) |
2509 "Have footnote @var{note} act as an annotation to the markup @var{mkup}. | 2509 "Have footnote @var{note} act as an annotation to the markup @var{mkup}. |
2510 | 2510 |
2511 @lilypond[verbatim,quote] | 2511 @lilypond[verbatim,quote] |
2512 \\markup { | 2512 \\markup { |
2513 \\auto-footnote a b | 2513 \\auto-footnote a b |
2514 \\override #'(padding . 0.2) | 2514 \\override #'(padding . 0.2) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2560 RIGHT | 2560 RIGHT |
2561 (ly:make-stencil footnote-number x-ext y-ext) | 2561 (ly:make-stencil footnote-number x-ext y-ext) |
2562 padding))) | 2562 padding))) |
2563 (ly:stencil-add | 2563 (ly:stencil-add |
2564 main-stencil | 2564 main-stencil |
2565 (ly:make-stencil | 2565 (ly:make-stencil |
2566 `(footnote ,footnote-hash #t ,(interpret-markup layout props note)) | 2566 `(footnote ,footnote-hash #t ,(interpret-markup layout props note)) |
2567 '(0 . 0) | 2567 '(0 . 0) |
2568 '(0 . 0))))) | 2568 '(0 . 0))))) |
2569 | 2569 |
2570 (define-markup-command (override layout props new-prop arg) | 2570 (define-markup-command-compilable (override layout props new-prop arg) |
2571 (pair? markup?) | 2571 (pair? markup?) |
2572 #:category other | 2572 #:category other |
2573 " | 2573 " |
2574 @cindex overriding property within text markup | 2574 @cindex overriding property within text markup |
2575 | 2575 |
2576 Add the argument @var{new-prop} to the property list. Properties | 2576 Add the argument @var{new-prop} to the property list. Properties |
2577 may be any property supported by @rinternals{font-interface}, | 2577 may be any property supported by @rinternals{font-interface}, |
2578 @rinternals{text-interface} and | 2578 @rinternals{text-interface} and |
2579 @rinternals{instrument-specific-markup-interface}. | 2579 @rinternals{instrument-specific-markup-interface}. |
2580 | 2580 |
(...skipping 11 matching lines...) Expand all Loading... |
2592 @end lilypond" | 2592 @end lilypond" |
2593 (interpret-markup layout | 2593 (interpret-markup layout |
2594 (cons (if (pair? (car new-prop)) new-prop (list new-prop)) | 2594 (cons (if (pair? (car new-prop)) new-prop (list new-prop)) |
2595 props) | 2595 props) |
2596 arg)) | 2596 arg)) |
2597 | 2597 |
2598 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 2598 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2599 ;; files | 2599 ;; files |
2600 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 2600 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2601 | 2601 |
2602 (define-markup-command (verbatim-file layout props name) | 2602 (define-markup-command-compilable (verbatim-file layout props name) |
2603 (string?) | 2603 (string?) |
2604 #:category other | 2604 #:category other |
2605 "Read the contents of file @var{name}, and include it verbatim. | 2605 "Read the contents of file @var{name}, and include it verbatim. |
2606 | 2606 |
2607 @lilypond[verbatim,quote] | 2607 @lilypond[verbatim,quote] |
2608 \\markup { | 2608 \\markup { |
2609 \\verbatim-file #\"simple.ly\" | 2609 \\verbatim-file #\"simple.ly\" |
2610 } | 2610 } |
2611 @end lilypond" | 2611 @end lilypond" |
2612 (interpret-markup layout props | 2612 (interpret-markup layout props |
2613 (if (ly:get-option 'safe) | 2613 (if (ly:get-option 'safe) |
2614 "verbatim-file disabled in safe mode" | 2614 "verbatim-file disabled in safe mode" |
2615 (let* ((str (ly:gulp-file name)) | 2615 (let* ((str (ly:gulp-file name)) |
2616 (lines (string-split str #\nl))) | 2616 (lines (string-split str #\nl))) |
2617 (make-typewriter-markup | 2617 (make-typewriter-markup |
2618 (make-column-markup lines)))))) | 2618 (make-column-markup lines)))))) |
2619 | 2619 |
2620 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 2620 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2621 ;; fonts. | 2621 ;; fonts. |
2622 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 2622 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
2623 | 2623 |
2624 | 2624 |
2625 (define-markup-command (smaller layout props arg) | 2625 (define-markup-command-compilable (smaller layout props arg) |
2626 (markup?) | 2626 (markup?) |
2627 #:category font | 2627 #:category font |
2628 "Decrease the font size relative to the current setting. | 2628 "Decrease the font size relative to the current setting. |
2629 | 2629 |
2630 @lilypond[verbatim,quote] | 2630 @lilypond[verbatim,quote] |
2631 \\markup { | 2631 \\markup { |
2632 \\fontsize #3.5 { | 2632 \\fontsize #3.5 { |
2633 some large text | 2633 some large text |
2634 \\hspace #2 | 2634 \\hspace #2 |
2635 \\smaller { | 2635 \\smaller { |
2636 a bit smaller | 2636 a bit smaller |
2637 } | 2637 } |
2638 \\hspace #2 | 2638 \\hspace #2 |
2639 more large text | 2639 more large text |
2640 } | 2640 } |
2641 } | 2641 } |
2642 @end lilypond" | 2642 @end lilypond" |
2643 (interpret-markup layout props | 2643 (interpret-markup layout props |
2644 `(,fontsize-markup -1 ,arg))) | 2644 `(,fontsize-markup -1 ,arg))) |
2645 | 2645 |
2646 (define-markup-command (larger layout props arg) | 2646 (define-markup-command-compilable (larger layout props arg) |
2647 (markup?) | 2647 (markup?) |
2648 #:category font | 2648 #:category font |
2649 "Increase the font size relative to the current setting. | 2649 "Increase the font size relative to the current setting. |
2650 | 2650 |
2651 @lilypond[verbatim,quote] | 2651 @lilypond[verbatim,quote] |
2652 \\markup { | 2652 \\markup { |
2653 default | 2653 default |
2654 \\hspace #2 | 2654 \\hspace #2 |
2655 \\larger | 2655 \\larger |
2656 larger | 2656 larger |
2657 } | 2657 } |
2658 @end lilypond" | 2658 @end lilypond" |
2659 (interpret-markup layout props | 2659 (interpret-markup layout props |
2660 `(,fontsize-markup 1 ,arg))) | 2660 `(,fontsize-markup 1 ,arg))) |
2661 | 2661 |
2662 (define-markup-command (finger layout props arg) | 2662 (define-markup-command-compilable (finger layout props arg) |
2663 (markup?) | 2663 (markup?) |
2664 #:category font | 2664 #:category font |
2665 "Set @var{arg} as small numbers. | 2665 "Set @var{arg} as small numbers. |
2666 | 2666 |
2667 @lilypond[verbatim,quote] | 2667 @lilypond[verbatim,quote] |
2668 \\markup { | 2668 \\markup { |
2669 \\finger { | 2669 \\finger { |
2670 1 2 3 4 5 | 2670 1 2 3 4 5 |
2671 } | 2671 } |
2672 } | 2672 } |
2673 @end lilypond" | 2673 @end lilypond" |
2674 (interpret-markup layout | 2674 (interpret-markup layout |
2675 (cons '((font-size . -5) (font-encoding . fetaText)) props) | 2675 (cons '((font-size . -5) (font-encoding . fetaText)) props) |
2676 arg)) | 2676 arg)) |
2677 | 2677 |
2678 (define-markup-command (abs-fontsize layout props size arg) | 2678 (define-markup-command-compilable (abs-fontsize layout props size arg) |
2679 (number? markup?) | 2679 (number? markup?) |
2680 #:properties ((word-space 0.6) (baseline-skip 3)) | 2680 #:properties ((word-space 0.6) (baseline-skip 3)) |
2681 #:category font | 2681 #:category font |
2682 "Use @var{size} as the absolute font size (in points) to display @var{arg}. | 2682 "Use @var{size} as the absolute font size (in points) to display @var{arg}. |
2683 Adjusts @code{baseline-skip} and @code{word-space} accordingly. | 2683 Adjusts @code{baseline-skip} and @code{word-space} accordingly. |
2684 | 2684 |
2685 @lilypond[verbatim,quote] | 2685 @lilypond[verbatim,quote] |
2686 \\markup { | 2686 \\markup { |
2687 default text font size | 2687 default text font size |
2688 \\hspace #2 | 2688 \\hspace #2 |
2689 \\abs-fontsize #16 { text font size 16 } | 2689 \\abs-fontsize #16 { text font size 16 } |
2690 \\hspace #2 | 2690 \\hspace #2 |
2691 \\abs-fontsize #12 { text font size 12 } | 2691 \\abs-fontsize #12 { text font size 12 } |
2692 } | 2692 } |
2693 @end lilypond" | 2693 @end lilypond" |
2694 (let* ((ref-size (ly:output-def-lookup layout 'text-font-size 12)) | 2694 (let* ((ref-size (ly:output-def-lookup layout 'text-font-size 12)) |
2695 (text-props (list (ly:output-def-lookup layout 'text-font-defaults))) | 2695 (text-props (list (ly:output-def-lookup layout 'text-font-defaults))) |
2696 (magnification (/ size ref-size))) | 2696 (magnification (/ size ref-size))) |
2697 (interpret-markup | 2697 (interpret-markup |
2698 layout | 2698 layout |
2699 (cons | 2699 (cons |
2700 `((baseline-skip . ,(* magnification baseline-skip)) | 2700 `((baseline-skip . ,(* magnification baseline-skip)) |
2701 (word-space . ,(* magnification word-space)) | 2701 (word-space . ,(* magnification word-space)) |
2702 (font-size . ,(magnification->font-size magnification))) | 2702 (font-size . ,(magnification->font-size magnification))) |
2703 props) | 2703 props) |
2704 arg))) | 2704 arg))) |
2705 | 2705 |
2706 (define-markup-command (fontsize layout props increment arg) | 2706 (define-markup-command-compilable (fontsize layout props increment arg) |
2707 (number? markup?) | 2707 (number? markup?) |
2708 #:category font | 2708 #:category font |
2709 #:properties ((font-size 0) | 2709 #:properties ((font-size 0) |
2710 (word-space 1) | 2710 (word-space 1) |
2711 (baseline-skip 2)) | 2711 (baseline-skip 2)) |
2712 "Add @var{increment} to the font-size. Adjusts @code{baseline-skip} | 2712 "Add @var{increment} to the font-size. Adjusts @code{baseline-skip} |
2713 accordingly. | 2713 accordingly. |
2714 | 2714 |
2715 @lilypond[verbatim,quote] | 2715 @lilypond[verbatim,quote] |
2716 \\markup { | 2716 \\markup { |
2717 default | 2717 default |
2718 \\hspace #2 | 2718 \\hspace #2 |
2719 \\fontsize #-1.5 | 2719 \\fontsize #-1.5 |
2720 smaller | 2720 smaller |
2721 } | 2721 } |
2722 @end lilypond" | 2722 @end lilypond" |
2723 (interpret-markup | 2723 (interpret-markup |
2724 layout | 2724 layout |
2725 (cons | 2725 (cons |
2726 `((baseline-skip . ,(* baseline-skip (magstep increment))) | 2726 `((baseline-skip . ,(* baseline-skip (magstep increment))) |
2727 (word-space . ,(* word-space (magstep increment))) | 2727 (word-space . ,(* word-space (magstep increment))) |
2728 (font-size . ,(+ font-size increment))) | 2728 (font-size . ,(+ font-size increment))) |
2729 props) | 2729 props) |
2730 arg)) | 2730 arg)) |
2731 | 2731 |
2732 (define-markup-command (magnify layout props sz arg) | 2732 (define-markup-command-compilable (magnify layout props sz arg) |
2733 (number? markup?) | 2733 (number? markup?) |
2734 #:category font | 2734 #:category font |
2735 " | 2735 " |
2736 @cindex magnifying text | 2736 @cindex magnifying text |
2737 | 2737 |
2738 Set the font magnification for its argument. In the following | 2738 Set the font magnification for its argument. In the following |
2739 example, the middle@tie{}A is 10% larger: | 2739 example, the middle@tie{}A is 10% larger: |
2740 | 2740 |
2741 @example | 2741 @example |
2742 A \\magnify #1.1 @{ A @} A | 2742 A \\magnify #1.1 @{ A @} A |
2743 @end example | 2743 @end example |
2744 | 2744 |
2745 Note: Magnification only works if a font name is explicitly selected. | 2745 Note: Magnification only works if a font name is explicitly selected. |
2746 Use @code{\\fontsize} otherwise. | 2746 Use @code{\\fontsize} otherwise. |
2747 | 2747 |
2748 @lilypond[verbatim,quote] | 2748 @lilypond[verbatim,quote] |
2749 \\markup { | 2749 \\markup { |
2750 default | 2750 default |
2751 \\hspace #2 | 2751 \\hspace #2 |
2752 \\magnify #1.5 { | 2752 \\magnify #1.5 { |
2753 50% larger | 2753 50% larger |
2754 } | 2754 } |
2755 } | 2755 } |
2756 @end lilypond" | 2756 @end lilypond" |
2757 (interpret-markup | 2757 (interpret-markup |
2758 layout | 2758 layout |
2759 (prepend-alist-chain 'font-size (magnification->font-size sz) props) | 2759 (prepend-alist-chain 'font-size (magnification->font-size sz) props) |
2760 arg)) | 2760 arg)) |
2761 | 2761 |
2762 (define-markup-command (bold layout props arg) | 2762 (define-markup-command-compilable (bold layout props arg) |
2763 (markup?) | 2763 (markup?) |
2764 #:category font | 2764 #:category font |
2765 "Switch to bold font-series. | 2765 "Switch to bold font-series. |
2766 | 2766 |
2767 @lilypond[verbatim,quote] | 2767 @lilypond[verbatim,quote] |
2768 \\markup { | 2768 \\markup { |
2769 default | 2769 default |
2770 \\hspace #2 | 2770 \\hspace #2 |
2771 \\bold | 2771 \\bold |
2772 bold | 2772 bold |
2773 } | 2773 } |
2774 @end lilypond" | 2774 @end lilypond" |
2775 (interpret-markup layout (prepend-alist-chain 'font-series 'bold props) arg)) | 2775 (interpret-markup layout (prepend-alist-chain 'font-series 'bold props) arg)) |
2776 | 2776 |
2777 (define-markup-command (sans layout props arg) | 2777 (define-markup-command-compilable (sans layout props arg) |
2778 (markup?) | 2778 (markup?) |
2779 #:category font | 2779 #:category font |
2780 "Switch to the sans serif font family. | 2780 "Switch to the sans serif font family. |
2781 | 2781 |
2782 @lilypond[verbatim,quote] | 2782 @lilypond[verbatim,quote] |
2783 \\markup { | 2783 \\markup { |
2784 default | 2784 default |
2785 \\hspace #2 | 2785 \\hspace #2 |
2786 \\sans { | 2786 \\sans { |
2787 sans serif | 2787 sans serif |
2788 } | 2788 } |
2789 } | 2789 } |
2790 @end lilypond" | 2790 @end lilypond" |
2791 (interpret-markup layout (prepend-alist-chain 'font-family 'sans props) arg)) | 2791 (interpret-markup layout (prepend-alist-chain 'font-family 'sans props) arg)) |
2792 | 2792 |
2793 (define-markup-command (number layout props arg) | 2793 (define-markup-command-compilable (number layout props arg) |
2794 (markup?) | 2794 (markup?) |
2795 #:category font | 2795 #:category font |
2796 "Set font family to @code{number}, which yields the font used for | 2796 "Set font family to @code{number}, which yields the font used for |
2797 time signatures and fingerings. This font contains numbers and | 2797 time signatures and fingerings. This font contains numbers and |
2798 some punctuation; it has no letters. | 2798 some punctuation; it has no letters. |
2799 | 2799 |
2800 @lilypond[verbatim,quote] | 2800 @lilypond[verbatim,quote] |
2801 \\markup { | 2801 \\markup { |
2802 \\number { | 2802 \\number { |
2803 0 1 2 3 4 5 6 7 8 9 . , | 2803 0 1 2 3 4 5 6 7 8 9 . , |
2804 } | 2804 } |
2805 } | 2805 } |
2806 @end lilypond" | 2806 @end lilypond" |
2807 (interpret-markup layout (prepend-alist-chain 'font-encoding 'fetaText props)
arg)) | 2807 (interpret-markup layout (prepend-alist-chain 'font-encoding 'fetaText props)
arg)) |
2808 | 2808 |
2809 (define-markup-command (roman layout props arg) | 2809 (define-markup-command-compilable (roman layout props arg) |
2810 (markup?) | 2810 (markup?) |
2811 #:category font | 2811 #:category font |
2812 "Set font family to @code{roman}. | 2812 "Set font family to @code{roman}. |
2813 | 2813 |
2814 @lilypond[verbatim,quote] | 2814 @lilypond[verbatim,quote] |
2815 \\markup { | 2815 \\markup { |
2816 \\sans \\bold { | 2816 \\sans \\bold { |
2817 sans serif, bold | 2817 sans serif, bold |
2818 \\hspace #2 | 2818 \\hspace #2 |
2819 \\roman { | 2819 \\roman { |
2820 text in roman font family | 2820 text in roman font family |
2821 } | 2821 } |
2822 \\hspace #2 | 2822 \\hspace #2 |
2823 return to sans | 2823 return to sans |
2824 } | 2824 } |
2825 } | 2825 } |
2826 @end lilypond" | 2826 @end lilypond" |
2827 (interpret-markup layout (prepend-alist-chain 'font-family 'roman props) arg)) | 2827 (interpret-markup layout (prepend-alist-chain 'font-family 'roman props) arg)) |
2828 | 2828 |
2829 (define-markup-command (huge layout props arg) | 2829 (define-markup-command-compilable (huge layout props arg) |
2830 (markup?) | 2830 (markup?) |
2831 #:category font | 2831 #:category font |
2832 "Set font size to +2. | 2832 "Set font size to +2. |
2833 | 2833 |
2834 @lilypond[verbatim,quote] | 2834 @lilypond[verbatim,quote] |
2835 \\markup { | 2835 \\markup { |
2836 default | 2836 default |
2837 \\hspace #2 | 2837 \\hspace #2 |
2838 \\huge | 2838 \\huge |
2839 huge | 2839 huge |
2840 } | 2840 } |
2841 @end lilypond" | 2841 @end lilypond" |
2842 (interpret-markup layout (prepend-alist-chain 'font-size 2 props) arg)) | 2842 (interpret-markup layout (prepend-alist-chain 'font-size 2 props) arg)) |
2843 | 2843 |
2844 (define-markup-command (large layout props arg) | 2844 (define-markup-command-compilable (large layout props arg) |
2845 (markup?) | 2845 (markup?) |
2846 #:category font | 2846 #:category font |
2847 "Set font size to +1. | 2847 "Set font size to +1. |
2848 | 2848 |
2849 @lilypond[verbatim,quote] | 2849 @lilypond[verbatim,quote] |
2850 \\markup { | 2850 \\markup { |
2851 default | 2851 default |
2852 \\hspace #2 | 2852 \\hspace #2 |
2853 \\large | 2853 \\large |
2854 large | 2854 large |
2855 } | 2855 } |
2856 @end lilypond" | 2856 @end lilypond" |
2857 (interpret-markup layout (prepend-alist-chain 'font-size 1 props) arg)) | 2857 (interpret-markup layout (prepend-alist-chain 'font-size 1 props) arg)) |
2858 | 2858 |
2859 (define-markup-command (normalsize layout props arg) | 2859 (define-markup-command-compilable (normalsize layout props arg) |
2860 (markup?) | 2860 (markup?) |
2861 #:category font | 2861 #:category font |
2862 "Set font size to default. | 2862 "Set font size to default. |
2863 | 2863 |
2864 @lilypond[verbatim,quote] | 2864 @lilypond[verbatim,quote] |
2865 \\markup { | 2865 \\markup { |
2866 \\teeny { | 2866 \\teeny { |
2867 this is very small | 2867 this is very small |
2868 \\hspace #2 | 2868 \\hspace #2 |
2869 \\normalsize { | 2869 \\normalsize { |
2870 normal size | 2870 normal size |
2871 } | 2871 } |
2872 \\hspace #2 | 2872 \\hspace #2 |
2873 teeny again | 2873 teeny again |
2874 } | 2874 } |
2875 } | 2875 } |
2876 @end lilypond" | 2876 @end lilypond" |
2877 (interpret-markup layout (prepend-alist-chain 'font-size 0 props) arg)) | 2877 (interpret-markup layout (prepend-alist-chain 'font-size 0 props) arg)) |
2878 | 2878 |
2879 (define-markup-command (small layout props arg) | 2879 (define-markup-command-compilable (small layout props arg) |
2880 (markup?) | 2880 (markup?) |
2881 #:category font | 2881 #:category font |
2882 "Set font size to -1. | 2882 "Set font size to -1. |
2883 | 2883 |
2884 @lilypond[verbatim,quote] | 2884 @lilypond[verbatim,quote] |
2885 \\markup { | 2885 \\markup { |
2886 default | 2886 default |
2887 \\hspace #2 | 2887 \\hspace #2 |
2888 \\small | 2888 \\small |
2889 small | 2889 small |
2890 } | 2890 } |
2891 @end lilypond" | 2891 @end lilypond" |
2892 (interpret-markup layout (prepend-alist-chain 'font-size -1 props) arg)) | 2892 (interpret-markup layout (prepend-alist-chain 'font-size -1 props) arg)) |
2893 | 2893 |
2894 (define-markup-command (tiny layout props arg) | 2894 (define-markup-command-compilable (tiny layout props arg) |
2895 (markup?) | 2895 (markup?) |
2896 #:category font | 2896 #:category font |
2897 "Set font size to -2. | 2897 "Set font size to -2. |
2898 | 2898 |
2899 @lilypond[verbatim,quote] | 2899 @lilypond[verbatim,quote] |
2900 \\markup { | 2900 \\markup { |
2901 default | 2901 default |
2902 \\hspace #2 | 2902 \\hspace #2 |
2903 \\tiny | 2903 \\tiny |
2904 tiny | 2904 tiny |
2905 } | 2905 } |
2906 @end lilypond" | 2906 @end lilypond" |
2907 (interpret-markup layout (prepend-alist-chain 'font-size -2 props) arg)) | 2907 (interpret-markup layout (prepend-alist-chain 'font-size -2 props) arg)) |
2908 | 2908 |
2909 (define-markup-command (teeny layout props arg) | 2909 (define-markup-command-compilable (teeny layout props arg) |
2910 (markup?) | 2910 (markup?) |
2911 #:category font | 2911 #:category font |
2912 "Set font size to -3. | 2912 "Set font size to -3. |
2913 | 2913 |
2914 @lilypond[verbatim,quote] | 2914 @lilypond[verbatim,quote] |
2915 \\markup { | 2915 \\markup { |
2916 default | 2916 default |
2917 \\hspace #2 | 2917 \\hspace #2 |
2918 \\teeny | 2918 \\teeny |
2919 teeny | 2919 teeny |
2920 } | 2920 } |
2921 @end lilypond" | 2921 @end lilypond" |
2922 (interpret-markup layout (prepend-alist-chain 'font-size -3 props) arg)) | 2922 (interpret-markup layout (prepend-alist-chain 'font-size -3 props) arg)) |
2923 | 2923 |
2924 (define-markup-command (fontCaps layout props arg) | 2924 (define-markup-command-compilable (fontCaps layout props arg) |
2925 (markup?) | 2925 (markup?) |
2926 #:category font | 2926 #:category font |
2927 "Set @code{font-shape} to @code{caps} | 2927 "Set @code{font-shape} to @code{caps} |
2928 | 2928 |
2929 Note: @code{\\fontCaps} requires the installation and selection of | 2929 Note: @code{\\fontCaps} requires the installation and selection of |
2930 fonts which support the @code{caps} font shape." | 2930 fonts which support the @code{caps} font shape." |
2931 (interpret-markup layout (prepend-alist-chain 'font-shape 'caps props) arg)) | 2931 (interpret-markup layout (prepend-alist-chain 'font-shape 'caps props) arg)) |
2932 | 2932 |
2933 ;; Poor man's caps | 2933 ;; Poor man's caps |
2934 (define-markup-command (smallCaps layout props arg) | 2934 (define-markup-command-compilable (smallCaps layout props arg) |
2935 (markup?) | 2935 (markup?) |
2936 #:category font | 2936 #:category font |
2937 "Emit @var{arg} as small caps. | 2937 "Emit @var{arg} as small caps. |
2938 | 2938 |
2939 Note: @code{\\smallCaps} does not support accented characters. | 2939 Note: @code{\\smallCaps} does not support accented characters. |
2940 | 2940 |
2941 @lilypond[verbatim,quote] | 2941 @lilypond[verbatim,quote] |
2942 \\markup { | 2942 \\markup { |
2943 default | 2943 default |
2944 \\hspace #2 | 2944 \\hspace #2 |
(...skipping 26 matching lines...) Expand all Loading... |
2971 (if (null? currents) | 2971 (if (null? currents) |
2972 prev-result | 2972 prev-result |
2973 (cons (char-list->markup | 2973 (cons (char-list->markup |
2974 currents current-is-lower) | 2974 currents current-is-lower) |
2975 prev-result))))))) | 2975 prev-result))))))) |
2976 (interpret-markup layout props | 2976 (interpret-markup layout props |
2977 (if (string? arg) | 2977 (if (string? arg) |
2978 (make-small-caps (string->list arg) (list) #f (list)) | 2978 (make-small-caps (string->list arg) (list) #f (list)) |
2979 arg))) | 2979 arg))) |
2980 | 2980 |
2981 (define-markup-command (caps layout props arg) | 2981 (define-markup-command-compilable (caps layout props arg) |
2982 (markup?) | 2982 (markup?) |
2983 #:category font | 2983 #:category font |
2984 "Copy of the @code{\\smallCaps} command. | 2984 "Copy of the @code{\\smallCaps} command. |
2985 | 2985 |
2986 @lilypond[verbatim,quote] | 2986 @lilypond[verbatim,quote] |
2987 \\markup { | 2987 \\markup { |
2988 default | 2988 default |
2989 \\hspace #2 | 2989 \\hspace #2 |
2990 \\caps { | 2990 \\caps { |
2991 Text in small caps | 2991 Text in small caps |
2992 } | 2992 } |
2993 } | 2993 } |
2994 @end lilypond" | 2994 @end lilypond" |
2995 (interpret-markup layout props (make-smallCaps-markup arg))) | 2995 (interpret-markup layout props (make-smallCaps-markup arg))) |
2996 | 2996 |
2997 (define-markup-command (dynamic layout props arg) | 2997 (define-markup-command-compilable (dynamic layout props arg) |
2998 (markup?) | 2998 (markup?) |
2999 #:category font | 2999 #:category font |
3000 "Use the dynamic font. This font only contains @b{s}, @b{f}, @b{m}, | 3000 "Use the dynamic font. This font only contains @b{s}, @b{f}, @b{m}, |
3001 @b{z}, @b{p}, and @b{r}. When producing phrases, like | 3001 @b{z}, @b{p}, and @b{r}. When producing phrases, like |
3002 @q{pi@`{u}@tie{}@b{f}}, the normal words (like @q{pi@`{u}}) should be | 3002 @q{pi@`{u}@tie{}@b{f}}, the normal words (like @q{pi@`{u}}) should be |
3003 done in a different font. The recommended font for this is bold and italic. | 3003 done in a different font. The recommended font for this is bold and italic. |
3004 @lilypond[verbatim,quote] | 3004 @lilypond[verbatim,quote] |
3005 \\markup { | 3005 \\markup { |
3006 \\dynamic { | 3006 \\dynamic { |
3007 sfzp | 3007 sfzp |
3008 } | 3008 } |
3009 } | 3009 } |
3010 @end lilypond" | 3010 @end lilypond" |
3011 (interpret-markup | 3011 (interpret-markup |
3012 layout (prepend-alist-chain 'font-encoding 'fetaText props) arg)) | 3012 layout (prepend-alist-chain 'font-encoding 'fetaText props) arg)) |
3013 | 3013 |
3014 (define-markup-command (text layout props arg) | 3014 (define-markup-command-compilable (text layout props arg) |
3015 (markup?) | 3015 (markup?) |
3016 #:category font | 3016 #:category font |
3017 "Use a text font instead of music symbol or music alphabet font. | 3017 "Use a text font instead of music symbol or music alphabet font. |
3018 | 3018 |
3019 @lilypond[verbatim,quote] | 3019 @lilypond[verbatim,quote] |
3020 \\markup { | 3020 \\markup { |
3021 \\number { | 3021 \\number { |
3022 1, 2, | 3022 1, 2, |
3023 \\text { | 3023 \\text { |
3024 three, four, | 3024 three, four, |
3025 } | 3025 } |
3026 5 | 3026 5 |
3027 } | 3027 } |
3028 } | 3028 } |
3029 @end lilypond" | 3029 @end lilypond" |
3030 | 3030 |
3031 ;; ugh - latin1 | 3031 ;; ugh - latin1 |
3032 (interpret-markup layout (prepend-alist-chain 'font-encoding 'latin1 props) | 3032 (interpret-markup layout (prepend-alist-chain 'font-encoding 'latin1 props) |
3033 arg)) | 3033 arg)) |
3034 | 3034 |
3035 (define-markup-command (italic layout props arg) | 3035 (define-markup-command-compilable (italic layout props arg) |
3036 (markup?) | 3036 (markup?) |
3037 #:category font | 3037 #:category font |
3038 "Use italic @code{font-shape} for @var{arg}. | 3038 "Use italic @code{font-shape} for @var{arg}. |
3039 | 3039 |
3040 @lilypond[verbatim,quote] | 3040 @lilypond[verbatim,quote] |
3041 \\markup { | 3041 \\markup { |
3042 default | 3042 default |
3043 \\hspace #2 | 3043 \\hspace #2 |
3044 \\italic | 3044 \\italic |
3045 italic | 3045 italic |
3046 } | 3046 } |
3047 @end lilypond" | 3047 @end lilypond" |
3048 (interpret-markup layout (prepend-alist-chain 'font-shape 'italic props) arg)) | 3048 (interpret-markup layout (prepend-alist-chain 'font-shape 'italic props) arg)) |
3049 | 3049 |
3050 (define-markup-command (typewriter layout props arg) | 3050 (define-markup-command-compilable (typewriter layout props arg) |
3051 (markup?) | 3051 (markup?) |
3052 #:category font | 3052 #:category font |
3053 "Use @code{font-family} typewriter for @var{arg}. | 3053 "Use @code{font-family} typewriter for @var{arg}. |
3054 | 3054 |
3055 @lilypond[verbatim,quote] | 3055 @lilypond[verbatim,quote] |
3056 \\markup { | 3056 \\markup { |
3057 default | 3057 default |
3058 \\hspace #2 | 3058 \\hspace #2 |
3059 \\typewriter | 3059 \\typewriter |
3060 typewriter | 3060 typewriter |
3061 } | 3061 } |
3062 @end lilypond" | 3062 @end lilypond" |
3063 (interpret-markup | 3063 (interpret-markup |
3064 layout (prepend-alist-chain 'font-family 'typewriter props) arg)) | 3064 layout (prepend-alist-chain 'font-family 'typewriter props) arg)) |
3065 | 3065 |
3066 (define-markup-command (upright layout props arg) | 3066 (define-markup-command-compilable (upright layout props arg) |
3067 (markup?) | 3067 (markup?) |
3068 #:category font | 3068 #:category font |
3069 "Set @code{font-shape} to @code{upright}. This is the opposite | 3069 "Set @code{font-shape} to @code{upright}. This is the opposite |
3070 of @code{italic}. | 3070 of @code{italic}. |
3071 | 3071 |
3072 @lilypond[verbatim,quote] | 3072 @lilypond[verbatim,quote] |
3073 \\markup { | 3073 \\markup { |
3074 \\italic { | 3074 \\italic { |
3075 italic text | 3075 italic text |
3076 \\hspace #2 | 3076 \\hspace #2 |
3077 \\upright { | 3077 \\upright { |
3078 upright text | 3078 upright text |
3079 } | 3079 } |
3080 \\hspace #2 | 3080 \\hspace #2 |
3081 italic again | 3081 italic again |
3082 } | 3082 } |
3083 } | 3083 } |
3084 @end lilypond" | 3084 @end lilypond" |
3085 (interpret-markup | 3085 (interpret-markup |
3086 layout (prepend-alist-chain 'font-shape 'upright props) arg)) | 3086 layout (prepend-alist-chain 'font-shape 'upright props) arg)) |
3087 | 3087 |
3088 (define-markup-command (medium layout props arg) | 3088 (define-markup-command-compilable (medium layout props arg) |
3089 (markup?) | 3089 (markup?) |
3090 #:category font | 3090 #:category font |
3091 "Switch to medium font-series (in contrast to bold). | 3091 "Switch to medium font-series (in contrast to bold). |
3092 | 3092 |
3093 @lilypond[verbatim,quote] | 3093 @lilypond[verbatim,quote] |
3094 \\markup { | 3094 \\markup { |
3095 \\bold { | 3095 \\bold { |
3096 some bold text | 3096 some bold text |
3097 \\hspace #2 | 3097 \\hspace #2 |
3098 \\medium { | 3098 \\medium { |
3099 medium font series | 3099 medium font series |
3100 } | 3100 } |
3101 \\hspace #2 | 3101 \\hspace #2 |
3102 bold again | 3102 bold again |
3103 } | 3103 } |
3104 } | 3104 } |
3105 @end lilypond" | 3105 @end lilypond" |
3106 (interpret-markup layout (prepend-alist-chain 'font-series 'medium props) | 3106 (interpret-markup layout (prepend-alist-chain 'font-series 'medium props) |
3107 arg)) | 3107 arg)) |
3108 | 3108 |
3109 (define-markup-command (normal-text layout props arg) | 3109 (define-markup-command-compilable (normal-text layout props arg) |
3110 (markup?) | 3110 (markup?) |
3111 #:category font | 3111 #:category font |
3112 "Set all font related properties (except the size) to get the default | 3112 "Set all font related properties (except the size) to get the default |
3113 normal text font, no matter what font was used earlier. | 3113 normal text font, no matter what font was used earlier. |
3114 | 3114 |
3115 @lilypond[verbatim,quote] | 3115 @lilypond[verbatim,quote] |
3116 \\markup { | 3116 \\markup { |
3117 \\huge \\bold \\sans \\caps { | 3117 \\huge \\bold \\sans \\caps { |
3118 huge bold sans caps | 3118 huge bold sans caps |
3119 \\hspace #2 | 3119 \\hspace #2 |
3120 \\normal-text { | 3120 \\normal-text { |
3121 huge normal | 3121 huge normal |
3122 } | 3122 } |
3123 \\hspace #2 | 3123 \\hspace #2 |
3124 as before | 3124 as before |
3125 } | 3125 } |
3126 } | 3126 } |
3127 @end lilypond" | 3127 @end lilypond" |
3128 ;; ugh - latin1 | 3128 ;; ugh - latin1 |
3129 (interpret-markup layout | 3129 (interpret-markup layout |
3130 (cons '((font-family . roman) (font-shape . upright) | 3130 (cons '((font-family . roman) (font-shape . upright) |
3131 (font-series . medium) (font-encoding . latin1)) | 3131 (font-series . medium) (font-encoding . latin1)) |
3132 props) | 3132 props) |
3133 arg)) | 3133 arg)) |
3134 | 3134 |
3135 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 3135 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3136 ;; symbols. | 3136 ;; symbols. |
3137 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 3137 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3138 | 3138 |
3139 (define-markup-command (musicglyph layout props glyph-name) | 3139 (define-markup-command-compilable (musicglyph layout props glyph-name) |
3140 (string?) | 3140 (string?) |
3141 #:category music | 3141 #:category music |
3142 "@var{glyph-name} is converted to a musical symbol; for example, | 3142 "@var{glyph-name} is converted to a musical symbol; for example, |
3143 @code{\\musicglyph #\"accidentals.natural\"} selects the natural sign from | 3143 @code{\\musicglyph #\"accidentals.natural\"} selects the natural sign from |
3144 the music font. See @ruser{The Emmentaler font} for a complete listing of | 3144 the music font. See @ruser{The Emmentaler font} for a complete listing of |
3145 the possible glyphs. | 3145 the possible glyphs. |
3146 | 3146 |
3147 @lilypond[verbatim,quote] | 3147 @lilypond[verbatim,quote] |
3148 \\markup { | 3148 \\markup { |
3149 \\musicglyph #\"f\" | 3149 \\musicglyph #\"f\" |
3150 \\musicglyph #\"rests.2\" | 3150 \\musicglyph #\"rests.2\" |
3151 \\musicglyph #\"clefs.G_change\" | 3151 \\musicglyph #\"clefs.G_change\" |
3152 } | 3152 } |
3153 @end lilypond" | 3153 @end lilypond" |
3154 (let* ((font (ly:paper-get-font layout | 3154 (let* ((font (ly:paper-get-font layout |
3155 (cons '((font-encoding . fetaMusic) | 3155 (cons '((font-encoding . fetaMusic) |
3156 (font-name . #f)) | 3156 (font-name . #f)) |
3157 | 3157 |
3158 props))) | 3158 props))) |
3159 (glyph (ly:font-get-glyph font glyph-name))) | 3159 (glyph (ly:font-get-glyph font glyph-name))) |
3160 (if (null? (ly:stencil-expr glyph)) | 3160 (if (null? (ly:stencil-expr glyph)) |
3161 (ly:warning (_ "Cannot find glyph ~a") glyph-name)) | 3161 (ly:warning (_ "Cannot find glyph ~a") glyph-name)) |
3162 | 3162 |
3163 glyph)) | 3163 glyph)) |
3164 | 3164 |
3165 (define-markup-command (doublesharp layout props) | 3165 (define-markup-command-compilable (doublesharp layout props) |
3166 () | 3166 () |
3167 #:category music | 3167 #:category music |
3168 "Draw a double sharp symbol. | 3168 "Draw a double sharp symbol. |
3169 | 3169 |
3170 @lilypond[verbatim,quote] | 3170 @lilypond[verbatim,quote] |
3171 \\markup { | 3171 \\markup { |
3172 \\doublesharp | 3172 \\doublesharp |
3173 } | 3173 } |
3174 @end lilypond" | 3174 @end lilypond" |
3175 (interpret-markup layout props (markup #:musicglyph (assoc-get 1 standard-alte
ration-glyph-name-alist "")))) | 3175 (interpret-markup layout props (markup #:musicglyph (assoc-get 1 standard-alte
ration-glyph-name-alist "")))) |
3176 | 3176 |
3177 (define-markup-command (sesquisharp layout props) | 3177 (define-markup-command-compilable (sesquisharp layout props) |
3178 () | 3178 () |
3179 #:category music | 3179 #:category music |
3180 "Draw a 3/2 sharp symbol. | 3180 "Draw a 3/2 sharp symbol. |
3181 | 3181 |
3182 @lilypond[verbatim,quote] | 3182 @lilypond[verbatim,quote] |
3183 \\markup { | 3183 \\markup { |
3184 \\sesquisharp | 3184 \\sesquisharp |
3185 } | 3185 } |
3186 @end lilypond" | 3186 @end lilypond" |
3187 (interpret-markup layout props (markup #:musicglyph (assoc-get 3/4 standard-al
teration-glyph-name-alist "")))) | 3187 (interpret-markup layout props (markup #:musicglyph (assoc-get 3/4 standard-al
teration-glyph-name-alist "")))) |
3188 | 3188 |
3189 (define-markup-command (sharp layout props) | 3189 (define-markup-command-compilable (sharp layout props) |
3190 () | 3190 () |
3191 #:category music | 3191 #:category music |
3192 "Draw a sharp symbol. | 3192 "Draw a sharp symbol. |
3193 | 3193 |
3194 @lilypond[verbatim,quote] | 3194 @lilypond[verbatim,quote] |
3195 \\markup { | 3195 \\markup { |
3196 \\sharp | 3196 \\sharp |
3197 } | 3197 } |
3198 @end lilypond" | 3198 @end lilypond" |
3199 (interpret-markup layout props (markup #:musicglyph (assoc-get 1/2 standard-al
teration-glyph-name-alist "")))) | 3199 (interpret-markup layout props (markup #:musicglyph (assoc-get 1/2 standard-al
teration-glyph-name-alist "")))) |
3200 | 3200 |
3201 (define-markup-command (semisharp layout props) | 3201 (define-markup-command-compilable (semisharp layout props) |
3202 () | 3202 () |
3203 #:category music | 3203 #:category music |
3204 "Draw a semisharp symbol. | 3204 "Draw a semisharp symbol. |
3205 | 3205 |
3206 @lilypond[verbatim,quote] | 3206 @lilypond[verbatim,quote] |
3207 \\markup { | 3207 \\markup { |
3208 \\semisharp | 3208 \\semisharp |
3209 } | 3209 } |
3210 @end lilypond" | 3210 @end lilypond" |
3211 (interpret-markup layout props (markup #:musicglyph (assoc-get 1/4 standard-al
teration-glyph-name-alist "")))) | 3211 (interpret-markup layout props (markup #:musicglyph (assoc-get 1/4 standard-al
teration-glyph-name-alist "")))) |
3212 | 3212 |
3213 (define-markup-command (natural layout props) | 3213 (define-markup-command-compilable (natural layout props) |
3214 () | 3214 () |
3215 #:category music | 3215 #:category music |
3216 "Draw a natural symbol. | 3216 "Draw a natural symbol. |
3217 | 3217 |
3218 @lilypond[verbatim,quote] | 3218 @lilypond[verbatim,quote] |
3219 \\markup { | 3219 \\markup { |
3220 \\natural | 3220 \\natural |
3221 } | 3221 } |
3222 @end lilypond" | 3222 @end lilypond" |
3223 (interpret-markup layout props (markup #:musicglyph (assoc-get 0 standard-alte
ration-glyph-name-alist "")))) | 3223 (interpret-markup layout props (markup #:musicglyph (assoc-get 0 standard-alte
ration-glyph-name-alist "")))) |
3224 | 3224 |
3225 (define-markup-command (semiflat layout props) | 3225 (define-markup-command-compilable (semiflat layout props) |
3226 () | 3226 () |
3227 #:category music | 3227 #:category music |
3228 "Draw a semiflat symbol. | 3228 "Draw a semiflat symbol. |
3229 | 3229 |
3230 @lilypond[verbatim,quote] | 3230 @lilypond[verbatim,quote] |
3231 \\markup { | 3231 \\markup { |
3232 \\semiflat | 3232 \\semiflat |
3233 } | 3233 } |
3234 @end lilypond" | 3234 @end lilypond" |
3235 (interpret-markup layout props (markup #:musicglyph (assoc-get -1/4 standard-a
lteration-glyph-name-alist "")))) | 3235 (interpret-markup layout props (markup #:musicglyph (assoc-get -1/4 standard-a
lteration-glyph-name-alist "")))) |
3236 | 3236 |
3237 (define-markup-command (flat layout props) | 3237 (define-markup-command-compilable (flat layout props) |
3238 () | 3238 () |
3239 #:category music | 3239 #:category music |
3240 "Draw a flat symbol. | 3240 "Draw a flat symbol. |
3241 | 3241 |
3242 @lilypond[verbatim,quote] | 3242 @lilypond[verbatim,quote] |
3243 \\markup { | 3243 \\markup { |
3244 \\flat | 3244 \\flat |
3245 } | 3245 } |
3246 @end lilypond" | 3246 @end lilypond" |
3247 (interpret-markup layout props (markup #:musicglyph (assoc-get -1/2 standard-a
lteration-glyph-name-alist "")))) | 3247 (interpret-markup layout props (markup #:musicglyph (assoc-get -1/2 standard-a
lteration-glyph-name-alist "")))) |
3248 | 3248 |
3249 (define-markup-command (sesquiflat layout props) | 3249 (define-markup-command-compilable (sesquiflat layout props) |
3250 () | 3250 () |
3251 #:category music | 3251 #:category music |
3252 "Draw a 3/2 flat symbol. | 3252 "Draw a 3/2 flat symbol. |
3253 | 3253 |
3254 @lilypond[verbatim,quote] | 3254 @lilypond[verbatim,quote] |
3255 \\markup { | 3255 \\markup { |
3256 \\sesquiflat | 3256 \\sesquiflat |
3257 } | 3257 } |
3258 @end lilypond" | 3258 @end lilypond" |
3259 (interpret-markup layout props (markup #:musicglyph (assoc-get -3/4 standard-a
lteration-glyph-name-alist "")))) | 3259 (interpret-markup layout props (markup #:musicglyph (assoc-get -3/4 standard-a
lteration-glyph-name-alist "")))) |
3260 | 3260 |
3261 (define-markup-command (doubleflat layout props) | 3261 (define-markup-command-compilable (doubleflat layout props) |
3262 () | 3262 () |
3263 #:category music | 3263 #:category music |
3264 "Draw a double flat symbol. | 3264 "Draw a double flat symbol. |
3265 | 3265 |
3266 @lilypond[verbatim,quote] | 3266 @lilypond[verbatim,quote] |
3267 \\markup { | 3267 \\markup { |
3268 \\doubleflat | 3268 \\doubleflat |
3269 } | 3269 } |
3270 @end lilypond" | 3270 @end lilypond" |
3271 (interpret-markup layout props (markup #:musicglyph (assoc-get -1 standard-alt
eration-glyph-name-alist "")))) | 3271 (interpret-markup layout props (markup #:musicglyph (assoc-get -1 standard-alt
eration-glyph-name-alist "")))) |
3272 | 3272 |
3273 (define-markup-command (with-color layout props color arg) | 3273 (define-markup-command-compilable (with-color layout props color arg) |
3274 (color? markup?) | 3274 (color? markup?) |
3275 #:category other | 3275 #:category other |
3276 " | 3276 " |
3277 @cindex coloring text | 3277 @cindex coloring text |
3278 | 3278 |
3279 Draw @var{arg} in color specified by @var{color}. | 3279 Draw @var{arg} in color specified by @var{color}. |
3280 | 3280 |
3281 @lilypond[verbatim,quote] | 3281 @lilypond[verbatim,quote] |
3282 \\markup { | 3282 \\markup { |
3283 \\with-color #red | 3283 \\with-color #red |
3284 red | 3284 red |
3285 \\hspace #2 | 3285 \\hspace #2 |
3286 \\with-color #green | 3286 \\with-color #green |
3287 green | 3287 green |
3288 \\hspace #2 | 3288 \\hspace #2 |
3289 \\with-color #blue | 3289 \\with-color #blue |
3290 blue | 3290 blue |
3291 } | 3291 } |
3292 @end lilypond" | 3292 @end lilypond" |
3293 (let ((stil (interpret-markup layout props arg))) | 3293 (let ((stil (interpret-markup layout props arg))) |
3294 (ly:make-stencil (list 'color color (ly:stencil-expr stil)) | 3294 (ly:make-stencil (list 'color color (ly:stencil-expr stil)) |
3295 (ly:stencil-extent stil X) | 3295 (ly:stencil-extent stil X) |
3296 (ly:stencil-extent stil Y)))) | 3296 (ly:stencil-extent stil Y)))) |
3297 | 3297 |
3298 (define-markup-command (tied-lyric layout props str) | 3298 (define-markup-command-compilable (tied-lyric layout props str) |
3299 (string?) | 3299 (string?) |
3300 #:category music | 3300 #:category music |
3301 #:properties ((word-space)) | 3301 #:properties ((word-space)) |
3302 " | 3302 " |
3303 @cindex simple text string, with tie characters | 3303 @cindex simple text string, with tie characters |
3304 | 3304 |
3305 Like simple-markup, but use tie characters for @q{~} tilde symbols. | 3305 Like simple-markup, but use tie characters for @q{~} tilde symbols. |
3306 | 3306 |
3307 @lilypond[verbatim,quote] | 3307 @lilypond[verbatim,quote] |
3308 \\markup \\column { | 3308 \\markup \\column { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3342 (replace-short new-str new-mkp))))) | 3342 (replace-short new-str new-mkp))))) |
3343 | 3343 |
3344 (interpret-markup layout | 3344 (interpret-markup layout |
3345 props | 3345 props |
3346 (replace-short str (markup)))) | 3346 (replace-short str (markup)))) |
3347 | 3347 |
3348 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 3348 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3349 ;; glyphs | 3349 ;; glyphs |
3350 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 3350 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3351 | 3351 |
3352 (define-markup-command (arrow-head layout props axis dir filled) | 3352 (define-markup-command-compilable (arrow-head layout props axis dir filled) |
3353 (integer? ly:dir? boolean?) | 3353 (integer? ly:dir? boolean?) |
3354 #:category graphic | 3354 #:category graphic |
3355 "Produce an arrow head in specified direction and axis. | 3355 "Produce an arrow head in specified direction and axis. |
3356 Use the filled head if @var{filled} is specified. | 3356 Use the filled head if @var{filled} is specified. |
3357 @lilypond[verbatim,quote] | 3357 @lilypond[verbatim,quote] |
3358 \\markup { | 3358 \\markup { |
3359 \\fontsize #5 { | 3359 \\fontsize #5 { |
3360 \\general-align #Y #DOWN { | 3360 \\general-align #Y #DOWN { |
3361 \\arrow-head #Y #UP ##t | 3361 \\arrow-head #Y #UP ##t |
3362 \\arrow-head #Y #DOWN ##f | 3362 \\arrow-head #Y #DOWN ##f |
3363 \\hspace #2 | 3363 \\hspace #2 |
3364 \\arrow-head #X #RIGHT ##f | 3364 \\arrow-head #X #RIGHT ##f |
3365 \\arrow-head #X #LEFT ##f | 3365 \\arrow-head #X #LEFT ##f |
3366 } | 3366 } |
3367 } | 3367 } |
3368 } | 3368 } |
3369 @end lilypond" | 3369 @end lilypond" |
3370 (let* | 3370 (let* |
3371 ((name (format #f "arrowheads.~a.~a~a" | 3371 ((name (format #f "arrowheads.~a.~a~a" |
3372 (if filled | 3372 (if filled |
3373 "close" | 3373 "close" |
3374 "open") | 3374 "open") |
3375 axis | 3375 axis |
3376 dir))) | 3376 dir))) |
3377 (ly:font-get-glyph | 3377 (ly:font-get-glyph |
3378 (ly:paper-get-font layout (cons '((font-encoding . fetaMusic)) | 3378 (ly:paper-get-font layout (cons '((font-encoding . fetaMusic)) |
3379 props)) | 3379 props)) |
3380 name))) | 3380 name))) |
3381 | 3381 |
3382 (define-markup-command (lookup layout props glyph-name) | 3382 (define-markup-command-compilable (lookup layout props glyph-name) |
3383 (string?) | 3383 (string?) |
3384 #:category other | 3384 #:category other |
3385 "Lookup a glyph by name. | 3385 "Lookup a glyph by name. |
3386 | 3386 |
3387 @lilypond[verbatim,quote] | 3387 @lilypond[verbatim,quote] |
3388 \\markup { | 3388 \\markup { |
3389 \\override #'(font-encoding . fetaBraces) { | 3389 \\override #'(font-encoding . fetaBraces) { |
3390 \\lookup #\"brace200\" | 3390 \\lookup #\"brace200\" |
3391 \\hspace #2 | 3391 \\hspace #2 |
3392 \\rotate #180 | 3392 \\rotate #180 |
3393 \\lookup #\"brace180\" | 3393 \\lookup #\"brace180\" |
3394 } | 3394 } |
3395 } | 3395 } |
3396 @end lilypond" | 3396 @end lilypond" |
3397 (ly:font-get-glyph (ly:paper-get-font layout props) | 3397 (ly:font-get-glyph (ly:paper-get-font layout props) |
3398 glyph-name)) | 3398 glyph-name)) |
3399 | 3399 |
3400 (define-markup-command (char layout props num) | 3400 (define-markup-command-compilable (char layout props num) |
3401 (integer?) | 3401 (integer?) |
3402 #:category other | 3402 #:category other |
3403 "Produce a single character. Characters encoded in hexadecimal | 3403 "Produce a single character. Characters encoded in hexadecimal |
3404 format require the prefix @code{#x}. | 3404 format require the prefix @code{#x}. |
3405 | 3405 |
3406 @lilypond[verbatim,quote] | 3406 @lilypond[verbatim,quote] |
3407 \\markup { | 3407 \\markup { |
3408 \\char #65 \\char ##x00a9 | 3408 \\char #65 \\char ##x00a9 |
3409 } | 3409 } |
3410 @end lilypond" | 3410 @end lilypond" |
(...skipping 11 matching lines...) Expand all Loading... |
3422 ((repeat) (let ((the-length (1+ (quotient (1- number) the-alphabet-length)
)) | 3422 ((repeat) (let ((the-length (1+ (quotient (1- number) the-alphabet-length)
)) |
3423 (the-index (remainder (1- number) the-alphabet-length)
)) | 3423 (the-index (remainder (1- number) the-alphabet-length)
)) |
3424 (make-string the-length (vector-ref the-alphabet the-index)))) | 3424 (make-string the-length (vector-ref the-alphabet the-index)))) |
3425 ((combine) (let loop ((num (1- number))) | 3425 ((combine) (let loop ((num (1- number))) |
3426 (if (< num the-alphabet-length) | 3426 (if (< num the-alphabet-length) |
3427 (string (vector-ref the-alphabet num)) | 3427 (string (vector-ref the-alphabet num)) |
3428 (string-append | 3428 (string-append |
3429 (loop (1- (quotient num the-alphabet-length))) | 3429 (loop (1- (quotient num the-alphabet-length))) |
3430 (loop (remainder num the-alphabet-length))))))))) | 3430 (loop (remainder num the-alphabet-length))))))))) |
3431 | 3431 |
3432 (define-markup-command (markletter layout props num) | 3432 (define-markup-command-compilable (markletter layout props num) |
3433 (integer?) | 3433 (integer?) |
3434 #:category other | 3434 #:category other |
3435 "Make a markup letter for @var{num}. The letters start with A | 3435 "Make a markup letter for @var{num}. The letters start with A |
3436 to@tie{}Z (skipping letter@tie{}I), and continue with double letters. | 3436 to@tie{}Z (skipping letter@tie{}I), and continue with double letters. |
3437 | 3437 |
3438 @lilypond[verbatim,quote] | 3438 @lilypond[verbatim,quote] |
3439 \\markup { | 3439 \\markup { |
3440 \\markletter #8 | 3440 \\markletter #8 |
3441 \\hspace #2 | 3441 \\hspace #2 |
3442 \\markletter #26 | 3442 \\markletter #26 |
3443 } | 3443 } |
3444 @end lilypond" | 3444 @end lilypond" |
3445 (ly:text-interface::interpret-markup layout props | 3445 (ly:text-interface::interpret-markup layout props |
3446 (markgeneric-string num 'alphabet-omit-i
'combine))) | 3446 (markgeneric-string num 'alphabet-omit-i
'combine))) |
3447 | 3447 |
3448 (define-markup-command (markalphabet layout props num) | 3448 (define-markup-command-compilable (markalphabet layout props num) |
3449 (integer?) | 3449 (integer?) |
3450 #:category other | 3450 #:category other |
3451 "Make a markup letter for @var{num}. The letters start with A to@tie{}Z | 3451 "Make a markup letter for @var{num}. The letters start with A to@tie{}Z |
3452 and continue with double letters. | 3452 and continue with double letters. |
3453 | 3453 |
3454 @lilypond[verbatim,quote] | 3454 @lilypond[verbatim,quote] |
3455 \\markup { | 3455 \\markup { |
3456 \\markalphabet #8 | 3456 \\markalphabet #8 |
3457 \\hspace #2 | 3457 \\hspace #2 |
3458 \\markalphabet #26 | 3458 \\markalphabet #26 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3515 (begin | 3515 (begin |
3516 ;; for some numbers we need to shift the slash/backslash up or | 3516 ;; for some numbers we need to shift the slash/backslash up or |
3517 ;; down to make the slashed digit look better | 3517 ;; down to make the slashed digit look better |
3518 (set! slash-stencil (adjust-slash-stencil num forward slash-stencil ma
g)) | 3518 (set! slash-stencil (adjust-slash-stencil num forward slash-stencil ma
g)) |
3519 (set! number-stencil | 3519 (set! number-stencil |
3520 (ly:stencil-add number-stencil slash-stencil))) | 3520 (ly:stencil-add number-stencil slash-stencil))) |
3521 (ly:warning "Unable to create slashed digit ~a" num)) | 3521 (ly:warning "Unable to create slashed digit ~a" num)) |
3522 number-stencil)) | 3522 number-stencil)) |
3523 | 3523 |
3524 | 3524 |
3525 (define-markup-command (slashed-digit layout props num) | 3525 (define-markup-command-compilable (slashed-digit layout props num) |
3526 (integer?) | 3526 (integer?) |
3527 #:category other | 3527 #:category other |
3528 #:properties ((font-size 0) | 3528 #:properties ((font-size 0) |
3529 (thickness 1.6)) | 3529 (thickness 1.6)) |
3530 " | 3530 " |
3531 @cindex slashed digit | 3531 @cindex slashed digit |
3532 | 3532 |
3533 A feta number, with slash. This is for use in the context of | 3533 A feta number, with slash. This is for use in the context of |
3534 figured bass notation. | 3534 figured bass notation. |
3535 @lilypond[verbatim,quote] | 3535 @lilypond[verbatim,quote] |
3536 \\markup { | 3536 \\markup { |
3537 \\slashed-digit #5 | 3537 \\slashed-digit #5 |
3538 \\hspace #2 | 3538 \\hspace #2 |
3539 \\override #'(thickness . 3) | 3539 \\override #'(thickness . 3) |
3540 \\slashed-digit #7 | 3540 \\slashed-digit #7 |
3541 } | 3541 } |
3542 @end lilypond" | 3542 @end lilypond" |
3543 (slashed-digit-internal layout props num #t font-size thickness)) | 3543 (slashed-digit-internal layout props num #t font-size thickness)) |
3544 | 3544 |
3545 (define-markup-command (backslashed-digit layout props num) | 3545 (define-markup-command-compilable (backslashed-digit layout props num) |
3546 (integer?) | 3546 (integer?) |
3547 #:category other | 3547 #:category other |
3548 #:properties ((font-size 0) | 3548 #:properties ((font-size 0) |
3549 (thickness 1.6)) | 3549 (thickness 1.6)) |
3550 " | 3550 " |
3551 @cindex backslashed digit | 3551 @cindex backslashed digit |
3552 | 3552 |
3553 A feta number, with backslash. This is for use in the context of | 3553 A feta number, with backslash. This is for use in the context of |
3554 figured bass notation. | 3554 figured bass notation. |
3555 @lilypond[verbatim,quote] | 3555 @lilypond[verbatim,quote] |
(...skipping 23 matching lines...) Expand all Loading... |
3579 (moveto 1.025 0.935) | 3579 (moveto 1.025 0.935) |
3580 (rcurveto 0 0.182 -0.148 0.33 -0.33 0.33) | 3580 (rcurveto 0 0.182 -0.148 0.33 -0.33 0.33) |
3581 (rcurveto -0.182 0 -0.33 -0.148 -0.33 -0.33) | 3581 (rcurveto -0.182 0 -0.33 -0.148 -0.33 -0.33) |
3582 (moveto -0.68 0.77) | 3582 (moveto -0.68 0.77) |
3583 (rlineto 0.66 1.43) | 3583 (rlineto 0.66 1.43) |
3584 (rcurveto 0.132 0.286 0.55 0.44 0.385 -0.33) | 3584 (rcurveto 0.132 0.286 0.55 0.44 0.385 -0.33) |
3585 (moveto 2.07 0.77) | 3585 (moveto 2.07 0.77) |
3586 (rlineto 0.66 1.43) | 3586 (rlineto 0.66 1.43) |
3587 (rcurveto 0.132 0.286 0.55 0.44 0.385 -0.33))) | 3587 (rcurveto 0.132 0.286 0.55 0.44 0.385 -0.33))) |
3588 | 3588 |
3589 (define-markup-command (eyeglasses layout props) | 3589 (define-markup-command-compilable (eyeglasses layout props) |
3590 () | 3590 () |
3591 #:category other | 3591 #:category other |
3592 "Prints out eyeglasses, indicating strongly to look at the conductor. | 3592 "Prints out eyeglasses, indicating strongly to look at the conductor. |
3593 @lilypond[verbatim,quote] | 3593 @lilypond[verbatim,quote] |
3594 \\markup { \\eyeglasses } | 3594 \\markup { \\eyeglasses } |
3595 @end lilypond" | 3595 @end lilypond" |
3596 (interpret-markup layout props | 3596 (interpret-markup layout props |
3597 (make-override-markup '(line-cap-style . butt) | 3597 (make-override-markup '(line-cap-style . butt) |
3598 (make-path-markup 0.15 eyeglassespath)
))) | 3598 (make-path-markup 0.15 eyeglassespath)
))) |
3599 | 3599 |
3600 (define-markup-command (left-brace layout props size) | 3600 (define-markup-command-compilable (left-brace layout props size) |
3601 (number?) | 3601 (number?) |
3602 #:category other | 3602 #:category other |
3603 " | 3603 " |
3604 A feta brace in point size @var{size}. | 3604 A feta brace in point size @var{size}. |
3605 | 3605 |
3606 @lilypond[verbatim,quote] | 3606 @lilypond[verbatim,quote] |
3607 \\markup { | 3607 \\markup { |
3608 \\left-brace #35 | 3608 \\left-brace #35 |
3609 \\hspace #2 | 3609 \\hspace #2 |
3610 \\left-brace #45 | 3610 \\left-brace #45 |
(...skipping 20 matching lines...) Expand all Loading... |
3631 (> scaled-size (interval-length | 3631 (> scaled-size (interval-length |
3632 (ly:stencil-extent (glyph glyph-count) Y)))) | 3632 (ly:stencil-extent (glyph glyph-count) Y)))) |
3633 (begin | 3633 (begin |
3634 (ly:warning (_ "no brace found for point size ~S ") size) | 3634 (ly:warning (_ "no brace found for point size ~S ") size) |
3635 (ly:warning (_ "defaulting to ~S pt") | 3635 (ly:warning (_ "defaulting to ~S pt") |
3636 (/ (* scale (interval-length | 3636 (/ (* scale (interval-length |
3637 (ly:stencil-extent glyph-found Y))) | 3637 (ly:stencil-extent glyph-found Y))) |
3638 (ly:pt 1))))) | 3638 (ly:pt 1))))) |
3639 glyph-found)) | 3639 glyph-found)) |
3640 | 3640 |
3641 (define-markup-command (right-brace layout props size) | 3641 (define-markup-command-compilable (right-brace layout props size) |
3642 (number?) | 3642 (number?) |
3643 #:category other | 3643 #:category other |
3644 " | 3644 " |
3645 A feta brace in point size @var{size}, rotated 180 degrees. | 3645 A feta brace in point size @var{size}, rotated 180 degrees. |
3646 | 3646 |
3647 @lilypond[verbatim,quote] | 3647 @lilypond[verbatim,quote] |
3648 \\markup { | 3648 \\markup { |
3649 \\right-brace #45 | 3649 \\right-brace #45 |
3650 \\hspace #2 | 3650 \\hspace #2 |
3651 \\right-brace #35 | 3651 \\right-brace #35 |
3652 } | 3652 } |
3653 @end lilypond" | 3653 @end lilypond" |
3654 (interpret-markup layout props (markup #:rotate 180 #:left-brace size))) | 3654 (interpret-markup layout props (markup #:rotate 180 #:left-brace size))) |
3655 | 3655 |
3656 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 3656 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3657 ;; the note command. | 3657 ;; the note command. |
3658 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 3658 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3659 | 3659 |
3660 ;; TODO: better syntax. | 3660 ;; TODO: better syntax. |
3661 | 3661 |
3662 (define-markup-command (note-by-number layout props log dot-count dir) | 3662 (define-markup-command-compilable (note-by-number layout props log dot-count dir
) |
3663 (number? number? number?) | 3663 (number? number? number?) |
3664 #:category music | 3664 #:category music |
3665 #:properties ((font-size 0) | 3665 #:properties ((font-size 0) |
3666 (flag-style '()) | 3666 (flag-style '()) |
3667 (style '())) | 3667 (style '())) |
3668 " | 3668 " |
3669 @cindex note, within text, by @code{log} and @code{dot-count} | 3669 @cindex note, within text, by @code{log} and @code{dot-count} |
3670 | 3670 |
3671 Construct a note symbol, with stem and flag. By using fractional values for | 3671 Construct a note symbol, with stem and flag. By using fractional values for |
3672 @var{dir}, longer or shorter stems can be obtained. | 3672 @var{dir}, longer or shorter stems can be obtained. |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3903 (if (and match (string=? duration-string (match:substring match 0))) | 3903 (if (and match (string=? duration-string (match:substring match 0))) |
3904 (let ((len (match:substring match 1)) | 3904 (let ((len (match:substring match 1)) |
3905 (dots (match:substring match 2))) | 3905 (dots (match:substring match 2))) |
3906 (list (cond ((string=? len "breve") -1) | 3906 (list (cond ((string=? len "breve") -1) |
3907 ((string=? len "longa") -2) | 3907 ((string=? len "longa") -2) |
3908 ((string=? len "maxima") -3) | 3908 ((string=? len "maxima") -3) |
3909 (else (log2 (string->number len)))) | 3909 (else (log2 (string->number len)))) |
3910 (if dots (string-length dots) 0))) | 3910 (if dots (string-length dots) 0))) |
3911 (ly:error (_ "not a valid duration string: ~a") duration-string)))) | 3911 (ly:error (_ "not a valid duration string: ~a") duration-string)))) |
3912 | 3912 |
3913 (define-markup-command (note layout props duration dir) | 3913 (define-markup-command-compilable (note layout props duration dir) |
3914 (ly:duration? number?) | 3914 (ly:duration? number?) |
3915 #:category music | 3915 #:category music |
3916 #:properties (note-by-number-markup) | 3916 #:properties (note-by-number-markup) |
3917 " | 3917 " |
3918 @cindex note, within text, by duration | 3918 @cindex note, within text, by duration |
3919 | 3919 |
3920 This produces a note with a stem pointing in @var{dir} direction, with | 3920 This produces a note with a stem pointing in @var{dir} direction, with |
3921 the @var{duration} for the note head type and augmentation dots. For | 3921 the @var{duration} for the note head type and augmentation dots. For |
3922 example, @code{\\note @{4.@} #-0.75} creates a dotted quarter note, with | 3922 example, @code{\\note @{4.@} #-0.75} creates a dotted quarter note, with |
3923 a shortened down stem. | 3923 a shortened down stem. |
3924 | 3924 |
3925 @lilypond[verbatim,quote] | 3925 @lilypond[verbatim,quote] |
3926 \\markup { | 3926 \\markup { |
3927 \\override #'(style . cross) | 3927 \\override #'(style . cross) |
3928 \\note {4..} #UP | 3928 \\note {4..} #UP |
3929 \\hspace #2 | 3929 \\hspace #2 |
3930 \\note {\\breve} #0 | 3930 \\note {\\breve} #0 |
3931 } | 3931 } |
3932 @end lilypond" | 3932 @end lilypond" |
3933 (note-by-number-markup layout props | 3933 (note-by-number-markup layout props |
3934 (ly:duration-log duration) | 3934 (ly:duration-log duration) |
3935 (ly:duration-dot-count duration) | 3935 (ly:duration-dot-count duration) |
3936 dir)) | 3936 dir)) |
3937 | 3937 |
3938 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 3938 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3939 ;; the rest command. | 3939 ;; the rest command. |
3940 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 3940 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
3941 | 3941 |
3942 (define-markup-command (rest-by-number layout props log dot-count) | 3942 (define-markup-command-compilable (rest-by-number layout props log dot-count) |
3943 (number? number?) | 3943 (number? number?) |
3944 #:category music | 3944 #:category music |
3945 #:properties ((font-size 0) | 3945 #:properties ((font-size 0) |
3946 (style '()) | 3946 (style '()) |
3947 (multi-measure-rest #f)) | 3947 (multi-measure-rest #f)) |
3948 " | 3948 " |
3949 @cindex rest, within text, by @code{log} and @code{dot-count} | 3949 @cindex rest, within text, by @code{log} and @code{dot-count} |
3950 @cindex multi-measure rest, within text, by @code{log} and @code{dot-count} | 3950 @cindex multi-measure rest, within text, by @code{log} and @code{dot-count} |
3951 | 3951 |
3952 A rest or multi-measure-rest symbol. | 3952 A rest or multi-measure-rest symbol. |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4047 dots | 4047 dots |
4048 (cons | 4048 (cons |
4049 (+ (cdr (ly:stencil-extent rest-glyph X)) dot-width) | 4049 (+ (cdr (ly:stencil-extent rest-glyph X)) dot-width) |
4050 (if (< log 2) | 4050 (if (< log 2) |
4051 (interval-center (ly:stencil-extent rest-glyph Y)) | 4051 (interval-center (ly:stencil-extent rest-glyph Y)) |
4052 (- (interval-end (ly:stencil-extent rest-glyph Y)) | 4052 (- (interval-end (ly:stencil-extent rest-glyph Y)) |
4053 (/ (* 2 dot-width) 3))))) | 4053 (/ (* 2 dot-width) 3))))) |
4054 rest-glyph))) | 4054 rest-glyph))) |
4055 rest-glyph)) | 4055 rest-glyph)) |
4056 | 4056 |
4057 (define-markup-command (rest layout props duration) | 4057 (define-markup-command-compilable (rest layout props duration) |
4058 (string?) | 4058 (string?) |
4059 #:category music | 4059 #:category music |
4060 #:properties ((style '()) | 4060 #:properties ((style '()) |
4061 (multi-measure-rest #f) | 4061 (multi-measure-rest #f) |
4062 (multi-measure-rest-number #t) | 4062 (multi-measure-rest-number #t) |
4063 (word-space 0.6)) | 4063 (word-space 0.6)) |
4064 " | 4064 " |
4065 @cindex rest, within text, by string | 4065 @cindex rest, within text, by string |
4066 @cindex multi-measure rest, within text, by string | 4066 @cindex multi-measure rest, within text, by string |
4067 | 4067 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4195 ;; Ugh, hardcoded | 4195 ;; Ugh, hardcoded |
4196 0.8)))) | 4196 0.8)))) |
4197 (if multi-measure-rest | 4197 (if multi-measure-rest |
4198 mmr-stil | 4198 mmr-stil |
4199 stil)))) | 4199 stil)))) |
4200 | 4200 |
4201 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4201 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4202 ;; fermata markup | 4202 ;; fermata markup |
4203 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4203 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4204 | 4204 |
4205 (define-markup-command (fermata layout props) () | 4205 (define-markup-command-compilable (fermata layout props) () |
4206 #:category music | 4206 #:category music |
4207 #:properties ((direction UP)) | 4207 #:properties ((direction UP)) |
4208 "Create a fermata glyph. When @var{direction} is @code{DOWN}, use | 4208 "Create a fermata glyph. When @var{direction} is @code{DOWN}, use |
4209 an inverted glyph. Note that within music, one would usually use the | 4209 an inverted glyph. Note that within music, one would usually use the |
4210 @code{\\fermata} articulation instead of a markup. | 4210 @code{\\fermata} articulation instead of a markup. |
4211 | 4211 |
4212 @lilypond[verbatim,quote] | 4212 @lilypond[verbatim,quote] |
4213 { c''1^\\markup \\fermata d''1_\\markup \\fermata } | 4213 { c''1^\\markup \\fermata d''1_\\markup \\fermata } |
4214 | 4214 |
4215 \\markup { \\fermata \\override #`(direction . ,DOWN) \\fermata } | 4215 \\markup { \\fermata \\override #`(direction . ,DOWN) \\fermata } |
4216 @end lilypond | 4216 @end lilypond |
4217 " | 4217 " |
4218 (interpret-markup layout props | 4218 (interpret-markup layout props |
4219 (if (eqv? direction DOWN) | 4219 (if (eqv? direction DOWN) |
4220 (markup #:musicglyph "scripts.dfermata") | 4220 (markup #:musicglyph "scripts.dfermata") |
4221 (markup #:musicglyph "scripts.ufermata")))) | 4221 (markup #:musicglyph "scripts.ufermata")))) |
4222 | 4222 |
4223 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4223 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4224 ;; translating. | 4224 ;; translating. |
4225 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4225 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4226 | 4226 |
4227 (define-markup-command (lower layout props amount arg) | 4227 (define-markup-command-compilable (lower layout props amount arg) |
4228 (number? markup?) | 4228 (number? markup?) |
4229 #:category align | 4229 #:category align |
4230 " | 4230 " |
4231 @cindex lowering text | 4231 @cindex lowering text |
4232 | 4232 |
4233 Lower @var{arg} by the distance @var{amount}. | 4233 Lower @var{arg} by the distance @var{amount}. |
4234 A negative @var{amount} indicates raising; see also @code{\\raise}. | 4234 A negative @var{amount} indicates raising; see also @code{\\raise}. |
4235 | 4235 |
4236 @lilypond[verbatim,quote] | 4236 @lilypond[verbatim,quote] |
4237 \\markup { | 4237 \\markup { |
4238 one | 4238 one |
4239 \\lower #3 | 4239 \\lower #3 |
4240 two | 4240 two |
4241 three | 4241 three |
4242 } | 4242 } |
4243 @end lilypond" | 4243 @end lilypond" |
4244 (ly:stencil-translate-axis (interpret-markup layout props arg) | 4244 (ly:stencil-translate-axis (interpret-markup layout props arg) |
4245 (- amount) Y)) | 4245 (- amount) Y)) |
4246 | 4246 |
4247 (define-markup-command (translate-scaled layout props offset arg) | 4247 (define-markup-command-compilable (translate-scaled layout props offset arg) |
4248 (number-pair? markup?) | 4248 (number-pair? markup?) |
4249 #:category align | 4249 #:category align |
4250 #:properties ((font-size 0)) | 4250 #:properties ((font-size 0)) |
4251 " | 4251 " |
4252 @cindex translating text | 4252 @cindex translating text |
4253 @cindex scaling text | 4253 @cindex scaling text |
4254 | 4254 |
4255 Translate @var{arg} by @var{offset}, scaling the offset by the | 4255 Translate @var{arg} by @var{offset}, scaling the offset by the |
4256 @code{font-size}. | 4256 @code{font-size}. |
4257 | 4257 |
4258 @lilypond[verbatim,quote] | 4258 @lilypond[verbatim,quote] |
4259 \\markup { | 4259 \\markup { |
4260 \\fontsize #5 { | 4260 \\fontsize #5 { |
4261 * \\translate #'(2 . 3) translate | 4261 * \\translate #'(2 . 3) translate |
4262 \\hspace #2 | 4262 \\hspace #2 |
4263 * \\translate-scaled #'(2 . 3) translate-scaled | 4263 * \\translate-scaled #'(2 . 3) translate-scaled |
4264 } | 4264 } |
4265 } | 4265 } |
4266 @end lilypond" | 4266 @end lilypond" |
4267 (let* ((factor (magstep font-size)) | 4267 (let* ((factor (magstep font-size)) |
4268 (scaled (cons (* factor (car offset)) | 4268 (scaled (cons (* factor (car offset)) |
4269 (* factor (cdr offset))))) | 4269 (* factor (cdr offset))))) |
4270 (ly:stencil-translate (interpret-markup layout props arg) | 4270 (ly:stencil-translate (interpret-markup layout props arg) |
4271 scaled))) | 4271 scaled))) |
4272 | 4272 |
4273 (define-markup-command (raise layout props amount arg) | 4273 (define-markup-command-compilable (raise layout props amount arg) |
4274 (number? markup?) | 4274 (number? markup?) |
4275 #:category align | 4275 #:category align |
4276 " | 4276 " |
4277 @cindex raising text | 4277 @cindex raising text |
4278 | 4278 |
4279 Raise @var{arg} by the distance @var{amount}. | 4279 Raise @var{arg} by the distance @var{amount}. |
4280 A negative @var{amount} indicates lowering, see also @code{\\lower}. | 4280 A negative @var{amount} indicates lowering, see also @code{\\lower}. |
4281 | 4281 |
4282 The argument to @code{\\raise} is the vertical displacement amount, | 4282 The argument to @code{\\raise} is the vertical displacement amount, |
4283 measured in (global) staff spaces. @code{\\raise} and @code{\\super} | 4283 measured in (global) staff spaces. @code{\\raise} and @code{\\super} |
4284 raise objects in relation to their surrounding markups. | 4284 raise objects in relation to their surrounding markups. |
4285 | 4285 |
4286 If the text object itself is positioned above or below the staff, then | 4286 If the text object itself is positioned above or below the staff, then |
4287 @code{\\raise} cannot be used to move it, since the mechanism that | 4287 @code{\\raise} cannot be used to move it, since the mechanism that |
4288 positions it next to the staff cancels any shift made with | 4288 positions it next to the staff cancels any shift made with |
4289 @code{\\raise}. For vertical positioning, use the @code{padding} | 4289 @code{\\raise}. For vertical positioning, use the @code{padding} |
4290 and/or @code{extra-offset} properties. | 4290 and/or @code{extra-offset} properties. |
4291 | 4291 |
4292 @lilypond[verbatim,quote] | 4292 @lilypond[verbatim,quote] |
4293 \\markup { | 4293 \\markup { |
4294 C | 4294 C |
4295 \\small | 4295 \\small |
4296 \\bold | 4296 \\bold |
4297 \\raise #1.0 | 4297 \\raise #1.0 |
4298 9/7+ | 4298 9/7+ |
4299 } | 4299 } |
4300 @end lilypond" | 4300 @end lilypond" |
4301 (ly:stencil-translate-axis (interpret-markup layout props arg) amount Y)) | 4301 (ly:stencil-translate-axis (interpret-markup layout props arg) amount Y)) |
4302 | 4302 |
4303 (define-markup-command (fraction layout props arg1 arg2) | 4303 (define-markup-command-compilable (fraction layout props arg1 arg2) |
4304 (markup? markup?) | 4304 (markup? markup?) |
4305 #:category other | 4305 #:category other |
4306 #:properties ((font-size 0)) | 4306 #:properties ((font-size 0)) |
4307 " | 4307 " |
4308 @cindex creating text fraction | 4308 @cindex creating text fraction |
4309 | 4309 |
4310 Make a fraction of two markups. | 4310 Make a fraction of two markups. |
4311 @lilypond[verbatim,quote] | 4311 @lilypond[verbatim,quote] |
4312 \\markup { | 4312 \\markup { |
4313 π ≈ | 4313 π ≈ |
(...skipping 15 matching lines...) Expand all Loading... |
4329 ;; should stack mols separately, to maintain LINE on baseline | 4329 ;; should stack mols separately, to maintain LINE on baseline |
4330 (stack (stack-lines DOWN padding baseline (list m1 line m2)))) | 4330 (stack (stack-lines DOWN padding baseline (list m1 line m2)))) |
4331 (set! stack | 4331 (set! stack |
4332 (ly:stencil-aligned-to stack Y CENTER)) | 4332 (ly:stencil-aligned-to stack Y CENTER)) |
4333 (set! stack | 4333 (set! stack |
4334 (ly:stencil-aligned-to stack X LEFT)) | 4334 (ly:stencil-aligned-to stack X LEFT)) |
4335 ;; should have EX dimension | 4335 ;; should have EX dimension |
4336 ;; empirical anyway | 4336 ;; empirical anyway |
4337 (ly:stencil-translate-axis stack offset Y)))) | 4337 (ly:stencil-translate-axis stack offset Y)))) |
4338 | 4338 |
4339 (define-markup-command (normal-size-super layout props arg) | 4339 (define-markup-command-compilable (normal-size-super layout props arg) |
4340 (markup?) | 4340 (markup?) |
4341 #:category font | 4341 #:category font |
4342 #:properties ((font-size 0)) | 4342 #:properties ((font-size 0)) |
4343 " | 4343 " |
4344 @cindex setting superscript, in standard font size | 4344 @cindex setting superscript, in standard font size |
4345 | 4345 |
4346 Set @var{arg} in superscript with a normal font size. | 4346 Set @var{arg} in superscript with a normal font size. |
4347 | 4347 |
4348 @lilypond[verbatim,quote] | 4348 @lilypond[verbatim,quote] |
4349 \\markup { | 4349 \\markup { |
4350 default | 4350 default |
4351 \\normal-size-super { | 4351 \\normal-size-super { |
4352 superscript in standard size | 4352 superscript in standard size |
4353 } | 4353 } |
4354 } | 4354 } |
4355 @end lilypond" | 4355 @end lilypond" |
4356 (ly:stencil-translate-axis | 4356 (ly:stencil-translate-axis |
4357 (interpret-markup layout props arg) | 4357 (interpret-markup layout props arg) |
4358 (* 1.0 (magstep font-size)) Y)) | 4358 (* 1.0 (magstep font-size)) Y)) |
4359 | 4359 |
4360 (define-markup-command (super layout props arg) | 4360 (define-markup-command-compilable (super layout props arg) |
4361 (markup?) | 4361 (markup?) |
4362 #:category font | 4362 #:category font |
4363 #:properties ((font-size 0)) | 4363 #:properties ((font-size 0)) |
4364 " | 4364 " |
4365 @cindex superscript text | 4365 @cindex superscript text |
4366 | 4366 |
4367 Set @var{arg} in superscript. | 4367 Set @var{arg} in superscript. |
4368 | 4368 |
4369 @lilypond[verbatim,quote] | 4369 @lilypond[verbatim,quote] |
4370 \\markup { | 4370 \\markup { |
4371 E = | 4371 E = |
4372 \\concat { | 4372 \\concat { |
4373 mc | 4373 mc |
4374 \\super | 4374 \\super |
4375 2 | 4375 2 |
4376 } | 4376 } |
4377 } | 4377 } |
4378 @end lilypond" | 4378 @end lilypond" |
4379 (ly:stencil-translate-axis | 4379 (ly:stencil-translate-axis |
4380 (interpret-markup | 4380 (interpret-markup |
4381 layout | 4381 layout |
4382 (cons `((font-size . ,(- font-size 3))) props) | 4382 (cons `((font-size . ,(- font-size 3))) props) |
4383 arg) | 4383 arg) |
4384 (* 1.0 (magstep font-size)) ; original font-size | 4384 (* 1.0 (magstep font-size)) ; original font-size |
4385 Y)) | 4385 Y)) |
4386 | 4386 |
4387 (define-markup-command (translate layout props offset arg) | 4387 (define-markup-command-compilable (translate layout props offset arg) |
4388 (number-pair? markup?) | 4388 (number-pair? markup?) |
4389 #:category align | 4389 #:category align |
4390 " | 4390 " |
4391 @cindex translating text | 4391 @cindex translating text |
4392 | 4392 |
4393 Translate @var{arg} relative to its surroundings. @var{offset} | 4393 Translate @var{arg} relative to its surroundings. @var{offset} |
4394 is a pair of numbers representing the displacement in the X and Y axis. | 4394 is a pair of numbers representing the displacement in the X and Y axis. |
4395 | 4395 |
4396 @lilypond[verbatim,quote] | 4396 @lilypond[verbatim,quote] |
4397 \\markup { | 4397 \\markup { |
4398 * | 4398 * |
4399 \\translate #'(2 . 3) | 4399 \\translate #'(2 . 3) |
4400 \\line { translated two spaces right, three up } | 4400 \\line { translated two spaces right, three up } |
4401 } | 4401 } |
4402 @end lilypond" | 4402 @end lilypond" |
4403 (ly:stencil-translate (interpret-markup layout props arg) | 4403 (ly:stencil-translate (interpret-markup layout props arg) |
4404 offset)) | 4404 offset)) |
4405 | 4405 |
4406 (define-markup-command (sub layout props arg) | 4406 (define-markup-command-compilable (sub layout props arg) |
4407 (markup?) | 4407 (markup?) |
4408 #:category font | 4408 #:category font |
4409 #:properties ((font-size 0)) | 4409 #:properties ((font-size 0)) |
4410 " | 4410 " |
4411 @cindex subscript text | 4411 @cindex subscript text |
4412 | 4412 |
4413 Set @var{arg} in subscript. | 4413 Set @var{arg} in subscript. |
4414 | 4414 |
4415 @lilypond[verbatim,quote] | 4415 @lilypond[verbatim,quote] |
4416 \\markup { | 4416 \\markup { |
4417 \\concat { | 4417 \\concat { |
4418 H | 4418 H |
4419 \\sub { | 4419 \\sub { |
4420 2 | 4420 2 |
4421 } | 4421 } |
4422 O | 4422 O |
4423 } | 4423 } |
4424 } | 4424 } |
4425 @end lilypond" | 4425 @end lilypond" |
4426 (ly:stencil-translate-axis | 4426 (ly:stencil-translate-axis |
4427 (interpret-markup | 4427 (interpret-markup |
4428 layout | 4428 layout |
4429 (cons `((font-size . ,(- font-size 3))) props) | 4429 (cons `((font-size . ,(- font-size 3))) props) |
4430 arg) | 4430 arg) |
4431 (* -0.75 (magstep font-size)) ; original font-size | 4431 (* -0.75 (magstep font-size)) ; original font-size |
4432 Y)) | 4432 Y)) |
4433 | 4433 |
4434 (define-markup-command (normal-size-sub layout props arg) | 4434 (define-markup-command-compilable (normal-size-sub layout props arg) |
4435 (markup?) | 4435 (markup?) |
4436 #:category font | 4436 #:category font |
4437 #:properties ((font-size 0)) | 4437 #:properties ((font-size 0)) |
4438 " | 4438 " |
4439 @cindex setting subscript, in standard font size | 4439 @cindex setting subscript, in standard font size |
4440 | 4440 |
4441 Set @var{arg} in subscript with a normal font size. | 4441 Set @var{arg} in subscript with a normal font size. |
4442 | 4442 |
4443 @lilypond[verbatim,quote] | 4443 @lilypond[verbatim,quote] |
4444 \\markup { | 4444 \\markup { |
4445 default | 4445 default |
4446 \\normal-size-sub { | 4446 \\normal-size-sub { |
4447 subscript in standard size | 4447 subscript in standard size |
4448 } | 4448 } |
4449 } | 4449 } |
4450 @end lilypond" | 4450 @end lilypond" |
4451 (ly:stencil-translate-axis | 4451 (ly:stencil-translate-axis |
4452 (interpret-markup layout props arg) | 4452 (interpret-markup layout props arg) |
4453 (* -0.75 (magstep font-size)) | 4453 (* -0.75 (magstep font-size)) |
4454 Y)) | 4454 Y)) |
4455 | 4455 |
4456 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4456 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4457 ;; brackets. | 4457 ;; brackets. |
4458 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4458 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4459 | 4459 |
4460 (define-markup-command (hbracket layout props arg) | 4460 (define-markup-command-compilable (hbracket layout props arg) |
4461 (markup?) | 4461 (markup?) |
4462 #:category graphic | 4462 #:category graphic |
4463 " | 4463 " |
4464 @cindex placing horizontal brackets, around text | 4464 @cindex placing horizontal brackets, around text |
4465 | 4465 |
4466 Draw horizontal brackets around @var{arg}. | 4466 Draw horizontal brackets around @var{arg}. |
4467 | 4467 |
4468 @lilypond[verbatim,quote] | 4468 @lilypond[verbatim,quote] |
4469 \\markup { | 4469 \\markup { |
4470 \\hbracket { | 4470 \\hbracket { |
4471 \\line { | 4471 \\line { |
4472 one two three | 4472 one two three |
4473 } | 4473 } |
4474 } | 4474 } |
4475 } | 4475 } |
4476 @end lilypond" | 4476 @end lilypond" |
4477 (let ((th 0.1) ;; todo: take from GROB. | 4477 (let ((th 0.1) ;; todo: take from GROB. |
4478 (m (interpret-markup layout props arg))) | 4478 (m (interpret-markup layout props arg))) |
4479 (bracketify-stencil m X th (* 2.5 th) th))) | 4479 (bracketify-stencil m X th (* 2.5 th) th))) |
4480 | 4480 |
4481 (define-markup-command (bracket layout props arg) | 4481 (define-markup-command-compilable (bracket layout props arg) |
4482 (markup?) | 4482 (markup?) |
4483 #:category graphic | 4483 #:category graphic |
4484 " | 4484 " |
4485 @cindex placing vertical brackets, around text | 4485 @cindex placing vertical brackets, around text |
4486 | 4486 |
4487 Draw vertical brackets around @var{arg}. | 4487 Draw vertical brackets around @var{arg}. |
4488 | 4488 |
4489 @lilypond[verbatim,quote] | 4489 @lilypond[verbatim,quote] |
4490 \\markup { | 4490 \\markup { |
4491 \\bracket { | 4491 \\bracket { |
4492 \\note {2.} #UP | 4492 \\note {2.} #UP |
4493 } | 4493 } |
4494 } | 4494 } |
4495 @end lilypond" | 4495 @end lilypond" |
4496 (let ((th 0.1) ;; todo: take from GROB. | 4496 (let ((th 0.1) ;; todo: take from GROB. |
4497 (m (interpret-markup layout props arg))) | 4497 (m (interpret-markup layout props arg))) |
4498 (bracketify-stencil m Y th (* 2.5 th) th))) | 4498 (bracketify-stencil m Y th (* 2.5 th) th))) |
4499 | 4499 |
4500 (define-markup-command (parenthesize layout props arg) | 4500 (define-markup-command-compilable (parenthesize layout props arg) |
4501 (markup?) | 4501 (markup?) |
4502 #:category graphic | 4502 #:category graphic |
4503 #:properties ((angularity 0) | 4503 #:properties ((angularity 0) |
4504 (padding) | 4504 (padding) |
4505 (size 1) | 4505 (size 1) |
4506 (thickness 1) | 4506 (thickness 1) |
4507 (line-thickness 0.1) | 4507 (line-thickness 0.1) |
4508 (width 0.25)) | 4508 (width 0.25)) |
4509 " | 4509 " |
4510 @cindex placing parentheses, around text | 4510 @cindex placing parentheses, around text |
(...skipping 25 matching lines...) Expand all Loading... |
4536 (* (/ 4 3.0) scaled-width))) | 4536 (* (/ 4 3.0) scaled-width))) |
4537 (padding (or padding half-thickness))) | 4537 (padding (or padding half-thickness))) |
4538 (parenthesize-stencil | 4538 (parenthesize-stencil |
4539 m half-thickness scaled-width angularity padding))) | 4539 m half-thickness scaled-width angularity padding))) |
4540 | 4540 |
4541 | 4541 |
4542 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4542 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4543 ;; Delayed markup evaluation | 4543 ;; Delayed markup evaluation |
4544 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4544 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4545 | 4545 |
4546 (define-markup-command (page-ref layout props label gauge default) | 4546 (define-markup-command-compilable (page-ref layout props label gauge default) |
4547 (symbol? markup? markup?) | 4547 (symbol? markup? markup?) |
4548 #:category other | 4548 #:category other |
4549 " | 4549 " |
4550 @cindex referencing page number, in text | 4550 @cindex referencing page number, in text |
4551 | 4551 |
4552 Reference to a page number. @var{label} is the label set on the referenced | 4552 Reference to a page number. @var{label} is the label set on the referenced |
4553 page (using the @code{\\label} command), @var{gauge} a markup used to estimate | 4553 page (using the @code{\\label} command), @var{gauge} a markup used to estimate |
4554 the maximum width of the page number, and @var{default} the value to display | 4554 the maximum width of the page number, and @var{default} the value to display |
4555 when @var{label} is not found. | 4555 when @var{label} is not found. |
4556 | 4556 |
(...skipping 21 matching lines...) Expand all Loading... |
4578 (interpret-markup layout props | 4578 (interpret-markup layout props |
4579 (markup #:hspace gap page-markup)))))) | 4579 (markup #:hspace gap page-markup)))))) |
4580 x-ext | 4580 x-ext |
4581 y-ext) | 4581 y-ext) |
4582 (make-filled-box-stencil x-ext y-ext)))) | 4582 (make-filled-box-stencil x-ext y-ext)))) |
4583 | 4583 |
4584 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4584 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4585 ;; scaling | 4585 ;; scaling |
4586 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4586 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4587 | 4587 |
4588 (define-markup-command (scale layout props factor-pair arg) | 4588 (define-markup-command-compilable (scale layout props factor-pair arg) |
4589 (number-pair? markup?) | 4589 (number-pair? markup?) |
4590 #:category graphic | 4590 #:category graphic |
4591 " | 4591 " |
4592 @cindex scaling markup | 4592 @cindex scaling markup |
4593 @cindex mirroring markup | 4593 @cindex mirroring markup |
4594 | 4594 |
4595 Scale @var{arg}. @var{factor-pair} is a pair of numbers | 4595 Scale @var{arg}. @var{factor-pair} is a pair of numbers |
4596 representing the scaling-factor in the X and Y axes. | 4596 representing the scaling-factor in the X and Y axes. |
4597 Negative values may be used to produce mirror images. | 4597 Negative values may be used to produce mirror images. |
4598 | 4598 |
(...skipping 12 matching lines...) Expand all Loading... |
4611 (sy (cdr factor-pair))) | 4611 (sy (cdr factor-pair))) |
4612 (ly:stencil-scale stil sx sy))) | 4612 (ly:stencil-scale stil sx sy))) |
4613 | 4613 |
4614 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4614 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4615 ;; Repeating | 4615 ;; Repeating |
4616 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4616 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4617 | 4617 |
4618 ;; TODO: this should really be pieced together at stencil level rather | 4618 ;; TODO: this should really be pieced together at stencil level rather |
4619 ;; than markup level | 4619 ;; than markup level |
4620 | 4620 |
4621 (define-markup-command (pattern layout props count axis space pattern) | 4621 (define-markup-command-compilable (pattern layout props count axis space pattern
) |
4622 (integer? integer? number? markup?) | 4622 (integer? integer? number? markup?) |
4623 #:category other | 4623 #:category other |
4624 " | 4624 " |
4625 Prints @var{count} times a @var{pattern} markup. | 4625 Prints @var{count} times a @var{pattern} markup. |
4626 Patterns are spaced apart by @var{space}. | 4626 Patterns are spaced apart by @var{space}. |
4627 Patterns are distributed on @var{axis}. | 4627 Patterns are distributed on @var{axis}. |
4628 | 4628 |
4629 @lilypond[verbatim, quote] | 4629 @lilypond[verbatim, quote] |
4630 \\markup \\column { | 4630 \\markup \\column { |
4631 \"Horizontally repeated :\" | 4631 \"Horizontally repeated :\" |
(...skipping 13 matching lines...) Expand all Loading... |
4645 layout | 4645 layout |
4646 new-props | 4646 new-props |
4647 (if (= axis X) | 4647 (if (= axis X) |
4648 (markup patterns #:stencil pattern-stencil) | 4648 (markup patterns #:stencil pattern-stencil) |
4649 (markup #:column (patterns #:stencil pattern-stencil)))) | 4649 (markup #:column (patterns #:stencil pattern-stencil)))) |
4650 (loop (1- i) | 4650 (loop (1- i) |
4651 (if (= axis X) | 4651 (if (= axis X) |
4652 (markup patterns #:stencil pattern-stencil #:hspace space) | 4652 (markup patterns #:stencil pattern-stencil #:hspace space) |
4653 (markup #:column (patterns #:stencil pattern-stencil #:vspac
e space)))))))) | 4653 (markup #:column (patterns #:stencil pattern-stencil #:vspac
e space)))))))) |
4654 | 4654 |
4655 (define-markup-command (fill-with-pattern layout props space dir pattern left ri
ght) | 4655 (define-markup-command-compilable (fill-with-pattern layout props space dir patt
ern left right) |
4656 (number? ly:dir? markup? markup? markup?) | 4656 (number? ly:dir? markup? markup? markup?) |
4657 #:category align | 4657 #:category align |
4658 #:properties ((word-space) | 4658 #:properties ((word-space) |
4659 (line-width)) | 4659 (line-width)) |
4660 " | 4660 " |
4661 Put @var{left} and @var{right} in a horizontal line of width @code{line-width} | 4661 Put @var{left} and @var{right} in a horizontal line of width @code{line-width} |
4662 with a line of markups @var{pattern} in between. | 4662 with a line of markups @var{pattern} in between. |
4663 Patterns are spaced apart by @var{space}. | 4663 Patterns are spaced apart by @var{space}. |
4664 Patterns are aligned to the @var{dir} markup. | 4664 Patterns are aligned to the @var{dir} markup. |
4665 | 4665 |
(...skipping 29 matching lines...) Expand all Loading... |
4695 #:with-dimensions (cons 0 middle-width) '(0 . 0) | 4695 #:with-dimensions (cons 0 middle-width) '(0 . 0) |
4696 #:translate (cons x-offset 0) | 4696 #:translate (cons x-offset 0) |
4697 #:pattern (1+ count) X space | 4697 #:pattern (1+ count) X space |
4698 #:stencil pattern-stencil | 4698 #:stencil pattern-stencil |
4699 #:stencil right-stencil)))) | 4699 #:stencil right-stencil)))) |
4700 | 4700 |
4701 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4701 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4702 ;; Replacements | 4702 ;; Replacements |
4703 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 4703 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
4704 | 4704 |
4705 (define-markup-command (replace layout props replacements arg) | 4705 (define-markup-command-compilable (replace layout props replacements arg) |
4706 (list? markup?) | 4706 (list? markup?) |
4707 #:category font | 4707 #:category font |
4708 " | 4708 " |
4709 Used to automatically replace a string by another in the markup @var{arg}. | 4709 Used to automatically replace a string by another in the markup @var{arg}. |
4710 Each pair of the alist @var{replacements} specifies what should be replaced. | 4710 Each pair of the alist @var{replacements} specifies what should be replaced. |
4711 The @code{key} is the string to be replaced by the @code{value} string. | 4711 The @code{key} is the string to be replaced by the @code{value} string. |
4712 | 4712 |
4713 @lilypond[verbatim, quote] | 4713 @lilypond[verbatim, quote] |
4714 \\markup \\replace #'((\"thx\" . \"Thanks!\")) thx | 4714 \\markup \\replace #'((\"thx\" . \"Thanks!\")) thx |
4715 @end lilypond" | 4715 @end lilypond" |
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4961 (throw key | 4961 (throw key |
4962 (interpret-markup-list | 4962 (interpret-markup-list |
4963 layout props args))) | 4963 layout props args))) |
4964 (make-null-markup)))))) | 4964 (make-null-markup)))))) |
4965 (lambda (key stencils) | 4965 (lambda (key stencils) |
4966 (map | 4966 (map |
4967 (lambda (sten) | 4967 (lambda (sten) |
4968 (interpret-markup layout props | 4968 (interpret-markup layout props |
4969 (compose (make-stencil-markup sten)))) | 4969 (compose (make-stencil-markup sten)))) |
4970 stencils))))) | 4970 stencils))))) |
OLD | NEW |