(m (interpret-markup layout props arg)))
(circle-stencil m th pad)))
+(define-markup-command (ellipse layout props arg)
+ (markup?)
+ #:category graphic
+ #:properties ((thickness 1)
+ (font-size 0)
+ (x-padding 0.2)
+ (y-padding 0.2))
+ "
+@cindex drawing ellipse around text
+
+Draw an ellipse around @var{arg}. Use @code{thickness},
+@code{x-padding}, @code{y-padding} and @code{font-size} properties to determine
+line thickness and padding around the markup.
+
+@lilypond[verbatim,quote]
+\\markup {
+ \\ellipse {
+ Hi
+ }
+}
+@end lilypond"
+ (let ((th (* (ly:output-def-lookup layout 'line-thickness)
+ thickness))
+ (pad-x (* (magstep font-size) x-padding))
+ (pad-y (* (magstep font-size) y-padding))
+ (m (interpret-markup layout props arg)))
+ (ellipse-stencil m th pad-x pad-y)))
+
+(define-markup-command (oval layout props arg)
+ (markup?)
+ #:category graphic
+ #:properties ((thickness 1)
+ (font-size 0)
+ (x-padding 0.75)
+ (y-padding 0.75))
+ "
+@cindex drawing oval around text
+
+Draw an oval around @var{arg}. Use @code{thickness},
+@code{x-padding}, @code{x-padding} and @code{font-size} properties to determine
+line thickness and padding around the markup.
+
+@lilypond[verbatim,quote]
+\\markup {
+ \\oval {
+ Hi
+ }
+}
+@end lilypond"
+ (let ((th (* (ly:output-def-lookup layout 'line-thickness)
+ thickness))
+ (pad-x (* (magstep font-size) x-padding))
+ (pad-y (* (magstep font-size) y-padding))
+ (m (interpret-markup layout props arg)))
+ (oval-stencil m th pad-x pad-y)))
+
(define-markup-command (with-url layout props url arg)
(string? markup?)
#:category graphic
(let* ((arg-stencil (interpret-markup layout props arg))
(x-ext (ly:stencil-extent arg-stencil X))
(y-ext (ly:stencil-extent arg-stencil Y)))
- (ly:make-stencil
- `(delay-stencil-evaluation
- ,(delay (ly:stencil-expr
- (let* ((table (ly:output-def-lookup layout 'label-page-table))
+ (ly:stencil-add
+ (ly:make-stencil
+ `(delay-stencil-evaluation
+ ,(delay (let* ((table (ly:output-def-lookup layout 'label-page-table))
(page-number (if (list? table)
(assoc-get label table)
- #f))
- (link-expr (list 'page-link page-number
- `(quote ,x-ext) `(quote ,y-ext))))
- (ly:stencil-add (ly:make-stencil link-expr x-ext y-ext)
- arg-stencil)))))
- x-ext
- y-ext)))
+ #f)))
+ (list 'page-link page-number
+ `(quote ,x-ext) `(quote ,y-ext)))))
+ x-ext
+ y-ext)
+ arg-stencil)))
(define-markup-command (beam layout props width slope thickness)
@cindex putting space around text
Add space around a markup object.
+Identical to @code{pad-around}.
@lilypond[verbatim,quote]
\\markup {
}
}
@end lilypond"
- (let*
- ((stil (interpret-markup layout props arg))
- (xext (ly:stencil-extent stil X))
- (yext (ly:stencil-extent stil Y)))
-
- (ly:make-stencil
- (ly:stencil-expr stil)
- (interval-widen xext amount)
- (interval-widen yext amount))))
+ (let* ((m (interpret-markup layout props arg))
+ (x (interval-widen (ly:stencil-extent m X) amount))
+ (y (interval-widen (ly:stencil-extent m Y) amount)))
+ (ly:stencil-add (make-transparent-box-stencil x y)
+ m)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; space
@cindex setting extent of text objects
Set the dimensions of @var{arg} to @var{x} and@tie{}@var{y}."
- (let* ((m (interpret-markup layout props arg)))
- (ly:make-stencil (ly:stencil-expr m) x y)))
+ (let* ((expr (ly:stencil-expr (interpret-markup layout props arg))))
+ (ly:stencil-add
+ (make-transparent-box-stencil x y)
+ (ly:make-stencil
+ `(delay-stencil-evaluation ,(delay expr))
+ x y))))
(define-markup-command (pad-around layout props amount arg)
(number? markup?)
}
@end lilypond"
(let* ((m (interpret-markup layout props arg))
- (x (ly:stencil-extent m X))
- (y (ly:stencil-extent m Y)))
- (ly:make-stencil (ly:stencil-expr m)
- (interval-widen x amount)
- (interval-widen y amount))))
+ (x (interval-widen (ly:stencil-extent m X) amount))
+ (y (interval-widen (ly:stencil-extent m Y) amount)))
+ (ly:stencil-add (make-transparent-box-stencil x y)
+ m)))
(define-markup-command (pad-x layout props amount arg)
(number? markup?)
(let* ((m (interpret-markup layout props arg))
(x (ly:stencil-extent m X))
(y (ly:stencil-extent m Y)))
- (ly:make-stencil "" x y)))
+ (ly:make-stencil (list 'transparent-stencil (ly:stencil-expr m)) x y)))
(define-markup-command (pad-to-box layout props x-ext y-ext arg)
(number-pair? number-pair? markup?)
}
}
@end lilypond"
- (let* ((m (interpret-markup layout props arg))
- (x (ly:stencil-extent m X))
- (y (ly:stencil-extent m Y)))
- (ly:make-stencil (ly:stencil-expr m)
- (interval-union x-ext x)
- (interval-union y-ext y))))
+ (ly:stencil-add (make-transparent-box-stencil x-ext y-ext)
+ (interpret-markup layout props arg)))
(define-markup-command (hcenter-in layout props length arg)
(number? markup?)
mmr-stil
stil))))
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; fermata markup
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(define-markup-command (fermata layout props) ()
+ #:category music
+ #:properties ((direction UP))
+ "Create a fermata glyph. When @var{direction} is @code{DOWN}, use
+an inverted glyph. Note that within music, one would usually use the
+@code{\\fermata} articulation instead of a markup.
+
+@lilypond[verbatim,quote]
+ { c1^\\markup \\fermata d1_\\markup \\fermata }
+
+\\markup { \\fermata \\override #`(direction . ,DOWN) \\fermata }
+@end lilypond
+"
+ (interpret-markup layout props
+ (if (eqv? direction DOWN)
+ (markup #:musicglyph "scripts.dfermata")
+ (markup #:musicglyph "scripts.ufermata"))))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; translating.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(let* ((gauge-stencil (interpret-markup layout props gauge))
(x-ext (ly:stencil-extent gauge-stencil X))
(y-ext (ly:stencil-extent gauge-stencil Y)))
+ (ly:stencil-add
+ (make-transparent-box-stencil x-ext y-ext))
(ly:make-stencil
`(delay-stencil-evaluation
,(delay (ly:stencil-expr