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