[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 19:41:02 +0100 |
Hello John,
this property is not documented (yet, but Werner just opened an issue for
this), so the only real way to understand this behaviour is to look at the
right places in the source code.
So let’s look in the source code where font-features is actually used: You’ll
arrive at Text_interface::interpret_string in text-interface.cc. Here we have
the line
SCM features
= ly_chain_assoc_get (ly_symbol2scm ("font-features"), props, SCM_BOOL_F);
So we pull the value from the props. So where do the props come from? If we
look where interpret_string is used we find
Text_interface::internal_interpret_markup
which is used in
Text_interface::interpret_markup
which is used in
Text_interface::internal_print
Now internal_print does use
Font_interface::text_font_alist_chain (me);
for props. So we take a look at Font_interface::text_font_alist_chain and find
SCM defaults
= g->layout ()->lookup_variable (ly_symbol2scm ("text-font-defaults"));
so we look up the value of "text-font-defaults" in the layout of the grob. The
dafault value of this is defined in the most global layout, which is the top
level paper block. This is done in ly/paper-defaults-init.ly:
#(define text-font-defaults
`((font-encoding . latin1)
(baseline-skip . 3)
(replacement-alist . ())
(string-transformers . (,ly:perform-text-replacements))
(word-space . 0.6)))
Cheers,
Valentin
Am Montag, 27. Februar 2023, 19:14:15 CET schrieb John Zaitseff:
> Hi, everyone (especially Jean),
>
> Thanks for all your replies -- most helpful.
>
> > > In short, is there a way to set "ss03" globally?
> >
> > This should do:
> >
> > ```
> > \paper {
> >
> > text-font-defaults.font-features = #'("ss03")
> >
> > }
> > ```
>
> This was exactly what I was looking for -- I've tested it and it
> works.
>
> FYI, before writing to this list I did do multiple Google searches,
> as well as a search of the LilyPond source code, and I couldn't find
> any references to this, at least in regard to font-features.
>
> So, thanks: you've all saved me a lot of tearing of the hair! :-)
>
> Yours truly,
>
> John Zaitseff
signature.asc
Description: This is a digitally signed message part.