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