"
@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))
optionally filled.
@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))
A triangle, either filled or empty.
@lilypond[verbatim,quote]
-\\markup { \\triangle ##t \\hspace #2 \\triangle ##f }
+\\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))
"
@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))
\\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
+ \\with-color #white
+ \\filled-box #'(-4.5 . -2.5) #'(3.5 . 5.5) #0.7
}
@end lilypond"
(ly:round-filled-box
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)
\\markup {
\\fontsize #5
\\override #'(thickness . 2)
- \\combine \\draw-line #'(0 . 4) \\arrow-head #Y #DOWN ##f
+ \\combine
+ \\draw-line #'(0 . 4)
+ \\arrow-head #Y #DOWN ##f
}
@end lilypond"
(let* ((s1 (interpret-markup layout props m1))
@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)))
(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
()
- "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)
(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)
\\musicglyph #\"clefs.G_change\"
}
@end lilypond"
- (ly:font-get-glyph
- (ly:paper-get-font layout (cons '((font-encoding . fetaMusic))
- props))
- glyph-name))
+ (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?)
(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)
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
"
@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)))