Re: Setting font-features globally?

2023-02-27 Thread 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

-- 
John Zaitseff   ╭───╮   Email: j.zaits...@zap.org.au
The ZAP Group   │ Z │   GnuPG: 0x0D254111C4EE569B
Australia Inc.  ╰───╯   https://www.zap.org.au/~john/



Setting font-features globally?

2023-02-27 Thread John Zaitseff
Hello,

I have a fairly large collection of LilyPond music scores that I
have entered over the years.  Now that I have access to the rather
nice Adobe Minion 3 set of fonts, I would like to use them for my
scores.  I have successfully included the following in my
stylesheet:

  \paper {
  #(define fonts
  (set-global-fonts
  #:roman  "Minion 3,"
  #:sans   "Myriad Pro,"
  #:typewriter "Hack,"
  #:factor (/ staff-height pt 20)
  ))
  }

However, I'd like to use the SS03 font feature of Minion 3
(trapezoid variants of Cyrillic DE and EL [1]) everywhere that text
appears.  Is this possible?  If so, how?  I don't mind writing
Scheme to do it!

[1] https://minion.typekit.com/usage/

I know I can do something like:

  \layout {
  \context { \Lyrics \override LyricText.font-features = #'("ss03") }
  # ... every other context / text variation here
  }

but this misses headings, page headers and footers and verse text
typeset after a score.

In short, is there a way to set "ss03" globally?

Yours truly,

John Zaitseff

-- 
John Zaitseff   ╭───╮   Email: j.zaits...@zap.org.au
The ZAP Group   │ Z │   GnuPG: 0x0D254111C4EE569B
Australia Inc.  ╰───╯   https://www.zap.org.au/~john/



Re: Problems defining a BraceStaff

2008-02-29 Thread John Zaitseff
Dear LilyPonders,

Mats wrote:

  The question is: how do I define a BraceStaff that is exactly like a
  ChoirStaff, except that braces are used instead of brackets at the
  start of systems?  In particular, I tried to define the following in my
  stylesheet (which gets included into all my documents):
 
\layout {
\context {
\type Engraver_group
\name BraceStaff
\alias ChoirStaff
% [...]
\consists System_start_delimiter_engraver
systemStartDelimiter = #'SystemStartBrace
}
}

 It seems that you forgot to include your new context into the context
 hieararchy, see section Defining new contexts in the manual for
 instructions on how to do that using the \accepts keyword.

Oops!  I've redefined it as:

  \layout {
  \context {
  \name BraceStaff
  \type Engraver_group
  \alias ChoirStaff
  \consists System_start_delimiter_engraver
  systemStartDelimiter = #'SystemStartBrace
  }

  \context {
  \Score
  \accepts BraceStaff
  }
  }

LilyPond now finds the definition correctly, but it still doesn't use 
SystemStartBrace.  My main \score block is of the form:

  \score {
  \new BraceStaff 

\new Staff = upper 
% [...]

\new Staff = lower 
% [...]

  

  \layout {
  }
  }

If I replace BraceStaff with ChoirStaff \with { systemStartDelimiter = 
#'SystemStartBrace }, it all just works.  And putting the line containing
\alias to end of the context doesn't help.

What am I doing wrong?  I can't help but think it must be fairly simple...  
Thanks in advance!

Yours truly,

John Zaitseff

-- 
John Zaitseff,--_|\The ZAP Group
Phone:  +61 2 9643 7737 /  \   Sydney, Australia
E-mail: [EMAIL PROTECTED]   \_,--._*   http://www.zap.org.au/
  v


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Problems defining a BraceStaff

2008-02-29 Thread John Zaitseff
Dear Mats / other LilyPonders,

Mats wrote:
 Do you want both the default ChoirStaff and the BraceStaff in the same
 score (or in the same .ly file)?

Yes, I do.  The solution you had suggested (redefining the ChoirStaff 
context) had already occurred to me...

 Otherwise, I think you only included your new context type halfway into
 the context hieararchy.  You also have to tell which contexts are accepted
 within your new context.

 Actually, instead of creating a new context from scratch, as you have
 attempted to do, it's often easier to use an existing context type as a
 starting point, for example [... cut ...]

Thanks, your comments gave me the hints I needed, as demonstrated below.

 If you haven't already looked in the file ly/engraver-init.ly, I recommend
 you to do so. It's the best way to understand how these things really
 work.

I indeed have looked into this file (and the related ly/performer-init.ly), 
although, as you mentioned, the default definition of ChoirStaff is a bit 
complicated.

In the end, I came up with the following, which seems to work for me:

  \layout {
  \context {
  \GrandStaff
  \name BraceStaff
  \type Engraver_group
  \alias ChoirStaff

  \remove Span_bar_engraver
  \remove Span_arpeggio_engraver

  \accepts Staff
  \accepts FiguredBass
  \accepts TabStaff
  \accepts Lyrics
  \accepts ChordNames

  \description
Just like @code{ChoirStaff} but with a brace
 (@code{SystemStartBrace}) instead of a bracket
 (@code{SystemStartBracket}) at the start of each system.
  }

  \context {
  \Score
  \accepts BraceStaff
  }
  }

  \midi {
  \context {
  \GrandStaff
  \name BraceStaff
  \type Performer_group
  \alias ChoirStaff
  }

  \context {
  \Score
  \accepts BraceStaff
  }
  }

Once again, thank you for all your help!

Yours truly,

John Zaitseff

-- 
John Zaitseff,--_|\The ZAP Group
Phone:  +61 2 9643 7737 /  \   Sydney, Australia
E-mail: [EMAIL PROTECTED]   \_,--._*   http://www.zap.org.au/
  v


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Problems defining a BraceStaff

2008-02-28 Thread John Zaitseff
Dear LilyPond users,

I have searched the LilyPond documentation, lilypond-user mailing list 
archives and the LilyPond snippet repository---all without success...

The question is: how do I define a BraceStaff that is exactly like a 
ChoirStaff, except that braces are used instead of brackets at the start of 
systems?  In particular, I tried to define the following in my stylesheet 
(which gets included into all my documents):

  \layout {
  \context {
  \type Engraver_group
  \name BraceStaff
  \alias ChoirStaff

  \description
Just like @code{ChoirStaff} but with a brace (SystemStartBrace)
 instead of a bracket (SystemStartBraclet) at the start of
 each system.

  \consists System_start_delimiter_engraver
  systemStartDelimiter = #'SystemStartBrace
  }
  }

  \midi {
  \context {
  \type Performer_group
  \name BraceStaff
  \alias ChoirStaff
  }
  }

When compiling a file with these lines, LilyPond 2.10.33 does not complain 
about the definitions, but it DOES complain that it cannot find them:

  warning: can't find or create new `BraceStaff'

I'm attaching a sample LilyPond document to illustrate this problem.  Any 
help is appreciated, as this little problem has already taken rather a lot 
of hours of my time... :-)

Yours truly,

John Zaitseff

-- 
John Zaitseff,--_|\The ZAP Group
Phone:  +61 2 9643 7737 /  \   Sydney, Australia
E-mail: [EMAIL PROTECTED]   \_,--._*   http://www.zap.org.au/
  v
%
%   %
%   How Deep the Father's Love For Us   %
%   %
%

% $Id: empty.ly 91 2007-08-24 11:59:14Z john $


\version 2.10.33  % LilyPond language version

global =
{
\key e \major
\time 4/4

\autoBeamOff
}

mainChords =
\chordmode {
  e1 | fis1:m |
}

upperPianoNotes =
\relative c'' {
  e1 | fis1 |
}

upperPianoAltNotes =
\relative c'' {
  e,2 dis | fis1 |
}

lowerPianoNotes =
\relative c {
  e1 | fis1 |
}


% Generate the actual music score

\layout {
\context {
\type Engraver_group
\name BraceStaff
\alias ChoirStaff

\description
Just like @code{ChoirStaff} but with a brace (SystemStartBrace)
 instead of a bracket (SystemStartBraclet) at the start of
 each system.

\consists System_start_delimiter_engraver
systemStartDelimiter = #'SystemStartBrace
}
}

\midi {
\context {
\type Performer_group
\name BraceStaff
\alias ChoirStaff
}
}

\score {
\new BraceStaff 
%@@@\new ChoirStaff \with { systemStartDelimiter = #'SystemStartBrace } 

\new ChordNames = chords 
{ \global }
{ \mainChords }


\new Staff = upper 
\clef treble
\new Voice = upperPiano 
{ \voiceOne \global }
{ \voiceOne \upperPianoNotes}

\new Voice = upperPianoAlt 
{ \voiceTwo \global }
{ \voiceTwo \upperPianoAltNotes }



\new Staff = lower 
\clef bass
\new Voice = lowerPiano 
{ \oneVoice \global }
{ \oneVoice \lowerPianoNotes}




\layout {
}

\midi {
}
}
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Scheme code for extracting LilyPond header properties?

2007-10-08 Thread John Zaitseff
Dear Nicolas / LilyPonders,

Nicolas Sceaux wrote:

 John Zaitseff writes:
 
  [...]  What I would like to do, however, is to replace the
  \fromproperty #'header:maintainer with something like:
 
  \with-url #mailto:[EMAIL PROTECTED]
  \fromproperty #'header:maintainer
 
  except that I would like to extract the actual e-mail address
  from header:maintainerEmail: something like:
 
  \with-url #(string-append mailto:; XXX)
 
 Ok so basicaly you want a \email-property markup command that
 looks for a header property and outputs something equivalent to:
 
   \with-url #mailto:...; ...
 
 [ Actual detailed explanation follows... ]

Thank you very much for your help!  I actually wrote the function
to take the header:maintainer AND header:maintainerEmail properties
into account:

  % \email-property EMAIL ARG - add a mailto link based on property EMAIL
  #(define-markup-command (email-property layout props email arg)
  (symbol? markup?)
  Add a mailto link to property @var{email} around @var{arg}.
  This only works in the PDF backend.
  (let* ((address (chain-assoc-get email props)))
  (interpret-markup layout props
  (if (string? address)
  (markup #:with-url (string-append mailto:; address) arg)
  arg

For other people's edification :-), the following is my tagline:

  tagline = \markup {
  \fontsize #-3.5
  \override #'(word-space . 0)
  \line {
  Typeset by 
  \email-property #'header:maintainerEmail
  \fromproperty #'header:maintainer
   using 
  \with-url #http://www.lilypond.org/;
  \line {
  LilyPond 
  #(ly:export (string-append (lilypond-version) .))
  }
File version 
  \fromproperty #'header:version
  , last modified 
  \parsed-date #'header:lastupdated
  .
  }
  }

I store a field in the header, lastupdated, in the form 09-Oct-2007;
the \parsed-date function converts that to something like 9 October,
2007:

  % \parsed-date DATE - convert a DD-MMM- property to a fully printed date
  #(define-markup-command (parsed-date layout props date) (symbol?)
  Convert the property @var{date} containing a date in the
  form DD-MMM- into a nicely formatted stencil output D ,
  .
  (let* ((datestr (chain-assoc-get date props)))
  (interpret-markup layout props
  (if (string? datestr)
  (markup #:simple
  (strftime %e %B, %Y (car (strptime %d-%b-%Y 
datestr
  datestr

(Of course, I should rewrite that to make it somewhat more robust.
It works for me, however).


Once again, thank you for your help.

Yours truly,

John Zaitseff

-- 
John Zaitseff,--_|\The ZAP Group
Phone:  +61 2 9643 7737 /  \   Sydney, Australia
E-mail: [EMAIL PROTECTED]   \_,--._*   http://www.zap.org.au/
  v


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Method of including PDF document information in LilyPond files?

2007-10-02 Thread John Zaitseff
Dear LilyPonders,

Is there a way to include PDF metainfo (document information) in LilyPond
documents?  For example, I would like to do something like the following:

\header {
title = Test title
subject = Description of title
maintainer = John Zaitseff
}

and then have LilyPond and/or my own Scheme code generate the following
pdfmark PostScript to be included in the output PS file:

[
/Title (Test title)
/Subject (Description of title)
/Author (John Zaitseff)
/DOCINFO
pdfmark

Of course, I'd like the actual contents of the pdfmark output to be
generated from the header:title, header:subject and header:maintainer
properties.

Yours truly,

John Zaitseff

-- 
John Zaitseff,--_|\The ZAP Group
Phone:  +61 2 9643 7737 /  \   Sydney, Australia
E-mail: [EMAIL PROTECTED]   \_,--._*   http://www.zap.org.au/
  v


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Scheme code for extracting LilyPond header properties?

2007-10-02 Thread John Zaitseff
Dear LilyPonders,

I am not a particular expert on Scheme, hence my request for help.
I am trying to write a new version of tagline that includes the
particular document maintainer's name and e-mail address.  Thus, I
have the following in my header:

\header {
...
maintainer = John Zaitseff
maintainerEmail = [EMAIL PROTECTED]
}

and I redefine tagline as:

tagline = \markup {
\teeny
\override #'(word-space . 0)
\line {
% [... other information ...]
Document maintained by 
\fromproperty #'header:maintainer
.
}
}

So far, so good.  What I would like to do, however, is to replace
the \fromproperty #'header:maintainer with something like:

\with-url #mailto:[EMAIL PROTECTED]
\fromproperty #'header:maintainer

except that I would like to extract the actual e-mail address from
header:maintainerEmail: something like:

\with-url #(string-append mailto:; XXX)

It's the XXX that I'm having problems with!  How do I extract the
header:maintainerEmail property as a Scheme string?  Any help would
be much appreciated!

Yours truly,

John Zaitseff

-- 
John Zaitseff,--_|\The ZAP Group
Phone:  +61 2 9643 7737 /  \   Sydney, Australia
E-mail: [EMAIL PROTECTED]   \_,--._*   http://www.zap.org.au/
  v


___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user