1 @c -*- coding: utf-8; mode: texinfo; -*-
3 Translation of GIT committish: FILL-IN-HEAD-COMMITTISH
5 When revising a translation, copy the HEAD committish of the
6 version that you are working on. For details, see the Contributors'
7 Guide, node Updating translation committishes..
15 @lilypondfile[quote]{text-headword.ly}
17 This section explains how to include text (with various
18 formatting) in music scores.
21 Some text elements that are not dealt with here are discussed in other
22 specific sections: @ref{Vocal music}, @ref{Titles and headers}.
31 @subsection Writing text
33 This section introduces different ways of adding text to a score.
35 @cindex Text, other languages
36 @warning{To write accented and special text (such as characters
37 from other languages), simply insert the characters directly into
38 the LilyPond file. The file must be saved as UTF-8. For more
39 information, see @ref{Text encoding}.}
50 @unnumberedsubsubsec Text scripts
53 @cindex text items, non-empty
54 @cindex non-empty texts
57 Simple @qq{quoted text} indications may be added to a score, as
58 demonstrated in the following example. Such indications may be
59 manually placed above or below the staff, using the syntax described
60 in @ref{Direction and placement}.
62 @lilypond[quote,verbatim,relative=2]
63 a8^"pizz." g f e a4-"scherz." f
66 This syntax is actually a shorthand; more complex text formatting may be
67 added to a note by explicitly using a @code{\markup} block, as described
68 in @ref{Formatting text}.
70 @lilypond[quote,verbatim,relative=2]
71 a8^\markup { \italic pizz. } g f e
72 a4_\markup { \tiny scherz. \bold molto } f
75 By default, text indications do not influence the note spacing. However,
76 their widths can be taken into account: in the following example, the
77 first text string does not affect spacing, whereas the second one does.
79 @lilypond[quote,verbatim,relative=2]
85 In addition to text scripts, articulations can be attached to notes.
86 For more information, see @ref{Articulations and ornamentations}.
88 For more information about the relative ordering of text scripts and
89 articulations, see @rlearning{Placement of objects}.
91 @funindex \textLengthOn
92 @funindex textLengthOn
93 @funindex \textLengthOff
94 @funindex textLengthOff
98 @code{\textLengthOff}.
103 @rlearning{Placement of objects}.
106 @ref{Formatting text},
107 @ref{Direction and placement},
108 @ref{Articulations and ornamentations}.
114 @rinternals{TextScript}.
116 @cindex text outside margin
117 @cindex margin, text running over
118 @cindex text, keeping inside margin
119 @cindex lyrics, keeping inside margin
122 Checking to make sure that text scripts and lyrics are within the
123 margins requires additonal calculations. In cases where slightly faster
124 performance is desired, use
127 \override Score.PaperColumn #'keep-inside-line = ##f
132 @unnumberedsubsubsec Text spanners
134 @cindex text spanners
136 Some performance indications, e.g., @notation{rallentando} or
137 @notation{accelerando}, are written as text and are extended over
138 multiple notes with dotted lines. Such objects, called
139 @qq{spanners}, may be created from one note to another using the
142 @lilypond[verbatim,quote,relative=2]
143 \override TextSpanner #'(bound-details left text) = "rit."
148 @cindex text spanners, formatting
149 @cindex formatting text spanners
152 The string to be printed is set through object properties. By default
153 it is printed in italic characters, but different formatting can be
154 obtained using @code{\markup} blocks, as described in
155 @ref{Formatting text}.
157 @lilypond[quote,relative=2,verbatim]
158 \override TextSpanner #'(bound-details left text) =
159 \markup { \upright "rit." }
164 The line style, as well as the text string, can be defined as an
165 object property. This syntax is described in @ref{Line styles}.
167 @funindex \textSpannerUp
168 @funindex textSpannerUp
169 @funindex \textSpannerDown
170 @funindex textSpannerDown
171 @funindex \textSpannerNeutral
172 @funindex textSpannerNeutral
176 @code{\textSpannerUp},
177 @code{\textSpannerDown},
178 @code{\textSpannerNeutral}.
182 LilyPond is only able to handle one text spanner per voice.
186 @lilypondfile[verbatim,quote,texidoc,doctitle]
187 {dynamics-text-spanner-postfix.ly}
189 @lilypondfile[verbatim,quote,texidoc,doctitle]
190 {dynamics-custom-text-spanner-postfix.ly}
196 @ref{Formatting text}.
200 @rlsr{Expressive marks}.
203 @rinternals{TextSpanner}.
207 @unnumberedsubsubsec Text marks
212 @cindex text on bar line
213 @cindex coda on bar line
214 @cindex segno on bar line
215 @cindex fermata on bar line
216 @cindex bar lines, symbols on
223 Various text elements may be added to a score using the syntax described
224 in @ref{Rehearsal marks}:
226 @c \mark needs to be placed on a separate line (it's not
227 @c attached to an object like \markup is). -vv
229 @lilypond[verbatim,quote,relative=2]
235 This syntax makes it possible to put any text on a bar line;
236 more complex text formatting may be added using a @code{\markup}
237 block, as described in @ref{Formatting text}:
239 @lilypond[quote,verbatim,relative=1]
241 \mark \markup { \italic { colla parte } }
247 This syntax also allows to print special signs, like coda, segno
248 or fermata, by specifying the appropriate symbol name as explained in
249 @ref{Music notation inside markup}:
251 @lilypond[quote,verbatim,relative=2]
253 \mark \markup { \musicglyph #"scripts.ufermata" }
258 Such objects are only typeset above the top staff of the score;
259 depending on whether they are specified at the end or the middle of a
260 bar, they can be placed above the bar line or between notes. When
261 specified at a line break, the mark will be printed at the beginning of
264 @lilypond[quote,verbatim,relative=2]
274 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
275 {printing-marks-at-the-end-of-a-line.ly}
277 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
278 {aligning-marks-with-various-notation-objects.ly}
280 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
281 {printing-marks-on-every-staff.ly}
285 @ref{Rehearsal marks},
286 @ref{Formatting text},
287 @ref{Music notation inside markup},
294 @rinternals{MarkEvent},
295 @rinternals{Mark_engraver},
296 @rinternals{RehearsalMark}.
300 @unnumberedsubsubsec Separate text
302 @cindex separate text
303 @cindex text, separate
304 @cindex standalone text
305 @cindex top-level text
306 @cindex text, top-level
307 @cindex text, standalone
312 A @code{\markup} block can exist by itself, outside of any
313 @code{\score} block, as a @qq{top-level expression}. This syntax
314 is described in @ref{File structure}.
316 @lilypond[verbatim,quote]
318 Tomorrow, and tomorrow, and tomorrow...
323 This allows printing text separately from the music, which is
324 particularly useful when the input file contains several music pieces,
325 as described in @ref{Multiple scores in a book}.
327 @lilypond[quote,verbatim]
332 Tomorrow, and tomorrow, and tomorrow...
339 Separate text blocks can be spread over multiple pages,
340 making it possible to print text documents or books entirely
341 within LilyPond. This feature, and the specific syntax it
342 requires, are described in @ref{Multi-page markup}.
347 @funindex \markuplist
358 @lilypondfile[verbatim,quote,ragged-right,texidoc,doctitle]
359 {stand-alone-two-column-markup.ly}
363 @ref{Formatting text},
364 @ref{File structure},
365 @ref{Multiple scores in a book},
366 @ref{Multi-page markup}.
372 @rinternals{TextScript}.
375 @node Formatting text
376 @subsection Formatting text
378 This section presents basic and advanced text formatting,
379 using the @code{\markup} mode specific syntax.
382 * Text markup introduction::
383 * Selecting font and font size::
385 * Graphic notation inside markup::
386 * Music notation inside markup::
387 * Multi-page markup::
390 @node Text markup introduction
391 @unnumberedsubsubsec Text markup introduction
401 A @code{\markup} block is used to typeset text with an extensible
402 syntax called @qq{markup mode}.
404 @cindex markup expressions
405 @cindex expressions, markup
406 @cindex markup syntax
407 @cindex syntax, markup
409 The markup syntax is similar to LilyPond's usual syntax: a
410 @code{\markup} expression is enclosed in curly braces
411 @code{@{@dots{} @}}. A single word is regarded as a minimal expression,
412 and therefore does not need to be enclosed with braces.
414 Unlike simple @qq{quoted text} indications, @code{\markup} blocks may
415 contain nested expressions or markup commands, entered using the
416 backslash @code{\} character. Such commands only affect the first
417 following expression.
419 @lilypond[quote,verbatim,relative=2]
421 a2^\markup { poco \italic più forte }
423 d2_\markup { \italic "string. assai" }
425 b1^\markup { \bold { molto \italic agitato } }
429 @cindex special characters in markup mode
430 @cindex markup mode, special characters
431 @cindex reserved characters, printing
432 @cindex printing reserved characters
433 @cindex printing special characters
434 @cindex quoted text in markup mode
435 @cindex markup mode, quoted text
437 A @code{\markup} block may also contain quoted text strings. Such
438 strings are treated as minimal text expressions, and therefore any
439 markup command or special character (such as @code{\} and@tie{}@code{#})
440 will be printed verbatim without affecting the formatting of the text.
441 Double quotation marks themselves may be printed by preceding them
444 @lilypond[quote,verbatim,relative=2]
445 a1^"\italic markup..."
446 a_\markup { \italic "... prints \"italic\" letters!" }
450 To be treated as a distinct expression, a list of words needs to be
451 enclosed with double quotes or preceded by a command. The way markup
452 expressions are defined affects how these expressions will be stacked,
453 centered and aligned; in the following example, the second
454 @code{\markup} expression is treated the same as the first one:
456 @lilypond[quote,verbatim,relative=2]
457 c1^\markup { \center-column { a bbb c } }
458 c1^\markup { \center-column { a { bbb c } } }
459 c1^\markup { \center-column { a \line { bbb c } } }
460 c1^\markup { \center-column { a "bbb c" } }
463 Markups can be stored in variables. Such variables may be
464 directly attached to notes:
466 @lilypond[quote,verbatim]
467 allegro = \markup { \bold \large Allegro }
477 An exhaustive list of @code{\markup}-specific commands can be found in
478 @ref{Text markup commands}.
482 @ref{Text markup commands}.
488 @file{scm/markup.scm}.
491 Syntax errors for markup mode can be confusing.
494 @node Selecting font and font size
495 @unnumberedsubsubsec Selecting font and font size
497 @cindex font switching
498 @cindex changing fonts
499 @cindex switching fonts
508 Basic font switching is supported in markup mode:
510 @lilypond[quote,verbatim,relative=2]
513 \italic { non troppo \underline Vivo }
516 d,_\markup { \italic quasi \smallCaps Tromba }
523 @funindex \abs-fontsize
533 The font size can be altered, relative to the global staff size, in a
534 number of different ways
536 It can be set to predefined size,
538 @lilypond[quote,verbatim,relative=2]
539 b1_\markup { \huge Sinfonia }
540 b1^\markup { \teeny da }
541 b1-\markup { \normalsize camera }
544 It can be set relative to its previous value,
546 @lilypond[quote,verbatim,relative=2]
547 b1_\markup { \larger Sinfonia }
548 b1^\markup { \smaller da }
549 b1-\markup { \magnify #0.6 camera }
552 It can be increased or decreased relative to the value set by the
555 @lilypond[quote,verbatim,relative=2]
556 b1_\markup { \fontsize #-2 Sinfonia }
557 b1^\markup { \fontsize #1 da }
558 b1-\markup { \fontsize #3 camera }
561 It can also be set to a fixed point-size, regardless of the global staff
564 @lilypond[quote,verbatim,relative=2]
565 b1_\markup { \abs-fontsize #20 Sinfonia }
566 b1^\markup { \abs-fontsize #8 da }
567 b1-\markup { \abs-fontsize #14 camera }
577 @funindex \normal-size-super
578 @funindex normal-size-super
580 Text may be printed as subscript or superscript. By default these are
581 printed in a smaller size, but a normal size can be used as well:
583 @lilypond[quote,verbatim]
586 \line { 1 \super st movement }
587 \line { 1 \normal-size-super st movement
588 \sub { (part two) } }
593 @cindex font families
595 The markup mode provides an easy way to select alternate font
596 families. The default serif font, of roman type, is automatically
597 selected unless specified otherwise; on the last line of the following
598 example, there is no difference between the first and the second word.
600 @lilypond[quote,verbatim]
603 \line { Act \number 1 }
604 \line { \sans { Scene I. } }
605 \line { \typewriter { Verona. An open place. } }
606 \line { Enter \roman Valentine and Proteus. }
612 Some of these font families, used for specific items such as numbers
613 or dynamics, do not provide all characters, as mentioned in
614 @ref{New dynamic marks} and @ref{Manual repeat marks}.
616 @c \concat is actually documented in Align (it is not
617 @c a font-switching command). But we need it here. -vv
619 When used inside a word, some font-switching or formatting commands
620 may produce an unwanted blank space. This can easily be solved by
621 concatenating the text elements together:
623 @lilypond[quote,verbatim]
627 \concat { 1 \super st }
631 \concat { \dynamic p , }
632 \italic { con dolce espressione }
638 An exhaustive list of font switching commands and custom font usage
639 commands can be found in @ref{Font}.
641 Defining custom font sets is also possible, as explained in
650 @funindex \normalsize
676 @ref{New dynamic marks},
677 @ref{Manual repeat marks},
681 @file{scm/define-markup-commands.scm}.
687 @rinternals{TextScript}.
690 Using the font sizing commands @code{\teeny}, @code{\tiny},
691 @code{\small}, @code{\normalsize}, @code{\large}, and
692 @code{\huge} will lead to inconsistent line spacing compared to
693 using @code{\fontsize}.
697 @unnumberedsubsubsec Text alignment
699 @cindex text, aligning
700 @cindex aligning text
701 @cindex aligning markup text
702 @cindex aligning markups
703 @cindex markups, aligning
704 @cindex markup text, aligning
706 This subsection discusses how to place text in markup mode. Markup
707 objects can also be moved as a whole, using the syntax described in
708 @rlearning{Moving objects}.
710 @c Padding commands should be mentioned on this page, but
711 @c most of these require \box to be more clearly illustrated. -vv
713 @cindex text, horizontal alignment
714 @cindex horizontal text alignment
716 @funindex \left-align
718 @funindex \center-align
719 @funindex center-align
720 @funindex \right-align
721 @funindex right-align
723 Markup objects may be aligned in different ways. By default, a text
724 indication is aligned on its left edge: in the following example,
725 there is no difference between the first and the second markup.
727 @lilypond[quote,verbatim,relative=2]
730 d-\markup { \left-align poco }
732 d-\markup { \center-align { poco } }
734 d-\markup { \right-align poco }
740 Horizontal alignment may be fine-tuned using a numeric value:
742 @lilypond[quote,verbatim,relative=2]
743 a1-\markup { \halign #-1 poco }
745 a,-\markup { \halign #0 poco }
747 a,-\markup { \halign #0.5 poco }
749 a,-\markup { \halign #2 poco }
753 Some objects may have alignment procedures of their own, and therefore
754 are not affected by these commands. It is possible to move such
755 markup objects as a whole, as shown for instance in
758 @cindex text, vertical alignment
759 @cindex vertical text alignment
768 @c QUERY Should the function of ``\null'' be clarified? rp
770 Vertical alignment is a bit more complex. As stated above, markup
771 objects can be moved as a whole; however, it is also possible to move
772 specific elements inside a markup block. In this case, the element to
773 be moved needs to be preceded with an @emph{anchor point}, that can be
774 another markup element or an invisible object. The following example
775 demonstrates these two possibilities; the last markup in this example
776 has no anchor point, and therefore is not moved.
778 @lilypond[quote,verbatim,relative=1]
781 \raise #2 { Scène 1 }
786 \lower #4 \bold { Très modéré }
790 \raise #4 \italic { Une forêt. }
795 @funindex \general-align
796 @funindex general-align
799 @funindex \translate-scaled
800 @funindex translate-scaled
802 Some commands can affect both the horizontal and vertical alignment of
803 text objects in markup mode. Any object affected by these commands
804 must be preceded with an anchor point:
806 @lilypond[quote,verbatim,relative=1]
809 \translate #'(-1 . 2) "Scène 1"
814 \general-align #Y #3.2 \bold "Très modéré"
819 \translate-scaled #'(-1 . 2) \teeny "Une forêt."
824 @cindex multi-line markup
825 @cindex markup, multi-line
826 @cindex multi-line text
827 @cindex text, multi-line
828 @cindex text in columns
829 @cindex columns, text
833 @funindex \center-column
834 @funindex center-column
836 A markup object may include several lines of text. In the following
837 example, each element or expression is placed on its own line, either
838 left-aligned or centered:
840 @lilypond[quote,verbatim]
856 @cindex centering text on the page
857 @cindex text, centering on the page
858 @cindex markup, centering on the page
863 Similarly, a list of elements or expressions may be spread to fill the
864 entire horizontal line width (if there is only one element, it will be
865 centered on the page). These expressions can, in turn, include
866 multi-line text or any other markup expression:
868 @lilypond[quote,verbatim]
871 \line { William S. Gilbert }
873 \huge \smallCaps "The Mikado"
875 \smallCaps "The Town of Titipu"
877 \line { Sir Arthur Sullivan }
885 @cindex wordwrapped text
886 @cindex justified text
887 @cindex text, justified
888 @cindex text, wordwrapped
889 @cindex markup text, wordwrapped
890 @cindex markup text, justified
897 Long text indications can also be automatically wrapped accordingly to
898 the given line width. These will be either left-aligned or justified,
899 as shown in the following example.
901 @lilypond[quote,verbatim]
904 \line \smallCaps { La vida breve }
905 \line \bold { Acto I }
907 (La escena representa el corral de una casa de
908 gitanos en el AlbaicÃn de Granada. Al fondo una
909 puerta por la que se ve el negro interior de
910 una Fragua, iluminado por los rojos resplandores
915 \line \bold { Acto II }
916 \override #'(line-width . 50)
918 (Calle de Granada. Fachada de la casa de Carmela
919 y su hermano Manuel con grandes ventanas abiertas
920 a través de las que se ve el patio
921 donde se celebra una alegre fiesta)
927 @cindex text alignment commands
928 @cindex markup text alignment commands
929 @cindex alignment, text, commands
931 An exhaustive list of text alignment commands can be found in
936 @rlearning{Moving objects}.
943 @file{scm/define-markup-commands.scm}.
949 @rinternals{TextScript}.
952 @node Graphic notation inside markup
953 @unnumberedsubsubsec Graphic notation inside markup
955 @cindex graphics, embedding
956 @cindex drawing graphic objects
957 @cindex graphic objects, drawing
958 @cindex embedding graphic objects
959 @cindex graphic objects, embedding
961 Various graphic objects may be added to a score, using markup
964 @cindex decorating text
966 @cindex text, framing
967 @cindex text, decorating
968 @cindex markup text, decorating
969 @cindex markup text, framing
975 @funindex \rounded-box
976 @funindex rounded-box
982 Some markup commands allow decoration of text elements with graphics,
983 as demonstrated in the following example.
985 @lilypond[quote,verbatim]
994 \bracket "1866 - 1925"
997 \rounded-box \bold Prelude
1002 @cindex padding around text
1003 @cindex text padding
1004 @cindex markup text padding
1006 @funindex \pad-markup
1007 @funindex pad-markup
1010 @funindex \pad-to-box
1011 @funindex pad-to-box
1012 @funindex \pad-around
1013 @funindex pad-around
1015 Some commands may require an increase in the padding around the text;
1016 this is achieved with some markup commands exhaustively described in
1019 @lilypond[quote,verbatim]
1020 \markup \fill-line {
1022 \box "Charles Ives (1874 - 1954)"
1024 \box \pad-markup #2 "THE UNANSWERED QUESTION"
1025 \box \pad-x #8 "A Cosmic Landscape"
1032 \box \pad-to-box #'(-5 . 20) #'(0 . 5)
1033 \bold "Largo to Presto"
1036 "String quartet keeps very even time,
1037 Flute quartet keeps very uneven time."
1041 @cindex graphic notation
1042 @cindex symbols, non-musical
1043 @cindex non-musical symbols
1044 @cindex notation, graphic
1048 @funindex \draw-circle
1049 @funindex draw-circle
1050 @funindex \filled-box
1051 @funindex filled-box
1054 @funindex \draw-line
1056 @funindex \arrow-head
1057 @funindex arrow-head
1059 Other graphic elements or symbols may be printed without requiring any
1060 text. As with any markup expression, such objects can be combined.
1062 @lilypond[quote,verbatim]
1065 \draw-circle #4 #0.4 ##f
1066 \filled-box #'(-4 . 4) #'(-0.5 . 0.5) #1
1072 \draw-line #'(0 . 4)
1073 \arrow-head #Y #DOWN ##f
1078 @cindex embedded graphics
1079 @cindex images, embedding
1080 @cindex graphics, embedding
1085 @funindex \postscript
1086 @funindex postscript
1088 Advanced graphic features include the ability to include external
1089 image files converted to the Encapsulated PostScript format
1090 (@emph{eps}), or to directly embed graphics into the input file, using
1091 native PostScript code. In such a case, it may be useful to
1092 explicitly specify the size of the drawing, as demonstrated below:
1094 @lilypond[quote,verbatim,relative=1]
1097 \epsfile #X #10 #"./context-example.eps"
1098 \with-dimensions #'(0 . 6) #'(0 . 10)
1114 An exhaustive list of graphics-specific commands can be found in
1120 @ref{Editorial annotations},
1124 @file{scm/define-markup-commands.scm},
1125 @file{scm/stencil.scm}.
1130 Internals Reference:
1131 @rinternals{TextScript}.
1134 @node Music notation inside markup
1135 @unnumberedsubsubsec Music notation inside markup
1137 @cindex notation inside markup
1138 @cindex music inside markup
1139 @cindex markup, music notation inside
1141 Various musical notation elements may be added to a score, inside a
1144 Notes and accidentals can be entered using markup commands:
1146 @lilypond[quote,verbatim,relative=2]
1150 \note-by-number #1 #1 #1.5
1153 \natural \semiflat \flat
1154 \sesquiflat \doubleflat
1158 \natural \semisharp \sharp
1159 \sesquisharp \doublesharp
1164 Other notation objects may also be printed
1167 @lilypond[quote,verbatim,relative=1]
1174 fis_\markup { \dynamic rf }
1185 More generally, any available musical symbol may be included
1186 separately in a markup object, as demonstrated below; an exhaustive
1187 list of these symbols and their names can be found in
1188 @ref{The Feta font}.
1190 @lilypond[quote,verbatim,relative=2]
1192 c'^\markup { \musicglyph #"eight" }
1194 c,8._\markup { \musicglyph #"clefs.G_change" }
1196 c2^\markup { \musicglyph #"timesig.neomensural94" }
1199 Another way of printing non-text glyphs is described in
1200 @ref{Fonts explained}. This is useful for printing braces of various
1203 The markup mode also supports diagrams for specific
1206 @lilypond[quote,verbatim,relative=2]
1208 \fret-diagram-terse #"x;x;o;2;3;2;"
1211 \harp-pedal #"^-v|--ov^"
1216 \musicglyph #"accordion.discant"
1218 \raise #0.5 \musicglyph #"accordion.dot"
1219 \raise #1.5 \musicglyph #"accordion.dot"
1223 @c The accordion diagram is actually taken from a snippet.
1226 Such diagrams are documented in @ref{Instrument Specific Markup}.
1228 @cindex score inside markup
1229 @cindex markup, score inside
1231 A whole score can even be nested inside a markup object. In such a
1232 case, the nested @code{\score} block must contain a @code{\layout}
1233 block, as demonstrated here:
1235 @lilypond[quote,verbatim,relative=1]
1238 \relative c' { c4 d e f }
1246 An exhaustive list of music notation related commands can be found in
1252 @ref{The Feta font},
1253 @ref{Fonts explained}.
1256 @file{scm/define-markup-commands.scm},
1257 @file{scm/fret-diagrams.scm},
1258 @file{scm/harp-pedals.scm}.
1263 Internals Reference:
1264 @rinternals{TextScript}.
1267 @node Multi-page markup
1268 @unnumberedsubsubsec Multi-page markup
1270 @cindex multi-page markup
1271 @cindex markup, multi-page
1272 @cindex markup text, multi-page
1273 @cindex text spread over multiple pages
1275 @funindex \markuplist
1276 @funindex markuplist
1277 @funindex \justified-lines
1278 @funindex justified-lines
1279 @funindex \wordwrap-lines
1280 @funindex wordwrap-lines
1282 Although standard markup objects are not breakable, a specific syntax
1283 makes it possible to enter lines of text that can spread over multiple
1286 @lilypond[quote,verbatim]
1289 A very long text of justified lines.
1293 Another very long paragraph.
1300 This syntax accepts a list of markups, that can be
1303 the result of a markup list command,
1307 a list of markup lists.
1310 An exhaustive list of markup list commands can be found in
1311 @ref{Text markup list commands}.
1315 @ref{Text markup list commands}.
1318 @rextend{New markup list command definition}.
1321 @file{scm/define-markup-commands.scm}.
1326 Internals Reference:
1327 @rinternals{TextScript}.
1329 @funindex \markuplist
1330 @funindex markuplist
1340 This section presents the way fonts are handled, and how they may be
1345 * Single entry fonts::
1346 * Entire document fonts::
1349 @node Fonts explained
1350 @unnumberedsubsubsec Fonts explained
1353 @cindex fonts, explained
1354 @cindex braces, various sizes
1355 @cindex fonts, non-text in markup
1356 @cindex non-text fonts in markup
1358 @funindex font-interface
1360 Fonts are handled through several libraries. FontConfig is used to
1361 detect available fonts on the system; the selected fonts are rendered
1364 Music notation fonts can be described as a set of specific glyphs,
1365 ordered in several families. The following syntax allows various
1366 LilyPond @code{feta} non-text fonts to be used directly in markup
1369 @lilypond[quote,verbatim,relative=2]
1372 \override #'(font-encoding . fetaBraces)
1374 \override #'(font-encoding . fetaText)
1376 \override #'(font-encoding . fetaMusic)
1377 \lookup #"noteheads.s0petrucci"
1383 However, all these glyphs except the braces of various sizes contained
1384 in @code{fetaBraces} are available using the simpler syntax described
1385 in @ref{Music notation inside markup}.
1387 When using the glyphs contained in @code{fetaBraces}, the size of the
1388 brace is specified by the numerical part of the glyph name, in
1389 arbitrary units. Any integer from @code{0} to @code{575} inclusive
1390 may be specified, @code{0} giving the smallest brace. The optimum
1391 value must be determined by trial and error. These glyphs are all
1392 left braces; right braces may be obtained by rotation, see
1393 @ref{Rotating objects}.
1395 Three families of text fonts are made available: the @emph{roman}
1396 (serif) font, that defaults to New Century Schoolbook, the
1397 @emph{sans} font and the monospaced @emph{typewriter} font -- these
1398 last two families are determined by the Pango installation.
1400 Each family may include different shapes and series. The following
1401 example demonstrates the ability to select alternate families, shapes,
1402 series and sizes. The value supplied to @code{font-size} is the
1403 required change from the default size.
1405 @lilypond[quote,verbatim,relative=2]
1406 \override Score.RehearsalMark #'font-family = #'typewriter
1407 \mark \markup "Ouverture"
1408 \override Voice.TextScript #'font-shape = #'italic
1409 \override Voice.TextScript #'font-series = #'bold
1410 d2.^\markup "Allegro"
1411 \override Voice.TextScript #'font-size = #-3
1416 A similar syntax may be used in markup mode; however in this case it
1417 is preferable to use the simpler syntax explained in
1418 @ref{Selecting font and font size}:
1420 @lilypond[quote,verbatim]
1424 \override #'(font-shape . italic)
1425 \override #'(font-size . 4)
1429 \override #'(font-family . typewriter)
1431 \override #'(font-series . bold)
1435 \override #'(font-family . sans)
1442 Although it is easy to switch between preconfigured fonts, it is also
1443 possible to use other fonts, as explained in the following sections:
1444 @ref{Single entry fonts} and @ref{Entire document fonts}.
1448 @ref{The Feta font},
1449 @ref{Music notation inside markup},
1450 @ref{Rotating objects},
1451 @ref{Selecting font and font size},
1455 @node Single entry fonts
1456 @unnumberedsubsubsec Single entry fonts
1458 Any font that is installed on the operating system and recognized by
1459 FontConfig may be used in a score, using the following syntax:
1461 @lilypond[quote,verbatim,relative=2]
1462 \override Staff.TimeSignature #'font-name = #"Bitstream Charter"
1463 \override Staff.TimeSignature #'font-size = #2
1467 \override #'(font-name . "Vera Bold")
1472 @cindex fonts, finding available
1473 @cindex finding available fonts
1474 @cindex listing available fonts
1475 @cindex available fonts, listing
1477 @funindex show-available-fonts
1479 The following command displays a list of all available fonts on the
1483 lilypond -dshow-available-fonts x
1488 @ref{Fonts explained},
1489 @ref{Entire document fonts}.
1494 @c A source file gets never installed...
1496 @c @file{lily/font-config-scheme.cc}.
1499 @node Entire document fonts
1500 @unnumberedsubsubsec Entire document fonts
1502 It is possible to change the fonts to be used as the default fonts in
1503 the @emph{roman}, @emph{sans} and @emph{typewriter} font families by
1504 specifying them, in that order, as shown in the example below. For an
1505 explanation of fonts, see @ref{Fonts explained}.
1507 @cindex font families, setting
1508 @cindex fonts, changing for entire document
1510 @funindex make-pango-font-tree
1512 @lilypond[verbatim,quote]
1516 (make-pango-font-tree "Times New Roman"
1519 (/ myStaffSize 20)))
1526 \typewriter typewriter. }
1530 @c we don't do Helvetica / Courier, since GS incorrectly loads
1535 @ref{Fonts explained},
1536 @ref{Single entry fonts},
1537 @ref{Selecting font and font size},