Re: [large/complex projects] conditional header values and/or book name

2024-01-23 Thread Sam Speer
Kieren,

I'm not sure if this fits under your umbrella of having a single top level
file, but what about this?

 song-FV.ly
definedVariables = data
\include song.ily

 song-SV.ly
definedVariables = data
\include song.ily

 song.ily
\include [.ily files containing the notes, edition-engraver tweaks, etc.]

\header {
  [header parameters shared by both versions]
  [differing header parameters defined in global variables]
}

\score {
  [contexts built from variables defined in \include-d files]
}


Optionally, you could use the output names and book blocks so that you can
compile the whole work from a FullVersion.ly and ShortVersion.ly which are
basically a series of includes of the applicable songs.

Hope some of these ideas help or at least spark others,
Sam


Feta optical sizes

2022-12-05 Thread Sam Speer
Dear list,

I'd like to create a heavier/thicker look for some of my engravings, and
one way which might work nicely is to bump up the optical weight of the
feta font.

For example, I'd like to have a staff size of 16 or 17, but use feta14 or
feta11.

But I can't seem to find how to do this. Searching through the manuals for
font information, one finds mostly information about text fonts, or
sometimes how to adjust the notation font size with macros like \tiny. I
don't want the noteheads or other objects to be smaller though -- just to
use the glyphs from the thicker font weight. Another macro which doesn't
seem to apply is \magnifyMusic which adjusts everything, including the
staff.

I'm fine adjusting all of the other lines (staff, beams, stems, barlines,
ledger lines) myself; those are straightforward. It's just this font swap
which I can't figure out.

I'd like to do something like this:

\paper {
  #(define fonts
(set-global-fonts
 #:music "emmentaler-14" ; font filename without suffix and extension
 #:brace "emmentaler-14" ; font filename without suffix and extension
   ))
}

But as you can see from the comment, you are not supposed to include the
suffix and in fact this code doesn't work. You have to set the global font
as a whole "family" as it were. Besides, if I did this, I wouldn't be able
to have smaller staves for some instruments and use a heavier weight for
just that staff.

One workaround that I've thought of is to calculate a smaller page size and
staff size which would blow up to my desired dimensions, but I'd like to
avoid that if possible. Another solution which Urs and Janek used for their
Fried score was to marginally increase the font size of each score item by
custom amounts, trying to create glyphs which still look like they "fit" in
the staff but were a bit bolder. A third workaround that occurs to me is to
create an "EmmentalerTwo" font which just transposes the weights the way
I'd like. So you can see that I'm able to workaround if necessary. I'm only
wondering if there is a simpler code-based way which I am not finding.

Here are some of the pages I've consulted that are most relevant:
https://lilypond.org/doc/v2.22/Documentation/essay/engraving-details#optical-sizing
https://lilypond.org/doc/v2.21/Documentation/notation/setting-the-staff-size
(auto font weight section)
https://lilypond.org/doc/v2.21/Documentation/notation/replacing-the-notation-font
https://github.com/openlilylib/snippets/blob/master/fried-library-to-be-sorted/lied-stylesheet.ily