lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting font-features globally?


From: Valentin Petzel
Subject: Re: Setting font-features globally?
Date: Mon, 27 Feb 2023 16:31:04 +0100

Hello Jean,

yes, did not think about that. Doing is your way is better anyway ...

Regarding the \with-font-feature-Part: I think I had some discussion on the 
list wrt this a long time ago. Would you think it would make sense to provide 
this (or a similar function) to Lilypond? Usually people actually using 
Opentype features use this in a sort of toggle-like manner, so I think this 
would be useful.

Cheers,
Valentin

Am Montag, 27. Februar 2023, 14:11:56 CET schrieb Jean Abou Samra:
> Le lundi 27 février 2023 à 13:53 +0100, Valentin Petzel a écrit :
> > Hello John,
> > 
> > you can do this by setting this in the default props:
> > 
> > \paper {
> >     #(define fonts
> >         (set-global-fonts
> >             #:roman      "Linux Libertine"
> >             #:factor (/ staff-height pt 20)
> >         ))
> >     text-font-defaults = #(assoc-set! text-font-defaults 'font-features
> > '("smcp"))
> 
> `assoc-set!` here is a bad idea imho because it will mutate the original.
> You can see this in
> 
> ```
> \version "2.24.1"
> 
> \paper {
>     text-font-defaults = #(assoc-set! text-font-defaults 'font-features
> '("smcp")) #(define fonts
>         (set-global-fonts
>             #:roman      "Linux Libertine"
>             #:factor (/ staff-height pt 20)
>         ))
> }
> 
> \bookpart {
>   \markup "abc" % no small caps because of bleedover from next \bookpart
> }
> 
> \bookpart {
>   \paper {
>     text-font-defaults = #(assoc-set! text-font-defaults 'font-features #f)
>  }
>   \markup "abc"
> }
> ```
> 
> You could use `(assoc-set! (alist-copy text-font-defaults) ...)`, but
> LilyPond's nested assignment syntax `text-font-defaults.font-features =
> ...` is just as convenient (as in my first reply shortly before yours).

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]