]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/text.itely
247e518d1117c4b75945c883288d46a469e08c04
[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 can 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 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.  These 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 This manual: @ref{Text markup commands}.
428
429 Snippets:
430 @rlsr{Text}.
431
432 Internals Reference: @rinternals{TextScript}.
433
434 Init files: @file{scm/@/new@/-markup@/.scm}.
435
436
437 @knownissues
438
439 Syntax errors for markup mode can be confusing.
440
441
442 @node Selecting font and font size
443 @subsubsection Selecting font and font size
444
445 @cindex font switching
446 @funindex \italic
447 @funindex \bold
448 @funindex \underline
449
450 Basic font switching is supported in markup mode:
451
452 @lilypond[quote,verbatim,relative=2]
453 {
454   d1^\markup { 
455     \bold { Più mosso } 
456     \italic { non troppo \underline Vivo } 
457   }
458   r2 r4 r8
459   d,_\markup { \italic quasi \smallCaps Tromba }
460   f1 d2 r
461 }
462 @end lilypond
463
464 @cindex font size
465 @cindex text size
466 @funindex \fontsize
467 @funindex \smaller
468 @funindex \larger
469 @funindex \bigger
470 @funindex \magnify
471
472 The size of the characters can also be altered in different ways:
473 @itemize
474 @item
475 the font size can be defined to an absolute value,
476
477 @item
478 predefined commands allow to easily select standard sizes,
479
480 @item
481 the font size can also be changed relatively to its previous value.
482 @end itemize
483
484 @noindent
485 The following example demonstrates these three methods:
486
487 @lilypond[quote,verbatim,relative=2]
488 {
489   f1^\markup { \fontsize #5 Sinfonia } 
490   a,_\markup { 
491     \tiny espressivo
492     \large e
493     \normalsize intenso 
494   }
495   bes^\markup { (con 
496     \larger grande 
497     \smaller emozione 
498     \magnify #0.6 { e sentimento } )
499   }
500   d c2 r8 c bes a g1
501 }
502 @end lilypond
503
504 @cindex subscript
505 @cindex superscript
506 @funindex \super
507 @funindex \sub
508
509 Text may be printed as subscript or superscript. By default
510 these are printed in a smaller size, but a normal size can be used as well:
511
512 @lilypond[quote,verbatim]
513 \markup {
514   \column {
515     \line { 1 \super st movement }
516     \line { 1 \normal-size-super st movement 
517       \sub { (part two) }  }
518   }
519 }
520 @end lilypond
521
522 @cindex font families
523
524 The markup mode provides an easy way to select alternate
525 font families.  The default serif font, of roman type, is
526 automatically selected unless specified otherwise: on the
527 last line of the following example, there is no difference
528 between the first and the second word.
529
530 @lilypond[quote,verbatim]
531 \markup {
532   \column {
533     \line { Act \number 1 }
534     \line { \sans { Scene I. } }
535     \line { \typewriter { Verona. An open place. } }
536     \line { Enter \roman Valentine and Proteus. }
537   }
538 }
539 @end lilypond
540
541 @noindent
542 Some of these font families, used for specific items
543 such as numbers or dynamics, do not provide all
544 characters, as mentioned in @ref{New dynamic marks} and
545 @ref{Manual repeat marks}.
546
547 @c \concat is actually documented in Align (it is not
548 @c a font-switching command). But we need it here. -vv
549
550 When used inside a word, some font-switching or formatting
551 commands may produce an unwanted blank space.  This can
552 easily be solved by concatenating the text elements together:
553
554 @lilypond[quote,verbatim]
555 \markup {
556   \column {
557     \line {
558       \concat { 1 \super st }
559       movement
560     }
561     \line {
562       \concat { \dynamic p , }
563       \italic { con dolce espressione }
564     }
565   }
566 }
567 @end lilypond
568
569 An exhaustive list of font-switching, font-size
570 and font-families related commands can be found in @ref{Font}.
571
572 Defining custom font sets is also possible, as explained in
573 @ref{Fonts}.
574
575 @predefined
576
577 @funindex \teeny
578 @funindex \tiny
579 @funindex \small
580 @funindex \normalsize
581 @funindex \large
582 @funindex \huge
583 @code{\teeny},
584 @code{\tiny},
585 @code{\small},
586 @code{\normalsize},
587 @code{\large},
588 @code{\huge}.
589
590 @c TODO: add @seealso
591
592
593 @node Text alignment
594 @subsubsection Text alignment
595
596 @cindex text, aligning
597 @cindex aligning text
598
599 This subsection discusses how to place text in markup mode,
600 inside a @code{\markup} block.  Markup objects can also
601 be moved as a whole, using the syntax described in
602 @rlearning{Moving objects}.
603
604 @c The padding commands should be mentioned on this page, but
605 @c most of these require \box to be more clearly illustrated. -vv
606
607 @cindex text, horizontal alignment
608 @cindex horizontal text alignment
609 @funindex \left-align
610 @funindex \center-align
611 @funindex \right-align
612
613 Markup objects may be aligned in different ways.  By default,
614 a text indication is aligned on its left edge: in the following
615 example, there is no difference
616 between the first and the second markup.
617
618 @lilypond[quote,verbatim,fragment,relative=1]
619 a1-\markup { poco }
620 e'
621 a,-\markup { \left-align poco }
622 e'
623 a,-\markup { \center-align { poco } }
624 e'
625 a,-\markup { \right-align poco }
626 @end lilypond
627
628 @funindex \halign
629
630 The horizontal alignment may be fine-tuned
631 using a numeric value:
632
633 @lilypond[quote,verbatim,fragment,relative=1]
634 a1-\markup { \halign #-1 poco }
635 e'
636 a,-\markup { \halign #0 poco }
637 e'
638 a,-\markup { \halign #0.5 poco }
639 e'
640 a,-\markup { \halign #2 poco }
641 @end lilypond
642
643 @noindent
644 Some objects may have alignment procedures of their own,
645 and therefore are not affected by these commands.  It is
646 possible to move such markup objects as a whole, as shown
647 for instance in @ref{Text marks},
648
649 @cindex text, vertical alignment
650 @cindex vertical text alignment
651 @funindex \raise
652 @funindex \lower
653
654 Vertical alignment is a bit more complex. As stated above,
655 markup objects can be moved as a whole; however, it is also
656 possible to move specific elements inside a markup block.
657 In this case, the element to be moved needs to be preceded
658 with an @emph{anchor point}, that can be another markup element
659 or an invisible object.  The following example demonstrates these
660 two possibilities; the last markup in this example has no anchor
661 point, and therefore is not moved.
662
663 @lilypond[quote,verbatim,fragment,relative=1]
664 d2^\markup { 
665   Acte I
666   \raise #2 { Scène 1 } }
667 a'
668 g_\markup {
669   \null
670   \lower #4 \bold { Très modéré } }
671 a
672 d,^\markup {
673   \raise #4 \italic { Une forêt. } }
674 a'4 a g2 a
675 @end lilypond
676
677 @funindex \general-align
678 @funindex \translate
679 @funindex \translate-scaled
680
681 Some commands can affect both the horizontal and vertical
682 alignment of text objects in markup mode.  Any object
683 affected by these commands must be preceded with an
684 anchor point:
685
686 @lilypond[quote,verbatim,fragment,relative=1]
687 d2^\markup {
688   Acte I
689   \translate #'(-1 . 2) "Scène 1" }
690 a'
691 g_\markup {
692   \null
693   \general-align #Y #3.2 \bold "Très modéré" }
694 a
695 d,^\markup {
696   \null
697   \translate-scaled #'(-1 . 2) \teeny "Une forêt." }
698 a'4 a g2 a
699 @end lilypond
700
701 @funindex \column
702 @funindex \center-column
703
704 @cindex multi-line markup
705 @cindex multi-line text
706 @cindex columns, text
707
708 A markup object may include several lines of text.
709 In the following example, each element or expression
710 is placed on its own line, either left-aligned or centered:
711
712 @lilypond[quote,verbatim]
713 \markup {
714   \column {
715     a
716     "b c"
717     \line { d e f }
718   }
719   \hspace #10
720   \center-column {
721     a
722     "b c"
723     \line { d e f }
724   }
725 }
726 @end lilypond
727
728 @funindex \fill-line
729
730 @cindex centering text on the page
731
732 Similarly, a list of elements or expressions may be
733 spread to fill the entire horizontal line width (if there
734 is only one element, it will be centered on the page).
735 These expressions can, in turn, include multi-line text
736 or any other markup expression:
737
738 @lilypond[quote,verbatim]
739 \markup {
740   \fill-line {
741     \line { William S. Gilbert }
742     \center-column {
743       \huge \smallCaps "The Mikado"
744       or
745       \smallCaps "The Town of Titipu"
746     }
747     \line { Sir Arthur Sullivan }
748   }
749 }
750 \markup {
751   \fill-line { 1885 } 
752 }
753 @end lilypond
754
755 @funindex \wordwrap
756 @funindex \justify
757
758 @cindex wordwrapped text
759 @cindex justified text
760
761 Long text indications can also be automatically wrapped
762 accordingly to the given line width.  These will be
763 either left-aligned or justified, as shown in
764 the following example.
765
766 @lilypond[quote,verbatim]
767 \markup {
768   \column {
769     \line  \smallCaps { La vida breve }
770     \line \bold { Acto I }
771     \wordwrap \italic {
772       (La escena representa el corral de una casa de
773       gitanos en el Albaicín de Granada. Al fondo una
774       puerta por la que se vé el negro interior de
775       una Fragua, iluminado por los rojos resplandores
776       del fuego.) 
777     }
778     \hspace #0
779
780     \line \bold { Acto II }
781     \override #'(line-width . 50)
782     \justify \italic {
783       (Calle de Granada. Fachada de la casa de Carmela
784       y su hermano Manuel con grandes ventanas abiertas
785       a través de las que se ve el patio
786       donde se celebra una alegre fiesta)
787     }
788   }
789 }
790 @end lilypond
791
792 An exhaustive list of text alignment commands
793 can be found in @ref{Align}.
794
795 @c TODO: add @seealso
796
797 @node Graphic notation inside markup
798 @subsubsection Graphic notation inside markup
799
800 @cindex graphics, embedding
801 @cindex drawing graphic objects
802
803 Various graphic objects may be added to a score,
804 using specific markup commands.
805
806 @funindex \box
807 @funindex \circle
808 @funindex \rounded-box
809 @funindex \bracket
810 @funindex \hbracket
811
812 @cindex decorating text
813 @cindex framing text
814
815 Some markup commands allow to decorate text elements
816 with graphics, as demonstrated in the following example.
817
818 @lilypond[quote,verbatim]
819 \markup \fill-line {
820   \center-column {
821     \circle Jack
822     \box "in the box"
823     \null
824     \line {
825       Erik Satie
826       \hspace #3
827       \bracket "1866 - 1925"
828     }
829     \null
830     \rounded-box \bold Prelude
831   }
832 }
833 @end lilypond
834
835 @funindex \pad-markup
836 @funindex \pad-x
837 @funindex \pad-to-box
838 @funindex \pad-around
839
840 @cindex padding around text
841 @cindex text padding
842
843 Some commands may require to increase the padding around
844 the text: this is achieved with some specific commands
845 exhaustively described in @ref{Align}.
846
847 @lilypond[quote,verbatim]
848 \markup \fill-line {
849   \center-column {
850     \box "Charles Ives (1874 - 1954)"
851     \null
852     \box \pad-markup #2 "THE UNANSWERED QUESTION"
853     \box \pad-x #8 "A Cosmic Landscape"
854     \null
855   }
856 }
857 \markup \column {
858   \line {
859     \hspace #10
860     \box \pad-to-box #'(-5 . 20) #'(0 . 5)
861       \bold "Largo to Presto"
862   }
863   \pad-around #3
864       "String quartet keeps very even time,
865 Flute quartet keeps very uneven time."
866 }
867 @end lilypond
868
869 @funindex \combine
870 @funindex \draw-circle
871 @funindex \filled-box
872 @funindex \triangle
873 @funindex \draw-line
874 @funindex \arrow-head
875
876 @cindex graphic notation
877 @cindex symbols, non-musical
878
879 Other graphic elements or symbols may be printed
880 without requiring any text.  As with any markup
881 expression, such objects can be combined together:
882
883 @lilypond[quote,verbatim]
884 \markup {
885   \combine
886     \draw-circle #4 #0.4 ##f
887     \filled-box #'(-4 . 4) #'(-0.5 . 0.5) #1
888   \hspace #5
889
890   \center-column {
891     \triangle ##t
892     \combine
893       \draw-line #'(0 . 4)
894       \arrow-head #Y #DOWN ##f
895   }
896 }
897 @end lilypond
898
899 @funindex \epsfile
900 @funindex \postscript
901
902 @cindex embedded graphics
903 @cindex images, embedding
904 @cindex graphics, embedding
905 @cindex postscript
906
907 Advanced graphic features include the ability to
908 include external image files converted to the
909 Encapsulated PostScript format (@emph{eps}), or
910 to directly embed graphics into the input file,
911 using native PostScript code.
912
913 @lilypond[quote,verbatim,fragment,relative=1]
914 c1^\markup {
915   \combine
916     \epsfile #X #10 #"./context-example.eps"
917     \postscript #"
918       -2 3 translate
919       2.7 2 scale
920       newpath
921       2 -1 moveto
922       4 -2 4 1 1 arct
923       4 2 3 3 1 arct
924       0 4 0 3 1 arct
925       0 0 1 -1 1 arct
926       closepath
927       stroke"
928   }
929 c
930 @end lilypond
931
932 An exhaustive list of graphics-specific commands
933 can be found in @ref{Graphic}.
934
935 @c TODO: add @seealso (and link with NR Editorial)
936
937 @node Music notation inside markup
938 @subsubsection Music notation inside markup
939
940 Notes can be printed in markup mode blah blah:
941
942 \note   
943 \note-by-number
944
945 Accidental symbols can be obtained easily:
946
947 \doubleflat
948 \sesquiflat
949 \flat
950 \semiflat
951 \natural
952 \semisharp
953 \sharp
954 \sesquisharp
955 \doublesharp
956
957 Some other notation objects blah blah
958
959 \beam
960 \finger
961 \dynamic
962 \tied-lyric
963 \markalphabet
964 \markletter
965 @c TODO: add \text here? -vv
966
967 Any musical symbol can be printed
968
969 \musicglyph
970 @c TODO: add \lookup here? -vv
971
972
973 The markup mode has support for fret diagrams:
974
975 \fret-diagram 
976 \fret-diagram-terse
977 \fret-diagram-verbose
978
979 An entire @code{\score} block can even be nested in a @code{\markup}
980 block.  In such a case, the @code{\score} must contain a @code{\layout} block.
981
982
983 \score
984
985
986 @lilypond[quote,verbatim,ragged-right]
987 \relative {
988   c4 d^\markup {
989     \score {
990       \relative { c4 d e f }
991       \layout { }
992     }
993   }
994   e f
995 }
996 @end lilypond
997
998 @seealso
999
1000 Snippets:
1001 @rlsr{Text}.
1002
1003 @node Multi-page markup
1004 @subsubsection Multi-page markup
1005
1006 Whereas @code{\markup} is used to enter a non-breakable block of
1007 text, @code{\markuplines} can be used at top-level to enter lines
1008 of text that can spread over multiple pages:
1009
1010 @verbatim
1011 \markuplines {
1012   \justified-lines {
1013     A very long text of justified lines.
1014     ...
1015   }
1016   \justified-lines {
1017     An other very long paragraph.
1018     ...
1019   }
1020   ...
1021 }
1022 @end verbatim
1023
1024 @code{\markuplines} accepts a list of markup, that is either the
1025 result of a markup list command, or a list of markups or of markup
1026 lists.  The built-in markup list commands are described in
1027 @ref{Text markup list commands}.
1028
1029 @seealso
1030
1031 This manual: @ref{Text markup list commands}, @ref{New
1032 markup list command definition}.
1033
1034 Snippets:
1035 @rlsr{Text}.
1036
1037 @predefined
1038
1039 @funindex \markuplines
1040 @code{\markuplines}
1041
1042
1043 @node Fonts
1044 @subsection Fonts
1045
1046 @menu
1047 * Entire document fonts::       
1048 * Single entry fonts::          
1049 @end menu
1050
1051 @node Entire document fonts
1052 @subsubsection Entire document fonts
1053
1054 It is also possible to change the default font family for the
1055 entire document.  This is done by calling the
1056 @code{make-pango-font-tree} from within the @code{\paper} block.
1057 The function takes names for the font families to use for roman,
1058 sans serif and monospaced text.  For example,
1059
1060 @cindex font families, setting
1061 @cindex Pango
1062
1063
1064 @lilypond[verbatim]
1065 \paper  {
1066   myStaffSize = #20
1067
1068   #(define fonts
1069     (make-pango-font-tree "Times New Roman"
1070                           "Nimbus Sans"
1071                           "Luxi Mono"
1072                            (/ myStaffSize 20)))
1073 }
1074
1075 {
1076   c'^\markup { roman: foo \sans bla \typewriter bar }
1077 }
1078 @end lilypond
1079
1080 @c we don't do Helvetica / Courier, since GS incorrectly loads
1081 @c Apple TTF fonts
1082
1083
1084 @node Single entry fonts
1085 @subsubsection Single entry fonts
1086
1087 @cindex font selection
1088 @cindex font magnification
1089 @funindex font-interface
1090
1091 By setting the object properties described below, you can select a
1092 font from the preconfigured font families.  LilyPond has default
1093 support for the feta music fonts.  Text fonts are selected through
1094 Pango/FontConfig.  The serif font defaults to New Century
1095 Schoolbook, the sans and typewriter to whatever the Pango
1096 installation defaults to.
1097
1098
1099 @itemize
1100 @item @code{font-encoding}
1101 is a symbol that sets layout of the glyphs.  This should only be
1102 set to select different types of non-text fonts, e.g.
1103
1104 @code{fetaBraces} for piano staff braces, @code{fetaMusic} the
1105 standard music font, including ancient glyphs, @code{fetaDynamic}
1106 for dynamic signs and @code{fetaNumber} for the number font.
1107
1108 @item @code{font-family}
1109 is a symbol indicating the general class of the typeface.
1110 Supported are @code{roman} (Computer Modern), @code{sans}, and
1111 @code{typewriter}.
1112
1113 @item @code{font-shape}
1114 is a symbol indicating the shape of the font.  There are typically
1115 several font shapes available for each font family.  Choices are
1116 @code{italic}, @code{caps}, and @code{upright}.
1117
1118 @item @code{font-series}
1119 is a symbol indicating the series of the font.  There are
1120 typically several font series for each font family and shape.
1121 Choices are @code{medium} and @code{bold}.
1122
1123 @end itemize
1124
1125 Fonts selected in the way sketched above come from a predefined
1126 style sheet.  If you want to use a font from outside the style
1127 sheet, then set the @code{font-name} property,
1128
1129 @lilypond[fragment,verbatim]
1130 {
1131   \override Staff.TimeSignature #'font-name = #"Charter"
1132   \override Staff.TimeSignature #'font-size = #2
1133   \time 3/4
1134   c'1_\markup {
1135     \override #'(font-name . "Vera Bold")
1136       { This text is in Vera Bold }
1137   }
1138 }
1139 @end lilypond
1140
1141 @noindent
1142 Any font can be used, as long as it is available to
1143 Pango/FontConfig.  To get a full list of all available fonts, run
1144 the command
1145
1146 @example
1147 lilypond -dshow-available-fonts blabla
1148 @end example
1149
1150 (the last argument of the command can be anything, but has to be
1151 present).
1152
1153
1154 The size of the font may be set with the @code{font-size}
1155 property.  The resulting size is taken relative to the
1156 @code{text-font-size} as defined in the @code{\paper} block.
1157
1158 @cindex font size
1159 @cindex font magnification
1160
1161
1162
1163
1164 @seealso
1165
1166 Snippets:
1167 @rlsr{Text}.
1168
1169