I’m having some trouble with customizing typefaces/fonts in this code. I
cannot get the \bold command to work, and for some reason I can’t use the
Garamond typeface. Can anyone help?

\version "2.24.4"

#(use-modules (srfi srfi-1))
#(use-modules (lily page))

#(define (newpageprops new-page lines config is-last-bookpart)
  (page-set-property! new-page 'lines lines)
  (page-set-property! new-page 'configuration config)
  (page-set-property! new-page 'is-last-bookpart is-last-bookpart))

#(define (bookpart-recto pagebreakalgo)
(lambda (paper-book)
   (let ((default-pages (pagebreakalgo paper-book)))
     (append-map
       (lambda (this-page)
         (let* ((page-number (page-property this-page 'page-number))
                (config (page-property this-page 'configuration))
                (lines (page-property this-page 'lines))
                (is-last-page (page-property this-page
'is-bookpart-last-page))
                (is-last-bookpart (page-property this-page
'is-last-bookpart)))
           (if (and is-last-page (odd? page-number) (not is-last-bookpart))
             (let* ((blank-page (make-page paper-book (1+ page-number) #t))
                    (new-page (make-page paper-book page-number #f)))
               (page-set-property! blank-page 'head-stencil empty-stencil)
               (page-set-property! blank-page 'foot-stencil empty-stencil)
               (newpageprops new-page lines config is-last-bookpart)
               (list this-page blank-page))
             (let* ((new-page (make-page paper-book page-number
is-last-page)))
               (newpageprops new-page lines config is-last-bookpart)
               (list this-page)))))
       default-pages))))

NN = 2 % how many numbered copies

myTitlePage = \markup \fill-line \huge { "This Is My Title Page" }

myScore = { c' \pageBreak d' }

myBookpart = #(define-scheme-function (n) ((lambda (x) (or (integer? x)
(string? x))))
#{
  \bookpart {
    \markup \fill-line
    \large % increases the font size
    \bold % does not work (has no effect on the output)
      { "" % this string causes the copy labels/numbers to be
right-justified on the page

        \override #'(font-name . "Comic Sans MS") % changes typeface to
Comic Sans MS

        % \override #'(font-name . "Garamond") % when enabled, this did not
produce Garamond output
        % Error message: warning: g_spawn_sync failed (-1): fondu: Failed
to execute child process “fondu” (No such file or directory)
        % warning: `(fondu -force /Library/Fonts/Microsoft/Garamond)'
failed (-1)

        % \override #'(font-name . "Arial") % works when enabled

        % \override #'(font-name . "Courier New") % works when enabled

        % \override #'(font-name . "DejaVu Math TeX Gyre") % works when
enabled

        % \override #'(font-name . "Nimbus Mono") % works when enabled

        { #(format #f "Copy ~a" n) }
      }
    \myTitlePage
    \pageBreak
    \myScore
  }
#})

\paper {
  page-breaking = #(bookpart-recto ly:optimal-breaking)
  bookpart-level-page-numbering = ##t
  oddFooterMarkup = \markup \fill-line { \if \on-last-page-of-part {
\fromproperty #'header:tagline } }
}

\book {
  #(for-each
     (lambda (i) (ly:book-add-bookpart! $current-book (myBookpart i)))
     (append '("for Choirmaster" "for Organist") (iota NN 1)))
}


On Fri, 5 Dec 2025 at 15:19, Gabriel Ellsworth wrote:

> Many thanks, Timothy! This is very helpful.
>
> On Sun, 30 Nov 2025, Timothy Lanfear wrote:
>
>> I devised a page breaking method that forces bookparts to start on a
>> recto page.
>>
>

Reply via email to