]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/text.itely
Added @seealso in NR 1.8.2.*
[lilypond.git] / Documentation / user / text.itely
1 @c -*- coding: utf-8; mode: texinfo; -*-
2 @ignore
3     Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
4
5     When revising a translation, copy the HEAD committish of the
6     version that you are working on.  See TRANSLATION for details.
7 @end ignore
8
9 @c \version "2.11.57"
10
11 @node Text
12 @section Text
13
14 @lilypondfile[quote]{text-headword.ly}
15
16 This section explains how to include text (with various
17 formatting) in music scores.
18
19 @noindent
20 Some text elements that are not dealt with here are discussed in other
21 specific sections: @ref{Vocal music}, @ref{Titles and headers}.
22
23
24 @cindex Text, other languages
25 @warning{To write accented and special text (such as characters
26 from other languages), simply insert the characters directly into
27 the LilyPond file.  The file must be saved as UTF-8.  For more
28 information, see @ref{Text encoding}.}
29
30 @menu
31 * Writing text::                
32 * Formatting text::             
33 * Fonts::                       
34 @end menu
35
36
37 @node Writing text
38 @subsection Writing text
39
40 This section introduces different ways of adding text to a score.
41
42 @menu
43 * Text scripts::                
44 * Text spanners::               
45 * Text marks::                  
46 * Separate text::               
47 @end menu
48
49
50 @node Text scripts
51 @subsubsection Text scripts
52
53 @cindex Text scripts
54 @cindex text items, non-empty
55 @cindex non-empty texts
56 @cindex quoted text
57
58 Simple @q{quoted text} indications may be added
59 to a score, as demonstrated in the following example.
60 Such indications can be manually placed
61 above or below the staff, using the
62 syntax described in @ref{Direction and
63 placement}.
64
65 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
66 d8^"pizz." e f g a4-"scherz." f
67 @end lilypond
68
69 This syntax is actually a shorthand; more complex text
70 formatting may be added to a note by explicitly using a
71 @code{\markup} block, as described in @ref{Formatting text}.
72
73 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
74 d8^\markup { \italic pizz. } e f g 
75 a4_\markup { \tiny scherz. \bold molto } f
76 @end lilypond
77
78 By default, text indications do not influence the note spacing.
79 However, their widths can be taken into account:
80 in the following example, the first text string does not affect 
81 spacing, whereas the second one does.
82
83 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
84 d8^"pizz." e f g
85 \textLengthOn
86 a4_"scherzando" f
87 @end lilypond
88
89 @predefined
90
91 @funindex \textLengthOn
92 @code{\textLengthOn},
93 @funindex \textLengthOff
94 @code{\textLengthOff}
95
96
97 @seealso
98
99 Notation Reference: @ref{Formatting text},
100 @ref{Direction and placement}.
101
102 Snippets:
103 @rlsr{Text}.
104
105 Internals Reference: @rinternals{TextScript}.
106
107 @knownissues
108
109 Checking to make sure that text scripts and lyrics are within the
110 margins is a relatively large computational task.  To speed up
111 processing, LilyPond does not perform such calculations by
112 default; to enable it, use
113
114 @example
115 \override Score.PaperColumn #'keep-inside-line = ##t
116 @end example
117
118
119 @node Text spanners
120 @subsubsection Text spanners
121
122 @cindex Text spanners
123
124 Some performance indications, e.g., @notation{rallentando} or
125 @notation{accelerando}, are written as text and are extended over
126 multiple notes with dotted lines.
127 Such objects, called @q{spanners}, may be created
128 from one note to another using the following syntax:
129
130 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
131 \override TextSpanner #'bound-details #'left #'text = "rit." 
132 b1\startTextSpan 
133 e,\stopTextSpan
134 @end lilypond
135
136 @noindent
137 The string to be printed is set through
138 object properties.  By default it is printed in italic characters,
139 but different formatting can be obtained using
140 @code{\markup} blocks, as described in @ref{Formatting text}.
141
142 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
143 \override TextSpanner #'bound-details #'left #'text =
144   \markup { \upright "rit." } 
145 b1\startTextSpan c
146 e,\stopTextSpan
147 @end lilypond
148
149 The line style, as well as the text string, can be defined as an
150 object property.  This syntax is described in @ref{Line styles}.
151
152 @predefined
153
154 @funindex textSpannerUp
155 @code{\textSpannerUp},
156 @funindex textSpannerDown
157 @code{\textSpannerDown},
158 @funindex textSpannerNeutral
159 @code{\textSpannerNeutral}
160
161 @seealso
162
163 Notation Reference: @ref{Line styles}.
164
165 Snippets:
166 @rlsr{Text}.
167
168 Internals Reference: @rinternals{TextSpanner}.
169
170
171 @node Text marks
172 @subsubsection Text marks
173
174 @cindex coda on bar line
175 @cindex segno on bar line
176 @cindex fermata on bar line
177 @cindex bar lines, symbols on
178 @funindex \mark
179
180 Various text elements may be added to a score using
181 the syntax described in @ref{Rehearsal marks}:
182
183 @c \mark needs to be placed on a separate line (it's not
184 @c attached to an object like \markup is). -vv
185
186 @lilypond[verbatim,quote,ragged-right,fragment,relative=2]
187 c4
188 \mark "Allegro"
189 c c c
190 @end lilypond
191
192 This syntax makes it possible to put any text on a bar line;
193 more complex text formatting may be added using a @code{\markup}
194 block, as described in @ref{Formatting text}.  This can be used to print
195 signs like coda, segno or fermata, by specifying the appropriate
196 symbol name:
197
198 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
199 c1
200 \mark \markup { \musicglyph #"scripts.ufermata" }
201 c1
202 @end lilypond
203
204 @noindent
205 Such objects are only typeset above the top staff of the score; depending on
206 whether they are specified at the end or the middle of a bar, they 
207 can be placed above the bar line or between notes.  When specified at the
208 beginning of a score or at a line break, marks will be printed at
209 the beginning of the line (the next line, in case of a line break).
210
211 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
212 \mark "Allegro"
213 c1 c
214 \mark "assai" \break
215 c  c
216 @end lilypond
217
218
219 @snippets
220
221 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
222 {printing-marks-at-the-end-of-a-line-or-a-score.ly}
223
224 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
225 {aligning-marks-with-various-notation-objects.ly}
226
227 @lilypondfile[verbatim,lilyquote,ragged-right,texidoc,doctitle]
228 {printing-marks-on-every-staff.ly}
229
230 @seealso
231
232 Notation Reference: @ref{Rehearsal marks},
233 @ref{Formatting text}, @ref{The Feta font}.
234
235 Snippets:
236 @rlsr{Text}.
237
238 Internals Reference: @rinternals{RehearsalMark}.
239
240 @knownissues
241 @c  To be removed when Issue 69 in the tracker gets fixed. -vv
242
243 If a mark is entered at the end of the last bar of the score (where
244 there is no next line), then the mark will not be printed at
245 all.
246
247 @node Separate text
248 @subsubsection Separate text
249
250 @cindex separate text
251 @cindex standalone text
252 @cindex top-level text
253 @cindex text, standalone
254 @funindex \markup
255
256 A @code{\markup} block can exist by itself, outside of any
257 any @code{\score} block, as a @qq{top-level
258 expression}.  This syntax is described in @ref{File structure}.
259
260 @lilypond[verbatim,quote]
261 \markup {
262   Tomorrow, and tomorrow, and tomorrow...
263 }
264 @end lilypond
265
266 @noindent
267 This allows printing text separately
268 from the music, which is particularly 
269 useful when the input file contains
270 several music pieces, as described in
271 @ref{Multiple scores in a book}.
272
273 @lilypond[quote,ragged-right,verbatim]
274 \score {
275   c'1
276 }
277 \markup {
278   Tomorrow, and tomorrow, and tomorrow...
279 }
280 \score {
281   c'1
282 }
283 @end lilypond
284
285 Using a specific syntax, text blocks can be spread
286 over multiple pages, making possible to print
287 text documents or books (and therefore to
288 use LilyPond as a word processor).  This syntax is described in
289 @ref{Multi-page markup}.
290
291 @predefined
292
293 @code{\markup},
294 @funindex \markuplines
295 @code{\markuplines}
296
297 @ignore
298 @snippets
299
300 TODO: add convenient snippets in input/new -vv
301 @end ignore
302
303 @seealso
304
305 Notation Reference: @ref{Formatting text},
306 @ref{File structure}, 
307 @ref{Multiple scores in a book},
308 @ref{Multi-page markup}.
309
310 Snippets:
311 @rlsr{Text}.
312
313 Internals Reference: @rinternals{TextScript}.
314
315
316 @node Formatting text
317 @subsection Formatting text
318
319 This section presents basic and advanced text formatting,
320 using the @code{\markup} mode specific syntax.
321
322 @menu
323 * Text markup introduction::    
324 * Selecting font and font size::      
325 * Text alignment::              
326 * Graphic notation inside markup::  
327 * Music notation inside markup::  
328 * Multi-page markup::          
329 @end menu
330
331 @node Text markup introduction
332 @subsubsection Text markup introduction
333
334 @cindex markup
335 @cindex text markup
336 @cindex markup text
337 @cindex typeset text
338 @funindex \markup
339
340 A @code{\markup} block is used to typeset text with an extensible
341 specific syntax called @qq{markup mode}.
342
343 @cindex markup expressions
344 @cindex markup syntax
345
346 The markup syntax is similar to LilyPond's usual syntax: a
347 @code{\markup} expression is enclosed in curly braces @code{@{
348 @dots{} @}}.  A single word is regarded as a minimal expression,
349 and therefore does not need to be enclosed with braces.
350
351 Unlike simple @q{quoted text} indications, @code{\markup} blocks
352 may contain nested expressions or specific commands,
353 entered using the backslash @code{\} character.
354 Such commands only affect the first following expression.
355
356 @lilypond[quote,verbatim,fragment,relative=1]
357 e1-\markup intenso
358 a2^\markup { poco \italic più forte  }
359 c e1
360 d2_\markup { \italic "string. assai" }
361
362 b1^\markup { \bold { molto \italic  agitato } }
363 c
364 @end lilypond
365
366 @cindex special characters in markup mode
367 @cindex markup mode, special characters
368 @cindex reserved characters, printing
369 @cindex printing special characters
370 @cindex quoted text in markup mode
371
372 A @code{\markup} block may also contain quoted text strings.
373 Such strings are treated as minimal text expressions, and
374 therefore any markup command or special character (such as
375 @code{\} and @code{#}) will be printed verbatim without affecting
376 the formatting of the text.  This syntax even allows to print
377 double quotation marks, by preceding them with backslashes
378
379 @lilypond[quote,verbatim,fragment,relative=1]
380 d1^"\italic markup..."
381 d_\markup \italic "... prints \"italic\" letters!"
382 d d
383 @end lilypond
384
385 The way markup expressions are defined affects 
386 how these expressions will be stacked, centered and aligned
387 when using the commands explained in @ref{Text alignment}.
388
389 @lilypond[quote,verbatim,fragment,relative=1]
390 c1^\markup { \column { a bbbb \line { c d } } }
391 c1^\markup { \center-column { a bbbb c } }
392 c1^\markup { \line { a b c } }
393 @end lilypond
394
395 Lists of words that are not enclosed with double quotes
396 or preceded by a command are not treated as a distinct
397 expression.  In the following example, the first two
398 @code{\markup} expressions are equivalent:
399
400 @lilypond[quote,verbatim,fragment,relative=1]
401 c1^\markup { \center-column { a bbb c } }
402 c1^\markup { \center-column { a { bbb c } } }
403 c1^\markup { \center-column { a \line { bbb c } } }
404 @end lilypond
405
406
407 Markups can be stored in variables.  Such variables may be
408 directly attached to notes:
409
410 @lilypond[quote,verbatim]
411 allegro = \markup { \bold \large Allegro }
412
413 {
414   d''8.^\allegro
415   d'16 d'4 r2
416 }
417 @end lilypond
418
419
420 @noindent
421 An exhaustive list of @code{\markup}-specific commands can be found in
422 @ref{Text markup commands}.
423
424
425 @seealso
426
427 Notation Reference:
428 @ref{Text markup commands}.
429
430 Snippets:
431 @rlsr{Text}.
432
433 Internals Reference:
434 @rinternals{TextScript}.
435
436 Installed files:
437 @file{scm/@/markup@/.scm}.
438
439
440 @knownissues
441
442 Syntax errors for markup mode can be confusing.
443
444
445 @node Selecting font and font size
446 @subsubsection Selecting font and font size
447
448 @cindex font switching
449 @funindex \italic
450 @funindex \bold
451 @funindex \underline
452
453 Basic font switching is supported in markup mode:
454
455 @lilypond[quote,verbatim,relative=2]
456 {
457   d1^\markup { 
458     \bold { Più mosso } 
459     \italic { non troppo \underline Vivo } 
460   }
461   r2 r4 r8
462   d,_\markup { \italic quasi \smallCaps Tromba }
463   f1 d2 r
464 }
465 @end lilypond
466
467 @cindex font size
468 @cindex text size
469 @funindex \fontsize
470 @funindex \smaller
471 @funindex \larger
472 @funindex \bigger
473 @funindex \magnify
474
475 The size of the characters can also be altered in different ways:
476 @itemize
477 @item
478 the font size can be defined to an absolute value,
479
480 @item
481 predefined commands allow to easily select standard sizes,
482
483 @item
484 the font size can also be changed relatively to its previous value.
485 @end itemize
486
487 @noindent
488 The following example demonstrates these three methods:
489
490 @lilypond[quote,verbatim,relative=2]
491 {
492   f1^\markup { \fontsize #5 Sinfonia } 
493   a,_\markup { 
494     \tiny espressivo
495     \large e
496     \normalsize intenso 
497   }
498   bes^\markup { (con 
499     \larger grande 
500     \smaller emozione 
501     \magnify #0.6 { e sentimento } )
502   }
503   d c2 r8 c bes a g1
504 }
505 @end lilypond
506
507 @cindex subscript
508 @cindex superscript
509 @funindex \super
510 @funindex \sub
511
512 Text may be printed as subscript or superscript. By default
513 these are printed in a smaller size, but a normal size can be used as well:
514
515 @lilypond[quote,verbatim]
516 \markup {
517   \column {
518     \line { 1 \super st movement }
519     \line { 1 \normal-size-super st movement 
520       \sub { (part two) }  }
521   }
522 }
523 @end lilypond
524
525 @cindex font families
526
527 The markup mode provides an easy way to select alternate
528 font families.  The default serif font, of roman type, is
529 automatically selected unless specified otherwise: on the
530 last line of the following example, there is no difference
531 between the first and the second word.
532
533 @lilypond[quote,verbatim]
534 \markup {
535   \column {
536     \line { Act \number 1 }
537     \line { \sans { Scene I. } }
538     \line { \typewriter { Verona. An open place. } }
539     \line { Enter \roman Valentine and Proteus. }
540   }
541 }
542 @end lilypond
543
544 @noindent
545 Some of these font families, used for specific items
546 such as numbers or dynamics, do not provide all
547 characters, as mentioned in @ref{New dynamic marks} and
548 @ref{Manual repeat marks}.
549
550 @c \concat is actually documented in Align (it is not
551 @c a font-switching command). But we need it here. -vv
552
553 When used inside a word, some font-switching or formatting
554 commands may produce an unwanted blank space.  This can
555 easily be solved by concatenating the text elements together:
556
557 @lilypond[quote,verbatim]
558 \markup {
559   \column {
560     \line {
561       \concat { 1 \super st }
562       movement
563     }
564     \line {
565       \concat { \dynamic p , }
566       \italic { con dolce espressione }
567     }
568   }
569 }
570 @end lilypond
571
572 An exhaustive list of font-switching, font-size
573 and font-families related commands can be found in @ref{Font}.
574
575 Defining custom font sets is also possible, as explained in
576 @ref{Fonts}.
577
578 @predefined
579
580 @funindex \teeny
581 @funindex \tiny
582 @funindex \small
583 @funindex \normalsize
584 @funindex \large
585 @funindex \huge
586 @code{\teeny},
587 @code{\tiny},
588 @code{\small},
589 @code{\normalsize},
590 @code{\large},
591 @code{\huge}.
592
593 @seealso
594 Notation Reference:
595 @ref{Font},
596 @ref{New dynamic marks},
597 @ref{Manual repeat marks},
598 @ref{Fonts}.
599
600 Snippets:
601 @rlsr{Text}.
602
603 Internals Reference:
604 @rinternals{TextScript}.
605
606 Installed files:
607 @file{scm/@/define@/-markup@/-commands@/.scm}.
608
609
610 @node Text alignment
611 @subsubsection Text alignment
612
613 @cindex text, aligning
614 @cindex aligning text
615
616 This subsection discusses how to place text in markup mode,
617 inside a @code{\markup} block.  Markup objects can also
618 be moved as a whole, using the syntax described in
619 @rlearning{Moving objects}.
620
621 @c Padding commands should be mentioned on this page, but
622 @c most of these require \box to be more clearly illustrated. -vv
623
624 @cindex text, horizontal alignment
625 @cindex horizontal text alignment
626 @funindex \left-align
627 @funindex \center-align
628 @funindex \right-align
629
630 Markup objects may be aligned in different ways.  By default,
631 a text indication is aligned on its left edge: in the following
632 example, there is no difference
633 between the first and the second markup.
634
635 @lilypond[quote,verbatim,fragment,relative=1]
636 a1-\markup { poco }
637 e'
638 a,-\markup { \left-align poco }
639 e'
640 a,-\markup { \center-align { poco } }
641 e'
642 a,-\markup { \right-align poco }
643 @end lilypond
644
645 @funindex \halign
646
647 Horizontal alignment may be fine-tuned
648 using a numeric value:
649
650 @lilypond[quote,verbatim,fragment,relative=1]
651 a1-\markup { \halign #-1 poco }
652 e'
653 a,-\markup { \halign #0 poco }
654 e'
655 a,-\markup { \halign #0.5 poco }
656 e'
657 a,-\markup { \halign #2 poco }
658 @end lilypond
659
660 @noindent
661 Some objects may have alignment procedures of their own,
662 and therefore are not affected by these commands.  It is
663 possible to move such markup objects as a whole, as shown
664 for instance in @ref{Text marks},
665
666 @cindex text, vertical alignment
667 @cindex vertical text alignment
668 @funindex \raise
669 @funindex \lower
670
671 Vertical alignment is a bit more complex.  As stated above,
672 markup objects can be moved as a whole; however, it is also
673 possible to move specific elements inside a markup block.
674 In this case, the element to be moved needs to be preceded
675 with an @emph{anchor point}, that can be another markup element
676 or an invisible object.  The following example demonstrates these
677 two possibilities; the last markup in this example has no anchor
678 point, and therefore is not moved.
679
680 @lilypond[quote,verbatim,fragment,relative=1]
681 d2^\markup { 
682   Acte I
683   \raise #2 { Scène 1 } }
684 a'
685 g_\markup {
686   \null
687   \lower #4 \bold { Très modéré } }
688 a
689 d,^\markup {
690   \raise #4 \italic { Une forêt. } }
691 a'4 a g2 a
692 @end lilypond
693
694 @funindex \general-align
695 @funindex \translate
696 @funindex \translate-scaled
697
698 Some commands can affect both the horizontal and vertical
699 alignment of text objects in markup mode.  Any object
700 affected by these commands must be preceded with an
701 anchor point:
702
703 @lilypond[quote,verbatim,fragment,relative=1]
704 d2^\markup {
705   Acte I
706   \translate #'(-1 . 2) "Scène 1" }
707 a'
708 g_\markup {
709   \null
710   \general-align #Y #3.2 \bold "Très modéré" }
711 a
712 d,^\markup {
713   \null
714   \translate-scaled #'(-1 . 2) \teeny "Une forêt." }
715 a'4 a g2 a
716 @end lilypond
717
718 @funindex \column
719 @funindex \center-column
720
721 @cindex multi-line markup
722 @cindex multi-line text
723 @cindex columns, text
724
725 A markup object may include several lines of text.
726 In the following example, each element or expression
727 is placed on its own line, either left-aligned or centered:
728
729 @lilypond[quote,verbatim]
730 \markup {
731   \column {
732     a
733     "b c"
734     \line { d e f }
735   }
736   \hspace #10
737   \center-column {
738     a
739     "b c"
740     \line { d e f }
741   }
742 }
743 @end lilypond
744
745 @funindex \fill-line
746
747 @cindex centering text on the page
748
749 Similarly, a list of elements or expressions may be
750 spread to fill the entire horizontal line width (if there
751 is only one element, it will be centered on the page).
752 These expressions can, in turn, include multi-line text
753 or any other markup expression:
754
755 @lilypond[quote,verbatim]
756 \markup {
757   \fill-line {
758     \line { William S. Gilbert }
759     \center-column {
760       \huge \smallCaps "The Mikado"
761       or
762       \smallCaps "The Town of Titipu"
763     }
764     \line { Sir Arthur Sullivan }
765   }
766 }
767 \markup {
768   \fill-line { 1885 } 
769 }
770 @end lilypond
771
772 @funindex \wordwrap
773 @funindex \justify
774
775 @cindex wordwrapped text
776 @cindex justified text
777
778 Long text indications can also be automatically wrapped
779 accordingly to the given line width.  These will be
780 either left-aligned or justified, as shown in
781 the following example.
782
783 @lilypond[quote,verbatim]
784 \markup {
785   \column {
786     \line  \smallCaps { La vida breve }
787     \line \bold { Acto I }
788     \wordwrap \italic {
789       (La escena representa el corral de una casa de
790       gitanos en el Albaicín de Granada. Al fondo una
791       puerta por la que se vé el negro interior de
792       una Fragua, iluminado por los rojos resplandores
793       del fuego.) 
794     }
795     \hspace #0
796
797     \line \bold { Acto II }
798     \override #'(line-width . 50)
799     \justify \italic {
800       (Calle de Granada. Fachada de la casa de Carmela
801       y su hermano Manuel con grandes ventanas abiertas
802       a través de las que se ve el patio
803       donde se celebra una alegre fiesta)
804     }
805   }
806 }
807 @end lilypond
808
809 An exhaustive list of text alignment commands
810 can be found in @ref{Align}.
811
812 @seealso
813 Learning Manual:
814 @rlearning{Moving objects}.
815
816 Notation Reference:
817 @ref{Align},
818 @ref{Text marks}.
819
820 Snippets:
821 @rlsr{Text}.
822
823 Internals Reference: @rinternals{TextScript}.
824
825 Installed files:
826 @file{scm/@/define@/-markup@/-commands@/.scm}.
827
828
829 @node Graphic notation inside markup
830 @subsubsection Graphic notation inside markup
831
832 @cindex graphics, embedding
833 @cindex drawing graphic objects
834
835 Various graphic objects may be added to a score,
836 using specific markup commands.
837
838 @funindex \box
839 @funindex \circle
840 @funindex \rounded-box
841 @funindex \bracket
842 @funindex \hbracket
843
844 @cindex decorating text
845 @cindex framing text
846
847 Some markup commands allow to decorate text elements
848 with graphics, as demonstrated in the following example.
849
850 @lilypond[quote,verbatim]
851 \markup \fill-line {
852   \center-column {
853     \circle Jack
854     \box "in the box"
855     \null
856     \line {
857       Erik Satie
858       \hspace #3
859       \bracket "1866 - 1925"
860     }
861     \null
862     \rounded-box \bold Prelude
863   }
864 }
865 @end lilypond
866
867 @funindex \pad-markup
868 @funindex \pad-x
869 @funindex \pad-to-box
870 @funindex \pad-around
871
872 @cindex padding around text
873 @cindex text padding
874
875 Some commands may require to increase the padding around
876 the text: this is achieved with some specific commands
877 exhaustively described in @ref{Align}.
878
879 @lilypond[quote,verbatim]
880 \markup \fill-line {
881   \center-column {
882     \box "Charles Ives (1874 - 1954)"
883     \null
884     \box \pad-markup #2 "THE UNANSWERED QUESTION"
885     \box \pad-x #8 "A Cosmic Landscape"
886     \null
887   }
888 }
889 \markup \column {
890   \line {
891     \hspace #10
892     \box \pad-to-box #'(-5 . 20) #'(0 . 5)
893       \bold "Largo to Presto"
894   }
895   \pad-around #3
896       "String quartet keeps very even time,
897 Flute quartet keeps very uneven time."
898 }
899 @end lilypond
900
901 @funindex \combine
902 @funindex \draw-circle
903 @funindex \filled-box
904 @funindex \triangle
905 @funindex \draw-line
906 @funindex \arrow-head
907
908 @cindex graphic notation
909 @cindex symbols, non-musical
910
911 Other graphic elements or symbols may be printed
912 without requiring any text.  As with any markup
913 expression, such objects can be combined together:
914
915 @lilypond[quote,verbatim]
916 \markup {
917   \combine
918     \draw-circle #4 #0.4 ##f
919     \filled-box #'(-4 . 4) #'(-0.5 . 0.5) #1
920   \hspace #5
921
922   \center-column {
923     \triangle ##t
924     \combine
925       \draw-line #'(0 . 4)
926       \arrow-head #Y #DOWN ##f
927   }
928 }
929 @end lilypond
930
931 @funindex \epsfile
932 @funindex \postscript
933
934 @cindex embedded graphics
935 @cindex images, embedding
936 @cindex graphics, embedding
937 @cindex postscript
938
939 Advanced graphic features include the ability to
940 include external image files converted to the
941 Encapsulated PostScript format (@emph{eps}), or
942 to directly embed graphics into the input file,
943 using native PostScript code.
944
945 @lilypond[quote,verbatim,fragment,relative=1]
946 c1^\markup {
947   \combine
948     \epsfile #X #10 #"./context-example.eps"
949     \postscript #"
950       -2 3 translate
951       2.7 2 scale
952       newpath
953       2 -1 moveto
954       4 -2 4 1 1 arct
955       4 2 3 3 1 arct
956       0 4 0 3 1 arct
957       0 0 1 -1 1 arct
958       closepath
959       stroke"
960   }
961 c
962 @end lilypond
963
964 An exhaustive list of graphics-specific commands
965 can be found in @ref{Graphic}.
966
967 @seealso
968 Notation Reference:
969 @ref{Graphic},
970 @ref{Editorial annotations}.
971
972 Snippets:
973 @rlsr{Text}.
974
975 Internals Reference: @rinternals{TextScript}.
976
977 Installed files:
978 @file{scm/@/define@/-markup@/-commands@/.scm},
979 @file{scm/@/stencil@/.scm}.
980
981 @node Music notation inside markup
982 @subsubsection Music notation inside markup
983
984 Various musical notation elements may be added
985 to a score, inside a markup object.
986
987 Notes and accidentals can be entered using specific
988 commands:
989
990 @lilypond[quote,verbatim,fragment,relative=2]
991 a2 a^\markup {
992   \note #"4" #1
993   =
994   \note-by-number #1 #1 #1.5
995 }
996 b1_\markup {
997   \natural \semiflat \flat
998   \sesquiflat \doubleflat
999 }
1000 \glissando
1001 a1_\markup {
1002   \natural \semisharp \sharp
1003   \sesquisharp \doublesharp
1004 }
1005 \glissando b
1006 @end lilypond
1007
1008 Other notation objects may also be printed
1009 in markup mode:
1010
1011 @lilypond[quote,verbatim,fragment,relative=1]
1012 g1 bes
1013 ees-\markup {
1014   \finger 4
1015   \tied-lyric #"~"
1016   \finger 1
1017 }
1018 fis_\markup { \dynamic rf }
1019 bes^\markup {
1020   \beam #8 #0.1 #0.5
1021 }
1022 cis
1023 d-\markup {
1024   \markalphabet #8
1025   \markletter #8
1026 }
1027 @end lilypond 
1028
1029 More generally, any available musical symbol may be
1030 included separately in a markup object, using the
1031 following syntax:
1032
1033 @lilypond[quote,verbatim,fragment,relative=2]
1034 c2
1035 c'^\markup { \musicglyph #"eight" }
1036 c,4
1037 c,8._\markup { \musicglyph #"clefs.G_change" }
1038 c16
1039 c2^\markup { \musicglyph #"timesig.neomensural94" }
1040 @end lilypond
1041 @c TODO: add \lookup here? -vv
1042
1043 @noindent
1044 An exhaustive list of these symbols and their names can
1045 be found in @ref{The Feta font}.
1046
1047 The markup mode also supports diagrams for specific
1048 instruments:
1049
1050 @lilypond[quote,verbatim,fragment,relative=2]
1051 c1^\markup {
1052   \fret-diagram-terse #"x;x;o;2;3;2;"
1053 }
1054 c^\markup {
1055   \harp-pedal #"^-v|--ov^"
1056 }
1057 c
1058 c^\markup {
1059   \combine
1060     \musicglyph #"accordion.accDiscant"
1061     \combine
1062       \raise #0.5 \musicglyph #"accordion.accDot"
1063       \raise #1.5 \musicglyph #"accordion.accDot"
1064 }
1065 @end lilypond
1066
1067 @c The accordion diagram is actually taken from a snippet.
1068
1069 @noindent
1070 Such diagrams are documented in @ref{Instrument Specific Markup}.
1071
1072 A whole score can even be nested inside a markup object.
1073 In such a case, the nested @code{\score} block must
1074 contain a @code{\layout} block, as demonstrated here:
1075
1076 @lilypond[quote,verbatim,fragment,relative=1]
1077 c4 d^\markup {
1078   \score {
1079     \relative { c4 d e f }
1080     \layout { }
1081   }
1082 }
1083 e f |
1084 c d e f
1085 @end lilypond
1086
1087 An exhaustive list of music notation related commands can be
1088 found in @ref{Music}.
1089
1090 @seealso
1091 Notation Reference:
1092 @ref{Music},
1093 @ref{The Feta font}.
1094
1095 Snippets:
1096 @rlsr{Text}.
1097
1098 Internals Reference: @rinternals{TextScript}.
1099
1100 Installed files:
1101 @file{scm/@/define@/-markup@/-commands@/.scm},
1102 @file{scm/@/fret@/-diagrams@/.scm},
1103 @file{scm/@/harp@/-pedals@/.scm}.
1104
1105 @node Multi-page markup
1106 @subsubsection Multi-page markup
1107
1108 Although standard markup objects are not breakable, a
1109 specific syntax allows to enter lines of text that can
1110 spread over multiple pages:
1111
1112 @lilypond[quote,verbatim]
1113 \markuplines {
1114   \justified-lines {
1115     A very long text of justified lines.
1116     ...
1117   }
1118   \wordwrap-lines {
1119     An other very long paragraph.
1120     ...
1121   }
1122   ...
1123 }
1124 @end lilypond
1125
1126 This specific syntax accepts a list of markups, that can be
1127 @itemize
1128 @item
1129 the result of a markup list command,
1130 @item
1131 a list of markups,
1132 @item
1133 a list of markup lists.
1134 @end itemize
1135
1136 An exhaustive list of markup list commands can be found in
1137 @ref{Text markup list commands}.
1138
1139 @seealso
1140 Notation Reference:
1141 @ref{Text markup list commands},
1142 @ref{New markup list command definition}.
1143
1144 Snippets:
1145 @rlsr{Text}.
1146
1147 Internals Reference: @rinternals{TextScript}.
1148
1149 Installed files:
1150 @file{scm/@/define@/-markup@/-commands@/.scm}.
1151
1152 @predefined
1153 @funindex \markuplines
1154 @code{\markuplines}
1155
1156
1157 @node Fonts
1158 @subsection Fonts
1159
1160 @menu
1161 * Entire document fonts::       
1162 * Single entry fonts::          
1163 @end menu
1164
1165 @node Entire document fonts
1166 @subsubsection Entire document fonts
1167
1168 It is also possible to change the default font family for the
1169 entire document.  This is done by calling the
1170 @code{make-pango-font-tree} from within the @code{\paper} block.
1171 The function takes names for the font families to use for roman,
1172 sans serif and monospaced text.  For example,
1173
1174 @cindex font families, setting
1175 @cindex Pango
1176
1177
1178 @lilypond[verbatim]
1179 \paper  {
1180   myStaffSize = #20
1181
1182   #(define fonts
1183     (make-pango-font-tree "Times New Roman"
1184                           "Nimbus Sans"
1185                           "Luxi Mono"
1186                            (/ myStaffSize 20)))
1187 }
1188
1189 {
1190   c'^\markup { roman: foo \sans bla \typewriter bar }
1191 }
1192 @end lilypond
1193
1194 @c we don't do Helvetica / Courier, since GS incorrectly loads
1195 @c Apple TTF fonts
1196
1197
1198 @node Single entry fonts
1199 @subsubsection Single entry fonts
1200
1201 @cindex font selection
1202 @cindex font magnification
1203 @funindex font-interface
1204
1205 By setting the object properties described below, you can select a
1206 font from the preconfigured font families.  LilyPond has default
1207 support for the feta music fonts.  Text fonts are selected through
1208 Pango/FontConfig.  The serif font defaults to New Century
1209 Schoolbook, the sans and typewriter to whatever the Pango
1210 installation defaults to.
1211
1212
1213 @itemize
1214 @item @code{font-encoding}
1215 is a symbol that sets layout of the glyphs.  This should only be
1216 set to select different types of non-text fonts, e.g.
1217
1218 @code{fetaBraces} for piano staff braces, @code{fetaMusic} the
1219 standard music font, including ancient glyphs, @code{fetaDynamic}
1220 for dynamic signs and @code{fetaNumber} for the number font.
1221
1222 @item @code{font-family}
1223 is a symbol indicating the general class of the typeface.
1224 Supported are @code{roman} (Computer Modern), @code{sans}, and
1225 @code{typewriter}.
1226
1227 @item @code{font-shape}
1228 is a symbol indicating the shape of the font.  There are typically
1229 several font shapes available for each font family.  Choices are
1230 @code{italic}, @code{caps}, and @code{upright}.
1231
1232 @item @code{font-series}
1233 is a symbol indicating the series of the font.  There are
1234 typically several font series for each font family and shape.
1235 Choices are @code{medium} and @code{bold}.
1236
1237 @end itemize
1238
1239 Fonts selected in the way sketched above come from a predefined
1240 style sheet.  If you want to use a font from outside the style
1241 sheet, then set the @code{font-name} property,
1242
1243 @lilypond[fragment,verbatim]
1244 {
1245   \override Staff.TimeSignature #'font-name = #"Charter"
1246   \override Staff.TimeSignature #'font-size = #2
1247   \time 3/4
1248   c'1_\markup {
1249     \override #'(font-name . "Vera Bold")
1250       { This text is in Vera Bold }
1251   }
1252 }
1253 @end lilypond
1254
1255 @noindent
1256 Any font can be used, as long as it is available to
1257 Pango/FontConfig.  To get a full list of all available fonts, run
1258 the command
1259
1260 @example
1261 lilypond -dshow-available-fonts blabla
1262 @end example
1263
1264 (the last argument of the command can be anything, but has to be
1265 present).
1266
1267
1268 The size of the font may be set with the @code{font-size}
1269 property.  The resulting size is taken relative to the
1270 @code{text-font-size} as defined in the @code{\paper} block.
1271
1272 @cindex font size
1273 @cindex font magnification
1274
1275
1276
1277
1278 @seealso
1279
1280 Snippets:
1281 @rlsr{Text}.
1282
1283