lilypond-user-fr
[Top][All Lists]
Advanced

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

Re: Spécification fontname dans fonction Scheme


From: Remy CLAVERIE
Subject: Re: Spécification fontname dans fonction Scheme
Date: Sat, 4 Jan 2020 15:05:40 +0100 (CET)

Bonjour à tous, bonjour Valentin,

Tu as raison, il autait mieux fallut que j'ajoute un exmple minimal. Le voici ci dessous.

Malheuresement, ta proposition de modification ne fonctionne pas...

Merci en tous cas,

 

Bon WE!

Rémy

 

\version "2.18.2"

% -----------------------------------------------------------------------------
% Fonction avec deux 'Time Signature'
#(define ((double-time-signature glyph a b) grob)
   (grob-interpret-markup grob
     (markup #:override '(baseline-skip . 2.0) #:number
       (#:line ((markup (#:fontsize 0.2 #:musicglyph glyph))
               
                (#:fontsize -1 #:column ( a b))
                )))))
% -----------------------------------------------------------------------------

% -----------------------------------------------------------------------------
% Fonction permettant l'ajout d'un incipit en début de Staff
incipit =
#(define-music-function (parser location incipit-music) (ly:music?)
   #{
     \once \override Staff.InstrumentName.self-alignment-X = #RIGHT
     \once \override Staff.InstrumentName.self-alignment-Y = ##f
     \once \override Staff . InstrumentName.padding = #0.5
     \once \override Staff.InstrumentName.stencil =
     #(lambda (grob)
        (let* ((instrument-name (ly:grob-property grob 'long-text)))
          (set! (ly:grob-property grob 'long-text)
                #{ \markup {
                  \score
                  {
                    { \context PetrucciStaff \with {
                      instrumentName = #instrument-name
                      %fontSize = #1
                      } $incipit-music                  
                    }
                    \layout { $(ly:grob-layout grob)
                              line-width = \indent
                              indent =
                              % primitive-eval is probably easiest for
                              % escaping lexical closure and evaluating
                              % everything respective to (current-module).
                              #(primitive-eval
                                '(or (false-if-exception (- indent incipit-width))
                                     (* 0.5 indent)))
                              ragged-right = ##f
                              ragged-last = ##f
                              system-count = #1 }
                  } \hspace #2 }
                #})
          (system-start-text::print grob)))
   #})
% -----------------------------------------------------------------------------
% Notes
myMusic = { a'2 c' d' e'1 }

% -----------------------------------------------------------------------------
% Mise en forme de l'incipit
incipitJMG = {
  \override Staff . Accidental #'glyph-name-alist = #alteration-mensural-glyph-name-alist
  \override Staff . KeySignature #'glyph-name-alist = #alteration-mensural-glyph-name-alist
  \override Staff . TimeSignature #'glyph-name-alist = #alteration-mensural-glyph-name-alist
  \override Staff . BassFigure #'glyph-name-alist = #alteration-mensural-glyph-name-alist
  \override Staff . BarLine . transparent = ##t
  \override Staff . Rest . style  = #'mensural 
  \override Staff . TimeSignature #'stencil = #ly:text-interface::print
  \override Staff . TimeSignature #'text = \markup \musicglyph #"timesig.mensural44"
  \override Staff . TimeSignature.stencil = #(double-time-signature  "timesig.mensural22" "3" "2")
  \key f \major
  \myMusic
  }
% -----------------------------------------------------------------------------

% -----------------------------------------------------------------------------
% Parition musicale
\score {
  \new Staff
  <<
    \incipit { \clef "petrucci-c3" \incipitJMG }
    \set Staff . instrumentName = "Viola"
    \new Voice { \key f \major \time 3/2 \myMusic }
  >>
  \layout {
  indent = 5\cm
  incipit-width = 2\cm
  }
}

 

 

 

 

 

 

> Message du 04/01/20 14:38
> De : "Valentin Villenave" <address@hidden>
> A : "Remy CLAVERIE" <address@hidden>
> Copie à : "Mialing list Lilypond" <address@hidden>
> Objet : Re: Spécification fontname dans fonction Scheme
>
> On 1/4/20, Remy CLAVERIE <address@hidden> wrote:
> > Je vous soumets ma première question de l'année. Je souhaite modifier la
> > fonction suivante pour spécifier la font-name des deux variables a et b,
> > mais je n'y arrive pas.
>
> A priori il devrait suffire d’ajouter un override au bon endroit,
> comme ceci par exemple :
>
> #(define ((double-time-signature glyph a b) grob)
> (grob-interpret-markup grob
> (markup #:override '(baseline-skip . 2.0)
> #:number
> (#:line ((markup (#:fontsize 0.2 #:musicglyph glyph))
> #:override '(font-name . "myfont")
> (#:fontsize -1 #:column ( a b))
> )))))
>
> Mais il vaudrait mieux poster un exemple compilable pour qu’on puisse
> tester exactement ce qu’il vous faut.
>
> Cordialement,
> V. V.
>

reply via email to

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