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: Fri, 18 Nov 2022 12:47:19 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1

Le 18/11/2022 à 12:34, Werner LEMBERG a écrit :
It is completely unclear to me how you would take non-printing
stencils with empty extents into skylines.  How should the resulting
skylines look like?  If the X extent is empty-interval, why should
the vertical skyline take this stencil into account on '(0 . 0) and
not on, say, '(2 . 2)?
I don't understand what you mean, please elaborate.


Put yourself in the shoes of LilyPond trying to compute the skylines
of this stencil:

(ly:make-stencil "" empty-interval '(-0.3 . 0.7))

According to you, the skyline should be a zero-width spike.
At which horizontal coordinate is this spike? Any value would
be legitimate.



What I want: Let's assume we have `\markup \concat {"a" \strut "a"}`,
then the vertical skyline would be

```
         |
      ___|___
     | a   a |
```

i.e., there would be a (zero-width) spike between the two 'a' glyphs.

If \strut needs to have an empty X extent for horizontal spacing
reasons, you will need to use ly:stencil-outline.
Please give an example.



Here is a refinement of my initial reply:



\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:make-stencil
      (ly:stencil-expr
       (ly:stencil-outline
        empty-stencil
        (make-filled-box-stencil '(0 . 0.05) yext)))
      empty-interval
      yext)))

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

\markup \box "a"
\markup \box \concat { \strut "a" }





Now the output of \strut should have a 'spike' skyline on
'(0 . 0.05) and an empty (not '(0 . 0), but really empty,
i.e. empty-interval = '(+inf.0 . -inf.0)) X extent.
(Which is kind of weird, by the way.)

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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