Search code examples
fontslilypond

What is causing this error in changing the default music font in a Lilypond document?


The first few lines of my file clarinettrio.ly look like this (with several lines of comments removed for your convenience):

\version "2.18.0"

\paper {
    #(define fonts
     (set-global-fonts
        #:music "Improviso" 
    ))  
}

Unfortunately, attempting to run Lilypond results in this (relatively uninformative) error:

C:/MusicStuff/COMPOSITION/PORTFOLIO/Clarinet Trio/clarinettrio.ly:27:4: error: GUILE signaled an error for the expression beginning here
    #
       (define fonts

I checked multiple times to make sure I followed the examples I found online, so if you know what I might be doing wrong, any help would be appreciated!

(I found a forum online where a similar problem was being discussed, but in that instance, the error message included something about undefined variables, which ended up being the problem. The error message I'm getting does not include anything about variables, which makes sense since at that point in the file, no variables have been defined yet.)

The problem persists if I replace "Improviso" with "emmentaler" or "feta".


Solution

  • As explained in the openlilylib website, where you probably downloaded the Improviso font, you must use lilypond version 2.19.12 or later. Also, be sure to copy the Improviso font inside the lilypond install directory. I suggest using this script.