@}
@end example
-If routines with multiple arguments must be called, the current grob
-can be inserted with a grob closure. Here is a setting from
-@code{RehearsalMark},
-
-@example
-`(X-offset .
- ,(ly:make-simple-closure
- `(,+
- ,(ly:make-simple-closure
- (list ly:break-alignable-interface::self-align-callback))
- ,(ly:make-simple-closure
- (list ly:self-alignment-interface::x-aligned-on-self)))))
-@end example
-
-@noindent
-In this example, both @code{ly:break-alignable-interface::self-align-callback} and
-@code{ly:self-alignment-interface::x-aligned-on-self} are called
-with the grob as argument. The results are added with the @code{+}
-function. To ensure that this addition is properly executed, the whole
-thing is enclosed in @code{ly:make-simple-closure}.
-
-In fact, using a single procedure as property value is equivalent to
-
-@example
-(ly:make-simple-closure (ly:make-simple-closure (list @var{proc})))
-@end example
-
-@noindent
-The inner @code{ly:make-simple-closure} supplies the grob as argument
-to @var{proc}, the outer ensures that result of the function is
-returned, rather than the @code{simple-closure} object.
-
From within a callback, the easiest method for evaluating a markup is
to use grob-interpret-markup. For example:
(self-alignment-X . ,RIGHT)
(side-axis . ,Y)
(stencil . ,ly:text-interface::print)
- (X-offset . ,(ly:make-simple-closure
- `(,+
- ,(ly:make-simple-closure
- (list ly:break-alignable-interface::self-align-callback))
- ,(ly:make-simple-closure
- (list ly:self-alignment-interface::x-aligned-on-self)))))
+ (X-offset . ,self-alignment-interface::self-aligned-on-breakable)
(Y-offset . ,side-position-interface::y-aligned-side)
(Y-extent . ,grob::always-Y-extent-from-stencil)
(meta .
(stencil . ,ly:text-interface::print)
(vertical-skylines . ,grob::always-vertical-skylines-from-stencil)
(Y-offset . ,side-position-interface::y-aligned-side)
- (X-offset . ,(ly:make-simple-closure
- `(,+
- ,(ly:make-simple-closure
- (list ly:break-alignable-interface::self-align-callback))
- ,(ly:make-simple-closure
- (list ly:self-alignment-interface::x-aligned-on-self)))))
+ (X-offset . ,self-alignment-interface::self-aligned-on-breakable)
(self-alignment-X . ,LEFT)
(break-align-symbols . (time-signature))
(non-break-align-symbols . (paper-column-interface))
(self-alignment-X . ,CENTER)
(stencil . ,ly:text-interface::print)
(vertical-skylines . ,grob::always-vertical-skylines-from-stencil)
- (X-offset . ,(ly:make-simple-closure
- `(,+
- ,(ly:make-simple-closure
- (list ly:break-alignable-interface::self-align-callback))
- ,(ly:make-simple-closure
- (list ly:self-alignment-interface::x-aligned-on-self)))))
+ (X-offset . ,self-alignment-interface::self-aligned-on-breakable)
(Y-offset . ,side-position-interface::y-aligned-side)
(Y-extent . ,grob::always-Y-extent-from-stencil)
(meta . ((class . Item)
ly:self-alignment-interface::y-aligned-on-self
ly:self-alignment-interface::pure-y-aligned-on-self))
+(define-public (self-alignment-interface::self-aligned-on-breakable grob)
+ "Return the @code{X-offset} that places @var{grob} according to its
+ @code{self-alignment-X} over the reference point defined by the
+ @code{break-align-anchor-alignment} of a @code{break-aligned} item
+ such as a @code{Clef}."
+ (+ (ly:break-alignable-interface::self-align-callback grob)
+ (ly:self-alignment-interface::x-aligned-on-self grob)))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; staff symbol