[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: can baseline-skip be absolute?
From: |
Werner LEMBERG |
Subject: |
Re: can baseline-skip be absolute? |
Date: |
Wed, 27 May 2015 16:14:12 +0200 (CEST) |
> Is there any way to set baseline-skip in absolute measurements?
I use a solution as below.
Werner
======================================================================
#(define-public (pt-to-ss size)
"Convert from points to staff space units."
;; The value `output-scale' gives the size (in mm) of the staff space at
;; the global staff size. By definition, the staff space for a staff
;; size of 20pt is 20pt / 4 = 5pt.
(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
"Use @var{size} as the absolute value for @code{baseline-skip} (in
points)."
(interpret-markup layout
(cons `((baseline-skip . ,(pt-to-ss size)))
props)
arg))
\paper {
line-width = 170.0\mm
top-margin = 15.0\mm
bottom-margin = 15.0\mm
indent = 20.0\mm
top-markup-spacing = #`((basic-distance . ,(pt-to-ss 30))
(minimum-distance . ,(pt-to-ss 30))
(padding . 0)
(stretchability . 0))
...
}