On 1 nov. 2012, at 00:11, Paul Morris <p...@paulwmorris.com> wrote:

> On Oct 31, 2012, at 4:52 PM, Thomas Morley <thomasmorle...@googlemail.com> 
> wrote:
> 
>> Hi Paul,
>> 
>> postscript is scaled with global-staff-size only.
>> 
>> To work around you could use:
>> 
>> TwinNoteNoteHeads =
>> #(lambda (grob)
>>  (let* ((sz (ly:grob-property grob 'font-size 0.0))
>>         (mult (magstep sz)))
>>      (set! (ly:grob-property grob 'stencil) (ly:stencil-scale
>> (stencil-notehead grob) mult mult))
>>      (set! (ly:grob-property grob 'stem-attachment) (stem-adjuster grob))))
>> 
> 
> Hi Harm and Mike,  
> Thank you both for your help!  Harm's work around does the trick nicely!
> 
> On Mike's suggestion I also switched to using internal path stencils instead 
> of embedded PS. The only problem I ran into was using "fill" to get a filled 
> triangle.  I used:
> 
> upTriangle =
> #(ly:make-stencil
>     '(path 0.09
>         '(moveto -.1875 -.5
>           lineto .65625 .5
>           lineto 1.5 -.5
>           closepath
>           fill ()
>           )
>      )
>     (cons -.1875 1.5)
>     (cons -.5 .5)
> )
> 
> When I typeset my file the visual output is correct (filled triangles), but I 
> get either an "Unsupported SCM value for format" error for each of those 
> notes.  (Or if I omit the "()" after "fill" then the rendering fails with 
> "Wrong type argument in position 1 (expecting pair): ()").  I did not find 
> much documentation for "path", only a snippet that doesn't use "fill" [1].  
> 
> Does anyone know the value that is needed for "fill" to avoid this error?
> 
> Thanks again, it will be great to be able to resize staves!
> 
> -Paul
> 
> [1] http://lsr.dsi.unimi.it/LSR/Item?id=623
> 

Hey Paul,

Try make-connected-path-stencil.

(make-connected-path-stencil pointlist thickness x-scale y-scale connect fill)

Here, the x-scale and y-scale are scaling along the x and y axes, connect is a 
boolean if the path should be connected, and fill is a boolean if the path 
should be filled.  So...

upTriangle =
#(make-connected-path-stencil
  '(moveto -.1875 -.5
          lineto .65625 .5
          lineto 1.5 -.5)
     )
  0.09
  1.0
  1.0
  #t
  #t
)
The dimensions will be calculated for you by the function.

Cheers,
MS
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to