lilypond-devel
[Top][All Lists]
Advanced

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

Re: See the new music fonts in action


From: Alexander Kobel
Subject: Re: See the new music fonts in action
Date: Fri, 01 Aug 2014 23:51:02 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0

On 08/01/2014 09:46 PM, Abraham Lee wrote:
On Thu, Jul 31, 2014 at 12:07 PM, Urs Liska <address@hidden> wrote:
Or send me the latest version of the file. Urs

Urs,

Here's the newest version of "font.scm". I decided to create my own
function after all so that make-pango-font-tree (at least from the
user's perspective) follows the same syntax, it is only changed under
the covers. I'm sure this will trip people up, though, so we'll need to
discuss an appropriate solution for that. It doesn't make much sense to
me to have all these different functions available that all kind of do
the same thing, but behave slightly different from each other. That will
only confuse people.

The function "add-music-fonts" still needs to be modified for all this
to work.

I call my function (drum roll, please...): "set-global-fonts". It's
different in that ALL the font choices are optional, keyword arguments.

Abraham, Urs,

that's great. Again, not much time now, but I had a quick look and it seems that this is not only a perfectly clean approach, but also that I can integrate the new text font selection easily. The only part I want to figure out is whether it is possible to change the font tree after initial setting, so that a user can write his own stylesheet commands for different music fonts, header fonts, lyric fonts etc. and plug them together without rewriting the entire command set for each and every combination of fonts. Maybe it suffices to simply expose add-*-fonts or add-*-node to the public and/or give corresponding replace-or-add functions.

Thus, if I only want to change the notation font, that's all I need to
specify. Here's a minimal example showing all the optional, keyword
arguments (and you can't just put in the string values! They MUST be
preceded by the key identifier, but any and all can be omitted):

\version "2.18.2"
\include "english.ly"

\paper {
   #(define fonts
      (set-global-fonts
       #:music "lilyjazz"
       #:brace "gonville"
       #:roman "lilyjazztext"
       #:sans "FreeSans"
       #:typewriter "Inconsolata"
       #:factor 1 ; should this EVER NOT be 1?
    ))
}

factor is relevant if you set the global staff size to something different than 20, the default. The usual rule-of-tree used to be something like
  myStaffSize = #17.82
  #(set-global-staff-size myStaffSize)
  #(define fonts (make-pango-font-tree ... (/ myStaffSize 20)))

BTW, I never really understood whether it is technically possible to automatically figure out "factor" at the point where make-pango-font-tree is called? If not, why? And if yes, is there any reason why it is not done?


Best,
Alexander



reply via email to

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