"
@cindex drawing lines within text
-A simple line."
+A simple line.
+@lilypond[verbatim,quote]
+\\markup {
+ \\draw-line #'(4 . 4)
+ \\override #'(thickness . 5)
+ \\draw-line #'(-3 . 0)
+}
+@end lilypond"
(let ((th (* (ly:output-def-lookup layout 'line-thickness)
thickness))
(x (car dest))
A circle of radius @var{radius}, thickness @var{thickness} and
optionally filled.
-@c
+
@lilypond[verbatim,quote]
-\\markup { \\draw-circle #2 #0.5 ##f \\hspace #2 \\draw-circle #2 #0 ##t }
+\\markup {
+ \\draw-circle #2 #0.5 ##f
+ \\hspace #2
+ \\draw-circle #2 #0 ##t
+}
@end lilypond"
(make-circle-stencil radius thickness fill))
@cindex drawing triangles within text
A triangle, either filled or empty.
-@c
+
@lilypond[verbatim,quote]
-\\markup { \\triangle ##f \\triangle ##t }
+\\markup {
+ \\triangle ##t
+ \\hspace #2
+ \\triangle ##f
+}
@end lilypond"
(let ((ex (* (magstep font-size) 0.8 baseline-skip)))
(ly:make-stencil
Draw a circle around @var{arg}. Use @code{thickness},
@code{circle-padding} and @code{font-size} properties to determine line
-thickness and padding around the markup."
+thickness and padding around the markup.
+
+@lilypond[verbatim,quote]
+\\markup \\circle { Hi }
+@end lilypond"
(let ((th (* (ly:output-def-lookup layout 'line-thickness)
thickness))
(pad (* (magstep font-size) circle-padding))
Add a link to URL @var{url} around @var{arg}. This only works in
the PDF backend.
+
@lilypond[verbatim,quote]
\\markup {
\\with-url #\"http://lilypond.org/web/\" {
- LilyPond ... \\italic \"music notation for everyone\"
+ LilyPond ... \\italic { music notation for everyone }
}
}
@end lilypond"
"
@cindex drawing beams within text
-Create a beam with the specified parameters."
+Create a beam with the specified parameters.
+@lilypond[verbatim,quote]
+\\markup \\beam #5 #1 #2
+@end lilypond"
(let* ((y (* slope width))
(yext (cons (min 0 y) (max 0 y)))
(half (/ thickness 2)))
@cindex underlining text
Underline @var{arg}. Looks at @code{thickness} to determine line
-thickness and y offset."
+thickness and y offset.
+
+@lilypond[verbatim,quote]
+\\markup \\underline { CONTENTS }
+@end lilypond"
(let* ((thick (* (ly:output-def-lookup layout 'line-thickness)
thickness))
(markup (interpret-markup layout props arg))
Draw a box round @var{arg}. Looks at @code{thickness},
@code{box-padding} and @code{font-size} properties to determine line
-thickness and padding around the markup."
+thickness and padding around the markup.
+
+@lilypond[verbatim,quote]
+\\markup {
+ \\override #'(box-padding . 0.5)
+ \\box
+ \\line { V. S. }
+}
+@end lilypond"
(let* ((th (* (ly:output-def-lookup layout 'line-thickness)
thickness))
(pad (* (magstep font-size) box-padding))
@end verbatim
creates a box extending horizontally from -0.3 to 1.8 and
vertically from -0.3 up to 1.8, with corners formed from a
-circle of diameter@tie{}0 (i.e. sharp corners)."
+circle of diameter@tie{}0 (i.e. sharp corners).
+
+@lilypond[verbatim,quote]
+\\markup {
+ \\filled-box #'(0 . 4) #'(0 . 4) #0
+ \\filled-box #'(0 . 2) #'(-4 . 2) #0.4
+ \\filled-box #'(1 . 8) #'(0 . 7) #0.2
+ \\with-color #white
+ \\filled-box #'(-4.5 . -2.5) #'(3.5 . 5.5) #0.7
+}
+@end lilypond"
(ly:round-filled-box
xext yext blot))
makes possible to define another shape for the corners (default is 1).
@lilypond[quote,verbatim,fragment,relative=2]
-c^\\markup{ \\rounded-box Overtura }
+c^\\markup \\rounded-box { Overtura }
c,8. c16 c4 r
@end lilypond"
(let ((th (* (ly:output-def-lookup layout 'line-thickness)
@cindex inlining an Encapsulated PostScript image
Inline an EPS image. The image is scaled along @var{axis} to
-@var{size}."
+@var{size}.
+
+@lilypond[verbatim,quote]
+\\markup {
+ \\general-align #Y #DOWN {
+ \\epsfile #X #20 #\"context-example.eps\"
+ \\epsfile #Y #20 #\"context-example.eps\"
+ }
+}
+@end lilypond"
(if (ly:get-option 'safe)
(interpret-markup layout props "not allowed in safe")
(eps-file->stencil axis size file-name)
gsave /ecrm10 findfont
10.0 output-scale div
scalefont setfont 90 rotate (hello) show grestore
-@end example"
+@end example
+
+@lilypond[verbatim,quote]
+eyeglassesps = #\"
+ 0.15 setlinewidth
+ -0.9 0 translate
+ 1.1 1.1 scale
+ 1.2 0.7 moveto
+ 0.7 0.7 0.5 0 361 arc
+ stroke
+ 2.20 0.70 0.50 0 361 arc
+ stroke
+ 1.45 0.85 0.30 0 180 arc
+ stroke
+ 0.20 0.70 moveto
+ 0.80 2.00 lineto
+ 0.92 2.26 1.30 2.40 1.15 1.70 curveto
+ stroke
+ 2.70 0.70 moveto
+ 3.30 2.00 lineto
+ 3.42 2.26 3.80 2.40 3.65 1.70 curveto
+ stroke\"
+
+eyeglasses = \\markup {
+ \\with-dimensions #'(0 . 4.4) #'(0 . 2.5)
+ \\postscript #eyeglassesps
+}
+
+\\relative c'' { c2^\\eyeglasses a_\\eyeglasses }
+@end lilypond"
;; FIXME
(ly:make-stencil
(list 'embedded-ps
"
@cindex inserting music into text
-Inline an image of music."
+Inline an image of music.
+
+@lilypond[verbatim,quote]
+\\markup {
+ \\score {
+ \\new PianoStaff <<
+ \\new Staff \\relative c' {
+ \\key f \\major
+ \\time 3/4
+ \\mark \\markup { Allegro }
+ f2\\p( a4)
+ c2( a4)
+ bes2( g'4)
+ f8( e) e4 r
+ }
+ \\new Staff \\relative c {
+ \\clef bass
+ \\key f \\major
+ \\time 3/4
+ f8( a c a c a
+ f c' es c es c)
+ f,( bes d bes d bes)
+ f( g bes g bes g)
+ }
+ >>
+ \\layout {
+ indent = 0.0\\cm
+ \\context {
+ \\Score
+ \\override RehearsalMark #'break-align-symbols =
+ #'(time-signature key-signature)
+ \\override RehearsalMark #'self-alignment-X = #LEFT
+ }
+ \\context {
+ \\Staff
+ \\override TimeSignature #'break-align-anchor-alignment = #LEFT
+ }
+ }
+ }
+}
+@end lilypond"
(let* ((output (ly:score-embedded-format score layout)))
(if (ly:music-output? output)
"
@cindex merging text
-Print two markups on top of each other."
+Print two markups on top of each other.
+@lilypond[verbatim,quote]
+\\markup {
+ \\fontsize #5
+ \\override #'(thickness . 2)
+ \\combine
+ \\draw-line #'(0 . 4)
+ \\arrow-head #Y #DOWN ##f
+}
+@end lilypond"
(let* ((s1 (interpret-markup layout props m1))
(s2 (interpret-markup layout props m2)))
(ly:stencil-add s1 s2)))
@cindex stacking text in a column
Stack the markups in @var{args} vertically. The property
-@code{baseline-skip} determines the space between each markup in @var{args}."
+@code{baseline-skip} determines the space between each
+markup in @var{args}.
+
+@lilypond[verbatim,quote]
+\\markup \\column { one two three }
+@end lilypond"
(let ((arg-stencils (interpret-markup-list layout props args)))
(stack-lines -1 0.0 baseline-skip
(remove ly:stencil-empty? arg-stencils))))
@cindex changing direction of text columns
Make a column of args, going up or down, depending on the setting
-of the @code{#'direction} layout property."
+of the @code{#'direction} layout property.
+
+@lilypond[verbatim,quote]
+\\markup {
+ \\override #'(direction . 1)
+ \\dir-column { going up }
+ \\dir-column { going down }
+}
+@end lilypond"
(stack-lines (if (number? direction) direction -1)
0.0
baseline-skip
"
@cindex centering a column of text
-Put @code{args} in a centered column."
+Put @code{args} in a centered column.
+
+@lilypond[verbatim,quote]
+\\markup \\center-align { one two three }
+@end lilypond"
(let* ((mols (interpret-markup-list layout props args))
(cmols (map (lambda (x) (ly:stencil-aligned-to x X CENTER)) mols)))
(stack-lines -1 0.0 baseline-skip cmols)))
@cindex overriding properties within text markup
Add the first argument in to the property list. Properties may be
-any sort of property supported by @internalsref{font-interface} and
-@internalsref{text-interface}, for example
+any sort of property supported by @rinternals{font-interface} and
+@rinternals{text-interface}, for example
@example
\\override #'(font-family . married) \"bla\"
(string?)
other
()
- "Read the contents of a file, and include it verbatim."
+ "Read the contents of a file, and include it verbatim.
+
+@lilypond[verbatim,quote]
+\\markup \\verbatim-file #\"simple.ly\"
+@end lilypond"
(interpret-markup layout props
(if (ly:get-option 'safe)
"verbatim-file disabled in safe mode"
(markup?)
font
()
- "Increase the font size relative to current setting."
+ "Increase the font size relative to current setting.
+
+@lilypond[verbatim,quote]
+\\markup \\bigger {
+ Voici venir les temps où vibrant sur sa tige
+}
+@end lilypond"
(interpret-markup layout props
`(,fontsize-markup 1 ,arg)))
(markup?)
font
()
- "Set the argument as small numbers."
+ "Set the argument as small numbers.
+@lilypond[verbatim,quote]
+\\markup \\finger { 1 2 3 4 5 }
+@end lilypond"
(interpret-markup layout
(cons '((font-size . -5) (font-encoding . fetaNumber)) props)
arg))
(number? markup?)
font
((font-size 0)
+ (word-space 1)
(baseline-skip 2))
"Add @var{increment} to the font-size. Adjust baseline skip accordingly."
(let ((entries (list
(cons 'baseline-skip (* baseline-skip (magstep increment)))
+ (cons 'word-space (* word-space (magstep increment)))
(cons 'font-size (+ font-size increment)))))
(interpret-markup layout (cons entries props) arg)))
(markup?)
font
()
- "Switch to bold font-series."
+ "Switch to bold font-series.
+
+@lilypond[verbatim,quote]
+\\markup \\bold {
+ Chaque fleur s'évapore ainsi qu'un encensoir
+}
+@end lilypond"
(interpret-markup layout (prepend-alist-chain 'font-series 'bold props) arg))
(define-builtin-markup-command (sans layout props arg)
()
"Set font family to @code{number}, which yields the font used for
time signatures and fingerings. This font only contains numbers and
-some punctuation. It doesn't have any letters."
+some punctuation. It doesn't have any letters.
+
+@lilypond[verbatim,quote]
+\\markup \\number { 0 1 2 3 4 5 6 7 8 9 . , + - }
+@end lilypond"
(interpret-markup layout (prepend-alist-chain 'font-encoding 'fetaNumber props) arg))
(define-builtin-markup-command (roman layout props arg)
(markup?)
font
()
- "Set @code{font-shape} to @code{caps}."
+ "Set @code{font-shape} to @code{caps}"
(interpret-markup layout (prepend-alist-chain 'font-shape 'caps props) arg))
;; Poor man's caps
(markup?)
font
()
- "Emit @var{arg} as small caps."
+ "Emit @var{arg} as small caps.
+
+@lilypond[verbatim,quote]
+\\markup \\caps {
+ Les sons et les parfums tournent dans l'air du soir
+}
+@end lilypond"
(interpret-markup layout props (make-smallCaps-markup arg)))
(define-builtin-markup-command (dynamic layout props arg)
"Use the dynamic font. This font only contains @b{s}, @b{f}, @b{m},
@b{z}, @b{p}, and @b{r}. When producing phrases, like
@q{pi@`{u}@tie{}@b{f}}, the normal words (like @q{pi@`{u}}) should be
-done in a different font. The recommended font for this is bold and italic."
+done in a different font. The recommended font for this is bold and italic.
+@lilypond[verbatim,quote]
+\\markup { \\dynamic sfzp }
+@end lilypond"
(interpret-markup
layout (prepend-alist-chain 'font-encoding 'fetaDynamic props) arg))
(markup?)
font
()
- "Use italic @code{font-shape} for @var{arg}."
+ "Use italic @code{font-shape} for @var{arg}.
+
+@lilypond[verbatim,quote]
+\\markup \\italic { scherzando e leggiero }
+@end lilypond"
(interpret-markup layout (prepend-alist-chain 'font-shape 'italic props) arg))
(define-builtin-markup-command (typewriter layout props arg)
music
()
"Draw a double sharp symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\doublesharp }
@end lilypond"
music
()
"Draw a 3/2 sharp symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\sesquisharp }
@end lilypond"
music
()
"Draw a sharp symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\sharp }
@end lilypond"
music
()
"Draw a semi sharp symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\semisharp }
@end lilypond"
music
()
"Draw a natural symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\natural }
@end lilypond"
music
()
"Draw a semiflat symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\semiflat }
@end lilypond"
music
()
"Draw a flat symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\flat }
@end lilypond"
music
()
"Draw a 3/2 flat symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\sesquiflat }
@end lilypond"
music
()
"Draw a double flat symbol.
-@c
+
@lilypond[verbatim,quote]
\\markup { \\doubleflat }
@end lilypond"
graphic
()
"Produce an arrow head in specified direction and axis.
-Use the filled head if @var{filled} is specified."
+Use the filled head if @var{filled} is specified.
+@lilypond[verbatim,quote]
+\\markup {
+ \\fontsize #5
+ \\general-align #Y #DOWN {
+ \\arrow-head #Y #UP ##t
+ \\arrow-head #Y #DOWN ##f
+ \\hspace #2
+ \\arrow-head #X #RIGHT ##f
+ \\arrow-head #X #LEFT ##f
+ }
+}
+@end lilypond"
(let*
((name (format "arrowheads.~a.~a~a"
(if filled
"@var{glyph-name} is converted to a musical symbol; for example,
@code{\\musicglyph #\"accidentals.natural\"} selects the natural sign from
the music font. See @ruser{The Feta font} for a complete listing of
-the possible glyphs."
- (ly:font-get-glyph
- (ly:paper-get-font layout (cons '((font-encoding . fetaMusic))
- props))
- glyph-name))
+the possible glyphs.
+
+@lilypond[verbatim,quote]
+\\markup {
+ \\musicglyph #\"f\"
+ \\musicglyph #\"rests.2\"
+ \\musicglyph #\"clefs.G_change\"
+}
+@end lilypond"
+ (let* ((font (ly:paper-get-font layout
+ (cons '((font-encoding . fetaMusic)
+ (font-name . #f))
+
+ props)))
+ (glyph (ly:font-get-glyph font glyph-name)))
+ (if (null? (ly:stencil-expr glyph))
+ (ly:warning (_ "Cannot find glyph ~a") glyph-name))
+
+ glyph))
+
(define-builtin-markup-command (lookup layout props glyph-name)
(string?)
other
()
"Make a markup letter for @var{num}. The letters start with A to@tie{}Z
-(skipping letter@tie{}I), and continue with double letters."
+(skipping letter@tie{}I), and continue with double letters.
+
+@lilypond[verbatim,quote]
+\\markup { \\markletter #8 \\hspace #2 \\markletter #26 }
+@end lilypond"
(ly:text-interface::interpret-markup layout props
(number->markletter-string number->mark-letter-vector num)))
other
()
"Make a markup letter for @var{num}. The letters start with A to@tie{}Z
-and continue with double letters."
+and continue with double letters.
+
+@lilypond[verbatim,quote]
+\\markup { \\markalphabet #8 \\hspace #2 \\markalphabet #26 }
+@end lilypond"
(ly:text-interface::interpret-markup layout props
(number->markletter-string number->mark-alphabet-vector num)))
@cindex slashed digits
A feta number, with slash. This is for use in the context of
-figured bass notation."
+figured bass notation.
+@lilypond[verbatim,quote]
+\\markup {
+ \\slashed-digit #5
+ \\hspace #2
+ \\override #'(thickness . 3)
+ \\slashed-digit #7
+}
+@end lilypond"
(let* ((mag (magstep font-size))
(thickness (* mag
(ly:output-def-lookup layout 'line-thickness)
(ly:stencil-add number-stencil slash-stencil))
(ly:warning "invalid number for slashed digit ~a" num))
number-stencil))
-\f
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; the note command.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@cindex notes within text by log and dot-count
Construct a note symbol, with stem. By using fractional values for
-@var{dir}, you can obtain longer or shorter stems."
+@var{dir}, you can obtain longer or shorter stems.
+@lilypond[verbatim,quote]
+\\markup {
+ \\note-by-number #3 #0 #DOWN
+ \\hspace #1
+ \\note-by-number #1 #2 #0.8
+}
+@end lilypond"
(define (get-glyph-name-candidates dir log style)
(map (lambda (dir-name)
(format "noteheads.~a~a~a" dir-name (min log 2)
(number->string log)))
(cons (+ (car attach-off) (if (< dir 0) stem-thickness 0)) stemy)))))
- (if (and dots flaggl (> dir 0))
- (set! dots (ly:stencil-translate-axis dots 0.35 X)))
+ ; If there is a flag on an upstem and the stem is short, move the dots to avoid the flag.
+ ; 16th notes get a special case because their flags hang lower than any other flags.
+ (if (and dots (> dir 0) (> log 2) (or (< dir 1.15) (and (= log 4) (< dir 1.3))))
+ (set! dots (ly:stencil-translate-axis dots 0.5 X)))
(if flaggl
(set! stem-glyph (ly:stencil-add flaggl stem-glyph)))
(if (ly:stencil? stem-glyph)
This produces a note with a stem pointing in @var{dir} direction, with
the @var{duration} for the note head type and augmentation dots. For
example, @code{\\note #\"4.\" #-0.75} creates a dotted quarter note, with
-a shortened down stem."
+a shortened down stem.
+
+@lilypond[verbatim,quote]
+\\markup {
+ \\override #'(style . cross)
+ \\note #\"4..\" #UP
+ \\hspace #1
+ \\note #\"breve\" #0
+}
+@end lilypond"
(let ((parsed (parse-simple-duration duration)))
(note-by-number-markup layout props (car parsed) (cadr parsed) dir)))
\f
positions it next to the staff cancels any shift made with
@code{\\raise}. For vertical positioning, use the @code{padding}
and/or @code{extra-offset} properties.
-@c
+
@lilypond[verbatim,quote]
-\\markup { C \\small \\raise #1.0 \\bold { \"9/7+\" } }
+\\markup { C \\small \\raise #1.0 \\bold 9/7+ }
@end lilypond"
(ly:stencil-translate-axis (interpret-markup layout props arg) amount Y))
"
@cindex creating text fractions
-Make a fraction of two markups."
+Make a fraction of two markups.
+@lilypond[verbatim,quote]
+\\markup { π ≈ \\fraction 355 113 }
+@end lilypond"
(let* ((m1 (interpret-markup layout props arg1))
(m2 (interpret-markup layout props arg2))
(factor (magstep font-size))
Raising and lowering texts can be done with @code{\\super} and
@code{\\sub}:
-@c
+
@lilypond[verbatim,quote]
-\\markup { E \"=\" \\concat { \"mc\" \\super \"2\" } }
+\\markup { E = \\concat { mc \\super 2 } }
@end lilypond"
(ly:stencil-translate-axis
(interpret-markup
"
@cindex placing horizontal brackets around text
-Draw horizontal brackets around @var{arg}."
+Draw horizontal brackets around @var{arg}."
(let ((th 0.1) ;; todo: take from GROB.
(m (interpret-markup layout props arg)))
(bracketify-stencil m X th (* 2.5 th) th)))
"
@cindex placing vertical brackets around text
-Draw vertical brackets around @var{arg}."
+Draw vertical brackets around @var{arg}.
+
+@lilypond[verbatim,quote]
+\\markup \\bracket \\note #\"2.\" #UP
+@end lilypond"
(let ((th 0.1) ;; todo: take from GROB.
(m (interpret-markup layout props arg)))
(bracketify-stencil m Y th (* 2.5 th) th)))