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