lilypond-devel
[Top][All Lists]
Advanced

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

Re: Cairo plans


From: Rene Brandenburger
Subject: Re: Cairo plans
Date: Fri, 3 Sep 2021 13:54:41 +0200
User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

works great

thank you

Am 01.09.2021 um 16:24 schrieb Jean Abou Samra:
Le 01/09/2021 à 15:11, Rene Brandenburger a écrit :
I use the \postscript a lot when typesetting contemporary music e.g. like this:

\version "2.20.0"


wave_line = \markup {
  \with-dimensions #'(0 . 0) #'(0 . 0)
  \postscript #"0.3 setlinewidth 1 setlinecap [0 1]
 0 0 0 setrgbcolor  0.00 -3.50 moveto
 0.23 -3.71   0.47 -3.93   1.00 -4.00 curveto
 1.53 -4.07   2.36 -4.00   3.00 -3.50 curveto
 3.64 -3.00   4.11 -2.07   4.50 -1.46 curveto
 4.89 -0.84   5.22 -0.55   6.00 -0.80 curveto
 6.78 -1.05   8.03 -1.83   9.00 -1.53 curveto
 9.97 -1.23  10.66  0.15  11.50  0.50 curveto
12.34  0.85  13.32  0.17  14.00 -0.50 curveto
14.68 -1.17  15.05 -1.84  16.00 -2.50 curveto
16.95 -3.16  18.47 -3.82  20.00 -4.49 curveto
stroke "
}

 \relative c''{
  s1*5^\wave_line
}


This use case continues to be supported with
Cairo. Just convert \postscript to \path, wich
works both in the current PS backend and with Cairo.

\version "2.22.1"

wave_line = \markup {
  \with-dimensions #'(0 . 0) #'(0 . 0)
  \path #0.5
        #'((moveto 0.00 -3.50)
           (curveto 0.23 -3.71 0.47 -3.93 1.00 -4.00)
           (curveto 1.53 -4.07 2.36 -4.00 3.00 -3.50)
           (curveto 3.64 -3.00  4.11 -2.07 4.50 -1.46)
           (curveto 4.89 -0.84 5.22 -0.55 6.00 -0.80)
           (curveto 6.78 -1.05 8.03 -1.83 9.00 -1.53)
           (curveto 9.97 -1.23  10.66 0.15 11.50 0.50)
           (curveto 12.34  0.85  13.32 0.17 14.00 -0.50)
           (curveto 14.68 -1.17 15.05 -1.84 16.00 -2.50)
           (curveto 16.95 -3.16  18.47 -3.82 20.00 -4.49))
}

{ s1*5^\wave_line }

Actually, this is better in any case, because from
\path LilyPond is able to get extents and "skylines"
(outlines). Try:

\version "2.22.1"

#(ly:set-option 'debug-skylines)

wave_line = \markup
  \path #0.5
        #'((moveto 0.00 -3.50)
           (curveto 0.23 -3.71 0.47 -3.93 1.00 -4.00)
           (curveto 1.53 -4.07 2.36 -4.00 3.00 -3.50)
           (curveto 3.64 -3.00  4.11 -2.07 4.50 -1.46)
           (curveto 4.89 -0.84 5.22 -0.55 6.00 -0.80)
           (curveto 6.78 -1.05 8.03 -1.83 9.00 -1.53)
           (curveto 9.97 -1.23  10.66 0.15 11.50 0.50)
           (curveto 12.34  0.85  13.32 0.17 14.00 -0.50)
           (curveto 14.68 -1.17 15.05 -1.84 16.00 -2.50)
           (curveto 16.95 -3.16  18.47 -3.82 20.00 -4.49))

{ s1*5^\wave_line }

versus

\version "2.22.1"

#(ly:set-option 'debug-skylines)

wave_line = \markup
  \postscript #"0.3 setlinewidth 1 setlinecap [0 1]
 0 0 0 setrgbcolor  0.00 -3.50 moveto
 0.23 -3.71   0.47 -3.93   1.00 -4.00 curveto
 1.53 -4.07   2.36 -4.00   3.00 -3.50 curveto
 3.64 -3.00   4.11 -2.07   4.50 -1.46 curveto
 4.89 -0.84   5.22 -0.55   6.00 -0.80 curveto
 6.78 -1.05   8.03 -1.83   9.00 -1.53 curveto
 9.97 -1.23  10.66  0.15  11.50  0.50 curveto
12.34  0.85  13.32  0.17  14.00 -0.50 curveto
14.68 -1.17  15.05 -1.84  16.00 -2.50 curveto
16.95 -3.16  18.47 -3.82  20.00 -4.49 curveto
stroke "

{ s1*5^\wave_line }


Denemo uses postscript to generate a title page with a border.

From a glance at the output of

git grep "\\\\postscript"

in the Denemo repository, that should be easy to convert
to \path as above.

Best regards,
Jean




reply via email to

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