Am 16.09.2016 um 11:53 schrieb Pierre Perol-Schneider:
Hi Malte,

Here is an old thread regarding a similar demand:
http://lilypond.1069038.n5.nabble.com/Absolute-size-for-epsfile-i-e-independent-of-global-staff-size-td161872.html

HTH,
Pierre

Thanks Pierre for the hint and Marc for the solution I found in this thread. This approach also works for other things like baseline-skip overrides, probably I’ll make some other similar commands. It would be nice though to have an easier method to make whole markups “absolute-sized”, maybe something like

\markup \absolute {
  [everything inside behaves as if global staff size
   was the default 20pt]
}

or

\markup \absolute #16 {
  [everything inside behaves as if global staff size
   was 16pt]
}

with an optional argument or \default for #20.

Here my pt-based (instead of mm-based) abs-epsfile and abs-baseline-skip commands, maybe they are of interest for someone.

%%%%%

\version "2.19.47"

% based on epsfile-mm by Marc Hohl
% http://lists.gnu.org/archive/html/lilypond-user/2014-04/msg00632.html
#(define-markup-command
  (abs-epsfile layout props axis size file-name)
  (number? number? string?)
  (let* ((output-scale (ly:output-def-lookup layout 'output-scale))
         (scaled-size-mm (/ size output-scale))
         (scaled-size (* scaled-size-mm (/ 25.4 72.27))))
    (if (ly:get-option 'safe)
        (interpret-markup layout props "not allowed in safe")
        (eps-file->stencil axis scaled-size file-name))))

#(define-markup-command
  (abs-baseline-skip layout props skip m)
  (number? markup?)
  (let* ((output-scale (ly:output-def-lookup layout 'output-scale))
         (scaled-skip-mm (/ skip output-scale))
         (scaled-skip (* scaled-skip-mm (/ 25.4 72.27))))
        (interpret-markup layout props
          (markup #:override (cons 'baseline-skip scaled-skip) m))))

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to