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