]> git.donarmstrong.com Git - lilypond.git/blob - Documentation/user/text.itely
496127b0f543fdd2f77c35c8d61c99b89270816d
[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 @node Text
10 @section Text
11
12 This section explains how to include text (with various formatting) in
13 your scores.
14
15 @cindex Text, other languages
16 To write accented and special text (such as characters from other languages),
17 simply
18 insert the characters directly into the lilypond file.  The file must be
19 saved as UTF-8.  For more information, see @ref{Text encoding}.
20
21 @lilypond[fragment,ragged-right,staffsize=16,quote]
22 c'4^\markup { bla \bold bla }
23 @end lilypond
24
25 @lilypond[fragment,ragged-right,staffsize=16,quote]
26 c'4^\markup { bla \bold bla }
27 @end lilypond
28
29 @lilypond[fragment,ragged-right,staffsize=16,quote]
30 c'4^\markup { bla \bold bla }
31 @end lilypond
32
33 @lilypond[fragment,ragged-right,staffsize=16,quote]
34 c'4^\markup { bla \bold bla }
35 @end lilypond
36
37 @menu
38 * Writing text::                
39 * Text markup::                 
40 @end menu
41
42
43 @node Writing text
44 @subsection Writing text
45
46 @menu
47 * Text scripts::                
48 * Text and line spanners::      
49 * Text spanners::               
50 * Text marks::                  
51 * New dynamic marks::           
52 @end menu
53
54 @node Text scripts
55 @unnumberedsubsubsec Text scripts
56
57 @cindex Text scripts
58 @cindex text items, non-empty
59 @cindex non-empty texts
60
61 It is possible to place arbitrary strings of text or @ref{Text markup},
62 above or below notes by using a string @code{c^"text"}.  By default,
63 these indications do not influence the note spacing, but by using the
64 command @code{\fatText}, the widths will be taken into account
65
66 @lilypond[quote,fragment,ragged-right,verbatim,relative=1]
67 c4^"longtext" \fatText c4_"longlongtext" c4
68 @end lilypond
69
70 @noindent
71 To prevent text from influencing spacing, use @code{\emptyText}.
72
73 More complex formatting may also be added to a note by using the
74 markup command,
75
76 @lilypond[fragment,ragged-right,verbatim,quote]
77 c'4^\markup { bla \bold bla }
78 @end lilypond
79
80 The @code{\markup} is described in more detail in
81 @ref{Text markup}.
82
83
84 @refcommands
85
86 @funindex \fatText
87 @code{\fatText},
88 @funindex \emptyText
89 @code{\emptyText}.
90
91
92 @commonprop
93
94 Checking to make sure that text scripts and lyrics are within the margins is
95 a relatively large computational task.  To speed up processing, lilypond does
96 not perform such calculations by default; to enable it, use
97
98 @example
99 \override Score.PaperColumn #'keep-inside-line = ##t
100 @end example
101
102
103 @seealso
104
105 In this manual: @ref{Text markup}.
106
107 Program reference: @internalsref{TextScript}.
108
109
110 @node Text and line spanners
111 @unnumberedsubsubsec Text and line spanners
112
113 Some performance indications, e.g., @i{rallentando} and
114 @i{accelerando} and @i{trills} are written as text and are extended
115 over many measures with lines, sometimes dotted or wavy.
116
117 These all use the same routines as the glissando for drawing the texts
118 and the lines, and tuning their behavior is therefore also done in the
119 same way. It is done with a spanner, and the routine responsible for
120 drawing the spanners is @code{ly:line-interface::print}. This
121 routine determines the exact location of the two @i{span
122 points} and draws a line in between, in the style requested.
123
124 Here is an example of the different line styles available, and how to
125 tune them.
126
127 @lilypond[relative=2,ragged-right,verbatim,fragment]
128 d2 \glissando d'2
129 \once \override Glissando #'dash-fraction = #0.5
130 d,2 \glissando d'2
131 \override Glissando #'style = #'dotted-line
132 d,2 \glissando d'2
133 \override Glissando #'style = #'zigzag
134 d,2 \glissando d'2
135 \override Glissando #'style = #'trill
136 d,2 \glissando d'2
137 @end lilypond
138
139 The information that determines the end-points is computed on-the-fly
140 for every graphic object, but it is possible to override these. 
141
142 @lilypond[relative=2,ragged-right,verbatim,fragment]
143 e2 \glissando f
144 \once \override Glissando #'bound-details #'right #'Y = #-2
145 e2 \glissando f
146 @end lilypond
147
148 The @code{Glissando} object, like any other using the
149 @code{ly:line-interface::print} routine, carries a nested
150 association list. In the above statement, the value for @code{Y}
151 is set to @code{-2} for the association list corresponding to the right
152 end point. Of course, it is also possible to adjust the left side with
153 @code{left} instead of @code{right}.
154
155 If @code{Y} is not set, the value is computed from the vertical
156 position of right attachment point of the spanner. 
157
158 In case of a line break, the values for the span-points are extended
159 with contents of the @code{left-broken} and @code{right-broken}
160 sublists, for example
161
162 @lilypond[relative=2,ragged-right,verbatim,fragment]
163 \override Glissando #'breakable = ##T 
164 \override Glissando #'bound-details #'right-broken #'Y = #-3
165 c1 \glissando \break
166 f1
167 @end lilypond
168
169 The following properties can be used for the
170
171 @table @code
172 @item Y
173 This sets the Y-coordinate of the end point, in staff space.  By
174 default, it is the center of the bound object, so for a glissando it
175 points to the vertical center of the note head.
176
177 For horizontal spanners, such as text spanner and trill spanners, it
178 is hardcoded to 0.
179
180 @item attach-dir
181 This determines where the line starts and ends in X-direction,
182 relative to the bound object.  So, a value of @code{-1} (or
183 @code{LEFT}) makes the line start/end at the left side of the note
184 head it is attached to.
185
186 @item X
187 This is the absolute coordinate of the end point. It is usually
188 computed on the fly, and there is little use in overriding it. 
189
190 @item stencil
191 Line spanners may have symbols at the beginning or end, which is
192 contained in this sub-property.  This is for internal use, it is
193 recommended to use @code{text}.
194
195 @item text
196 This is a markup that is evaluated to yield stencil. It is
197 used to put @i{cresc.} and @i{tr} on horizontal spanners.
198
199 @lilypond[quote,ragged-right,fragment,relative=2,verbatim]
200 \override TextSpanner #'bound-details #'left #'text
201    = \markup { \small \bold Slower }
202 c2\startTextSpan b c a\stopTextSpan
203 @end lilypond
204
205 @item stencil-align-dir-y
206 @item stencil-offset
207 Without setting this, the stencil is simply put there at the
208 end-point, as defined by the @code{X} and @code{Y} sub properties.
209 Setting either @code{stencil-align-dir-y} or @code{stencil-offset}
210 will move the symbol at the edge relative to the end point of the line
211
212 @lilypond[relative=1,fragment,verbatim]
213 \override TextSpanner #'bound-details #'left #'stencil-align-dir-y = #DOWN
214 \override TextSpanner #'bound-details #'right #'stencil-align-dir-y = #UP
215
216 \override TextSpanner #'bound-details #'left #'text = #"gggg"
217 \override TextSpanner #'bound-details #'right #'text = #"hhhh"
218 c4^\startTextSpan c c c \stopTextSpan
219 @end lilypond
220
221 @item arrow
222 Setting this sub property to @code{#t} produce an arrowhead at the end
223 of the line.
224
225 @item padding
226 This sub property controls the space between the specified end-point
227 of the line and the actual end.  Without padding, a glissando would
228 start and end in the center of each note head.
229
230 @end table
231
232 @seealso
233
234 Program reference: @internalsref{TextSpanner},
235 @internalsref{Glissando}, @internalsref{VoiceFollower},
236 @internalsref{TrillSpanner}, @internalsref{line-spanner-interface}.
237
238 Examples: @lsr{expressive,line-styles.ly}, @lsr{expressive,line-arrows.ly}
239
240
241 @node Text spanners
242 @unnumberedsubsubsec Text spanners
243
244 @cindex Text spanners
245
246 Some performance indications, e.g., @i{rallentando} or @i{accelerando},
247 are written as text and are extended over many measures with dotted
248 lines.  Such texts are created using text spanners; attach
249 @code{\startTextSpan} and @code{\stopTextSpan} to the first and last
250 notes of the spanner.
251
252 The string to be printed, as well as the style, is set through object
253 properties
254
255 @lilypond[quote,ragged-right,fragment,relative=1,verbatim]
256 c1
257 \textSpannerDown
258 \override TextSpanner #'bound-details #'left #'text =
259   \markup { \upright "rall" } 
260 c2\startTextSpan b c\stopTextSpan a
261 \break
262 \textSpannerUp
263 \override TextSpanner #'bound-details #'left #'text =
264   \markup { \italic "rit" } 
265 c2\startTextSpan b c\stopTextSpan a
266 @end lilypond
267
268 @refcommands
269
270 @funindex textSpannerUp
271 @code{\textSpannerUp},
272 @funindex textSpannerDown
273 @code{\textSpannerDown},
274 @funindex textSpannerNeutral
275 @code{\textSpannerNeutral}.
276
277
278 @commonprop
279
280 To print a solid line, use
281
282 @example
283 \override TextSpanner #'dash-fraction = #'()
284 @end example
285
286
287 @seealso
288
289 Program reference: @internalsref{TextSpanner}.
290
291
292 @node Text marks
293 @unnumberedsubsubsec Text marks
294
295 @cindex coda on bar line
296 @cindex segno on bar line
297 @cindex fermata on bar line
298 @cindex bar lines, symbols on
299 @funindex \mark
300
301 The @code{\mark} command is primarily used for
302 @ref{Rehearsal marks},
303 but it can also be used to put signs like coda,
304 segno, and fermata on a bar line.  Use @code{\markup} to
305 access the appropriate symbol (symbols are listed in
306 @ref{The Feta font}).
307
308 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
309 c1 \mark \markup { \musicglyph #"scripts.ufermata" }
310 c1
311 @end lilypond
312
313 @noindent
314 @code{\mark} is only typeset above the top stave of the score.  If
315 you specify the @code{\mark} command at a bar line, the resulting
316 mark is placed above the bar line.  If you specify it in the middle
317 of a bar, the resulting mark is positioned between notes.  If it is
318 specified before the beginning of a score line, it is placed
319 before the first note of the line.  Finally, if the mark occurs at
320 a line break, the mark will be printed at the
321 beginning of the next line.
322 @c  IMO this is a bug; hopefully it'll be fixed soon, so I can
323 @c  delete this sentence.   -gp
324 If there is no next line, then the mark will not be printed at all.
325
326
327 @commonprop
328
329 To print the mark at the end of the current line, use
330
331 @example
332 \override Score.RehearsalMark
333   #'break-visibility = #begin-of-line-invisible
334 @end example
335
336 @code{\mark} is often useful for adding text to the end of bar.  In
337 such cases, changing the @code{#'self-alignment} is very useful
338
339 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
340 \override Score.RehearsalMark
341   #'break-visibility = #begin-of-line-invisible
342 c1 c c c4 c c c
343 \once \override Score.RehearsalMark #'self-alignment-X = #right
344 \mark "D.S. al Fine "
345 @end lilypond
346
347 Text marks may be aligned with notation objects other than
348 bar lines,
349
350 @lilypond[fragment,quote,ragged-right,verbatim,relative=2]
351 \relative {
352   c1
353   \key cis \major
354   \clef alto
355   \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
356   \mark "on key"
357   cis
358   \key ces \major
359   \override Score.RehearsalMark #'break-align-symbols = #'(clef)
360   \clef treble
361   \mark "on clef"
362   ces
363   \override Score.RehearsalMark #'break-align-symbols = #'(time-signature)
364   \key d \minor
365   \clef tenor
366   \time 3/4
367   \mark "on time"
368   c
369 }
370 @end lilypond
371
372 Possible symbols for the @code{break-align-symbols} list are
373 @code{ambitus}, @code{breathing-sign}, @code{clef}, @code{custos},
374 @code{staff-bar}, @code{left-edge}, @code{key-cancellation},
375 @code{key-signature}, and @code{time-signature}.
376
377 The text marks will, by default, be aligned with the middle of the notation
378 object, but this can be changed by overriding the
379 @code{break-align-anchor-alignment} and
380 @code{break-align-anchor} properties for the appropriate grob.
381
382 @lilypond[fragment,quote,ragged-right,verbatim]
383 {
384   \override Score.RehearsalMark #'break-align-symbols = #'(key-signature)
385   c1
386   \key cis \major
387
388   % the RehearsalMark will be aligned with the left edge of the KeySignature
389   \once \override Staff.KeySignature #'break-align-anchor-alignment = #LEFT
390   \mark \default
391   cis1
392   \key ces \major
393
394   % the RehearsalMark will be aligned with the right edge of the KeySignature
395   \once \override Staff.KeySignature #'break-align-anchor-alignment = #RIGHT
396   \mark \default
397   ces1
398   \key cis \major
399
400   % the RehearsalMark will be aligned with the left edge of the KeySignature
401   % and then shifted right by 2 units.
402   \once \override Staff.KeySignature #'break-align-anchor = #2
403   \mark \default
404   ces1
405 }
406 @end lilypond
407
408 Although text marks are normally only printed above the topmost
409 staff, you may alter this to print them on every staff,
410
411 @lilypond[quote,ragged-right,verbatim,relative=2]
412 {
413   \new Score \with {
414     \remove "Mark_engraver"
415   }
416   <<
417     \new Staff \with {
418       \consists "Mark_engraver"
419     }
420     { c''1 \mark "foo" c'' }
421     \new Staff \with {
422       \consists "Mark_engraver"
423     }
424     { c'1 \mark "foo" c' }
425   >>
426 }
427 @end lilypond
428
429
430 @seealso
431
432 Program reference: @internalsref{RehearsalMark}.
433
434
435
436 @node New dynamic marks
437 @unnumberedsubsubsec New dynamic marks
438
439 It is possible to print new dynamic marks or text that should be aligned
440 with dynamics.  Use @code{make-dynamic-script} to create these
441 marks.  Note that the dynamic font only contains the characters
442 @code{f,m,p,r,s} and @code{z}.
443
444 Some situations (such as dynamic marks) have preset font-related
445 properties.  If you are creating text in such situations, it
446 is advisable to cancel those properties with
447 @code{normal-text}.  See @ref{Overview of text markup commands},
448 for more details.
449
450 @cindex make-dynamic-script
451
452 @lilypond[quote,verbatim,ragged-right]
453 sfzp = #(make-dynamic-script "sfzp")
454 \relative c' {
455   c4 c c\sfzp c
456 }
457 @end lilypond
458
459 @cindex Dynamics, editorial
460 @cindex Dynamics, parenthesis
461
462 It is also possible to print dynamics in round parenthesis or square
463 brackets.  These are often used for adding editorial dynamics.
464
465 @lilypond[quote,verbatim,ragged-right]
466 rndf = \markup{ \center-align {\line { \bold{\italic (}
467   \dynamic f \bold{\italic )} }} }
468 boxf = \markup{ \bracket { \dynamic f } }
469 { c'1_\rndf c'1_\boxf }
470 @end lilypond
471
472
473
474 @node Text markup
475 @subsection Text markup
476
477 @menu
478 * Text markup introduction::    
479 * Nested scores::               
480 * Page wrapping text::          
481 * Font selection::              
482 @end menu
483
484 @node Text markup introduction
485 @unnumberedsubsubsec Text markup introduction
486
487 @cindex markup
488 @cindex text markup
489 @cindex markup text
490 @cindex typeset text
491
492 Use @code{\markup} to typeset text.  Commands are entered with the
493 backslash @code{\}.  To enter @code{\} and @code{#}, use double
494 quotation marks.
495
496 @lilypond[quote,verbatim,fragment,relative=1]
497 c1^\markup { hello }
498 c1_\markup { hi there }
499 c1^\markup { hi \bold there, is \italic {anyone home?} }
500 c1_\markup { "\special {weird} #characters" }
501 @end lilypond
502
503 @noindent
504 See @ref{Overview of text markup commands}, for a list of all
505 commands.
506
507 @code{\markup} is primarily used for @internalsref{TextScript}s,
508 but it can also be used anywhere text is called in lilypond
509
510 @lilypond[quote,verbatim]
511 \header{ title = \markup{ \bold { foo \italic { bar! } } } }
512 \score{
513   \relative c'' {
514     \override Score.RehearsalMark
515       #'break-visibility = #begin-of-line-invisible
516     \override Score.RehearsalMark #'self-alignment-X = #right
517
518     \set Staff.instrumentName = \markup{ \column{ Alto solo } }
519     c2^\markup{ don't be \flat }
520     \override TextSpanner #'bound-details #'left #'text = \markup{\italic rit }
521     b2\startTextSpan
522     a2\mark \markup{ \large \bold Fine }
523     r2\stopTextSpan
524     \bar "||"
525   }
526   \addlyrics { bar, foo \markup{ \italic bar! } }
527 }
528 @end lilypond
529
530 A @code{\markup} command can also be placed on its own, away from any
531 @code{\score} block, see @ref{Multiple scores in a book}.
532
533 @lilypond[quote,ragged-right,verbatim]
534 \markup{ Here is some text. }
535 @end lilypond
536
537 @cindex font switching
538
539 The markup in the example demonstrates font switching commands.  The
540 command @code{\bold} and @code{\italic} apply to the first following
541 word only; to apply a command to more than one word, enclose the
542 words with braces,
543
544 @example
545 \markup @{ \bold @{ hi there @} @}
546 @end example
547
548 @noindent
549 For clarity, you can also do this for single arguments, e.g.,
550
551 @example
552 \markup @{ is \italic @{ anyone @} home @}
553 @end example
554
555 In markup mode you can compose expressions, similar to mathematical
556 expressions, XML documents, and music expressions.  You can stack
557 expressions grouped vertically with the command @code{\column}.
558 Similarly, @code{\center-align} aligns texts by their center lines:
559
560 @lilypond[quote,verbatim,fragment,relative=1]
561 c1^\markup { \column { a bbbb \line { c d } } }
562 c1^\markup { \center-align { a bbbb c } }
563 c1^\markup { \line { a b c } }
564 @end lilypond
565
566 Lists with no previous command are not kept distinct.  The expression
567
568 @example
569 \center-align @{ @{ a b @} @{ c d @} @}
570 @end example
571
572 @noindent
573
574 is equivalent to
575
576 @example
577 \center-align @{ a b c d @}
578 @end example
579
580 @noindent
581
582 To keep lists of words distinct, please use quotes @code{"} or
583 the @code{\line} command
584
585 @lilypond[quote,verbatim,fragment,relative=1]
586 \fatText
587 c4^\markup{ \center-align { on three lines } }
588 c4^\markup{ \center-align { "all one line" } }
589 c4^\markup{ \center-align { { on three lines } } }
590 c4^\markup{ \center-align { \line { on one line } } }
591 @end lilypond
592
593 Markups can be stored in variables and these variables
594 may be attached to notes, like
595 @example
596 allegro = \markup @{ \bold \large @{ Allegro @} @}
597  @{ a^\allegro b c d @}
598 @end example
599
600 Some objects have alignment procedures of their own, which cancel out
601 any effects of alignments applied to their markup arguments as a
602 whole.  For example, the @internalsref{RehearsalMark} is horizontally
603 centered, so using @code{\mark \markup @{ \left-align .. @}} has no
604 effect.
605
606 In addition, vertical placement is performed after creating the
607 text markup object.  If you wish to move an entire piece of markup,
608 you need to use the #'padding property or create an @q{anchor} point
609 inside the markup (generally with @code{\hspace #0}).
610
611 @lilypond[quote,verbatim,fragment,relative=1]
612 \fatText
613 c'4^\markup{ \raise #5 "not raised" }
614 \once \override TextScript #'padding = #3
615 c'4^\markup{ raised }
616 c'4^\markup{ \hspace #0 \raise #1.5 raised }
617 @end lilypond
618
619 Some situations (such as dynamic marks) have preset font-related
620 properties.  If you are creating text in such situations, it
621 is advisable to cancel those properties with
622 @code{normal-text}.  See @ref{Overview of text markup commands},
623 for more details.
624
625
626 @seealso
627
628 This manual: @ref{Overview of text markup commands}.
629
630 Program reference: @internalsref{TextScript}.
631
632 Init files: @file{scm/@/new@/-markup@/.scm}.
633
634
635 @refbugs
636
637 Kerning or generation of ligatures is only done when the @TeX{}
638 backend is used.  In this case, LilyPond does not account for them so
639 texts will be spaced slightly too wide.
640
641 Syntax errors for markup mode are confusing.
642
643
644 @node Nested scores
645 @unnumberedsubsubsec Nested scores
646
647 It is possible to nest music inside markups, by adding a @code{\score}
648 block to a markup expression.  Such a score must contain a @code{\layout}
649 block.
650
651 @lilypond[quote,verbatim,ragged-right]
652 \relative {
653   c4 d^\markup {
654     \score {
655       \relative { c4 d e f }
656       \layout { }
657     }
658   }
659   e f
660 }
661 @end lilypond
662
663 @node Page wrapping text
664 @unnumberedsubsubsec Page wrapping text
665 Whereas @code{\markup} is used to enter a non-breakable block of text,
666 @code{\markuplines} can be used at top-level to enter lines of text that
667 can spread over multiple pages:
668
669 @verbatim
670 \markuplines {
671   \justified-lines {
672     A very long text of justified lines.
673     ...
674   }
675   \justified-lines {
676     An other very long paragraph.
677     ...
678   }
679   ...
680 }
681 @end verbatim
682
683 @code{\markuplines} accepts a list of markup, that is either the result
684 of a markup list command, or a list of markups or of markup lists. The
685 built-in markup list commands are described in
686 @ref{Overview of text markup list commands}.
687
688 @seealso
689
690 This manual: @ref{Overview of text markup list commands}, 
691 @ref{New markup list command definition}.
692
693 @refcommands
694
695 @funindex \markuplines
696 @code{\markuplines}
697
698 @node Font selection
699 @unnumberedsubsubsec Font selection
700
701 @cindex font selection
702 @cindex font magnification
703 @funindex font-interface
704
705 By setting the object properties described below, you can select a
706 font from the preconfigured font families.  LilyPond has default
707 support for the feta music fonts. Text fonts are selected through
708 Pango/FontConfig. The serif font defaults to New Century Schoolbook,
709 the sans and typewriter to whatever the Pango installation defaults
710 to.
711
712
713 @itemize @bullet
714 @item @code{font-encoding}
715 is a symbol that sets layout of the glyphs.  This should only be set to
716 select different types of non-text fonts, e.g.
717
718 @code{fetaBraces} for piano staff braces, @code{fetaMusic} the
719 standard music font, including ancient glyphs, @code{fetaDynamic} for
720 dynamic signs and @code{fetaNumber} for the number font.
721
722 @item @code{font-family}
723 is a symbol indicating the general class of the typeface.  Supported are
724 @code{roman} (Computer Modern), @code{sans}, and @code{typewriter}.
725
726 @item @code{font-shape}
727 is a symbol indicating the shape of the font.  There are typically
728 several font shapes available for each font family.  Choices are
729 @code{italic}, @code{caps}, and @code{upright}.
730
731 @item @code{font-series}
732 is a symbol indicating the series of the font.  There are typically
733 several font series for each font family and shape.  Choices are
734 @code{medium} and @code{bold}.
735
736 @end itemize
737
738 Fonts selected in the way sketched above come from a predefined style
739 sheet. If you want to use a font from outside the style sheet,
740 then set the
741 @code{font-name} property,
742
743 @lilypond[fragment,verbatim]
744 {
745   \override Staff.TimeSignature #'font-name = #"Charter"
746   \override Staff.TimeSignature #'font-size = #2
747   \time 3/4
748   c'1_\markup {
749     \override #'(font-name . "Vera Bold")
750       { This text is in Vera Bold }
751   }
752 }
753 @end lilypond
754
755 @noindent
756 Any font can be used, as long as it is available to Pango/FontConfig.
757 To get a full list of all available fonts, run the command
758 @example
759 lilypond -dshow-available-fonts blabla
760 @end example
761 (the last argument of the command can be anything, but has to be present).
762
763
764 The size of the font may be set with the @code{font-size}
765 property. The resulting size is taken relative to the
766 @code{text-font-size} as defined in the @code{\paper} block.
767
768 @cindex font size
769 @cindex font magnification
770
771
772 It is also possible to change the default font family for the entire
773 document. This is done by calling the @code{make-pango-font-tree} from
774 within the @code{\paper} block. The function takes names for the font
775 families to use for roman, sans serif and monospaced text. For
776 example,
777
778 @cindex font families, setting
779 @cindex Pango
780
781
782 @lilypond[verbatim]
783 \paper  {
784   myStaffSize = #20
785
786   #(define fonts
787     (make-pango-font-tree "Times New Roman"
788                           "Nimbus Sans"
789                           "Luxi Mono"
790                            (/ myStaffSize 20)))
791 }
792
793 {
794   c'^\markup { roman: foo \sans bla \typewriter bar }
795 }
796 @end lilypond
797
798 @c we don't do Helvetica / Courier, since GS incorrectly loads
799 @c Apple TTF fonts
800
801
802
803 @seealso
804
805 Examples: @lsr{text,font@/-family@/-override.ly}.
806
807
808
809