lilypond-devel
[Top][All Lists]
Advanced

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

Re: Question about customizing emmentaler font


From: tisimst
Subject: Re: Question about customizing emmentaler font
Date: Sat, 3 May 2014 09:37:12 -0700 (PDT)

All,

I have thoroughly enjoyed our discussion here. I finally figured out what
was the real problem with the dynamics and numbers not printing in the right
font. Here's what I found:

In fontforge, there are three places to put a font name (/Fontname/, /Family
Name/, and /Name For Humans/), like: 

<http://lilypond.1069038.n5.nabble.com/file/n162033/fontforge-font-information-snapshot.png>
 

Although the font I created worked fine for the notation elements, pango is
used to get the text elements (which is used for all the numbers, dynamics,
and any other text) and it was looking for a font from the family
"cadence-XX", which didn't technically exist because it looks at the /Family
Name/ field in the font and not the others, apparently. I didn't realize
that I was simply putting "cadence" in that field while I put "cadence-XX"
in the other two.

So, now, I changed my script to now put the same font name "cadence-XX" in
each field, and--POOF!--everything works now! I am having a blast.

To top it off, as I was trying to figure this out, I got to looking through
all the source code and discovered a way to make emmentaler, gonville, and
cadence (or any font that supports the LILY, LILC, and LILF subtables) all
usable without any funny renaming business and without overwriting the
emmentaler font. They can all reside in the same ".../fonts/otf/" LilyPond
folder and be applied to the whole document, just like we could already do
with any text font. 

This is done by modifying two functions (/make-pango-font-tree/ and
/add-music-fonts/) in ".../scm/font.scm" of the LilyPond install directory,
which fortunately can be done without updating the binary. Also, to handle
the default values, the function /make-century-schoolbook-tree/ also needed
to be updated with the new syntax. These are all in "font.scm", which is
nice.

I've attached the updated "font.scm" file for those interested in trying it.
It also works for picking a different brace set (i.e., you can mix
emmentaler's notation with gonville's braces), since I didn't want to create
a font for the braces too.

Once "font.scm" is replaced with the updated one, the following should work
in place of the usual way of  changing entire document fonts
<http://lilypond.org/doc/v2.18/Documentation/notation/fonts#entire-document-fonts>
 
:

\paper {
  #(define fonts 
    (make-pango-font-tree
      "cadence"  ; this is for the notation font
      "gonville"  ; this is for the brace font
      "Century Schoolbook L"
      "sans"
      "monospace"
      (/ staff-space pt 20)))
}

Here's a sample of what this can do (using LilyPond 2.18.2):

<http://lilypond.1069038.n5.nabble.com/file/n162033/mixed-font-example-large.png>
 

Anyway, just thought I'd share. I've only tried it on linux, but I can't
imagine that I'm doing anything that would break another OS if the proper
font files were there. This doesn't have to be included in the main source
code, but it wouldn't be hard to include either for those who would like to
change the notation font more easily. Enjoy!

Regards,
Abraham

font.scm <http://lilypond.1069038.n5.nabble.com/file/n162033/font.scm>  



--
View this message in context: 
http://lilypond.1069038.n5.nabble.com/Question-about-customizing-emmentaler-font-tp161702p162033.html
Sent from the Dev mailing list archive at Nabble.com.



reply via email to

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