]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/text.itely
Merge branch 'master' of ssh+git://hanwen@git.sv.gnu.org/srv/git/lilypond
[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.51"
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{} @}}.
349
350 Unlike simple @q{quoted text} indications, @code{\markup} blocks
351 may contain nested expressions or specific commands,
352 entered using the backslash @code{\} character.
353 Such commands only affect the first following expression.
354
355 @lilypond[quote,verbatim,fragment,relative=1]
356 e1-\markup "intenso"
357 a2^\markup { poco \italic più forte  }
358 c e1
359 d2_\markup { \italic "string. assai" }
360
361 b1^\markup { \bold { molto \italic  agitato } }
362 c
363 @end lilypond
364
365 @cindex special characters in markup mode
366 @cindex markup mode, special characters
367 @cindex reserved characters, printing
368 @cindex printing special characters
369 @cindex quoted text in markup mode
370
371 A @code{\markup} block may also contain quoted text, which
372 can be useful to print special characters such as @code{\} and @code{#},
373 or even double quotation marks -- these have to be preceded
374 with backslashes:
375
376 @lilypond[quote,verbatim,fragment,relative=1]
377 \clef bass
378 a^\markup "##\ LEPORELLO \##"
379 a_\markup "Bravi! \"Cosa rara\"!"
380 r a8 d
381 cis a r4 r2
382 @end lilypond
383
384 The way markup expressions are defined affects 
385 how these expressions will stacked, centered and aligned
386 when using the commands explained in @ref{Text alignment}.
387
388 @lilypond[quote,verbatim,fragment,relative=1]
389 c1^\markup { \column { a bbbb \line { c d } } }
390 c1^\markup { \center-align { a bbbb c } }
391 c1^\markup { \line { a b c } }
392 @end lilypond
393
394 Lists of words that are not enclosed with double quotes
395 or preceded by a command are not treated as a distinct
396 expression.  In the following example, the first two
397 @code{\markup} expressions are equivalent:
398
399 @lilypond[quote,verbatim,fragment,relative=1]
400 c1^\markup { \center-align { a bbb c } }
401 c1^\markup { \center-align { a { bbb c } } }
402 c1^\markup { \center-align { a \line { bbb c } } }
403 @end lilypond
404
405
406 Markups can be stored in variables.  These variables may be
407 directly attached to notes:
408
409 @lilypond[quote,verbatim]
410 allegro = \markup { \bold \large Allegro }
411
412 {
413   d''8.^\allegro
414   d'16 d'4 r2
415 }
416 @end lilypond
417
418
419 @noindent
420 An exhaustive list of @code{\markup}-specific commands can be found in
421 @ref{Text markup commands}.
422
423
424 @seealso
425
426 This manual: @ref{Text markup commands}.
427
428 Snippets:
429 @rlsr{Text}.
430
431 Internals Reference: @rinternals{TextScript}.
432
433 Init files: @file{scm/@/new@/-markup@/.scm}.
434
435
436 @knownissues
437
438 Syntax errors for markup mode can be confusing.
439
440
441 @node Selecting font and font size
442 @subsubsection Selecting font and font size
443
444 @cindex font switching
445 @funindex \italic
446 @funindex \bold
447 @funindex \underline
448
449 Basic font switching is supported in markup mode:
450
451 @lilypond[quote,verbatim,relative=2]
452 {
453   d1^\markup { 
454     \bold { Più mosso } 
455     \italic { non troppo \underline Vivo } 
456   }
457   r2 r4 r8
458   d,_\markup { \italic quasi \smallCaps Tromba }
459   f1 d2 r
460 }
461 @end lilypond
462
463 @cindex font size
464 @cindex text size
465 @funindex \fontsize
466 @funindex \smaller
467 @funindex \larger
468 @funindex \bigger
469 @funindex \magnify
470
471 The size of the characters can also be altered in different ways:
472 @itemize
473 @item
474 the font size can be defined to an absolute value,
475
476 @item
477 predefined commands allow to easily select standard sizes,
478
479 @item
480 the font size can also be changed relatively to its previous value.
481 @end itemize
482
483 @noindent
484 The following example demonstrates these three methods:
485
486 @lilypond[quote,verbatim,relative=2]
487 {
488   f1^\markup { \fontsize #5 Sinfonia } 
489   a,_\markup { 
490     \tiny espressivo
491     \large e
492     \normalsize intenso 
493   }
494   bes^\markup { (con 
495     \larger grande 
496     \smaller emozione 
497     \magnify #0.6 { e sentimento } )
498   }
499   d c2 r8 c bes a g1
500 }
501 @end lilypond
502
503 @cindex subscript
504 @cindex superscript
505 @funindex \super
506 @funindex \sub
507
508 Text may be printed as subscript or superscript. By default
509 these are printed in a smaller size, but a normal size can be used as well:
510
511 @lilypond[quote,verbatim]
512 \markup {
513   \column {
514     \line { 1 \super st movement }
515     \line { 1 \normal-size-super st movement 
516       \sub { (part two) }  }
517   }
518 }
519 @end lilypond
520
521 @cindex font families
522
523 The markup mode provides an easy way to select alternate
524 font families.  The default serif font, of roman type, is
525 automatically selected unless specified otherwise: on the
526 last line of the following example, there is no difference
527 between the first and the second word.
528
529 @lilypond[quote,verbatim]
530 \markup {
531   \column {
532     \line { Act \number 1 }
533     \line { \sans { Scene I. } }
534     \line { \typewriter { Verona. An open place. } }
535     \line { Enter \roman Valentine and Proteus. }
536   }
537 }
538 @end lilypond
539
540 @noindent
541 Some of these font families, used for specific items
542 such as numbers or dynamics, do not provide all
543 characters, as mentioned in @ref{New dynamic marks} and
544 @ref{Manual repeat marks}.
545
546 @c \concat is actually documented in Align (it is not
547 @c a font-switching command). But we need it here. -vv
548
549 When used inside a word, some font-switching or formatting
550 commands may produce an unwanted blank space.  This can
551 easily be solved by concatenating the text elements together:
552
553 @lilypond[quote,verbatim]
554 \markup {
555   \column {
556     \line {
557       \concat { 1 \super st }
558       movement
559     }
560     \line {
561       \concat { \dynamic p , }
562       \italic { con dolce espressione }
563     }
564   }
565 }
566 @end lilypond
567
568 An exhaustive list of font-switching, font-size
569 and font-families related commands can be found in @ref{Font}.
570
571 Defining custom font sets is also possible, as explained in
572 @ref{Fonts}.
573
574 @predefined
575
576 @funindex \teeny
577 @funindex \tiny
578 @funindex \small
579 @funindex \normalsize
580 @funindex \large
581 @funindex \huge
582 @code{\teeny},
583 @code{\tiny},
584 @code{\small},
585 @code{\normalsize},
586 @code{\large},
587 @code{\huge}.
588
589 @c TODO: add @seealso
590
591
592 @node Text alignment
593 @subsubsection Text alignment
594
595 @cindex text, aligning
596 @cindex aligning text
597
598 This subsection discusses how to place text in markup mode,
599 inside a @code{\markup} block.  Markup objects can also
600 be moved as a whole, using the syntax described in
601 @rlearning{Moving objects}.
602
603 @c The padding commands should be mentioned on this page, but
604 @c most of these require \box to be more clearly illustrated. -vv
605
606 @cindex text, horizontal alignment
607 @cindex horizontal text alignment
608 @funindex \left-align
609 @funindex \hcenter
610 @funindex \right-align
611
612 Markup objects may be aligned in different ways.  By default,
613 a text indication is aligned on its left edge: in the following
614 example, there's no difference
615 between the first and the second markup.
616
617 @lilypond[quote,verbatim,fragment,relative=1]
618 a1-\markup { poco }
619 e'
620 a,-\markup { \left-align poco }
621 e'
622 a,-\markup { \hcenter { poco } }
623 e'
624 a,-\markup { \right-align poco }
625 @end lilypond
626
627 @funindex \halign
628
629 The horizontal alignment may be fine-tuned
630 using a numeric value:
631
632 @lilypond[quote,verbatim,fragment,relative=1]
633 a1-\markup { \halign #-1 poco }
634 e'
635 a,-\markup { \halign #0 poco }
636 e'
637 a,-\markup { \halign #0.5 poco }
638 e'
639 a,-\markup { \halign #2 poco }
640 @end lilypond
641
642 @noindent
643 Some objects may have alignment procedures of their own,
644 and therefore are not affected by these commands.  It is
645 possible to move such markup objects as a whole, as shown
646 for instance in @ref{Text marks},
647
648 @cindex text, vertical alignment
649 @cindex vertical text alignment
650 @funindex \raise
651 @funindex \lower
652
653 Vertical alignment is a bit more complex. As stated above,
654 markup objects can be moved as a whole; however, it is also
655 possible to move specific elements inside a markup block.
656 In this case, the element to be moved needs to be preceded
657 with an @emph{anchor point}, that can be another markup element
658 or an invisible object.  The following example demonstrates these
659 two possibilities; the last markup in this example has no anchor
660 point, and therefore is not moved.
661
662 @lilypond[quote,verbatim,fragment,relative=1]
663 d2^\markup { 
664   Acte I
665   \raise #2 { Scène 1 } }
666 a'
667 g_\markup {
668   \null
669   \lower #4 \bold { Très modéré } }
670 a
671 d,^\markup {
672   \raise #4 \italic { Une forêt. } }
673 a'4 a g2 a
674 @end lilypond
675
676 @funindex \general-align
677 @funindex \translate
678 @funindex \translate-scaled
679
680 Some commands can affect both the horizontal and vertical
681 alignment of text objects in markup mode.  Any object
682 affected by these commands must be preceded with an
683 anchor point:
684
685 @lilypond[quote,verbatim,fragment,relative=1]
686 d2^\markup {
687   Acte I
688   \translate #'(-1 . 2) "Scène 1" }
689 a'
690 g_\markup {
691   \null
692   \general-align #Y #3.2 \bold "Très modéré" }
693 a
694 d,^\markup {
695   \null
696   \translate-scaled #'(-1 . 2) \teeny "Une forêt." }
697 a'4 a g2 a
698 @end lilypond
699
700 @cindex multi-line markup
701 @cindex multi-line text
702 @cindex columns, text
703
704 A markup object may include several lines of text.
705 In the following example, each element or expression
706 is placed on its own line, either left-aligned or centered:
707
708 @lilypond[quote,verbatim]
709 \markup {
710   \column {
711     a
712     "b c"
713     \line { d e f }
714   }
715   \hspace #10
716   \center-align {
717     a
718     "b c"
719     \line { d e f }
720   }
721 }
722 @end lilypond
723
724 Similarly, a list of elements or expressions may be
725 spread to fill the entire horizontal line width -- if there
726 is only one element, it will be centered on the page.
727 These expressions can, in turn, include multi-line text
728 or any other markup expression:
729
730 @lilypond[quote,verbatim]
731 \markup {
732   \fill-line {
733     \line { William S. Gilbert }
734     \center-align {
735       \huge \smallCaps "The Mikado"
736       or
737       \smallCaps "The Town of Titipu"
738     }
739     \line { Sir Arthur Sullivan }
740   }
741 }
742 \markup {
743   \fill-line { 1885 } 
744 }
745 @end lilypond
746
747 Long text indications can also be automatically wrapped
748 accordingly to the given line width.  These will be
749 either left-aligned or justified, as shown in
750 the following example.
751
752 @lilypond[quote,verbatim]
753 \markup {
754   \column {
755     \line  \smallCaps { La vida breve }
756     \line \bold { Acto I }
757     \wordwrap \italic {
758       (La escena representa el corral de una casa de
759       gitanos en el Albaicín de Granada. Al fondo una
760       puerta por la que se vé el negro interior de
761       una Fragua, iluminado por los rojos resplandores
762       del fuego.) 
763     }
764     \hspace #0
765
766     \line \bold { Acto II }
767     \override #'(line-width . 50)
768     \justify \italic {
769       (Calle de Granada. Fachada de la casa de Carmela
770       y su hermano Manuel con grandes ventanas abiertas
771       a través de las que se ve el patio
772       donde se celebra una alegre fiesta)
773     }
774   }
775 }
776 @end lilypond
777
778 An exhaustive list of text alignment commands
779 can be found in @ref{Align}.
780
781 @c TODO: add @seealso
782
783 @node Graphic notation inside markup
784 @subsubsection Graphic notation inside markup
785
786 Graphics around text:
787 \box
788 \circle
789
790 (TODO: document padding commands here)
791
792 \bracket
793 \hbracket
794
795 "Standalone" graphics:
796
797 \arrow-head
798 \draw-line
799 \draw-circle
800 \filled-box
801 \triangle
802 \strut
803
804 \with-color
805
806
807 Advanced graphics:
808 \stencil
809
810 \postscript
811 \epsfile
812
813 \with-dimensions
814
815 @node Music notation inside markup
816 @subsubsection Music notation inside markup
817
818 Notes can be printed in markup mode blah blah:
819
820 \note   
821 \note-by-number
822
823 Accidental symbols can be obtained easily:
824
825 \doubleflat
826 \sesquiflat
827 \flat
828 \semiflat
829 \natural
830 \semisharp
831 \sharp
832 \sesquisharp
833 \doublesharp
834
835 Some other notation objects blah blah
836
837 \beam
838 \finger
839 \dynamic
840 \tied-lyric
841 \markalphabet
842 \markletter
843 @c TODO: add \text here? -vv
844
845 Any musical symbol can be printed
846
847 \musicglyph
848 @c TODO: add \lookup here? -vv
849
850
851 The markup mode has support for fret diagrams:
852
853 \fret-diagram 
854 \fret-diagram-terse
855 \fret-diagram-verbose
856
857 An entire @code{\score} block can even be nested in a @code{\markup}
858 block.  In such a case, the @code{\score} must contain a @code{\layout} block.
859
860
861 \score
862
863
864 @lilypond[quote,verbatim,ragged-right]
865 \relative {
866   c4 d^\markup {
867     \score {
868       \relative { c4 d e f }
869       \layout { }
870     }
871   }
872   e f
873 }
874 @end lilypond
875
876 @seealso
877
878 Snippets:
879 @rlsr{Text}.
880
881 @node Multi-page markup
882 @subsubsection Multi-page markup
883
884 Whereas @code{\markup} is used to enter a non-breakable block of
885 text, @code{\markuplines} can be used at top-level to enter lines
886 of text that can spread over multiple pages:
887
888 @verbatim
889 \markuplines {
890   \justified-lines {
891     A very long text of justified lines.
892     ...
893   }
894   \justified-lines {
895     An other very long paragraph.
896     ...
897   }
898   ...
899 }
900 @end verbatim
901
902 @code{\markuplines} accepts a list of markup, that is either the
903 result of a markup list command, or a list of markups or of markup
904 lists.  The built-in markup list commands are described in
905 @ref{Text markup list commands}.
906
907 @seealso
908
909 This manual: @ref{Text markup list commands}, @ref{New
910 markup list command definition}.
911
912 Snippets:
913 @rlsr{Text}.
914
915 @predefined
916
917 @funindex \markuplines
918 @code{\markuplines}
919
920
921 @node Fonts
922 @subsection Fonts
923
924 @menu
925 * Entire document fonts::       
926 * Single entry fonts::          
927 @end menu
928
929 @node Entire document fonts
930 @subsubsection Entire document fonts
931
932 It is also possible to change the default font family for the
933 entire document.  This is done by calling the
934 @code{make-pango-font-tree} from within the @code{\paper} block.
935 The function takes names for the font families to use for roman,
936 sans serif and monospaced text.  For example,
937
938 @cindex font families, setting
939 @cindex Pango
940
941
942 @lilypond[verbatim]
943 \paper  {
944   myStaffSize = #20
945
946   #(define fonts
947     (make-pango-font-tree "Times New Roman"
948                           "Nimbus Sans"
949                           "Luxi Mono"
950                            (/ myStaffSize 20)))
951 }
952
953 {
954   c'^\markup { roman: foo \sans bla \typewriter bar }
955 }
956 @end lilypond
957
958 @c we don't do Helvetica / Courier, since GS incorrectly loads
959 @c Apple TTF fonts
960
961
962 @node Single entry fonts
963 @subsubsection Single entry fonts
964
965 @cindex font selection
966 @cindex font magnification
967 @funindex font-interface
968
969 By setting the object properties described below, you can select a
970 font from the preconfigured font families.  LilyPond has default
971 support for the feta music fonts.  Text fonts are selected through
972 Pango/FontConfig.  The serif font defaults to New Century
973 Schoolbook, the sans and typewriter to whatever the Pango
974 installation defaults to.
975
976
977 @itemize
978 @item @code{font-encoding}
979 is a symbol that sets layout of the glyphs.  This should only be
980 set to select different types of non-text fonts, e.g.
981
982 @code{fetaBraces} for piano staff braces, @code{fetaMusic} the
983 standard music font, including ancient glyphs, @code{fetaDynamic}
984 for dynamic signs and @code{fetaNumber} for the number font.
985
986 @item @code{font-family}
987 is a symbol indicating the general class of the typeface.
988 Supported are @code{roman} (Computer Modern), @code{sans}, and
989 @code{typewriter}.
990
991 @item @code{font-shape}
992 is a symbol indicating the shape of the font.  There are typically
993 several font shapes available for each font family.  Choices are
994 @code{italic}, @code{caps}, and @code{upright}.
995
996 @item @code{font-series}
997 is a symbol indicating the series of the font.  There are
998 typically several font series for each font family and shape.
999 Choices are @code{medium} and @code{bold}.
1000
1001 @end itemize
1002
1003 Fonts selected in the way sketched above come from a predefined
1004 style sheet.  If you want to use a font from outside the style
1005 sheet, then set the @code{font-name} property,
1006
1007 @lilypond[fragment,verbatim]
1008 {
1009   \override Staff.TimeSignature #'font-name = #"Charter"
1010   \override Staff.TimeSignature #'font-size = #2
1011   \time 3/4
1012   c'1_\markup {
1013     \override #'(font-name . "Vera Bold")
1014       { This text is in Vera Bold }
1015   }
1016 }
1017 @end lilypond
1018
1019 @noindent
1020 Any font can be used, as long as it is available to
1021 Pango/FontConfig.  To get a full list of all available fonts, run
1022 the command
1023
1024 @example
1025 lilypond -dshow-available-fonts blabla
1026 @end example
1027
1028 (the last argument of the command can be anything, but has to be
1029 present).
1030
1031
1032 The size of the font may be set with the @code{font-size}
1033 property.  The resulting size is taken relative to the
1034 @code{text-font-size} as defined in the @code{\paper} block.
1035
1036 @cindex font size
1037 @cindex font magnification
1038
1039
1040
1041
1042 @seealso
1043
1044 Snippets:
1045 @rlsr{Text}.
1046
1047