]> git.donarmstrong.com Git - lilypond.git/blobdiff - scm/define-markup-commands.scm
Fix some bugs in the dynamic engraver and PostScript backend
[lilypond.git] / scm / define-markup-commands.scm
index 5eea9071697b96ef37e15e6c13f773eccc13a665..1a940b13834e8c2dd79b0b60a367b82c9a1b28f2 100644 (file)
@@ -1267,6 +1267,17 @@ A negative @var{amount} indicates raising, see also @code{\\raise}.
                             (- amount) Y))
 
 
+(define-markup-command (translate-scaled layout props offset arg) (number-pair? markup?)
+  "Translate @var{arg} by @var{offset}, scaling the offset by the @code{font-size}."
+
+  (let*
+      ((factor (magstep (chain-assoc-get 'font-size props 0)))
+       (scaled (cons (* factor (car offset))
+                    (* factor (cdr offset)))))
+    
+  (ly:stencil-translate (interpret-markup layout props arg)
+                       scaled)))
+
 (define-markup-command (raise layout props amount arg) (number? markup?)
   "
 Raise @var{arg}, by the distance @var{amount}.