lilypond-user
[Top][All Lists]
Advanced

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

Re: ChordName Font Size


From: Aaron Hill
Subject: Re: ChordName Font Size
Date: Sun, 12 May 2019 21:13:54 -0700
User-agent: Roundcube Webmail/1.3.8

On 2019-05-12 5:29 pm, Gregory Hollands wrote:
I want to use an alternative font for ChordNames, but the font I have
chosen is not exactly the same size as the default font. The result is that
musical symbols (sharps, flat, etc) appear too large.

How can I change the size of the musical symbols in ChordNames so that they
match the size of the font?

Here is a bit of a hack:

%%%%
\version "2.19.82"

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)))))
  } #} )

theChords = \chordmode { c2:7 g2:dim aes2:m fis2 }
<< \new ChordNames \theChords
   \new ChordNames \with \embiggenChordNames #5 \theChords
   \new ChordNames \with \embiggenChordNames #-3 \theChords >>
%%%%

This applies a global \fontsize to the markup to scale everything up by a specified amount; however, it also looks within the markup for occurrences of \musicglyph and applies an inverse \fontsize so they remain the original size.

Wouldn't be surprised to learn there is some built-in procedure like map-some-music but for markup that would obsolete my helper function above. But I threw this together pretty quickly.


-- Aaron Hill

Attachment: chordname-size.cropped.png
Description: PNG image


reply via email to

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