lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strut problem


From: Jean Abou Samra
Subject: Re: strut problem
Date: Thu, 17 Nov 2022 18:26:35 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1

Le 17/11/2022 à 18:14, Werner LEMBERG a écrit :
Consider this input.

```
\version "2.23.81"

#(define-markup-command (strut layout props)
    ()
    #:properties ((baseline-skip))
    (ly:make-stencil ""
                     empty-interval
                     (cons (* -0.3 baseline-skip)
                           (* 0.7 baseline-skip))))

{
   \override TextScript.show-horizontal-skylines = ##t
   e'4^\markup { "a" }
   e'4^\markup \concat { \strut "a" }
}
```

Why is the vertical extent of the strut ignored?


Because side positioning is primarily based on (vertical)
skylines, not extents. While the horizontal skylines are
fine here (they're just taken from the extents), the vertical
ones are unchanged by \strut.

\version "2.23.81"

#(define-markup-command (strut layout props)
   ()
   #:properties ((baseline-skip))
   (ly:make-stencil ""
                    empty-interval
                    (cons (* -0.3 baseline-skip)
                          (* 0.7 baseline-skip))))

{
  \override TextScript.show-vertical-skylines = ##t
  e'4^\markup { "a" }
  e'4^\markup \concat { \strut "a" }
}




They change if you give \strut some outline, e.g.,



\version "2.23.81"

#(define-markup-command (strut layout props)
   ()
   #:properties ((baseline-skip))
   (let ((yext (cons (* -0.3 baseline-skip)
                     (* 0.7 baseline-skip))))
     (ly:stencil-outline
       (ly:make-stencil "" empty-interval yext)
       (make-filled-box-stencil '(0 . 0.01) yext))))

{
  \override TextScript.show-horizontal-skylines = ##t
  \override TextScript.show-vertical-skylines = ##t
  e'4^\markup { "a" }
  e'4^\markup \concat { \strut "a" }
}

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]