4

Which font is used for the \sectionMark in Lilypond?

screenshot

The \sectionMark is defined simply as a formatted text:

sectionMark =
#(define-music-function (parser location text) (markup?)
   #{
     \mark \markup { \box { \bold #text } }
   #})

The screenshot is from a Windows machine.

Edit: I have just ran #(ly:font-config-display-fonts) which showed all the config locations and the fonts available. I'm still not sure which exact font is used, though. Can this be deciphered from a generated PDF?

6
  • 2
    do you mean \sectionLabel? Commented Oct 7, 2022 at 14:57
  • @ElementsinSpace, thank you for the tip. This is a custom instruction, true! I've updated the question. Commented Oct 7, 2022 at 15:07
  • 1
    Not really related to the question, but I don't understand why you don't just use \mark \default, which lets LilyPond pick the next letter automatically. If you want boxed rehearsal marks, you can select that as a style option with \layout { \context { \Score rehearsalMarkFormatter = #format-mark-box-letters } } (replace rehearsalMarkFormatter with markFormatter for LilyPond ≤ 2.23.6). Commented Oct 7, 2022 at 15:41
  • 1
    Also, the parser location part is unnecessary in reasonably recent versions and more or less deprecated. Commented Oct 7, 2022 at 15:44
  • 2
    \mark lets you do that too, e.g., \mark 3 Commented Oct 7, 2022 at 18:32

2 Answers 2

7

The same font as Lilypond uses for everything else. If you look at https://lilypond.org/doc/v2.23/Documentation/notation/fonts (this is the v2.23 documentation, change this to the version you use) you can see what fonts Lilypond uses by default:

C059, Century SchoolBook URW, Century Schoolbook L, TeX Gyre Schola, DejaVu Serif, …, serif

So Lilypond tries to find a glyph first in URW C059 (which ships with it), then in Century SchoolBook URW, then in Century Schoolbook L, then in TeX Gyre Schola, then in DejaVu Serif. At some point Lilypond defaulted to TeX Gyre Schola as first option, which is an opentype font created from URW’s original postscript fonts release. With URW rereleasing them as opentype fonts Lilypond changed their defaults.

Short Answer: It is some verion of Century Schoolbook.

3
  • Thank you for the explanation! I have just found the config files but was/am still unsure about which exact font was used. :) According to the generated PDF, it is probably C059. The confusion is caused by a different rendering when the same font used in an SVG. Commented Oct 7, 2022 at 16:11
  • OK, finally got it. It is indeed C059 Bold. Commented Oct 7, 2022 at 16:21
  • 1
    If you are using an unstable (2.23) version from the official website, you can compile with -dbackend=cairo to get the same fonts (edit: in SVG). Beware though, this is experimental, not enabled in all Linux distros, and doesn’t support output-attributes. Commented Oct 7, 2022 at 18:35
2

To add some details to @Lazy's answer, the command #(ly:font-config-display-fonts) can be used to display configs and paths.

The first config file listed, 00-lilypond-fonts.conf, has these defined:

<family>LilyPond Serif</family>
<prefer>
  <!-- Ghostscript (URW) font:
       gs 9.20+ includes Greek and Cyrillic glyphs. -->
  <family>C059</family>                   <!-- gs 9.20 -->
  <family>Century SchoolBook URW</family> <!-- gs 9.16 -->
  <family>Century Schoolbook L</family>   <!-- gs 9.15, 9.18, 9.19 -->
  <!-- TeX Gyre Schola:
       Latin glyphs only. Has some issues with certain characters but 
       is a good fallback, mostly for Vietnamese to match URW. -->
  <family>TeX Gyre Schola</family>
<!-- Substitute font:
     Most Unicode Glyphs except CJK are included. -->
<family>DejaVu Serif</family>
<!-- Substitute font for Japanese, which gets used for 
     building LilyPond's documentation.

     Debian GNU/Linux, Ubuntu:
         Noto Serif CJK JP in fonts-noto-cjk package
     Red Hat Fedora:
         Noto Serif JP in google-noto-serif-jp-fonts package -->
  <family>Noto Serif CJK JP</famliy>
  <family>Noto Serif JP</family>
</prefer>
<default>
  <!-- Fontconfig default serif font alias:
       For CJK glyphs etc. -->
  <family>serif</family>
</default>
0

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.