This command acts as a front-end to \with-dimensions
, taking the new dimensions from a markup object instead of having them explicitly given.
https://codereview.appspot.com/281710043/
:::TeX
\version "2.19.36"
\paper { #(set-paper-size "a10") indent = 0 }
#(ly:set-option 'point-and-click #f)
\header { tagline = ##f }
#(define-markup-command (with-dimensions-from layout props arg1 arg2)
(markup? markup?)
#:category other
"
Print @var{arg2} with the dimensions of @var{arg1}."
(let* ((stil1 (interpret-markup layout props arg1))
(x (ly:stencil-extent stil1 0))
(y (ly:stencil-extent stil1 1)))
(interpret-markup layout props (markup #:with-dimensions x y arg2))))
\markup {
\pattern #5 #Y #0 "x"
\pattern #5 #Y #0 \with-dimensions-from "x" "f"
\pattern #5 #Y #0 \with-dimensions-from "x" "g"
\override #'(baseline-skip . 2)
\column {
\pattern #5 #X #0 "n"
\pattern #5 #X #0 \with-dimensions-from "n" "m"
\pattern #5 #X #0 \with-dimensions-from "n" "!"
}
}
Passes make, make check and a full make doc
Patch on countdown for Feb 15th
Patch counted down please push.
author Simon Albrecht simon.albrecht@mail.de
Tue, 16 Feb 2016 19:47:21 +0000 (19:47 +0000)
committer James Lowe pkx166h@gmail.com
Tue, 16 Feb 2016 19:48:28 +0000 (19:48 +0000)
commit 25fe86c1db4017a46c3169912ceae8a6663b057e