Le mardi 25 avril 2023 à 14:12 +0200, Jakob Pedersen a écrit : > Hello! > > I'm trying to change the fonts of my scores. It's a \book consisting of > several bookparts with a single \paper block. > > I've sent a new roman font using this in the \paper block: > > #(define fonts > (set-global-fonts > #:roman "Libertinus Serif" > #:factor (/ staff-height pt 18) > )) > > I have two questions that I couldn't find an answer to in the documentation. > > > 1) How do I apply openfont features globally and not in individual markup > blocks?
Use
```
\paper {
text-font-defaults.font-features = #'("feature1" "feature2" ...)
}
```
> 2) How do I make a global change of the font used for lyrics? I assumed it
> would change with the roman font, but they didn't.
Could you give an example? For me, this works, printing lyrics in Libertinus:
```
\version "2.24.1"
\paper {
#(define fonts
(set-global-fonts
#:roman "Libertinus Serif"
#:factor (/ staff-height pt 20)
))
}
{ c' }
\addlyrics { aah }
```
One thing that could be the cause is `set-global-staff-size` or
`layout-set-staff-size` if you use one of those; they reset the fonts, so you
have to restate the `#(define fonts ...)` command after them. This quirk has
been fixed in the freshly released unstable version 2.25.4, by the way.
Also, why `#:factor (/ staff-height pt 18)` ? You would normally use `#:factor
(/ staff-height pt 20)`, any other value desynchronizes the size of the music
glyphs from that of the staves... (Which is why the 2.25.4 syntax does not take
a #:factor parameter.)
Best,
Jean
signature.asc
Description: This is a digitally signed message part
