9

I've been looking at the latest stable version of Lilypond (2.24.2) and noticed that the figured bass font is not the same as before. Not only that, but (without changing anything) the symbols are smaller and some key symbols appear to be missing. Compare the following samples (continuo line with figures only, from a larger score):

-ver. 2.24.2: enter image description here -ver. 2.22.2: enter image description here

The question is, can one restore the older font without having to revert to the older version, and if so, how?

Example code as follows. The issue is AFAIK not caused by the custom notation font, since restoring the default does not solve the issue as then one is left with an inconsistent font (the back-stroke six is an obvious example of a Zwiebelfisch, see picture below); and in any case the issue does not even exist in the older version, so the logical deduction is that this is an issue caused by something in the newer version.

global = {
    \key d \minor
    \time 3/4
}

continuoPart = {
\relative c { g2 g'8 a | b4 a g | f e d | cis a cis | d a' a, | }
}
continuoFigures = { \figures { \set figuredBassAlterationDirection = #RIGHT \set figuredBassPlusDirection = #RIGHT
s2. <6>4 <6> <6> <6> <6\\> s <5/> \bassFigureExtendersOn <5/> <5/> \bassFigureExtendersOff <4>8 <3> <7 _+>4 \bassFigureExtendersOn <7 _+> \bassFigureExtendersOff
}
}

%%Output
\book {
    \bookOutputSuffix "Continuo"
    \paper {
        #(set-paper-size "letter")
        #(define fonts
        (set-global-fonts
            #:music "haydn"
            #:brace "haydn"
            #:factor (/ staff-height pt 20)
        ))
        top-margin = 22.5\mm
        bottom-margin = 22.5\mm
        left-margin = 22.5\mm
        right-margin = 22.5\mm
        %%page-count = #1
    }
    
\score {
        <<
        \new Staff = "continuo" { \set Staff.instrumentName = #"Continuo"
            \clef "bass" \global \continuoPart
        }
        \context Staff = "continuo" { 
            \bassFigureStaffAlignmentDown \continuoFigures 
        }
        >>
}
}

Ex. 3: no font, still an issue: enter image description here

2 Answers 2

8

The fontsize can be changed by overriding BassFigure.font-size. The old version used a value of -4, the new one does not use this property but directly sets the fontsize to -5. So set the fontsize to 1.

The slashed 6 is an alternate glyph as explained in https://lilypond.org/doc/v2.24/Documentation/notation/figured-bass.html section Adjusting figured bass alteration glyphs. Essentially you can set individual stroked glyphs for each step in figuredBassPlusStrokedAlist.

For the different accidentals: 2.22 used music font accidentals for this, which is not optically perfect for small text. 2.24 uses the unicode accidental glyphs provided by the number font.

In your case you are changing to fonts that does not have these special stroke characters nor unicode accidentals. This is why the slashed 6th is not displayed, and the accidental falls back to a random system font.

The solution here would be to change the figuredBassFormatter property to something that uses the notation font markups. So alltogether:

#(use-modules (srfi srfi-2)) % for `and-let*`
#(define (old-acc-format-bass-figure figure event context)
  (let* (;; User properties controlling the figured bass layout.
         (large-number-alignment
          (ly:context-property context 'figuredBassLargeNumberAlignment))
         (figbass-alist
          (ly:context-property context 'figuredBassPlusStrokedAlist))
         (alt-dir
          (ly:context-property context 'figuredBassAlterationDirection))
         (plus-dir
          (ly:context-property context 'figuredBassPlusDirection))

         (augmented (ly:event-property event 'augmented))

         ;; The digit(s), horizontally positioned, or #f.
         (fig-markup
          (if (number? figure)
              ((if (<= 10 figure)
                   (lambda (y)
                     (make-align-on-other-markup
                      X
                      large-number-alignment (make-number-markup "1")
                      large-number-alignment y))
                   identity)
               (cond
                ((eq? #t (ly:event-property event 'diminished))
                 (make-slashed-digit-markup figure))
                ((eq? #t (ly:event-property event 'augmented-slash))
                 ;; Use specially stroked digit if available and wanted.
                 (or (and-let* (((<= 6 figure 9))
                                (glyph (assv-ref figbass-alist figure)))
                       (make-musicglyph-markup glyph))
                     (make-backslashed-digit-markup figure)))
                ((eq? #t augmented)
                 ;; Use special digit with plus if available and wanted.
                 (or (and-let* (((>= 5 figure 2))
                                ((eqv? plus-dir RIGHT))
                                (glyph (assv-ref figbass-alist figure)))
                       (set! augmented #f)
                       (make-musicglyph-markup glyph))
                     (make-number-markup (number->string figure 10))))
                (else (make-number-markup (number->string figure 10)))))
              #f))

         (alt (ly:event-property event 'alteration))
         (alt-bracket (ly:event-property event 'alteration-bracket #f))
         ;; The alteration, probably bracketed but not positioned yet,
         ;; or #f.
         (alt-markup
          (if (number? alt)
              ((if alt-bracket make-bracket-markup identity)
               (alteration->text-accidental-markup alt))
              #f))

         (plus-markup (if (eq? #t augmented)
                          (make-number-markup "+")
                          #f)))

    (if (and (not alt-markup) alt-bracket)
        (ly:programming-error
         "Cannot put brackets around non-existent bass figure alteration."))

    ;; We treat a solitary alteration similarly to digits.
    (if (and (not fig-markup) alt-markup)
        (begin
          (set! fig-markup
                (make-align-on-other-markup
                 X
                 CENTER (make-number-markup "1")
                 CENTER alt-markup))
          (set! alt-markup #f)))

    ;; We treat a solitary plus similarly to digits (but enlarged).
    (if (and (not fig-markup) plus-markup)
        (begin
          (set! fig-markup
                (make-align-on-other-markup
                 Y
                 CENTER (make-number-markup "1")
                 CENTER (make-align-on-other-markup
                         X
                         CENTER (make-number-markup "1")
                         CENTER (make-fontsize-markup 3 plus-markup))))
          (set! plus-markup #f)))

    ;; The alteration gets attached either to the left or the right of
    ;; the digit(s).
    (if alt-markup
        (set! fig-markup
              (make-put-adjacent-markup
               X (if (number? alt-dir)
                     alt-dir
                     LEFT)
               fig-markup
               (make-pad-x-markup 0.1 alt-markup))))

    ;; Ditto for the plus mark.
    (if plus-markup
        (set! fig-markup
              (if fig-markup
                  (make-put-adjacent-markup
                   X (if (number? plus-dir)
                         plus-dir
                         LEFT)
                   fig-markup plus-markup)
                  plus-markup)))

    (if (markup? fig-markup)
        (make-fontsize-markup -5 fig-markup)
        (make-null-markup))))

\layout {
  \context {
    \FiguredBass
    \override BassFigure.font-size = #1
    figuredBassPlusStrokedAlist = #'()
    figuredBassFormatter = #old-acc-format-bass-figure
  }
}
1
  • 1
    Thanks for the in-depth explanation and the solution, which works like a charm!
    – AlexJ
    Sep 29, 2023 at 13:07
8

@Lazy's answer is correct. I would add, though, that if you are OK with using a development version (2.25.x) instead of the latest stable version (2.24.2), then there is a much simpler method to fix the alteration glyphs than changing the figured bass formatter. In 2.24, there is no way to mix several music fonts in the same score, but in 2.25 it has become possible (and easy). Therefore, you can work around the fact that Haydn does not contain the new glyphs used for figured bass (text-mode accidentals) by changing the default font to Haydn but reverting to the default font (Emmentaler) for bass figures.

\version "2.25.8"

global = {
  \key d \minor
  \time 3/4
}

continuoPart = \relative c {
  g2 g'8 a |
  b4 a g |
  f e d |
  cis a cis |
  d a' a, |
}

continuoFigures = {
  \figures {
    \set figuredBassAlterationDirection = #RIGHT
    \set figuredBassPlusDirection = #RIGHT
    s2. <6>4 <6> <6> <6> <6\\> s <5/>
    \bassFigureExtendersOn
    <5/> <5/>
    \bassFigureExtendersOff
    <4>8 <3> <7 _+>4
    \bassFigureExtendersOn
    <7 _+>
    \bassFigureExtendersOff
  }
}

\paper {
  #(set-paper-size "letter")
  property-defaults.fonts.music = "haydn"
  top-margin = 22.5\mm
  bottom-margin = 22.5\mm
  left-margin = 22.5\mm
  right-margin = 22.5\mm
  %%page-count = #1
}

\layout {
  \override FiguredBass.BassFigure.fonts.music = "emmentaler"
  \override FiguredBass.BassFigure.font-size = 1
  \set FiguredBass.figuredBassPlusStrokedAlist = #'()
}

\book {
  \bookOutputSuffix "Continuo"
  \score {
    <<
      \new Staff = "continuo" {
        \set Staff.instrumentName = #"Continuo"
        \clef "bass" \global \continuoPart
      }
      \context Staff = "continuo" {
        \bassFigureStaffAlignmentDown \continuoFigures
      }
    >>
  }
}

Output

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.