]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/text.itely
Merge git://git.sv.gnu.org/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 automatically
525 selected unless specified otherwise: on the last line of the following example,
526 there is no difference between the first word and the second word.
527
528 @lilypond[quote,verbatim]
529 \markup {
530   \column {
531     \line { Act \number 1 }
532     \line { \sans { Scene I. } }
533     \line { \typewriter { Verona. An open place. } }
534     \line { Enter \roman Valentine and Proteus. }
535   }
536 }
537 @end lilypond
538
539 @noindent
540 Some of these font families, used for specific items
541 such as numbers or dynamics, do not provide all
542 characters, as mentioned in @ref{New dynamic marks} and
543 @ref{Manual repeat marks}.
544
545
546 Defining custom font sets is also possible, as explained in
547 @ref{Fonts}.  An exhaustive list of font-switching, font-size
548 and font-families related commands can be found in @ref{Font}.
549
550 @predefined
551
552 @funindex \teeny
553 @funindex \tiny
554 @funindex \small
555 @funindex \normalsize
556 @funindex \large
557 @funindex \huge
558 @code{\teeny},
559 @code{\tiny},
560 @code{\small},
561 @code{\normalsize},
562 @code{\large},
563 @code{\huge}.
564
565
566 @c TODO: add @seealso
567
568 @knownissues
569 When used inside a word, some of these commands may produce an unwanted
570 blank space.  This can easily be solved by concatenating the text
571 elements together, using a specific command
572 described in @ref{Text alignment}.
573
574
575
576 @node Text alignment
577 @subsubsection Text alignment
578
579 @cindex text, aligning
580 @cindex aligning text
581
582 This subsection discusses how to place text in markup mode,
583 inside a @code{\markup} block.  Markup objects can also
584 be moved as a whole, using the syntax described in
585 @rlearning{Moving objects}.
586
587 @cindex text, horizontal alignment
588 @cindex horizontal text alignment
589 @funindex \left-align
590 @funindex \hcenter
591 @funindex \right-align
592
593 Markup objects may be aligned in different ways.  By default,
594 a text indication is aligned on its left edge: in the following
595 example, there's no difference between the first and the second
596 markup.
597
598 @lilypond[quote,verbatim,fragment,relative=1]
599 a1-\markup { poco }
600 e'
601 a,-\markup { \left-align poco }
602 e'
603 a,-\markup { \hcenter { poco } }
604 e'
605 a,-\markup { \right-align poco }
606 @end lilypond
607
608 @funindex \halign
609
610 The horizontal alignment may be fine-tuned
611 using a numeric value:
612
613 @lilypond[quote,verbatim,fragment,relative=1]
614 a1-\markup { \halign #-1 poco }
615 e'
616 a,-\markup { \halign #0 poco }
617 e'
618 a,-\markup { \halign #0.5 poco }
619 e'
620 a,-\markup { \halign #2 poco }
621 @end lilypond
622
623 @cindex text, vertical alignment
624 @cindex vertical text alignment
625 @funindex \raise
626 @funindex \lower
627
628 Vertical alignment is a bit more complex. As stated above,
629 markup objects can be moved as a whole; however, it is also
630 possible to move specific elements inside a markup block.
631 In this case, the element to be moved needs to be preceded
632 with an @emph{anchor point}, that can be another markup element
633 or an invisible object.  The following example demonstrates these
634 two possibilities; the last markup in this example has no anchor
635 point, and therefore is not moved.
636
637 @lilypond[quote,verbatim,fragment,relative=1]
638 d2^\markup { 
639   Acte I
640   \raise #2 { Scène 1 } }
641 a'
642 g_\markup {
643   \null
644   \lower #4 \bold { Très modéré } }
645 a
646 d,^\markup {
647   \raise #4 \italic { Une forêt. } }
648 a'4 a g2 a
649 @end lilypond
650
651 @funindex \general-align
652 @funindex \translate
653 @funindex \translate-scaled
654
655 Some commands can affect both the horizontal and vertical
656 alignment of text objects in markup mode.  Any object
657 affected by these commands must be preceded by an
658 anchor point:
659
660 @lilypond[quote,verbatim,fragment,relative=1]
661 d2^\markup {
662   Acte I
663   \translate #'(-1 . 2) "Scène 1" }
664 a'
665 g_\markup {
666   \null
667   \general-align #Y #3.2 \bold "Très modéré" }
668 a
669 d,^\markup {
670   \null
671   \translate-scaled #'(-1 . 2) \teeny "Une forêt." }
672 a'4 a g2 a
673 @end lilypond
674
675 @cindex multi-line markup
676 @cindex multi-line text
677 @cindex columns, text
678
679 A markup object may include several lines of text.
680 In the following example, each element or expression
681 is placed on its own line:
682
683 @lilypond[quote,verbatim]
684 \markup {
685   \column {
686     
687
688
689 \rotate
690 \transparent
691 \whiteout
692
693 Vertical alignment: 
694 \vcenter
695 \column
696 \dir-column
697
698 Building a "large" markup:
699
700 \line
701
702 \fill-line
703
704 \hcenter-in
705         
706 \pad-around
707 \pad-markup
708 \pad-to-box
709 \pad-x
710         
711 Alignment inside a "large" markup:
712
713 \justify-field 
714 \justify
715 \justify-string
716
717 \wordwrap-field
718 \wordwrap
719 \wordwrap-string
720
721
722 @ignore
723 TODO: here are some commands that could be described here.
724 I'm putting them in bulk, prior to working on this section. -vv
725
726 \simple
727
728 \char
729 \fraction
730
731 \combine
732 \concat
733 \put-adjacent
734
735
736 \page-ref (see also "Table of contents")
737 \fromproperty
738 \verbatim-file
739 \with-url
740
741 \on-the-fly 
742 \override
743
744
745
746 @end ignore
747
748
749 Some objects have alignment procedures of their own, which cancel
750 out any effects of alignments applied to their markup arguments as
751 a whole.  For example, the @rinternals{RehearsalMark} is
752 horizontally centered, so using @code{\mark \markup @{ \left-align
753 .. @}} has no effect.
754
755
756
757 @node Graphic notation inside markup
758 @subsubsection Graphic notation inside markup
759 Graphics around text:
760 \box
761 \circle
762
763 \bracket
764 \hbracket
765
766 "Standalone" graphics:
767
768 \arrow-head
769 \draw-line
770 \draw-circle
771 \filled-box
772 \triangle
773 \strut
774
775 \with-color
776
777
778 Advanced graphics:
779 \stencil
780
781 \postscript
782 \epsfile
783
784 \with-dimensions
785
786 @node Music notation inside markup
787 @subsubsection Music notation inside markup
788
789 Notes can be printed in markup mode blah blah:
790
791 \note   
792 \note-by-number
793
794 Accidental symbols can be obtained easily:
795
796 \doubleflat
797 \sesquiflat
798 \flat
799 \semiflat
800 \natural
801 \semisharp
802 \sharp
803 \sesquisharp
804 \doublesharp
805
806 Some other notation objects blah blah
807
808 \beam
809 \finger
810 \dynamic
811 \tied-lyric
812 \markalphabet
813 \markletter
814 @c TODO: add \text here? -vv
815
816 Any musical symbol can be printed
817
818 \musicglyph
819 @c TODO: add \lookup here? -vv
820
821
822 The markup mode has support for fret diagrams:
823
824 \fret-diagram 
825 \fret-diagram-terse
826 \fret-diagram-verbose
827
828 An entire @code{\score} block can even be nested in a @code{\markup}
829 block.  In such a case, the @code{\score} must contain a @code{\layout} block.
830
831
832 \score
833
834
835 @lilypond[quote,verbatim,ragged-right]
836 \relative {
837   c4 d^\markup {
838     \score {
839       \relative { c4 d e f }
840       \layout { }
841     }
842   }
843   e f
844 }
845 @end lilypond
846
847 @seealso
848
849 Snippets:
850 @rlsr{Text}.
851
852 @node Multi-page markup
853 @subsubsection Multi-page markup
854
855 Whereas @code{\markup} is used to enter a non-breakable block of
856 text, @code{\markuplines} can be used at top-level to enter lines
857 of text that can spread over multiple pages:
858
859 @verbatim
860 \markuplines {
861   \justified-lines {
862     A very long text of justified lines.
863     ...
864   }
865   \justified-lines {
866     An other very long paragraph.
867     ...
868   }
869   ...
870 }
871 @end verbatim
872
873 @code{\markuplines} accepts a list of markup, that is either the
874 result of a markup list command, or a list of markups or of markup
875 lists.  The built-in markup list commands are described in
876 @ref{Text markup list commands}.
877
878 @seealso
879
880 This manual: @ref{Text markup list commands}, @ref{New
881 markup list command definition}.
882
883 Snippets:
884 @rlsr{Text}.
885
886 @predefined
887
888 @funindex \markuplines
889 @code{\markuplines}
890
891
892 @node Fonts
893 @subsection Fonts
894
895 @menu
896 * Entire document fonts::       
897 * Single entry fonts::          
898 @end menu
899
900 @node Entire document fonts
901 @subsubsection Entire document fonts
902
903 It is also possible to change the default font family for the
904 entire document.  This is done by calling the
905 @code{make-pango-font-tree} from within the @code{\paper} block.
906 The function takes names for the font families to use for roman,
907 sans serif and monospaced text.  For example,
908
909 @cindex font families, setting
910 @cindex Pango
911
912
913 @lilypond[verbatim]
914 \paper  {
915   myStaffSize = #20
916
917   #(define fonts
918     (make-pango-font-tree "Times New Roman"
919                           "Nimbus Sans"
920                           "Luxi Mono"
921                            (/ myStaffSize 20)))
922 }
923
924 {
925   c'^\markup { roman: foo \sans bla \typewriter bar }
926 }
927 @end lilypond
928
929 @c we don't do Helvetica / Courier, since GS incorrectly loads
930 @c Apple TTF fonts
931
932
933 @node Single entry fonts
934 @subsubsection Single entry fonts
935
936 @cindex font selection
937 @cindex font magnification
938 @funindex font-interface
939
940 By setting the object properties described below, you can select a
941 font from the preconfigured font families.  LilyPond has default
942 support for the feta music fonts.  Text fonts are selected through
943 Pango/FontConfig.  The serif font defaults to New Century
944 Schoolbook, the sans and typewriter to whatever the Pango
945 installation defaults to.
946
947
948 @itemize
949 @item @code{font-encoding}
950 is a symbol that sets layout of the glyphs.  This should only be
951 set to select different types of non-text fonts, e.g.
952
953 @code{fetaBraces} for piano staff braces, @code{fetaMusic} the
954 standard music font, including ancient glyphs, @code{fetaDynamic}
955 for dynamic signs and @code{fetaNumber} for the number font.
956
957 @item @code{font-family}
958 is a symbol indicating the general class of the typeface.
959 Supported are @code{roman} (Computer Modern), @code{sans}, and
960 @code{typewriter}.
961
962 @item @code{font-shape}
963 is a symbol indicating the shape of the font.  There are typically
964 several font shapes available for each font family.  Choices are
965 @code{italic}, @code{caps}, and @code{upright}.
966
967 @item @code{font-series}
968 is a symbol indicating the series of the font.  There are
969 typically several font series for each font family and shape.
970 Choices are @code{medium} and @code{bold}.
971
972 @end itemize
973
974 Fonts selected in the way sketched above come from a predefined
975 style sheet.  If you want to use a font from outside the style
976 sheet, then set the @code{font-name} property,
977
978 @lilypond[fragment,verbatim]
979 {
980   \override Staff.TimeSignature #'font-name = #"Charter"
981   \override Staff.TimeSignature #'font-size = #2
982   \time 3/4
983   c'1_\markup {
984     \override #'(font-name . "Vera Bold")
985       { This text is in Vera Bold }
986   }
987 }
988 @end lilypond
989
990 @noindent
991 Any font can be used, as long as it is available to
992 Pango/FontConfig.  To get a full list of all available fonts, run
993 the command
994
995 @example
996 lilypond -dshow-available-fonts blabla
997 @end example
998
999 (the last argument of the command can be anything, but has to be
1000 present).
1001
1002
1003 The size of the font may be set with the @code{font-size}
1004 property.  The resulting size is taken relative to the
1005 @code{text-font-size} as defined in the @code{\paper} block.
1006
1007 @cindex font size
1008 @cindex font magnification
1009
1010
1011
1012
1013 @seealso
1014
1015 Snippets:
1016 @rlsr{Text}.
1017
1018