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