Re: \abs-(font)size for \epsfile

2016-09-17 Thread Kieren MacMillan
Hi Malte,

> It would be nice though to have an easier method to make whole markups 
> “absolute-sized”

That *would* be nice!

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

Here are the ones I use (can’t remember who wrote them?). I don’t know if 
they’re different, or which is preferable — but thought you might like to see 
them.

#(define-public (pt-to-ss size)
  (let* ((5pt (ly:pt 5))
 (output-scale (ly:output-def-lookup $defaultpaper 'output-scale 1))
 (factor (/ output-scale 5pt))
 (staff-space (* 5 factor)))
(/ size staff-space)))

#(define-markup-command (abs-baseline-skip layout props size arg)
  (number? markup?)
  #:category font
  (interpret-markup layout
(cons `((baseline-skip . ,(pt-to-ss size)))
  props)
arg))

Best,
Kieren.


Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: i...@kierenmacmillan.info


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


Re: \abs-(font)size for \epsfile

2016-09-17 Thread Malte Meyn


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


Re: \abs-(font)size for \epsfile

2016-09-16 Thread 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


2016-09-16 9:41 GMT+02:00 Malte Meyn :

> Hi list,
>
> is there a staff-size indepent version of \epsfile like \abs-fontsize
> instead of \fontsize?
>
> \markup \abs-fontsize #20 \epsfile #X #10 "foo.eps" seems to have no
> effect.
>
> Cheers
> Malte
>
> ___
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


\abs-(font)size for \epsfile

2016-09-16 Thread Malte Meyn

Hi list,

is there a staff-size indepent version of \epsfile like \abs-fontsize 
instead of \fontsize?


\markup \abs-fontsize #20 \epsfile #X #10 "foo.eps" seems to have no effect.

Cheers
Malte

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