lilypond-user
[Top][All Lists]
Advanced

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

Re: ChordName Font Size


From: Gregory Hollands
Subject: Re: ChordName Font Size
Date: Fri, 17 May 2019 19:21:07 -0400

Aaron,

I noticed that the scaling factor -- #3 in the example below -- is not the same between this method and the standard method ( \override Chordname #'font-size).
This isn't a problem, as I was able to adjust the font size to my liking, however I am curious as to why the difference exists.

%%%
\version "2.19"

embiggenChordNames = #(define-scheme-function (size) (number?)
   #{ \with {
     chordNameFunction = #(lambda (in-pitches bass inversion context)
       (define (helper mu)
         (if (list? mu)
           (if (eq? (car mu) musicglyph-markup)
             (markup (#:fontsize (- size) mu))
             (map helper mu))
           mu))
       (let ((orig (ignatzek-chord-names in-pitches bass inversion context)))
         (markup (#:fontsize size (helper orig)))))
   } #} )

Chords = \chordmode {
  \override ChordName #'font-name = #"Source Sans Pro"
  a:dim bes c:maj7 d:m e:aug fis g:7/b
}

<<
  \new ChordNames
    \with \embiggenChordNames #3
    \Chords
>>

<<
  \new ChordNames
    \with { \override ChordName #'font-size = #3 }
    \Chords
>>
%%%

On Tue, May 14, 2019 at 9:23 PM Gregory Hollands <address@hidden> wrote:
Aaron,

This function is working nicely, except the major seventh triangle is still growing with the font size.
I *was* able to put this in an included .ily file. I had been including the wrong file before  ¯\_(ツ)_/¯  

%%%
\version "2.19"

embiggenChordNames = #(define-scheme-function (size) (number?)
   #{ \with {
     chordNameFunction = #(lambda (in-pitches bass inversion context)
       (define (helper mu)
         (if (list? mu)
           (if (eq? (car mu) musicglyph-markup)
             (markup (#:fontsize (- size) mu))
             (map helper mu))
           mu))
       (let ((orig (ignatzek-chord-names in-pitches bass inversion context)))
         (markup (#:fontsize size (helper orig)))))
   } #} )

Chords = \chordmode {
  \override ChordName #'font-name = #"Source Sans Pro"
  a:dim bes c:maj7 d:m e:aug fis g:7/b
}

<<
  \new ChordNames \with \embiggenChordNames #3 { \Chords }
>>
%%%

Thanks for helping me out,
Greg

reply via email to

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